no \<^isac_test> guard for test material: thus the Prover IDE does not have to switch the option "isac_test";
2 imports "Isac.Build_Isac"
5 ML \<open>open ML_System\<close>
9 open Test_Code; CalcTreeTEST;
10 open LItool; arguments_from_model;
18 open Error_Pattern_Def;
20 open Ctree; append_problem;
26 open Auto_Prog; rule2stac;
33 open Solve; (* NONE *)
34 open ContextC; transfer_asms_from_to;
35 open Tactic; (* NONE *)
38 open P_Model; (* NONE *)
43 open Rule_Set; Sequence;
51 ML_file "BridgeJEdit/parseC.sml"
53 section \<open>code for copy & paste ===============================================================\<close>
55 "~~~~~ fun xxx , args:"; val () = ();
56 "~~~~~ and xxx , args:"; val () = ();
57 "~~~~~ from fun xxx \<longrightarrow>fun yyy \<longrightarrow>fun zzz , return:"; val () = ();
58 (*if*) (*then*); (*else*); (*case*) (*of*); (*return from xxx*);
60 ^ "xxx" (*+*) (*!for return!*) (*isa*) (*REP*) (**)
61 (*/------------------- step into XXXXX -----------------------------------------------------\*)
62 (*-------------------- stop step into XXXXX -------------------------------------------------*)
63 (*\------------------- step into XXXXX -----------------------------------------------------/*)
64 (*-------------------- contiue step into XXXXX ----------------------------------------------*)
65 (*/------------------- check entry to XXXXX ------------------------------------------------\*)
66 (*\------------------- check entry to XXXXX ------------------------------------------------/*)
67 (*/------------------- check within XXXXX --------------------------------------------------\*)
68 (*\------------------- check within XXXXX --------------------------------------------------/*)
69 (*/------------------- check result of XXXXX -----------------------------------------------\*)
70 (*\------------------- check result of XXXXX -----------------------------------------------/*)
72 (*/------------------- build new fun XXXXX -------------------------------------------------\*)
73 (*\------------------- build new fun XXXXX -------------------------------------------------/*)
81 declare [[show_types]]
82 declare [[show_sorts]]
83 find_theorems "?a <= ?a"
89 ML_command \<open>Pretty.writeln prt\<close>
90 declare [[ML_print_depth = 999]]
91 declare [[ML_exception_trace]]
94 section \<open>====== ML_file "MathEngBasic/thmC.sml" ============================================\<close>
97 "----------- fun revert_sym_rule ---------------------------------------------------------------";
98 "----------- fun revert_sym_rule ---------------------------------------------------------------";
99 "----------- fun revert_sym_rule ---------------------------------------------------------------";
100 "~~~~~ fun revert_sym_rule , args:"; val (thy, (Rule.Thm (id, thm))) =
101 (@{theory Isac_Knowledge},
102 Thm ("sym_real_mult_minus1", ThmC.numerals_to_Free (@{thm real_mult_minus1} RS @{thm sym})));
104 if id = "sym_real_mult_minus1" andalso ThmC.string_of_thm thm = "- ?z1 = -1 * ?z1" then ()
105 else error "input to revert_sym_rule CHANGED";
108 (*if*) is_sym (cut_id id) (*then*);
110 val id' = id_drop_sym id
112 val thm' = thm_from_thy thy id'
114 val id'' = Thm.get_name_hint thm'
116 val thy = @{theory Isac_Knowledge}
117 val (Thm (thmID, thm)) = ThmC.revert_sym_rule thy
118 (Thm ("sym_real_mult_minus1", ThmC.numerals_to_Free (@{thm real_mult_minus1} RS @{thm sym})))
120 if thmID = "Poly.real_mult_minus1" andalso ThmC.string_of_thm thm = "-1 * ?z = - ?z"
121 then () else error "fun revert_sym_rule changed 1";
123 val (Thm (thmID, thm)) = ThmC.revert_sym_rule thy
124 (Thm ("real_diff_minus", ThmC.numerals_to_Free @{thm real_diff_minus}))
126 if thmID = "Root.real_diff_minus" andalso ThmC.string_of_thm thm = "?a - ?b = ?a + -1 * ?b"
127 then () else error "fun revert_sym_rule changed 2"
139 section \<open>=========== ML_file "BridgeLibisabelle/thy-hierarchy.sml" ======================\<close>
143 "----------- fun ThmC_Def.make_thm ------------------------------------";
144 "----------- fun ThmC_Def.make_thm ------------------------------------";
145 "----------- fun ThmC_Def.make_thm ------------------------------------";
146 "~~~~~ fun ThmC_Def.make_thm, args:"; val (thy, part, (thmID : ThmC.id, thm), (mathauthors : Thy_Write.authors)) =
147 (@{theory "Biegelinie"}, "IsacKnowledge",
148 ("Belastung_Querkraft", Thm.prop_of @{thm Belastung_Querkraft}),
149 ["Walther Neuper 2005 supported by a grant from NMI Austria"]);
150 val guh = Thy_Write.thm2guh (part, Context.theory_name thy) thmID
151 val theID = Thy_Present.guh2theID guh;
152 if guh = "thy_isac_Biegelinie-thm-Belastung_Querkraft" andalso
153 theID = ["IsacKnowledge", "Biegelinie", "Theorems", "Belastung_Querkraft"]
154 then () else error "store_thm: guh | theID changed";
156 \<close> ML \<open> (*ERROR "??.unknown"*)
157 "----------- fun thms_of_rlss ------------------------------------";
158 "----------- fun thms_of_rlss ------------------------------------";
159 "----------- fun thms_of_rlss ------------------------------------";
162 [("empty" : Rule_Set.id, ("Know_Store": ThyC.id, Rule_Set.empty)),
163 ("discard_minus" : Rule_Set.id, ("Poly": ThyC.id, discard_minus))]:
164 (id * (id * Rule_Def.rule_set)) list
167 (*--- fun ThmC_Def.make_thm --- avoids ERROR BELOW Undefined fact: "real_mult_minus1"*)
168 (*+*)thms_of_rlss thy rlss (* = [("??.unknown", "?a - ?b = ?a + -1 * ?b")]: (string * thm) list*)
170 (*+*)Rule_Set.empty: Rule_Def.rule_set
172 (*+*)discard_minus: Rule_Def.rule_set
174 val [_, (thmID, term)] = thms_of_rlss thy rlss;
177 if thmID = "real_mult_minus1" (* WAS "??.unknown" *)
178 then () else error "thms_of_rlss changed";
181 "~~~~~ fun thms_of_rlss, args:"; val (thy, rlss) = (@{theory Isac_Knowledge}, rlss);
182 val rlss' = (rlss : (Rule_Set.id * (ThyC.id * Rule_Set.T)) list)
183 |> map (Thy_Present.thms_of_rls o #2 o #2)
184 (* = [[], [Thm ("real_diff_minus", "?a - ?b = ?a + -1 * ?b"),
185 Thm ("sym_real_mult_minus1", "- ?z1 = -1 * ?z1")]]*)
187 (* = [Thm ("real_diff_minus", "?a - ?b = ?a + -1 * ?b"),
188 Thm ("sym_real_mult_minus1", "- ?z1 = -1 * ?z1")]*)
189 |> map (ThmC.revert_sym_rule thy)
190 (* = [Thm ("Poly.real_diff_minus", "?a - ?b = ?a + -1 * ?b"),
191 Thm ("Delete.real_mult_minus1", "-1 * ?z = - ?z")] : rule list*)
192 |> map (fn Thm (thmID, thm) => (thmID, Thm.prop_of thm))
193 (* = [("Poly.real_diff_minus", Const ("HOL.Trueprop", "bool \<Rightarrow> prop") $ ...,
194 ("Delete.real_mult_minus1", Const ("HOL.Trueprop", ...)] : (string * term) list*)
195 |> distinct (fn ((thmID1, thm1), (thmID2, thm2)) => thmID1 = thmID2);
208 section \<open>===================================================================================\<close>
215 section \<open>code for copy & paste ===============================================================\<close>
217 "~~~~~ fun xxx , args:"; val () = ();
218 "~~~~~ and xxx , args:"; val () = ();
219 "~~~~~ from xxx to yyy return val:"; val ((*yyy*)) = ((*xxx*));
220 (*if*) (*then*); (*else*); (*case*) (*of*); (*return value*);