1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/sml/systest/FE-KE.sml Thu Apr 17 18:01:03 2003 +0200
1.3 @@ -0,0 +1,403 @@
1.4 +(* use"test-FE-KE.sml";
1.5 + W.N.16.4.00
1.6 + *)
1.7 +
1.8 +(*contents*)
1.9 +" _________________ stdin: tutor active_________________ ";
1.10 +" _________________ stdin: student active_________________ ";
1.11 +" _________________ stdin: root_equ: 1.norm_equation ________________ ";
1.12 +" _________________ stdin: root_equ: spec_hide ________________ ";
1.13 +" ------------- test-FE-KE.sml: test100 ------------- ";
1.14 +" _________________ stdin: root_equ: Auto ________________ ";
1.15 +(*contents*)
1.16 +
1.17 +
1.18 +
1.19 +
1.20 +(*#########################################################*)
1.21 +" _________________ stdin: tutor active_________________ ";
1.22 +" _________________ stdin: tutor active_________________ ";
1.23 +" _________________ stdin: tutor active_________________ ";
1.24 +" _________________ stdin: tutor active_________________ ";
1.25 +" _________________ stdin: tutor active_________________ ";
1.26 +" _________________ stdin: tutor active_________________ ";
1.27 +proofs:= []; dials:=([],[],[]);
1.28 +StdinSML 0 0 0 0 New_User;
1.29 +set_dstate 1 test_hide 0 2;(*PutRule,TskipS..PutRuleRes,Tt..*)
1.30 +StdinSML 1 0 0 0 New_Proof;
1.31 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
1.32 + "solveFor x","errorBound (eps=0)",
1.33 + "solutions L"];
1.34 +val (dI',pI',mI') =
1.35 + ("Test.thy",["sqroot-test","univariate","equation","test"],
1.36 + ("Test.thy","sqrt-equ-test"));
1.37 +"--- s1 ---";
1.38 +val (_,1,1,1,[],[_,_,PpcKF (_,_,_,_,ppc),req],_) =
1.39 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
1.40 +"--- s2 ---";
1.41 +StdinSML 1 1 ~1 ~1 (Command Accept);
1.42 +(*RuleFK (Add_Given "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))"*)
1.43 +"--- s3 ---";
1.44 +StdinSML 1 1 ~2 ~2 (Command Accept);
1.45 +(*RuleFK (Add_Given "solveFor x")*)
1.46 +"--- s4 ---";
1.47 +StdinSML 1 1 ~3 ~3 (Command Accept);
1.48 +(*RuleFK (Add_Given "errorBound (eps = #0)")*)
1.49 +"--- s5 ---";
1.50 +StdinSML 1 1 ~4 ~4 (Command Accept);
1.51 +(*RuleFK (Add_Find "solutions L")*)
1.52 +"--- s6 ---";
1.53 +StdinSML 1 1 ~5 ~5 (Command Accept);
1.54 +(*RuleFK (Specify_Domain "Test.thy")*)
1.55 +"--- s7 ---";
1.56 +StdinSML 1 1 ~6 ~6 (Command Accept);
1.57 +(*RuleFK (Specify_Problem ["sqroot-test","univariate","equation","test"])*)
1.58 +"--- s8 ---";
1.59 +StdinSML 1 1 ~7 ~7 (Command Accept);
1.60 +(*RuleFK (Specify_Method ("Test.thy","sqrt-equ-test"))*)
1.61 +"--- s9 ---";
1.62 +val (_,1,1,~8,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.63 +StdinSML 1 1 ~8 ~8 (Command Accept);
1.64 +if ct'="sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)" andalso
1.65 +r = Apply_Method ("Test.thy","sqrt-equ-test")
1.66 +then () else raise error "new behaviour in test-example";
1.67 +(*RuleFK (Apply_Method ("Test.thy","sqrt-equ-test"))*)
1.68 +
1.69 +"--- 1 ---";
1.70 +val (_,1,1,~9,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.71 +StdinSML 1 1 ~9 ~9 (Command Accept);
1.72 +(*RuleFK (Rewrite ("square_equation_left",""))*)
1.73 +"--- 2 ---";
1.74 +val (_,1,1,~10,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.75 +StdinSML 1 1 ~10 ~10 (Command Accept);
1.76 +(*RuleFK (Rewrite_Set "Test_simplify")*)
1.77 +"--- 3 ---";
1.78 +val (_,1,1,~11,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.79 +StdinSML 1 1 ~11 ~11 (Command Accept);
1.80 +(*RuleFK (Rewrite_Set "rearrange_assoc")*)
1.81 +"--- 4 ---";
1.82 +val (_,1,1,~12,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.83 +StdinSML 1 1 ~12 ~12 (Command Accept);
1.84 +(*RuleFK (Rewrite_Set "isolate_root")*)
1.85 +"--- 5 ---";
1.86 +val (_,1,1,~13,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.87 +StdinSML 1 1 ~13 ~13 (Command Accept);
1.88 +(*RuleFK (Rewrite_Set "Test_simplify")*)
1.89 +"--- 6 ---";
1.90 +val (_,1,1,~14,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.91 +StdinSML 1 1 ~14 ~14 (Command Accept);
1.92 +(*RuleFK (Rewrite ("square_equation_left",""))*)
1.93 +"--- 7 ---";
1.94 +val (_,1,1,~15,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.95 +StdinSML 1 1 ~15 ~15 (Command Accept);
1.96 +(*RuleFK (Rewrite_Set "Test_simplify")*)
1.97 +"--- 8 ---";
1.98 +val (_,1,1,~16,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.99 +StdinSML 1 1 ~16 ~16 (Command Accept);
1.100 +(*val r = Rewrite_Set "rearrange_assoc"*)
1.101 +"--- 9 ---";
1.102 +val (_,1,1,~17,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.103 +StdinSML 1 1 ~17 ~17 (Command Accept);
1.104 +(*RuleFK (Rewrite_Set "Test_simplify")*)
1.105 +"--- 10 ---";
1.106 +val (_,1,1,~18,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.107 +StdinSML 1 1 ~18 ~18 (Command Accept);
1.108 +(*val r = Rewrite_Set "norm_equation"*)
1.109 +"--- 11 ---";
1.110 +val (_,1,1,~19,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.111 +StdinSML 1 1 ~19 ~19 (Command Accept);
1.112 +(*RuleFK (Rewrite_Set "Test_simplify")*)
1.113 +"--- 13 ---";
1.114 +val (_,1,1,~20,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.115 +StdinSML 1 1 ~20 ~20 (Command Accept);
1.116 +(*RuleFK (Rewrite_Set_Inst ([(#,#)],"isolate_bdv"))*)
1.117 +"--- 14 ---";
1.118 +val (_,1,1,~21,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.119 +StdinSML 1 1 ~21 ~21 (Command Accept);
1.120 +(*RuleFK (Rewrite_Set "Test_simplify")*)
1.121 +"--- 15 ---";
1.122 +val (_,1,1,~22,[],[RuleKF (_,r),FormKF (_,_,_,_,ct'),req],_) =
1.123 +StdinSML 1 1 ~22 ~22 (Command Accept);
1.124 +"--- 16 ---";
1.125 +val (_,1,1,~23,[],[req,End_Proof],_) =
1.126 +StdinSML 1 1 ~23 ~23 (Command Accept);
1.127 +
1.128 +(*
1.129 +"=====================";=======================
1.130 + use"test-FE-KE.sml";
1.131 + *)
1.132 +
1.133 +
1.134 +(*#########################################################*)
1.135 +" _________________ stdin: student active_________________ ";
1.136 +" _________________ stdin: student active_________________ ";
1.137 +" _________________ stdin: student active_________________ ";
1.138 +" _________________ stdin: student active_________________ ";
1.139 +" _________________ stdin: student active_________________ ";
1.140 +" _________________ stdin: student active_________________ ";
1.141 +proofs:= []; dials:=([],[],[]);
1.142 +StdinSML 0 0 0 0 New_User;
1.143 +set_dstate 1 test_hide 4 1;(*SelRule,St..PutRuleRes,TskipS..*)
1.144 +(*SelRule WORKS BY CAHCNE, and wrong, IN SPECIFY*)
1.145 +StdinSML 1 0 0 0 New_Proof;
1.146 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
1.147 + "solveFor x","errorBound (eps=0)",
1.148 + "solutions L"];
1.149 +val (dI',pI',mI') =
1.150 + ("Test.thy",["sqroot-test","univariate","equation","test"],
1.151 + ("Test.thy","sqrt-equ-test"));
1.152 +"--- s1 ---";
1.153 +val (_,1,1,1,[],[_,_,PpcKF (_,_,_,_,f), Select _, req],_) =
1.154 + StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
1.155 +"--- s2 ---";
1.156 +(*val (_,1,1,~1,[],[PpcKF (_,_,_,_,ppc),RuleKF (_,r),req],_) = *)
1.157 + StdinSML 1 1 ~1 ~1
1.158 + (RuleFK (Add_Given "equality (sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x))"));
1.159 +"--- s3 ---";
1.160 +StdinSML 1 1 ~2 ~2 (RuleFK (Add_Given "solveFor x"));
1.161 +"--- s4 ---";
1.162 +StdinSML 1 1 ~3 ~3 (RuleFK (Add_Given "errorBound (eps = 0)"));
1.163 +"--- s5 ---";
1.164 +StdinSML 1 1 ~4 ~4 (RuleFK (Add_Find "solutions L"));
1.165 +"--- s6 ---";
1.166 +StdinSML 1 1 ~5 ~5 (RuleFK (Specify_Domain "Test.thy"));
1.167 +"--- s7 ---";
1.168 +StdinSML 1 1 ~6 ~6 (RuleFK
1.169 +(Specify_Problem ["sqroot-test","univariate","equation","test"]));
1.170 +"--- s8 ---";
1.171 +StdinSML 1 1 ~7 ~7 (RuleFK (Specify_Method ("Test.thy","sqrt-equ-test")));
1.172 +"--- s9 ---";
1.173 +StdinSML 1 1 ~8 ~8 (RuleFK (Apply_Method ("Test.thy","sqrt-equ-test")));
1.174 +"--- 1 ---";
1.175 +StdinSML 1 1 ~9 ~9 (RuleFK (Rewrite ("square_equation_left","")));
1.176 +"--- 2 ---";
1.177 +StdinSML 1 1 ~10 ~10 (RuleFK (Rewrite_Set "Test_simplify"));
1.178 +"--- 3 ---";
1.179 +StdinSML 1 1 ~11 ~11 (RuleFK (Rewrite_Set "rearrange_assoc"));
1.180 +"--- 4 ---";
1.181 +StdinSML 1 1 ~12 ~12 (RuleFK (Rewrite_Set "isolate_root"));
1.182 +"--- 5 ---";
1.183 +StdinSML 1 1 ~13 ~13 (RuleFK (Rewrite_Set "Test_simplify"));
1.184 +"--- 6 ---";
1.185 +StdinSML 1 1 ~14 ~14 (RuleFK
1.186 +(Rewrite ("square_equation_left","")));
1.187 +"--- 7 ---";
1.188 +StdinSML 1 1 ~15 ~15 (RuleFK (Rewrite_Set "Test_simplify"));
1.189 +"--- 8<> ---";
1.190 +StdinSML 1 1 ~16 ~16 (RuleFK (Rewrite_Set "rearrange_assoc"));
1.191 +"--- 9<> ---";
1.192 +StdinSML 1 1 ~17 ~17 (RuleFK (Rewrite_Set "Test_simplify"));
1.193 +"--- 10<> ---";
1.194 +StdinSML 1 1 ~18 ~18 (RuleFK (Rewrite_Set "norm_equation"));
1.195 +"--- 11<> ---";
1.196 +StdinSML 1 1 ~19 ~19 (RuleFK (Rewrite_Set "Test_simplify"));
1.197 +"--- 12<> ---";
1.198 +StdinSML 1 1 ~20 ~20 (RuleFK
1.199 +(Rewrite_Set_Inst (["(bdv,x)"],"isolate_bdv")));
1.200 +"--- 13<> ---";
1.201 +StdinSML 1 1 ~21 ~21 (RuleFK (Rewrite_Set "Test_simplify"));
1.202 +"--- 14<> ---";
1.203 +val (begin,uI,pI,acI,cI,dats,eend) =
1.204 +StdinSML 1 1 ~22 ~22 (RuleFK
1.205 +(Check_Postcond ["sqroot-test","univariate","equation","test"]));
1.206 +
1.207 +
1.208 +(*
1.209 +"=====================";=======================
1.210 + use"test-FE-KE.sml";
1.211 + *)
1.212 +
1.213 +
1.214 +
1.215 +
1.216 +" _________________ stdin: root_equ: 1.norm_equation ________________ ";
1.217 +" _________________ stdin: root_equ: 1.norm_equation ________________ ";
1.218 +" _________________ stdin: root_equ: 1.norm_equation ________________ ";
1.219 +" _________________ stdin: root_equ: 1.norm_equation ________________ ";
1.220 +" _________________ stdin: root_equ: 1.norm_equation ________________ ";
1.221 +" _________________ stdin: root_equ: 1.norm_equation ________________ ";
1.222 +proofs:= []; dials:=([],[],[]);
1.223 +StdinSML 0 0 0 0 New_User;
1.224 +set_dstate 1 test_hide 0 2;
1.225 +StdinSML 1 0 0 0 New_Proof;
1.226 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
1.227 + "solveFor x","errorBound (eps=0)",
1.228 + "solutions L"];
1.229 +val (dI',pI',mI') =
1.230 + ("Test.thy",["sqroot-test","univariate","equation","test"],
1.231 + ("Test.thy","sqrt-equ-test"));
1.232 +"--- s1 ---";
1.233 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
1.234 +"--- s2 ---";
1.235 +StdinSML 1 1 ~1 ~1 (Command Accept);
1.236 +(*RuleFK (Add_Given "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))"*)
1.237 +"--- s3 ---";
1.238 +StdinSML 1 1 ~2 ~2 (Command Accept);
1.239 +(*RuleFK (Add_Given "solveFor x")*)
1.240 +"--- s4 ---";
1.241 +StdinSML 1 1 ~3 ~3 (Command Accept);
1.242 +(*RuleFK (Add_Given "errorBound (eps = #0)")*)
1.243 +"--- s5 ---";
1.244 +StdinSML 1 1 ~4 ~4 (Command Accept);
1.245 +(*RuleFK (Add_Find "solutions L")*)
1.246 +"--- s6 ---";
1.247 +StdinSML 1 1 ~5 ~5 (Command Accept);
1.248 +(*RuleFK (Specify_Domain "Test.thy")*)
1.249 +"--- s7 ---";
1.250 +StdinSML 1 1 ~6 ~6 (Command Accept);
1.251 +(*RuleFK (Specify_Problem ["sqroot-test","univariate","equation","test"])*)
1.252 +"--- s8 ---";
1.253 +StdinSML 1 1 ~7 ~7 (Command Accept);
1.254 +(*RuleFK (Specify_Method ("Test.thy","sqrt-equ-test"))*)
1.255 +"--- s9 ---";
1.256 +val (_,1,1,~8,[],[RuleKF (_,r),FormKF (_,_,_,_,f),req],_) =
1.257 +StdinSML 1 1 ~8 ~8 (Command Accept);
1.258 +(*RuleFK (Apply_Method ("Test.thy","sqrt-equ-test"))*)
1.259 +"--- !!! x1 --- strange choice";
1.260 +StdinSML 1 1 ~9 2 (RuleFK (Rewrite_Set "norm_equation"));
1.261 +"--- !!! x2 --- ME knows nxt_step";
1.262 +StdinSML 1 1 ~10 3 (RuleFK (Rewrite_Set "Test_simplify"));
1.263 +"--- !!! x3 --- helpless !!!";
1.264 +StdinSML 1 1 ~11 4 (RuleFK (Rewrite_Set "rearrange_assoc"));
1.265 +"--- !!! x4 ---";
1.266 +StdinSML 1 1 ~12 5 (RuleFK (Rewrite_Set "isolate_root"));
1.267 +"--- !!! x5 --- back at original equation !!!";
1.268 +val (_,_,_,_,_,[FormKF (_,_,_,_,res),requ],_) =
1.269 +StdinSML 1 1 ~13 5 (RuleFK (Rewrite_Set "Test_simplify"));
1.270 +if res="sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)"
1.271 +then () else raise error "new behaviour in 1.norm_equ";
1.272 +
1.273 +(*
1.274 +"=====================================";=====@@@@@s=====
1.275 + use"test-FE-KE.sml";
1.276 + W.N.16.4.00
1.277 + *)
1.278 +
1.279 +" _________________ stdin: root_equ: spec_hide ________________ ";
1.280 +" _________________ stdin: root_equ: spec_hide ________________ ";
1.281 +" _________________ stdin: root_equ: spec_hide ________________ ";
1.282 +" _________________ stdin: root_equ: spec_hide ________________ ";
1.283 +" _________________ stdin: root_equ: spec_hide ________________ ";
1.284 +" _________________ stdin: root_equ: spec_hide ________________ ";
1.285 +" _________________ stdin: root_equ: spec_hide ________________ ";
1.286 +proofs:= []; dials:=([],[],[]);
1.287 +StdinSML 0 0 0 0 New_User;
1.288 +set_dstate 1 spec_hide 4 1;
1.289 +StdinSML 1 0 0 0 New_Proof;
1.290 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
1.291 + "solveFor x","errorBound (eps=0)",
1.292 + "solutions L"];
1.293 +val (dI',pI',mI') =
1.294 + ("Test.thy",["sqroot-test","univariate","equation","test"],
1.295 + ("Test.thy","sqrt-equ-test"));
1.296 +val Script sc = (#scr o get_met) ("Test.thy","sqrt-equ-test");
1.297 +writeln(term2str sc);
1.298 +"--- s1 ---";
1.299 +val (_,1,1,1,[],[_,_,FormKF (_,_,_,_,f),Select _,req],_) =
1.300 +
1.301 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
1.302 +"--- !!! x1 --- strange choice"; (*TODO 31.10.00: hier nochmals spec ?!?!?*)
1.303 +StdinSML 1 1 ~1 ~1 (RuleFK (Rewrite_Set "norm_equation"));
1.304 +"--- !!! x2 --- ME knows nxt_step";
1.305 +StdinSML 1 1 ~2 ~2 (RuleFK (Rewrite_Set "Test_simplify"));
1.306 +"--- !!! x3 --- helpless !!!";
1.307 +val (_,_,_,_,_,[FormKF (_,_,_,_,res),_,requ],_) =
1.308 +StdinSML 1 1 ~3 ~3 (RuleFK (Rewrite_Set "rearrange_assoc"));
1.309 +"--- !!! x4 ---";
1.310 +val (_,_,_,_,_,[FormKF (_,_,_,_,res),_,requ],_) =
1.311 +StdinSML 1 1 ~4 ~4 (RuleFK (Rewrite_Set "isolate_root"));
1.312 +"--- !!! x5 --- back at original equation !!!";
1.313 +val (_,_,_,_,_,[FormKF (_,_,_,_,res),_,requ],_) =
1.314 +
1.315 +StdinSML 1 1 ~5 ~5 (RuleFK (Rewrite_Set "Test_simplify"));
1.316 +if res="sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)"
1.317 +then () else raise error "new behaviour in test-example";
1.318 +
1.319 +"--- !!! x6 --- not applicable";
1.320 +val (_,_,_,_,_,[Error_ err,Select _,requ],_) =
1.321 +StdinSML 1 1 ~6 ~6 (RuleFK (Rewrite_Set "Test_simplify"));
1.322 +
1.323 +val (_,_,_,_,_,[RuleKF r,FormKF (_,_,_,_,f),requ],_) =
1.324 +StdinSML 1 1 ~6 ~6 (Command YourTurn);
1.325 +
1.326 +StdinSML 1 1 ~7 ~7 (Command ActiveMinus);
1.327 +StdinSML 1 1 ~7 ~7 (Command ActiveMinus);
1.328 +StdinSML 1 1 ~7 ~7 (Command ActiveMinus);
1.329 +StdinSML 1 1 ~7 ~7 (Command ActiveMinus);(*acti=0*)
1.330 +StdinSML 1 1 ~7 ~7 (Command SpeedPlus);(*speed=2:PutRule,TskipS..PutRuleRes,Tt.*)
1.331 +StdinSML 1 1 ~7 ~7 (Command Accept);
1.332 +StdinSML 1 1 ~8 ~8 (Command Accept);
1.333 +StdinSML 1 1 ~9 ~9 (Command Accept);
1.334 +StdinSML 1 1 ~10 ~10 (Command Accept);
1.335 +StdinSML 1 1 ~11 ~11 (Command Accept);
1.336 +StdinSML 1 1 ~12 ~12 (Command Accept);
1.337 +StdinSML 1 1 ~13 ~13 (Command Accept);
1.338 +StdinSML 1 1 ~14 ~14 (Command Accept);
1.339 +
1.340 +(*17.9.02: nach Umbau KB wird Equ immer gr"osser ?!-----
1.341 +StdinSML 1 1 ~15 ~15 (Command Accept);
1.342 +StdinSML 1 1 ~16 ~16 (Command Accept);
1.343 +StdinSML 1 1 ~17 ~17 (Command Accept);
1.344 +StdinSML 1 1 ~18 ~18 (Command Accept);
1.345 +val (_,1,1,_,_,[FormKF (~20,_,0,_,f),req],_) =
1.346 +StdinSML 1 1 ~19 ~19 (Command Accept);
1.347 +if f="[x = 4]" then () else raise error "new behaviour in test-example";
1.348 +
1.349 +val (_,1,1,~20,[],[Request "start another example",End_Proof],_) =
1.350 +StdinSML 1 1 ~20 ~20 (Command Accept);
1.351 +--------------------------------------------------------------------*)
1.352 +
1.353 +(*
1.354 +"=====================================";=====@@@@@=====
1.355 + use"test-FE-KE.sml";
1.356 + *)
1.357 +
1.358 +
1.359 +" ------------- test-FE-KE.sml: test100 ------------- ";
1.360 +" ------------- test-FE-KE.sml: test100 ------------- ";
1.361 +" ------------- test-FE-KE.sml: test100 ------------- ";
1.362 +" ------------- test-FE-KE.sml: test100 ------------- ";
1.363 +" ------------- test-FE-KE.sml: test100 ------------- ";
1.364 +" ------------- test-FE-KE.sml: test100 ------------- ";
1.365 +StdinSML 0 0 0 0 New_User;
1.366 +StdinSML 1 0 0 0 New_Proof;
1.367 +val fmz = ["realTestGiven (0+0)*(1*(1*a))",
1.368 + "realTestFind a"];
1.369 +val (dI',pI',mI') =
1.370 + ("Script.thy",["Script.thy","pbl-testterm"],
1.371 + ("Script.thy","met-testterm"));
1.372 +"--- s1 ---";
1.373 +(*
1.374 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
1.375 +*** Type unification failed: Clash of types "Descript.una" and "RealDef.real".
1.376 +*)
1.377 +"--- s2 ---";
1.378 +(*too many problems with setup of this example*)
1.379 +
1.380 +
1.381 +" _________________ stdin: root_equ: Auto ________________ ";
1.382 +" _________________ stdin: root_equ: Auto ________________ ";
1.383 +" _________________ stdin: root_equ: Auto ________________ ";
1.384 +" _________________ stdin: root_equ: Auto ________________ ";
1.385 +" _________________ stdin: root_equ: Auto ________________ ";
1.386 +proofs:= []; dials:=([],[],[]);
1.387 +StdinSML 0 0 0 0 New_User;
1.388 +set_dstate 1 spec_hide 4 1;
1.389 +StdinSML 1 0 0 0 New_Proof;
1.390 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
1.391 + "solveFor x","errorBound (eps=0)",
1.392 + "solutions L"];
1.393 +val (dI',pI',mI') =
1.394 + ("Test.thy",["sqroot-test","univariate","equation","test"],
1.395 + ("Test.thy","sqrt-equ-test"));
1.396 +"--- s1 ---";
1.397 +val (_,1,1,1,[],[_,_,FormKF (_,_,_,_,f),Select _,req],_) =
1.398 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
1.399 +
1.400 +val (_,1,1,~1,[],
1.401 + [RuleKF _,_,_,_,_,_,_,_,_,_,_,_,_,_,_,req,End_Proof],_) =
1.402 +StdinSML 1 1 ~1 ~1 (Command Auto);
1.403 +
1.404 +
1.405 +
1.406 +"######################### test-FE_KE.sml complete #####################";
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/src/sml/systest/calculate.sml Thu Apr 17 18:01:03 2003 +0200
2.3 @@ -0,0 +1,455 @@
2.4 +(* use"tests/calculate.sml";
2.5 + use"calculate.sml";
2.6 + *)
2.7 +(*contents
2.8 +" ================= calculate.sml: calculate_ ======================== ";
2.9 +" ================= calculate.sml: aus script ======================== ";
2.10 +" ================= calculate.sml: from test-root-equ.sml ================== ";
2.11 +" ================= calculate.sml: 2.8.02 check test-root-equ ======== ";
2.12 +" ================= calculate.sml:10.8.02 2002:///->/ ======== ";
2.13 +" ================= calculate.sml: calculate_ 2002 =================== ";
2.14 +" ================= eval_binop Float =================== ";
2.15 +*)
2.16 +
2.17 +(* [("Var",("Tools.Var",fn)),("Length",("Tools.Length",fn)),
2.18 + ("Nth",("Tools.Nth",fn)),
2.19 + ("power_",("Atools.pow",fn)),("plus",("op +",fn)),("times",("op *",fn)),
2.20 + ("is_const",("Atools.is'_const",fn)),
2.21 + ("le",("op <",fn)),("leq",("op <=",fn)),
2.22 + ("ident",("Atools.ident",fn))] *)
2.23 +
2.24 +" ================= calculate.sml: calculate_ ======================== ";
2.25 +" ================= calculate.sml: calculate_ ======================== ";
2.26 +" ================= calculate.sml: calculate_ ======================== ";
2.27 +
2.28 +
2.29 +val thy = Test.thy;
2.30 +val t = (term_of o the o (parse thy)) "1+2";
2.31 +val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"plus"))) t;
2.32 +
2.33 +val t = (term_of o the o (parse thy)) "((1+2)*4/3)^^^2";
2.34 +val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"plus"))) t;
2.35 +val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.36 +Sign.string_of_term (sign_of thy) t;
2.37 +(*val it = "(#3 * #4 // #3) ^^^ #2" : string*)
2.38 +val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"times"))) t;
2.39 +val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.40 +Sign.string_of_term (sign_of thy) t;
2.41 +(*val it = "(#12 // #3) ^^^ #2" : string*)
2.42 +val Some (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"divide_")))t;
2.43 +val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.44 +Sign.string_of_term (sign_of thy) t;
2.45 +(*it = "#4 ^^^ #2" : string*)
2.46 +val Some (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"power_")))t;
2.47 +val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.48 +Sign.string_of_term (sign_of thy) t;
2.49 +(*val it = "#16" : string*)
2.50 +if it <> "16" then raise error "calculate.sml: new behaviour in calculate_"
2.51 +else ();
2.52 +
2.53 +" ================= calculate.sml: aus script ======================== ";
2.54 +" ================= calculate.sml: aus script ======================== ";
2.55 +" ================= calculate.sml: aus script ======================== ";
2.56 +
2.57 +store_pbt
2.58 + (prep_pbt Test.thy
2.59 + (["test"],
2.60 + [],
2.61 + e_rls, None, []));
2.62 +store_pbt
2.63 + (prep_pbt Test.thy
2.64 + (["calculate","test"],
2.65 + [("#Given" ,["realTestGiven t_"]),
2.66 + ("#Find" ,["realTestFind s_"])
2.67 + ],
2.68 + e_rls, None, [("Test.thy","test_calculate")]));
2.69 +
2.70 +methods:= overwritel (!methods,
2.71 +[
2.72 + prep_met
2.73 + (("Test.thy","test_calculate"):metID,
2.74 + [("#Given" ,["realTestGiven t_"]),
2.75 + ("#Find" ,["realTestFind s_"])
2.76 + ],
2.77 + {rew_ord'="sqrt_right",rls'=tval_rls,srls=e_rls,prls=e_rls,
2.78 + calc=[("plus" ,("op +" ,eval_binop "#add_")),
2.79 + ("times" ,("op *" ,eval_binop "#mult_")),
2.80 + ("divide_" ,("HOL.divide" ,eval_cancel "#divide_")),
2.81 + ("power_" ,("Atools.pow" ,eval_binop "#power_"))],
2.82 + asm_rls=[],asm_thm=[]},
2.83 + "Script STest_simplify (t_::real) = \
2.84 + \(Repeat \
2.85 + \ ((Try (Repeat (Calculate plus))) @@ \
2.86 + \ (Try (Repeat (Calculate times))) @@ \
2.87 + \ (Try (Repeat (Calculate divide_))) @@ \
2.88 + \ (Try (Repeat (Calculate power_))))) t_"
2.89 + )
2.90 +]);
2.91 +
2.92 +val fmz = ["realTestGiven (((1+2)*4/3)^^^2)","realTestFind s"];
2.93 +val (dI',pI',mI') =
2.94 + ("Test.thy",["calculate","test"],("Test.thy","test_calculate"));
2.95 +val p = e_pos'; val c = [];
2.96 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
2.97 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
2.98 +(*nxt =("Add_Given",Add_Given "realTestGiven (((#1 + #2) * #4 // #3) ^^^#2)")*)
2.99 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.100 +(*nxt = ("Add_Find",Add_Find "realTestFind s") : string * mstep*)
2.101 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.102 +(*nxt = ("Specify_Domain",Specify_Domain "Test.thy") : string * mstep*)
2.103 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.104 +(*nxt = ("Specify_Problem",Specify_Problem ["calculate","test"])*)
2.105 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.106 +(*nxt = ("Specify_Method",Specify_Method ("Test.thy","test_calculate"))*)
2.107 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.108 +(*nxt = ("Apply_Method",Apply_Method ("Test.thy","test_calculate"))*)
2.109 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.110 +(*nxt = ("Calculate",Calculate "plus")*)
2.111 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.112 +(*nxt = ("Calculate",Calculate "times")*)
2.113 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.114 +(*nxt = ("Calculate",Calculate "divide_")*)
2.115 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.116 +(*nxt = ("Calculate",Calculate "power_")*)
2.117 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.118 +(*nxt = ("Check_Postcond",Check_Postcond ["calculate","test"])*)
2.119 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
2.120 +(*nxt = ("End_Proof'",End_Proof')*)
2.121 +if f = Form' (FormKF (~1,EdUndef,0,Nundef,"16")) then ()
2.122 +else raise error "calculate.sml: script test_calculate changed behaviour";
2.123 +
2.124 +
2.125 +
2.126 +
2.127 +" ================= calculate.sml: from test-root-equ.sml ================== ";
2.128 +" ================= calculate.sml: from test-root-equ.sml ================== ";
2.129 +" ================= calculate.sml: from test-root-equ.sml ================== ";
2.130 +val thy' = "Test.thy";
2.131 +val ct = "1 + 2";
2.132 +val (ct,thm') = the (calculate thy' (the(assoc(calclist,"plus"))) ct);
2.133 +(*val ct = "#3" : string
2.134 +val thm' = ("#add_#1_#2","\"#1 + #2 = #3\"") : thm'*)
2.135 +
2.136 +"----- me -----";
2.137 +val (dI',pI',mI') = ("Test.thy",e_pblID,
2.138 + ("Test.thy","sqrt-equ-test"));
2.139 +val p = e_pos'; val c = [];
2.140 +val (mI,m) = ("Init_Proof",Init_Proof ([], (dI',pI',mI')));
2.141 +val (p,_,_,_,_,pt) = me (mI,m) p c EmptyPtree;
2.142 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
2.143 +val (p,_,_,_,_,pt) = me nxt p c pt;
2.144 +val (pt,_) = cappend_atomic pt [1] e_istate "1 + 2"
2.145 + (Calculate "test") ct Complete;
2.146 +val p = ([1],Frm):pos';
2.147 +val nxt = ("Calculate",Calculate "plus");
2.148 +val (p,_,f,nxt,_,pt)=me nxt p c pt;
2.149 +Compiler.Control.Print.printDepth:=9; (*4 default*)
2.150 +(* Nd (PblObj...
2.151 + [Nd (PrfObj
2.152 + {branch=NoBranch,cell=[],form="#1 + #2",loc=(([],None),([],None)),
2.153 + mstep=Calculate "plus",ostate=Complete,result="#3"},[])]) : squ*)
2.154 +Compiler.Control.Print.printDepth:=4; (*4 default*)
2.155 +
2.156 +val (pt,_) = cappend_atomic pt [1] e_istate "6/4"
2.157 + (Calculate "test") ct Complete;
2.158 +val p = ([1],Frm):pos';
2.159 +val nxt = ("Calculate",Calculate "divide_");
2.160 +val (p,_,f,nxt,_,pt)=me nxt p c pt;
2.161 +(*{branch=NoBranch,cell=[],form="#6 // #4",loc=(([],None),([],None)),
2.162 + mstep=Calculate "divide_",ostate=Complete,result="#3 // #2"},[])]) *)
2.163 +
2.164 +(*5.7.00: interne ops in calclist*)
2.165 +
2.166 +
2.167 +" ================= calculate.sml: 2.8.02 check test-root-equ ======== ";
2.168 +" ================= calculate.sml: 2.8.02 check test-root-equ ======== ";
2.169 +" ================= calculate.sml: 2.8.02 check test-root-equ ======== ";
2.170 +(*(1): 2nd Test_simplify didn't work:
2.171 +val ct =
2.172 + "sqrt (x ^^^ 2 + -3 * x) = (-3 + 2 * x + -1 * (9 + 4 * x)) / (-1 * 2)"
2.173 +> val rls = ("Test_simplify");
2.174 +> val (ct,_) = the (rewrite_set thy' ("tval_rls") false rls ct);
2.175 +val ct = "sqrt (x ^^^ 2 + -3 * x) =
2.176 +(-9) / (-2) + (-3 / (-2) + (x * ((-4) / (-2)) + x * (2 / (-2))))";
2.177 +ie. cancel does not work properly
2.178 +*)
2.179 + val thy = "Test.thy";
2.180 + val op_ = "divide_";
2.181 + val ct = "sqrt (x ^^^ 2 + -3 * x) =\
2.182 + \(-9) / (-2) + (-3 / (-2) + (x * ((-4) / (-2)) + x * (2 / (-2))))";
2.183 + val Some (ct,_) = calculate thy (the(assoc(calclist,op_))) ct;
2.184 + writeln ct;
2.185 +(*
2.186 + sqrt (x ^^^ 2 + -3 * x) =\
2.187 + \(-9) / (-2) + (-3 / (-2) + (x * ((-4) / (-2)) + x * (2 / (-2))))
2.188 +............... does not work *)
2.189 +
2.190 +(*--------------(2): does divide work in Test_simplify ?: ------*)
2.191 + val thy = Test.thy;
2.192 + val t = (term_of o the o (parse thy)) "6 / 2";
2.193 + val rls = Test_simplify;
2.194 + val (t,_) = the (rewrite_set_ thy false rls t);
2.195 +(*val t = Free ("3","RealDef.real") : term*)
2.196 +
2.197 + val thy = "Test.thy";
2.198 + val t = "6 / 2";
2.199 + val rls = "Test_simplify";
2.200 + val (t,_) = the (rewrite_set thy false rls t);
2.201 +(*val t = "3" : string
2.202 + ....... works, thus: which rule in SqRoot_simplify works differently ?*)
2.203 +
2.204 +
2.205 +(*--------------(3): is_const works ?: -------------------------------------*)
2.206 + val t = (term_of o the o (parse Test.thy)) "2 is_const";
2.207 + atomty Test.thy t;
2.208 + rewrite_set_ Test.thy false tval_rls t;
2.209 +(*val it = Some (Const ("True","bool"),[]) ... works*)
2.210 +
2.211 +
2.212 +(*--------------(4): check bottom up: ---------------------------*)
2.213 +(*-------------- eval_cancel works: *)
2.214 + trace_rewrite:=true;
2.215 + val thy = Test.thy;
2.216 + val t = (term_of o the o (parse thy)) "(-4) / 2";
2.217 + val Some (_,t) = eval_cancel "xxx" 111 t thy;
2.218 + term2str t;
2.219 +"-4 / 2 = (-2)";
2.220 +(*-------------- but ... *)
2.221 + val ct = "x + (-4) / 2";
2.222 + val (ct,_) = the (rewrite_set thy' false rls ct);
2.223 +"(-2) + x";
2.224 +(*-------------- while ... *)
2.225 + val ct = "(-4) / 2";
2.226 + val (ct,_) = the (rewrite_set thy' false rls ct);
2.227 +"(-2)";
2.228 +
2.229 +(*--------------(5): reproduce (1) with simpler term: ------------*)
2.230 + val thy = "Test.thy";
2.231 + val t = "(3+5)/2";
2.232 + val (t,_) = the (rewrite_set thy false rls t);
2.233 +(*val t = "4" ... works*)
2.234 +
2.235 + val t = "(3+1+2*x)/2";
2.236 + val (t,_) = the (rewrite_set thy false rls t);
2.237 +(*val t = "2 + x" ... works*)
2.238 +
2.239 + val t = "(3+(1+2*x))/2";
2.240 + val (t,_) = the (rewrite_set thy false rls t);
2.241 +(*val t = "2 + x" ... works: give up----------------------------------------*)
2.242 +
2.243 +
2.244 +
2.245 +(*--- trace_rewrite before correction of ... --------------------
2.246 + val ct = "(-3 + 2 * x + -1) / 2";
2.247 + val (ct,_) = the (rewrite_set thy' false rls ct);
2.248 +:
2.249 +### trying thm 'root_ge0_2'
2.250 +### rewrite_set_: x + (-1 + -3) / 2
2.251 +### trying thm 'radd_real_const_eq'
2.252 +### trying thm 'radd_real_const'
2.253 +### rewrite_set_: x + (-4) / 2
2.254 +### trying thm 'rcollect_right'
2.255 +:
2.256 +"x + (-4) / 2"
2.257 +-------------------------------------while before Isabelle20002:
2.258 + val ct = "(#-3 + #2 * x + #-1) // #2";
2.259 + val (ct,_) = the (rewrite_set thy' false rls ct);
2.260 +:
2.261 +### trying thm 'root_ge0_2'
2.262 +### rewrite_set_: x + (#-1 + #-3) // #2
2.263 +### trying thm 'radd_real_const_eq'
2.264 +### trying thm 'radd_real_const'
2.265 +### rewrite_set_: x + #-4 // #2
2.266 +### rewrite_set_: x + #-2
2.267 +### trying thm 'rcollect_right'
2.268 +:
2.269 +"#-2 + x"
2.270 +-----------------------------------------------------------------*)
2.271 +
2.272 +
2.273 + toggle trace_rewrite;
2.274 +(*===================*)
2.275 + trace_rewrite:=true;
2.276 + val thy' = "Test.thy";
2.277 + val rls = "Test_simplify";
2.278 + val ct = "x + (-1 + -3) / 2";
2.279 + val (ct,_) = the (rewrite_set thy' false rls ct);
2.280 +"x + (-4) / 2";
2.281 +(*
2.282 +### trying calc. 'cancel'
2.283 +@@@ get_pair: binop, t = x + (-4) / 2
2.284 +@@@ get_pair: t else
2.285 +@@@ get_pair: t else -> None
2.286 +@@@ get_pair: binop, t = (-4) / 2
2.287 +@@@ get_pair: then 1
2.288 +@@@ get_pair: t -> None
2.289 +@@@ get_pair: t1 -> None
2.290 +@@@ get_calculation: None
2.291 +### trying calc. 'pow'
2.292 +*)
2.293 +
2.294 + trace_rewrite:=true;
2.295 + val thy' = "Test.thy";
2.296 + val rls = "Test_simplify";
2.297 + val ct = "x + (-4) / 2";
2.298 + val (ct,_) = the (rewrite_set thy' false rls ct);
2.299 +"(-2) + x";
2.300 +(*
2.301 +### trying calc. 'cancel'
2.302 +@@@ get_pair: binop, t = x + -4 / 2
2.303 +@@@ get_pair: t else
2.304 +@@@ get_pair: t else -> None
2.305 +@@@ get_pair: binop, t = -4 / 2
2.306 +@@@ get_pair: then 1
2.307 +@@@ get_calculation: Some #cancel_-4_2
2.308 +### calc. to: x + (-2)
2.309 +### trying calc. 'cancel'
2.310 +*)
2.311 + trace_rewrite:=false;
2.312 +
2.313 +" ================= calculate.sml:10.8.02 2002:///->/ ======== ";
2.314 +" ================= calculate.sml:10.8.02 2002:///->/ ======== ";
2.315 +" ================= calculate.sml:10.8.02 2002:///->/ ======== ";
2.316 +" ----------------- rewriting works ? -----------------------";
2.317 + val thy = Isac.thy;
2.318 + val prop = (#prop o rep_thm) real_divide_1;
2.319 + atomty thy prop;
2.320 +(*** -------------
2.321 +*** Const ( Trueprop, bool => prop)
2.322 +*** . Const ( op =, [real, real] => bool)
2.323 +*** . . Const ( HOL.divide, [real, real] => real)
2.324 +*** . . . Var ((x, 0), real)
2.325 +*** . . . Const ( 1, real)
2.326 +*** . . Var ((x, 0), real) *)
2.327 + val prop' = (#prop o rep_thm o num_str) real_divide_1;
2.328 + atomty thy prop';
2.329 +(*** -------------
2.330 +*** Const ( Trueprop, bool => prop)
2.331 +*** . Const ( op =, [real, real] => bool)
2.332 +*** . . Const ( HOL.divide, [real, real] => real)
2.333 +*** . . . Var ((x, 0), real)
2.334 +*** . . . Free ( 1, real) (*app_num_tr'*)
2.335 +*** . . Var ((x, 0), real)*)
2.336 + val t = (term_of o the o (parseold thy)) "aaa/1";
2.337 + atomty thy t;
2.338 +(*** -------------
2.339 +*** Const ( HOL.divide, ['a, 'a] => 'a)
2.340 +*** . Free ( aaa, 'a)
2.341 +*** . Free ( 1, 'a) *)
2.342 + val t = (term_of o the o (parse thy)) "aaa/1";
2.343 + atomty thy t;
2.344 +(*** -------------
2.345 +*** Const ( HOL.divide, [real, real] => real)
2.346 +*** . Free ( aaa, real)
2.347 +*** . Free ( 1, real) *)
2.348 + val thm = num_str real_divide_1;
2.349 + val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.350 +(*val t = Free ("aaa","RealDef.real") : term*)
2.351 +
2.352 +
2.353 + val prop = (#prop o rep_thm) realpow_eq_one;
2.354 + atomty thy prop;
2.355 +(*** -------------
2.356 +*** Const ( Trueprop, bool => prop)
2.357 +*** . Const ( op =, [real, real] => bool)
2.358 +*** . . Const ( Nat.power, [real, nat] => real)
2.359 +*** . . . Const ( 1, real)
2.360 +*** . . . Var ((n, 0), nat)
2.361 +*** . . Const ( 1, real) *)
2.362 + val prop' = (#prop o rep_thm o num_str) realpow_eq_one;
2.363 + atomty thy prop';
2.364 +(*** -------------
2.365 +*** Const ( Trueprop, bool => prop)
2.366 +*** . Const ( op =, [real, real] => bool)
2.367 +*** . . Const ( Nat.power, [real, nat] => real)
2.368 +*** . . . Free ( 1, real)
2.369 +*** . . . Var ((n, 0), nat)
2.370 +*** . . Free ( 1, real)*)
2.371 + val t = (term_of o the o (parseold thy)) "1 ^ aaa";
2.372 + atomty thy t;
2.373 +(*** -------------
2.374 +*** Const ( Nat.power, ['a, nat] => 'a)
2.375 +*** . Free ( 1, 'a)
2.376 +*** . Free ( aaa, nat) *)
2.377 + val t = (term_of o the o (parse thy)) "1 ^ aaa";
2.378 + atomty thy t;
2.379 +(*** -------------
2.380 +*** Const ( Nat.power, [real, nat] => real)
2.381 +*** . Free ( 1, real)
2.382 +*** . Free ( aaa, nat) .......................... nat !!! *)
2.383 + val thm = num_str realpow_eq_one;
2.384 + val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.385 +(*val t = Free ("1","RealDef.real") : term*)
2.386 +
2.387 +" ================= calculate.sml: calculate_ 2002 =================== ";
2.388 +" ================= calculate.sml: calculate_ 2002 =================== ";
2.389 +" ================= calculate.sml: calculate_ 2002 =================== ";
2.390 +
2.391 +val thy = Test.thy;
2.392 +val t = (term_of o the o (parse thy)) "12 / 3";
2.393 +val Some (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"divide_")))t;
2.394 +val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.395 +"12 / 3 = 4";
2.396 +val thy = Test.thy;
2.397 +val t = (term_of o the o (parse thy)) "4 ^^^ 2";
2.398 +val Some (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"power_"))) t;
2.399 +val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.400 +"4 ^ 2 = 16";
2.401 +
2.402 + val t = (term_of o the o (parse thy)) "((1 + 2) * 4 / 3) ^^^ 2";
2.403 + val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"plus"))) t;
2.404 +"1 + 2 = 3";
2.405 + val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.406 + Sign.string_of_term (sign_of thy) t;
2.407 +"(3 * 4 / 3) ^^^ 2";
2.408 + val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"times")))t;
2.409 +"3 * 4 = 12";
2.410 + val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.411 + Sign.string_of_term (sign_of thy) t;
2.412 +"(12 / 3) ^^^ 2";
2.413 + val Some (thmID,thm) =get_calculation_ thy(the(assoc(calclist,"divide_")))t;
2.414 +"12 / 3 = 4";
2.415 + val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.416 + Sign.string_of_term (sign_of thy) t;
2.417 +"4 ^^^ 2";
2.418 + val Some (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"power_")))t;
2.419 +"4 ^^^ 2 = 16";
2.420 + val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
2.421 + Sign.string_of_term (sign_of thy) t;
2.422 +"16";
2.423 + if it <> "16" then raise error "calculate.sml: new behaviour in calculate_"
2.424 + else ();
2.425 +
2.426 +(*13.9.02 *** calc: operator = pow not defined*)
2.427 + val t = (term_of o the o (parse thy)) "3^^^2";
2.428 + val Some (thmID,thm) =
2.429 + get_calculation_ thy (the(assoc(calclist,"power_"))) t;
2.430 +(*** calc: operator = pow not defined*)
2.431 +
2.432 + val (op_, eval_fn) = the (assoc(calclist,"power_"));
2.433 + (*
2.434 +val op_ = "Atools.pow" : string
2.435 +val eval_fn = fn : string -> term -> theory -> (string * term) option*)
2.436 +
2.437 + val Some (thmid,t') = get_pair thy op_ eval_fn t;
2.438 +(*** calc: operator = pow not defined*)
2.439 +
2.440 + val Some (id,t') = eval_fn op_ t thy;
2.441 +(*** calc: operator = pow not defined*)
2.442 +
2.443 + val (thmid, (Const (op0,t0) $ Free (n1,t1) $ Free(n2,t2))) = (op_, t);
2.444 + val Some (id,t') = eval_binop thmid op_ t thy;
2.445 +(*** calc: operator = pow not defined*)
2.446 +
2.447 +
2.448 +
2.449 +" ================= eval_binop Float =================== ";
2.450 +val t = str2term "Float ((1,2),(0,0))";
2.451 +atomty thy t;
2.452 +val Const ("Float.Float",_) $
2.453 + (Const ("Pair",_) $
2.454 + (Const ("Pair",_) $ Free (i1,_) $ Free (i2,_)) $ _) = t;
2.455 +
2.456 +val t = str2term "Float ((1,2),(0,0)) * Float ((3,4),(0,0))";
2.457 +atomty thy t;
2.458 +(*GOON.10.4.03*)
2.459 \ No newline at end of file
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/src/sml/systest/details.sml Thu Apr 17 18:01:03 2003 +0200
3.3 @@ -0,0 +1,280 @@
3.4 +(* use"../systest/details.sml";
3.5 + use"systest/details.sml";
3.6 + use"details.sml";
3.7 +
3.8 +########################################################
3.9 +is NOT dependent on Test, but on other thys:
3.10 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3.11 +uses from Rational.ML: Rrls cancel_p, Rrls cancel
3.12 +which in turn
3.13 +uses from Poly.ML: Rls make_polynomial, Rls expand_binom
3.14 +########################################################
3.15 +*)
3.16 +"-------- cancel, without detail ------------------------------";
3.17 +"-------- cancel, detail rev-rew (cancel) afterwards ----------";
3.18 +"-------------- cancel_p, without detail ------------------------------";
3.19 +"-------------- cancel_p, detail rev-rew (cancel) afterwards ----------";
3.20 +
3.21 +store_pbt
3.22 + (prep_pbt Test.thy
3.23 + (["test"],
3.24 + [],
3.25 + e_rls, None, []));
3.26 +store_pbt
3.27 + (prep_pbt Test.thy
3.28 + (["detail","test"],
3.29 + [("#Given" ,["realTestGiven t_"]),
3.30 + ("#Find" ,["realTestFind s_"])
3.31 + ],
3.32 + e_rls, None, [("Test.thy","test_detail")]));
3.33 +
3.34 +methods:= overwritel (!methods,
3.35 +[
3.36 + prep_met
3.37 + (("Test.thy","test_detail_binom"):metID,
3.38 + [("#Given" ,["realTestGiven t_"]),
3.39 + ("#Find" ,["realTestFind s_"])
3.40 + ],
3.41 + {rew_ord'="sqrt_right",rls'=tval_rls,calc = [],srls=e_rls,prls=e_rls,
3.42 + asm_rls=[],asm_thm=[("real_mult_div_cancel2","")]},
3.43 + "Script Testterm (g_::real) = \
3.44 + \(((Rewrite_Set expand_binoms False) @@\
3.45 + \ (Rewrite_Set cancel False)) g_)"
3.46 + ),
3.47 + prep_met
3.48 + (("Test.thy","test_detail_poly"):metID,
3.49 + [("#Given" ,["realTestGiven t_"]),
3.50 + ("#Find" ,["realTestFind s_"])
3.51 + ],
3.52 + {rew_ord'="sqrt_right",rls'=tval_rls,calc=[],srls=e_rls,prls=e_rls,
3.53 + asm_rls=[],asm_thm=[("real_mult_div_cancel2","")]},
3.54 + "Script Testterm (g_::real) = \
3.55 + \(((Rewrite_Set make_polynomial False) @@\
3.56 + \ (Rewrite_Set cancel_p False)) g_)"
3.57 + )]);
3.58 +
3.59 +(*---- funktionieren mit Rationals.ML: dummy-Funktionen(1)--------*)
3.60 +
3.61 +"-------- cancel, without detail ------------------------------";
3.62 +"-------- cancel, without detail ------------------------------";
3.63 +"-------- cancel, without detail ------------------------------";
3.64 +val fmz = ["realTestGiven (((3 + x) * (3 - x)) / ((3 + x) * (3 + x)))",
3.65 + "realTestFind s"];
3.66 +val (dI',pI',mI') =
3.67 + ("Test.thy",["detail","test"],("Test.thy","test_detail_binom"));
3.68 +
3.69 +val p = e_pos'; val c = [];
3.70 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
3.71 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
3.72 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.73 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.74 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.75 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.76 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.77 +(*nxt = ("Apply_Method",Apply_Method ("Test.thy","test_detail"))*)
3.78 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.79 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.80 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.81 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.82 +(*"(3 + -1 * x) / (3 + x)"*)
3.83 +if nxt = ("End_Proof'",End_Proof') then ()
3.84 +else raise error "details.sml, changed behaviour in: without detail";
3.85 +
3.86 +
3.87 +"-------- cancel, detail rev-rew (cancel) afterwards ----------";
3.88 +"-------- cancel, detail rev-rew (cancel) afterwards ----------";
3.89 +"-------- cancel, detail rev-rew (cancel) afterwards ----------";
3.90 + val p = e_pos'; val c = [];
3.91 + val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
3.92 + val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
3.93 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.94 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.95 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.96 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.97 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.98 + (*nxt = ("Apply_Method",Apply_Method ("Test.thy","test_detail"))*)
3.99 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.100 + (*val nxt = ("Rewrite_Set",Rewrite_Set "expand_binoms")*)
3.101 + val (p,_,f,nxt,_,pt) = me nxt p [] pt; (* rewrite must exist for Detail*)
3.102 + val nxt = ("Detail",Detail);"----------------------";
3.103 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.104 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.105 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.106 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.107 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.108 + (*val nxt = ("End_Detail",End_Detail)*)
3.109 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.110 + (*val nxt = ("Rewrite_Set",Rewrite_Set "cancel")*)
3.111 + val (p,_,f,nxt,_,pt) = me nxt p [] pt; (* rewrite must exist for Detail*)
3.112 + val nxt = ("Detail",Detail);"----------------------";
3.113 + val (p,_,f,nxt,_,pt) = (me nxt p [] pt) handle e => print_exn e;
3.114 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.115 +(*15.10.02*)
3.116 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.117 +(*
3.118 +rewrite "Rationals.thy" "tless_true""e_rls"true("sym_real_plus_minus_binom","")
3.119 + "3 ^^^ 2 - x ^^^ 2";
3.120 +*)
3.121 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.122 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.123 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.124 + val (p,_,f,nxt,_,pt) = (me nxt p [] pt) handle e => print_exn e;
3.125 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.126 +if f = Form' (FormKF (~1,EdUndef,0,Nundef,"(3 - x) / (3 + x)"))
3.127 + andalso nxt = ("End_Proof'",End_Proof') then ()
3.128 +else raise error "new behaviour in details.sml, \
3.129 + \cancel, rev-rew (cancel) afterwards";
3.130 +
3.131 +(*---- funktionieren mit Rationals.ML: dummy-Funktionen(1)--------*)
3.132 +
3.133 +"-------------- cancel_p, without detail ------------------------------";
3.134 +"-------------- cancel_p, without detail ------------------------------";
3.135 +"-------------- cancel_p, without detail ------------------------------";
3.136 +val fmz = ["realTestGiven (((3 + x)*(3+(-1)*x)) / ((3+x) * (3+x)))",
3.137 + "realTestFind s"];
3.138 +val (dI',pI',mI') =
3.139 + ("Test.thy",["detail","test"],("Test.thy","test_detail_poly"));
3.140 +
3.141 +val p = e_pos'; val c = [];
3.142 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
3.143 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
3.144 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.145 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.146 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.147 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.148 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.149 +(*nxt = ("Apply_Method",Apply_Method ("Test.thy","test_detail"))*)
3.150 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.151 +"(3 + x) * (3 + -1 * x) / ((3 + x) * (3 + x))";
3.152 +
3.153 + (*14.3.03*)
3.154 + val t = str2term "(3 + x) * (3 + -1 * x) / ((3 + x) * (3 + x))";
3.155 + val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
3.156 + "(9 + - (x ^^^ 2)) / (9 + 6 * x + x ^^^ 2)";
3.157 + val Some (t,_) = rewrite_set_ thy false cancel_p t; term2str t;
3.158 + cancel_p_ thy t;
3.159 +
3.160 + val t = str2term "(3 + x) * (3 + -1 * x)";
3.161 + val Some (t,_) = rewrite_set_ thy false expand_poly t; term2str t;
3.162 + "3 * 3 + 3 * (-1 * x) + (x * 3 + x * (-1 * x))";
3.163 + val Some (t,_) = rewrite_set_ thy false order_add_mult t; term2str t;
3.164 + "3 * 3 + (3 * x + (-1 * (3 * x) + -1 * (x * x)))";
3.165 + val Some (t,_) = rewrite_set_ thy false simplify_power t; term2str t;
3.166 + "3 ^^^ 2 + (3 * x + (-1 * (3 * x) + -1 * x ^^^ 2))";
3.167 + val Some (t,_) = rewrite_set_ thy false collect_numerals t; term2str t;
3.168 + "9 + (0 * x + -1 * x ^^^ 2)";
3.169 + val Some (t,_) = rewrite_set_ thy false reduce_012 t; term2str t;
3.170 + "9 + - (x ^^^ 2)";
3.171 + (*14.3.03*)
3.172 +
3.173 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.174 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.175 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.176 +(*"(3 + -1 * x) / (3 + x)"*)
3.177 +if nxt = ("End_Proof'",End_Proof') then ()
3.178 +else raise error "details.sml, changed behaviour in: cancel_p, without detail";
3.179 +
3.180 +"-------------- cancel_p, detail rev-rew (cancel) afterwards ----------";
3.181 +"-------------- cancel_p, detail rev-rew (cancel) afterwards ----------";
3.182 +"-------------- cancel_p, detail rev-rew (cancel) afterwards ----------";
3.183 + val p = e_pos'; val c = [];
3.184 + val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
3.185 + val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
3.186 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.187 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.188 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.189 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.190 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.191 + (*nxt = ("Apply_Method",Apply_Method ("Test.thy","test_detail_poly"))*)
3.192 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.193 + (*val nxt = ("Rewrite_Set",Rewrite_Set "make_polynomial")*)
3.194 + val (p,_,f,nxt,_,pt) = me nxt p [] pt; (* rewrite must exist for Detail*)
3.195 +
3.196 +(*14.3.03.FIXXXXXME since Isa02/reverse-rew.sml:
3.197 + fun make_deriv ... Rls_ not yet impl. (| Thm | Calc)
3.198 + Rls_ needed for make_polynomial ----------------------
3.199 + val nxt = ("Detail",Detail);"----------------------";
3.200 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.201 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.202 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.203 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.204 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.205 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.206 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.207 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.208 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.209 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.210 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.211 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.212 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.213 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.214 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.215 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.216 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.217 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.218 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.219 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.220 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.221 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.222 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.223 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.224 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.225 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.226 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.227 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.228 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.229 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.230 + if nxt = ("End_Detail",End_Detail) then ()
3.231 + else raise error "details.sml: new behav. in Detail make_polynomial";
3.232 +----------------------------------------------------------------------*)
3.233 +
3.234 +(*---------------
3.235 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.236 + (*val nxt = ("Rewrite_Set",Rewrite_Set "cancel_p")*)
3.237 + val (p,_,f,nxt,_,pt) = me nxt p [] pt; (* rewrite must exist for Detail*)
3.238 + val nxt = ("Detail",Detail);"----------------------";
3.239 + val (p,_,f,nxt,_,pt) = (me nxt p [] pt) handle e => print_exn e;
3.240 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.241 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.242 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.243 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.244 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.245 + val (p,_,f,nxt,_,pt) = (me nxt p [] pt) handle e => print_exn e;
3.246 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.247 +if f = Form' (FormKF (~1,EdUndef,0,Nundef,"(3 + x) / (3 - x)"))
3.248 + andalso nxt = ("End_Proof'",End_Proof') then ()
3.249 +else raise error "new behaviour in details.sml, cancel_p afterwards";
3.250 +
3.251 +----------------*)
3.252 +
3.253 +
3.254 +
3.255 +
3.256 +
3.257 +val fmz = ["realTestGiven ((x+3)+(-1)*(2+6*x))",
3.258 + "realTestFind s"];
3.259 +val (dI',pI',mI') =
3.260 + ("Test.thy",["detail","test"],("Test.thy","test_detail_poly"));
3.261 +
3.262 + val p = e_pos'; val c = [];
3.263 + val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
3.264 + val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
3.265 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.266 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.267 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.268 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.269 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.270 + (*nxt = ("Apply_Method",Apply_Method ("Test.thy","test_detail_poly"))*)
3.271 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.272 +(*16.10.02 --- kommt auf POLY_EXCEPTION ?!??? ----------------------------
3.273 + (*val nxt = ("Rewrite_Set",Rewrite_Set "make_polynomial")*)
3.274 + val (p,_,f,nxt,_,pt) = me nxt p [] pt; (* rewrite must exist for Detail*)
3.275 + val nxt = ("Detail",Detail);"----------------------";
3.276 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.277 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.278 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.279 + val (p,_,f,nxt,_,pt) = me nxt p [] pt;
3.280 +-------------------------------------------------------------------------*)
3.281 +
3.282 +
3.283 +
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/src/sml/systest/list_rls.sml Thu Apr 17 18:01:03 2003 +0200
4.3 @@ -0,0 +1,32 @@
4.4 +(* use"tests/list_rls.sml";
4.5 + W.N. 8.01
4.6 + only one item per file for test-impl.
4.7 +*)
4.8 +
4.9 +
4.10 +val thy' = "ListG.thy";
4.11 +val ct = "length_ [1,1,1]";
4.12 +val thm = ("length_Cons_","");
4.13 +val (ct,asm) = the (rewrite thy' "tless_true" ("tval_rls") false thm ct);
4.14 +val (ct,asm) = the (rewrite thy' "tless_true" ("tval_rls") false thm ct);
4.15 +val (ct,asm) = the (rewrite thy' "tless_true" ("tval_rls") false thm ct);
4.16 +val thm = ("length_Nil_","");
4.17 +val (ct,asm) = the (rewrite thy' "tless_true" ("tval_rls") false thm ct);
4.18 +if ct="1 + (1 + (1 + 0))"then()
4.19 +else raise error ("list_rls.sml 1: behaviour of test-expl changed: "^ct);
4.20 +
4.21 +
4.22 +val ct = "length_ [1,1,1]";
4.23 +val rls = "list_rls";
4.24 +val (ct,asm) = the (rewrite_set thy' false rls ct);
4.25 +if ct="3"then()
4.26 +else raise error ("list_rls.sml 2: behaviour of test-expl changed: "^ct);
4.27 +
4.28 +
4.29 +val ct = "length_ [1,1,1]";
4.30 +val t = (term_of o the o (parse ListG.thy)) ct;
4.31 +val t = eval_listexpr_ ListG.thy list_rls t;
4.32 +case t of Free ("3",_) => ()
4.33 +| _ => raise error ("list-rls.sml 3: behaviour of test-expl changed: "^ct);
4.34 +
4.35 +
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/src/sml/systest/refine.sml Thu Apr 17 18:01:03 2003 +0200
5.3 @@ -0,0 +1,396 @@
5.4 +(* intermediately stores !ptyps
5.5 + WN.16.9.01
5.6 + use"tests/refine.sml";
5.7 + *)
5.8 +
5.9 +
5.10 +"----------------------- store test-pbtyps ----------------------------";
5.11 +"----------------------- refin test-pbtyps ----------------------------";
5.12 +"----------------------- refine_ori test-pbtyps ----------------------------";
5.13 +"----------------------- refine test-pbtyps ----------------------------";
5.14 +"----------------------- Refine_Problem (aus subp-rooteq.sml) ---------";
5.15 +
5.16 +
5.17 +
5.18 +
5.19 +"----------------------- store test-pbtyps ----------------------------";
5.20 +val intermediate_ptyps = !ptyps;
5.21 +ptyps:= ([]:ptyps);
5.22 +
5.23 +store_pbt
5.24 + (prep_pbt DiffApp.thy
5.25 + (["pbla"],
5.26 + [("#Given", ["fixedValues a_"])], e_rls, None, []));
5.27 +store_pbt
5.28 + (prep_pbt DiffApp.thy
5.29 + (["pbla1","pbla"],
5.30 + [("#Given", ["fixedValues a_","maximum a1_"])], e_rls, None, []));
5.31 +store_pbt
5.32 + (prep_pbt DiffApp.thy
5.33 + (["pbla2","pbla"],
5.34 + [("#Given", ["fixedValues a_","valuesFor a2_"])], e_rls, None, []));
5.35 +store_pbt
5.36 + (prep_pbt DiffApp.thy
5.37 + (["pbla2x","pbla2","pbla"],
5.38 + [("#Given", ["fixedValues a_","valuesFor a2_","functionOf a2x_"])],
5.39 + e_rls, None, []));
5.40 +store_pbt
5.41 + (prep_pbt DiffApp.thy
5.42 + (["pbla2y","pbla2","pbla"],
5.43 + [("#Given" ,["fixedValues a_","valuesFor a2_","boundVariable a2y_"])],
5.44 + e_rls, None, []));
5.45 +store_pbt
5.46 + (prep_pbt DiffApp.thy
5.47 + (["pbla2z","pbla2","pbla"],
5.48 + [("#Given" ,["fixedValues a_","valuesFor a2_","interval a2z_"])],
5.49 + e_rls, None, []));
5.50 +store_pbt
5.51 + (prep_pbt DiffApp.thy
5.52 + (["pbla3","pbla"],
5.53 + [("#Given" ,["fixedValues a_","relations a3_"])],
5.54 + e_rls, None, []));
5.55 +
5.56 +show_ptyps();
5.57 +
5.58 +(*case 1: no refinement *)
5.59 +val thy = Isac.thy;
5.60 +val (d1,ts1,vs1) = split_dts thy ((term_of o the o (parse thy))
5.61 + "fixedValues [aaa=0]");
5.62 +val (d2,ts2,vs2) = split_dts thy ((term_of o the o (parse thy))
5.63 + "errorBound (ddd=0)");
5.64 +val ori1 = [(1,[1],"#Given",d1,ts1),
5.65 + (2,[1],"#Given",d2,ts2)]:ori list;
5.66 +
5.67 +
5.68 +(*case 2: refined to pbt without children *)
5.69 +val (d2,ts2,vs2) = split_dts thy ((term_of o the o (parse thy))
5.70 + "relations aaa333");
5.71 +val ori2 = [(1,[1],"#Given",d1,ts1),
5.72 + (2,[1],"#Given",d2,ts2)]:ori list;
5.73 +
5.74 +
5.75 +(*case 3: refined to pbt with children *)
5.76 +val (d2,ts2,vs2) = split_dts thy ((term_of o the o (parse thy))
5.77 + "valuesFor aaa222");
5.78 +val ori3 = [(1,[1],"#Given",d1,ts1),
5.79 + (2,[1],"#Given",d2,ts2)]:ori list;
5.80 +
5.81 +
5.82 +(*case 4: refined to children (without child)*)
5.83 +val (d3,ts3,vs3) = split_dts thy ((term_of o the o (parse thy))
5.84 + "boundVariable aaa222yyy");
5.85 +val ori4 = [(1,[1],"#Given",d1,ts1),
5.86 + (2,[1],"#Given",d2,ts2),
5.87 + (3,[1],"#Given",d3,ts3)]:ori list;
5.88 +
5.89 +"----------------------- refin test-pbtyps ----------------------------";
5.90 +
5.91 +(*case 1: no refinement *)
5.92 +refin [] ori1 (hd (!ptyps));
5.93 +(*val it = Some ["pbla"] : pblID option*)
5.94 +
5.95 +(*case 2: refined to pbt without children *)
5.96 +refin [] ori2 (hd (!ptyps));
5.97 +(*val it = Some ["pbla","pbla3"] : pblID option*)
5.98 +
5.99 +(*case 3: refined to pbt with children *)
5.100 +refin [] ori3 (hd (!ptyps));
5.101 +(*val it = Some ["pbla","pbla2"] : pblID option*)
5.102 +
5.103 +(*case 4: refined to children (without child)*)
5.104 +refin [] ori4 (hd (!ptyps));
5.105 +(*val it = Some ["pbla","pbla2","pbla2y"] : pblID option*)
5.106 +
5.107 +(*case 5: start refinement somewhere in ptyps*)
5.108 +val [Ptyp ("pbla",_,[_, ppp as Ptyp ("pbla2",_,_), _])] = !ptyps;
5.109 +refin ["pbla"] ori4 ppp;
5.110 +(*val it = Some ["pbla2","pbla2y"] : pblRD option*)
5.111 +
5.112 +
5.113 +"----------------------- refine_ori test-pbtyps ----------------------------";
5.114 +
5.115 +(*case 1: no refinement *)
5.116 +refine_ori ori1 ["pbla"];
5.117 +(*val it = None : pblID option !!!!*)
5.118 +
5.119 +(*case 2: refined to pbt without children *)
5.120 +refine_ori ori2 ["pbla"];
5.121 +(*val it = Some ["pbla3","pbla"] : pblID option*)
5.122 +
5.123 +(*case 3: refined to pbt with children *)
5.124 +refine_ori ori3 ["pbla"];
5.125 +(*val it = Some ["pbla2","pbla"] : pblID option*)
5.126 +
5.127 +(*case 4: refined to children (without child)*)
5.128 +val opt = refine_ori ori4 ["pbla"];
5.129 +if opt = Some ["pbla2y","pbla2","pbla"] then ()
5.130 +else raise error "new behaviour in refine.sml case 4";
5.131 +
5.132 +(*case 5: start refinement somewhere in ptyps*)
5.133 +refine_ori ori4 ["pbla2","pbla"];
5.134 +(*val it = Some ["pbla2y","pbla2","pbla"] : pblID option*)
5.135 +
5.136 +
5.137 +"----------------------- refine test-pbtyps ----------------------------";
5.138 +
5.139 +val fmz1 = ["fixedValues [aaa=0]","errorBound (ddd=0)"];
5.140 +val fmz2 = ["fixedValues [aaa=0]","relations aaa333"];
5.141 +val fmz3 = ["fixedValues [aaa=0]","valuesFor aaa222"];
5.142 +val fmz4 = ["fixedValues [aaa=0]","valuesFor aaa222",
5.143 + "boundVariable aaa222yyy"];
5.144 +
5.145 +(*case 1: no refinement *)
5.146 +refine fmz1 ["pbla"];
5.147 +(*
5.148 +*** pass ["pbla"]
5.149 +*** pass ["pbla","pbla1"]
5.150 +*** pass ["pbla","pbla2"]
5.151 +*** pass ["pbla","pbla3"]
5.152 +val it =
5.153 + [Matches
5.154 + (["pbla"],
5.155 + {Find=[],
5.156 + Given=[Correct "fixedValues [aaa = #0]",
5.157 + Superfl "errorBound (ddd = #0)"],Relate=[],Where=[],With=[]}),
5.158 + NoMatch
5.159 + (["pbla1","pbla"],
5.160 + {Find=[],
5.161 + Given=[Correct "fixedValues [aaa = #0]",Missing "maximum a1_",
5.162 + Superfl "errorBound (ddd = #0)"],Relate=[],Where=[],With=[]}),
5.163 + NoMatch
5.164 + (["pbla2","pbla"],
5.165 + {Find=[],
5.166 + Given=[Correct "fixedValues [aaa = #0]",Missing "valuesFor a2_",
5.167 + Superfl "errorBound (ddd = #0)"],Relate=[],Where=[],With=[]}),
5.168 + NoMatch
5.169 + (["pbla3","pbla"],
5.170 + {Find=[],
5.171 + Given=[Correct "fixedValues [aaa = #0]",Missing "relations a3_",
5.172 + Superfl "errorBound (ddd = #0)"],Relate=[],Where=[],With=[]})]
5.173 + : match list*)
5.174 +
5.175 +(*case 2: refined to pbt without children *)
5.176 +refine fmz2 ["pbla"];
5.177 +(*
5.178 +*** pass ["pbla"]
5.179 +*** pass ["pbla","pbla1"]
5.180 +*** pass ["pbla","pbla2"]
5.181 +*** pass ["pbla","pbla3"]
5.182 +val it =
5.183 + [Matches
5.184 + (["pbla"],
5.185 + {Find=[],
5.186 + Given=[Correct "fixedValues [aaa = #0]",Superfl "relations aaa333"],
5.187 + Relate=[],Where=[],With=[]}),
5.188 + NoMatch
5.189 + (["pbla1","pbla"],
5.190 + {Find=[],
5.191 + Given=[Correct "fixedValues [aaa = #0]",Missing "maximum a1_",
5.192 + Superfl "relations aaa333"],Relate=[],Where=[],With=[]}),
5.193 + NoMatch
5.194 + (["pbla2","pbla"],
5.195 + {Find=[],
5.196 + Given=[Correct "fixedValues [aaa = #0]",Missing "valuesFor a2_",
5.197 + Superfl "relations aaa333"],Relate=[],Where=[],With=[]}),
5.198 + Matches
5.199 + (["pbla3","pbla"],
5.200 + {Find=[],
5.201 + Given=[Correct "fixedValues [aaa = #0]",Correct "relations aaa333"],
5.202 + Relate=[],Where=[],With=[]})] : match list*)
5.203 +
5.204 +(*case 3: refined to pbt with children *)
5.205 +refine fmz3 ["pbla"];
5.206 +(*
5.207 +*** pass ["pbla"]
5.208 +*** pass ["pbla","pbla1"]
5.209 +*** pass ["pbla","pbla2"]
5.210 +*** pass ["pbla","pbla2","pbla2x"]
5.211 +*** pass ["pbla","pbla2","pbla2y"]
5.212 +*** pass ["pbla","pbla2","pbla2z"]
5.213 +*** pass ["pbla","pbla3"]
5.214 +val it =
5.215 + [Matches
5.216 + (["pbla"],
5.217 + {Find=[],
5.218 + Given=[Correct "fixedValues [aaa = #0]",Superfl "valuesFor aaa222"],
5.219 + Relate=[],Where=[],With=[]}),
5.220 + NoMatch
5.221 + (["pbla1","pbla"],
5.222 + {Find=[],
5.223 + Given=[Correct "fixedValues [aaa = #0]",Missing "maximum a1_",
5.224 + Superfl "valuesFor aaa222"],Relate=[],Where=[],With=[]}),
5.225 + Matches
5.226 + (["pbla2","pbla"],
5.227 + {Find=[],
5.228 + Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222"],
5.229 + Relate=[],Where=[],With=[]}),
5.230 + NoMatch
5.231 + (["pbla2x","pbla2","pbla"],
5.232 + {Find=[],
5.233 + Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
5.234 + Missing "functionOf a2x_"],Relate=[],Where=[],With=[]}),
5.235 + NoMatch
5.236 + (["pbla2y","pbla2","pbla"],
5.237 + {Find=[],
5.238 + Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
5.239 + Missing "boundVariable a2y_"],Relate=[],Where=[],With=[]}),
5.240 + NoMatch
5.241 + (["pbla2z","pbla2","pbla"],
5.242 + {Find=[],
5.243 + Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
5.244 + Missing "interval a2z_"],Relate=[],Where=[],With=[]}),
5.245 + NoMatch
5.246 + (["pbla3","pbla"],
5.247 + {Find=[],
5.248 + Given=[Correct "fixedValues [aaa = #0]",Missing "relations a3_",
5.249 + Superfl "valuesFor aaa222"],Relate=[],Where=[],With=[]})]
5.250 + : match list*)
5.251 +
5.252 +(*case 4: refined to children (without child)*)
5.253 +refine fmz4 ["pbla"];
5.254 +(*
5.255 +*** pass ["pbla"]
5.256 +*** pass ["pbla","pbla1"]
5.257 +*** pass ["pbla","pbla2"]
5.258 +*** pass ["pbla","pbla2","pbla2x"]
5.259 +*** pass ["pbla","pbla2","pbla2y"]
5.260 +val it =
5.261 + [Matches
5.262 + (["pbla"],
5.263 + {Find=[],
5.264 + Given=[Correct "fixedValues [aaa = #0]",Superfl "valuesFor aaa222",
5.265 + Superfl "boundVariable aaa222yyy"],Relate=[],Where=[],With=[]}),
5.266 + NoMatch
5.267 + (["pbla1","pbla"],
5.268 + {Find=[],
5.269 + Given=[Correct "fixedValues [aaa = #0]",Missing "maximum a1_",
5.270 + Superfl "valuesFor aaa222",Superfl "boundVariable aaa222yyy"],
5.271 + Relate=[],Where=[],With=[]}),
5.272 + Matches
5.273 + (["pbla2","pbla"],
5.274 + {Find=[],
5.275 + Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
5.276 + Superfl "boundVariable aaa222yyy"],Relate=[],Where=[],With=[]}),
5.277 + NoMatch
5.278 + (["pbla2x","pbla2","pbla"],
5.279 + {Find=[],
5.280 + Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
5.281 + Missing "functionOf a2x_",Superfl "boundVariable aaa222yyy"],
5.282 + Relate=[],Where=[],With=[]}),
5.283 + Matches
5.284 + (["pbla2y","pbla2","pbla"],
5.285 + {Find=[],
5.286 + Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
5.287 + Correct "boundVariable aaa222yyy"],Relate=[],Where=[],With=[]})]
5.288 + : match list*)
5.289 +
5.290 +(*case 5: start refinement somewhere in ptyps*)
5.291 +refine fmz4 ["pbla2","pbla"];
5.292 +(*
5.293 +*** pass ["pbla","pbla2"]
5.294 +*** pass ["pbla","pbla2","pbla2x"]
5.295 +*** pass ["pbla","pbla2","pbla2y"]
5.296 +val it =
5.297 + [Matches
5.298 + (["pbla2","pbla"],
5.299 + {Find=[],
5.300 + Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
5.301 + Superfl "boundVariable aaa222yyy"],Relate=[],Where=[],With=[]}),
5.302 + NoMatch
5.303 + (["pbla2x","pbla2","pbla"],
5.304 + {Find=[],
5.305 + Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
5.306 + Missing "functionOf a2x_",Superfl "boundVariable aaa222yyy"],
5.307 + Relate=[],Where=[],With=[]}),
5.308 + Matches
5.309 + (["pbla2y","pbla2","pbla"],
5.310 + {Find=[],
5.311 + Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
5.312 + Correct "boundVariable aaa222yyy"],Relate=[],Where=[],With=[]})]
5.313 + : match list*)
5.314 +
5.315 +
5.316 +ptyps:= intermediate_ptyps;
5.317 +show_ptyps();
5.318 +
5.319 +
5.320 +
5.321 +"----------------------- Refine_Problem (aus subp-rooteq.sml) ---------";
5.322 +"----------------refine.sml: miniscript with mini-subpbl -------------";
5.323 +val fmz = ["equality ((x+1)*(x+2)=x^^^2+8)","solveFor x",
5.324 + "errorBound (eps=0)","solutions L"];
5.325 +val (dI',pI',mI') = ("Test.thy",["sqroot-test","univariate","equation","test"],
5.326 + ("Test.thy","squ-equ-test-subpbl1"));
5.327 +val p = e_pos'; val c = [];
5.328 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
5.329 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
5.330 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.331 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.332 +
5.333 +val nxt = ("Specify_Problem",
5.334 + Specify_Problem ["linear","univariate","equation","test"]);
5.335 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.336 +(*ML> f;
5.337 +val it = Form' (PpcKF (0,EdUndef,0,Nundef,
5.338 + (Problem ["linear","univariate","equation","test"],
5.339 + {Find=[Incompl "solutions []"],
5.340 + Given=[Incompl "errorBound",
5.341 + Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
5.342 + Correct "solveFor x"],Relate=[],
5.343 + Where=[False "matches (x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)
5.344 + |\nmatches (?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)
5.345 + |\nmatches (?a + x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)
5.346 + |\nmatches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
5.347 + With=[]}))) : mout
5.348 +
5.349 +val nxt = ("Add_Given",Add_Given "errorBound (eps = #0)")*)
5.350 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.351 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.352 +(*val nxt = ("Refine_Problem",Refine_Problem ["linear","univariate","equation","test"]
5.353 + kann nicht gut gehen --------- *)
5.354 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.355 +(*val nxt = ("Specify_Problem",Specify_Problem []) FIXXXME*)
5.356 +
5.357 +val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation","test"]);
5.358 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.359 +(*("Specify_Problem",Specify_Problem ["normalize","univariate","equation","test"])*)
5.360 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.361 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.362 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.363 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.364 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.365 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.366 +(*val nxt = ("Subproblem",Subproblem ("Test.thy",[#,#,#])) : string * mstep
5.367 + in Script "uberdefiniert -^-*)
5.368 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.369 +(*val nxt = ("Model_Problem",Model_Problem ["linear","univariate","equation","test"]*)
5.370 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.371 +(*val nxt = ("Add_Given",Add_Given "equality (x + #1 + #-1 * #2 = #0)") *)
5.372 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.373 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.374 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.375 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.376 +(*("Specify_Problem",Specify_Problem ["linear","univariate","equation","test"])*)
5.377 +
5.378 +val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation","test"]);
5.379 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.380 +(*val nxt = ("Specify_Method",Specify_Method ("RatArith.thy","solve_linear"))*)
5.381 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.382 +(*val nxt = ("Apply_Method",Apply_Method ("RatArith.thy","solve_linear"))*)
5.383 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.384 +(*val nxt = ("Rewrite_Set_Inst",Rewrite_Set_Inst ([#],"isolate_bdv"))*)
5.385 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.386 +(*val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify")*)
5.387 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.388 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.389 +(*val nxt = ("Check_Postcond",Check_Postcond ["linear","univariate","eq*)
5.390 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.391 +(*val nxt = ("Check_elementwise",Check_elementwise "Assumptions")*)
5.392 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.393 +(*("Check_Postcond",Check_Postcond ["normalize","univariate","equation","test"])*)
5.394 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
5.395 +val Form' (FormKF (~1,EdUndef,0,Nundef,res)) = f;
5.396 +if (snd nxt)=End_Proof' andalso res="[x = 2]" then ()
5.397 +else raise error "new behaviour in test:refine.sml: miniscript with mini-subpbl";
5.398 +
5.399 +
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/src/sml/systest/root-equ.sml Thu Apr 17 18:01:03 2003 +0200
6.3 @@ -0,0 +1,620 @@
6.4 +(* use"../tests/test-root-equ.sml";
6.5 + use"tests/test-root-equ.sml";
6.6 + use"test-root-equ.sml";
6.7 + trace_rewrite:= true;
6.8 + trace_rewrite:= false;
6.9 +
6.10 + method "sqrt-equ-test", _NOT_ "square-equation"
6.11 +*)
6.12 +
6.13 +
6.14 +" ================= equation with x =(-12)/5, but L ={} ======= ";
6.15 +" _________________ rewrite _________________ ";
6.16 +
6.17 +
6.18 +" ================= equation with result={4} ================== ";
6.19 +" -------------- model, specify ------------ ";
6.20 +" ________________ rewrite _________________";
6.21 +" _________________ rewrite_ x=4_________________ ";
6.22 +" _________________ rewrite + cappend _________________ ";
6.23 +" _________________ me Free_Solve _________________ ";
6.24 +" _________________ me + msteps input _________________ ";
6.25 +(*" _______________ me + nxt_step from script _________---> scriptnew.sml*)
6.26 +(*" _________________ me + nxt_step from script (check_elementwise..)______
6.27 + ... L_a = Mstep subproblem_equation_dummy; ";*)
6.28 +(*" _______________ me + root-equ: 1.norm_equation ___---> scriptnew.sml*)
6.29 +
6.30 +(*
6.31 +> val t = (term_of o the o (parse thy)) "#2^^^#3";
6.32 +> val eval_fn = the (assoc (!eval_list, "pow"));
6.33 +> val (Some (id,t')) = get_pair thy "pow" eval_fn t;
6.34 +> Sign.string_of_term (sign_of thy) t';
6.35 +*)
6.36 +(******************************************************************)
6.37 +(* ------------------------------------- *)
6.38 +" _________________ equation with x =(-12)/5, but L ={} ------- ";
6.39 +(* ------------------------------------- *)
6.40 +" _________________ rewrite _________________ ";
6.41 +val thy' = "Test.thy";
6.42 +val ct = "sqrt(9+4*x)=sqrt x + sqrt(-3+x)";
6.43 +val thm = ("square_equation_left","");
6.44 +val (ct,asm) = the (rewrite thy' "tless_true" "tval_rls" true thm ct);
6.45 +(*"9 + 4 * x = (sqrt x + sqrt (-3 + x)) ^^^ 2"*)
6.46 +val rls = ("Test_simplify");
6.47 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.48 +(*"9 + 4 * x = -3 + (2 * x + 2 * sqrt (x ^^^ 2 + -3 * x))"*)
6.49 +val rls = ("rearrange_assoc");
6.50 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.51 +(*"9 + 4 * x = -3 + 2 * x + 2 * sqrt (x ^^^ 2 + -3 * x)"*)
6.52 +val rls = ("isolate_root");
6.53 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.54 +(*"sqrt (x ^^^ 2 + -3 * x) =
6.55 +(-3 + 2 * x + -1 * (9 + 4 * x)) // (-1 * 2)"*)
6.56 +val rls = ("Test_simplify");
6.57 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.58 +(*"sqrt (x ^^^ 2 + -3 * x) = 6 + x"*)
6.59 +val thm = ("square_equation_left","");
6.60 +val (ct,asm') = the (rewrite thy' "tless_true" "tval_rls" true thm ct);
6.61 +val asm = asm union asm';
6.62 +(*"x ^^^ 2 + -3 * x = (6 + x) ^^^ 2"*)
6.63 +val rls = ("Test_simplify");
6.64 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.65 +(*"x ^^^ 2 + -3 * x = 36 + (x ^^^ 2 + 12 * x)"*)
6.66 +val rls = ("norm_equation");
6.67 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.68 +(*"x ^^^ 2 + -3 * x + -1 * (36 + (x ^^^ 2 + 12 * x)) = 0"*)
6.69 +val rls = ("Test_simplify");
6.70 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.71 +(*"-36 + -15 * x = 0"*)
6.72 +val rls = ("isolate_bdv");
6.73 +val (ct,_) = the (rewrite_set_inst thy' false
6.74 + [("bdv","x::real")] rls ct);
6.75 +(*"x = (0 + -1 * -36) // -15"*)
6.76 +val rls = ("Test_simplify");
6.77 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.78 +if ct<>"x = -12 / 5"then raise error "new behaviour in testexample"else ();
6.79 +
6.80 +(*
6.81 +val ct = "x = (-12) / 5" : cterm'
6.82 +> asm;
6.83 +val it =
6.84 + ["(+0) <= sqrt x + sqrt ((-3) + x) ","(+0) <= 9 + 4 * x",
6.85 + "(+0) <= (-3) * x + x ^^^ 2","(+0) <= 6 + x"] : cterm' list
6.86 +*)
6.87 +
6.88 +
6.89 +
6.90 +
6.91 +
6.92 +" ================== equation with result={4} ================== ";
6.93 +" ================== equation with result={4} ================== ";
6.94 +" ================== equation with result={4} ================== ";
6.95 +
6.96 +" -------------- model, specify ------------ ";
6.97 +" -------------- model, specify ------------ ";
6.98 +" -------------- model, specify ------------ ";
6.99 +" --- subproblem 1: linear-equation --- ";
6.100 +val origin = ["equation (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
6.101 + "bound_variable x","error_bound 0"(*,
6.102 + "solutions L::real set" ,
6.103 + "L = {bdv. || ((%x. l) bdv) - ((%x. r) bdv) || < eps}"*)];
6.104 +val thy = Isac.thy;
6.105 +val formals = map (the o (parse thy)) origin;
6.106 +
6.107 +val given = ["equation (l=(r::real))",
6.108 + "bound_variable bdv", (* TODO type *)
6.109 + "error_bound eps"];
6.110 +val where_ = [(*"(l=r) is_root_equation_in bdv", 5.3.*)
6.111 + "bdv is_var",
6.112 + "eps is_const_expr"];
6.113 +val find = ["solutions (L::bool list)"];
6.114 +val with_ = [(* parseold ...
6.115 + "L = {bdv. || ((%x. l) bdv) - ((%x. r) bdv) || < eps}"*)];
6.116 +val chkpbl = map (the o (parse thy)) (given @ where_ @ find @ with_);
6.117 +val givens = map (the o (parse thy)) given;
6.118 +parseold thy "L = {bdv. || ((%x. l) bdv) - ((%x. r) bdv) || < apx}";
6.119 +(* 31.1.00
6.120 +val tag__forms = chktyps thy (formals, givens);
6.121 +map ((atomty thy) o term_of) tag__forms; *)
6.122 +
6.123 +" --- subproblem 2: linear-equation --- ";
6.124 +val origin = ["x + 4 = (0::real)","x::real"];
6.125 +val formals = map (the o (parse thy)) origin;
6.126 +
6.127 +val given = ["equation (l=(0::real))",
6.128 + "bound_variable bdv"];
6.129 +val where_ = ["l is_linear_in bdv","bdv is_const"];
6.130 +val find = ["l::real"];
6.131 +val with_ = ["l = (%x. l) bdv"];
6.132 +val chkpbl = map (the o (parseold thy)) (given @ where_ @ find @ with_);
6.133 +val givens = map (the o (parse thy)) given;
6.134 +
6.135 +val tag__forms = chktyps thy (formals, givens);
6.136 +map ((atomty thy) o term_of) tag__forms;
6.137 +
6.138 +
6.139 +
6.140 +" _________________ rewrite_ x+4_________________ ";
6.141 +" _________________ rewrite_ x+4_________________ ";
6.142 +" _________________ rewrite_ x+4_________________ ";
6.143 +val t = (term_of o the o (parse thy)) "sqrt(9+4*x)=sqrt x + sqrt(5+x)";
6.144 +val thm = num_str square_equation_left;
6.145 +val (t,asm) = the (rewrite_ thy tless_true tval_rls true thm t);
6.146 +val rls = Test_simplify;
6.147 +val (t,_) = the (rewrite_set_ thy false rls t);
6.148 +val rls = rearrange_assoc;
6.149 +val (t,_) = the (rewrite_set_ thy false rls t);
6.150 +val rls = isolate_root;
6.151 +val (t,_) = the (rewrite_set_ thy false rls t);
6.152 +
6.153 +val rls = Test_simplify;
6.154 +val (t,_) = the (rewrite_set_ thy false rls t);
6.155 +(*
6.156 +sqrt (x ^^^ 2 + 5 * x) =
6.157 +(5 + 2 * x + (-1 * 9 + -1 * (4 * x))) / (-1 * 2)
6.158 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6.159 +### trying thm 'rdistr_div_right'
6.160 +### rewrites to: sqrt (x ^^^ 2 + 5 * x) =
6.161 +(5 + 2 * x) / (-1 * 2) + (-1 * 9 + -1 * (4 * x)) / (-1 * 2)
6.162 +### rewrites to: sqrt (x ^^^ 2 + 5 * x) =
6.163 +(5 + 2 * x) / (-1 * 2) + (-1 * 9 / (-1 * 2) + -1 * (4 * x) / (-1 * 2))
6.164 +### rewrites to: sqrt (x ^^^ 2 + 5 * x) =
6.165 +5 / (-1 * 2) + 2 * x / (-1 * 2) +
6.166 +(-1 * 9 / (-1 * 2) + -1 * (4 * x) / (-1 * 2))
6.167 +
6.168 +### trying thm 'radd_left_commute'
6.169 +### rewrites to: sqrt (x ^^^ 2 + 5 * x) =
6.170 +-1 * 9 / (-1 * 2) +
6.171 +(5 / (-1 * 2) + 2 * x / (-1 * 2) + -1 * (4 * x) / (-1 * 2))
6.172 +### trying thm 'radd_assoc'
6.173 +### rewrites to: sqrt (x ^^^ 2 + 5 * x) =
6.174 +-1 * 9 / (-1 * 2) +
6.175 +(5 / (-1 * 2) + (2 * x / (-1 * 2) + -1 * (4 * x) / (-1 * 2)))
6.176 +
6.177 +### trying thm 'radd_real_const_eq'
6.178 +### rewrites to: sqrt (x ^^^ 2 + 5 * x) =
6.179 +-1 * 9 / (-1 * 2) + (5 / (-1 * 2) + (2 * x + -1 * (4 * x)) / (-1 * 2))
6.180 +### rewrites to: sqrt (x ^^^ 2 + 5 * x) =
6.181 +-1 * 9 / (-1 * 2) + (5 + (2 * x + -1 * (4 * x))) / (-1 * 2)
6.182 +### rewrites to: sqrt (x ^^^ 2 + 5 * x) =
6.183 +(-1 * 9 + (5 + (2 * x + -1 * (4 * x)))) / (-1 * 2)
6.184 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6.185 +
6.186 +28.8.02: ruleset besser zusammenstellen !!!
6.187 +*)
6.188 +val thm = num_str square_equation_left;
6.189 +val (t,asm') = the (rewrite_ thy tless_true tval_rls true thm t);
6.190 +val asm = asm union asm';
6.191 +val rls = Test_simplify;
6.192 +val (t,_) = the (rewrite_set_ thy false rls t);
6.193 +val rls = norm_equation;
6.194 +val (t,_) = the (rewrite_set_ thy false rls t);
6.195 +val rls = Test_simplify;
6.196 +val (t,_) = the (rewrite_set_ thy false rls t);
6.197 +val rls = isolate_bdv;
6.198 +val subst = [(str2term "bdv", str2term "x")];
6.199 +val (t,_) = the (rewrite_set_inst_ thy false subst rls t);
6.200 +val rls = Test_simplify;
6.201 +val (t,_) = the (rewrite_set_ thy false rls t);
6.202 +val t' = term2str t;
6.203 +if t' = "x = 4" then ()
6.204 +else raise error "root-equ.sml: new behav. in rewrite_ x+4";
6.205 +
6.206 +" _________________ rewrite x=4_________________ ";
6.207 +" _________________ rewrite x=4_________________ ";
6.208 +" _________________ rewrite x=4_________________ ";
6.209 +(*
6.210 +rewrite thy' "tless_true" "tval_rls" true (num_str rbinom_power_2) ct;
6.211 +atomty thy ((#prop o rep_thm) (!tthm));
6.212 +atomty thy (term_of (!tct));
6.213 +*)
6.214 +val thy' = "Test.thy";
6.215 +val ct = "sqrt(9+4*x)=sqrt x + sqrt(5+x)";
6.216 +(*1*)val thm = ("square_equation_left","");
6.217 +val (ct,asm) = the (rewrite thy' "tless_true" "tval_rls" true thm ct);
6.218 +"9 + 4 * x = (sqrt x + sqrt (5 + x)) ^^^ 2";
6.219 +(*2*)val rls = "Test_simplify";
6.220 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.221 +"9 + 4 * x = 5 + (2 * x + 2 * sqrt (x ^^^ 2 + 5 * x))";
6.222 +(*3*)val rls = "rearrange_assoc";
6.223 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.224 +"9 + 4 * x = 5 + 2 * x + 2 * sqrt (x ^^^ 2 + 5 * x)";
6.225 +(*4*)val rls = "isolate_root";
6.226 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.227 +"sqrt (x ^^^ 2 + 5 * x) = (5 + 2 * x + -1 * (9 + 4 * x)) // (-1 * 2)";
6.228 +(*5*)val rls = "Test_simplify";
6.229 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.230 +"sqrt (x ^^^ 2 + 5 * x) = 2 + x";
6.231 +(*6*)val thm = ("square_equation_left","");
6.232 +val (ct,asm') = the (rewrite thy' "tless_true" "tval_rls" true thm ct);
6.233 +val asm = asm union asm';
6.234 +"x ^^^ 2 + 5 * x = (2 + x) ^^^ 2";
6.235 +(*7*)val rls = "Test_simplify";
6.236 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.237 +"x ^^^ 2 + 5 * x = 4 + (x ^^^ 2 + 4 * x)";
6.238 +(*8*)val rls = "norm_equation";
6.239 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.240 +"x ^^^ 2 + 5 * x + -1 * (4 + (x ^^^ 2 + 4 * x)) = 0";
6.241 +(*9*)val rls = "Test_simplify";
6.242 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.243 +"-4 + x = 0";
6.244 +(*10*)val rls = "isolate_bdv";
6.245 +val (ct,_) = the (rewrite_set_inst thy' false
6.246 + [("bdv","x")] rls ct);
6.247 +"x = 0 + -1 * -4";
6.248 +(*11*)val rls = "Test_simplify";
6.249 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.250 +if ct="x = 4" then () else raise error "new behaviour in test-example";
6.251 +
6.252 +
6.253 +
6.254 +
6.255 +" _________________ rewrite + cappend _________________ ";
6.256 +" _________________ rewrite + cappend _________________ ";
6.257 +" _________________ rewrite + cappend _________________ ";
6.258 +val thy' = "Test.thy";
6.259 +val ct = "sqrt(9+4*x)=sqrt x + sqrt(5+x)";
6.260 +val ctl = ["sqrt(9+4*x)=sqrt x + sqrt(5+x)","x::real","0"];
6.261 +val oris = prep_ori ctl thy ((#ppc o get_pbt)
6.262 + ["sqroot-test","univariate","equation","test"]);
6.263 +val loc = e_istate;
6.264 +val (pt,pos) = (e_ptree,[]);
6.265 +val (pt,_) = cappend_problem pt pos loc (oris,empty_spec);
6.266 +val pt = update_branch pt [] Transitive;
6.267 +(*
6.268 +val pt = update_model pt [] (map init_item (snd (get_obj g_origin pt [])));
6.269 +*)
6.270 +(*val pt = update_model pt [] (fst (get_obj g_origin pt [])); *)
6.271 +val pt = update_domID pt [] "Test";
6.272 +val pt = update_pblID pt [] ["Test",
6.273 + "equations","univariate","square-root"];
6.274 +val pt = update_metID pt [] ("Test","sqrt-equ-test");
6.275 +val pt = update_pbl pt [] [];
6.276 +val pt = update_met pt [] [];
6.277 +(*
6.278 +> get_obj g_spec pt [];
6.279 +val it = ("e_domID",["e_pblID"],("e_domID","e_metID")) : spec
6.280 +> val pt = update_domID pt [] "RatArith";
6.281 +> get_obj g_spec pt [];
6.282 +val it = ("RatArith",["e_pblID"],("e_domID","e_metID")) : spec
6.283 +> val pt = update_pblID pt [] ["RatArith",
6.284 + "equations","univariate","square-root"];
6.285 +> get_obj g_spec pt [];
6.286 +("RatArith",["RatArith","equations","univariate","square-root"],
6.287 + ("e_domID","e_metID")) : spec
6.288 +> val pt = update_metID pt [] ("RatArith","sqrt-equ-test");
6.289 +> get_obj g_spec pt [];
6.290 + ("RatArith",["RatArith","equations","univariate","square-root"],
6.291 + ("RatArith","sqrt-equ-test")) : spec
6.292 +*)
6.293 +
6.294 +val pos = [1];
6.295 +val (pt,_) = cappend_parent pt pos loc ct (Mstep "repeat") Transitive;
6.296 +
6.297 +val pos = (lev_on o lev_dn) pos;
6.298 +val thm = ("square_equation_left",""); val ctold = ct;
6.299 +val (ct,asm) = the (rewrite thy' "tless_true" ("tval_rls") true thm ct);
6.300 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep (fst thm)) ct Complete;
6.301 +val pt = union_asm pt [] (map (rpair []) asm);
6.302 +
6.303 +val pos = lev_on pos;
6.304 +val rls = ("Test_simplify"); val ctold = ct;
6.305 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.306 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep rls) ct Complete;
6.307 +
6.308 +val pos = lev_on pos;
6.309 +val rls = ("rearrange_assoc"); val ctold = ct;
6.310 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.311 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep rls) ct Complete;
6.312 +
6.313 +val pos = lev_on pos;
6.314 +val rls = ("isolate_root"); val ctold = ct;
6.315 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.316 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep rls) ct Complete;
6.317 +
6.318 +val pos = lev_on pos;
6.319 +val rls = ("Test_simplify"); val ctold = ct;
6.320 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.321 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep rls) ct Complete;
6.322 +
6.323 +val pos = lev_on pos;
6.324 +val thm = ("square_equation_left",""); val ctold = ct;
6.325 +val (ct,asm) = the (rewrite thy' "tless_true" "tval_rls" true thm ct);
6.326 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep rls) ct Complete;
6.327 +val pt = union_asm pt [] (map (rpair []) asm);
6.328 +
6.329 +val pos = lev_up pos;
6.330 +val (pt,_) = append_result pt pos e_istate ct Complete;
6.331 +
6.332 +val pos = lev_on pos;
6.333 +val rls = ("Test_simplify"); val ctold = ct;
6.334 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.335 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep rls) ct Complete;
6.336 +
6.337 +val pos = lev_on pos;
6.338 +val rls = ("norm_equation"); val ctold = ct;
6.339 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.340 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep rls) ct Complete;
6.341 +
6.342 +val pos = lev_on pos;
6.343 +val rls = ("Test_simplify"); val ctold = ct;
6.344 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.345 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep rls) ct Complete;
6.346 +
6.347 +(* --- see comments in interface_ME_ISA/instantiate''
6.348 +val rlsdat' = instantiate_rls' thy' [("bdv","x")] ("isolate_bdv");
6.349 +val (ct,_) = the (rewrite_set thy' false
6.350 + ("#isolate_bdv",rlsdat') ct); *)
6.351 +val pos = lev_on pos;
6.352 +val rls = ("isolate_bdv"); val ctold = ct;
6.353 +val (ct,_) = the (rewrite_set_inst thy' false
6.354 + [("bdv","x")] rls ct);
6.355 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep rls) ct Complete;
6.356 +
6.357 +val pos = lev_on pos;
6.358 +val rls = ("Test_simplify"); val ctold = ct;
6.359 +val (ct,_) = the (rewrite_set thy' false rls ct);
6.360 +val (pt,_) = cappend_atomic pt pos loc ctold (Mstep rls) ct Complete;
6.361 +
6.362 +val pos = lev_up pos;
6.363 +val (pt,pos) = append_result pt pos e_istate ct Complete;
6.364 +get_obj g_asm pt [];
6.365 +
6.366 +writeln (pr_ptree pr_short pt);
6.367 +(* aus src.24-11-99:
6.368 +. sqrt(9+4*x)=sqrt x + sqrt(5+x), x, (+0)
6.369 +1. sqrt(9+4*x)=sqrt x + sqrt(5+x)
6.370 +1.1. sqrt(9+4*x)=sqrt x + sqrt(5+x)
6.371 +1.2. 9 + 4 * x = (sqrt x + sqrt (5 + x) ) ^^^ 2
6.372 +1.3. 9 + 4 * x = 5 + ((+2) * x + (+2) * sqrt (5 * x + x ^^^ 2) )
6.373 +1.4. 9 + 4 * x = 5 + (+2) * x + (+2) * sqrt (5 * x + x ^^^ 2)
6.374 +1.5. sqrt (5 * x + x ^^^ 2) = (5 + (+2) * x + (-1) * (9 + 4 * x)) / ((-1) * (+2))
6.375 +1.6. sqrt (5 * x + x ^^^ 2) = (+2) + x
6.376 +2. 5 * x + x ^^^ 2 = ((+2) + x) ^^^ 2
6.377 +3. 5 * x + x ^^^ 2 = 4 + (4 * x + x ^^^ 2) ###12.12.99: indent 2.1. !?!
6.378 +4. 5 * x + x ^^^ 2 + (-1) * (4 + (4 * x + x ^^^ 2)) = (+0)
6.379 +5. (-4) + x = (+0)
6.380 +6. x = (+0) + (-1) * (-4)
6.381 +*)
6.382 +
6.383 +(*
6.384 +val t = (term_of o the o (parse thy)) "solutions (L::real set)";
6.385 +atomty thy t;
6.386 +*)
6.387 +
6.388 +
6.389 +(*- 20.9.02: Free_Solve would need the erls (for conditions of rules)
6.390 + from thy ???, i.e. together with the *_simplify ?!!!? ----------
6.391 +" _________________ me Free_Solve _________________ ";
6.392 +" _________________ me Free_Solve _________________ ";
6.393 +" _________________ me Free_Solve _________________ ";
6.394 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
6.395 + "solveFor x","errorBound (eps=0)",
6.396 + "solutions L"(*,
6.397 + "L = {bdv. || ((%x. l) bdv) - ((%x. r) bdv) || < eps}"*)];
6.398 +val (dI',pI',mI') =
6.399 + ("Test.thy",["sqroot-test","univariate","equation","test"],
6.400 + ("Test.thy","sqrt-equ-test"));
6.401 +val p = e_pos'; val c = [];
6.402 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
6.403 +
6.404 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
6.405 +(*val nxt = ("Add_Given", Add_Given "equation (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x) )");*)
6.406 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
6.407 +(* val nxt = ("Add_Given",Add_Given "bound_variable x");*)
6.408 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
6.409 +(* val nxt = ("Add_Given",Add_Given "error_bound #0");*)
6.410 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
6.411 +(* val nxt = ("Add_Find",Add_Find "solutions L"); *)
6.412 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
6.413 +(* val nxt = ("Specify_Domain",Specify_Domain "DiffAppl.thy");
6.414 +> get_obj g_spec pt (fst p);
6.415 +val it = ("e_domID",["e_pblID"],("e_domID","e_metID")) : spec*)
6.416 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
6.417 +(*val nxt = ("Specify_Problem", Specify_Problem *)
6.418 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
6.419 +(*val nxt = ("Specify_Method",Specify_Method ("DiffAppl.thy","sqrt-equ-test"));*)
6.420 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
6.421 +(*val nxt = ("Apply_Method",Apply_Method ("DiffAppl.thy","sqrt-equ-test"));*)
6.422 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
6.423 +val nxt = ("Free_Solve",Free_Solve);
6.424 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
6.425 +get_obj g_spec pt [];
6.426 +
6.427 +"--- -2 ---";
6.428 +get_form ("Take",Take"sqrt(9+4*x)=sqrt x + sqrt(5+x)") p pt;
6.429 +val (p,_,f,nxt,_,pt)=
6.430 +me ("Take",Take "sqrt(9+4*x)=sqrt x + sqrt(5+x)") p [3] pt;
6.431 +(* 15.4.
6.432 +"--- -1 ---";
6.433 +get_form ("Begin_Trans",Begin_Trans) p pt;
6.434 +val (p,_,f,nxt,_,pt)=
6.435 +me ("Begin_Trans",Begin_Trans) p [4] pt; *)
6.436 +
6.437 +"--- 1 ---";
6.438 +get_form ("Rewrite_Asm",Rewrite_Asm ("square_equation_left","")) p pt;
6.439 +val (p,_,f,nxt,_,pt)=
6.440 +me ("Rewrite_Asm",Rewrite_Asm ("square_equation_left","")) p [5] pt;
6.441 +"--- 2 ---";
6.442 +get_form ("Rewrite_Set",Rewrite_Set "Test_simplify")p pt;
6.443 +val (p,_,f,nxt,_,pt)=
6.444 +me ("Rewrite_Set",Rewrite_Set "Test_simplify")p [6] pt;
6.445 +"--- 3 ---";
6.446 +get_form ("Rewrite_Set",Rewrite_Set "rearrange_assoc") p pt;
6.447 +val (p,_,f,nxt,_,pt)=
6.448 +me ("Rewrite_Set",Rewrite_Set "rearrange_assoc") p [7] pt;
6.449 +"--- 4 ---";
6.450 +get_form ("Rewrite_Set",Rewrite_Set "isolate_root") p pt;
6.451 +val (p,_,f,nxt,_,pt)=
6.452 +me ("Rewrite_Set",Rewrite_Set "isolate_root") p [8] pt;
6.453 +"--- 5 ---";
6.454 +get_form ("Rewrite_Set",Rewrite_Set "Test_simplify") p pt;
6.455 +val (p,_,f,nxt,_,pt)=
6.456 +me ("Rewrite_Set",Rewrite_Set "Test_simplify") p [9] pt;
6.457 +"--- 6 ---";
6.458 +get_form ("Rewrite_Asm",Rewrite_Asm ("square_equation_left","")) p pt;
6.459 +val (p,_,f,nxt,_,pt)=
6.460 +me ("Rewrite_Asm",Rewrite_Asm ("square_equation_left","")) p [10] pt;
6.461 +(* 15.4.
6.462 +"--- ---";
6.463 +get_form ("End_Trans",End_Trans) p pt;
6.464 +val (p,_,f,nxt,_,pt)=
6.465 +me ("End_Trans",End_Trans) p [11] pt; *)
6.466 +"--- 7 ---";
6.467 +get_form ("Rewrite_Set",Rewrite_Set "Test_simplify") p pt;
6.468 +val (p,_,f,nxt,_,pt)=
6.469 +me ("Rewrite_Set",Rewrite_Set "Test_simplify") p [12] pt;
6.470 +"--- 8 ---";
6.471 +get_form ("Rewrite_Set",Rewrite_Set "norm_equation") p pt;
6.472 +val (p,_,f,nxt,_,pt)=
6.473 +me ("Rewrite_Set",Rewrite_Set "norm_equation") p [13] pt;
6.474 +"--- 9 ---";
6.475 +get_form ("Rewrite_Set",Rewrite_Set "Test_simplify") p pt;
6.476 +val (p,_,f,nxt,_,pt)=
6.477 +me ("Rewrite_Set",Rewrite_Set "Test_simplify") p [14] pt;
6.478 +"--- 10 ---.";
6.479 +get_form ("Rewrite_Set_Inst",Rewrite_Set_Inst (["(bdv,x)"],"isolate_bdv")) p pt;
6.480 +val (p,_,f,nxt,_,pt)=
6.481 +me ("Rewrite_Set",Rewrite_Set_Inst (["(bdv,x)"],"isolate_bdv")) p [15] pt;
6.482 +"--- 11 ---";
6.483 +get_form ("Rewrite_Set",Rewrite_Set "Test_simplify") p pt;
6.484 +val ((p,p_),_,f,nxt,_,pt)=
6.485 +me ("Rewrite_Set",Rewrite_Set "Test_simplify") p [16] pt;
6.486 +(* 5.4.00.: ---
6.487 +get_form ("Check_Postcond",Check_Postcond ("Test.thy","solve-root-equation")) (p,Met) pt;
6.488 +val (p,_,f,nxt,_,pt)=
6.489 +me ("Check_Postcond",Check_Postcond ("Test.thy","solve-root-equation")) (p,Met) [17] pt;
6.490 +--- *)
6.491 +writeln (pr_ptree pr_short pt);
6.492 +writeln("result: "^(get_obj g_result pt [])^"\n==================================================================="*;
6.493 +*)
6.494 +
6.495 +
6.496 +" _________________ me + msteps input _________________ ";
6.497 +" _________________ me + msteps input _________________ ";
6.498 +" _________________ me + msteps input _________________ ";
6.499 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
6.500 + "solveFor x","errorBound (eps=0)",
6.501 + "solutions L"];
6.502 +val (dI',pI',mI') =
6.503 + ("Test.thy",["sqroot-test","univariate","equation","test"],
6.504 + ("Test.thy","sqrt-equ-test"));
6.505 +val p = e_pos'; val c = [];
6.506 +"--- s1 ---";
6.507 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
6.508 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
6.509 +"--- s2 ---";
6.510 +val nxt = ("Add_Given",
6.511 +Add_Given "equality (sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x))");
6.512 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.513 +"--- s3 ---";
6.514 +val nxt = ("Add_Given",Add_Given "solveFor x");
6.515 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.516 +"--- s4 ---";
6.517 +val nxt = ("Add_Given",Add_Given "errorBound (eps = 0)");
6.518 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.519 +"--- s5 ---";
6.520 +val nxt = ("Add_Find",Add_Find "solutions L");
6.521 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.522 +"--- s6 ---";
6.523 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
6.524 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.525 +"--- s7 ---";
6.526 +val nxt = ("Specify_Problem",
6.527 +Specify_Problem ["sqroot-test","univariate","equation","test"]);
6.528 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.529 +"--- s8 ---";
6.530 +val nxt = ("Specify_Method",Specify_Method ("Test.thy","sqrt-equ-test"));
6.531 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.532 +"--- s9 ---";
6.533 +val nxt = ("Apply_Method",Apply_Method ("Test.thy","sqrt-equ-test"));
6.534 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.535 +"--- 1 ---";
6.536 +val nxt = ("Rewrite",Rewrite ("square_equation_left",""));
6.537 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.538 +
6.539 +(*me------------
6.540 + val (mI,m) = nxt; val pos' as (p,p_) = p;
6.541 +
6.542 + val Appl m = applicable_in (p,p_) pt m;
6.543 +(*solve*)
6.544 + val pp = par_pblobj pt p;
6.545 + val metID = get_obj g_metID pt pp;
6.546 + val sc = (#scr o get_met) metID;
6.547 + val is = get_istate pt (p,p_);
6.548 + val thy' = get_obj g_domID pt pp;
6.549 + val thy = assoc_thy thy';
6.550 + val d = e_rls;
6.551 + val Steps [(m',f',pt',p',c',s')] =
6.552 + locate_gen thy' m (pt,(p,p_)) (sc,d) is;
6.553 + val is' = get_istate pt' p';
6.554 + next_tac thy' (pt'(*'*),p') sc is';
6.555 +
6.556 +
6.557 +
6.558 +
6.559 +val ttt = (term_of o the o (parse Test.thy))
6.560 +"Let (((While contains_root e_ Do\
6.561 +\Rewrite square_equation_left True @@\
6.562 +\Try (Rewrite_Set Test_simplify False) @@\
6.563 +\Try (Rewrite_Set rearrange_assoc False) @@\
6.564 +\Try (Rewrite_Set Test_simplify False)) @@\
6.565 +\Try (Rewrite_Set norm_equation False) @@\
6.566 +\Try (Rewrite_Set Test_simplify False) @@\
6.567 +\Rewrite_Set_Inst [(bdv, v_)] isolate_bdv False @@\
6.568 +\Try (Rewrite_Set Test_simplify False))\
6.569 +\e_)";
6.570 +
6.571 +-------------------------*)
6.572 +
6.573 +
6.574 +"--- 2 ---";
6.575 +val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");
6.576 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.577 +"--- 3 ---";
6.578 +val nxt = ("Rewrite_Set",Rewrite_Set "rearrange_assoc");
6.579 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.580 +"--- 4 ---";
6.581 +val nxt = ("Rewrite_Set",Rewrite_Set "isolate_root");
6.582 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.583 +"--- 5 ---";
6.584 +val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");
6.585 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.586 +"--- 6 ---";
6.587 +val nxt = ("Rewrite",Rewrite ("square_equation_left",""));
6.588 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.589 +"--- 7 ---";
6.590 +val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");
6.591 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.592 +"--- 8<> ---";
6.593 +val nxt = ("Rewrite_Set",Rewrite_Set "rearrange_assoc");
6.594 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.595 +"--- 9<> ---";
6.596 +val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");
6.597 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.598 +"--- 10<> ---";
6.599 +val nxt = ("Rewrite_Set",Rewrite_Set "norm_equation");
6.600 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.601 +"--- 11<> ---.";
6.602 +val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");
6.603 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.604 +"--- 12<> ---";
6.605 +val nxt = ("Rewrite_Set_Inst",Rewrite_Set_Inst (["(bdv,x)"],"isolate_bdv"));
6.606 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.607 +"--- 13<> ---";
6.608 +val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");
6.609 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
6.610 +"--- 1<> ---";
6.611 +val nxt = ("Check_Postcond",Check_Postcond ["sqroot-test","univariate","equation","test"]);
6.612 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
6.613 +(* val nxt = ("End_Proof'",End_Proof');*)
6.614 +if f<>(Form' (FormKF (~1,EdUndef,0,Nundef,"[x = 4]")))
6.615 +then raise error "me + msteps input: not finished correctly"
6.616 +else "root-equation, me + msteps input: OK";
6.617 +
6.618 +writeln (pr_ptree pr_short pt);
6.619 +writeln("result: "^(get_obj g_result pt [])^
6.620 +"\n==============================================================");
6.621 +
6.622 +
6.623 +
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/src/sml/systest/script.sml Thu Apr 17 18:01:03 2003 +0200
7.3 @@ -0,0 +1,996 @@
7.4 +(* use"test-script.sml";
7.5 + WN.13.3.00
7.6 + *)
7.7 +
7.8 +" scripts: Variante 'funktional' ";
7.9 +"############## Make_fun_by_new_variable ##############";
7.10 +"############## Make_fun_by_explicit ##############";
7.11 +"################ Solve_root_equation #################";
7.12 +"------- Notlocatable: Free_Solve -------";
7.13 +
7.14 +" --- test100: nxt_tac order------------------------------------ ";
7.15 +" --- test100: order 1 3 1 2 ----------------------------------- ";
7.16 +" --- test200: nxt_tac order ------------------------------------- ";
7.17 +" --- test200: order 3 1 1 2 --------------------------------- ";
7.18 +
7.19 +" --- root-equation: nxt_tac order------------------------------ ";
7.20 +" --- root-equation: 1.norm_equation ------------------------------ ";
7.21 +(* --- test200: calculate -----------------------------------------*)
7.22 +" --- check_elementwise ------------------------------ ";
7.23 +
7.24 +" --- test 30.4.02 Testterm: Repeat Repeat Or ------------------ ";
7.25 +" --- test 9.5.02 Testeq: While Try Repeat @@ ------------------ ";
7.26 +
7.27 +
7.28 +
7.29 +
7.30 +
7.31 +
7.32 +" #################################################### ";
7.33 +" scripts: Variante 'funktional' ";
7.34 +" #################################################### ";
7.35 +
7.36 +val c = (the o (parse DiffApp.thy))
7.37 + "Script Maximum_value(fix_::bool list)(m_::real) (rs_::bool list)\
7.38 + \ (v_::real) (itv_::real set) (err_::bool) = \
7.39 + \ (let e_ = (hd o (filter (Testvar m_))) rs_; \
7.40 + \ t_ = (if 1 < Length rs_ \
7.41 + \ then (SubProblem (Reals_,[make,function],(Isac_,no_met))\
7.42 + \ [real_ m_, real_ v_, bool_list_ rs_])\
7.43 + \ else (hd rs_)); \
7.44 + \ (mx_::real) = SubProblem (Reals_,[on_interval,max_of,function], \
7.45 + \ (DiffAppl_,maximum_on_interval))\
7.46 + \ [bool_ t_, real_ v_, real_set_ itv_]\
7.47 + \ in ((SubProblem (Reals_,[find_values,tool],(DiffAppl_,find_values)) \
7.48 + \ [real_ mx_, real_ (Rhs t_), real_ v_, real_ m_, \
7.49 + \ bool_list_ (dropWhile (ident e_) rs_)])::bool list))";
7.50 +
7.51 +
7.52 +"######################################################";
7.53 +"############## Make_fun_by_new_variable ##############";
7.54 +"######################################################";
7.55 +
7.56 +val sc = (the o (parse DiffApp.thy)) (*start interpretieren*)
7.57 + "Script Make_fun_by_new_variable (f_::real) (v_::real) \
7.58 + \ (eqs_::bool list) = \
7.59 + \(let h_ = (hd o (filter (Testvar m_))) eqs_; \
7.60 + \ es_ = dropWhile (ident h_) eqs_; \
7.61 + \ vs_ = dropWhile (ident f_) (Var h_); \
7.62 + \ v1_ = Nth 1 vs_; \
7.63 + \ v2_ = Nth 2 vs_; \
7.64 + \ e1_ = (hd o (filter (Testvar v1_))) es_; \
7.65 + \ e2_ = (hd o (filter (Testvar v2_))) es_; \
7.66 + \ (s_1::bool list) = (SubProblem(Reals_, [univar,equation],(Isac_,no_met))\
7.67 + \ [bool_ e1_, real_ v1_]);\
7.68 + \ (s_2::bool list) = (SubProblem(Reals_, [univar,equation],(Isac_,no_met))\
7.69 + \ [bool_ e2_, real_ v2_])\
7.70 + \in Substitute [(v_1, (Rhs o hd) s_1),(v_2, (Rhs o hd) s_2)] h_)";
7.71 +val ags = map (term_of o the o (parse DiffApp.thy))
7.72 + ["A::real", "alpha::real",
7.73 + "[A=a*b, a/2=r*sin alpha, b/2=r*cos alpha]"];
7.74 +val ll = []:loc_;
7.75 +(* problem with exn PTREE + eval_to -------------------------
7.76 +"-------------- subproblem with empty formalizaton -------";
7.77 +val (mI1,m1) =
7.78 + ("Subproblem", mstep2mstep' pt p
7.79 + (Subproblem (("Reals",["univar","equation","test"],
7.80 + (""(*"ANDERN !!!!!!!*),"no_met")),[])));
7.81 +val (mI2,m2) = (mI1,m1);
7.82 +val (mI3,m3) =
7.83 + ("Substitute", mstep2mstep' pt p
7.84 + (Substitute [("a","#2*r*sin alpha"),("b","#2*r*cos alpha")]));
7.85 +"------- same_tacpbl + eval_to -------";
7.86 +val Some(l1,t1) = same_tacpbl sc ll (mI1,m1);
7.87 +loc_2str l1;
7.88 +(*"[R, R, D, R, D, R, D, R, D, R, D, R, D, R, D, L, R]"*)
7.89 +Sign.string_of_term (sign_of DiffApp.thy) t1;
7.90 +(*"solve_univar (Reals, [univar, equation], no_met) B.1 B.3 "?6 ?4 *)
7.91 +
7.92 +val Some(l2,t2) = same_tacpbl sc l1 (mI2,m2);
7.93 +loc_2str l2;
7.94 +(*"[R, R, D, R, D, R, D, R, D, R, D, R, D, R, D, R, D, L, R]"*)
7.95 +Sign.string_of_term (sign_of DiffApp.thy) t2;
7.96 +(*"solve_univar (Reals, [univar, equation], no_met) B.1 B.3 "?7 ?3 *)
7.97 +
7.98 +val Some(l3,t3) = same_tacpbl sc l2 (mI3,m3);
7.99 +loc_2str l3;
7.100 +(*"[R, R, D, R, D, R, D, R, D, R, D, R, D, R, D, R, D, R, D]"*)
7.101 +Sign.string_of_term (sign_of DiffApp.thy) t3;
7.102 +(*"Substitute [(v_1, (Rhs o hd) B.1), (v_2, (Rhs o hd) B.0)] B.8"*)
7.103 +
7.104 +
7.105 +"------- eq_tacIDs + eq_consts + eval_args -------";
7.106 +val eq_ids = eq_tacIDs (*start-loc_*)[] sc (mI,m) [];
7.107 +val eq_cons = filter (eq_consts m) eq_ids;
7.108 +val Ready (l,(_,m)::_,_) = eval_args sc (mI,m) [(1,ags)] eq_cons;
7.109 +"------- locate -------";
7.110 +
7.111 +
7.112 +"-------------- subproblem with formalizaton -------";
7.113 +val (mI,m) =
7.114 + ("Subproblem", mstep2mstep' pt []
7.115 + (Subproblem (("Reals",["univar","equation","test"],
7.116 + (""(*"ANDERN !!!!!!!*),"no_met")),
7.117 + ["a//#2=r*sin alpha","a"])));
7.118 +"------- same_tacpbl + eval_to -------";
7.119 +
7.120 +
7.121 +"------- eq_tacIDs + eq_consts + eval_args -------";
7.122 +val eq_ids = eq_tacIDs [] sc (mI,m) [];
7.123 +val eq_cons = filter (eq_consts m) eq_ids;
7.124 +val Ready (l,(_,m)::_,_) = eval_args sc (mI,m) [(1,ags)] eq_cons;
7.125 +
7.126 +
7.127 +"------- locate -------";
7.128 +-------------------------------------------------------*)
7.129 +(* use"ME/script.sml";
7.130 + use"test-script.sml";
7.131 + *)
7.132 +
7.133 +
7.134 +
7.135 +(*#####################################################*)
7.136 +(*#####################################################*)
7.137 +"############## Make_fun_by_explicit ##############";
7.138 +val c = (the o (parse DiffApp.thy))
7.139 + "Script Make_fun_by_explicit (f_::real) (v_::real) \
7.140 + \ (eqs_::bool list) = \
7.141 + \ (let h_ = (hd o (filter (Testvar m_))) eqs_; \
7.142 + \ e1_ = hd (dropWhile (ident h_) eqs_); \
7.143 + \ vs_ = dropWhile (ident f_) (Var h_); \
7.144 + \ v1_ = hd (dropWhile (ident v_) vs_); \
7.145 + \ (s1::bool list) = (SubProblem (Reals_, [univar,equation],(Isac_,no_met))\
7.146 + \ [bool_ e1_, real_ v1_])\
7.147 + \ in Substitute [(v_1, (Rhs o hd) s_1)] h_)";
7.148 +
7.149 +
7.150 +(*#####################################################--------11.5.02
7.151 +"################ Solve_root_equation #################";
7.152 +(*#####################################################*)
7.153 +val sc = (term_of o the o (parse Test.thy))
7.154 + "Script Solve_root_equation (eq_::bool) (v_::real) (err_::bool) =\
7.155 + \ (let e_ = Rewrite square_equation_left True eq_; \
7.156 + \ e_ = Rewrite_Set Test_simplify False e_; \
7.157 + \ e_ = Rewrite_Set rearrange_assoc False e_; \
7.158 + \ e_ = Rewrite_Set isolate_root False e_; \
7.159 + \ e_ = Rewrite_Set Test_simplify False e_; \
7.160 +
7.161 + \ e_ = Rewrite square_equation_left True e_; \
7.162 + \ e_ = Rewrite_Set Test_simplify False e_; \
7.163 +
7.164 + \ e_ = Rewrite_Set norm_equation False e_; \
7.165 + \ e_ = Rewrite_Set Test_simplify False e_; \
7.166 + \ e_ = Rewrite_Set_Inst [(bdv,v_)] isolate_bdv False e_;\
7.167 + \ e_ = Rewrite_Set Test_simplify False e_ \
7.168 + \ in [e_::bool])";
7.169 +val ags = map (term_of o the o (parse Test.thy))
7.170 + ["sqrt(#9+#4*x)=sqrt x + sqrt(#5+x)", "x::real","#0"];
7.171 +val fmz =
7.172 + ["equality (sqrt(#9+#4*x)=sqrt x + sqrt(#5+x))",
7.173 + "solveFor x","errorBound (eps = #0)","solutions v_i_"];
7.174 +----------------------------------------------------------------11.5.02...*)
7.175 +
7.176 +
7.177 +(*#####################################################*)
7.178 +"------- Notlocatable: Free_Solve -------";
7.179 +"------- Notlocatable: Free_Solve -------";
7.180 +"------- Notlocatable: Free_Solve -------";
7.181 +val fmz = [];
7.182 +val (dI',pI',mI') =
7.183 + ("Test.thy",["sqroot-test","univariate","equation","test"],
7.184 + ("Test.thy","sqrt-equ-test"));
7.185 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
7.186 +val (p,_,f,nxt,_,pt) = me (mI,m) e_pos'[1] EmptyPtree;
7.187 +val nxt =
7.188 + ("Add_Given",
7.189 + Add_Given "equality (sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x))");
7.190 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
7.191 +val nxt = ("Add_Given",Add_Given "solveFor x");
7.192 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
7.193 +val nxt = ("Add_Given",Add_Given "errorBound (eps = 0)");
7.194 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
7.195 +val nxt = ("Add_Find",Add_Find "solutions v_i_");
7.196 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
7.197 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
7.198 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
7.199 +val nxt =
7.200 + ("Specify_Problem",Specify_Problem ["sqroot-test","univariate","equation","test"]);
7.201 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
7.202 +val nxt = ("Specify_Method",Specify_Method ("Test.thy","sqrt-equ-test"));
7.203 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
7.204 +
7.205 +"--- -1 ---";
7.206 +val nxt = ("Free_Solve",Free_Solve);
7.207 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
7.208 +
7.209 +"--- 0 ---";
7.210 +val nxt = ("Take",Take "sqrt(9+4*x)=sqrt x + sqrt(5+x)");
7.211 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
7.212 +(*me ("Begin_Trans" ////*)
7.213 +
7.214 +"--- 1 ---";
7.215 +val nxt = ("Rewrite_Asm",Rewrite_Asm ("square_equation_left",""));
7.216 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
7.217 +
7.218 +"--- 2 ---";
7.219 +val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");
7.220 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
7.221 +
7.222 +"--- 3 ---";
7.223 +val nxt = ("Rewrite_Set",Rewrite_Set "rearrange_assoc");
7.224 +val (p,_,f,nxt,_,pt) = me nxt p [] pt;
7.225 +if f = Form'
7.226 + (FormKF
7.227 + (~1,EdUndef,1,Nundef,
7.228 + "9 + 4 * x = 5 + 2 * x + 2 * sqrt (x ^^^ 2 + 5 * x)"))
7.229 +then () else raise error "behaviour in root-expl. Free_Solve changed";
7.230 +writeln (pr_ptree pr_short pt);
7.231 +
7.232 +
7.233 +
7.234 +val d = e_rls;
7.235 +
7.236 +" --- test100: nxt_tac order------------------------------------ ";
7.237 +" --- test100: nxt_tac order------------------------------------ ";
7.238 +
7.239 +val scr as (Script sc) = Script (((inst_abs Test.thy)
7.240 + o term_of o the o (parse thy))
7.241 + "Script Testeq (e_::bool) = \
7.242 + \(While (contains_root e_) Do \
7.243 + \((Try (Repeat (Rewrite rroot_square_inv False))) @@ \
7.244 + \ (Try (Repeat (Rewrite square_equation_left True))) @@ \
7.245 + \ (Try (Repeat (Rewrite radd_0 False)))))\
7.246 + \ e_ ");
7.247 +atomty thy sc;
7.248 +val (dI',pI',mI') = ("Test.thy",e_pblID,
7.249 + ("Test.thy","sqrt-equ-test"));
7.250 +val p = e_pos'; val c = [];
7.251 +val (mI,m) = ("Init_Proof",Init_Proof ([], (dI',pI',mI')));
7.252 +val (p,_,_,_,_,pt) = me (mI,m) p c EmptyPtree;
7.253 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
7.254 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.255 +val nxt = ("Specify_Method",Specify_Method("Test.thy","sqrt-equ-test")); (*for asm in square_equation_left*)
7.256 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.257 +val p = ([1],Res):pos';
7.258 +val eq_ = (term_of o the o (parse thy))"e_::bool";
7.259 +
7.260 +val ct = "0+(sqrt(sqrt(sqrt a))^^^2)^^^2=0";
7.261 +val ve0_= (term_of o the o (parse thy)) ct;
7.262 +val ets0=[([],(Mstep'(Script.thy,"BS","",""),[(eq_,ve0_)],[(eq_,ve0_)],
7.263 + e_term,e_term,Safe)),
7.264 + ([],(User', [], [], e_term, e_term,Sundef))]:ets;
7.265 +val l0 = [];
7.266 +" --------------- 1. ---------------------------------------------";
7.267 +val (pt,_) = cappend_atomic pt[1]e_istate""(Rewrite("test","")) ct Complete;
7.268 +val Appl m'=applicable_in p pt (Rewrite("rroot_square_inv",""));
7.269 +
7.270 +
7.271 +(*-----------11.5.02: ets disabolished ------------------
7.272 +
7.273 +val NextStep(l1,m') = nxt_tac "Test.thy" (pt,p) scr ets0 l0;
7.274 +(*val l = [R,R,L,R,R,R] : loc_
7.275 + val m' = Rewrite'...("rroot_square_inv",..(sqrt (sqrt (sqrt a))..
7.276 + -> sqrt (sqrt a)*)
7.277 +
7.278 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets1)] =
7.279 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets0 l0;
7.280 +val ets1 = (drop_last ets0) @ ets1;val pt = update_ets pt [] [(1,ets1)];
7.281 +writeln(ets2str ets1);
7.282 +" --------------- 2. ---------------------------------------------";
7.283 +val Appl m'=applicable_in p pt (Rewrite("rroot_square_inv",""));
7.284 +
7.285 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.286 +(*val l = [R,R,L,R,R,R] : loc_
7.287 +val m' = Rewrite'...("rroot_square_inv",..,sqrt (sqrt a)..
7.288 + -> #0+ sqrt a =#0*)
7.289 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.290 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.291 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.292 +writeln(ets2str ets2);
7.293 +" --------------- 3. ---------------------------------------------";
7.294 +val Appl m'=applicable_in p pt (Rewrite("radd_0",""));
7.295 +
7.296 +val NextStep(l3,m') = nxt_tac "Test.thy" (pt,p) scr ets2 l2;
7.297 +(*val l = [R,R,R,D,R,D,R,R] : loc_
7.298 +val m' = Rewrite'...("radd_0","")..(#0 + sqrt a = #0)..-> sqrt a = #0*)
7.299 +
7.300 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets3)] =
7.301 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets2 l2;
7.302 +val ets3 = (drop_last ets2) @ ets3; val pt = update_ets pt [] [(1,ets3)];
7.303 +writeln(ets2str ets3);
7.304 +" --------------- 4. ---------------------------------------------";
7.305 +val Appl m'=applicable_in p pt (Rewrite("square_equation_left",""));
7.306 +
7.307 +val NextStep(l4,m') = nxt_tac "Test.thy" (pt,p) scr ets3 l3;
7.308 +(*val l = [R,R,R,D,L,R,R,R] : loc_
7.309 +val m' = Rewrite'...("square_equation_left"..(sqrt a = #0)..a = #0^#2*)
7.310 +
7.311 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets4)] =
7.312 +(*=====*) locate_gen "Test.thy" m' (pt,p) (scr,d) ets3 l3;
7.313 +val ets4 = (drop_last ets3) @ ets4; val pt = update_ets pt [] [(1,ets4)];
7.314 +
7.315 +" --------------- 5. ---------------------------------------------";
7.316 +val Finished _ = nxt_tac "Test.thy" (pt,p) scr ets4 l4;
7.317 +
7.318 +writeln (pr_ptree pr_short pt);writeln("result: "^res^
7.319 +"\n===================================================================");
7.320 +"--- test100 nxt_tac order: finished correctly ---------------";
7.321 +"--- test100 nxt_tac order: finished correctly ---------------";
7.322 +"--- test100 nxt_tac order: finished correctly ---------------";
7.323 +
7.324 +
7.325 +
7.326 +
7.327 +" --- test100: order 1 3 1 2 ----------------------------------- ";
7.328 +" --- test100: order 1 3 1 2 ----------------------------------- ";
7.329 +val scr as (Script sc) =
7.330 + Script (((inst_abs Test.thy) o term_of o the o (parse thy))
7.331 + "Script Testeq (e_::bool) = \
7.332 + \While (contains_root e_) Do \
7.333 + \ (let e_ = Try (Repeat (Rewrite rroot_square_inv False e_)); \
7.334 + \ e_ = Try (Repeat (Rewrite square_equation_left True e_)) \
7.335 + \ in Try (Repeat (Rewrite radd_0 False e_))) ");
7.336 +val (dI',pI',mI') = ("Test.thy",e_pblID,
7.337 + ("Test.thy","sqrt-equ-test"));
7.338 +val p = e_pos'; val c = [];
7.339 +val (mI,m) = ("Init_Proof",Init_Proof ([], (dI',pI',mI')));
7.340 +val (p,_,_,_,_,pt) = me (mI,m) p c EmptyPtree;
7.341 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
7.342 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.343 +val nxt = ("Specify_Method",Specify_Method("Test.thy","sqrt-equ-test")); (*for asm in square_equation_left*)
7.344 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.345 +val p = ([1],Res):pos';
7.346 +val eq_ = (term_of o the o (parse thy))"e_::bool";
7.347 +
7.348 +val ct = "#0+(sqrt(sqrt(sqrt a))^^^#2)^^^#2=#0";
7.349 +val ve0_= (term_of o the o (parse thy)) ct;
7.350 +val ets0=[([],(Mstep'(Script.thy,"bS","",""),[(eq_,ve0_)],[(eq_,ve0_)],
7.351 + e_term,e_term,Safe)),
7.352 + ([],(User', [], [], e_term, e_term,Sundef))]:ets;
7.353 +val l0 = [];
7.354 +" --------------- 1. --- test100 order 1 3 1 2 --------------------";
7.355 +val (pt,_) = cappend_atomic pt[1]e_istate""(Rewrite("test","")) ct Complete;
7.356 +val Appl m'=applicable_in p pt (Rewrite("rroot_square_inv",""));
7.357 +
7.358 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets1)] =
7.359 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets0 l0;
7.360 +val ets1 = (drop_last ets0) @ ets1;val pt = update_ets pt [] [(1,ets1)];
7.361 +writeln (ets2str ets1);
7.362 +" --------------- 2. --- test100 order 1 3 1 2 --------------------";
7.363 +val Appl m'=applicable_in p pt (Rewrite("radd_0",""));
7.364 +val Rewrite'(_,_,_,_,("radd_0",""),f,(_,[])) = m';
7.365 +Sign.string_of_term (sign_of (thy)) f;
7.366 +(*"#0 + sqrt (sqrt a) ^^^ #2 = #0"
7.367 + -> AssocWeak .. pt aus ass_up,ass_dn,assy _verworfen_.. nur letzte tac*)
7.368 +
7.369 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.370 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.371 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.372 +" --------------- 3. --- test100 order 1 3 1 2 --------------------";
7.373 +val Appl m'=applicable_in p pt (Rewrite("rroot_square_inv",""));
7.374 +
7.375 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets3)] =
7.376 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets2 l2;
7.377 +val ets3 = (drop_last ets2) @ ets3; val pt = update_ets pt [] [(1,ets3)];
7.378 +" --------------- 4. --- test100 order 1 3 1 2 --------------------";
7.379 +val Appl m'=applicable_in p pt (Rewrite("square_equation_left",""));
7.380 +
7.381 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets4)] =
7.382 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets3 l3;
7.383 +val ets4 = (drop_last ets3) @ ets4; val pt = update_ets pt [] [(1,ets4)];
7.384 +if res="a = #0 ^^^ #2"then()else raise error "test100 order 1 3 1 2";
7.385 +" --------------- 5. --- test100 order 1 3 1 2 --------------------";
7.386 +val Finished _ = nxt_tac "Test.thy" (pt,p) scr ets4 l4;
7.387 +writeln (pr_ptree pr_short pt);writeln("result: "^res^
7.388 +"\n===================================================================");
7.389 +"--- test100 order 1 3 1 2: finished correctly --------------";
7.390 +"--- test100 order 1 3 1 2: finished correctly --------------";
7.391 +
7.392 +
7.393 +
7.394 +
7.395 +" --- test200: nxt_tac order ------------------------------------- ";
7.396 +" --- test200: nxt_tac order ------------------------------------- ";
7.397 +
7.398 +val scr as (Script sc) =
7.399 + Script (((inst_abs Test.thy) o term_of o the o (parse thy))
7.400 + "Script Testterm (g_::real) = \
7.401 + \Repeat \
7.402 + \ ((Repeat (Rewrite rmult_1 False g_)) Or \
7.403 + \ (Repeat (Rewrite rmult_0 False g_)) Or \
7.404 + \ (Repeat (Rewrite radd_0 False g_))) ");
7.405 +val d = e_rls; (*domain-rls for assod*)
7.406 +val (dI',pI',mI') = ("Test.thy",e_pblID,
7.407 + ("Test.thy","sqrt-equ-test"));
7.408 +val p = e_pos'; val c = [];
7.409 +val (mI,m) = ("Init_Proof",Init_Proof ([], (dI',pI',mI')));
7.410 +val (p,_,_,_,_,pt) = me (mI,m) p c EmptyPtree;
7.411 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
7.412 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.413 +val nxt = ("Specify_Method",Specify_Method ("Test.thy","sqrt-equ-test")); (*for asm in square_equation_left*)
7.414 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.415 +val p = ([1],Res):pos';
7.416 +val g_ = (term_of o the o (parse thy)) "g_";
7.417 +
7.418 +val ct = "(#0+#0)*(#1*(#1*a))";
7.419 +val vg0_= (term_of o the o (parse thy)) ct;
7.420 +val ets0 = [([],(Mstep'(Script.thy,"sB","",""), [(g_,vg0_)], [(g_,vg0_)],
7.421 + e_term, e_term,Safe)),
7.422 + ([],(User', [], [], e_term, e_term,Sundef))]:ets;
7.423 +val l0 = [];
7.424 +" --------------- 1. ---------------------------------------------";
7.425 +val (pt,_) = cappend_atomic pt[1]e_istate ""(Rewrite("test",""))ct Complete;
7.426 +val Appl m'=applicable_in p pt (Rewrite("rmult_1",""));
7.427 +
7.428 +val NextStep(l1,m') = nxt_tac "Test.thy" (pt,p) scr ets0 l0;
7.429 +(*val l = [R,R,L,R,L,R,R] : loc_
7.430 +val m' = Rewrite' ... ("rmult_1","") (#0+#0)*#1*(#1*a)*)
7.431 +
7.432 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets1)] =
7.433 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets0 l0;
7.434 +val ets1 = (drop_last ets0) @ ets1;val pt = update_ets pt [] [(1,ets1)];
7.435 +
7.436 +" --------------- 2. ---------------------------------------------";
7.437 +val Appl m'=applicable_in p pt (Rewrite("rmult_1",""));
7.438 +
7.439 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.440 +(*val l = [R,R,L,R,L,R,R] : loc_
7.441 +val m' = Rewrite' ... ("rmult_1","") (#0+#0)*#1*a*)
7.442 +
7.443 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.444 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.445 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.446 +
7.447 +" --------------- 3. ---------------------------------------------";
7.448 +val Appl m'=applicable_in p pt (Rewrite("radd_0",""));
7.449 +
7.450 +val NextStep(l3,m') = nxt_tac "Test.thy" (pt,p) scr ets2 l2;
7.451 +(*val l = [R,R,R,R] : loc_
7.452 +val m' = Rewrite'...("radd_0","") (#0+#0)*a *)
7.453 +
7.454 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets3)] =
7.455 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets2 l2;
7.456 +val ets3 = (drop_last ets2) @ ets3; val pt = update_ets pt [] [(1,ets3)];
7.457 +
7.458 +" --------------- 4. ---------------------------------------------";
7.459 +val Appl m'=applicable_in p pt (Rewrite("rmult_0",""));
7.460 +
7.461 +val NextStep(l4,m') = nxt_tac "Test.thy" (pt,p) scr ets3 l3;
7.462 +(*al l = [R,R,L,R,R,R] : loc_
7.463 +val m' = Rewrite'...("rmult_0","") #0*a *)
7.464 +
7.465 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets4)] =
7.466 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets3 l3;
7.467 +val ets4 = (drop_last ets3) @ ets4; val pt = update_ets pt [] [(1,ets4)];
7.468 +
7.469 +" --------------- 5. ---------------------------------------------";
7.470 +val Finished _ = nxt_tac "Test.thy" (pt,p) scr ets4 l4;
7.471 +(*al l = [R,R,L,R,R,R] : loc_
7.472 +val m' = Rewrite'...("rmult_0","") #0*a *)
7.473 +writeln (pr_ptree pr_short pt);writeln("result: "^res^
7.474 +"\n===================================================================");
7.475 +"--- test200 nxt_tac order: finished correctly ---------------";
7.476 +"--- test200 nxt_tac order: finished correctly ---------------";
7.477 +
7.478 +
7.479 +
7.480 +
7.481 +" --- test200: order 3 1 1 2 --------------------------------- ";
7.482 +" --- test200: order 3 1 1 2 --------------------------------- ";
7.483 +val p = e_pos'; val c = [];
7.484 +val (mI,m) = ("Init_Proof",Init_Proof ([], (dI',pI',mI')));
7.485 +val (p,_,_,_,_,pt) = me (mI,m) p c EmptyPtree;
7.486 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
7.487 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.488 +val nxt = ("Specify_Method",Specify_Method ("Test.thy","sqrt-equ-test")); (*for asm in square_equation_left*)
7.489 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.490 +val p = ([1],Res):pos';
7.491 +val g_ = (term_of o the o (parse thy)) "g_";
7.492 +
7.493 +val ct = "(#0+#0)*(#1*(#1*a))";
7.494 +val vg0_= (term_of o the o (parse thy)) ct;
7.495 +val ets0 = [([],(Mstep'(Script.thy,"sB","",""),[(g_,vg0_)],[(g_,vg0_)],
7.496 + e_term,e_term,Safe)),
7.497 + ([],(User', [], [], e_term, e_term,Sundef))]:ets;
7.498 +val l0 = [];
7.499 +" --------------- 1. --- test200: order 3 1 1 2 -----------------";
7.500 +val (pt,_) = cappend_atomic pt[1]e_istate ""(Rewrite("test",""))ct Complete;
7.501 +val Appl m'=applicable_in p pt (Rewrite("radd_0",""));
7.502 +
7.503 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets1)] =
7.504 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets0 l0;
7.505 +val ets1 = (drop_last ets0) @ ets1;val pt = update_ets pt [] [(1,ets1)];
7.506 +
7.507 +" --------------- 2. --- test200: order 3 1 1 2 -----------------";
7.508 +val Appl m'=applicable_in p pt (Rewrite("rmult_1",""));
7.509 +
7.510 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.511 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.512 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.513 +if res="#0 * (#1 * a)"then()else raise error "error test200: order 3 1 1 2";
7.514 +" --------------- 3. --- test200: order 3 1 1 2 -----------------";
7.515 +val Appl m'=applicable_in p pt (Rewrite("rmult_1",""));
7.516 +
7.517 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets3)] =
7.518 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets2 l2;
7.519 +val ets3 = (drop_last ets2) @ ets3; val pt = update_ets pt [] [(1,ets3)];
7.520 +
7.521 +" --------------- 4. --- test200: order 3 1 1 2 -----------------";
7.522 +val Appl m'=applicable_in p pt (Rewrite("rmult_0",""));
7.523 +
7.524 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets4)] =
7.525 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets3 l3;
7.526 +val ets4 = (drop_last ets3) @ ets4; val pt = update_ets pt [] [(1,ets4)];
7.527 +
7.528 +if res="#0"then()else raise error "test200 order 3 1 1 2";
7.529 +" --------------- 5. --- test200: order 3 1 1 2 -----------------";
7.530 +val Finished _ = nxt_tac "Test.thy" (pt,p) scr ets4 l4;
7.531 +writeln (pr_ptree pr_short pt);writeln("result: "^res^
7.532 +"\n===================================================================");
7.533 +"--- test200 order 3 1 1 2: finished correctly ---------------";
7.534 +"--- test200 order 3 1 1 2: finished correctly ---------------";
7.535 +
7.536 +
7.537 +------------------------------------11.5.02: ets disabolished ---*)
7.538 +(* use"test-script-nxt_tac.sml";
7.539 + *)
7.540 +
7.541 +(*---------11.5.02:
7.542 +### Currently parsed expression could be extremely ambiguous. ----------
7.543 +
7.544 +" --- root-equation: nxt_tac order------------------------------ ";
7.545 +" --- root-equation: nxt_tac order------------------------------ ";
7.546 +val scr as (Script sc) =
7.547 + Script (((inst_abs Test.thy) o term_of o the o (parse thy))
7.548 + "Script Solve_root_equation (e_::bool) (v_::real) (err_::bool) =\
7.549 + \ (let e_ = \
7.550 + \ (While (contains_root e_) Do \
7.551 + \ (let \
7.552 + \ e_ = Rewrite square_equation_left True e_; \
7.553 + \ e_ = Try (Rewrite_Set Test_simplify False e_); \
7.554 + \ e_ = Try (Rewrite_Set rearrange_assoc False e_); \
7.555 + \ e_ = Try (Rewrite_Set isolate_root False e_) \
7.556 + \ in Try (Rewrite_Set Test_simplify False e_))); \
7.557 + \ e_ = Try (Rewrite_Set norm_equation False e_); \
7.558 + \ e_ = Try (Rewrite_Set Test_simplify False e_); \
7.559 + \ e_ = Rewrite_Set_Inst [(bdv,v_::real)] isolate_bdv False e_;\
7.560 + \ e_ = Try (Rewrite_Set Test_simplify False e_) \
7.561 + \ in [e_::bool])");
7.562 +val (dI',pI',mI') = ("Test.thy",e_pblID,
7.563 + ("Test.thy","sqrt-equ-test"));
7.564 +val p = e_pos'; val c = [];
7.565 +val (mI,m) = ("Init_Proof",Init_Proof ([], (dI',pI',mI')));
7.566 +val (p,_,_,_,_,pt) = me (mI,m) p c EmptyPtree;
7.567 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
7.568 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.569 +val nxt = ("Specify_Method",Specify_Method("Test.thy","sqrt-equ-test")); (*for asm in square_equation_left*)
7.570 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.571 +val p = ([1],Frm):pos';
7.572 +
7.573 +val bdv_ =(term_of o the o (parse thy))"v_::real";
7.574 +val v_ =(term_of o the o (parse thy))"x::real";
7.575 +val eq_ = (term_of o the o (parse thy))"e_::bool";
7.576 +val ct = "sqrt(#9+#4*x)=sqrt x + sqrt(#5+x)";
7.577 +val ve0_= (term_of o the o (parse thy)) ct;
7.578 +val env= [(bdv_, v_), (eq_, ve0_)];
7.579 +val ets1 =[([],(Mstep'(Script.thy,"BS","",""),env,env,e_term,e_term,Safe)),
7.580 + ([],(User', [], [], e_term, e_term,Sundef))]:ets;
7.581 +val l1 = [];
7.582 +" -------root-equation--- 1.--- nxt_tac-order----------------------";
7.583 +val (pt,_) = cappend_form pt[1]e_istate ct;
7.584 +
7.585 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.586 +(*square_equation_left*)
7.587 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.588 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.589 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.590 +if res = "#9 + #4 * x = (sqrt x + sqrt (#5 + x)) ^^^ #2"
7.591 +then () else raise error "new behaviour in test-example";
7.592 +writeln (pr_ptree pr_short pt);
7.593 +" -------root-equation--- 2.--- nxt_tac-order----------------------";
7.594 +val ets1 = ets2; val l1 = l2;
7.595 +(*
7.596 +> val eee = (hd) ets2;
7.597 +> val (_,(_,_,ennv,_,rees,_)) = eee;
7.598 +> subst2str ennv;
7.599 +> Sign.string_of_term (sign_of ( thy)) rees;
7.600 +*)
7.601 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.602 +(*Test_simplify*)
7.603 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.604 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.605 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.606 +if res = "#9 + #4 * x = #5 + (#2 * x + #2 * sqrt (x ^^^ #2 + #5 * x))"
7.607 +then () else raise error "new behaviour in test-example";
7.608 +writeln (pr_ptree pr_short pt);
7.609 +" -------root-equation--- 3.--- nxt_tac-order----------------------";
7.610 +val ets1 = ets2; val l1 = l2;
7.611 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.612 +(*rearrange_assoc*)
7.613 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.614 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.615 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.616 +if res = "#9 + #4 * x = #5 + #2 * x + #2 * sqrt (x ^^^ #2 + #5 * x)"
7.617 +then () else raise error "new behaviour in test-example";
7.618 +writeln (pr_ptree pr_short pt);
7.619 +" -------root-equation--- 4.--- nxt_tac-order----------------------";
7.620 +val ets1 = ets2; val l1 = l2;
7.621 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.622 +(*isolate_root*)
7.623 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.624 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.625 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.626 +if res = "sqrt (x ^^^ #2 + #5 * x) = (#5 + #2 * x + #-1 * (#9 + #4 * x)) // (#-1 * #2)"
7.627 +then () else raise error "new behaviour in test-example";
7.628 +writeln (pr_ptree pr_short pt);
7.629 +" -------root-equation--- 5.--- nxt_tac-order----------------------";
7.630 +val ets1 = ets2; val l1 = l2;
7.631 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.632 +(*Test_simplify*)
7.633 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.634 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.635 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.636 +if res = "sqrt (x ^^^ #2 + #5 * x) = #2 + x"
7.637 +then () else raise error "new behaviour in test-example";
7.638 +writeln (pr_ptree pr_short pt);
7.639 +" -------root-equation--- 6.--- nxt_tac-order----------------------";
7.640 +val ets1 = ets2; val l1 = l2;
7.641 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.642 +(*square_equation_left*)
7.643 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.644 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.645 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.646 +if res = "x ^^^ #2 + #5 * x = (#2 + x) ^^^ #2"
7.647 +then () else raise error "new behaviour in test-example";
7.648 +writeln (pr_ptree pr_short pt);
7.649 +" -------root-equation--- 7.--- nxt_tac-order----------------------";
7.650 +val ets1 = ets2; val l1 = l2;
7.651 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.652 +(*Test_simplify*)
7.653 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.654 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.655 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.656 +if res = "x ^^^ #2 + #5 * x = #4 + (x ^^^ #2 + #4 * x)"
7.657 +then () else raise error "new behaviour in test-example";
7.658 +writeln (pr_ptree pr_short pt);
7.659 +" -------root-equation--- 8.--- nxt_tac-order----------------------";
7.660 +val ets1 = ets2; val l1 = l2;
7.661 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.662 +(*rearrange_assoc ...<> test-root-equ.sml: norm_equation*)
7.663 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.664 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.665 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.666 +if res = "x ^^^ #2 + #5 * x = #4 + x ^^^ #2 + #4 * x"
7.667 +(* "x ^^^ #2 + #5 * x + #-1 * (#4 + (x ^^^ #2 + #4 * x)) = #0"
7.668 + ...<> test-root-equ.sml*)
7.669 +then () else raise error "new behaviour in test-example";
7.670 +writeln (pr_ptree pr_short pt);
7.671 +" -------root-equation--- 9.--- nxt_tac-order----------------------";
7.672 +val ets1 = ets2; val l1 = l2;
7.673 +(*> Sign.string_of_term (sign_of thy) (go l2 sc);
7.674 +val it = "Rewrite_Set rearrange_assoc False e_" : string*)
7.675 +
7.676 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.677 +(*Test_simplify*)
7.678 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.679 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.680 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.681 +if res = "x ^^^ #2 + #5 * x = #4 + (x ^^^ #2 + #4 * x)"
7.682 +then () else raise error "new behaviour in test-example";
7.683 +writeln (pr_ptree pr_short pt);
7.684 +" -------root-equation--- 10.--- nxt_tac-order----------------------";
7.685 +val ets1 = ets2; val l1 = l2;
7.686 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.687 +(*norm_equation*)
7.688 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.689 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.690 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.691 +if res = "x ^^^ #2 + #5 * x + #-1 * (#4 + (x ^^^ #2 + #4 * x)) = #0"
7.692 +then () else raise error "new behaviour in test-example";
7.693 +writeln (pr_ptree pr_short pt);
7.694 +" -------root-equation--- 11.--- nxt_tac-order----------------------";
7.695 +val ets1 = ets2; val l1 = l2;
7.696 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.697 +(*Test_simplify*)
7.698 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.699 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.700 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.701 +if res = "#-4 + x = #0"
7.702 +then () else raise error "new behaviour in test-example";
7.703 +writeln (pr_ptree pr_short pt);
7.704 +" -------root-equation--- 12.--- nxt_tac-order----------------------";
7.705 +val ets1 = ets2; val l1 = l2;
7.706 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.707 +(*isolate_bdv*)
7.708 +(*> val eee = (last_elem o drop_last) ets2;
7.709 +> val (_,(mmm,_,ennv,_,rees,_)) = eee;
7.710 +val mmm = Rewrite_Set'
7.711 + ("Test.thy","erls",false,"Test_simplify",# $ # $ Free #,(# $ #,[]))
7.712 +> writeln(subst2str ennv);
7.713 +["(e_, x ^^^ #2 + #5 * x + #-1 * (#4 + (x ^^^ #2 + #4 * x)) = #0)"]
7.714 +> Sign.string_of_term (sign_of ( thy)) rees;
7.715 +val it = "#-4 + x = #0" : string*)
7.716 +
7.717 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.718 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.719 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.720 +if res = "x = #0 + #-1 * #-4"
7.721 +then () else raise error "new behaviour in test-example";
7.722 +writeln (pr_ptree pr_short pt);
7.723 +" -------root-equation--- 13.--- nxt_tac-order----------------------";
7.724 +val ets1 = ets2; val l1 = l2;
7.725 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.726 +(*Test_simplify*)
7.727 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.728 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.729 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.730 +if res = "x = #4"
7.731 +then () else raise error "new behaviour in test-example";
7.732 +writeln (pr_ptree pr_short pt);
7.733 +" -------root-equation--- 14.--- nxt_tac-order----------------------";
7.734 +val ets1 = ets2; val l1 = l2;
7.735 +val Finished _ = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.736 +
7.737 +writeln (pr_ptree pr_short pt);
7.738 +writeln("result: "^res^"\n===================================================================");
7.739 +" --- root-equation: nxt_tac order .. finised correctly --------- ";
7.740 +" --- root-equation: nxt_tac order .. finised correctly --------- ";
7.741 +
7.742 +
7.743 +-------------------------------------11.5.02-----*)
7.744 +(*-----------------------------------11.5.02 ets disabolished -------
7.745 +
7.746 +" --- root-equation: 1.norm_equation ------------------------------ ";
7.747 +" --- root-equation: 1.norm_equation ------------------------------ ";
7.748 +val p = e_pos'; val c = [];
7.749 +val (mI,m) = ("Init_Proof",Init_Proof ([], (dI',pI',mI')));
7.750 +val (p,_,_,_,_,pt) = me (mI,m) p c EmptyPtree;
7.751 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
7.752 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.753 +val nxt = ("Specify_Method",Specify_Method("Test.thy","sqrt-equ-test")); (*for asm in square_equation_left*)
7.754 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.755 +val p = ([1],Frm):pos';
7.756 +val ets1 =[([],(Mstep'(Script.thy,"BS","",""),env,env,e_term,e_term,Safe)),
7.757 + user_interrupt]:ets;
7.758 +" -------root-equation--- 1.--- 1.norm_equation----------------------";
7.759 +val (pt,_) = cappend_form pt[1]e_istate ct;
7.760 +val Appl m'= applicable_in p pt (Rewrite_Set "norm_equation");
7.761 +
7.762 +val l1 = (fst o last_elem o drop_last) ets1;
7.763 +(*val l1 = [R,L,R,R,L,R];//////////////test-root_equ, me 11.10.00*)
7.764 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.765 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.766 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.767 +if res = "sqrt (#9 + #4 * x) + #-1 * (sqrt x + sqrt (#5 + x)) = #0"
7.768 +then () else raise error "new behaviour in test-example";
7.769 +
7.770 +val l2 = (fst o last_elem o drop_last) ets2;
7.771 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets2 l2;
7.772 +val ets1 = ets2;
7.773 +" -------root-equation--- 2.--- 1.norm_equation----------------------";
7.774 +(*m'=Rewrite_Set'...,"Test_simplify" *)
7.775 +val l1 = (fst o last_elem o drop_last) ets1;
7.776 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.777 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.778 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.779 +if res = "#-1 * sqrt x + (#-1 * sqrt (#5 + x) + sqrt (#9 + #4 * x)) = #0"
7.780 +then () else raise error "new behaviour in test-example";
7.781 +
7.782 +val Notappl _ =
7.783 + applicable_in p pt (Rewrite_Set_Inst(["(bdv,v_)"],"isolate_bdv"));
7.784 +val Notappl _ = applicable_in p pt (Rewrite_Set "Test_simplify");
7.785 +
7.786 +val l2 = (fst o last_elem o drop_last) ets2;
7.787 +val Helpless = nxt_tac "Test.thy" (pt,p) scr ets2 l2;
7.788 +(* ~~~~ because isolate_bdv goes without Try *)
7.789 +writeln (pr_ptree pr_short pt);
7.790 +val ets1 = ets2;
7.791 +" -------root-equation--- 3.--- 1.norm_equation----------------------";
7.792 +val Appl m'= applicable_in p pt (Rewrite_Set "rearrange_assoc");
7.793 +
7.794 +val l1 = (fst o last_elem o drop_last) ets1;
7.795 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.796 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.797 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.798 +
7.799 +val l2 = (fst o last_elem o drop_last) ets2;
7.800 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets2 l2;
7.801 +writeln (pr_ptree pr_short pt);
7.802 +val ets1 = ets2;
7.803 +" -------root-equation--- 4.--- 1.norm_equation----------------------";
7.804 +(*m' = .. isolate_root*)
7.805 +val l1 = (fst o last_elem o drop_last) ets1;
7.806 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.807 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.808 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.809 +
7.810 +val l2 = (fst o last_elem o drop_last) ets2;
7.811 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets2 l2;
7.812 +writeln (pr_ptree pr_short pt);
7.813 +val ets1 = ets2;
7.814 +" -------root-equation--- 5.--- 1.norm_equation----------------------";
7.815 +(*m' = .. Test_simplify*)
7.816 +val l1 = (fst o last_elem o drop_last) ets1;
7.817 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.818 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.819 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.820 +
7.821 +val l2 = (fst o last_elem o drop_last) ets2;
7.822 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets2 l2;
7.823 +writeln (pr_ptree pr_short pt);
7.824 +if res="sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x)" then ()
7.825 +else raise error "new behaviour in test-example";
7.826 +
7.827 +-------------------------------------11.5.02-----*)
7.828 +
7.829 +
7.830 +(* use"test-script.sml";
7.831 + *)
7.832 +
7.833 +
7.834 +
7.835 +
7.836 +
7.837 +
7.838 +
7.839 +(* --- test200: calculate -----------------------------------------
7.840 +" --- test200: calculate -----------------------------------------";
7.841 +val scr as (Script sc) =
7.842 + Script (((inst_abs Test.thy) o term_of o the o (parse thy))
7.843 + "Script Testterm (g_::real) = \
7.844 + \Repeat (Calculate plus g_) ");
7.845 +val (dI',pI',mI') = ("Test.thy",e_pblID,
7.846 + ("Test.thy","sqrt-equ-test"));
7.847 +val p = e_pos'; val c = [];
7.848 +val (mI,m) = ("Init_Proof",Init_Proof ([], (dI',pI',mI')));
7.849 +val (p,_,_,_,_,pt) = me (mI,m) p c EmptyPtree;
7.850 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
7.851 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.852 +val nxt = ("Specify_Method",Specify_Method ("Test.thy","sqrt-equ-test")); (*for asm in square_equation_left*)
7.853 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.854 +val p = ([1],Res):pos';
7.855 +val g_ = (term_of o the o (parse thy)) "g_";
7.856 +val vg_= (term_of o the o (parse thy)) "#1+#2";
7.857 +val env = [(g_,vg_)];
7.858 +
7.859 +val ets = []:ets;
7.860 +(* --------------- 1. ---------------------------------------------*)
7.861 +val (pt,_) = cappend_atomic pt [1] e_istate ""
7.862 + (Rewrite("test","")) "#1+#2" Complete;
7.863 +val Appl m'=applicable_in p pt (Calculate "plus");
7.864 +
7.865 +val NextStep(l,m') = nxt_tac "Test.thy" (pt,p) scr ets l;
7.866 +(*val l = [R,R,R,R] : loc_
7.867 + val m' = Calculate' ("Test.thy","plus", #1+#2 = #3*)
7.868 +
7.869 +val ets = (l,mstep'2etac m')::ets;
7.870 +(* --------------- 2. ---------------------------------------------*)
7.871 +val (pt,_) = cappend_atomic pt [1] e_istate ""
7.872 + (Rewrite("test","")) "#3" Complete;
7.873 +
7.874 +val Helpless = nxt_tac "Test.thy" (pt,p) scr ets l;
7.875 +(*val l = [R,R,R,R] : loc_
7.876 + val m' = Calculate' ("Test.thy","plus", #1+#2 = #3*)
7.877 +---*)
7.878 +
7.879 +
7.880 +(* --- test200: Test_simplify -----------------------------------
7.881 +
7.882 +val scr as (Script sc) =
7.883 + Script (((inst_abs Test.thy) o term_of o the o (parse thy))
7.884 + "Script Testterm (g_::real) = \
7.885 + \Repeat \
7.886 + \ ((Repeat (Rewrite radd_mult_distrib2 False g_)) Or \
7.887 + \ (Repeat (Rewrite rdistr_right_assoc False g_)) Or \
7.888 + \ (Repeat (Rewrite rdistr_right_assoc_p False g_)) Or \
7.889 + \ (Repeat (Rewrite rdistr_div_right False g_)) Or \
7.890 + \ (Repeat (Rewrite rbinom_power_2 False g_)) Or \
7.891 + \ (Repeat (Rewrite radd_commute False g_)) Or \
7.892 + \ (Repeat (Rewrite radd_left_commute False g_)) Or \
7.893 + \ (Repeat (Rewrite radd_assoc False g_)) Or \
7.894 + \ (Repeat (Rewrite rmult_commute False g_)) Or \
7.895 + \ (Repeat (Rewrite rmult_left_commute False g_)) Or \
7.896 + \ (Repeat (Rewrite rmult_assoc False g_)) Or \
7.897 + \ (Repeat (Rewrite radd_real_const_eq False g_)) Or \
7.898 + \ (Repeat (Rewrite radd_real_const False g_)) Or \
7.899 + \ (Repeat (Calculate plus g_)) Or \
7.900 + \ (Repeat (Calculate times g_)) Or \
7.901 + \ (Repeat (Rewrite rcollect_right False g_)) Or \
7.902 + \ (Repeat (Rewrite rcollect_one_left False g_)) Or \
7.903 + \ (Repeat (Rewrite rcollect_one_left_assoc False g_)) Or \
7.904 + \ (Repeat (Rewrite rcollect_one_left_assoc_p False g_))) ");
7.905 +---*)
7.906 +writeln
7.907 +"%%%%%%%%%%TODO 7.9.00---vvvvvv--- conflicts with Isa-types \n\
7.908 +\ (Repeat (Calculate cancel g_)) Or \n\
7.909 +\ (Repeat (Calculate pow g_)) Or \n\
7.910 +\%%%%%%%%%%%%%%%%%%%%%---^^^^^^--- conflicts with Isa-types \n\
7.911 +\%%%%%%%%%%%%%%%%%%%%%TODO before Detail Rewrite_Set";
7.912 +
7.913 +
7.914 +(*-------------------------------------11.5.02 ets disablished -------
7.915 +
7.916 +" --- check_elementwise ------------------------------ ";
7.917 +" --- check_elementwise ------------------------------ ";
7.918 +val d = e_rls;
7.919 +val scr as (Script sc) = Script (((inst_abs Test.thy)
7.920 + o term_of o the o (parse thy))
7.921 + "Script Testchk (e_::bool) (v_::real) = \
7.922 + \ (let e_ = Try (Rewrite_Set Test_simplify False e_); \
7.923 + \ (L_::real list) = Mstep subproblem_equation_dummy; \
7.924 + \ L_ = Mstep solve_equation_dummy \
7.925 + \ in Check_elementwise L_ {(v_::real). Assumptions})");
7.926 +val (dI',pI',mI') = ("Test.thy",e_pblID,
7.927 + ("Test.thy","sqrt-equ-test"));
7.928 +val p = e_pos'; val c = [];
7.929 +val (mI,m) = ("Init_Proof",Init_Proof ([], (dI',pI',mI')));
7.930 +val (p,_,_,_,_,pt) = me (mI,m) p c EmptyPtree;
7.931 +val nxt = ("Specify_Domain",Specify_Domain "Test.thy");
7.932 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.933 +val nxt = ("Specify_Method",Specify_Method("Test.thy","sqrt-equ-test")); (*for asm in square_equation_left*)
7.934 +val (p,_,_,_,_,pt) = me nxt p c pt;
7.935 +val pt = union_asm pt [] [("#0 <= sqrt x + sqrt (#5 + x)",[11]),
7.936 + ("#0 <= #9 + #4 * x",[22]),
7.937 + ("#0 <= x ^^^ #2 + #5 * x",[33]),
7.938 + ("#0 <= #2 + x",[44])];
7.939 +val p = ([1],Res):pos';
7.940 +val eq_ = (term_of o the o (parse thy))"e_::bool";
7.941 +val ct = "x=#1+#3";
7.942 +val ve0_= (term_of o the o (parse thy)) ct;
7.943 +val v_ = (term_of o the o (parse thy))"v_::real";
7.944 +val xx = (term_of o the o (parse thy))"x::real";
7.945 +val env0= [(eq_,ve0_),(v_,xx)];
7.946 +
7.947 +val ets0=[([],(Mstep'(Script.thy,"BS","",""),env0,env0,e_term,e_term,Safe)),
7.948 + ([],(User', [], [], e_term, e_term,Sundef))]:ets;
7.949 +val l0 = [];
7.950 +val (pt,_) = cappend_atomic pt[1]e_istate""(Rewrite("test","")) ct Complete;
7.951 +" --------------- 1. ---------------------------------------------";
7.952 +val Appl m'=applicable_in p pt (Rewrite_Set "Test_simplify");
7.953 +
7.954 +val NextStep(l1,m') = nxt_tac "Test.thy" (pt,p) scr ets0 l0;
7.955 +(*val l1 = [R,L,R,R] : loc_*)
7.956 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets1)] =
7.957 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets0 l0;
7.958 +(*val ets1 = [([R,L,R,R],(Rewrite_Set' #,[#],[#],Free #,# $ #,Safe)),..*)
7.959 +val ets1 = (drop_last ets0) @ ets1;val pt = update_ets pt [] [(1,ets1)];
7.960 +writeln(ets2str ets1);
7.961 +" --------------- 2. ---------------------------------------------";
7.962 +val Appl m'=applicable_in p pt (Mstep "subproblem_equation_dummy");
7.963 +
7.964 +val NextStep(l2,m') = nxt_tac "Test.thy" (pt,p) scr ets1 l1;
7.965 +(*val l2 = [R,R,D,L,R] : loc_|| val m' = Mstep' ("x = #4",...*)
7.966 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets2)] =
7.967 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets1 l1;
7.968 +(*val ets2 =[([R,R,D,L,R],(Mstep' ..subpbl..,[#],[#],Const #,# $ #,Safe)),..*)
7.969 +val ets2 = (drop_last ets1) @ ets2;val pt = update_ets pt [] [(1,ets2)];
7.970 +writeln(ets2str ets2);
7.971 +" --------------- 3. ---------------------------------------------";
7.972 +val Appl m'=applicable_in p pt (Mstep "solve_equation_dummy");
7.973 +
7.974 +val NextStep(l3,m') = nxt_tac "Test.thy" (pt,p) scr ets2 l2;
7.975 +(*val l3 = [R,R,D,R,D,L,R] : loc_
7.976 + val m' = Mstep'("subproblem_equation_dummy (x = #4)",..*)
7.977 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets3)] = (*@@@*)
7.978 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets2 l2;
7.979 +(*val ets3 = [([R,R,D,R,D,L,R], (Mstep' (..,"solve_equation_dummy",..*)
7.980 +val ets3 = (drop_last ets2) @ ets3; val pt = update_ets pt [] [(1,ets3)];
7.981 +writeln(ets2str ets3);
7.982 +" --------------- 4. ---------------------------------------------";
7.983 +val Appl (m' as (Check_elementwise' (consts,"Assumptions",consts'))) =
7.984 + applicable_in p pt (Check_elementwise "Assumptions");
7.985 +
7.986 +val NextStep(l4,m') = nxt_tac "Test.thy" (pt,p) scr ets3 l3;
7.987 +(*val l4 = [R,R,D,R,D,R,D] : loc_ val m' = Check_elementwise' (Const (#,#) $ ...*)
7.988 +
7.989 +val Steps[(Form' (FormKF (_,_,_,_,res)),pt,p,_,s,ets4)] =
7.990 + locate_gen "Test.thy" m' (pt,p) (scr,d) ets3 l3;
7.991 +(*val ets4 = [([R,R,D,R,D,R,D], (Check_elementwise' (# $ #,"Assumptions",Const #),..*)
7.992 +val ets4 = (drop_last ets3) @ ets4; val pt = update_ets pt [] [(1,ets4)];
7.993 +" --------------- 5. ---------------------------------------------";
7.994 +val Finished _ = nxt_tac "Test.thy" (pt,p) scr ets4 l4;
7.995 +
7.996 +writeln (pr_ptree pr_short pt);writeln("result: "^res^
7.997 +"\n===================================================================");
7.998 +
7.999 +-------------------------------------11.5.02-----*)
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/src/sml/systest/script_if.sml Thu Apr 17 18:01:03 2003 +0200
8.3 @@ -0,0 +1,169 @@
8.4 +(* 1.if-te-else- 8.02 f"ur Richard
8.5 +
8.6 + use"ifthenelse.sml";
8.7 + use"tests/rationals2.sml";
8.8 + *)
8.9 +
8.10 +
8.11 +
8.12 +(*---------------- 25.7.02 ---------------------*)
8.13 +
8.14 +val thy = Isac.thy;
8.15 +val t = (term_of o the o (parse thy)) "contains_root (sqrt(x)=1)";
8.16 +val Some(ss,tt) = eval_contains_root "xxx" 1 t thy;
8.17 +
8.18 +val t = (term_of o the o (parse thy)) "is_rootequation_in (sqrt(x)=1) x";
8.19 +val Some(ss,tt) = eval_is_rootequation_in "is_rootequation_i" 1 t thy;
8.20 +
8.21 +(*---
8.22 +val v = (term_of o the o (parse thy)) "x";
8.23 +val t = (term_of o the o (parse thy)) "sqrt(#3+#4*x)";
8.24 +scan t v;
8.25 +val t = (term_of o the o (parse thy)) "sqrt(#3+#4*a)";
8.26 +scan t v;
8.27 +val t = (term_of o the o (parse thy)) "#1 + #2*sqrt(#3+#4*x)";
8.28 +scan t v;
8.29 +val t = (term_of o the o (parse thy)) "x + #2*sqrt(#3+#4*a)";
8.30 +scan t v;
8.31 +---*)
8.32 +val t = (term_of o the o (parse thy))
8.33 + "is_rootequation_in (1 + 2*sqrt(3+4*x)=0) x";
8.34 +val Some(ss,tt) = eval_is_rootequation_in "is_rootequation_i" 1 t thy;
8.35 +
8.36 +val t = (term_of o the o (parse thy))
8.37 + "is_rootequation_in (x + 2*sqrt(3+4*a)=0) x";
8.38 +val Some(ss,tt) = eval_is_rootequation_in "is_rootequation_i" 1 t thy;
8.39 +
8.40 +val t = (term_of o the o (parse Test.thy))
8.41 + "is_rootequation_in (sqrt(x)=1) x";
8.42 +atomty Test.thy t;
8.43 +val t = (term_of o the o (parse Isac.thy))
8.44 + "is_rootequation_in (sqrt(x)=1) x";
8.45 +atomty Isac.thy t;
8.46 +
8.47 +(*
8.48 +val Some(tt,_) = rewrite_set_ Test.thytrue tval_rls t;
8.49 +*)
8.50 +val Some(tt,_) = rewrite_set_ Isac.thy true tval_rls t;
8.51 +
8.52 +rewrite_set "Isac.thy" true
8.53 + "tval_rls" "is_rootequation_in (sqrt(x)=1) x";
8.54 +rewrite_set "Test.thy" true
8.55 + "tval_rls" "is_rootequation_in (sqrt(x)=1) x";
8.56 +
8.57 +
8.58 +(*WN: ^^^--- bitte nimm vorerst immer Isac.thy, damit wird richtig gematcht,
8.59 + siehe unten. Wir werden w"ahrend der Arbeit auf diesen Fehler drauskommen*)
8.60 +store_pbt
8.61 + (prep_pbt (*Test.thy*) Isac.thy
8.62 + (["root","univariate","equation","test"],
8.63 + [("#Given" ,["equality e_","solveFor v_"]),
8.64 + ("#Where" ,["is_rootequation_in (e_::bool) (v_::real)"]),
8.65 + ("#Find" ,["solutions v_i_"])
8.66 + ],
8.67 + append_rls e_rls [Calc ("Test.is'_rootequation'_in",
8.68 + eval_is_rootequation_in "")],
8.69 + [("Test.thy","methode")]));
8.70 +
8.71 +match_pbl ["equality (sqrt(x)=1)","solveFor x","solutions L"] (get_pbt ["root","univariate","equation","test"]);
8.72 +
8.73 +
8.74 +(*---------------- 29.7.02 ---------------------*)
8.75 +
8.76 +store_pbt
8.77 + (prep_pbt Isac.thy
8.78 + (["approximate","univariate","equation","test"],
8.79 + [("#Given" ,["equality e_","solveFor v_","errorBound err_"]),
8.80 + ("#Where" ,["matches (?a = ?b) e_"]),
8.81 + ("#Find" ,["solutions v_i_"])
8.82 + ],
8.83 + append_rls e_rls [Calc ("Tools.matches",eval_matches "#matches_")],
8.84 + []));
8.85 +
8.86 +methods:= overwritel (!methods,
8.87 +[
8.88 + prep_met
8.89 + (("Isac.thy","solve_univar_err"):metID,
8.90 + [("#Given" ,["equality e_","solveFor v_","errorBound err_"]),
8.91 + ("#Find" ,["solutions v_i_"])
8.92 + ],
8.93 + {rew_ord'="tless_true",rls'="tval_rls",erls=e_rls,prls=e_rls,calc=[],
8.94 + asm_rls=[],asm_thm=[]},
8.95 + "Script Solve_univar_err (e_::bool) (v_::real) (err_::bool) = \
8.96 + \ (if (is_rootequation_in e_ v_)\
8.97 + \ then ((SubProblem (Isac_,[squareroot,univariate,equation],\
8.98 + \ (SqRoot_,square_equation)) [bool_ e_, real_ v_, bool_ err_]))\
8.99 + \ else ((SubProblem (Isac_,[linear,univariate,equation],\
8.100 + \ (RatArith_,solve_linear)) [bool_ e_, real_ v_])))"
8.101 + )]);
8.102 +
8.103 +val fmz = ["equality (1+2*x=0)","solveFor x","errorBound (eps=0)",
8.104 + "solutions L"];
8.105 +val (dI',pI',mI') =
8.106 + ("Isac.thy",["approximate","univariate","equation","test"],
8.107 + ("Isac.thy","solve_univar_err"));
8.108 +val p = e_pos'; val c = [];
8.109 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
8.110 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
8.111 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.112 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.113 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.114 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.115 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.116 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.117 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.118 +(*val nxt = ("Apply_Method",Apply_Method ("Isac.thy","solve_univar_err"))*)
8.119 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.120 +val (p,_,f,nxt,_,pt) = (me nxt p [1] pt) handle e => print_exn_G e;
8.121 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.122 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.123 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.124 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.125 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.126 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.127 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.128 +(*val nxt = ("Apply_Method",Apply_Method ("RatArith.thy","solve_linear"))*)
8.129 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.130 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.131 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.132 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.133 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.134 +if f = Form' (FormKF (~1,EdUndef,0,Nundef,"[x = -1 / 2]"))
8.135 + andalso nxt = ("End_Proof'",End_Proof') then ()
8.136 +else raise error "new behaviour in testexample rationals2.sml 1+2*x=0";
8.137 +
8.138 +(*---------------------------------*)
8.139 +"-------------- is_rootequ_in - SubProblem -------------------------";
8.140 +"-------------- is_rootequ_in - SubProblem -------------------------";
8.141 +"-------------- is_rootequ_in - SubProblem -------------------------";
8.142 +val fmz = ["equality (sqrt(x) - 1 = 0)","solveFor x","errorBound (eps=0)",
8.143 + "solutions L"];
8.144 +val (dI',pI',mI') =
8.145 + ("Isac.thy",["approximate","univariate","equation","test"],
8.146 + ("Isac.thy","solve_univar_err"));
8.147 +val p = e_pos'; val c = [];
8.148 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
8.149 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
8.150 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.151 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.152 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.153 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.154 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.155 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.156 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.157 +(*val nxt = ("Apply_Method",Apply_Method ("Isac.thy","solve_univar_err"))*)
8.158 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.159 +val (p,_,f,nxt,_,pt) = (me nxt p [1] pt) handle e => print_exn_G e;
8.160 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.161 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.162 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.163 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.164 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.165 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.166 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.167 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.168 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
8.169 +if p = ([1,1],Frm) andalso
8.170 + f = Form' (FormKF (~1,EdUndef,2,Nundef,"sqrt x - 1 = 0")) andalso
8.171 + nxt = ("Empty_Mstep",Empty_Mstep) (*script ist noch 'helpless'*) then ()
8.172 +else raise error "new behaviour in testexample rationals2.sml sqrt(x) - 1 = 0";
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/src/sml/systest/scriptnew.sml Thu Apr 17 18:01:03 2003 +0200
9.3 @@ -0,0 +1,421 @@
9.4 +(* use"../tests/scriptnew.sml";
9.5 + use"tests/scriptnew.sml";
9.6 + *)
9.7 +
9.8 +(*contents*)
9.9 +" --- test 30.4.02 Testterm: Repeat Repeat Or ------------------ ";
9.10 +" --- test 9.5.02 Testeq: While Try Repeat @@ ------------------ ";
9.11 +" --- test 11.5.02 Testeq: let e_ =... in [e_] ------------------ ";
9.12 +" _________________ me + nxt_step from script ___________________ ";
9.13 +" _________________ me + sqrt-equ-test: 1.norm_equation ________ ";
9.14 +" _________________ equation with x =(-12)/5, but L ={} ------- ";
9.15 +(*contents*)
9.16 +
9.17 +
9.18 +
9.19 +
9.20 +" --- test 30.4.02 Testterm: Repeat Repeat Or ------------------ ";
9.21 +" --- test 30.4.02 Testterm: Repeat Repeat Or ------------------ ";
9.22 +" --- test 30.4.02 Testterm: Repeat Repeat Or ------------------ ";
9.23 +store_pbt
9.24 + (prep_pbt Test.thy
9.25 + (["tests"],
9.26 + []:(string * string list) list,
9.27 + e_rls, None, []));
9.28 +store_pbt
9.29 + (prep_pbt Test.thy
9.30 + (["met-testterm","tests"],
9.31 + [("#Given" ,["realTestGiven g_"]),
9.32 + ("#Find" ,["realTestFind f_"])
9.33 + ],
9.34 + e_rls, None, []));
9.35 +methods:= overwritel (!methods,
9.36 +[ prep_met (*test for simplification*)
9.37 + (("Test.thy","met-testterm"):metID,
9.38 + [("#Given" ,["realTestGiven g_"]),
9.39 + ("#Find" ,["realTestFind f_"])
9.40 + ],
9.41 + {rew_ord'="tless_true",rls'=tval_rls,srls=e_rls,prls=e_rls,calc=[],
9.42 + asm_rls=[],asm_thm=[]},
9.43 + "Script Testterm (g_::real) = \
9.44 + \Repeat\
9.45 + \ ((Repeat (Rewrite rmult_1 False)) Or\
9.46 + \ (Repeat (Rewrite rmult_0 False)) Or\
9.47 + \ (Repeat (Rewrite radd_0 False))) g_"
9.48 + )]);
9.49 +val fmz = ["realTestGiven ((0+0)*(1*(1*a)))","realTestFind F"];
9.50 +val (dI',pI',mI') = ("Test.thy",["met-testterm","tests"],
9.51 + ("Test.thy","met-testterm"));
9.52 +val p = e_pos'; val c = [];
9.53 +val nxt = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
9.54 +val (p,_,f,nxt,_,pt) = me nxt p c EmptyPtree;
9.55 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.56 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.57 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.58 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.59 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.60 +(*val nxt = ("Apply_Method",Apply_Method ("Test.thy","met-testterm"))*)
9.61 +(*----script 111 ------------------------------------------------*)
9.62 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.63 +(*"(#0 + #0) * (#1 * (#1 * a))" nxt= Rewrite ("rmult_1",*)
9.64 +(*----script 222 ------------------------------------------------*)
9.65 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.66 +(*"(#0 + #0) * (#1 * a)" nxt= Rewrite ("rmult_1",*)
9.67 +(*----script 333 ------------------------------------------------*)
9.68 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.69 +(*"(#0 + #0) * a" nxt= Rewrite ("radd_0",*)
9.70 +(*----script 444 ------------------------------------------------*)
9.71 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.72 +(*"#0 * a"*)
9.73 +(*----script 555 ------------------------------------------------*)
9.74 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.75 +(*"#0"*)
9.76 +if p=([4],Res) then ()
9.77 +else raise error ("new behaviour in 30.4.02 Testterm: p="^(pos'2str p));
9.78 +(*----script 666 ------------------------------------------------*)
9.79 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.80 +(*"#0"*)
9.81 +if nxt=("End_Proof'",End_Proof') then ()
9.82 +else raise error "new behaviour in 30.4.02 Testterm: End_Proof";
9.83 +
9.84 +
9.85 +
9.86 +
9.87 +
9.88 +" --- test 9.5.02 Testeq: While Try Repeat @@ ------------------ ";
9.89 +" --- test 9.5.02 Testeq: While Try Repeat @@ ------------------ ";
9.90 +" --- test 9.5.02 Testeq: While Try Repeat @@ ------------------ ";
9.91 +store_pbt
9.92 + (prep_pbt Test.thy
9.93 + (["met-testeq","tests"],
9.94 + [("#Given" ,["boolTestGiven e_"]),
9.95 + ("#Find" ,["boolTestFind v_i_"])
9.96 + ],
9.97 + e_rls, None, []));
9.98 +methods:= overwritel (!methods,
9.99 +[
9.100 + prep_met
9.101 + (("Test.thy","testeq1"):metID,
9.102 + [("#Given",["boolTestGiven e_"]),
9.103 + ("#Where" ,[]),
9.104 + ("#Find" ,["boolTestFind v_i_"])
9.105 + ],
9.106 + {rew_ord'="tless_true",rls'=tval_rls,
9.107 + srls=append_rls "testeq1_srls" e_rls
9.108 + [Calc ("Test.contains'_root", eval_contains_root"")],
9.109 + prls=e_rls,calc=[],asm_rls=[],asm_thm=[("square_equation_left","")]},
9.110 + "Script Testeq (e_::bool) = \
9.111 + \(While (contains_root e_) Do \
9.112 + \((Try (Repeat (Rewrite rroot_square_inv False))) @@ \
9.113 + \ (Try (Repeat (Rewrite square_equation_left True))) @@ \
9.114 + \ (Try (Repeat (Rewrite radd_0 False)))))\
9.115 + \ e_"
9.116 + )
9.117 +]);
9.118 +
9.119 +val fmz = ["boolTestGiven (0+(sqrt(sqrt(sqrt a))^^^2)^^^2=0)",
9.120 + "boolTestFind v_i_"];
9.121 +val (dI',pI',mI') = ("Test.thy",["met-testeq","tests"],
9.122 + ("Test.thy","testeq1"));
9.123 +val Script sc = (#scr o get_met) ("Test.thy","testeq1");
9.124 +atomt sc;
9.125 +val p = e_pos'; val c = [];
9.126 +val nxt = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
9.127 +val (p,_,f,nxt,_,pt) = me nxt p c EmptyPtree;
9.128 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.129 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.130 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.131 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.132 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.133 +(*val nxt = ("Apply_Method",Apply_Method ("Test.thy","testeq1")) *)
9.134 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.135 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.136 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.137 +(*val f = Form' (FormKF (~1,EdUndef,1,Nundef,"#0 + sqrt a = #0"))
9.138 +val nxt = ("Rewrite",Rewrite ("radd_0","#0 + ?k = ?k"))*)
9.139 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.140 +
9.141 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.142 +(*** No such constant: "Test.contains'_root" *)
9.143 +
9.144 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.145 +if f=(Form' (FormKF (~1,EdUndef,0,Nundef,"a = 0 ^^^ 2"))) andalso
9.146 + nxt=("End_Proof'",End_Proof') then ()
9.147 +else raise error "different behaviour test 9.5.02 Testeq: While Try Repeat @@";
9.148 +
9.149 +
9.150 +
9.151 +
9.152 +" --- test 11.5.02 Testeq: let e_ =... in [e_] --------- ";
9.153 +" --- test 11.5.02 Testeq: let e_ =... in [e_] --------- ";
9.154 +" --- test 11.5.02 Testeq: let e_ =... in [e_] --------- ";
9.155 +methods:= overwritel (!methods,
9.156 +[
9.157 + prep_met
9.158 + (("Test.thy","testlet"):metID,
9.159 + [("#Given",["boolTestGiven e_"]),
9.160 + ("#Where" ,[]),
9.161 + ("#Find" ,["boolTestFind v_i_"])
9.162 + ],
9.163 + {rew_ord'="tless_true",rls'=tval_rls,
9.164 + srls=append_rls "testlet_srls" e_rls
9.165 + [Calc ("Test.contains'_root",eval_contains_root"")],
9.166 + prls=e_rls,calc=[],asm_rls=[],asm_thm=[("square_equation_left","")]},
9.167 + "Script Testeq2 (e_::bool) = \
9.168 + \(let e_ =\
9.169 + \ ((While (contains_root e_) Do \
9.170 + \ (Rewrite square_equation_left True))\
9.171 + \ e_)\
9.172 + \in [e_::bool])"
9.173 + )
9.174 + ]);
9.175 +val Script sc = (#scr o get_met) ("Test.thy","testlet");
9.176 +writeln(term2str sc);
9.177 +val fmz = ["boolTestGiven (sqrt a = 0)",
9.178 + "boolTestFind v_i_"];
9.179 +val (dI',pI',mI') = ("Test.thy",["met-testeq","tests"],
9.180 + ("Test.thy","testlet"));
9.181 +val p = e_pos'; val c = [];
9.182 +val nxt = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
9.183 +val (p,_,f,nxt,_,pt) = me nxt p c EmptyPtree;
9.184 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.185 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.186 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.187 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.188 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.189 +(*val nxt = ("Apply_Method",Apply_Method ("Test.thy","testlet"))*)
9.190 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.191 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.192 +val (p,_,f,nxt,_,pt) = me nxt p c pt;
9.193 +if f=(Form' (FormKF (~1,EdUndef,0,Nundef,"[a = 0 ^^^ 2]"))) andalso
9.194 + nxt=("End_Proof'",End_Proof') then ()
9.195 +else raise error "different behaviour in test 11.5.02 Testeq: let e_ =... in [e_]";
9.196 +
9.197 +
9.198 +
9.199 +
9.200 +" _________________ me + nxt_step from script _________________ ";
9.201 +" _________________ me + nxt_step from script _________________ ";
9.202 +" _________________ me + nxt_step from script _________________ ";
9.203 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
9.204 + "solveFor x","errorBound (eps=0)",
9.205 + "solutions L"];
9.206 +val (dI',pI',mI') =
9.207 + ("Test.thy",["sqroot-test","univariate","equation","test"],
9.208 + ("Test.thy","sqrt-equ-test"));
9.209 +val Script sc = (#scr o get_met) ("Test.thy","sqrt-equ-test");
9.210 +writeln(term2str sc);
9.211 +
9.212 +val p = e_pos'; val c = [];
9.213 +"--- s1 ---";
9.214 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
9.215 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
9.216 +"--- s2 ---";
9.217 +(* val nxt =
9.218 + ("Add_Given",
9.219 + Add_Given "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))");*)
9.220 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.221 +"--- s3 ---";
9.222 +(* val nxt = ("Add_Given",Add_Given "solveFor x");*)
9.223 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.224 +"--- s4 ---";
9.225 +(* val nxt = ("Add_Given",Add_Given "errorBound (eps = #0)");*)
9.226 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.227 +"--- s5 ---";
9.228 +(* val nxt = ("Add_Find",Add_Find "solutions L");*)
9.229 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.230 +"--- s6 ---";
9.231 +(* val nxt = ("Specify_Domain",Specify_Domain "Test.thy");*)
9.232 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.233 +"--- s7 ---";
9.234 +(* val nxt =
9.235 + ("Specify_Problem",
9.236 + Specify_Problem ["sqroot-test","univariate","equation","test"]);*)
9.237 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.238 +"--- s8 ---";
9.239 +(* val nxt = ("Specify_Method",Specify_Method ("Test.thy","sqrt-equ-test"));*)
9.240 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.241 +"--- s9 ---";
9.242 +(* val nxt = ("Apply_Method",Apply_Method ("Test.thy","sqrt-equ-test"));*)
9.243 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.244 +"--- 1 ---";
9.245 +(* val nxt = ("Rewrite",Rewrite ("square_equation_left",""));*)
9.246 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.247 +"--- 2 ---";
9.248 +(* val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");*)
9.249 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.250 +"--- 3 ---";
9.251 +(* val nxt = ("Rewrite_Set",Rewrite_Set "rearrange_assoc");*)
9.252 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.253 +"--- 4 ---";
9.254 +(* val nxt = ("Rewrite_Set",Rewrite_Set "isolate_root");*)
9.255 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.256 +"--- 5 ---";
9.257 +(* val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");*)
9.258 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.259 +"--- 6 ---";
9.260 +(* val nxt = ("Rewrite",Rewrite ("square_equation_left",""));*)
9.261 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.262 +"--- 7 ---";
9.263 +(* val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");*)
9.264 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.265 +"--- 8<> ---";
9.266 +(* val nxt = ("Rewrite_Set",Rewrite_Set "rearrange_assoc");*)
9.267 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.268 +"--- 9<> ---";
9.269 +(* val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");*)
9.270 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.271 +"--- 10<> ---";
9.272 +(* val nxt = ("Rewrite_Set",Rewrite_Set "norm_equation");*)
9.273 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.274 +"--- 11<> ---";
9.275 +(* val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");*)
9.276 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.277 +"--- 12<> ---.";
9.278 +(* val nxt = ("Rewrite_Set_Inst",Rewrite_Set_Inst (["(bdv,x)"],"isolate_bdv"));*)
9.279 +get_form nxt p pt;
9.280 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.281 +"--- 13<> ---";
9.282 +(* val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");*)
9.283 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.284 +"--- 14<> ---";
9.285 +(* nxt = ("Check_Postcond",Check_Postcond ("Test.thy","sqrt-equ-test"));*)
9.286 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.287 +if f<>(Form' (FormKF (~1,EdUndef,0,Nundef,"[x = 4]")))
9.288 +then raise error "scriptnew.sml 1: me + msteps from script: new behaviour"
9.289 +else ();
9.290 +"--- 15<> ---";
9.291 +(* val nxt = ("End_Proof'",End_Proof');*)
9.292 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.293 +
9.294 +writeln (pr_ptree pr_short pt);
9.295 +writeln("result: "^(get_obj g_result pt [])^
9.296 +"\n=============================================================");
9.297 +(*get_obj g_asm pt [];
9.298 +val it = [("#0 <= sqrt x + sqrt (#5 + x)",[1]),("#0 <= #9 + #4 * x",[1]),...*)
9.299 +
9.300 +
9.301 +
9.302 +
9.303 +
9.304 +" _________________ me + sqrt-equ-test: 1.norm_equation _________________ ";
9.305 +" _________________ me + sqrt-equ-test: 1.norm_equation _________________ ";
9.306 +" _________________ me + sqrt-equ-test: 1.norm_equation _________________ ";
9.307 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
9.308 + "solveFor x","errorBound (eps=0)",
9.309 + "solutions L"];
9.310 +val (dI',pI',mI') =
9.311 + ("Test.thy",["sqroot-test","univariate","equation","test"],
9.312 + ("Test.thy","sqrt-equ-test"));
9.313 + val Script sc = (#scr o get_met) ("Test.thy","sqrt-equ-test");
9.314 + (writeln o term2str) sc;
9.315 +val p = e_pos'; val c = [];
9.316 +"--- s1 ---";
9.317 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
9.318 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
9.319 +"--- s2 ---";
9.320 +(* val nxt = ("Add_Given",
9.321 + Add_Given "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))");*)
9.322 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.323 +"--- s3 ---";
9.324 +(* val nxt = ("Add_Given",Add_Given "solveFor x");*)
9.325 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.326 +"--- s4 ---";
9.327 +(* val nxt = ("Add_Given",Add_Given "errorBound (eps = #0)");*)
9.328 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.329 +"--- s5 ---";
9.330 +(* val nxt = ("Add_Find",Add_Find "solutions L");*)
9.331 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.332 +"--- s6 ---";
9.333 +(* val nxt = ("Specify_Domain",Specify_Domain "Test.thy");*)
9.334 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.335 +"--- s7 ---";
9.336 +(* val nxt = ("Specify_Problem",
9.337 + Specify_Problem ["sqroot-test","univariate","equation","test"]);*)
9.338 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.339 +"--- s8 ---";
9.340 +(* val nxt = ("Specify_Method",Specify_Method ("Test.thy","sqrt-equ-test"));*)
9.341 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.342 +"--- s9 ---";
9.343 +(* val nxt = ("Apply_Method",Apply_Method ("Test.thy","sqrt-equ-test"));*)
9.344 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.345 +"--- !!! x1 --- 1.norm_equation";
9.346 +(*###*)val nxt = ("Rewrite_Set",Rewrite_Set "norm_equation");
9.347 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.348 +"--- !!! x2 --- 1.norm_equation";
9.349 +(* val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");*)
9.350 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.351 +(*(me nxt p [1] pt) handle e => print_exn_G e;*)
9.352 +"--- !!! x3 --- 1.norm_equation";
9.353 +(*val nxt = ("Empty_Mstep",Empty_Mstep) ### helpless*)
9.354 +(*###*)val nxt = ("Rewrite_Set",Rewrite_Set "rearrange_assoc");
9.355 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.356 +"--- !!! x4 --- 1.norm_equation";
9.357 +(*val nxt = ("Rewrite_Set",Rewrite_Set "isolate_root")*)
9.358 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.359 +"--- !!! x5 --- 1.norm_equation";
9.360 +(* val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify");*)
9.361 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.362 +if f= Form'(FormKF(~1,EdUndef,1,Nundef,"sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)"))
9.363 +then() else raise error "new behaviour in test-example 1.norm sqrt-equ-test";
9.364 +
9.365 +
9.366 +(* use"../tests/scriptnew.sml";
9.367 + *)
9.368 +
9.369 +" _________________ equation with x =(-12)/5, but L ={} ------- ";
9.370 +
9.371 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(-3+x))",
9.372 + "solveFor x","errorBound (eps=0)",
9.373 + "solutions L"];
9.374 +val (dI',pI',mI') =
9.375 + ("Test.thy",["sqroot-test","univariate","equation","test"],
9.376 + ("Test.thy","square_equation"));
9.377 +val p = e_pos'; val c = [];
9.378 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
9.379 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
9.380 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.381 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.382 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.383 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.384 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.385 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.386 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.387 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.388 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.389 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.390 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.391 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.392 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.393 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.394 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.395 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.396 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.397 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.398 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.399 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.400 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.401 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.402 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.403 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.404 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.405 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.406 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.407 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.408 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.409 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.410 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.411 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.412 +trace_rewrite:=true;
9.413 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.414 +
9.415 +trace_rewrite:=false;
9.416 +
9.417 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
9.418 +val Form' (FormKF (_,_,_,_,ff)) = f;
9.419 +if ff="[]" then ()
9.420 +else raise error "diff.behav. in scriptnew.sml; root-eq: L = []";
9.421 +
9.422 +
9.423 +val tt = (term_of o the o (parse thy)) "?xxx";
9.424 +rewrite_set_ thy true tval_rls ;
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/src/sml/systest/stdinout.sml Thu Apr 17 18:01:03 2003 +0200
10.3 @@ -0,0 +1,183 @@
10.4 +(* use"test-FE-KE.sml";
10.5 + W.N.16.4.00
10.6 + *)
10.7 +
10.8 +Compiler.Control.Print.printDepth:=4; (*4 default*)
10.9 +
10.10 +(*#########################################################*)
10.11 +" _________________ stdin: tutor active_________________ ";
10.12 +proofs:=[]; dials:=([],[],[]);
10.13 +(*dmts:= [(PutRuleRes, Tt, Skip),(PutRule, St, SkipNo)];*)
10.14 +
10.15 +StdinSML 0 0 0 0 New_User;
10.16 +StdinSML 1 0 0 0 New_Proof;
10.17 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
10.18 + "solveFor x","errorBound (eps=0)",
10.19 + "solutions L"];
10.20 +val (dI',pI',mI') =
10.21 + ("Script.thy",["sqroot-test","univariate","equation"],
10.22 + ("Script.thy","sqrt-equ-test"));
10.23 +"--- s1 ---";
10.24 +val (_,uI,pI,acI,cI,dats,_)=StdinSML 1 1 1 1 (*@@@@@begin !!!!!*)
10.25 + (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
10.26 +"--- s2 ---";
10.27 +StdinSML 1 1 ~1 ~1 (Command Accept);
10.28 +(*RuleFK (Add_Given "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))"*)
10.29 +"--- s3 ---";
10.30 +StdinSML 1 1 ~2 ~2 (Command Accept);
10.31 +(*RuleFK (Add_Given "solveFor x")*)
10.32 +"--- s4 ---";
10.33 +StdinSML 1 1 ~3 ~3 (Command Accept);
10.34 +(*RuleFK (Add_Given "errorBound (eps = #0)")*)
10.35 +"--- s5 ---";
10.36 +StdinSML 1 1 ~4 ~4 (Command Accept);
10.37 +(*RuleFK (Add_Find "solutions L")*)
10.38 +"--- s6 ---";
10.39 +StdinSML 1 1 ~5 ~5 (Command Accept);
10.40 +(*RuleFK (Specify_Domain "Script.thy")*)
10.41 +"--- s7 ---";
10.42 +StdinSML 1 1 ~6 ~6 (Command Accept);
10.43 +(*RuleFK (Specify_Problem ["sqroot-test","univariate","equation"])*)
10.44 +"--- s8 ---";
10.45 +StdinSML 1 1 ~7 ~7 (Command Accept);
10.46 +(*RuleFK (Specify_Method ("Script.thy","sqrt-equ-test"))*)
10.47 +"--- s9 ---";
10.48 +StdinSML 1 1 ~8 ~8 (Command Accept);
10.49 +(*RuleFK (Apply_Method ("Script.thy","sqrt-equ-test"))*)
10.50 +"--- 1 ---";
10.51 +StdinSML 1 1 ~9 ~9 (Command Accept);
10.52 +(*RuleFK (Rewrite ("square_equation_left",""))*)
10.53 +"--- 2 ---";
10.54 +StdinSML 1 1 ~10 ~10 (Command Accept);
10.55 +(*RuleFK (Rewrite_Set "SqRoot_simplify")*)
10.56 +"--- 3 ---";
10.57 +StdinSML 1 1 ~11 ~11 (Command Accept);
10.58 +(*RuleFK (Rewrite_Set "rearrange_assoc")*)
10.59 +"--- 4 ---";
10.60 +StdinSML 1 1 ~12 ~12 (Command Accept);
10.61 +(*RuleFK (Rewrite_Set "isolate_root")*)
10.62 +"--- 5 ---";
10.63 +StdinSML 1 1 ~13 ~13 (Command Accept);
10.64 +(*RuleFK (Rewrite_Set "SqRoot_simplify")*)
10.65 +"--- 6 ---";
10.66 +StdinSML 1 1 ~14 ~14 (Command Accept);
10.67 +(*RuleFK (Rewrite ("square_equation_left",""))*)
10.68 +"--- 7 ---";
10.69 +StdinSML 1 1 ~15 ~15 (Command Accept);
10.70 +(*RuleFK (Rewrite_Set "SqRoot_simplify")*)
10.71 +"--- 8 ---";
10.72 +StdinSML 1 1 ~16 ~16 (Command Accept);
10.73 +(*RuleFK (Rewrite_Set "norm_equation")*)
10.74 +"--- 9 ---";
10.75 +StdinSML 1 1 ~17 ~17 (Command Accept);
10.76 +(*RuleFK (Rewrite_Set "SqRoot_simplify")*)
10.77 +"--- 10 ---";
10.78 +StdinSML 1 1 ~18 ~18 (Command Accept);
10.79 +(*RuleFK (Rewrite_Set_Inst ([("bdv","x")],"isolate_bdv"))*)
10.80 +"--- 11 ---";
10.81 +StdinSML 1 1 ~19 ~19 (Command Accept);
10.82 +(*RuleFK (Rewrite_Set "SqRoot_simplify")*)
10.83 +"--- 12 ---";
10.84 +val (begin,uI,pI,acI,cI,dats,eend) =
10.85 +StdinSML 1 1 ~20 ~20 (Command Accept);
10.86 +(*RuleFK (Check_Postcond ("Script.thy","sqrt-equ-test"))*)
10.87 +
10.88 +if (hd dats) <> (FormKF (~21,Protect,0,"[x = 4]"))
10.89 +then raise error "do_ + msteps input: not finished correctly"
10.90 +else "roo-equation, do_ + msteps input: OK";
10.91 +
10.92 +"==========================================================";
10.93 +writeln (get_history 1 1);
10.94 +"==========================================================";
10.95 +
10.96 +
10.97 +
10.98 +(*#########################################################*)
10.99 +" _________________ stdin: student active_________________ ";
10.100 +proofs:=[]; dials:=([],[],[]);
10.101 +(*dmts:= [(PutRuleRes, Tt, Skip),(PutRule, St, SkipNo)];*)
10.102 +
10.103 +StdinSML 0 0 0 0 New_User;
10.104 +StdinSML 1 0 0 0 New_Proof;
10.105 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
10.106 + "solveFor x","errorBound (eps=0)",
10.107 + "solutions L"];
10.108 +val (dI',pI',mI') =
10.109 + ("Script.thy",["sqroot-test","univariate","equation"],
10.110 + ("Script.thy","sqrt-equ-test"));
10.111 +"--- s1 ---";
10.112 +val (_,uI,pI,acI,cI,dats,_)=StdinSML 1 1 1 1
10.113 + (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
10.114 +"--- s2 ---";
10.115 +StdinSML 1 1 ~1 2 (RuleFK
10.116 +(Add_Given "equality (sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x))"));
10.117 +"--- s3 ---";
10.118 +StdinSML 1 1 ~2 3 (RuleFK (Add_Given "solveFor x"));
10.119 +"--- s4 ---";
10.120 +StdinSML 1 1 ~3 4 (RuleFK (Add_Given "errorBound (eps = 0)"));
10.121 +"--- s5 ---";
10.122 +StdinSML 1 1 ~4 5 (RuleFK (Add_Find "solutions L"));
10.123 +"--- s6 ---";
10.124 +StdinSML 1 1 ~5 6 (RuleFK (Specify_Domain "Script.thy"));
10.125 +"--- s7 ---";
10.126 +StdinSML 1 1 ~6 7 (RuleFK
10.127 +(Specify_Problem ["sqroot-test","univariate","equation"]));
10.128 +"--- s8 ---";
10.129 +StdinSML 1 1 ~7 8 (RuleFK (Specify_Method ("Script.thy","sqrt-equ-test")));
10.130 +"--- s9 ---";
10.131 +StdinSML 1 1 ~8 9 (RuleFK (Apply_Method ("Script.thy","sqrt-equ-test")));
10.132 +"--- 1 ---";
10.133 +StdinSML 1 1 ~9 10 (RuleFK
10.134 +(Rewrite ("square_equation_left","")));
10.135 +"--- 2 ---";
10.136 +StdinSML 1 1 ~10 11 (RuleFK (Rewrite_Set "SqRoot_simplify"));
10.137 +"--- 3 ---";
10.138 +StdinSML 1 1 ~11 12 (RuleFK (Rewrite_Set "rearrange_assoc"));
10.139 +"--- 4 ---";
10.140 +StdinSML 1 1 ~12 13 (RuleFK (Rewrite_Set "isolate_root"));
10.141 +"--- 5 ---";
10.142 +StdinSML 1 1 ~13 14 (RuleFK (Rewrite_Set "SqRoot_simplify"));
10.143 +"--- 6 ---";
10.144 +StdinSML 1 1 ~14 15 (RuleFK
10.145 +(Rewrite ("square_equation_left","")));
10.146 +"--- 7 ---";
10.147 +StdinSML 1 1 ~15 16 (RuleFK (Rewrite_Set "SqRoot_simplify"));
10.148 +"--- 8 ---";
10.149 +StdinSML 1 1 ~16 17 (RuleFK (Rewrite_Set "norm_equation"));
10.150 +"--- 9 ---";
10.151 +StdinSML 1 1 ~17 18 (RuleFK (Rewrite_Set "SqRoot_simplify"));
10.152 +"--- 10 ---";
10.153 +StdinSML 1 1 ~18 19 (RuleFK
10.154 +(Rewrite_Set_Inst ([("bdv","x")],"isolate_bdv")));
10.155 +"--- 11 ---";
10.156 +StdinSML 1 1 ~19 20 (RuleFK (Rewrite_Set "SqRoot_simplify"));
10.157 +"--- 12 ---";
10.158 +val (begin,uI,pI,acI,cI,dats,eend) =
10.159 +StdinSML 1 1 ~20 21 (RuleFK
10.160 +(Check_Postcond ("Script.thy","sqrt-equ-test")));
10.161 +
10.162 +if (hd dats) <> (FormKF (~21,Protect,0,"[x = 4]"))
10.163 +then raise error "do_ + msteps input: not finished correctly"
10.164 +else "roo-equation, do_ + msteps input: OK";
10.165 +
10.166 +"==========================================================";
10.167 +writeln (get_history 1 1);
10.168 +"==========================================================";
10.169 +
10.170 +
10.171 +(*=========27.4.01===============================================*)
10.172 + proofs:= []; dials:=([],[],[]);
10.173 +" _________________ exampel [x=4]: Rules 4.2.01a________________ ";
10.174 +val (_,uI,0,0,[],[New_User],_) = StdinSML 0 0 0 0 New_User;
10.175 +val (_,_,pI,0,[],[New_Proof],_) = StdinSML uI 0 0 0 New_Proof;
10.176 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
10.177 + "solveFor x","errorBound (eps=0)",
10.178 + "solutions L"];
10.179 +val (dI',pI',mI') =
10.180 + ("SqRoot.thy",["sqroot-test","univariate","equation"],
10.181 + ("SqRoot.thy","squ-equ-test2"));
10.182 +StdinSML uI pI 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
10.183 +
10.184 +StdinSML uI pI ~1 ~1 (Command Accept);
10.185 +
10.186 +StdinSML uI pI ~2 ~2 (RuleFK (Rewrite_Set "norm_equation"));
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/src/sml/systest/subp-rooteq.sml Thu Apr 17 18:01:03 2003 +0200
11.3 @@ -0,0 +1,492 @@
11.4 +(* use"tests/subp-rooteq.sml";
11.5 + use"subp-rooteq.sml";
11.6 + *)
11.7 +
11.8 +
11.9 +"---------------- miniscript with mini-subpbl -------------";
11.10 +"---------------- solve_linear as rootpbl -----------------";
11.11 +"---------------- solve_plain_square as rootpbl -----------";
11.12 +"---------------- root-eq + subpbl: solve_linear ----------";
11.13 +"---------------- root-eq + subpbl: solve_plain_square ----";
11.14 +"---------------- root-eq + subpbl: no_met: linear ----";
11.15 +"---------------- root-eq + subpbl: no_met: square ----";
11.16 +"---------------- no_met in rootpbl -> linear --------------";
11.17 +
11.18 +
11.19 +
11.20 +
11.21 +
11.22 +"---------------- miniscript with mini-subpbl -------------";
11.23 +"---------------- miniscript with mini-subpbl -------------";
11.24 +"---------------- miniscript with mini-subpbl -------------";
11.25 +val fmz = ["equality (x+1=2)",
11.26 + "solveFor x","errorBound (eps=0)",
11.27 + "solutions L"];
11.28 +val (dI',pI',mI') =
11.29 + ("Test.thy",["sqroot-test","univariate","equation","test"],
11.30 + ("Test.thy","squ-equ-test-subpbl1"));
11.31 + val Script sc = (#scr o get_met) ("Test.thy","squ-equ-test-subpbl1");
11.32 + (writeln o term2str) sc;
11.33 +
11.34 +val p = e_pos'; val c = [];
11.35 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
11.36 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
11.37 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.38 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.39 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.40 +(*val nxt = ("Add_Find",Add_Find "solutions L") : string * mstep*)
11.41 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.42 +(*val nxt = ("Specify_Domain",Specify_Domain "Test.thy") : string * mstep*)
11.43 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.44 +(*("Specify_Problem",Specify_Problem ["sqroot-test","univariate","equation"]*)
11.45 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.46 +(*("Specify_Method",Specify_Method ("Test.thy","squ-equ-test-subpbl1"))*)
11.47 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.48 +(*val nxt = ("Apply_Method",Apply_Method ("Test.thy","squ-equ-test-subpbl1"*)
11.49 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.50 +(*val nxt = ("Rewrite_Set",Rewrite_Set "norm_equation") : string * mstep*)
11.51 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.52 +(*val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify")*)
11.53 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.54 +(*val nxt = ("Subproblem",Subproblem ("Test.thy",[#,#,#])) : string * mstep
11.55 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*)
11.56 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.57 + p;
11.58 + writeln(istate2str (get_istate pt ([3],Frm)));
11.59 +(*val nxt = ("Model_Problem",Model_Problem ["linear","univariate","equation"]*)
11.60 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.61 +(*val nxt = ("Add_Given",Add_Given "equality (-1 + x = 0)") *)
11.62 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.63 +(*val nxt = ("Add_Given",Add_Given "solveFor x") : string * mstep*)
11.64 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.65 +(*val nxt = ("Add_Find",Add_Find "solutions x_i") : string * mstep*)
11.66 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.67 +(*val nxt = ("Specify_Domain",Specify_Domain "Test.thy")*)
11.68 +
11.69 +
11.70 +(*-----30.9.02----------------------------------------------*)
11.71 +
11.72 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.73 +(*("Specify_Problem",Specify_Problem ["linear","univariate","equation"])*)
11.74 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.75 +(*val nxt = ("Specify_Method",Specify_Method ("Test.thy","solve_linear"))*)
11.76 + val Script sc = (#scr o get_met) ("Test.thy","solve_linear");
11.77 + (writeln o term2str) sc;
11.78 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.79 +(*val nxt = ("Apply_Method",Apply_Method ("Test.thy","solve_linear"))*)
11.80 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.81 +(*val nxt = ("Rewrite_Set_Inst",Rewrite_Set_Inst ([#],"isolate_bdv"))*)
11.82 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.83 +(*val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify")*)
11.84 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.85 +(*val nxt = ("Check_Postcond",Check_Postcond ["linear","univariate","eq*)
11.86 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.87 + p;
11.88 + writeln(istate2str (get_istate pt ([3],Res)));
11.89 +
11.90 +(*val nxt = ("Check_elementwise",Check_elementwise "Assumptions")*)
11.91 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.92 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.93 +val Form' (FormKF (~1,EdUndef,0,Nundef,res)) = f;
11.94 +if (snd nxt)=End_Proof' andalso res="[x = 1]" then ()
11.95 +else raise error "new behaviour in test: miniscript with mini-subpbl";
11.96 +
11.97 +
11.98 +"---------------- solve_linear as rootpbl -----------------";
11.99 +"---------------- solve_linear as rootpbl -----------------";
11.100 +"---------------- solve_linear as rootpbl -----------------";
11.101 +val fmz = ["equality (1+-1*2+x=0)",
11.102 + "solveFor x","solutions L"];
11.103 +val (dI',pI',mI') =
11.104 + ("Test.thy",["linear","univariate","equation","test"],
11.105 + ("Test.thy","solve_linear"));
11.106 +val p = e_pos'; val c = [];
11.107 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
11.108 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
11.109 +(*val nxt = ("Add_Given",Add_Given "equality (x + #1 + #-1 * #2 = #0)")*)
11.110 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.111 +(*val nxt = ("Add_Given",Add_Given "solveFor x") : string * mstep*)
11.112 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.113 +(*val nxt = ("Add_Find",Add_Find "solutions L") : string * mstep*)
11.114 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.115 +(*val nxt = ("Specify_Domain",Specify_Domain "Test.thy") : string * mstep*)
11.116 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.117 +(*val nxt = ("Specify_Problem",Specify_Problem ["univariate","equation"])*)
11.118 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.119 +(*val nxt = ("Specify_Method",Specify_Method ("Test.thy","solve_linear"))*)
11.120 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.121 +(*val nxt = ("Apply_Method",Apply_Method ("Test.thy","solve_linear"))*)
11.122 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.123 +(*val f = Form' (FormKF (~1,EdUndef,1,Nundef,"#1 + #-1 * #2 + x = #0"))
11.124 + val nxt = ("Rewrite_Set_Inst",Rewrite_Set_Inst ([#],"isolate_bdv"))*)
11.125 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.126 +(*val f = Form' (FormKF (~1,EdUndef,1,Nundef,"x = #0 + #-1 * (#1 + #-1 * #2)"))
11.127 + val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify") : string * mstep*)
11.128 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.129 +(*val f = Form' (FormKF (~1,EdUndef,1,Nundef,"x = #1")) : mout val nxt = ("Check_Postcond",Check_Postcond ["univariate","equation"])*)
11.130 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.131 +(*val f = Form' (FormKF (~1,EdUndef,0,Nundef,"[x = #1]")) : mout
11.132 + val nxt = ("End_Proof'",End_Proof') : string * mstep*)
11.133 +val Form' (FormKF (~1,EdUndef,0,Nundef,res)) = f;
11.134 +if (snd nxt)=End_Proof' andalso res="[x = 1]" then ()
11.135 +else raise error "new behaviour in test: solve_linear as rootpbl";
11.136 +
11.137 +
11.138 +"---------------- solve_plain_square as rootpbl -----------";
11.139 +"---------------- solve_plain_square as rootpbl -----------";
11.140 +"---------------- solve_plain_square as rootpbl -----------";
11.141 +val fmz = ["equality (9 + -1 * x ^^^ 2 = 0)","solveFor x",
11.142 + "solutions L"];
11.143 +val (dI',pI',mI') =
11.144 + ("Test.thy",["plain_square","univariate","equation","test"],
11.145 + ("Test.thy","solve_plain_square"));
11.146 +val p = e_pos'; val c = [];
11.147 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
11.148 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
11.149 +
11.150 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.151 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.152 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.153 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.154 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.155 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.156 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.157 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.158 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.159 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.160 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.161 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.162 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.163 +val Form' (FormKF (~1,EdUndef,0,Nundef,res)) = f;
11.164 +if snd nxt=End_Proof' andalso res="[x = -3, x = 3]" then ()
11.165 +else raise error "new behaviour in test: solve_plain_square as rootpbl";
11.166 +
11.167 +
11.168 +
11.169 +
11.170 +"---------------- root-eq + subpbl: solve_linear ----------";
11.171 +"---------------- root-eq + subpbl: solve_linear ----------";
11.172 +"---------------- root-eq + subpbl: solve_linear ----------";
11.173 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
11.174 + "solveFor x","errorBound (eps=0)",
11.175 + "solutions L"];
11.176 +val (dI',pI',mI') =
11.177 + ("Test.thy",["sqroot-test","univariate","equation","test"],
11.178 + ("Test.thy","square_equation1"));
11.179 +val p = e_pos'; val c = [];
11.180 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
11.181 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
11.182 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.183 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.184 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.185 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.186 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.187 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.188 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.189 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.190 +(*"sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)"
11.191 +square_equation_left*)
11.192 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.193 +(*"9 + 4 * x = (sqrt x + sqrt (5 + x)) ^^^ 2"
11.194 +Test_simplify*)
11.195 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.196 +(*"9 + 4 * x = 5 + (2 * x + 2 * sqrt (x ^^^ 2 + 5 * x))"
11.197 +rearrange_assoc*)
11.198 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.199 +(*"9 + 4 * x = 5 + 2 * x + 2 * sqrt (x ^^^ 2 + 5 * x)"
11.200 +isolate_root*)
11.201 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.202 +(*"sqrt (x ^^^ 2 + 5 * x) = (5 + 2 * x + -1 * (9 + 4 * x)) / (-1 * 2)"
11.203 +Test_simplify*)
11.204 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.205 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.206 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.207 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.208 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.209 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.210 +(*"x ^^^ 2 + 5 * x + -1 * (4 + (x ^^^ 2 + 4 * x)) = 0"*)
11.211 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.212 +(*"-4 + x = 0"
11.213 + val nxt =("Subproblem",Subproblem ("Test.thy",["linear","univariate"...*)
11.214 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.215 +(*val nxt =("Model_Problem",Model_Problem ["linear","univariate"...*)
11.216 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.217 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.218 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.219 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.220 +(*val nxt = ("Specify_Domain",Specify_Domain "Test.thy")*)
11.221 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.222 +(*("Specify_Problem",Specify_Problem ["linear","univariate","equation"])*)
11.223 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.224 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.225 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.226 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.227 +(*"x = 0 + -1 * -4", nxt Test_simplify*)
11.228 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.229 +(*"x = 4", nxt Check_Postcond ["linear","univariate","equation","test"]*)
11.230 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.231 +(*"[x = 4]", nxt Check_elementwise "Assumptions"*)
11.232 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.233 +(*"[]", nxt Check_Postcond ["sqroot-test","univariate","equation","test"]*)
11.234 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.235 +val Form' (FormKF (~1,EdUndef,0,Nundef,res)) = f;
11.236 +if (snd nxt)=End_Proof' andalso res="[x = 4]" then ()
11.237 +else raise error "new behaviour in test: root-eq + subpbl: solve_linear";
11.238 +
11.239 +
11.240 +
11.241 +"---------------- root-eq + subpbl: solve_plain_square ----";
11.242 +"---------------- root-eq + subpbl: solve_plain_square ----";
11.243 +"---------------- root-eq + subpbl: solve_plain_square ----";
11.244 +val fmz = ["equality (sqrt(5+x)+sqrt(5-x)=sqrt 18)",
11.245 + "solveFor x","errorBound (eps=0)",
11.246 + "solutions L"];
11.247 +val (dI',pI',mI') =
11.248 + ("Test.thy",["sqroot-test","univariate","equation","test"],
11.249 + ("Test.thy","square_equation2"));
11.250 +val Script sc = (#scr o get_met) ("Test.thy","square_equation2");
11.251 +(writeln o term2str) sc;
11.252 +
11.253 +val p = e_pos'; val c = [];
11.254 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
11.255 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
11.256 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.257 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.258 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.259 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.260 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.261 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.262 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.263 +(*val nxt = ("Apply_Method",Apply_Method ("Test.thy","square_equation1"))*)
11.264 +val (p,_,f,nxt,_,pt) =
11.265 +
11.266 +me nxt p [1] pt;
11.267 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.268 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.269 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.270 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.271 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.272 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.273 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.274 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.275 +(*"9 + -1 * x ^^^ 2 = 0"
11.276 + Subproblem ("Test.thy",["plain_square","univariate","equation"]))*)
11.277 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.278 +(*Model_Problem ["plain_square","univariate","equation"]*)
11.279 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.280 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.281 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.282 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.283 +(*val nxt = ("Specify_Domain",Specify_Domain "Test.thy")*)
11.284 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.285 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.286 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.287 +(*Apply_Method ("Test.thy","solve_plain_square")*)
11.288 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.289 +(*"9 + -1 * x ^^^ 2 = 0", nxt Rewrite_Set "isolate_bdv"*)
11.290 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.291 +(*"x ^^^ 2 = (0 + -1 * 9) / -1", nxt Rewrite_Set "Test_simplify"*)
11.292 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.293 +(*"x ^^^ 2 = 9", nxt Rewrite ("square_equality"*)
11.294 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.295 +(*"x = sqrt 9 | x = -1 * sqrt 9", nxt Rewrite_Set "tval_rls"*)
11.296 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.297 +(*"x = -3 | x = 3", nxt Or_to_List*)
11.298 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.299 +(*"[x = -3, x = 3]",
11.300 + nxt Check_Postcond ["plain_square","univariate","equation","test"]*)
11.301 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.302 +
11.303 +
11.304 +
11.305 +(*"[x = -3, x = 3]", nxt Check_elementwise "Assumptions"*)
11.306 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.307 +(*"[]", nxt Check_Postcond ["sqroot-test","univariate","equation","test"]*)
11.308 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.309 +val Form' (FormKF (~1,EdUndef,0,Nundef,res)) = f;
11.310 +if (snd nxt)=End_Proof' andalso res="[x = -3, x = 3]" then ()
11.311 +else raise error "new behaviour in test: root-eq + subpbl: solve_plain_square";
11.312 +
11.313 +
11.314 +writeln (pr_ptree pr_short pt);
11.315 +
11.316 +
11.317 +
11.318 +val Script s = (#scr o get_met) ("Test.thy","square_equation");
11.319 +atomt s;
11.320 +
11.321 +
11.322 +
11.323 +
11.324 +"---------------- root-eq + subpbl: no_met: linear ----";
11.325 +"---------------- root-eq + subpbl: no_met: linear ----";
11.326 +"---------------- root-eq + subpbl: no_met: linear ----";
11.327 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
11.328 + "solveFor x","errorBound (eps=0)",
11.329 + "solutions L"];
11.330 +val (dI',pI',mI') =
11.331 + ("Test.thy",["squareroot","univariate","equation","test"],
11.332 + ("Test.thy","square_equation"));
11.333 +val p = e_pos'; val c = [];
11.334 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
11.335 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
11.336 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.337 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.338 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.339 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.340 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.341 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.342 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.343 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.344 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.345 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.346 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.347 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.348 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.349 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.350 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.351 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.352 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.353 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.354 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.355 +(*"-4 + x = 0", nxt Subproblem ("Test.thy",["univariate","equation"]))*)
11.356 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.357 +(*val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])*)
11.358 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.359 +(*val nxt =("Model_Problem",Model_Problem ["linear","univar...*)
11.360 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.361 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.362 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.363 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.364 +(*val nxt = ("Specify_Domain",Specify_Domain "Test.thy")*)
11.365 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.366 +(*val nxt = ("Specify_Problem",Specify_Problem ["linear","univariate","equ*)
11.367 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.368 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.369 +(*Apply_Method ("Test.thy","norm_univar_equation")*)
11.370 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.371 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.372 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.373 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.374 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.375 +if p = ([13],Res) then ()
11.376 +else raise error ("new behaviour in test: \
11.377 + \root-eq + subpbl: solve_linear, p ="^(pos'2str p));
11.378 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.379 +val Form' (FormKF (~1,EdUndef,0,Nundef,res)) = f;
11.380 +if (snd nxt)=End_Proof' andalso res="[x = 4]" then ()
11.381 +else raise error "new behaviour in test: root-eq + subpbl: solve_plain_square";
11.382 +
11.383 +
11.384 +
11.385 +
11.386 +"---------------- root-eq + subpbl: no_met: square ----";
11.387 +"---------------- root-eq + subpbl: no_met: square ----";
11.388 +"---------------- root-eq + subpbl: no_met: square ----";
11.389 +val fmz = ["equality (sqrt(5+x)+sqrt(5-x)=sqrt 18)",
11.390 + "solveFor x","errorBound (eps=0)",
11.391 + "solutions L"];
11.392 +val (dI',pI',mI') =
11.393 + ("Test.thy",["squareroot","univariate","equation","test"],
11.394 + ("Test.thy","square_equation"));
11.395 + val Script sc = (#scr o get_met) ("Test.thy","square_equation");
11.396 + (writeln o term2str) sc;
11.397 +
11.398 +val p = e_pos'; val c = [];
11.399 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
11.400 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
11.401 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.402 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.403 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.404 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.405 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.406 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.407 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.408 +(*val nxt = ("Apply_Method",Apply_Method ("Test.thy","square_equation1"))*)
11.409 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.410 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.411 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.412 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.413 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.414 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.415 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.416 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.417 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.418 +(*Subproblem ("Test.thy",["univariate","equation"]))*)
11.419 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.420 +(*("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])*)
11.421 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.422 +(*Model_Problem ["plain_square","univariate","equation"]*)
11.423 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.424 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.425 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.426 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.427 +(*val nxt = ("Specify_Domain",Specify_Domain "Test.thy")*)
11.428 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.429 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.430 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.431 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.432 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.433 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.434 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.435 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.436 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.437 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.438 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.439 +(*val nxt = ("Check_Postcond",Check_Postcond ["squareroot","univariate","equ*)
11.440 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.441 +val Form' (FormKF (~1,EdUndef,0,Nundef,res)) = f;
11.442 +if (snd nxt)=End_Proof' andalso res="[x = -3, x = 3]" then ()
11.443 +else raise error "new behaviour in test: root-eq + subpbl: no_met: square";
11.444 +
11.445 +
11.446 +
11.447 +"---------------- no_met in rootpbl -> linear --------------";
11.448 +"---------------- no_met in rootpbl -> linear --------------";
11.449 +"---------------- no_met in rootpbl -> linear --------------";
11.450 +val fmz = ["equality (1+2*x+3=4*x- 6)",
11.451 + "solveFor x","solutions L"];
11.452 +val (dI',pI',mI') =
11.453 + ("Test.thy",["univariate","equation","test"],
11.454 + ("Test.thy","no_met"));
11.455 +val p = e_pos'; val c = [];
11.456 +val (mI,m) = ("Init_Proof",Init_Proof (fmz, (dI',pI',mI')));
11.457 +val (p,_,f,nxt,_,pt) = me (mI,m) p c EmptyPtree;
11.458 +(*val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])*)
11.459 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.460 +(*val nxt = ("Model_Problem",Model_Problem ["normalize","univariate","equati*)
11.461 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.462 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.463 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.464 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.465 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.466 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.467 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.468 +(*val nxt = ("Apply_Method",Apply_Method ("Test.thy","norm_univar_equation"*)
11.469 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.470 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.471 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.472 +(*val nxt = ("Subproblem",Subproblem ("Test.thy",["univariate","equation"])*)
11.473 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.474 +(*val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])*)
11.475 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.476 +(*val nxt = ("Model_Problem",Model_Problem ["linear","univariate","equation"]*)
11.477 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.478 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.479 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.480 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.481 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.482 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.483 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.484 +(*val nxt = ("Apply_Method",Apply_Method ("Test.thy","solve_linear"))*)
11.485 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.486 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.487 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.488 +(*val nxt = ("Check_Postcond",Check_Postcond ["linear","univariate","equatio*)
11.489 +val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
11.490 +(*val nxt = ("Check_Postcond",Check_Postcond ["normalize","univariate","equa*)
11.491 +val (p,_,Form' (FormKF (_,_,_,_,f)),nxt,_,_) =
11.492 + me nxt p [1] pt;
11.493 +if f="[x = 5]" andalso nxt=("End_Proof'",End_Proof') then ()
11.494 +else raise error "new behaviour in test: no_met in rootpbl -> linear ---";
11.495 +
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/src/sml/systest/testdaten.sml Thu Apr 17 18:01:03 2003 +0200
12.3 @@ -0,0 +1,400 @@
12.4 +(* testdaten f"ur isac demo0
12.5 + WN 31.10.00, .., 18.1.01
12.6 + use"tests/testdaten.sml";
12.7 + use"testdaten.sml";
12.8 +
12.9 + proofs:= []; dials:=([],[],[]);
12.10 + *)
12.11 +" _________________ exampel [x=4]: Rules 4.2.01a________________ ";
12.12 +" _________________ exampel [x=4]: Rules 4.2.01b________________ ";
12.13 +" _________________ exampel [x=4]: tutor active ________________ ";
12.14 +" _________________ exampel [x=4] ________________ ";
12.15 +" _________________ exampel [x =(-12)/5] ________________ ";
12.16 +" _________________ exampel [x =(-12)/5] Auto ________________ ";
12.17 +" ----------------- d_d x (x ^^^ 2 + 3 * x + 4) ----------------- ";
12.18 +" ----------------- d_d x (x ^^^ 2 + x + 1 / x ^^^ 2) ----------------- ";
12.19 +" ----------------- Schalk III S.62 Nr. 51a) --------- ";
12.20 +" ----------------- Schalk III S.144 Nr. 408b) --------- ";
12.21 +" ----------------- Schalk III S.137 Nr. 359g) --------- ";
12.22 +
12.23 +
12.24 +
12.25 +
12.26 +
12.27 +" _________________ exampel [x=4]: Rules 4.2.01a________________ ";
12.28 +" _________________ exampel [x=4]: Rules 4.2.01a________________ ";
12.29 +val (_,uI,0,0,[],[New_User],_) = StdinSML 0 0 0 0 New_User;
12.30 +val (_,_,pI,0,[],[New_Proof],_) = StdinSML uI 0 0 0 New_Proof;
12.31 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
12.32 + "solveFor x","errorBound (eps=0)",
12.33 + "solutions L"];
12.34 +val (dI',pI',mI') =
12.35 + ("Test.thy",["squareroot","univariate","equation","test"],
12.36 + ("Test.thy","sqrt-equ-test"));
12.37 +"--- 0 ---";
12.38 +StdinSML uI pI 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.39 +"--- 1 ---";
12.40 +StdinSML uI pI ~1 ~1 (Command Accept);
12.41 +(* square_equation_left
12.42 +"#9 + #4 * x = (sqrt x + sqrt (#5 + x)) ^^^ #2"*)
12.43 +"--- 2 ---";
12.44 +StdinSML uI pI ~2 ~2 (Command Rules);
12.45 +"--- 3 ---";
12.46 +StdinSML uI pI ~2 ~2 (RuleFK (Rewrite_Set "Test_simplify"));
12.47 +"--- 4 ---";
12.48 +val (_,_,_,_,_,[Error_ _ (*"Error_ Test_simplify not applicable to ..*),
12.49 + Request "apply a rule !"],_) =
12.50 +StdinSML uI pI ~3 ~3 (RuleFK (Rewrite_Set "Test_simplify"));
12.51 +
12.52 +
12.53 +" _________________ exampel [x=4]: Rules 4.2.01b________________ ";
12.54 +" _________________ exampel [x=4]: Rules 4.2.01b________________ ";
12.55 +val (_,uI,0,0,[],[New_User],_) = StdinSML 0 0 0 0 New_User;
12.56 +val (_,_,pI,0,[],[New_Proof],_) = StdinSML uI 0 0 0 New_Proof;
12.57 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
12.58 + "solveFor x","errorBound (eps=0)",
12.59 + "solutions L"];
12.60 +val (dI',pI',mI') =
12.61 + ("Test.thy",["squareroot","univariate","equation","test"],
12.62 + ("Test.thy","sqrt-equ-test"));
12.63 +"--- 0 ---";
12.64 +StdinSML uI pI 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.65 +"--- 1 ---";
12.66 +StdinSML uI pI ~1 ~1 (Command Accept);
12.67 +(* square_equation_left
12.68 +"#9 + #4 * x = (sqrt x + sqrt (#5 + x)) ^^^ #2"*)
12.69 +"--- 2 ---";
12.70 +StdinSML uI pI ~2 ~2 (Command Rules);
12.71 +"--- 3 ---";
12.72 +val (_,_,_,_,_,
12.73 + [Error_ _ (*"Error_ 'square_equation_left' not applicable to: #9 *),
12.74 + Select _, Request "select a rule !"],_) =
12.75 +StdinSML uI pI ~2 ~2 (RuleFK (Rewrite ("square_equation_left","")));
12.76 +
12.77 +
12.78 +" _________________ exampel [x=4]: tutor active ________________ ";
12.79 +" _________________ exampel [x=4]: tutor active ________________ ";
12.80 +val (_,uI,0,0,[],[New_User],_) = StdinSML 0 0 0 0 New_User;
12.81 +val (_,_,pI,0,[],[New_Proof],_) = StdinSML uI 0 0 0 New_Proof;
12.82 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
12.83 + "solveFor x","errorBound (eps=0)",
12.84 + "solutions L"];
12.85 +val (dI',pI',mI') =
12.86 + ("Test.thy",["squareroot","univariate","equation","test"],
12.87 + ("Test.thy","sqrt-equ-test"));
12.88 +"--- s1 ---";
12.89 +StdinSML uI pI 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.90 +"--- 1 ---";
12.91 +StdinSML uI pI ~1 ~1 (Command Accept);
12.92 +(* square_equation_left
12.93 +"#9 + #4 * x = (sqrt x + sqrt (#5 + x)) ^^^ #2"*)
12.94 +"--- 2 ---";
12.95 +StdinSML uI pI ~2 ~2 (Command Accept);
12.96 +(* Test_simplify
12.97 +"#9 + #4 * x = #5 + (#2 * x + #2 * sqrt (x ^^^ #2 + #5 * x))"*)
12.98 +"--- 3 ---";
12.99 +StdinSML uI pI ~3 ~3 (Command Accept);
12.100 +(* rearrange_assoc
12.101 +"#9 + #4 * x = #5 + #2 * x + #2 * sqrt (x ^^^ #2 + #5 * x)"*)
12.102 +"--- 4 ---";
12.103 +StdinSML uI pI ~4 ~4 (Command Accept);
12.104 +(* isolate_root
12.105 +"sqrt (x ^^^ #2 + #5 * x) = (#5 + #2 * x + #-1 * (#9 + #4 * x)) // (#-1 *#2)"*)
12.106 +"--- 5 ---";
12.107 +StdinSML uI pI ~5 ~5 (Command Accept);
12.108 +(* Test_simplify
12.109 +"sqrt (x ^^^ #2 + #5 * x) = #2 + x"*)
12.110 +"--- 6 ---";
12.111 +StdinSML uI pI ~6 ~6 (Command Accept);
12.112 +(* square_equation_left
12.113 +"x ^^^ #2 + #5 * x = (#2 + x) ^^^ #2"*)
12.114 +"--- 7 ---";
12.115 +StdinSML uI pI ~7 ~7 (Command Accept);
12.116 +(* Test_simplify
12.117 +"x ^^^ #2 + #5 * x = #4 + (x ^^^ #2 + #4 * x)"*)
12.118 +"--- 8 ---";
12.119 +StdinSML uI pI ~8 ~8 (Command Accept);
12.120 +(* rearrange_assoc
12.121 +"x ^^^ #2 + #5 * x = #4 + x ^^^ #2 + #4 * x"*)
12.122 +"--- 9 ---";
12.123 +StdinSML uI pI ~9 ~9 (Command Accept);
12.124 +(* Test_simplify
12.125 +"x ^^^ #2 + #5 * x = #4 + (x ^^^ #2 + #4 * x)"*)
12.126 +"--- 10 ---";
12.127 +StdinSML uI pI ~10 ~10 (Command Accept);
12.128 +(* norm_equation
12.129 +"x ^^^ #2 + #5 * x + #-1 * (#4 + (x ^^^ #2 + #4 * x)) = #0"*)
12.130 +"--- 11 ---";
12.131 +StdinSML uI pI ~11 ~11 (Command Accept);
12.132 +(* Test_simplify
12.133 + "#-4 + x = #0"*)
12.134 +"--- 12 ---";
12.135 +StdinSML uI pI ~12 ~12 (Command Accept);
12.136 +(* isolate_bdv
12.137 +"x = #0 + #-1 * #-4" *)
12.138 +"--- 13 ---";
12.139 +StdinSML uI pI ~13 ~13 (Command Accept);
12.140 +(* Test_simplify
12.141 +"x = #4" *)
12.142 +"--- 14 ---";
12.143 +StdinSML uI pI ~14 ~14 (Command Accept);
12.144 +val (_,_,1,~14,[],[RuleKF (_,m),FormKF (_,_,_,_,f),Request "Accept ?"],_) = it;
12.145 +if m = Check_Postcond ["squareroot","univariate","equation","test"]
12.146 + andalso f = "[x = 4]" then ()
12.147 +else raise error "new behaviour in: exampel [x=4]: tutor active";
12.148 +"--- 15 ---";
12.149 +StdinSML uI pI ~15 ~15 (Command Accept);
12.150 +(* Request "start another example"*)
12.151 +
12.152 +(*---- after restruct. kb 18.9.02 ---- (same is in test-FE...)
12.153 +" _________________ exampel [x=4] ________________ ";
12.154 +" _________________ exampel [x=4] ________________ ";
12.155 +proofs:= []; dials:=([],[],[]);
12.156 +StdinSML 0 0 0 0 New_User;
12.157 +StdinSML 1 0 0 0 New_Proof;
12.158 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))",
12.159 + "solveFor x","errorBound (eps=0)",
12.160 + "solutions L"];
12.161 +val (dI',pI',mI') =
12.162 + ("Test.thy",["squareroot","univariate","equation","test"],
12.163 + ("Test.thy","sqrt-equ-test"));
12.164 +"--- s1 ---";
12.165 +val (_,1,1,1,[],[_,_,FormKF (_,_,_,_,f),req],_) =
12.166 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.167 +
12.168 +StdinSML 1 1 ~1 ~1 (Command ActivePlus);
12.169 +StdinSML 1 1 ~1 ~1 (Command ActivePlus);
12.170 +StdinSML 1 1 ~1 ~1 (Command ActivePlus);
12.171 +StdinSML 1 1 ~1 ~1 (Command ActivePlus);(*acti=4..SelRule*)
12.172 +
12.173 +"--- !!! x1 --- strange choice"; (* hier nochmals spec !*)
12.174 +StdinSML 1 1 ~1 ~1 (RuleFK (Rewrite_Set "norm_equation"));
12.175 +"--- !!! x2 --- ME knows nxt_step";
12.176 +StdinSML 1 1 ~2 ~2 (RuleFK (Rewrite_Set "Test_simplify"));
12.177 +"--- !!! x3 --- helpless !!!";
12.178 +val (_,_,_,_,_,[FormKF (_,_,_,_,res),_,requ],_) =
12.179 +StdinSML 1 1 ~3 ~3 (RuleFK (Rewrite_Set "rearrange_assoc"));
12.180 +"--- !!! x4 ---";
12.181 +val (_,_,_,_,_,[FormKF (_,_,_,_,res),_,requ],_) =
12.182 +StdinSML 1 1 ~4 ~4 (RuleFK (Rewrite_Set "isolate_root"));
12.183 +"--- !!! x5 --- back at original equation !!!";
12.184 +val (_,_,_,_,_,[FormKF (_,_,_,_,res),_,requ],_) =
12.185 +StdinSML 1 1 ~5 ~5 (RuleFK (Rewrite_Set "Test_simplify"));
12.186 +if res="sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)"
12.187 +then () else raise error "new behaviour in test-example";
12.188 +"--- !!! x6 --- not applicable";
12.189 +val (_,_,_,_,_,[Error_ err,_,requ],_) =
12.190 +StdinSML 1 1 ~6 ~6 (RuleFK (Rewrite_Set "Test_simplify"));
12.191 +(*val (_,_,_,_,_,[RuleKF r,requ],_) =*)
12.192 +val (_,_,_,_,_,ios,_) =
12.193 +StdinSML 1 1 ~6 ~6 (Command YourTurn);
12.194 +StdinSML 1 1 ~7 ~7 (Command Accept);
12.195 +StdinSML 1 1 ~8 ~8 (Command Accept);
12.196 +StdinSML 1 1 ~9 ~9 (Command Accept);
12.197 +StdinSML 1 1 ~10 ~10 (Command Accept);
12.198 +StdinSML 1 1 ~11 ~11 (Command Accept);
12.199 +StdinSML 1 1 ~12 ~12 (Command Accept);
12.200 +StdinSML 1 1 ~13 ~13 (Command Accept);
12.201 +StdinSML 1 1 ~14 ~14 (Command Accept);
12.202 +StdinSML 1 1 ~15 ~15 (Command Accept);
12.203 +StdinSML 1 1 ~16 ~16 (Command Accept);
12.204 +StdinSML 1 1 ~17 ~17 (Command Accept);
12.205 +StdinSML 1 1 ~18 ~18 (Command Accept);
12.206 +StdinSML 1 1 ~19 ~19 (Command Accept);
12.207 +val (_,1,1,_,[],[FormKF (_,_,_,_,f),Request "Accept ?"],_) = it;
12.208 +if f="[x = 4]" then () else raise error "new behaviour in test-example[x=4]";
12.209 +
12.210 +val (_,1,1,~20,[],[Request "start another example",End_Proof],_) =
12.211 +StdinSML 1 1 ~20 ~20 (Command Accept);
12.212 +-------------------------------------------------------------------*)
12.213 +
12.214 +
12.215 +
12.216 +" _________________ exampel [x =(-12)/5] ________________ ";
12.217 +" _________________ exampel [x =(-12)/5] ________________ ";
12.218 +proofs:= []; dials:=([],[],[]);
12.219 +StdinSML 0 0 0 0 New_User;
12.220 +StdinSML 1 0 0 0 New_Proof;
12.221 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(-3+x))",
12.222 + "solveFor x","errorBound (eps=0)",
12.223 + "solutions L"];
12.224 +val (dI',pI',mI') =
12.225 + ("Test.thy",["squareroot","univariate","equation","test"],
12.226 + ("Test.thy","sqrt-equ-test"));
12.227 +"--- s1 ---";
12.228 +val (_,1,1,1,[],[_,_,FormKF (_,_,_,_,f),req],_) =
12.229 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.230 +
12.231 +StdinSML 1 1 ~1 ~1 (Command SpeedMinus);
12.232 +StdinSML 1 1 ~1 ~1 (Command SpeedMinus);
12.233 +StdinSML 1 1 ~1 ~1 (Command Accept);(*->rule*)
12.234 +StdinSML 1 1 ~1 ~1 (Command Accept);(*->form*)
12.235 +val (_,_,_,_,_,dats,_) =
12.236 +StdinSML 1 1 ~2 ~2 (Command Accept);(*->rule*)
12.237 +StdinSML 1 1 ~2 ~2 (Command Accept);(*->form*)
12.238 +
12.239 +
12.240 +StdinSML 1 1 ~3 ~3 (Command ActivePlus);
12.241 +StdinSML 1 1 ~3 ~3 (Command ActivePlus);(*act=2: SelRule..PutRuleRes,Tt*)
12.242 +StdinSML 1 1 ~3 ~3 (RuleFK (Rewrite_Set "rearrange_assoc"));
12.243 +StdinSML 1 1 ~4 ~4 (Command Accept);
12.244 +StdinSML 1 1 ~4 ~4 (RuleFK (Rewrite_Set "isolate_root"));
12.245 +StdinSML 1 1 ~5 ~5 (Command Accept);
12.246 +StdinSML 1 1 ~5 ~5 (RuleFK (Rewrite_Set "Test_simplify"));
12.247 +StdinSML 1 1 ~6 ~6 (Command Accept);
12.248 +
12.249 +
12.250 +StdinSML 1 1 ~6 ~6 (Command SpeedPlus);
12.251 +StdinSML 1 1 ~6 ~6 (Command SpeedPlus);(*act=2: SelRule..SelRule*)
12.252 +StdinSML 1 1 ~6 ~6 (RuleFK (Rewrite ("square_equation_left","")));
12.253 +StdinSML 1 1 ~7 ~7 (RuleFK (Rewrite_Set "Test_simplify"));
12.254 +StdinSML 1 1 ~8 ~8 (RuleFK (Rewrite_Set "rearrange_assoc"));
12.255 +
12.256 +
12.257 +StdinSML 1 1 ~9 ~9 (Command YourTurn);
12.258 +StdinSML 1 1 ~10 ~10 (Command Accept);
12.259 +StdinSML 1 1 ~11 ~11 (Command Accept);
12.260 +StdinSML 1 1 ~12 ~12 (Command Accept);
12.261 +StdinSML 1 1 ~13 ~13 (Command Accept);
12.262 +StdinSML 1 1 ~14 ~14 (Command Accept);
12.263 +val (_,_,_,_,_,dats,_) =
12.264 +StdinSML 1 1 ~15 ~15 (Command Accept);
12.265 +if dats=[Request "start another example",End_Proof] then ()
12.266 +else raise error "new behaviour in test-example 1: [x =(-12)/5]";
12.267 +
12.268 +
12.269 +" _________________ exampel [x =(-12)/5] Auto ________________ ";
12.270 +" _________________ exampel [x =(-12)/5] Auto ________________ ";
12.271 +proofs:= []; dials:=([],[],[]);
12.272 +StdinSML 0 0 0 0 New_User;
12.273 +StdinSML 1 0 0 0 New_Proof;
12.274 +val fmz = ["equality (sqrt(9+4*x)=sqrt x + sqrt(-3+x))",
12.275 + "solveFor x","errorBound (eps=0)",
12.276 + "solutions L"];
12.277 +val (dI',pI',mI') =
12.278 + ("Test.thy",["squareroot","univariate","equation","test"],
12.279 + ("Test.thy","sqrt-equ-test"));
12.280 +val Script sc = (#scr o get_met) ("Test.thy","sqrt-equ-test");
12.281 +writeln(term2str sc);
12.282 +"--- s1 ---";
12.283 +val (_,1,1,1,[],[_,_,FormKF (_,_,_,_,f),req],_) =
12.284 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.285 +
12.286 +val (_,_,_,_,_,dats,_) = StdinSML 1 1 ~1 ~1 (Command Auto);
12.287 +val FormKF (~16,Protect,0,Nundef,res) =
12.288 + (last_elem o drop_last o drop_last) dats;
12.289 +if res=(*"[]"*)"[x = -12 / 5]" then ()
12.290 +else raise error "new behaviour in test-example 2: [x =(-12)/5]";
12.291 +
12.292 +
12.293 +
12.294 +" ----------------- differentiate ----------------- ";
12.295 +" ----------------- d_d x (x ^^^ 2 + 3 * x + 4) ----------------- ";
12.296 +proofs:= []; dials:=([],[],[]);
12.297 +StdinSML 0 0 0 0 New_User;
12.298 +StdinSML 1 0 0 0 New_Proof;
12.299 +val fmz = ["functionTerm (d_d x (x ^^^ 2 + 3 * x + 4))",
12.300 + "differentiateFor x","derivative f_'_"];
12.301 +val (dI',pI',mI') =
12.302 + ("Diff.thy",["derivative_of","function"],
12.303 + ("Diff.thy","differentiate_on_R"));
12.304 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.305 +(*FormKF (~10,Protect,0,Nundef,"#3 + #2 * x")*)
12.306 +(* 25.4.01: remove Error with NotAppl
12.307 + StdinSML 1 1 ~1 ~1 (RuleFK (Rewrite_Set "Test_simplify"));
12.308 + StdinSML 1 1 ~2 ~2 (RuleFK (Rewrite_Inst (["(bdv,x)"],("diff_sum",""))));
12.309 + StdinSML 1 1 ~3 ~3 (RuleFK (Rewrite_Inst (["(bdv,x)"],("diff_const",""))));
12.310 +uncaught exception TYPE ...
12.311 +
12.312 +val uI=1;val pI=1;val acI= ~3;val cI= ~3;
12.313 +val dat=(RuleFK (Rewrite_Inst (["(bdv,x)"],("diff_const",""))));;
12.314 +*)
12.315 +
12.316 +
12.317 +(*18.4.01 tests mit speed*)
12.318 +
12.319 +StdinSML 1 1 ~1 ~1 (Command Accept);
12.320 +
12.321 +StdinSML 1 1 ~2 ~2 (Command SpeedPlus);
12.322 +StdinSML 1 1 ~2 ~2 (Command Accept);
12.323 +
12.324 +StdinSML 1 1 ~4 ~4 (Command SpeedMinus);
12.325 +StdinSML 1 1 ~4 ~4 (Command Accept);
12.326 +
12.327 +StdinSML 1 1 ~5 ~5 (Command Accept);
12.328 +(**)
12.329 +val xxx = StdinSML 1 1 ~6 ~6 (Command Auto);
12.330 +if xxx = ("@@@@@begin@@@@@",1,1,~6,[],
12.331 + [FormKF (~7,Protect,1,Nundef,"2 * x ^^^ (2 - 1) + 3 * d_d x x + 0"),
12.332 + FormKF (~8,Protect,1,Nundef,"2 * x ^^^ (2 - 1) + 3 * 1 + 0"),
12.333 + FormKF (~9,Protect,1,Nundef,"3 + 2 * x"),
12.334 + FormKF (~10,Protect,0,Nundef,"3 + 2 * x"),
12.335 + Request "start another example",End_Proof],"@@@@@end@@@@@")
12.336 +then () else writeln "new behaviour in example d_d x (x ^^^ 2 + 3 * x + 4), SpeedPlus/Minus";
12.337 +
12.338 +
12.339 +" ----------------- d_d x (x ^^^ 2 + x + 1 / x ^^^ 2) ----------------- ";
12.340 +proofs:= []; dials:=([],[],[]);
12.341 +StdinSML 0 0 0 0 New_User;
12.342 +StdinSML 1 0 0 0 New_Proof;
12.343 +val fmz = ["functionTerm (d_d x (x ^^^ 2 + x + 1 / x ^^^ 2))",
12.344 + "differentiateFor x","derivative f_'_"];
12.345 +val (dI',pI',mI') =
12.346 + ("Diff.thy",["derivative_of","function"],
12.347 + ("Diff.thy","differentiate_on_R"));
12.348 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.349 +StdinSML 1 1 ~1 ~1 (Command Auto);
12.350 +(*FormKF (~12,Protect,0,Nundef,"#1 + (#2 * x + #-2 * x ^^^ #-3)")*)
12.351 +
12.352 +" ----------------- Schalk III S.62 Nr. 34a) --------- ";
12.353 +proofs:= []; dials:=([],[],[]);
12.354 +StdinSML 0 0 0 0 New_User;
12.355 +StdinSML 1 0 0 0 New_Proof;
12.356 +val fmz = ["functionTerm (d_d x ((5 * x ^^^ 2 - 2) * (7 * x + 1)))",
12.357 + "differentiateFor x","derivative f_'_"];
12.358 +val (dI',pI',mI') =
12.359 + ("Diff.thy",["derivative_of","function"],
12.360 + ("Diff.thy","differentiate_on_R"));
12.361 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.362 +StdinSML 1 1 ~1 ~1 (Command Auto);
12.363 +
12.364 +
12.365 +" ----------------- Schalk III S.62 Nr. 51a) --------- ";
12.366 +proofs:= []; dials:=([],[],[]);
12.367 +StdinSML 0 0 0 0 New_User;
12.368 +StdinSML 1 0 0 0 New_Proof;
12.369 +val fmz = ["functionTerm (d_d x ((x+1)/(x- 1)))",
12.370 + "differentiateFor x","derivative f_'_"];
12.371 +val (dI',pI',mI') =
12.372 + ("Diff.thy",["derivative_of","function"],
12.373 + ("Diff.thy","differentiate_on_R"));
12.374 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.375 +StdinSML 1 1 ~1 ~1 (Command Auto);
12.376 +(*"#-1 // (#1 + (x ^^^ #2 + #-2 * x)) +\n(x // (#1 + (x ^^^ #2 + #-2 * x)) +\n (#1 + x) * (#-1 // (#1 + (x ^^^ #2 + #-2 * x))))" ----- simplification !?!*)
12.377 +
12.378 +
12.379 +" ----------------- Schalk III S.144 Nr. 408b) --------- ";
12.380 +proofs:= []; dials:=([],[],[]);
12.381 +StdinSML 0 0 0 0 New_User;
12.382 +StdinSML 1 0 0 0 New_Proof;
12.383 +val fmz = ["functionTerm (d_d x (x ^^^ 2 * (ln ((sin x) ^^^ 2))))",
12.384 + "differentiateFor x","derivative f_'_"];
12.385 +val (dI',pI',mI') =
12.386 + ("Diff.thy",["derivative_of","function"],
12.387 + ("Diff.thy","differentiate_on_R"));
12.388 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.389 +StdinSML 1 1 ~1 ~1 (Command Auto);
12.390 +(*"#2 * (x * ln (sin x ^^^ #2)) +\ncos x * (sin x * (x ^^^ #2 * (#2 // sin x ^^^ #2)))"---- cancel sin x !!!*)
12.391 +
12.392 +
12.393 +" ----------------- Schalk III S.137 Nr. 359g) --------- ";
12.394 +proofs:= []; dials:=([],[],[]);
12.395 +StdinSML 0 0 0 0 New_User;
12.396 +StdinSML 1 0 0 0 New_Proof;
12.397 +val fmz = ["functionTerm (d_d x (sqrt (cos (3*x))))",
12.398 + "differentiateFor x","derivative f_'_"];
12.399 +val (dI',pI',mI') =
12.400 + ("Diff.thy",["derivative_of","function"],
12.401 + ("Diff.thy","differentiate_on_R"));
12.402 +StdinSML 1 1 1 1 (RuleFK (Init_Proof (fmz,(dI',pI',mI'))));
12.403 +StdinSML 1 1 ~1 ~1 (Command Auto);