more antiquotations for Isabelle/HOL consts/types, without change of semantics;
1 (* equations and functions; functions NOT as lambda-terms
2 author: Walther Neuper 2005, 2006
3 (c) due to copyright terms
6 theory Equation imports Base_Tools begin
8 text \<open>univariate equations over terms :
9 In 2003 Richard Lang prototyped ISAC's equation solver while also alpha-testing
10 the Lucas-Interpreter's Subproblem mechanism.
11 This prototype suffers from the drop-out of Matthias Goldgruber for a year,
12 who had started to work on simplification in parallel. So this implementation
13 replaced simplifiers by many specific theorems for specific terms in specific
14 phases of equation solving; these specific solutions wait for generalisation
15 in future improvements of ISAC's equation solver.
20 (*descriptions in the related problems TODOshift here from Descriptions.thy*)
21 substitution :: "bool => una"
24 solve :: "[bool * 'a] => bool list" (* solve (x+1=2, x) *)
25 solveTest :: "[bool * 'a] => bool list" (* for test collection *)
27 text \<open>defines equation and univariate-equation
33 (c) by Richard Lang, 2003\<close>
36 val univariate_equation_prls =
37 Rule_Set.append_rules "univariate_equation_prls" Rule_Set.empty
38 [\<^rule_eval>\<open>Prog_Expr.matches\<close> (Prog_Expr.eval_matches "")];
40 rule_set_knowledge univariate_equation_prls = \<open>Auto_Prog.prep_rls @{theory} univariate_equation_prls\<close>
42 problem pbl_equ : "equation" =
43 \<open>Rule_Set.append_rules "equation_prls" Rule_Set.empty
44 [\<^rule_eval>\<open>Prog_Expr.matches\<close> (Prog_Expr.eval_matches "")]\<close>
45 CAS: "solve (e_e::bool, v_v)"
46 Given: "equality e_e" "solveFor v_v"
47 Where: "matches (?a = ?b) e_e"
48 Find: "solutions v_v'i'"
50 problem pbl_equ_univ : "univariate/equation" =
51 \<open>univariate_equation_prls\<close>
52 CAS: "solve (e_e::bool, v_v)"
53 Given: "equality e_e" "solveFor v_v"
54 Where: "matches (?a = ?b) e_e"
55 Find: "solutions v_v'i'"
58 (*.function for handling the cas-input "solve (x+1=2, x)":
59 make a model which is already in ctree-internal format.*)
60 (* val (h,argl) = strip_comb (str2term "solve (x+1=2, x)");
61 val (h,argl) = strip_comb ((Thm.term_of o the o (parse thy))
62 "solveTest (x+1=2, x)");
64 fun argl2dtss [Const (\<^const_name>\<open>Pair\<close>, _) $ eq $ bdv] =
65 [((the o (TermC.parseNEW \<^context>)) "equality", [eq]),
66 ((the o (TermC.parseNEW \<^context>)) "solveFor", [bdv]),
67 ((the o (TermC.parseNEW \<^context>)) "solutions",
68 [(the o (TermC.parseNEW \<^context>)) "L"])
70 | argl2dtss _ = raise ERROR "Equation.ML: wrong argument for argl2dtss";
72 setup \<open>KEStore_Elems.add_cas
73 [((Thm.term_of o the o (TermC.parse @{theory})) "solveTest",
74 (("Test", ["univariate", "equation", "test"], ["no_met"]), argl2dtss)),
75 ((Thm.term_of o the o (TermC.parse @{theory})) "solve",
76 (("Isac_Knowledge", ["univariate", "equation"], ["no_met"]), argl2dtss))]\<close>
78 method met_equ : "Equation" =
79 \<open>{rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty, crls = Atools_erls,
80 errpats = [], nrls = Rule_Set.empty}\<close>