1 (*.(c) by Richard Lang, 2003 .*)
2 (* defines equation and univariate-equation
10 (* use_thy_only"Knowledge/Equation";
11 use_thy"Knowledge/Equation";
12 use"Knowledge/Equation.ML";
16 theory' := overwritel (!theory', [("Equation.thy",Equation.thy)]);
18 val univariate_equation_prls =
19 append_rls "univariate_equation_prls" e_rls
20 [Calc ("Tools.matches",eval_matches "")];
22 overwritelthy thy (!ruleset',
23 [("univariate_equation_prls",
24 prep_rls univariate_equation_prls)]);
28 (prep_pbt Equation.thy "pbl_equ" [] e_pblID
30 [("#Given" ,["equality e_","solveFor v_"]),
31 ("#Where" ,["matches (?a = ?b) e_"]),
32 ("#Find" ,["solutions v_i_"])
34 append_rls "equation_prls" e_rls
35 [Calc ("Tools.matches",eval_matches "")],
36 SOME "solve (e_::bool, v_)",
40 (prep_pbt Equation.thy "pbl_equ_univ" [] e_pblID
41 (["univariate","equation"],
42 [("#Given" ,["equality e_","solveFor v_"]),
43 ("#Where" ,["matches (?a = ?b) e_"]),
44 ("#Find" ,["solutions v_i_"])
46 univariate_equation_prls,SOME "solve (e_::bool, v_)",[]));
49 (*.function for handling the cas-input "solve (x+1=2, x)":
50 make a model which is already in ptree-internal format.*)
51 (* val (h,argl) = strip_comb (str2term "solve (x+1=2, x)");
52 val (h,argl) = strip_comb ((term_of o the o (parse thy))
53 "solveTest (x+1=2, x)");
55 fun argl2dtss [Const ("Pair", _) $ eq $ bdv] =
56 [((term_of o the o (parse thy)) "equality", [eq]),
57 ((term_of o the o (parse thy)) "solveFor", [bdv]),
58 ((term_of o the o (parse thy)) "solutions",
59 [(term_of o the o (parse thy)) "L"])
61 | argl2dtss _ = raise error "Equation.ML: wrong argument for argl2dtss";
65 [((term_of o the o (parse thy)) "solveTest",
66 (("Test.thy", ["univariate","equation","test"], ["no_met"]),
68 ((term_of o the o (parse thy)) "solve",
69 (("Isac.thy", ["univariate","equation"], ["no_met"]),
76 (prep_met Equation.thy "met_equ" [] e_metID
79 {rew_ord'="tless_true", rls'=Erls, calc = [],
82 crls = Atools_erls, nrls = e_rls},