akargl@42181
|
1 |
(* Title: test for rewtools.sml
|
neuper@37906
|
2 |
authors: Walther Neuper 2000, 2006
|
neuper@55397
|
3 |
|
wneuper@59465
|
4 |
theory Test_Some imports Isac.Build_Thydata begin
|
neuper@55397
|
5 |
ML_file "~~/test/Tools/isac/ADDTESTS/accumulate-val/lucas_interpreter.sml"
|
neuper@55458
|
6 |
ML {* KEStore_Elems.set_ref_thy @{theory};
|
neuper@55458
|
7 |
fun autoCalculate' cI auto = autoCalculate cI auto |> Future.join *}
|
neuper@55397
|
8 |
ML_file "Interpret/rewtools.sml"
|
neuper@37906
|
9 |
*)
|
neuper@37906
|
10 |
|
neuper@38061
|
11 |
"--------------------------------------------------------";
|
neuper@38061
|
12 |
"--------------------------------------------------------";
|
neuper@38061
|
13 |
"table of contents --------------------------------------";
|
neuper@38061
|
14 |
"--------------------------------------------------------";
|
neuper@38061
|
15 |
"----------- fun thy_containing_rls ---------------------";
|
wneuper@59366
|
16 |
"----------- apply thy_containing_rls -------------------";
|
neuper@38061
|
17 |
"----------- fun thy_containing_cal ---------------------";
|
neuper@38061
|
18 |
"----------- initContext Thy_ Integration-demo ----------";
|
neuper@38061
|
19 |
"----------- initContext..Thy_, fun context_thm ---------";
|
neuper@38061
|
20 |
"----------- initContext..Thy_, fun context_rls ---------";
|
neuper@38061
|
21 |
"----------- checkContext..Thy_, fun context_thy --------";
|
neuper@38061
|
22 |
"----------- checkContext..Thy_, fun context_rls --------";
|
neuper@38061
|
23 |
"----------- checkContext..Thy_ on last formula ---------";
|
neuper@38061
|
24 |
"----------- fun guh2theID ------------------------------";
|
neuper@38061
|
25 |
"----------- debugging on Tests/solve_linear_as_rootpbl -";
|
neuper@38061
|
26 |
"--------------------------------------------------------";
|
wneuper@55498
|
27 |
(*============ inhibit exn WN120321 ==============================================
|
neuper@38061
|
28 |
"--------------------------------------------------------";
|
neuper@38061
|
29 |
"----------- fun filter_appl_rews -----------------------";
|
wneuper@55498
|
30 |
============ inhibit exn WN120321 ==============================================*)
|
neuper@38061
|
31 |
"----------- fun is_contained_in ------------------------";
|
neuper@38061
|
32 |
"--------------------------------------------------------";
|
neuper@38061
|
33 |
"--------------------------------------------------------";
|
neuper@37906
|
34 |
|
neuper@38061
|
35 |
"----------- fun thy_containing_rls ---------------------";
|
neuper@38061
|
36 |
"----------- fun thy_containing_rls ---------------------";
|
neuper@38061
|
37 |
"----------- fun thy_containing_rls ---------------------";
|
wneuper@59366
|
38 |
(*ERROR WAS: Theory loader: undefined entry for theory "Isac.Complex_Main"*)
|
walther@59917
|
39 |
if Thy_Read.thy_containing_rls "Biegelinie" "norm_Poly" = ("IsacKnowledge", "Poly") then ()
|
wneuper@59366
|
40 |
else error ("thy_containing_rls changed for 'Biegelinie', 'norm_Poly'")
|
wneuper@59366
|
41 |
;
|
wneuper@59366
|
42 |
"~~~~~ fun thy_containing_rls, args:"; val (thy', rls') = ("Biegelinie", "norm_Poly");
|
walther@59879
|
43 |
val thy = ThyC.get_theory thy'; (*.., EqSystem, Isac.Biegelinie}*)
|
wneuper@59366
|
44 |
val xxx = AList.lookup op= (KEStore_Elems.get_rlss thy) rls';
|
wneuper@59366
|
45 |
val SOME (thy'', _) = xxx;
|
wneuper@59366
|
46 |
val SOME ("Poly", _) = xxx;
|
wneuper@59366
|
47 |
if thy'' = "Poly" then () else error "--- fun thy_containing_rls: changed";
|
wneuper@59366
|
48 |
(*ERROR WAS: Theory loader: undefined entry for theory "Isac.Complex_Main" *)
|
walther@59916
|
49 |
if Thy_Read.partID' thy'' = "IsacKnowledge" then () else error "fun partID': changed"
|
wneuper@59366
|
50 |
;
|
wneuper@59366
|
51 |
"~~~~~ fun partID', args:"; val (thy') = (thy');
|
walther@59879
|
52 |
ThyC.get_theory thy' (*.., EqSystem, Isac.Biegelinie}*)
|
wneuper@59366
|
53 |
;
|
walther@59879
|
54 |
"~~~~~ fun partID, args:"; val (thy) = (ThyC.get_theory thy');
|
wneuper@59366
|
55 |
(*ERROR WAS: Theory loader: undefined entry for theory "Isac.Complex_Main"*)
|
walther@59916
|
56 |
Thy_Read.knowthys ()
|
wneuper@59366
|
57 |
;
|
wneuper@59600
|
58 |
"~~~~~ fun knowthys , args:"; val () = ();
|
walther@59914
|
59 |
val allthys = filter_out (Library.member Context.eq_thy
|
walther@59879
|
60 |
[(*ThyC.get_theory "ProgLang",*) ThyC.get_theory "Interpret",
|
walther@59879
|
61 |
ThyC.get_theory "MathEngine", ThyC.get_theory "BridgeLibisabelle"])
|
walther@59879
|
62 |
(Theory.ancestors_of (ThyC.get_theory "Build_Thydata"));
|
wneuper@59366
|
63 |
length allthys = 152; (*in Isabelle2015/Isac*)
|
wneuper@59366
|
64 |
(*ERROR WAS: Theory loader: undefined entry for theory "Isac.Complex_Main"
|
walther@59879
|
65 |
ThyC.get_theory "Complex_Main";*)
|
wneuper@59366
|
66 |
Thy_Info.get_theory "Complex_Main";;
|
wneuper@59366
|
67 |
|
wneuper@59366
|
68 |
"----------- apply thy_containing_rls -------------------";
|
wneuper@59366
|
69 |
"----------- apply thy_containing_rls -------------------";
|
wneuper@59366
|
70 |
"----------- apply thy_containing_rls -------------------";
|
walther@59917
|
71 |
if Thy_Read.thy_containing_rls "Biegelinie" "norm_Poly" = ("IsacKnowledge", "Poly") then ()
|
walther@59917
|
72 |
else error ("Thy_Read.thy_containing_rls changed for 'Biegelinie', 'norm_Poly'")
|
neuper@55458
|
73 |
;
|
walther@59917
|
74 |
if Thy_Read.thy_containing_rls "Biegelinie" "empty" = ("IsacScripts", "Know_Store") then ()
|
walther@59917
|
75 |
else error ("Thy_Read.thy_containing_rls changed for 'Biegelinie', 'e_rls'")
|
neuper@55458
|
76 |
;
|
walther@59917
|
77 |
if Thy_Read.thy_containing_rls "Build_Thydata" "prog_expr" = (*FIXME: handle redifinition in several thys*)
|
wneuper@59602
|
78 |
("IsacKnowledge", "Base_Tools") then ()
|
walther@59917
|
79 |
else error ("Thy_Read.thy_containing_rls changed for 'Biegelinie', 'prog_expr'")
|
neuper@37906
|
80 |
|
neuper@38061
|
81 |
"----------- fun thy_containing_cal ---------------------";
|
neuper@38061
|
82 |
"----------- fun thy_containing_cal ---------------------";
|
neuper@38061
|
83 |
"----------- fun thy_containing_cal ---------------------";
|
walther@59603
|
84 |
(* ATTENTION: both, "IsacKnowledge" and "Prog_Expr" are fixed as results for any input*)
|
walther@59917
|
85 |
if Thy_Read.thy_containing_cal "Biegelinie" "PLUS" = ("IsacKnowledge", "Base_Tools")
|
neuper@55458
|
86 |
then () else error "(wrong) thy_containing_cal 'Biegelinie' 'PLUS' changed"
|
neuper@42407
|
87 |
|
neuper@38061
|
88 |
"----------- initContext Thy_ Integration-demo ----------";
|
neuper@38061
|
89 |
"----------- initContext Thy_ Integration-demo ----------";
|
neuper@38061
|
90 |
"----------- initContext Thy_ Integration-demo ----------";
|
s1210629013@55445
|
91 |
reset_states ();
|
neuper@37906
|
92 |
CalcTree
|
neuper@37906
|
93 |
[(["functionTerm (2 * x)","integrateBy x","antiDerivative FF"],
|
neuper@38058
|
94 |
("Integrate",["integrate","function"],
|
neuper@37906
|
95 |
["diff","integration"]))];
|
neuper@37906
|
96 |
Iterator 1;
|
neuper@37906
|
97 |
moveActiveRoot 1;
|
wneuper@59248
|
98 |
autoCalculate 1 CompleteCalc;
|
neuper@37906
|
99 |
interSteps 1 ([1],Res);
|
neuper@37906
|
100 |
interSteps 1 ([1,1],Res);
|
neuper@37906
|
101 |
val ((pt,p),_) = get_calc 1; show_pt pt;
|
neuper@37906
|
102 |
if existpt' ([1,1,1], Frm) pt then ()
|
neuper@38031
|
103 |
else error "integrate.sml: interSteps on Rewrite_Set_Inst 1";
|
neuper@37906
|
104 |
initContext 1 Thy_ ([1,1,1], Frm);
|
neuper@37906
|
105 |
|
neuper@38061
|
106 |
"----------- initContext..Thy_, fun context_thm ---------";
|
neuper@38061
|
107 |
"----------- initContext..Thy_, fun context_thm ---------";
|
neuper@38061
|
108 |
"----------- initContext..Thy_, fun context_thm ---------";
|
s1210629013@55445
|
109 |
reset_states (); (*start of calculation, return No.1*)
|
neuper@41970
|
110 |
CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"],
|
neuper@41970
|
111 |
("Test", ["sqroot-test","univariate","equation","test"],
|
neuper@37906
|
112 |
["Test","squ-equ-test-subpbl1"]))];
|
neuper@37906
|
113 |
Iterator 1; moveActiveRoot 1;
|
wneuper@59248
|
114 |
autoCalculate 1 CompleteCalc;
|
neuper@37906
|
115 |
|
neuper@37906
|
116 |
"----- no thy-context at result -----";
|
neuper@37906
|
117 |
val p = ([], Res);
|
neuper@37906
|
118 |
initContext 1 Thy_ p;
|
wneuper@55498
|
119 |
val ((pt,_),_) = get_calc 1; show_pt pt; (* 11 lines with subpbl *)
|
neuper@37906
|
120 |
|
neuper@37906
|
121 |
interSteps 1 ([2], Res);
|
wneuper@55498
|
122 |
val ((pt,_),_) = get_calc 1; show_pt pt; (* added [2,1]..[2,6] *)
|
neuper@37906
|
123 |
interSteps 1 ([3,1], Res);
|
wneuper@55498
|
124 |
val ((pt,_),_) = get_calc 1; show_pt pt; (* added [3,1,1] Frm + Res *)
|
neuper@37906
|
125 |
|
neuper@37906
|
126 |
val p = ([2,4], Res);
|
wneuper@55498
|
127 |
"~~~~~ fun initContext, args:"; val ((cI:calcID), Thy_, (pos as (p,p_):pos')) = (1, Thy_, p);
|
walther@59914
|
128 |
Library.member op = [Pbl,Met] p_ = false;
|
wneuper@55498
|
129 |
pos = ([],Res) = false;
|
wneuper@55498
|
130 |
val cs as (ptp as (pt,_),_) = get_calc cI;
|
wneuper@55498
|
131 |
exist_lev_on' pt pos = true;
|
wneuper@55498
|
132 |
val pos' = lev_on' pt pos
|
walther@59917
|
133 |
val tac = Thy_Present.get_tac_checked pt pos';
|
wneuper@55498
|
134 |
is_rewtac tac = true;
|
wneuper@55498
|
135 |
"~~~~~ fun context_thy, args:"; val ((pt, pos as (p,p_)), (tac as Rewrite (thmID,_))) =
|
wneuper@55498
|
136 |
((pt, pos), tac);
|
walther@59917
|
137 |
val Appl (Rewrite' (thy', ord', erls, _, (thmID, thm), f, (res,asm))) = applicable_in pos pt tac
|
walther@59881
|
138 |
val thm = Global_Theory.get_thm (Isac ()(*WN141021 ThyC.get_theory thy' ERROR*)) thmID
|
wneuper@55498
|
139 |
val thm_deriv = Thm.get_name_hint thm;
|
wneuper@55498
|
140 |
|
walther@59917
|
141 |
if Thy_Write.thm2guh (Thy_Read.thy_containing_thm thm_deriv) (ThmC.cut_id thm_deriv)
|
wneuper@55498
|
142 |
= "thy_isac_Test-thm-radd_left_commute" then ()
|
wneuper@55498
|
143 |
else error "context_thy mini-subpbl ([2,4], Res) changed";
|
wneuper@55498
|
144 |
(*~/proto3/kbase/thy$ ls -l thy_isac_Test-thm-radd_left_commute*
|
wneuper@55498
|
145 |
-rw-rw-r-- 1 wneuper wneuper 638 Aug 8 16:04 thy_isac_Test-thm-radd_left_commute.html*)
|
neuper@37906
|
146 |
|
akargl@42108
|
147 |
|
neuper@37906
|
148 |
val p = ([3,1,1], Frm);
|
wneuper@55498
|
149 |
"~~~~~ fun initContext, args:"; val ((cI:calcID), Thy_, (pos as (p,p_):pos')) = (1, Thy_, p);
|
walther@59914
|
150 |
Library.member op = [Pbl,Met] p_ = false;
|
wneuper@55498
|
151 |
pos = ([],Res) = false;
|
wneuper@55498
|
152 |
val cs as (ptp as (pt,_),_) = get_calc cI;
|
wneuper@55498
|
153 |
exist_lev_on' pt pos = true;
|
wneuper@55498
|
154 |
val pos' = lev_on' pt pos
|
walther@59917
|
155 |
val tac = Thy_Present.get_tac_checked pt pos';
|
wneuper@55498
|
156 |
is_rewtac tac = true;
|
wneuper@55498
|
157 |
"~~~~~ fun context_thy, args:"; val ((pt, pos as (p,p_)), (tac as Rewrite_Inst (subs, (thmID,_))))=
|
wneuper@55498
|
158 |
((pt, pos), tac);
|
wneuper@55498
|
159 |
val Appl (Rewrite_Inst' (thy', ord', erls, _, subst, (thmID,_), f, (res, asm))) =
|
wneuper@55498
|
160 |
applicable_in pos pt tac
|
walther@59881
|
161 |
val thm = Global_Theory.get_thm (Isac ()(*WN141021 ThyC.get_theory thy' ERROR*)) thmID
|
wneuper@55498
|
162 |
val thm_deriv = Thm.get_name_hint thm;
|
walther@59917
|
163 |
if Thy_Write.thm2guh (Thy_Read.thy_containing_thm thm_deriv) (ThmC.cut_id thm_deriv) =
|
wneuper@55498
|
164 |
"thy_isac_Test-thm-risolate_bdv_add" then ()
|
wneuper@55498
|
165 |
else error "context_thy mini-subpbl ([3,1,1], Frm) changed";
|
wneuper@55498
|
166 |
(*~/proto3/kbase/thy$ ls -l thy_isac_Test-thm-risolate_bdv_add*
|
wneuper@55498
|
167 |
-rw-rw-r-- 1 wneuper wneuper 646 Aug 8 16:04 thy_isac_Test-thm-risolate_bdv_add.html*)
|
neuper@37906
|
168 |
|
neuper@37906
|
169 |
|
wneuper@55498
|
170 |
val p = ([2,5], Res);
|
wneuper@55498
|
171 |
"~~~~~ fun initContext, args:"; val ((cI:calcID), Thy_, (pos as (p,p_):pos')) = (1, Thy_, p);
|
walther@59914
|
172 |
Library.member op = [Pbl,Met] p_ = false;
|
wneuper@55498
|
173 |
pos = ([],Res) = false;
|
wneuper@55498
|
174 |
val cs as (ptp as (pt,_),_) = get_calc cI;
|
wneuper@55498
|
175 |
exist_lev_on' pt pos = true;
|
wneuper@55498
|
176 |
val pos' = lev_on' pt pos
|
walther@59917
|
177 |
val tac = Thy_Present.get_tac_checked pt pos';
|
wneuper@55498
|
178 |
if is_rewtac tac = false then ()
|
wneuper@55498
|
179 |
else error "initContext: context_thy .. Calculate PLUS .. TO BE IMPLEMENTED"
|
neuper@37906
|
180 |
|
neuper@38061
|
181 |
"----------- initContext..Thy_, fun context_rls ---------";
|
neuper@38061
|
182 |
"----------- initContext..Thy_, fun context_rls ---------";
|
neuper@38061
|
183 |
"----------- initContext..Thy_, fun context_rls ---------";
|
neuper@37906
|
184 |
(*using pt from above*)
|
neuper@37906
|
185 |
val p = ([1], Res);
|
neuper@37906
|
186 |
val tac = Rewrite_Set "Test_simplify";
|
neuper@37906
|
187 |
initContext 1 Thy_ p;
|
neuper@37906
|
188 |
(*Res->Res, Rewrite_Set "Test_simplify" x + 1 + -1 * 2 = 0 -> -1 + x = 0
|
neuper@37906
|
189 |
--- in initContext..Thy_ ---*)
|
walther@59917
|
190 |
val Thy_Present.ContRls {rls,result,...} = Thy_Present.context_thy (pt,p) tac;
|
neuper@37906
|
191 |
if rls = "thy_isac_Test-rls-Test_simplify"
|
walther@59868
|
192 |
andalso UnparseC.term result = "-1 + x = 0" then ()
|
wneuper@55498
|
193 |
else error "rewtools.sml initContext..Th_ thy_isac_Test-rls-Test_simplify";
|
neuper@37906
|
194 |
|
neuper@37906
|
195 |
val p = ([3,1], Frm);
|
wneuper@59494
|
196 |
val tac = Rewrite_Set_Inst (["(''bdv'', x)"],"isolate_bdv");
|
neuper@37906
|
197 |
initContext 1 Thy_ p;
|
neuper@37906
|
198 |
(*Frm->Res, Rewrite_Set_Inst "isolate_bdv" -1 + x = 0 -> x = 0 + -1 * -1
|
neuper@37906
|
199 |
--- in initContext..Thy_ ---*)
|
walther@59917
|
200 |
val Thy_Present.ContRlsInst {rls,result,...} = Thy_Present.context_thy (pt,p) tac;
|
neuper@37906
|
201 |
if rls = "thy_isac_Test-rls-isolate_bdv"
|
walther@59868
|
202 |
andalso UnparseC.term result = "x = 0 + -1 * -1" then ()
|
neuper@38031
|
203 |
else error "rewtools.sml initContext..Th_ thy_Test-thm-risolate_bdv_add";
|
neuper@37906
|
204 |
|
neuper@38061
|
205 |
"----------- checkContext..Thy_, fun context_thy --------";
|
neuper@38061
|
206 |
"----------- checkContext..Thy_, fun context_thy --------";
|
neuper@38061
|
207 |
"----------- checkContext..Thy_, fun context_thy --------";
|
neuper@37906
|
208 |
(*using pt from above*)
|
neuper@37906
|
209 |
val p = ([2,4], Res);
|
wneuper@59253
|
210 |
val tac = Rewrite ("radd_left_commute", @{thm radd_left_commute});
|
neuper@37906
|
211 |
checkContext 1 p "thy_Test-thm-radd_left_commute";
|
neuper@37906
|
212 |
(* radd_left_commute: 1 + (-2 + x) = 0 -> -2 + (1 + x) = 0
|
neuper@37906
|
213 |
--- in checkContext..Thy_ ---*)
|
walther@59917
|
214 |
val Thy_Present.ContThm {thm,result,...} = Thy_Present.context_thy (pt,p) tac;
|
neuper@37906
|
215 |
if thm = "thy_isac_Test-thm-radd_left_commute"
|
walther@59868
|
216 |
andalso UnparseC.term result = "-2 + (1 + x) = 0" then ()
|
neuper@38031
|
217 |
else error "rewtools.sml checkContext.._ thy_Test-thm-radd_left_commute";
|
neuper@37906
|
218 |
|
neuper@37906
|
219 |
val p = ([3,1,1], Frm);
|
wneuper@59494
|
220 |
val tac = Rewrite_Inst (["(''bdv'',x)"],("risolate_bdv_add", @{thm "risolate_bdv_add"}));
|
neuper@37906
|
221 |
checkContext 1 p "thy_Test-thm-risolate_bdv_add";
|
neuper@37906
|
222 |
(* risolate_bdv_add: -1 + x = 0 -> x = 0 + -1 * -1
|
neuper@37906
|
223 |
--- in checkContext..Thy_ ---*)
|
walther@59917
|
224 |
val Thy_Present.ContThmInst {thm,result,...} = Thy_Present.context_thy (pt,p) tac;
|
neuper@37906
|
225 |
if thm = "thy_isac_Test-thm-risolate_bdv_add"
|
walther@59868
|
226 |
andalso UnparseC.term result = "x = 0 + - 1 * -1" then ()
|
neuper@38031
|
227 |
else error "rewtools.sml checkContext..T_ thy_Test-thm-risolate_bdv_add";
|
neuper@37906
|
228 |
|
neuper@37906
|
229 |
val p = ([2,5], Res);
|
neuper@37906
|
230 |
val tac = Calculate "plus";
|
neuper@37906
|
231 |
(*checkContext..Thy_ 1 ([2,5], Res);*)
|
neuper@37906
|
232 |
(*FIXXXME #######################vvvvv kestoreID !!!!!!!!!!!!!!!!*)
|
neuper@37906
|
233 |
checkContext 1 p ;
|
neuper@37906
|
234 |
(* Calculate "plus" -2 + (1 + x) = 0 -> -1 + x = 0
|
neuper@37906
|
235 |
--- in checkContext..Thy_ ---*)
|
neuper@37906
|
236 |
|
neuper@38061
|
237 |
"----------- checkContext..Thy_, fun context_rls --------";
|
neuper@38061
|
238 |
"----------- checkContext..Thy_, fun context_rls --------";
|
neuper@38061
|
239 |
"----------- checkContext..Thy_, fun context_rls --------";
|
neuper@37906
|
240 |
(*using pt from above*)
|
neuper@37906
|
241 |
val p = ([1], Res);
|
neuper@37906
|
242 |
val tac = Rewrite_Set "Test_simplify";
|
neuper@37906
|
243 |
checkContext 1 p "thy_isac_Test-rls-Test_simplify";
|
neuper@37906
|
244 |
(*Res->Res, Rewrite_Set "Test_simplify" x + 1 + -1 * 2 = 0 -> -1 + x = 0
|
neuper@37906
|
245 |
--- in checkContext..Thy_ ---*)
|
walther@59917
|
246 |
val Thy_Present.ContRls {rls,result,...} = Thy_Present.context_thy (pt,p) tac;
|
neuper@37906
|
247 |
if rls = "thy_isac_Test-rls-Test_simplify"
|
walther@59868
|
248 |
andalso UnparseC.term result = "-1 + x = 0" then ()
|
neuper@38031
|
249 |
else error "rewtools.sml checkContext..Thy_ thy_Test-rls-Test_simplify";
|
neuper@37906
|
250 |
|
neuper@37906
|
251 |
val p = ([3,1], Frm);
|
wneuper@59494
|
252 |
val tac = Rewrite_Set_Inst (["(''bdv'', x)"],"isolate_bdv");
|
neuper@37906
|
253 |
checkContext 1 p "thy_Test-rls-isolate_bdv";
|
walther@59917
|
254 |
val Thy_Present.ContRlsInst {rls,result,...} = Thy_Present.context_thy (pt,p) tac;
|
neuper@37906
|
255 |
if rls = "thy_isac_Test-rls-isolate_bdv"
|
walther@59868
|
256 |
andalso UnparseC.term result = "x = 0 + -1 * -1" then ()
|
neuper@38031
|
257 |
else error "rewtools.sml checkContext..Thy_ thy_Test-thm-isolate_bdv";
|
neuper@37906
|
258 |
|
neuper@38061
|
259 |
"----------- checkContext..Thy_ on last formula ---------";
|
neuper@38061
|
260 |
"----------- checkContext..Thy_ on last formula ---------";
|
neuper@38061
|
261 |
"----------- checkContext..Thy_ on last formula ---------";
|
s1210629013@55445
|
262 |
reset_states (); (*start of calculation, return No.1*)
|
neuper@41970
|
263 |
CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"],
|
neuper@41970
|
264 |
("Test", ["sqroot-test","univariate","equation","test"],
|
neuper@37906
|
265 |
["Test","squ-equ-test-subpbl1"]))];
|
neuper@37906
|
266 |
Iterator 1; moveActiveRoot 1;
|
neuper@37906
|
267 |
|
wneuper@59248
|
268 |
autoCalculate 1 CompleteCalcHead;
|
walther@59747
|
269 |
autoCalculate 1 (Steps 1);
|
neuper@37906
|
270 |
val (ptp as (pt,p), tacis) = get_calc 1; show_pt pt;
|
neuper@37906
|
271 |
initContext 1 Thy_ ([1], Frm);
|
neuper@37906
|
272 |
checkContext 1 ([1], Frm) "thy_isac_Test-thm-radd_left_commute";
|
neuper@37906
|
273 |
|
walther@59747
|
274 |
autoCalculate 1 (Steps 1);
|
neuper@37906
|
275 |
val (ptp as (pt,p), tacis) = get_calc 1; show_pt pt;
|
neuper@37906
|
276 |
initContext 1 Thy_ ([1], Res);
|
neuper@37906
|
277 |
checkContext 1 ([1], Res) "thy_isac_Test-rls-Test_simplify";
|
neuper@37906
|
278 |
|
neuper@38061
|
279 |
"----------- fun guh2theID ------------------------------";
|
neuper@38061
|
280 |
"----------- fun guh2theID ------------------------------";
|
neuper@38061
|
281 |
"----------- fun guh2theID ------------------------------";
|
neuper@37906
|
282 |
val guh = "thy_scri_ListG-thm-zip_Nil";
|
wneuper@59348
|
283 |
(*default_print_depth 3; 999*)
|
akargl@42181
|
284 |
take_fromto 1 4 (Symbol.explode guh);
|
akargl@42181
|
285 |
take_fromto 5 9 (Symbol.explode guh);
|
akargl@42181
|
286 |
val rest = takerest (9,(Symbol.explode guh));
|
neuper@37906
|
287 |
|
neuper@37906
|
288 |
separate "-" rest;
|
neuper@37906
|
289 |
space_implode "-" rest;
|
neuper@37906
|
290 |
commas rest;
|
neuper@37906
|
291 |
|
neuper@37906
|
292 |
val delim = "-";
|
neuper@37906
|
293 |
val thyID = takewhile [] (not o (curry op= delim)) rest;
|
neuper@37906
|
294 |
val rest' = dropuntil (curry op= delim) rest;
|
neuper@37906
|
295 |
val setc = take_fromto 1 5 rest';
|
neuper@37906
|
296 |
val xstr = takerest (5, rest');
|
neuper@37906
|
297 |
|
walther@59917
|
298 |
if Thy_Present.guh2theID guh = ["IsacScripts", "ListG", "Theorems", "zip_Nil"] then ()
|
neuper@38031
|
299 |
else error "rewtools.sml: guh2theID thy_scri_ListG-thm-zip_Nil changed";
|
neuper@37906
|
300 |
|
neuper@37906
|
301 |
|
neuper@38061
|
302 |
"----------- debugging on Tests/solve_linear_as_rootpbl -";
|
neuper@38061
|
303 |
"----------- debugging on Tests/solve_linear_as_rootpbl -";
|
neuper@38061
|
304 |
"----------- debugging on Tests/solve_linear_as_rootpbl -";
|
akargl@42108
|
305 |
"----- initContext -----";
|
s1210629013@55445
|
306 |
reset_states ();
|
neuper@37906
|
307 |
CalcTree
|
neuper@42124
|
308 |
[(["equality (1+-1*2+x=(0::real))", "solveFor x", "solutions L"],
|
neuper@38058
|
309 |
("Test",
|
neuper@55279
|
310 |
["LINEAR","univariate","equation","test"],
|
neuper@37906
|
311 |
["Test","solve_linear"]))];
|
neuper@37906
|
312 |
Iterator 1; moveActiveRoot 1;
|
wneuper@59248
|
313 |
autoCalculate 1 CompleteCalcHead;
|
neuper@37906
|
314 |
|
walther@59747
|
315 |
autoCalculate 1 (Steps 1); val (ptp as (pt,p), tacis) = get_calc 1; show_pt pt;
|
neuper@37906
|
316 |
if is_curr_endof_calc pt ([1],Frm) then ()
|
neuper@38031
|
317 |
else error "rewtools.sml is_curr_endof_calc ([1],Frm)";
|
neuper@37906
|
318 |
|
walther@59747
|
319 |
autoCalculate 1 (Steps 1); val (ptp as (pt,p), tacis) = get_calc 1; show_pt pt;
|
akargl@42125
|
320 |
|
neuper@37906
|
321 |
if not (is_curr_endof_calc pt ([1],Frm)) then ()
|
neuper@38031
|
322 |
else error "rewtools.sml is_curr_endof_calc ([1],Frm) not";
|
neuper@37906
|
323 |
if is_curr_endof_calc pt ([1],Res) then ()
|
neuper@38031
|
324 |
else error "rewtools.sml is_curr_endof_calc ([1],Res)";
|
neuper@37906
|
325 |
|
neuper@37906
|
326 |
initContext 1 Thy_ ([1],Res);
|
neuper@37906
|
327 |
|
neuper@37906
|
328 |
"----- checkContext -----";
|
s1210629013@55445
|
329 |
reset_states ();
|
neuper@37906
|
330 |
CalcTree
|
neuper@42124
|
331 |
[(["equality (1+-1*2+x=(0::real))", "solveFor x", "solutions L"],
|
neuper@38058
|
332 |
("Test",
|
neuper@55279
|
333 |
["LINEAR","univariate","equation","test"],
|
neuper@37906
|
334 |
["Test","solve_linear"]))];
|
neuper@37906
|
335 |
Iterator 1; moveActiveRoot 1;
|
wneuper@59248
|
336 |
autoCalculate 1 CompleteCalc;
|
neuper@37906
|
337 |
interSteps 1 ([1],Res);
|
akargl@42108
|
338 |
|
neuper@37906
|
339 |
val (ptp as (pt,p), tacis) = get_calc 1; show_pt pt;
|
neuper@37906
|
340 |
checkContext 1 ([1],Res) "thy_isac_Test-rls-Test_simplify";
|
neuper@37906
|
341 |
|
neuper@37906
|
342 |
interSteps 1 ([2],Res);
|
neuper@37906
|
343 |
val (ptp as (pt,p), tacis) = get_calc 1; show_pt pt;
|
neuper@37906
|
344 |
|
neuper@37906
|
345 |
checkContext 1 ([2,1],Res) "thy_isac_Test-rls-Test_simplify";
|
neuper@37906
|
346 |
checkContext 1 ([2,2],Res) "thy_isac_Test-rls-Test_simplify";
|
neuper@37906
|
347 |
|
neuper@38061
|
348 |
"----------- fun is_contained_in ------------------------";
|
neuper@38061
|
349 |
"----------- fun is_contained_in ------------------------";
|
neuper@38061
|
350 |
"----------- fun is_contained_in ------------------------";
|
walther@59871
|
351 |
val r1 = Thm ("real_diff_minus",ThmC.numerals_to_Free @{thm real_diff_minus});
|
walther@59914
|
352 |
if Rule_Set.contains r1 Test_simplify then ()
|
walther@59914
|
353 |
else error "rewtools.sml Rule_Set.contains Thm";
|
neuper@37906
|
354 |
|
walther@59878
|
355 |
val r1 = Eval ("Groups.plus_class.plus", eval_binop "#add_");
|
walther@59914
|
356 |
if Rule_Set.contains r1 Test_simplify then ()
|
walther@59914
|
357 |
else error "rewtools.sml Rule_Set.contains Eval";
|
neuper@37906
|
358 |
|
walther@59878
|
359 |
val r1 = Eval ("Groups.minus_class.minus", eval_binop "#add_");
|
walther@59914
|
360 |
if not (Rule_Set.contains r1 Test_simplify) then ()
|
walther@59914
|
361 |
else error "rewtools.sml Rule_Set.contains Eval";
|