wneuper@1365
|
1 |
(* use"systest/auto-inform.sml";
|
wneuper@1365
|
2 |
use"auto-inform.sml";
|
wneuper@1365
|
3 |
*)
|
wneuper@1365
|
4 |
|
wneuper@2155
|
5 |
"autoCalculate";
|
wneuper@1365
|
6 |
"--------- solve_linear as rootpbl AUTOCALCULATE CompleteModel ---";
|
wneuper@1431
|
7 |
"--------- solve_linear as rootpbl AUTOCALCULATE CompleteCalcHead-";
|
wneuper@1365
|
8 |
"--------- maximum-example: complete_metitms ---------------------";
|
wneuper@1365
|
9 |
"--------- maximum-example: complete_mod -------------------------";
|
wneuper@1408
|
10 |
"appendForm with miniscript with mini-subpbl:";
|
wneuper@1365
|
11 |
"--------- appendFormula: on Res + equ_nrls ----------------------";
|
wneuper@2152
|
12 |
"--------- appendFormula: on Frm + equ_nrls ----------------------";
|
wneuper@1365
|
13 |
"--------- appendFormula: on Res + NO deriv ----------------------";
|
wneuper@1365
|
14 |
"--------- appendFormula: on Res + late deriv --------------------";
|
wneuper@1399
|
15 |
"--------- appendFormula: on Res + late deriv [x = 3 + -2]---///--";
|
wneuper@1408
|
16 |
"replaceForm with miniscript with mini-subpbl:";
|
wneuper@1408
|
17 |
"--------- replaceFormula: on Res + = ----------------------------";
|
wneuper@2152
|
18 |
"--------- replaceFormula: on Res + = 1st Nd ---------------------";
|
wneuper@1408
|
19 |
"--------- replaceFormula: on Frm + = 1st Nd ---------------------";
|
wneuper@2152
|
20 |
"--------- replaceFormula: cut calculation -----------------------";
|
wneuper@1365
|
21 |
|
wneuper@1365
|
22 |
|
wneuper@1365
|
23 |
|
wneuper@1365
|
24 |
|
wneuper@1365
|
25 |
"--------- solve_linear as rootpbl AUTOCALCULATE CompleteModel ---";
|
wneuper@1365
|
26 |
"--------- solve_linear as rootpbl AUTOCALCULATE CompleteModel ---";
|
wneuper@1365
|
27 |
"--------- solve_linear as rootpbl AUTOCALCULATE CompleteModel ---";
|
wneuper@1365
|
28 |
val c = [];
|
wneuper@1365
|
29 |
val (p,_,f,nxt,_,pt) = CalcTreeTEST
|
wneuper@1365
|
30 |
[(["equality (1+-1*2+x=0)", "solveFor x","solutions L"],
|
wneuper@1365
|
31 |
("Test.thy",
|
wneuper@1365
|
32 |
["linear","univariate","equation","test"],
|
wneuper@1365
|
33 |
["Test","solve_linear"]))];
|
wneuper@1365
|
34 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
35 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
36 |
(*xt = Add_Given "solveFor x"*)
|
wneuper@1365
|
37 |
writeln (itms2str thy (get_obj g_pbl pt (fst p)));
|
wneuper@1365
|
38 |
(*[
|
wneuper@1365
|
39 |
(0 ,[] ,false ,#Given ,Inc solveFor ,(??.empty, [])),
|
wneuper@1365
|
40 |
(0 ,[] ,false ,#Find ,Inc solutions [] ,(??.empty, [])),
|
wneuper@1365
|
41 |
(1 ,[1] ,true ,#Given ,Cor equality (1 + -1 * 2 + x = 0) ,(e_, [1 + -1 * 2 + x = 0]))]*)
|
wneuper@1365
|
42 |
val (pt,p) = complete_mod (pt, p);
|
wneuper@1365
|
43 |
if itms2str thy (get_obj g_pbl pt (fst p)) = "[\n(1 ,[1] ,true ,#Given ,Cor equality (1 + -1 * 2 + x = 0) ,(e_, [1 + -1 * 2 + x = 0])),\n(2 ,[1] ,true ,#Given ,Cor solveFor x ,(v_, [x])),\n(3 ,[1] ,true ,#Find ,Cor solutions L ,(v_i_, [L]))]" then ()
|
wneuper@1365
|
44 |
else raise error "completetest.sml: new behav. in complete_mod 1";
|
wneuper@1365
|
45 |
writeln (itms2str thy (get_obj g_pbl pt (fst p)));
|
wneuper@1365
|
46 |
(*[
|
wneuper@1365
|
47 |
(1 ,[1] ,true ,#Given ,Cor equality (1 + -1 * 2 + x = 0) ,(e_, [1 + -1 * 2 + x = 0])),
|
wneuper@1365
|
48 |
(2 ,[1] ,true ,#Given ,Cor solveFor x ,(solveFor, [x])),
|
wneuper@1365
|
49 |
(3 ,[1] ,true ,#Find ,Cor solutions L ,(solutions, [L]))]*)
|
wneuper@1365
|
50 |
val mits = get_obj g_met pt (fst p);
|
wneuper@1365
|
51 |
if itms2str thy mits = "[\n(1 ,[1] ,true ,#Given ,Cor equality (1 + -1 * 2 + x = 0) ,(e_, [1 + -1 * 2 + x = 0])),\n(2 ,[1] ,true ,#Given ,Cor solveFor x ,(v_, [x])),\n(3 ,[1] ,true ,#Find ,Cor solutions L ,(v_i_, [L]))]"
|
wneuper@1365
|
52 |
then () else raise error "completetest.sml: new behav. in complete_mod 2";
|
wneuper@1365
|
53 |
writeln (itms2str thy mits);
|
wneuper@1365
|
54 |
(*[
|
wneuper@1365
|
55 |
(1 ,[1] ,true ,#Given ,Cor equality (1 + -1 * 2 + x = 0) ,(e_, [1 + -1 * 2 + x = 0])),
|
wneuper@1365
|
56 |
(2 ,[1] ,true ,#Given ,Cor solveFor x ,(solveFor, [x])),
|
wneuper@1365
|
57 |
(3 ,[1] ,true ,#Find ,Cor solutions L ,(solutions, [L]))]*)
|
wneuper@1365
|
58 |
|
wneuper@1365
|
59 |
|
wneuper@1365
|
60 |
|
wneuper@1431
|
61 |
"--------- solve_linear as rootpbl AUTOCALCULATE CompleteCalcHead-";
|
wneuper@1431
|
62 |
"--------- solve_linear as rootpbl AUTOCALCULATE CompleteCalcHead-";
|
wneuper@1431
|
63 |
"--------- solve_linear as rootpbl AUTOCALCULATE CompleteCalcHead-";
|
wneuper@1431
|
64 |
states:=[];
|
wneuper@1431
|
65 |
CalcTree (*start of calculation, return No.1*)
|
wneuper@1431
|
66 |
[(["equality (1+-1*2+x=0)", "solveFor x","solutions L"],
|
wneuper@1431
|
67 |
("Test.thy",
|
wneuper@1431
|
68 |
["linear","univariate","equation","test"],
|
wneuper@1431
|
69 |
["Test","solve_linear"]))];
|
wneuper@2026
|
70 |
Iterator 1; moveActiveRoot 1;
|
wneuper@1431
|
71 |
|
wneuper@1447
|
72 |
(*
|
wneuper@1447
|
73 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@1431
|
74 |
autoCalculate 1 (Step 1);
|
wneuper@1447
|
75 |
refFormula 1 1;
|
wneuper@1447
|
76 |
|
wneuper@1447
|
77 |
... works
|
wneuper@1447
|
78 |
|
wneuper@1447
|
79 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@1447
|
80 |
fetchProposedTactic 1; (*-> Apply_Method*);
|
wneuper@1447
|
81 |
setNextTactic 1 (Apply_Method ["Test","solve_linear"]);
|
wneuper@1447
|
82 |
autoCalculate 1 (Step 1);
|
wneuper@1447
|
83 |
refFormula 1 1;
|
wneuper@1447
|
84 |
|
wneuper@1447
|
85 |
... works *)
|
wneuper@1431
|
86 |
|
wneuper@1431
|
87 |
autoCalculate 1 (Step 1);
|
wneuper@2026
|
88 |
refFormula 1 (get_pos 1 1);
|
wneuper@1431
|
89 |
|
wneuper@1431
|
90 |
autoCalculate 1 CompleteModel;
|
wneuper@2026
|
91 |
refFormula 1 (get_pos 1 1);
|
wneuper@1431
|
92 |
|
wneuper@1431
|
93 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@1431
|
94 |
(* *** complete_mod: only impl.for Pbl, called with ([], Met) FIXXXXXXXXXXME*)
|
wneuper@1431
|
95 |
|
wneuper@1431
|
96 |
|
wneuper@1431
|
97 |
|
wneuper@1365
|
98 |
"--------- maximum-example: complete_metitms ---------------------";
|
wneuper@1365
|
99 |
"--------- maximum-example: complete_metitms ---------------------";
|
wneuper@1365
|
100 |
"--------- maximum-example: complete_metitms ---------------------";
|
wneuper@1365
|
101 |
val (p,_,f,nxt,_,pt) =
|
wneuper@1365
|
102 |
CalcTreeTEST
|
wneuper@1365
|
103 |
[(["fixedValues [r=Arbfix]","maximum A",
|
wneuper@1365
|
104 |
"valuesFor [a,b]",
|
wneuper@1365
|
105 |
"relations [A=a*b, (a/2)^^^2 + (b/2)^^^2 = r^^^2]",
|
wneuper@1365
|
106 |
"relations [A=a*b, (a/2)^^^2 + (b/2)^^^2 = r^^^2]",
|
wneuper@1365
|
107 |
"relations [A=a*b, a/2=r*sin alpha, b/2=r*cos alpha]",
|
wneuper@1365
|
108 |
|
wneuper@1365
|
109 |
"boundVariable a","boundVariable b","boundVariable alpha",
|
wneuper@1365
|
110 |
"interval {x::real. 0 <= x & x <= 2*r}",
|
wneuper@1365
|
111 |
"interval {x::real. 0 <= x & x <= 2*r}",
|
wneuper@1365
|
112 |
"interval {x::real. 0 <= x & x <= pi}",
|
wneuper@1365
|
113 |
"errorBound (eps=(0::real))"],
|
wneuper@1365
|
114 |
("DiffApp.thy",["maximum_of","function"],["DiffApp","max_by_calculus"])
|
wneuper@1365
|
115 |
)];
|
wneuper@1365
|
116 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
117 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
118 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
119 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
120 |
val (p,_,f,nxt,_,pt) = (me nxt p c pt) handle e => print_exn e;
|
wneuper@1365
|
121 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
122 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
123 |
(*nxt = Specify_Theory "DiffApp.thy"*)
|
wneuper@1365
|
124 |
val (oris, _, _) = get_obj g_origin pt (fst p);
|
wneuper@1365
|
125 |
writeln (oris2str oris);
|
wneuper@1365
|
126 |
(*[
|
wneuper@1365
|
127 |
(1, ["1","2","3"], #Given,fixedValues, ["[r = Arbfix]"]),
|
wneuper@1365
|
128 |
(2, ["1","2","3"], #Find,maximum, ["A"]),
|
wneuper@1365
|
129 |
(3, ["1","2","3"], #Find,valuesFor, ["[a]","[b]"]),
|
wneuper@1365
|
130 |
(4, ["1","2"], #Relate,relations, ["[A = a * b]","[(a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]"]),
|
wneuper@1365
|
131 |
(5, ["3"], #Relate,relations, ["[A = a * b]","[a / 2 = r * sin alpha]","[b / 2 = r * cos alpha]"]),
|
wneuper@1365
|
132 |
(6, ["1"], #undef,boundVariable, ["a"]),
|
wneuper@1365
|
133 |
(7, ["2"], #undef,boundVariable, ["b"]),
|
wneuper@1365
|
134 |
(8, ["3"], #undef,boundVariable, ["alpha"]),
|
wneuper@1365
|
135 |
(9, ["1","2"], #undef,interval, ["{x. 0 <= x & x <= 2 * r}"]),
|
wneuper@1365
|
136 |
(10, ["3"], #undef,interval, ["{x. 0 <= x & x <= pi}"]),
|
wneuper@1365
|
137 |
(11, ["1","2","3"], #undef,errorBound, ["eps = 0"])]*)
|
wneuper@1365
|
138 |
val pits = get_obj g_pbl pt (fst p);
|
wneuper@1365
|
139 |
writeln (itms2str thy pits);
|
wneuper@1365
|
140 |
(*[
|
wneuper@1365
|
141 |
(1 ,[1,2,3] ,true,#Given ,Cor fixedValues [r = Arbfix],(fix_, [[r = Arbfix]])),
|
wneuper@1365
|
142 |
(2 ,[1,2,3] ,true,#Find ,Cor maximum A ,(m_, [A])),
|
wneuper@1365
|
143 |
(3 ,[1,2,3] ,true,#Find ,Cor valuesFor [a, b] ,(vs_, [[a, b]])),
|
wneuper@1365
|
144 |
(4 ,[1,2] ,true,#Relate ,Cor relations [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^
|
wneuper@1365
|
145 |
2 = r ^^^ 2] ,(rs_, [[A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]]))]*)
|
wneuper@1365
|
146 |
val mits = get_obj g_met pt (fst p);
|
wneuper@1365
|
147 |
val mits = complete_metitms oris pits []
|
wneuper@1365
|
148 |
((#ppc o get_met) ["DiffApp","max_by_calculus"]);
|
wneuper@1365
|
149 |
writeln (itms2str thy mits);
|
wneuper@1365
|
150 |
(*[
|
wneuper@1365
|
151 |
(1 ,[1,2,3] ,true ,#Given ,Cor fixedValues [r = Arbfix] ,(fix_, [[r = Arbfix]])),
|
wneuper@1365
|
152 |
(2 ,[1,2,3] ,true ,#Find ,Cor maximum A ,(m_, [A])),
|
wneuper@1365
|
153 |
(3 ,[1,2,3] ,true ,#Find ,Cor valuesFor [a, b] ,(vs_, [[a, b]])),
|
wneuper@1365
|
154 |
(4 ,[1,2] ,true ,#Relate ,Cor relations [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^
|
wneuper@1365
|
155 |
2 = r ^^^ 2] ,(rs_, [[A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]])),
|
wneuper@1365
|
156 |
(6 ,[1] ,true ,#undef ,Cor boundVariable a ,(boundVariable, [a])),
|
wneuper@1365
|
157 |
(9 ,[1,2] ,true ,#undef ,Cor interval {x. 0 <= x & x <= 2 * r} ,(interval, [{x.
|
wneuper@1365
|
158 |
0 <= x & x <= 2 * r}])),
|
wneuper@1365
|
159 |
(11 ,[1,2,3] ,true ,#undef ,Cor errorBound (eps = 0) ,(errorBound, [eps = 0]))]*)
|
wneuper@1365
|
160 |
if itms2str thy mits = "[\n(1 ,[1,2,3] ,true ,#Given ,Cor fixedValues [r = Arbfix] ,(fix_, [[r = Arbfix]])),\n(2 ,[1,2,3] ,true ,#Find ,Cor maximum A ,(m_, [A])),\n(3 ,[1,2,3] ,true ,#Find ,Cor valuesFor [a, b] ,(vs_, [[a, b]])),\n(4 ,[1,2] ,true ,#Relate ,Cor relations [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2] ,(rs_, [[A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]])),\n(6 ,[1] ,true ,#undef ,Cor boundVariable a ,(v_, [a])),\n(9 ,[1,2] ,true ,#undef ,Cor interval {x. 0 <= x & x <= 2 * r} ,(itv_, [{x. 0 <= x & x <= 2 * r}])),\n(11 ,[1,2,3] ,true ,#undef ,Cor errorBound (eps = 0) ,(err_, [eps = 0]))]" then ()
|
wneuper@1365
|
161 |
else raise error "completetest.sml: new behav. in complete_metitms 1";
|
wneuper@1365
|
162 |
|
wneuper@1365
|
163 |
|
wneuper@1365
|
164 |
"--------- maximum-example: complete_mod -------------------------";
|
wneuper@1365
|
165 |
"--------- maximum-example: complete_mod -------------------------";
|
wneuper@1365
|
166 |
"--------- maximum-example: complete_mod -------------------------";
|
wneuper@1365
|
167 |
val (p,_,f,nxt,_,pt) =
|
wneuper@1365
|
168 |
CalcTreeTEST
|
wneuper@1365
|
169 |
[(["fixedValues [r=Arbfix]","maximum A",
|
wneuper@1365
|
170 |
"valuesFor [a,b]",
|
wneuper@1365
|
171 |
"relations [A=a*b, (a/2)^^^2 + (b/2)^^^2 = r^^^2]",
|
wneuper@1365
|
172 |
"relations [A=a*b, (a/2)^^^2 + (b/2)^^^2 = r^^^2]",
|
wneuper@1365
|
173 |
"relations [A=a*b, a/2=r*sin alpha, b/2=r*cos alpha]",
|
wneuper@1365
|
174 |
|
wneuper@1365
|
175 |
"boundVariable a","boundVariable b","boundVariable alpha",
|
wneuper@1365
|
176 |
"interval {x::real. 0 <= x & x <= 2*r}",
|
wneuper@1365
|
177 |
"interval {x::real. 0 <= x & x <= 2*r}",
|
wneuper@1365
|
178 |
"interval {x::real. 0 <= x & x <= pi}",
|
wneuper@1365
|
179 |
"errorBound (eps=(0::real))"],
|
wneuper@1365
|
180 |
("DiffApp.thy",["maximum_of","function"],["DiffApp","max_by_calculus"])
|
wneuper@1365
|
181 |
)];
|
wneuper@1365
|
182 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
183 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
184 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1365
|
185 |
(*nxt = nxt = Add_Find "valuesFor [a]" FIXME.12.03 +handle Inc !*)
|
wneuper@1365
|
186 |
val pits = get_obj g_pbl pt (fst p);
|
wneuper@1365
|
187 |
writeln (itms2str thy pits);
|
wneuper@1365
|
188 |
(*[
|
wneuper@1365
|
189 |
(0 ,[] ,false ,#Find ,Inc valuesFor ,(??.empty, [])),
|
wneuper@1365
|
190 |
(0 ,[] ,false ,#Relate ,Inc relations [] ,(??.empty, [])),
|
wneuper@1365
|
191 |
(1 ,[1,2,3] ,true,#Given,Cor fixedValues [r = Arbfix] ,(fix_, [[r = Arbfix]])),
|
wneuper@1365
|
192 |
(2 ,[1,2,3] ,true ,#Find ,Cor maximum A ,(m_, [A]))]*)
|
wneuper@1365
|
193 |
val (pt,p) = complete_mod (pt,p);
|
wneuper@1365
|
194 |
val pits = get_obj g_pbl pt (fst p);
|
wneuper@1365
|
195 |
if itms2str thy pits = "[\n(1 ,[1,2,3] ,true ,#Given ,Cor fixedValues [r = Arbfix] ,(fix_, [[r = Arbfix]])),\n(2 ,[1,2,3] ,true ,#Find ,Cor maximum A ,(m_, [A])),\n(3 ,[1,2,3] ,true ,#Find ,Cor valuesFor [a, b] ,(vs_, [[a],[b]])),\n(4 ,[1,2] ,true ,#Relate ,Cor relations [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2] ,(rs_, [[A = a * b],[(a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]]))]"
|
wneuper@1365
|
196 |
then () else raise error "completetest.sml: new behav. in complete_mod 3";
|
wneuper@1365
|
197 |
writeln (itms2str thy pits);
|
wneuper@1365
|
198 |
(*[
|
wneuper@1365
|
199 |
(1 ,[1,2,3] ,true,#Given,Cor fixedValues [r = Arbfix] ,(fix_, [[r = Arbfix]])),
|
wneuper@1365
|
200 |
(2 ,[1,2,3] ,true ,#Find ,Cor maximum A ,(m_, [A])),
|
wneuper@1365
|
201 |
(3 ,[1,2,3] ,true ,#Find ,Cor valuesFor [a, b] ,(valuesFor, [[a],[b]])),
|
wneuper@1365
|
202 |
(4 ,[1,2] ,true ,#Relate ,Cor relations [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^
|
wneuper@1365
|
203 |
2 = r ^^^ 2] ,(relations, [[A = a * b],[(a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]]))]*)
|
wneuper@1365
|
204 |
val mits = get_obj g_met pt (fst p);
|
wneuper@1365
|
205 |
if itms2str thy mits = "[\n(1 ,[1,2,3] ,true ,#Given ,Cor fixedValues [r = Arbfix] ,(fix_, [[r = Arbfix]])),\n(2 ,[1,2,3] ,true ,#Find ,Cor maximum A ,(m_, [A])),\n(3 ,[1,2,3] ,true ,#Find ,Cor valuesFor [a, b] ,(vs_, [[a],[b]])),\n(4 ,[1,2] ,true ,#Relate ,Cor relations [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2] ,(rs_, [[A = a * b],[(a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]])),\n(6 ,[1] ,true ,#undef ,Cor boundVariable a ,(v_, [a])),\n(9 ,[1,2] ,true ,#undef ,Cor interval {x. 0 <= x & x <= 2 * r} ,(itv_, [{x. 0 <= x & x <= 2 * r}])),\n(11 ,[1,2,3] ,true ,#undef ,Cor errorBound (eps = 0) ,(err_, [eps = 0]))]"
|
wneuper@1365
|
206 |
then () else raise error "completetest.sml: new behav. in complete_mod 3";
|
wneuper@1365
|
207 |
writeln (itms2str thy mits);
|
wneuper@1365
|
208 |
(*[
|
wneuper@1365
|
209 |
(1 ,[1,2,3] ,true ,#Given ,Cor fixedValues [r = Arbfix] ,(fix_, [[r = Arbfix]])),
|
wneuper@1365
|
210 |
(2 ,[1,2,3] ,true ,#Find ,Cor maximum A ,(m_, [A])),
|
wneuper@1365
|
211 |
(3 ,[1,2,3] ,true ,#Find ,Cor valuesFor [a, b] ,(valuesFor, [[a],[b]])),
|
wneuper@1365
|
212 |
(4 ,[1,2] ,true ,#Relate ,Cor relations [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^
|
wneuper@1365
|
213 |
2 = r ^^^ 2] ,(relations, [[A = a * b],[(a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]])),
|
wneuper@1365
|
214 |
(6 ,[1] ,true ,#undef ,Cor boundVariable a ,(boundVariable, [a])),
|
wneuper@1365
|
215 |
(9 ,[1,2] ,true ,#undef ,Cor interval {x. 0 <= x & x <= 2 * r} ,(interval, [{x.
|
wneuper@1365
|
216 |
0 <= x & x <= 2 * r}])),
|
wneuper@1365
|
217 |
(11 ,[1,2,3] ,true ,#undef ,Cor errorBound (eps = 0) ,(errorBound, [eps = 0]))]*)
|
wneuper@1365
|
218 |
|
wneuper@1365
|
219 |
|
wneuper@1399
|
220 |
|
wneuper@1399
|
221 |
|
wneuper@1399
|
222 |
"--------- appendFormula: on Res + equ_nrls ----------------------";
|
wneuper@1399
|
223 |
"--------- appendFormula: on Res + equ_nrls ----------------------";
|
wneuper@1399
|
224 |
"--------- appendFormula: on Res + equ_nrls ----------------------";
|
wneuper@1365
|
225 |
val Script sc = (#scr o get_met) ["Test","squ-equ-test-subpbl1"];
|
wneuper@1365
|
226 |
(writeln o term2str) sc;
|
wneuper@1365
|
227 |
val Script sc = (#scr o get_met) ["Test","solve_linear"];
|
wneuper@1365
|
228 |
(writeln o term2str) sc;
|
wneuper@1365
|
229 |
|
wneuper@1399
|
230 |
states:=[];
|
wneuper@1399
|
231 |
CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"],
|
wneuper@1399
|
232 |
("Test.thy",
|
wneuper@1399
|
233 |
["sqroot-test","univariate","equation","test"],
|
wneuper@1399
|
234 |
["Test","squ-equ-test-subpbl1"]))];
|
wneuper@2026
|
235 |
Iterator 1; moveActiveRoot 1;
|
wneuper@1399
|
236 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@2026
|
237 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 = 2*)
|
wneuper@2026
|
238 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 + -1 * 2 = 0*);
|
wneuper@1365
|
239 |
|
wneuper@2026
|
240 |
appendFormula 1 "-2 * 1 + (1 + x) = 0"; refFormula 1 (get_pos 1 1);
|
wneuper@1399
|
241 |
val ((pt,_),_) = get_calc 1;
|
wneuper@1399
|
242 |
val str = pr_ptree pr_short pt;
|
wneuper@1365
|
243 |
writeln str;
|
wneuper@1365
|
244 |
if str = ". ----- pblobj -----\n1. x + 1 = 2\n2. x + 1 + -1 * 2 = 0\n2.1. x + 1 + -1 * 2 = 0\n2.2. -1 * 2 + (x + 1) = 0\n2.3. -1 * 2 + (1 + x) = 0\n2.4. 1 + (-1 * 2 + x) = 0\n2.5. 1 + (-2 + x) = 0\n2.6. 1 + (-2 * 1 + x) = 0\n" then ()
|
wneuper@1399
|
245 |
else raise error "auto-inform.sml: diff.behav.appendFormula: on Res + equ 1";
|
wneuper@1365
|
246 |
|
wneuper@2026
|
247 |
moveDown 1 ([ ],Pbl); refFormula 1 ([1],Frm); (*x + 1 = 2*)
|
wneuper@2026
|
248 |
moveDown 1 ([1],Frm); refFormula 1 ([1],Res); (*x + 1 + -1 * 2 = 0*)
|
wneuper@1399
|
249 |
|
wneuper@2026
|
250 |
(*the seven steps of detailed derivation*)
|
wneuper@2026
|
251 |
moveDown 1 ([1 ],Res); refFormula 1 ([2,1],Frm);
|
wneuper@2026
|
252 |
moveDown 1 ([2,1],Frm); refFormula 1 ([2,1],Res);
|
wneuper@2026
|
253 |
moveDown 1 ([2,1],Res); refFormula 1 ([2,2],Res);
|
wneuper@2026
|
254 |
moveDown 1 ([2,2],Res); refFormula 1 ([2,3],Res);
|
wneuper@2026
|
255 |
moveDown 1 ([2,3],Res); refFormula 1 ([2,4],Res);
|
wneuper@2026
|
256 |
moveDown 1 ([2,4],Res); refFormula 1 ([2,5],Res);
|
wneuper@2026
|
257 |
moveDown 1 ([2,5],Res); refFormula 1 ([2,6],Res);
|
wneuper@1399
|
258 |
val ((pt,_),_) = get_calc 1;
|
wneuper@1399
|
259 |
if "-2 * 1 + (1 + x) = 0" = term2str (fst (get_obj g_result pt [2,6])) then()
|
wneuper@1399
|
260 |
else raise error "auto-inform.sml: diff.behav.appendFormula: on Res + equ 2";
|
wneuper@1399
|
261 |
|
wneuper@1399
|
262 |
fetchProposedTactic 1; (*takes Iterator 1 _1_*)
|
wneuper@1399
|
263 |
val (_,(tac,_,_)::_) = get_calc 1;
|
wneuper@1399
|
264 |
if tac = Rewrite_Set "Test_simplify" then ()
|
wneuper@1399
|
265 |
else raise error "auto-inform.sml: diff.behav.appendFormula: on Res + equ 3";
|
wneuper@1399
|
266 |
autoCalculate 1 CompleteCalc;
|
wneuper@1399
|
267 |
val ((pt,_),_) = get_calc 1;
|
wneuper@1399
|
268 |
if "[x = 1]" = term2str (fst (get_obj g_result pt [])) then ()
|
wneuper@1399
|
269 |
else raise error "auto-inform.sml: diff.behav.appendFormula: on Res + equ 4";
|
wneuper@1399
|
270 |
(* autoCalculate 1 CompleteCalc;
|
wneuper@1399
|
271 |
val ((pt,p),_) = get_calc 1;
|
wneuper@1399
|
272 |
(writeln o istates2str) (get_obj g_loc pt [ ]);
|
wneuper@1399
|
273 |
(writeln o istates2str) (get_obj g_loc pt [1]);
|
wneuper@1399
|
274 |
(writeln o istates2str) (get_obj g_loc pt [2]);
|
wneuper@1399
|
275 |
(writeln o istates2str) (get_obj g_loc pt [3]);
|
wneuper@1399
|
276 |
(writeln o istates2str) (get_obj g_loc pt [3,1]);
|
wneuper@1399
|
277 |
(writeln o istates2str) (get_obj g_loc pt [3,2]);
|
wneuper@1399
|
278 |
(writeln o istates2str) (get_obj g_loc pt [4]);
|
wneuper@1399
|
279 |
|
wneuper@1399
|
280 |
*)
|
wneuper@1399
|
281 |
"----------------------------------------------------------";
|
wneuper@1365
|
282 |
val fod = make_deriv Isac.thy Atools_erls
|
wneuper@1365
|
283 |
((#rules o rep_rls) Test_simplify)
|
wneuper@1365
|
284 |
(sqrt_right false ProtoPure.thy) None
|
wneuper@1365
|
285 |
(str2term "x + 1 + -1 * 2 = 0");
|
wneuper@1365
|
286 |
(writeln o trtas2str) fod;
|
wneuper@1365
|
287 |
|
wneuper@1365
|
288 |
val ifod = make_deriv Isac.thy Atools_erls
|
wneuper@1365
|
289 |
((#rules o rep_rls) Test_simplify)
|
wneuper@1365
|
290 |
(sqrt_right false ProtoPure.thy) None
|
wneuper@1365
|
291 |
(str2term "-2 * 1 + (1 + x) = 0");
|
wneuper@1365
|
292 |
(writeln o trtas2str) ifod;
|
wneuper@1365
|
293 |
fun equal (_,_,(t1, _)) (_,_,(t2, _)) = t1=t2;
|
wneuper@1365
|
294 |
val (fod', rifod') = dropwhile' equal (rev fod) (rev ifod);
|
wneuper@1365
|
295 |
val der = fod' @ (map rev_deriv' rifod');
|
wneuper@1365
|
296 |
(writeln o trtas2str) der;
|
wneuper@1365
|
297 |
"----------------------------------------------------------";
|
wneuper@1365
|
298 |
|
wneuper@1399
|
299 |
|
wneuper@1399
|
300 |
"--------- appendFormula: on Frm + equ_nrls ----------------------";
|
wneuper@1399
|
301 |
"--------- appendFormula: on Frm + equ_nrls ----------------------";
|
wneuper@1399
|
302 |
"--------- appendFormula: on Frm + equ_nrls ----------------------";
|
wneuper@1365
|
303 |
states:=[];
|
wneuper@1365
|
304 |
CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"],
|
wneuper@1365
|
305 |
("Test.thy",
|
wneuper@1365
|
306 |
["sqroot-test","univariate","equation","test"],
|
wneuper@1365
|
307 |
["Test","squ-equ-test-subpbl1"]))];
|
wneuper@2026
|
308 |
Iterator 1; moveActiveRoot 1;
|
wneuper@1399
|
309 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@2146
|
310 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*x + 1 = 2*);
|
wneuper@2152
|
311 |
|
wneuper@2026
|
312 |
appendFormula 1 "2+ -1 + x = 2"; refFormula 1 (get_pos 1 1);
|
wneuper@2146
|
313 |
|
wneuper@2146
|
314 |
moveDown 1 ([],Pbl); refFormula 1 ([1],Frm) (*x + 1 = 2*);
|
wneuper@1365
|
315 |
|
wneuper@2026
|
316 |
moveDown 1 ([1 ],Frm); refFormula 1 ([1,1],Frm);
|
wneuper@2026
|
317 |
moveDown 1 ([1,1],Frm); refFormula 1 ([1,1],Res);
|
wneuper@2026
|
318 |
moveDown 1 ([1,1],Res); refFormula 1 ([1,2],Res);
|
wneuper@2026
|
319 |
moveDown 1 ([1,2],Res); refFormula 1 ([1,3],Res);
|
wneuper@2026
|
320 |
moveDown 1 ([1,3],Res); refFormula 1 ([1,4],Res);
|
wneuper@2026
|
321 |
moveDown 1 ([1,4],Res); refFormula 1 ([1,5],Res);
|
wneuper@2026
|
322 |
moveDown 1 ([1,5],Res); refFormula 1 ([1,6],Res);
|
wneuper@1365
|
323 |
val ((pt,_),_) = get_calc 1;
|
wneuper@1399
|
324 |
if "2 + -1 + x = 2" = term2str (fst (get_obj g_result pt [1,6])) then()
|
wneuper@1399
|
325 |
else raise error "auto-inform.sml: diff.behav.appendFormula: on Frm + equ 1";
|
wneuper@1365
|
326 |
|
wneuper@1399
|
327 |
fetchProposedTactic 1; (*takes Iterator 1 _1_*)
|
wneuper@1399
|
328 |
val (_,(tac,_,_)::_) = get_calc 1;
|
wneuper@1399
|
329 |
if tac = Rewrite_Set "norm_equation" then ()
|
wneuper@1399
|
330 |
else raise error "auto-inform.sml: diff.behav.appendFormula: on Frm + equ 2";
|
wneuper@1399
|
331 |
autoCalculate 1 CompleteCalc;
|
wneuper@1399
|
332 |
val ((pt,_),_) = get_calc 1;
|
wneuper@1399
|
333 |
if "[x = 1]" = term2str (fst (get_obj g_result pt [])) then ()
|
wneuper@1399
|
334 |
else raise error "auto-inform.sml: diff.behav.appendFormula: on Frm + equ 3";
|
wneuper@1365
|
335 |
|
wneuper@1365
|
336 |
|
wneuper@1365
|
337 |
"--------- appendFormula: on Res + NO deriv ----------------------";
|
wneuper@1365
|
338 |
"--------- appendFormula: on Res + NO deriv ----------------------";
|
wneuper@1365
|
339 |
"--------- appendFormula: on Res + NO deriv ----------------------";
|
wneuper@1365
|
340 |
states:=[];
|
wneuper@1365
|
341 |
CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"],
|
wneuper@1365
|
342 |
("Test.thy",
|
wneuper@1365
|
343 |
["sqroot-test","univariate","equation","test"],
|
wneuper@1365
|
344 |
["Test","squ-equ-test-subpbl1"]))];
|
wneuper@2026
|
345 |
Iterator 1; moveActiveRoot 1;
|
wneuper@1399
|
346 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@2026
|
347 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 = 2*)
|
wneuper@2026
|
348 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 + -1 * 2 = 0*);
|
wneuper@1365
|
349 |
|
wneuper@1365
|
350 |
appendFormula 1 "x = 2";
|
wneuper@1365
|
351 |
val ((pt,p),_) = get_calc 1;
|
wneuper@1365
|
352 |
val str = pr_ptree pr_short pt;
|
wneuper@1365
|
353 |
writeln str;
|
wneuper@1365
|
354 |
if str = ". ----- pblobj -----\n1. x + 1 = 2\n" andalso p = ([1], Res)
|
wneuper@1365
|
355 |
then ()
|
wneuper@1399
|
356 |
else raise error "auto-inform.sml: diff.behav.appendFormula: Res + NOder 1";
|
wneuper@1399
|
357 |
|
wneuper@1399
|
358 |
fetchProposedTactic 1;
|
wneuper@1399
|
359 |
val (_,(tac,_,_)::_) = get_calc 1;
|
wneuper@1399
|
360 |
if tac = Rewrite_Set "Test_simplify" then ()
|
wneuper@1399
|
361 |
else raise error "auto-inform.sml: diff.behav.appendFormula: Res + NOder 2";
|
wneuper@1399
|
362 |
autoCalculate 1 CompleteCalc;
|
wneuper@1399
|
363 |
val ((pt,_),_) = get_calc 1;
|
wneuper@1399
|
364 |
if "[x = 1]" = term2str (fst (get_obj g_result pt [])) then ()
|
wneuper@1399
|
365 |
else raise error "auto-inform.sml: diff.behav.appendFormula: on Frm + equ 3";
|
wneuper@1365
|
366 |
|
wneuper@1365
|
367 |
|
wneuper@1365
|
368 |
"--------- appendFormula: on Res + late deriv --------------------";
|
wneuper@1365
|
369 |
"--------- appendFormula: on Res + late deriv --------------------";
|
wneuper@1365
|
370 |
"--------- appendFormula: on Res + late deriv --------------------";
|
wneuper@1365
|
371 |
states:=[];
|
wneuper@1365
|
372 |
CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"],
|
wneuper@1365
|
373 |
("Test.thy",
|
wneuper@1365
|
374 |
["sqroot-test","univariate","equation","test"],
|
wneuper@1365
|
375 |
["Test","squ-equ-test-subpbl1"]))];
|
wneuper@2026
|
376 |
Iterator 1; moveActiveRoot 1;
|
wneuper@1399
|
377 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@2026
|
378 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 = 2*)
|
wneuper@2026
|
379 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 + -1 * 2 = 0*);
|
wneuper@1365
|
380 |
|
wneuper@1365
|
381 |
appendFormula 1 "x = 1";
|
wneuper@1365
|
382 |
val ((pt,p),_) = get_calc 1;
|
wneuper@1365
|
383 |
val str = pr_ptree pr_short pt;
|
wneuper@1365
|
384 |
writeln str;
|
wneuper@1365
|
385 |
if str = ". ----- pblobj -----\n1. x + 1 = 2\n2. x + 1 + -1 * 2 = 0\n3. ----- pblobj -----\n3.1. -1 + x = 0\n3.2. x = 0 + -1 * -1\n3.2.1. x = 0 + -1 * -1\n3.2.2. x = 0 + 1\n" andalso p = ([3,2], Res)
|
wneuper@1399
|
386 |
then () (*finds 1 step too early: ([3,2], Res) "x = 1" also by script !!!*)
|
wneuper@1399
|
387 |
else raise error "auto-inform.sml: diff.behav.appendFormula: Res + late d 1";
|
wneuper@1365
|
388 |
|
wneuper@1399
|
389 |
fetchProposedTactic 1;
|
wneuper@1399
|
390 |
val (_,(tac,_,_)::_) = get_calc 1;
|
wneuper@1399
|
391 |
if tac = Check_Postcond ["linear", "univariate", "equation", "test"] then ()
|
wneuper@1399
|
392 |
else raise error "auto-inform.sml: diff.behav.appendFormula: Res + late d 2";
|
wneuper@1399
|
393 |
autoCalculate 1 CompleteCalc;
|
wneuper@1399
|
394 |
val ((pt,_),_) = get_calc 1;
|
wneuper@1399
|
395 |
if "[x = 1]" = term2str (fst (get_obj g_result pt [])) then ()
|
wneuper@1399
|
396 |
else raise error "auto-inform.sml: diff.behav.appendFormula: Res + late d 3";
|
wneuper@1399
|
397 |
|
wneuper@1399
|
398 |
|
wneuper@1399
|
399 |
"--------- appendFormula: on Res + late deriv [x = 3 + -2]---///--";
|
wneuper@1399
|
400 |
"--------- appendFormula: on Res + late deriv [x = 3 + -2]---///--";
|
wneuper@1399
|
401 |
"--------- appendFormula: on Res + late deriv [x = 3 + -2]---///--";
|
wneuper@1399
|
402 |
states:=[];
|
wneuper@1399
|
403 |
CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"],
|
wneuper@1399
|
404 |
("Test.thy",
|
wneuper@1399
|
405 |
["sqroot-test","univariate","equation","test"],
|
wneuper@1399
|
406 |
["Test","squ-equ-test-subpbl1"]))];
|
wneuper@2026
|
407 |
Iterator 1; moveActiveRoot 1;
|
wneuper@1399
|
408 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@2026
|
409 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 = 2*)
|
wneuper@2026
|
410 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 + -1 * 2 = 0*);
|
wneuper@1408
|
411 |
appendFormula 1 "[x = 3 + -2*1]";
|
wneuper@1408
|
412 |
val ((pt,p),_) = get_calc 1;
|
wneuper@1408
|
413 |
val str = pr_ptree pr_short pt;
|
wneuper@1408
|
414 |
writeln str;
|
wneuper@1408
|
415 |
if str=". ----- pblobj -----\n1. x + 1 = 2\n2. x + 1 + -1 * 2 = 0\n3. ----- pblobj -----\n3.1. -1 + x = 0\n3.2. x = 0 + -1 * -1\n4. [x = 1]\n4.1. [x = 1]\n4.2. [x = -2 + 3]\n4.3. [x = 3 + -2]\n" then ()
|
wneuper@1408
|
416 |
else raise error "auto-inform.sml: diff.behav.appendFormula: Res + latEE 1";
|
wneuper@1408
|
417 |
autoCalculate 1 CompleteCalc;
|
wneuper@1408
|
418 |
val ((pt,p),_) = get_calc 1;
|
wneuper@1408
|
419 |
if "[x = 3 + -2 * 1]" = term2str (fst (get_obj g_result pt [])) then ()
|
wneuper@1408
|
420 |
(* ~~~~~~~~~~ simplify as last step in any script ?!*)
|
wneuper@1408
|
421 |
else raise error "auto-inform.sml: diff.behav.appendFormula: Res + latEE 2";
|
wneuper@1408
|
422 |
|
wneuper@1408
|
423 |
|
wneuper@1408
|
424 |
|
wneuper@1408
|
425 |
"--------- replaceFormula: on Res + = ----------------------------";
|
wneuper@1408
|
426 |
"--------- replaceFormula: on Res + = ----------------------------";
|
wneuper@1408
|
427 |
"--------- replaceFormula: on Res + = ----------------------------";
|
wneuper@1408
|
428 |
states:=[];
|
wneuper@1408
|
429 |
CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"],
|
wneuper@1408
|
430 |
("Test.thy",
|
wneuper@1408
|
431 |
["sqroot-test","univariate","equation","test"],
|
wneuper@1408
|
432 |
["Test","squ-equ-test-subpbl1"]))];
|
wneuper@2026
|
433 |
Iterator 1; moveActiveRoot 1;
|
wneuper@1408
|
434 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@2026
|
435 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 = 2*)
|
wneuper@2026
|
436 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 + -1 * 2 = 0*);
|
wneuper@2026
|
437 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*-1 + x*);
|
wneuper@1408
|
438 |
|
wneuper@2026
|
439 |
replaceFormula 1 "-2 * 1 + (1 + x) = 0"; refFormula 1 (get_pos 1 1);
|
wneuper@1408
|
440 |
val ((pt,_),_) = get_calc 1;
|
wneuper@1408
|
441 |
val str = pr_ptree pr_short pt;
|
wneuper@1408
|
442 |
writeln str;
|
wneuper@1408
|
443 |
if str=". ----- pblobj -----\n1. x + 1 = 2\n2. x + 1 + -1 * 2 = 0\n2.1. x + 1 + -1 * 2 = 0\n2.2. -1 * 2 + (x + 1) = 0\n2.3. -1 * 2 + (1 + x) = 0\n2.4. 1 + (-1 * 2 + x) = 0\n2.5. 1 + (-2 + x) = 0\n2.6. 1 + (-2 * 1 + x) = 0\n" then()
|
wneuper@2152
|
444 |
else raise error "auto-inform.sml: diff.behav.replaceFormula: on Res += 1";
|
wneuper@1408
|
445 |
autoCalculate 1 CompleteCalc;
|
wneuper@1408
|
446 |
val ((pt,pos as(p,_)),_) = get_calc 1;
|
wneuper@1408
|
447 |
if pos=([],Res)andalso"[x = 1]"=(term2str o fst)(get_obj g_result pt p)then()
|
wneuper@1408
|
448 |
else raise error "auto-inform.sml: diff.behav.replaceFormula: on Res + = 2";
|
wneuper@1408
|
449 |
|
wneuper@1408
|
450 |
|
wneuper@1408
|
451 |
"--------- replaceFormula: on Res + = 1st Nd ---------------------";
|
wneuper@1408
|
452 |
"--------- replaceFormula: on Res + = 1st Nd ---------------------";
|
wneuper@1408
|
453 |
"--------- replaceFormula: on Res + = 1st Nd ---------------------";
|
wneuper@1408
|
454 |
states:=[];
|
wneuper@1408
|
455 |
CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"],
|
wneuper@1408
|
456 |
("Test.thy",
|
wneuper@1408
|
457 |
["sqroot-test","univariate","equation","test"],
|
wneuper@1408
|
458 |
["Test","squ-equ-test-subpbl1"]))];
|
wneuper@2026
|
459 |
Iterator 1; moveActiveRoot 1;
|
wneuper@1408
|
460 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@2026
|
461 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 = 2*)
|
wneuper@2026
|
462 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 + -1 * 2 = 0*);
|
wneuper@1408
|
463 |
|
wneuper@2026
|
464 |
replaceFormula 1 "x + 1 = 4 + -2"; refFormula 1 (get_pos 1 1);
|
wneuper@1408
|
465 |
val ((pt,_),_) = get_calc 1;
|
wneuper@1408
|
466 |
val str = pr_ptree pr_short pt;
|
wneuper@1408
|
467 |
writeln str;
|
wneuper@1408
|
468 |
if str=". ----- pblobj -----\n1. x + 1 = 2\n1.1. x + 1 = 2\n1.2. 1 + x = 2\n1.3. 1 + x = -2 + 4\n1.4. x + 1 = -2 + 4\n" then ()
|
wneuper@1408
|
469 |
else raise error "auto-inform.sml: diff.behav.replaceFormula: on Res 1 + = 1";
|
wneuper@1408
|
470 |
autoCalculate 1 CompleteCalc;
|
wneuper@1408
|
471 |
val ((pt,pos as(p,_)),_) = get_calc 1;
|
wneuper@1408
|
472 |
if pos=([],Res)andalso"[x = 1]"=(term2str o fst)(get_obj g_result pt p)then()
|
wneuper@1408
|
473 |
else raise error "auto-inform.sml: diff.behav.replaceFormula: on Res + = 2";
|
wneuper@1408
|
474 |
|
wneuper@1408
|
475 |
|
wneuper@1408
|
476 |
"--------- replaceFormula: on Frm + = 1st Nd ---------------------";
|
wneuper@1408
|
477 |
"--------- replaceFormula: on Frm + = 1st Nd ---------------------";
|
wneuper@1408
|
478 |
"--------- replaceFormula: on Frm + = 1st Nd ---------------------";
|
wneuper@1408
|
479 |
states:=[];
|
wneuper@1408
|
480 |
CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"],
|
wneuper@1408
|
481 |
("Test.thy",
|
wneuper@1408
|
482 |
["sqroot-test","univariate","equation","test"],
|
wneuper@1408
|
483 |
["Test","squ-equ-test-subpbl1"]))];
|
wneuper@2026
|
484 |
Iterator 1; moveActiveRoot 1;
|
wneuper@1408
|
485 |
autoCalculate 1 CompleteCalcHead;
|
wneuper@2026
|
486 |
autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*x + 1 = 2*)
|
wneuper@1408
|
487 |
|
wneuper@2026
|
488 |
replaceFormula 1 "x + 1 = 4 + -2"; refFormula 1 (get_pos 1 1);
|
wneuper@1408
|
489 |
val ((pt,_),_) = get_calc 1;
|
wneuper@1408
|
490 |
val str = pr_ptree pr_short pt;
|
wneuper@1408
|
491 |
writeln str;
|
wneuper@1408
|
492 |
if str=". ----- pblobj -----\n1. x + 1 = 2\n1.1. x + 1 = 2\n1.2. 1 + x = 2\n1.3. 1 + x = -2 + 4\n1.4. x + 1 = -2 + 4\n" then ()
|
wneuper@1408
|
493 |
else raise error "auto-inform.sml: diff.behav.replaceFormula: on Frm 1 + = 1";
|
wneuper@1408
|
494 |
autoCalculate 1 CompleteCalc;
|
wneuper@1408
|
495 |
val ((pt,pos as(p,_)),_) = get_calc 1;
|
wneuper@1408
|
496 |
if pos=([],Res)andalso"[x = 1]"=(term2str o fst)(get_obj g_result pt p)then()
|
wneuper@1408
|
497 |
else raise error "auto-inform.sml: diff.behav.replaceFormula: on Frm 1 + = 2";
|
wneuper@1408
|
498 |
|
wneuper@1408
|
499 |
|
wneuper@1408
|
500 |
"--------- replaceFormula: cut calculation -----------------------";
|
wneuper@1408
|
501 |
"--------- replaceFormula: cut calculation -----------------------";
|
wneuper@1408
|
502 |
"--------- replaceFormula: cut calculation -----------------------";
|
wneuper@1408
|
503 |
states:=[];
|
wneuper@1408
|
504 |
CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"],
|
wneuper@1408
|
505 |
("Test.thy",
|
wneuper@1408
|
506 |
["sqroot-test","univariate","equation","test"],
|
wneuper@1408
|
507 |
["Test","squ-equ-test-subpbl1"]))];
|
wneuper@2026
|
508 |
Iterator 1; moveActiveRoot 1;
|
wneuper@1408
|
509 |
autoCalculate 1 CompleteCalc;
|
wneuper@2026
|
510 |
moveActiveRoot 1; moveActiveDown 1;
|
wneuper@1408
|
511 |
if get_pos 1 1 = ([1], Frm) then ()
|
wneuper@1408
|
512 |
else raise error "auto-inform.sml: diff.behav. cut calculation 1";
|
wneuper@1408
|
513 |
|
wneuper@2026
|
514 |
replaceFormula 1 "x + 1 = 4 + -2"; refFormula 1 (get_pos 1 1);
|
wneuper@1408
|
515 |
val ((pt,p),_) = get_calc 1;
|
wneuper@1408
|
516 |
val str = pr_ptree pr_short pt;
|
wneuper@1408
|
517 |
writeln str;
|
wneuper@1408
|
518 |
if p = ([1], Res) then ()
|
wneuper@1408
|
519 |
else raise error "auto-inform.sml: diff.behav. cut calculation 2";
|
wneuper@1408
|
520 |
|
wneuper@1408
|
521 |
|
wneuper@1399
|
522 |
|
wneuper@1399
|
523 |
|
wneuper@1399
|
524 |
|
wneuper@1399
|
525 |
|
wneuper@1399
|
526 |
(* 040307 copied from informtest.sml; ... old version
|
wneuper@1399
|
527 |
"---------------- maximum-example, UC: Modeling / modifyCalcHead -";
|
wneuper@1399
|
528 |
"---------------- maximum-example, UC: Modeling / modifyCalcHead -";
|
wneuper@1399
|
529 |
"---------------- maximum-example, UC: Modeling / modifyCalcHead -";
|
wneuper@1399
|
530 |
|
wneuper@1399
|
531 |
val p = ([],Pbl);
|
wneuper@1399
|
532 |
val elems = ["fixedValues [r=Arbfix]","maximum A","valuesFor [a,b]",
|
wneuper@1399
|
533 |
"relations [A=a*b, (a/2)^^^2 + (b/2)^^^2 = r^^^2]",
|
wneuper@1399
|
534 |
"relations [A=a*b, (a/2)^^^2 + (b/2)^^^2 = r^^^2]",
|
wneuper@1399
|
535 |
"relations [A=a*b, a/2=r*sin alpha, b/2=r*cos alpha]",
|
wneuper@1399
|
536 |
(*^^^ these are the elements for the root-problem (in variants)*)
|
wneuper@1399
|
537 |
(*vvv these are elements required for subproblems*)
|
wneuper@1399
|
538 |
"boundVariable a","boundVariable b","boundVariable alpha",
|
wneuper@1399
|
539 |
"interval {x::real. 0 <= x & x <= 2*r}",
|
wneuper@1399
|
540 |
"interval {x::real. 0 <= x & x <= 2*r}",
|
wneuper@1399
|
541 |
"interval {x::real. 0 <= x & x <= pi}",
|
wneuper@1399
|
542 |
"errorBound (eps=(0::real))"]
|
wneuper@1399
|
543 |
(*specifying is not interesting for this example*)
|
wneuper@1399
|
544 |
val spec = ("DiffApp.thy", ["maximum_of","function"],
|
wneuper@1399
|
545 |
["DiffApp","max_by_calculus"]);
|
wneuper@1399
|
546 |
(*the empty model with descriptions for user-guidance by Model_Problem*)
|
wneuper@1399
|
547 |
val empty_model = [Given ["fixedValues []"],
|
wneuper@1399
|
548 |
Find ["maximum", "valuesFor"],
|
wneuper@1399
|
549 |
Relate ["relations []"]];
|
wneuper@1399
|
550 |
|
wneuper@1399
|
551 |
|
wneuper@1399
|
552 |
(*!!!!!!!!!!!!!!!!! DON'T USE me FOR FINDING nxt !!!!!!!!!!!!!!!!!!*)
|
wneuper@1399
|
553 |
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(elems, spec)];
|
wneuper@1399
|
554 |
(*val nxt = ("Model_Problem", ...*)
|
wneuper@1399
|
555 |
val pbl = get_obj g_pbl pt (fst p); (writeln o (itms2str thy)) pbl;
|
wneuper@1399
|
556 |
|
wneuper@1399
|
557 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
wneuper@1399
|
558 |
(*nxt = Add_Given "fixedValues [r = Arbfix]"*)
|
wneuper@1399
|
559 |
val pbl = get_obj g_pbl pt (fst p); (writeln o (itms2str thy)) pbl;
|
wneuper@1399
|
560 |
(*[
|
wneuper@1399
|
561 |
(0 ,[] ,false ,#Given ,Inc fixedValues [] ,(??.empty, [])),
|
wneuper@1399
|
562 |
(0 ,[] ,false ,#Find ,Inc maximum ,(??.empty, [])),
|
wneuper@1399
|
563 |
(0 ,[] ,false ,#Find ,Inc valuesFor ,(??.empty, [])),
|
wneuper@1399
|
564 |
(0 ,[] ,false ,#Relate ,Inc relations [] ,(??.empty, []))]*)
|
wneuper@1399
|
565 |
|
wneuper@1399
|
566 |
(*the empty CalcHead is checked w.r.t the model and re-established as such*)
|
wneuper@1399
|
567 |
val (b,pt,ocalhd) = input_icalhd pt (p,"", empty_model, Pbl, e_spec);
|
wneuper@1399
|
568 |
val pbl = get_obj g_pbl pt (fst p); (writeln o (itms2str thy)) pbl;
|
wneuper@1399
|
569 |
if ocalhd2str ocalhd = "(Pbl, ??.empty, [\n(0 ,[] ,false ,#Given ,Inc fixedValues [] ,(??.empty, [])),\n(0 ,[] ,false ,#Find ,Inc maximum ,(??.empty, [])),\n(0 ,[] ,false ,#Find ,Inc valuesFor ,(??.empty, [])),\n(0 ,[] ,false ,#Relate ,Inc relations [] ,(??.empty, []))], [], \n(\"e_domID\", [\"e_pblID\"], [\"e_metID\"]) )" then () else raise error "informtest.sml: diff.behav. max 1";
|
wneuper@1399
|
570 |
|
wneuper@1399
|
571 |
(*there is one input to the model (could be more)*)
|
wneuper@1399
|
572 |
val (b,pt,ocalhd) =
|
wneuper@1399
|
573 |
input_icalhd pt (p,"", [Given ["fixedValues [r=Arbfix]"],
|
wneuper@1399
|
574 |
Find ["maximum", "valuesFor"],
|
wneuper@1399
|
575 |
Relate ["relations"]], Pbl, e_spec);
|
wneuper@1399
|
576 |
val pbl = get_obj g_pbl pt (fst p); (writeln o (itms2str thy)) pbl;
|
wneuper@1399
|
577 |
if ocalhd2str ocalhd = "(Pbl, ??.empty, [\n(1 ,[1,2,3] ,true ,#Given ,Cor fixedValues [r = Arbfix] ,(fix_, [[r = Arbfix]])),\n(0 ,[] ,false ,#Find ,Inc maximum ,(??.empty, [])),\n(0 ,[] ,false ,#Find ,Inc valuesFor ,(??.empty, [])),\n(0 ,[] ,false ,#Relate ,Inc relations [] ,(??.empty, []))], [], \n(\"e_domID\", [\"e_pblID\"], [\"e_metID\"]) )" then ()
|
wneuper@1399
|
578 |
else raise error "informtest.sml: diff.behav. max 2";
|
wneuper@1399
|
579 |
|
wneuper@1399
|
580 |
(*this input is complete in variant 3, but the ME doesn't recognize FIXXXXME
|
wneuper@1399
|
581 |
val (b,pt''''',ocalhd) =
|
wneuper@1399
|
582 |
input_icalhd pt (p,"", [Given ["fixedValues [r=Arbfix]"],
|
wneuper@1399
|
583 |
Find ["maximum A", "valuesFor [a,b]"],
|
wneuper@1399
|
584 |
Relate ["relations [A=a*b, a/2=r*sin alpha, \
|
wneuper@1399
|
585 |
\b/2=r*cos alpha]"]], Pbl, e_spec);
|
wneuper@1399
|
586 |
val pbl = get_obj g_pbl pt''''' (fst p); (writeln o (itms2str thy)) pbl;
|
wneuper@1399
|
587 |
if ocalhd2str ocalhd = ------------^^^^^^^^^^ missing GOON !!!*)
|
wneuper@1399
|
588 |
|
wneuper@1399
|
589 |
(*this input is complete in variant 1 (variant 3 does not work yet)*)
|
wneuper@1399
|
590 |
val (b,pt''''',ocalhd) =
|
wneuper@1399
|
591 |
input_icalhd pt (p,"", [Given ["fixedValues [r=Arbfix]"],
|
wneuper@1399
|
592 |
Find ["maximum A", "valuesFor [a,b]"],
|
wneuper@1399
|
593 |
Relate ["relations [A=a*b, \
|
wneuper@1399
|
594 |
\(a/2)^^^2 + (b/2)^^^2 = r^^^2]"]],
|
wneuper@1399
|
595 |
Pbl, e_spec);
|
wneuper@1399
|
596 |
val pbl = get_obj g_pbl pt''''' (fst p); (writeln o (itms2str thy)) pbl;
|
wneuper@1399
|
597 |
|
wneuper@1399
|
598 |
modifycalcheadOK2xml 111 (bool2str b) ocalhd;
|
wneuper@1399
|
599 |
*) |