walther@59967
|
1 |
(* Title: "Specify/refine.sml"
|
walther@59967
|
2 |
Author: Walther Neuper
|
walther@59967
|
3 |
(c) due to copyright terms
|
walther@59967
|
4 |
*)
|
walther@59967
|
5 |
|
walther@59967
|
6 |
"-----------------------------------------------------------------------------------------------";
|
walther@59967
|
7 |
"table of contents -----------------------------------------------------------------------------";
|
walther@59967
|
8 |
"-----------------------------------------------------------------------------------------------";
|
walther@59967
|
9 |
"refine.thy: store test-pbtyps by 'setup' ------------------------------------------------------";
|
walther@59967
|
10 |
"----------- testdata for refin, Specify.refine_ori --------------------------------------------";
|
walther@59967
|
11 |
(*"----------- refin test-pbtyps -------requires specific 'setup'-------------------------------";*)
|
walther@59967
|
12 |
"----------- Specify.refine_ori test-pbtyps --requires 'setup'----------------------------------";
|
walther@59967
|
13 |
"----------- refine test-pbtyps ------requires 'setup'------------------------------------------";
|
walther@59967
|
14 |
"----------- Refine_Problem (aus subp-rooteq.sml) ----------------------------------------------";
|
walther@59967
|
15 |
"-----------------------------------------------------------------------------------------------";
|
walther@59967
|
16 |
"-----------------------------------------------------------------------------------------------";
|
walther@59967
|
17 |
"-----------------------------------------------------------------------------------------------";
|
walther@59967
|
18 |
|
walther@59967
|
19 |
|
walther@59967
|
20 |
"----------- testdata for refin, Specify.refine_ori --------------------------------------------";
|
walther@59967
|
21 |
"----------- testdata for refin, Specify.refine_ori --------------------------------------------";
|
walther@59967
|
22 |
"----------- testdata for refin, Specify.refine_ori --------------------------------------------";
|
walther@59967
|
23 |
Specify.show_ptyps();
|
walther@59967
|
24 |
val thy = @{theory "Isac_Knowledge"};
|
walther@59967
|
25 |
val ctxt = Proof_Context.init_global @{theory "Isac_Knowledge"};
|
walther@59967
|
26 |
|
walther@59967
|
27 |
(*case 1: no refinement *)
|
walther@59967
|
28 |
val (d1,ts1) = Input_Descript.split ((Thm.term_of o the o (TermC.parse thy)) "fixedValues [aaa = 0]");
|
walther@59967
|
29 |
val (d2,ts2) = Input_Descript.split ((Thm.term_of o the o (TermC.parse thy)) "errorBound (ddd = 0)");
|
walther@59967
|
30 |
val ori1 = [(1,[1],"#Given",d1,ts1), (2,[1],"#Given",d2,ts2)]: O_Model.T;
|
walther@59967
|
31 |
|
walther@59967
|
32 |
(*case 2: refined to pbt without children *)
|
walther@59967
|
33 |
val (d2,ts2) = Input_Descript.split ((Thm.term_of o the o (TermC.parse thy)) "relations [aaa333]");
|
walther@59967
|
34 |
val ori2 = [(1,[1],"#Given",d1,ts1), (2,[1],"#Given",d2,ts2)]:O_Model.T;
|
walther@59967
|
35 |
|
walther@59967
|
36 |
(*case 3: refined to pbt with children *)
|
walther@59967
|
37 |
val (d2,ts2) = Input_Descript.split ((Thm.term_of o the o (TermC.parse thy)) "valuesFor [aaa222]");
|
walther@59967
|
38 |
val ori3 = [(1,[1],"#Given",d1,ts1), (2,[1],"#Given",d2,ts2)]:O_Model.T;
|
walther@59967
|
39 |
|
walther@59967
|
40 |
(*case 4: refined to children (without child)*)
|
walther@59967
|
41 |
val (d3,ts3) = Input_Descript.split ((Thm.term_of o the o (TermC.parse thy)) "boundVariable aaa222yyy");
|
walther@59967
|
42 |
val ori4 = [(1,[1],"#Given",d1,ts1), (2,[1],"#Given",d2,ts2), (3,[1],"#Given",d3,ts3)]:O_Model.T;
|
walther@59967
|
43 |
|
walther@59967
|
44 |
(*=================================================================
|
walther@59967
|
45 |
This test expects pbls at a certain position in the tree.
|
walther@59967
|
46 |
Since parallel evaluation (i.e. Theory_Data) this cannot be expected.
|
walther@59967
|
47 |
Solutions would be
|
walther@59967
|
48 |
* provide an access function for a branch (not only leaves)
|
walther@59967
|
49 |
* sort the tree of pbls.
|
walther@59967
|
50 |
"----------- refin test-pbtyps -------requires specific 'setup'-------------------------------";
|
walther@59967
|
51 |
"----------- refin test-pbtyps -------requires specific 'setup'-------------------------------";
|
walther@59967
|
52 |
"----------- refin test-pbtyps -------requires specific 'setup'-------------------------------";
|
walther@59967
|
53 |
(* fragile test setup: expects ptyps as fixed *)
|
walther@59967
|
54 |
val level_1 = case nth 9 (get_ptyps ()) of
|
walther@59967
|
55 |
Store.Node ("test", _, level_1) => level_1 | _ => error "refin broken: root-branch in ptyps changed?"
|
walther@59967
|
56 |
val level_2 = case nth 4 level_1 of
|
walther@59967
|
57 |
Store.Node ("refine", _, level_2) => level_2 | _ => error "refin broken: lev1-branch in ptyps changed?"
|
walther@59967
|
58 |
val pbla_branch = case level_2 of
|
walther@59967
|
59 |
[Store.Node ("pbla", _, _)] => level_2 | _ => error "refin broken: lev2-branch in ptyps changed?";
|
walther@59967
|
60 |
|
walther@59967
|
61 |
(*case 1: no refinement *)
|
walther@59967
|
62 |
case refin [] ori1 (hd pbla_branch) of
|
walther@59967
|
63 |
SOME ["pbla"] => () | _ => error "refin case 1 broken";
|
walther@59967
|
64 |
|
walther@59967
|
65 |
(*case 2: refined to pbt without children *)
|
walther@59967
|
66 |
case refin [] ori2 (hd pbla_branch) of
|
walther@59967
|
67 |
SOME ["pbla", "pbla3"] => () | _ => error "refin case 2 broken";
|
walther@59967
|
68 |
|
walther@59967
|
69 |
(*case 3: refined to pbt with children *)
|
walther@59967
|
70 |
case refin [] ori3 (hd pbla_branch) of
|
walther@59967
|
71 |
SOME ["pbla", "pbla2"] => () | _ => error "refin case 3 broken";
|
walther@59967
|
72 |
|
walther@59967
|
73 |
(*case 4: refined to children (without child)*)
|
walther@59967
|
74 |
case refin [] ori4 (hd pbla_branch) of
|
walther@59967
|
75 |
SOME ["pbla", "pbla2", "pbla2y"] => () | _ => error "refin case 4 broken";
|
walther@59967
|
76 |
|
walther@59967
|
77 |
(*case 5: start refinement somewhere in ptyps*)
|
walther@59967
|
78 |
val [Store.Node ("pbla",_,[_, ppp as Store.Node ("pbla2",_,_), _])] = pbla_branch;
|
walther@59967
|
79 |
case refin ["pbla"] ori4 ppp of
|
walther@59967
|
80 |
SOME ["pbla", "pbla2", "pbla2y"] => () | _ => error "refin case 5 broken";
|
walther@59967
|
81 |
==================================================================*)
|
walther@59967
|
82 |
|
walther@59967
|
83 |
|
walther@59967
|
84 |
"----------- Specify.refine_ori test-pbtyps --requires 'setup'----------------------------------";
|
walther@59967
|
85 |
"----------- Specify.refine_ori test-pbtyps --requires 'setup'----------------------------------";
|
walther@59967
|
86 |
"----------- Specify.refine_ori test-pbtyps --requires 'setup'----------------------------------";
|
walther@59967
|
87 |
(*case 1: no refinement *)
|
walther@59967
|
88 |
case Specify.refine_ori ori1 ["pbla", "refine", "test"] of
|
walther@59967
|
89 |
NONE => () | _ => error "Specify.refine_ori case 1 broken";
|
walther@59967
|
90 |
|
walther@59967
|
91 |
(*case 2: refined to pbt without children *)
|
walther@59967
|
92 |
case Specify.refine_ori ori2 ["pbla", "refine", "test"] of
|
walther@59967
|
93 |
SOME ["pbla3", "pbla", "refine", "test"] => () | _ => error "Specify.refine_ori case 2 broken";
|
walther@59967
|
94 |
|
walther@59967
|
95 |
(*case 3: refined to pbt with children *)
|
walther@59967
|
96 |
case Specify.refine_ori ori3 ["pbla", "refine", "test"] of
|
walther@59967
|
97 |
SOME ["pbla2", "pbla", "refine", "test"] => () | _ => error "Specify.refine_ori case 3 broken";
|
walther@59967
|
98 |
|
walther@59967
|
99 |
(*case 4: refined to children (without child)*)
|
walther@59967
|
100 |
case Specify.refine_ori ori4 ["pbla", "refine", "test"] of
|
walther@59967
|
101 |
SOME ["pbla2y","pbla2","pbla", "refine", "test"] => () | _ => error "Specify.refine_ori case 4 broken";
|
walther@59967
|
102 |
|
walther@59967
|
103 |
(*case 5: start refinement somewhere in ptyps*)
|
walther@59967
|
104 |
case Specify.refine_ori ori4 ["pbla2","pbla", "refine", "test"] of
|
walther@59967
|
105 |
SOME ["pbla2y", "pbla2", "pbla", "refine", "test"] => () | _ => error "Specify.refine_ori case 5 broken";
|
walther@59967
|
106 |
|
walther@59967
|
107 |
|
walther@59967
|
108 |
"----------- refine test-pbtyps ------requires 'setup'------------------------------------------";
|
walther@59967
|
109 |
"----------- refine test-pbtyps ------requires 'setup'------------------------------------------";
|
walther@59967
|
110 |
"----------- refine test-pbtyps ------requires 'setup'------------------------------------------";
|
walther@59967
|
111 |
val fmz1 = ["fixedValues [aaa=0]","errorBound (ddd=0)"];
|
walther@59967
|
112 |
val fmz2 = ["fixedValues [aaa=0]","relations aaa333"];
|
walther@59967
|
113 |
val fmz3 = ["fixedValues [aaa=0]","valuesFor [aaa222]"];
|
walther@59967
|
114 |
val fmz4 = ["fixedValues [aaa=0]","valuesFor [aaa222]",
|
walther@59967
|
115 |
"boundVariable aaa222yyy"];
|
walther@59967
|
116 |
|
walther@59967
|
117 |
(*case 1: no refinement *)
|
walther@59967
|
118 |
case Specify.refine fmz1 ["pbla", "refine", "test"] of
|
walther@59967
|
119 |
[Model.Matches (["pbla", "refine", "test"], _),
|
walther@59967
|
120 |
Model.NoMatch (["pbla1", "pbla", "refine", "test"], _),
|
walther@59967
|
121 |
Model.NoMatch (["pbla2", "pbla", "refine", "test"], _),
|
walther@59967
|
122 |
Model.NoMatch (["pbla3", "pbla", "refine", "test"], _)] => ()
|
walther@59967
|
123 |
| _ => error "--- Specify.refine test-pbtyps --- broken with case 1";
|
walther@59967
|
124 |
(*
|
walther@59967
|
125 |
*** pass ["pbla"]
|
walther@59967
|
126 |
*** pass ["pbla","pbla1"]
|
walther@59967
|
127 |
*** pass ["pbla","pbla2"]
|
walther@59967
|
128 |
*** pass ["pbla","pbla3"]
|
walther@59967
|
129 |
val it =
|
walther@59967
|
130 |
[Model.Matches
|
walther@59967
|
131 |
(["pbla"],
|
walther@59967
|
132 |
{Find=[],
|
walther@59967
|
133 |
Given=[Correct "fixedValues [aaa = #0]",
|
walther@59967
|
134 |
Superfl "errorBound (ddd = #0)"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
135 |
Model.NoMatch
|
walther@59967
|
136 |
(["pbla1","pbla"],
|
walther@59967
|
137 |
{Find=[],
|
walther@59967
|
138 |
Given=[Correct "fixedValues [aaa = #0]",Missing "maximum a1_",
|
walther@59967
|
139 |
Superfl "errorBound (ddd = #0)"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
140 |
Model.NoMatch
|
walther@59967
|
141 |
(["pbla2","pbla"],
|
walther@59967
|
142 |
{Find=[],
|
walther@59967
|
143 |
Given=[Correct "fixedValues [aaa = #0]",Missing "valuesFor a2_",
|
walther@59967
|
144 |
Superfl "errorBound (ddd = #0)"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
145 |
Model.NoMatch
|
walther@59967
|
146 |
(["pbla3","pbla"],
|
walther@59967
|
147 |
{Find=[],
|
walther@59967
|
148 |
Given=[Correct "fixedValues [aaa = #0]",Missing "relations a3_",
|
walther@59967
|
149 |
Superfl "errorBound (ddd = #0)"],Relate=[],Where=[],With=[]})]
|
walther@59967
|
150 |
: match list*)
|
walther@59967
|
151 |
|
walther@59967
|
152 |
(*case 2: refined to pbt without children *)
|
walther@59967
|
153 |
case Specify.refine fmz2 ["pbla", "refine", "test"] of
|
walther@59967
|
154 |
[Model.Matches (["pbla", "refine", "test"], _),
|
walther@59967
|
155 |
Model.NoMatch (["pbla1", "pbla", "refine", "test"], _),
|
walther@59967
|
156 |
Model.NoMatch (["pbla2", "pbla", "refine", "test"], _),
|
walther@59967
|
157 |
Model.Matches (["pbla3", "pbla", "refine", "test"], _)] => ()
|
walther@59967
|
158 |
| _ => error "--- Specify.refine test-pbtyps --- broken with case 2";
|
walther@59967
|
159 |
(*
|
walther@59967
|
160 |
*** pass ["pbla"]
|
walther@59967
|
161 |
*** pass ["pbla","pbla1"]
|
walther@59967
|
162 |
*** pass ["pbla","pbla2"]
|
walther@59967
|
163 |
*** pass ["pbla","pbla3"]
|
walther@59967
|
164 |
val it =
|
walther@59967
|
165 |
[Model.Matches
|
walther@59967
|
166 |
(["pbla"],
|
walther@59967
|
167 |
{Find=[],
|
walther@59967
|
168 |
Given=[Correct "fixedValues [aaa = #0]",Superfl "relations aaa333"],
|
walther@59967
|
169 |
Relate=[],Where=[],With=[]}),
|
walther@59967
|
170 |
Model.NoMatch
|
walther@59967
|
171 |
(["pbla1","pbla"],
|
walther@59967
|
172 |
{Find=[],
|
walther@59967
|
173 |
Given=[Correct "fixedValues [aaa = #0]",Missing "maximum a1_",
|
walther@59967
|
174 |
Superfl "relations aaa333"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
175 |
Model.NoMatch
|
walther@59967
|
176 |
(["pbla2","pbla"],
|
walther@59967
|
177 |
{Find=[],
|
walther@59967
|
178 |
Given=[Correct "fixedValues [aaa = #0]",Missing "valuesFor a2_",
|
walther@59967
|
179 |
Superfl "relations aaa333"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
180 |
Model.Matches
|
walther@59967
|
181 |
(["pbla3","pbla"],
|
walther@59967
|
182 |
{Find=[],
|
walther@59967
|
183 |
Given=[Correct "fixedValues [aaa = #0]",Correct "relations aaa333"],
|
walther@59967
|
184 |
Relate=[],Where=[],With=[]})] : match list*)
|
walther@59967
|
185 |
|
walther@59967
|
186 |
(*case 3: refined to pbt with children *)
|
walther@59967
|
187 |
case Specify.refine fmz3 ["pbla", "refine", "test"] of
|
walther@59967
|
188 |
[Model.Matches (["pbla", "refine", "test"], _),
|
walther@59967
|
189 |
Model.NoMatch (["pbla1", "pbla", "refine", "test"], _),
|
walther@59967
|
190 |
Model.Matches (["pbla2", "pbla", "refine", "test"], _),
|
walther@59967
|
191 |
Model.NoMatch (["pbla2x", "pbla2", "pbla", "refine", "test"], _),
|
walther@59967
|
192 |
Model.NoMatch (["pbla2y", "pbla2", "pbla", "refine", "test"], _),
|
walther@59967
|
193 |
Model.NoMatch (["pbla2z", "pbla2", "pbla", "refine", "test"], _),
|
walther@59967
|
194 |
Model.NoMatch (["pbla3", "pbla", "refine", "test"], _)] => ()
|
walther@59967
|
195 |
| _ => error "--- Specify.refine test-pbtyps --- broken with case 3";
|
walther@59967
|
196 |
(*
|
walther@59967
|
197 |
*** pass ["pbla"]
|
walther@59967
|
198 |
*** pass ["pbla","pbla1"]
|
walther@59967
|
199 |
*** pass ["pbla","pbla2"]
|
walther@59967
|
200 |
*** pass ["pbla","pbla2","pbla2x"]
|
walther@59967
|
201 |
*** pass ["pbla","pbla2","pbla2y"]
|
walther@59967
|
202 |
*** pass ["pbla","pbla2","pbla2z"]
|
walther@59967
|
203 |
*** pass ["pbla","pbla3"]
|
walther@59967
|
204 |
val it =
|
walther@59967
|
205 |
[Model.Matches
|
walther@59967
|
206 |
(["pbla"],
|
walther@59967
|
207 |
{Find=[],
|
walther@59967
|
208 |
Given=[Correct "fixedValues [aaa = #0]",Superfl "valuesFor aaa222"],
|
walther@59967
|
209 |
Relate=[],Where=[],With=[]}),
|
walther@59967
|
210 |
Model.NoMatch
|
walther@59967
|
211 |
(["pbla1","pbla"],
|
walther@59967
|
212 |
{Find=[],
|
walther@59967
|
213 |
Given=[Correct "fixedValues [aaa = #0]",Missing "maximum a1_",
|
walther@59967
|
214 |
Superfl "valuesFor aaa222"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
215 |
Model.Matches
|
walther@59967
|
216 |
(["pbla2","pbla"],
|
walther@59967
|
217 |
{Find=[],
|
walther@59967
|
218 |
Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222"],
|
walther@59967
|
219 |
Relate=[],Where=[],With=[]}),
|
walther@59967
|
220 |
Model.NoMatch
|
walther@59967
|
221 |
(["pbla2x","pbla2","pbla"],
|
walther@59967
|
222 |
{Find=[],
|
walther@59967
|
223 |
Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
|
walther@59967
|
224 |
Missing "functionOf a2x_"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
225 |
Model.NoMatch
|
walther@59967
|
226 |
(["pbla2y","pbla2","pbla"],
|
walther@59967
|
227 |
{Find=[],
|
walther@59967
|
228 |
Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
|
walther@59967
|
229 |
Missing "boundVariable a2y_"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
230 |
Model.NoMatch
|
walther@59967
|
231 |
(["pbla2z","pbla2","pbla"],
|
walther@59967
|
232 |
{Find=[],
|
walther@59967
|
233 |
Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
|
walther@59967
|
234 |
Missing "interval a2z_"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
235 |
Model.NoMatch
|
walther@59967
|
236 |
(["pbla3","pbla"],
|
walther@59967
|
237 |
{Find=[],
|
walther@59967
|
238 |
Given=[Correct "fixedValues [aaa = #0]",Missing "relations a3_",
|
walther@59967
|
239 |
Superfl "valuesFor aaa222"],Relate=[],Where=[],With=[]})]
|
walther@59967
|
240 |
: match list*)
|
walther@59967
|
241 |
|
walther@59967
|
242 |
(*case 4: refined to children (without child)*)
|
walther@59967
|
243 |
case Specify.refine fmz4 ["pbla", "refine", "test"] of
|
walther@59967
|
244 |
[Model.Matches (["pbla", "refine", "test"], _),
|
walther@59967
|
245 |
Model.NoMatch (["pbla1", "pbla", "refine", "test"], _),
|
walther@59967
|
246 |
Model.Matches (["pbla2", "pbla", "refine", "test"], _),
|
walther@59967
|
247 |
Model.NoMatch (["pbla2x", "pbla2", "pbla", "refine", "test"], _),
|
walther@59967
|
248 |
Model.Matches (["pbla2y", "pbla2", "pbla", "refine", "test"], _)] => ()
|
walther@59967
|
249 |
| _ => error "--- Specify.refine test-pbtyps --- broken with case 4";
|
walther@59967
|
250 |
(*
|
walther@59967
|
251 |
*** pass ["pbla"]
|
walther@59967
|
252 |
*** pass ["pbla","pbla1"]
|
walther@59967
|
253 |
*** pass ["pbla","pbla2"]
|
walther@59967
|
254 |
*** pass ["pbla","pbla2","pbla2x"]
|
walther@59967
|
255 |
*** pass ["pbla","pbla2","pbla2y"]
|
walther@59967
|
256 |
val it =
|
walther@59967
|
257 |
[Model.Matches
|
walther@59967
|
258 |
(["pbla"],
|
walther@59967
|
259 |
{Find=[],
|
walther@59967
|
260 |
Given=[Correct "fixedValues [aaa = #0]",Superfl "valuesFor aaa222",
|
walther@59967
|
261 |
Superfl "boundVariable aaa222yyy"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
262 |
Model.NoMatch
|
walther@59967
|
263 |
(["pbla1","pbla"],
|
walther@59967
|
264 |
{Find=[],
|
walther@59967
|
265 |
Given=[Correct "fixedValues [aaa = #0]",Missing "maximum a1_",
|
walther@59967
|
266 |
Superfl "valuesFor aaa222",Superfl "boundVariable aaa222yyy"],
|
walther@59967
|
267 |
Relate=[],Where=[],With=[]}),
|
walther@59967
|
268 |
Model.Matches
|
walther@59967
|
269 |
(["pbla2","pbla"],
|
walther@59967
|
270 |
{Find=[],
|
walther@59967
|
271 |
Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
|
walther@59967
|
272 |
Superfl "boundVariable aaa222yyy"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
273 |
Model.NoMatch
|
walther@59967
|
274 |
(["pbla2x","pbla2","pbla"],
|
walther@59967
|
275 |
{Find=[],
|
walther@59967
|
276 |
Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
|
walther@59967
|
277 |
Missing "functionOf a2x_",Superfl "boundVariable aaa222yyy"],
|
walther@59967
|
278 |
Relate=[],Where=[],With=[]}),
|
walther@59967
|
279 |
Model.Matches
|
walther@59967
|
280 |
(["pbla2y","pbla2","pbla"],
|
walther@59967
|
281 |
{Find=[],
|
walther@59967
|
282 |
Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
|
walther@59967
|
283 |
Correct "boundVariable aaa222yyy"],Relate=[],Where=[],With=[]})]
|
walther@59967
|
284 |
: match list*)
|
walther@59967
|
285 |
|
walther@59967
|
286 |
(*case 5: start refinement somewhere in ptyps*)
|
walther@59967
|
287 |
case Specify.refine fmz4 ["pbla2","pbla", "refine", "test"] of
|
walther@59967
|
288 |
[Model.Matches (["pbla2", "pbla", "refine", "test"], _),
|
walther@59967
|
289 |
Model.NoMatch (["pbla2x", "pbla2", "pbla", "refine", "test"], _),
|
walther@59967
|
290 |
Model.Matches (["pbla2y", "pbla2", "pbla", "refine", "test"], _)] => ()
|
walther@59967
|
291 |
| _ => error "--- Specify.refine test-pbtyps --- broken with case 5";
|
walther@59967
|
292 |
(*
|
walther@59967
|
293 |
*** pass ["pbla","pbla2"]
|
walther@59967
|
294 |
*** pass ["pbla","pbla2","pbla2x"]
|
walther@59967
|
295 |
*** pass ["pbla","pbla2","pbla2y"]
|
walther@59967
|
296 |
val it =
|
walther@59967
|
297 |
[Model.Matches
|
walther@59967
|
298 |
(["pbla2","pbla"],
|
walther@59967
|
299 |
{Find=[],
|
walther@59967
|
300 |
Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
|
walther@59967
|
301 |
Superfl "boundVariable aaa222yyy"],Relate=[],Where=[],With=[]}),
|
walther@59967
|
302 |
Model.NoMatch
|
walther@59967
|
303 |
(["pbla2x","pbla2","pbla"],
|
walther@59967
|
304 |
{Find=[],
|
walther@59967
|
305 |
Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
|
walther@59967
|
306 |
Missing "functionOf a2x_",Superfl "boundVariable aaa222yyy"],
|
walther@59967
|
307 |
Relate=[],Where=[],With=[]}),
|
walther@59967
|
308 |
Model.Matches
|
walther@59967
|
309 |
(["pbla2y","pbla2","pbla"],
|
walther@59967
|
310 |
{Find=[],
|
walther@59967
|
311 |
Given=[Correct "fixedValues [aaa = #0]",Correct "valuesFor aaa222",
|
walther@59967
|
312 |
Correct "boundVariable aaa222yyy"],Relate=[],Where=[],With=[]})]
|
walther@59967
|
313 |
: match list*)
|
walther@59967
|
314 |
|
walther@59967
|
315 |
|
walther@59967
|
316 |
"----------- Refine_Problem (aus subp-rooteq.sml) ----------------------------------------------";
|
walther@59967
|
317 |
"----------- Refine_Problem (aus subp-rooteq.sml) ----------------------------------------------";
|
walther@59967
|
318 |
"----------- Refine_Problem (aus subp-rooteq.sml) ----------------------------------------------";
|
walther@59967
|
319 |
val c = [];
|
walther@59967
|
320 |
val fmz = ["equality ((x+1)*(x+2)=x^^^2+(8::real))","solveFor x",
|
walther@59967
|
321 |
"errorBound (eps=0)","solutions L"];
|
walther@59967
|
322 |
val (dI',pI',mI') = ("Test",["sqroot-test","univariate","equation","test"],
|
walther@59967
|
323 |
["Test","squ-equ-test-subpbl1"]);
|
walther@59967
|
324 |
(*[], Pbl*)val (p,_,f,nxt,_,pt) = Test_Code.CalcTreeTEST [(fmz, (dI',pI',mI'))];
|
walther@59967
|
325 |
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
326 |
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
327 |
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*\<rightarrow>Add_Find "solutions L"*)
|
walther@59967
|
328 |
|
walther@59967
|
329 |
(*=== specify a not-matching problem ---vvvvvvvvvvvvvvvvvvvvvvvvvvvv*)
|
walther@59967
|
330 |
val nxt = (Specify_Problem ["LINEAR","univariate","equation","test"]);
|
walther@59967
|
331 |
(*=== specify a not-matching problem ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^*)
|
walther@59967
|
332 |
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*\<rightarrow>Add_Find "solutions L"*)
|
walther@59967
|
333 |
|
walther@59967
|
334 |
val www =
|
walther@59967
|
335 |
case f of Test_Out.PpcKF (Test_Out.Problem [],
|
walther@59967
|
336 |
{Find = [Incompl "solutions []"], With = [],
|
walther@59967
|
337 |
Given = [Correct "equality ((x + 1) * (x + 2) = x ^^^ 2 + 8)", Correct "solveFor x"],
|
walther@59967
|
338 |
Where = [False www(*! ! ! ! ! !*)],
|
walther@59967
|
339 |
Relate = [],...}) => www(*! ! !*)
|
walther@59967
|
340 |
| _ => error "--- Refine_Problem broken 1";
|
walther@59967
|
341 |
if www = "matches (x = 0) ((x + 1) * (x + 2) = x ^^^ 2 + 8) \<or>\nmatches (?b * x = 0) ((x + 1) * (x + 2) = x ^^^ 2 + 8) \<or>\nmatches (?a + x = 0) ((x + 1) * (x + 2) = x ^^^ 2 + 8) \<or>\nmatches (?a + ?b * x = 0) ((x + 1) * (x + 2) = x ^^^ 2 + 8)"
|
walther@59967
|
342 |
then () else error "--- Refine_Problem broken 2";
|
walther@59967
|
343 |
(*ML> f;
|
walther@59967
|
344 |
val it = Form' (Test_Out.PpcKF (0,EdUndef,0,Nundef,
|
walther@59967
|
345 |
(Problem ["LINEAR","univariate","equation","test"], <<<<<===== diff.to above WN120313
|
walther@59967
|
346 |
{Find=[Incompl "solutions []"],
|
walther@59967
|
347 |
Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
|
walther@59967
|
348 |
Correct "solveFor x"],Relate=[],
|
walther@59967
|
349 |
Where=[False "matches (x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)
|
walther@59967
|
350 |
|\nmatches (?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)
|
walther@59967
|
351 |
|\nmatches (?a + x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)
|
walther@59967
|
352 |
|\nmatches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
|
walther@59967
|
353 |
With=[]}))) : mout
|
walther@59967
|
354 |
*)
|
walther@59967
|
355 |
|
walther@59967
|
356 |
(*[], Pbl*)val (p,_,f,nxt,_,pt) = (me nxt p c pt) (*Empty_Tac ?!?*);
|
walther@59967
|
357 |
|
walther@59967
|
358 |
(*=== refine problem -----vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*)
|
walther@59967
|
359 |
val nxt = (Refine_Problem ["univariate","equation","test"]);
|
walther@59967
|
360 |
(*=== refine problem -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*)
|
walther@59967
|
361 |
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
362 |
(*("Specify_Problem", Specify_Problem ["normalise", "univariate", ...])*)
|
walther@59967
|
363 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
364 |
(*nxt = ("Specify_Theory", Specify_Theory "Test")*)
|
walther@59967
|
365 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
366 |
(*nxt = ("Specify_Method", Specify_Method ["Test", "squ-equ-test-subpbl1"]*)
|
walther@59967
|
367 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
368 |
(*nxt = ("Apply_Method", *)
|
walther@59967
|
369 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
370 |
(*nxt = ("Rewrite_Set", Rewrite_Set "norm_equation")*)
|
walther@59967
|
371 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
372 |
(*nxt = ("Rewrite_Set", Rewrite_Set "Test_simplify")*)
|
walther@59967
|
373 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
374 |
(*Subproblem ("Test", ["LINEAR", "univariate", "equation", "test"]*)
|
walther@59967
|
375 |
|
walther@59967
|
376 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
377 |
(*nxt = Model_Problem ["LINEAR","univariate","equation","test"]*)
|
walther@59967
|
378 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
379 |
(*nxt = ("Add_Given", Add_Given "equality (-6 + 3 * x = 0)"*)
|
walther@59967
|
380 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
381 |
(**)
|
walther@59967
|
382 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
383 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
384 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
385 |
(*nxt = Specify_Problem ["LINEAR","univariate","equation","test"])*)
|
walther@59967
|
386 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
387 |
(*xt = ("Specify_Method", Specify_Method ["Test", "solve_linear"])*)
|
walther@59967
|
388 |
val nxt = (Refine_Problem ["univariate","equation","test"]);
|
walther@59967
|
389 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
390 |
(*("Specify_Problem", Specify_Problem ["LINEAR", "univariate", ...])*)
|
walther@59967
|
391 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
392 |
(*val nxt = ("Specify_Method",Specify_Method ("Test","solve_linear"))*)
|
walther@59967
|
393 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
394 |
(*val nxt = ("Apply_Method",Apply_Method ("Test","solve_linear"))*)
|
walther@59967
|
395 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
396 |
(*val nxt = ("Rewrite_Set_Inst",Rewrite_Set_Inst ([#],"isolate_bdv"))*)
|
walther@59967
|
397 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
398 |
(*val nxt = ("Rewrite_Set",Rewrite_Set "Test_simplify")*)
|
walther@59967
|
399 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
400 |
(*val nxt = ("Check_Postcond",Check_Postcond ["LINEAR","univariate","eq*)
|
walther@59967
|
401 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
402 |
(*val nxt = ("Check_elementwise",Check_elementwise "Assumptions")*)
|
walther@59967
|
403 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
404 |
(*Check_Postcond ["normalise","univariate","equation","test"])*)
|
walther@59967
|
405 |
val (p,_,f,nxt,_,pt) = me nxt p c pt;
|
walther@59967
|
406 |
val Test_Out.FormKF res = f;
|
walther@59967
|
407 |
|
walther@59967
|
408 |
if res = "[x = 2]"
|
walther@59967
|
409 |
then case nxt of End_Proof' => ()
|
walther@59967
|
410 |
| _ => error "new behaviour in test:refine.sml:miniscript with mini-subpb 1"
|
walther@59967
|
411 |
else error "new behaviour in test:refine.sml:miniscript with mini-subpb 2"
|
walther@59967
|
412 |
|