Test_Isac works again, almost ..
4 files raise errors:
# Interpret/solve.sml: "solve.sml: interSteps on norm_Rational 2"
# Interpret/inform.sml: "inform.sml: [rational,simplification] 2"
# Knowledge/partial_fractions.sml: "autoCalculate for met_partial_fraction changed: final result"
# Knowledge/eqsystem.sml: "eqsystem.sml: exp 7.70 normalize 4x4 by rewrite changed"
The chunk of changes is due to the fact, that Isac's code still is unstable.
The changes are accumulated since e8f46493af82.
1 (* tests on systems of equations
2 author: Walther Neuper 050826,
3 (c) due to copyright terms
6 trace_rewrite := false;
7 "-----------------------------------------------------------------";
8 "table of contents -----------------------------------------------";
9 "-----------------------------------------------------------------";
10 "----------- occur_exactly_in ------------------------------------";
11 "----------- problems --------------------------------------------";
12 "----------- rewrite-order ord_simplify_System -------------------";
13 "----------- rewrite in [EqSystem,normalize,2x2] -----------------";
14 "----------- rewrite example from 2nd [EqSystem,normalize,2x2] ---";
15 "----------- rewrite in [EqSystem,top_down_substitution,2x2] -----";
16 "----------- rewrite in [EqSystem,normalize,4x4] -----------------";
17 "----------- script [EqSystem,top_down_substitution,2x2] Vers.1 --";
18 "----------- refine [linear,system]-------------------------------";
19 "----------- refine [2x2,linear,system] search error--------------";
20 "----------- me [EqSystem,normalize,2x2] -------------------------";
21 "----------- me [linear,system] ..normalize..top_down_sub..-------";
22 "----------- all systems from Biegelinie -------------------------";
23 "----------- 4x4 systems from Biegelinie -------------------------";
24 "-----------------------------------------------------------------";
25 "-----------------------------------------------------------------";
26 "-----------------------------------------------------------------";
28 val thy = @{theory "EqSystem"};
29 val ctxt = Proof_Context.init_global thy;
31 "----------- occur_exactly_in ------------------------------------";
32 "----------- occur_exactly_in ------------------------------------";
33 "----------- occur_exactly_in ------------------------------------";
34 val all = [str2term"c", str2term"c_2", str2term"c_3"];
35 val t = str2term"0 = -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2";
37 if occur_exactly_in [str2term"c", str2term"c_2"] all t
38 then () else error "eqsystem.sml occur_exactly_in 1";
40 if not (occur_exactly_in [str2term"c", str2term"c_2", str2term"c_3"] all t)
41 then () else error "eqsystem.sml occur_exactly_in 2";
43 if not (occur_exactly_in [str2term"c_2"] all t)
44 then () else error "eqsystem.sml occur_exactly_in 3";
46 val t = str2term"[c,c_2] from [c,c_2,c_3] occur_exactly_in -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2";
47 eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48 val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
49 if str = "[c, c_2] from [c, c_2,\n" ^
50 " c_3] occur_exactly_in -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2 = True"
51 then () else error "eval_occur_exactly_in [c, c_2]";
53 val t = str2term ("[c,c_2,c_3] from [c,c_2,c_3] occur_exactly_in " ^
54 "-1 * q_0 * L ^^^ 2 / 2 + L * c + c_2");
55 val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
56 if str = "[c, c_2,\n c_3] from [c, c_2,\n" ^
57 " c_3] occur_exactly_in -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2 = False"
58 then () else error "eval_occur_exactly_in [c, c_2, c_3]";
60 val t = str2term"[c_2] from [c,c_2,c_3] occur_exactly_in \
61 \-1 * q_0 * L ^^^ 2 / 2 + L * c + c_2";
62 val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
63 if str = "[c_2] from [c, c_2,\n" ^
64 " c_3] occur_exactly_in -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2 = False"
65 then () else error "eval_occur_exactly_in [c, c_2, c_3]";
67 val t = str2term"[] from [c,c_2,c_3] occur_exactly_in 0";
68 val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
69 if str = "[] from [c, c_2, c_3] occur_exactly_in 0 = True" then ()
70 else error "eval_occur_exactly_in [c, c_2, c_3]";
74 "[] from [c, c_2, c_3, c_4] occur_exactly_in -1 * (q_0 * L ^^^ 2) /2";
75 val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
76 if str = "[] from [c, c_2, c_3, c_4] occur_exactly_in \
77 \-1 * (q_0 * L ^^^ 2) / 2 = True" then ()
78 else error "eval_occur_exactly_in [c, c_2, c_3, c_4]";
80 "----------- problems --------------------------------------------";
81 "----------- problems --------------------------------------------";
82 "----------- problems --------------------------------------------";
83 val t = str2term "LENGTH [x+y=1,y=2] = 2";
85 val testrls = append_rls "testrls" e_rls
86 [(Thm ("LENGTH_NIL",num_str @{thm LENGTH_NIL})),
87 (Thm ("LENGTH_CONS",num_str @{thm LENGTH_CONS})),
88 Calc ("Groups.plus_class.plus", eval_binop "#add_"),
89 Calc ("HOL.eq",eval_equal "#equal_")
91 val SOME (t',_) = rewrite_set_ thy false testrls t;
92 if term2str t' = "True" then ()
93 else error "eqsystem.sml: length_ [x+y=1,y=2] = 2";
95 val SOME t = parse thy "solution LL";
97 val SOME t = parse thy "solution LL";
101 "(tl (tl (tl v_s))) from v_s occur_exactly_in (NTH 1 (e_s::bool list))";
103 val t = str2term ("(tl (tl (tl [c, c_2, c_3, c_4]))) from [c, c_2, c_3, c_4] occur_exactly_in " ^
104 "(NTH 1 [c_4 = 1, 2 = 2, 3 = 3, 4 = 4])");
106 rewrite_set_ thy true
107 (append_rls "prls_" e_rls
108 [Thm ("NTH_CONS",num_str @{thm NTH_CONS}),
109 Thm ("NTH_NIL",num_str @{thm NTH_NIL}),
110 Thm ("TL_CONS",num_str @{thm tl_Cons}),
111 Thm ("TL_NIL",num_str @{thm tl_Nil}),
112 Calc ("EqSystem.occur'_exactly'_in", eval_occur_exactly_in "#eval_occur_exactly_in_")
114 if t = @{term True} then ()
115 else error "eqsystem.sml ..occur_exactly_in (nth_ 1 [c_4..";
117 "----------- rewrite-order ord_simplify_System -------------------";
118 "----------- rewrite-order ord_simplify_System -------------------";
119 "----------- rewrite-order ord_simplify_System -------------------";
120 "M_b x = c * x + -1 * q_0 * (x ^^^ 2 / 2) + c_2";
121 "--- add_commute ---";
122 if ord_simplify_System false thy [] (str2term"-1 * q_0 * (x ^^^ 2 / 2)",
123 str2term"c * x") then ()
124 else error "integrate.sml, (-1 * q_0 * (x ^^^ 2 / 2)) < (c * x) not#1";
126 if ord_simplify_System false thy [] (str2term"-1 * q_0 * (x ^^^ 2 / 2)",
127 str2term"c_2") then ()
128 else error "integrate.sml, (-1 * q_0 * (x ^^^ 2 / 2)) < (c_2) not#2";
130 if ord_simplify_System false thy [] (str2term"c * x",
131 str2term"c_2") then ()
132 else error "integrate.sml, (c * x) < (c_2) not#3";
134 "--- mult_commute ---";
135 if ord_simplify_System false thy [] (str2term"x * c",
136 str2term"c * x") then ()
137 else error "integrate.sml, (x * c) < (c * x) not#4";
139 if ord_simplify_System false thy [] (str2term"-1 * q_0 * (x ^^^ 2 / 2) * c",
140 str2term"-1 * q_0 * c * (x ^^^ 2 / 2)")
141 then () else error "integrate.sml, (. * .) < (. * .) not#5";
143 if ord_simplify_System false thy [] (str2term"-1 * q_0 * (x ^^^ 2 / 2) * c",
144 str2term"c * -1 * q_0 * (x ^^^ 2 / 2)")
145 then () else error "integrate.sml, (. * .) < (. * .) not#6";
148 "----------- rewrite in [EqSystem,normalize,2x2] -----------------";
149 "----------- rewrite in [EqSystem,normalize,2x2] -----------------";
150 "----------- rewrite in [EqSystem,normalize,2x2] -----------------";
151 val t = str2term"[0 = -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2,\
152 \0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2]";
153 val bdvs = [(str2term"bdv_1",str2term"c"),
154 (str2term"bdv_2",str2term"c_2")];
155 val SOME(t,_)= rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
156 if term2str t = "[0 = -1 * q_0 * L ^^^ 2 / 2 + (L * c + c_2), 0 = c_2]"
157 then () else error "eqsystem.sml rewrite in 2x2 simplify_System_par.1";
159 val SOME (t,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs t;
160 if term2str t = "[L * c + c_2 = 0 + -1 * (-1 * q_0 * L ^^^ 2 / 2), c_2 = 0]"then () else error "eqsystem.sml rewrite in 2x2 isolate_bdvs";
162 val SOME(t,_)= rewrite_set_inst_ thy true bdvs simplify_System t;
163 if term2str t = "[L * c + c_2 = q_0 * L ^^^ 2 / 2, c_2 = 0]"
164 then () else error "eqsystem.sml rewrite in 2x2 simplify_System_par.2";
166 "--- 3--- see EqSystem.thy (*..if replaced by 'and' ...";
167 val SOME (t,_) = rewrite_set_ thy true order_system t;
168 if term2str t = "[c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]"
169 then () else error "eqsystem.sml rewrite in 2x2 simplify_System_par.3";
172 "----------- rewrite example from 2nd [EqSystem,normalize,2x2] ---";
173 "----------- rewrite example from 2nd [EqSystem,normalize,2x2] ---";
174 "----------- rewrite example from 2nd [EqSystem,normalize,2x2] ---";
175 val thy = @{theory "Isac"} (*because of Undeclared constant "Biegelinie.EI*);
177 str2term"[0 = c_2 + c * 0 + 1 / EI * (L * q_0 / 12 * 0 ^^^ 3 + \
178 \ -1 * q_0 / 24 * 0 ^^^ 4),\
179 \ 0 = c_2 + c * L + 1 / EI * (L * q_0 / 12 * L ^^^ 3 + \
180 \ -1 * q_0 / 24 * L ^^^ 4)]";
181 val SOME (t,_) = rewrite_set_ thy true norm_Rational t;
182 if term2str t="[0 = c_2, 0 = c_2 + L * c + L ^^^ 4 * q_0 / (EI * 24)]"
183 then () else error "eqsystem.sml rewrite in 2x2 simplify_System_par.0b";
185 val SOME(t,_)= rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
186 if term2str t = "[0 = c_2, 0 = q_0 * L ^^^ 4 / (24 * EI) + (L * c + c_2)]"
187 then () else error "eqsystem.sml rewrite in 2x2 simplify_System_par.1b";
189 val SOME (t,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs t;
190 if term2str t = "[c_2 = 0, L * c + c_2 = 0 + -1 * (q_0 * L ^^^ 4 / (24 * EI))]"
191 then () else error "eqsystem.sml rewrite in 2x2 isolate_bdvs b";
193 val SOME(t,_)= rewrite_set_inst_ thy true bdvs simplify_System t;
194 if term2str t = "[c_2 = 0, L * c + c_2 = -1 * q_0 * L ^^^ 4 / (24 * EI)]"
195 then () else error "eqsystem.sml rewrite in 2x2 simplify_System.2b";
197 val xxx = rewrite_set_ thy true order_system t;
199 then () else error "eqsystem.sml rewrite in 2x2 simplify_System.3b";
202 "----------- rewrite in [EqSystem,top_down_substitution,2x2] -----";
203 "----------- rewrite in [EqSystem,top_down_substitution,2x2] -----";
204 "----------- rewrite in [EqSystem,top_down_substitution,2x2] -----";
205 val e1__ = str2term "c_2 = 77";
206 val e2__ = str2term "L * c + c_2 = q_0 * L ^^^ 2 / 2";
207 val bdvs = [(str2term"bdv_1",str2term"c"),
208 (str2term"bdv_2",str2term"c_2")];
209 val SOME (e2__,_) = rewrite_terms_ thy dummy_ord Erls [e1__] e2__;
210 if term2str e2__ = "L * c + 77 = q_0 * L ^^^ 2 / 2" then ()
211 else error "eqsystem.sml top_down_substitution,2x2] subst";
214 rewrite_set_inst_ thy true bdvs simplify_System_parenthesized e2__;
215 if term2str e2__ = "77 + L * c = q_0 * L ^^^ 2 / 2" then ()
216 else error "eqsystem.sml top_down_substitution,2x2] simpl_par";
218 val SOME (e2__,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs e2__;
219 if term2str e2__ = "c = (q_0 * L ^^^ 2 / 2 + -1 * 77) / L" then ()
220 else error "eqsystem.sml top_down_substitution,2x2] isolate";
222 val t = str2term "[c_2 = 77, c = (q_0 * L ^^^ 2 / 2 + -1 * 77) / L]";
223 val SOME (t,_) = rewrite_set_ thy true order_system t;
224 if term2str t = "[c = (q_0 * L ^^^ 2 / 2 + -1 * 77) / L, c_2 = 77]" then ()
225 else error "eqsystem.sml top_down_substitution,2x2] order_system";
227 if not (ord_simplify_System
229 (str2term"[c_2 = 77, c = (q_0 * L ^^^ 2 / 2 + -1 * 77) / L]",
230 str2term"[c = (q_0 * L ^^^ 2 / 2 + -1 * 77) / L, c_2 = 77]"))
231 then () else error "eqsystem.sml, order_result rew_ord";
234 trace_rewrite:=false;
237 "----------- rewrite in [EqSystem,normalize,4x4] -----------------";
238 "----------- rewrite in [EqSystem,normalize,4x4] -----------------";
239 "----------- rewrite in [EqSystem,normalize,4x4] -----------------";
240 (*STOPPED.WN06?: revise rewrite in [EqSystem,normalize,4x4] from before 0609*)
241 val t = str2term"[0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c_3 + c_4,\
242 \0 = -1 * q_0 * L ^^^ 2 / 2 + L * c_3 + c_4,\
243 \c + c_2 + c_3 + c_4 = 0,\
244 \c_2 + c_3 + c_4 = 0]";
245 val bdvs = [(str2term"bdv_1",str2term"c"),
246 (str2term"bdv_2",str2term"c_2"),
247 (str2term"bdv_3",str2term"c_3"),
248 (str2term"bdv_4",str2term"c_4")];
250 rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
251 if term2str t = "[0 = c_4, 0 = -1 * q_0 * L ^^^ 2 / 2 + (L * c_3 + c_4),\n\
252 \ c + (c_2 + (c_3 + c_4)) = 0, c_2 + (c_3 + c_4) = 0]"
253 then () else error "eqsystem.sml rewrite in 4x4 simplify_System_paren";
255 val SOME (t,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs t;
256 if term2str t = "[c_4 = 0, \
257 \L * c_3 + c_4 = 0 + -1 * (-1 * q_0 * L ^^^ 2 / 2),\n \
258 \c + (c_2 + (c_3 + c_4)) = 0, c_2 + (c_3 + c_4) = 0]"
259 then () else error "eqsystem.sml rewrite in 4x4 isolate_bdvs";
261 val SOME(t,_)= rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
262 if term2str t = "[c_4 = 0,\
263 \ L * c_3 + c_4 = q_0 * L ^^^ 2 / 2,\
264 \ c + (c_2 + (c_3 + c_4)) = 0,\n\
265 \ c_2 + (c_3 + c_4) = 0]"
266 then () else error "eqsystem.sml rewrite in 4x4 simplify_System_p..2";
268 val SOME (t,_) = rewrite_set_ thy true order_system t;
269 if term2str t = "[c_4 = 0,\
270 \ L * c_3 + c_4 = q_0 * L ^^^ 2 / 2,\
271 \ c_2 + (c_3 + c_4) = 0,\n\
272 \ c + (c_2 + (c_3 + c_4)) = 0]"
273 then () else error "eqsystem.sml rewrite in 4x4 order_system";
275 "----------- refine [linear,system]-------------------------------";
276 "----------- refine [linear,system]-------------------------------";
277 "----------- refine [linear,system]-------------------------------";
279 ["equalities [0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2," ^
280 "0 = -1 * q_0 * L ^^^ 2 / 2 + L * c + (c_2::real)]",
281 "solveForVars [c, c_2]", "solution LL"];
283 (*WN120313 in "solution L" above "refine fmz ["linear","system"]" caused an error...*)
284 "~~~~~ fun refine, args:"; val ((fmz:fmz_), (pblID:pblID)) = (fmz, ["linear","system"]);
285 "~~~~~ fun refin', args:"; val ((pblRD: pblRD), fmz, pbls, ((Ptyp (pI, [py], [])): pbt ptyp)) =
286 ((rev o tl) pblID, fmz, [(*match list*)],
287 ((Ptyp ("linear", [get_pbt ["linear","system"]], [])): pbt ptyp));
288 val {thy, ppc, where_, prls, ...} = py ;
289 "~~~~~ fun prep_ori, args:"; val (fmz, thy, pbt) = (fmz, thy, ppc);
290 (* val ctxt = Proof_Context.init_global thy |> fold declare_constraints fmz;*)
291 val ctxt = Proof_Context.init_global thy;
292 "~~~~~ fun declare_constraints, args:"; val (t, ctxt) = (nth 1 fmz, ctxt);
293 fun get_vars ((v,T)::vs) = (case raw_explode v |> Library.read_int of
294 (_, _::_) => (Free (v,T)::get_vars vs)
295 | (_, [] ) => get_vars vs) (*filter out nums as long as
296 we have Free ("123",_)*)
298 t = "equalities [0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2,"^
299 "0 = -1 * q_0 * L ^^^ 2 / 2 + L * c + (c_2::real)]";
300 val ts = Term.add_frees (Syntax.read_term ctxt t) [] |> get_vars;
301 val ctxt = Variable.declare_constraints (nth 1 ts) ctxt;
302 val ctxt = Variable.declare_constraints (nth 2 ts) ctxt;
303 val ctxt = Variable.declare_constraints (nth 3 ts) ctxt;
304 val ctxt = Variable.declare_constraints (nth 4 ts) ctxt;
305 val t = nth 2 fmz; t = "solveForVars [c, c_2]";
306 val ts = Term.add_frees (Syntax.read_term ctxt t) [] |> get_vars;
307 val ctxt = Variable.declare_constraints (nth 1 ts) ctxt;
308 val t = nth 3 fmz; t = "solution LL";
309 (*(Syntax.read_term ctxt t);
310 Type unification failed: Clash of types "real" and "_ list"
311 Type error in application: incompatible operand type
313 Operator: solution :: bool list \<Rightarrow> toreall
314 Operand: L :: real ========== L was already present in equalities ========== *)
316 "===== case 1 =====";
317 val matches = refine fmz ["linear","system"];
319 [Matches (["linear", "system"], _),
320 Matches (["2x2", "linear", "system"], _),
321 NoMatch (["triangular", "2x2", "linear", "system"], _),
322 Matches (["normalize", "2x2", "linear", "system"],
323 {Find = [Correct "solution LL"],
327 "equalities\n [0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2,\n 0 = -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2]",
328 Correct "solveForVars [c, c_2]"],
331 | _ => error "eqsystem.sml refine ['normalize','2x2'...]";
333 "===== case 2 =====";
334 val fmz = ["equalities [c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]",
335 "solveForVars [c, c_2]", "solution LL"];
336 val matches = refine fmz ["linear","system"];
337 case matches of [_,_,
339 (["triangular", "2x2", "linear", "system"],
340 {Find = [Correct "solution LL"],
343 [Correct "equalities [c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]",
344 Correct "solveForVars [c, c_2]"],
346 "tl [c, c_2] from [c, c_2] occur_exactly_in NTH 1\n [c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]",
348 "[c, c_2] from [c, c_2] occur_exactly_in NTH 2\n [c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]"],
350 | _ => error "eqsystem.sml refine ['triangular','2x2'...]";
352 (*WN051014----------------------------------------------------------------
353 the above 'val matches = refine fmz ["linear","system"]'
354 didn't work anymore; we investigated in these steps:*)
355 val fmz = ["equalities [c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]",
356 "solveForVars [c, c_2]", "solution LL"];
357 val matches = refine fmz ["triangular", "2x2", "linear","system"];
359 False "[c, c_2] from_ [c, c_2] occur_exactly_in nth_ 2\n
360 [c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]"]*)
361 val t = str2term ("[c, c_2] from [c, c_2] occur_exactly_in NTH 2" ^
362 "[c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]");
363 trace_rewrite := false;
364 val SOME (t',_) = rewrite_set_ thy false prls_triangular t;
367 ### eval asms: 1 < 2 + - 1
368 ==> nth_ (2 + - 1) [L * c + c_2 = q_0 * L ^^^ 2 / 2] =
369 nth_ (2 + - 1 + - 1) []
370 #### rls: erls_prls_triangular on: 1 < 2 + - 1
371 ##### try calc: op <'
372 ### asms accepted: ["1 < 2 + - 1"] stored: ["1 < 2 + -1"]
374 ... i.e Calc ("Groups.plus_class.plus", eval_binop "#add_") was missing in erls_prls_triangular*)
375 trace_rewrite:=false;
377 "===== case 3: relaxed preconditions for triangular system =====";
378 val fmz = ["equalities [L * q_0 = c, \
379 \ 0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2,\
382 "solveForVars [c, c_2, c_3, c_4]", "solution LL"];
383 (*============ inhibit exn WN120314 TODO: investigate type error (same) in these 2 cases:
384 probably exn thrown by fun declare_constraints
385 /-------------------------------------------------------\
386 Type unification failed
387 Type error in application: incompatible operand type
389 Operator: op # c_3 :: 'a list \<Rightarrow> 'a list
390 Operand: [c_4] :: 'b list
391 \-------------------------------------------------------/
392 val matches = refine fmz ["linear","system"];
394 [Matches (["linear", "system"], _),
395 NoMatch (["2x2", "linear", "system"], _),
396 NoMatch (["3x3", "linear", "system"], _),
397 Matches (["4x4", "linear", "system"], _),
398 NoMatch (["triangular", "4x4", "linear", "system"], _),
399 Matches (["normalize", "4x4", "linear", "system"], _)] => ()
400 | _ => error "eqsystem.sml: refine relaxed triangular sys NoMatch";
401 (*WN060914 does NOT match, because 3rd and 4th equ are not ordered*)
403 "===== case 4 =====";
404 val fmz = ["equalities [L * q_0 = c, \
405 \ 0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2,\
408 "solveForVars [c, c_2, c_3, c_4]", "solution LL"];
409 val matches = refine fmz ["triangular", "4x4", "linear","system"];
411 [Matches (["triangular", "4x4", "linear", "system"], _)] => ()
412 | _ => error "eqsystem.sml: refine relaxed triangular sys Matches";
413 val matches = refine fmz ["linear","system"];
414 ============ inhibit exn WN120314 ==============================================*)
416 "----------- refine [2x2,linear,system] search error--------------";
417 "----------- refine [2x2,linear,system] search error--------------";
418 "----------- refine [2x2,linear,system] search error--------------";
419 (*didn't go into ["2x2", "linear", "system"];
420 we investigated in these steps:*)
421 val fmz = ["equalities [0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2,\
422 \0 = -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2]",
423 "solveForVars [c, c_2]", "solution LL"];
424 trace_rewrite := false;
425 val matches = refine fmz ["2x2", "linear","system"];
426 trace_rewrite:=false;
427 print_depth 11; matches; print_depth 3;
428 (*brought: 'False "length_ es_ = 2"'*)
430 (*-----fun refin' (pblRD:pblRD) fmz pbls ((Ptyp (pI,[py],[])):pbt ptyp) =
431 (* val ((pblRD:pblRD), fmz, pbls, ((Ptyp (pI,[py],[])):pbt ptyp)) =
432 (rev ["linear","system"], fmz, [(*match list*)],
433 ((Ptyp ("2x2",[get_pbt ["2x2","linear","system"]],[])):pbt ptyp));
435 > show_types:=true; term2str (hd where_); show_types:=false;
436 val it = "length_ (es_::real list) = (2::real)" : string
438 =========================================================================\
440 (* val (thy, (pblID, dsc_dats: (string * (string list)) list,
441 ev:rls, ca: string option, metIDs:metID list)) =
442 (EqSystem.thy, (["system"],
443 [("#Given" ,["equalities es_", "solveForVars v_s"]),
444 ("#Find" ,["solution ss___"](*___ is copy-named*))
446 append_rls "e_rls" e_rls [(*for preds in where_*)],
447 SOME "solveSystem es_ v_s",
450 > val [("#Given", [equalities_es_, "solveForVars v_s"])] = gi;
451 val equalities_es_ = "equalities es_" : string
452 > val (dd, ii) = (split_did o term_of o the o (parse thy)) equalities_es_;
453 > show_types:=true; term2str ii; show_types:=false;
454 val it = "es_::bool list" : string
455 ~~~~~~~~~~~~~~~^^^^^^^^^ OK~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
457 > val {where_,...} = get_pbt ["2x2", "linear","system"];
458 > show_types:=true; term2str (hd where_); show_types:=false;
460 =========================================================================/
463 > (writeln o (itms2str_ (thy2ctxt @{theory Isac}))) itms;
465 (1 ,[1] ,true ,#Given ,Cor equalities
466 [0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2,
467 0 = -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2] ,(es_, [[0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2,
468 0 = -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2]])),
469 (2 ,[1] ,true ,#Given ,Cor solveForVars [c, c_2] ,(v_s, [[c, c_2]])),
470 (3 ,[1] ,true ,#Find ,Cor solution L ,(ss___, [L]))]
472 > (writeln o pres2str) pre';
474 (false, length_ es_ = 2),
475 (true, length_ [c, c_2] = 2)]
477 ----- fun match_oris':
478 > (writeln o (itms2str_ (thy2ctxt @{theory Isac}))) itms;
479 > (writeln o pres2str) pre';
482 ----- fun check_preconds'
483 > (writeln o env2str) env;
485 (es_, [0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2,
486 0 = -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2])","
490 > val es_ = (fst o hd) env;
491 val es_ = Free ("es_", "bool List.list") : Term.term
493 > val pre1 = hd pres;
496 *** Const (op =, [real, real] => bool)
497 *** . Const (ListG.length_, real list => real)
498 *** . . Free (es_, real list)
499 ~~~~~~~~~~~~~~~~~~~^^^^^^^^^ should be bool list~~~~~~~~~~~~~~~~~~~
503 THE REASON WAS A non-type-constrained variable IN #WHERE OF PROBLEM
504 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
507 "----------- me [EqSystem,normalize,2x2] -------------------------";
508 "----------- me [EqSystem,normalize,2x2] -------------------------";
509 "----------- me [EqSystem,normalize,2x2] -------------------------";
510 val fmz = ["equalities [0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2,\
511 \0 = -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2]",
512 "solveForVars [c, c_2]", "solution LL"];
514 ("Biegelinie",["normalize", "2x2", "linear", "system"],
515 ["EqSystem","normalize","2x2"]);
516 val p = e_pos'; val c = [];
517 val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
518 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
519 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
520 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
521 val (p,_,f,nxt,_,pt) = me nxt p c pt;
522 case nxt of ("Specify_Method",_) => ()
523 | _ => error "eqsystem.sml [EqSystem,normalize,2x2] specify";
525 val (p,_,f,nxt,_,pt) = me nxt p c pt;
526 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
527 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f(*["(bdv_1, c)", "(bdv_2, hd (tl [c, c_2] ... corrected srls; ran only AFTER use"RCODE-root.sml", store_met was NOT SUFFICIENT*);
528 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
529 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
530 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
532 (_, Subproblem ("Biegelinie", ["triangular", "2x2", "linear",_])) => ()
533 | _ => error "eqsystem.sml me [EqSystem,normalize,2x2] SubProblem";
535 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
536 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
537 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
538 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
540 (_, Specify_Method ["EqSystem", "top_down_substitution", "2x2"]) => ()
541 | _ => error "eqsystem.sml me [EqSys...2x2] top_down_substitution";
543 val (p,_,f,nxt,_,pt) = me nxt p c pt;
544 val PblObj {probl,...} = get_obj I pt [5];
545 (writeln o (itms2str_ (thy2ctxt @{theory Isac}))) probl;
547 (1 ,[1] ,true ,#Given ,Cor equalities [c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2] ,(es_, [[c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]])),
548 (2 ,[1] ,true ,#Given ,Cor solveForVars [c, c_2] ,(v_s, [[c, c_2]])),
549 (3 ,[1] ,true ,#Find ,Cor solution ss___ ,(ss___, [ss___]))]
551 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
552 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
553 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
554 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
555 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
556 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
557 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
558 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
560 (_, Check_Postcond ["triangular", "2x2", "linear", "system"]) => ()
561 | _ => error "eqsystem.sml me Subpbl .[EqSys...2x2] finished";
562 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
563 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
564 if f2str f = "[c = L * q_0 / 2, c_2 = 0]" then ()
565 else error "eqsystem.sml me [EqSys...2x2] finished f2str f";
567 (_, End_Proof') => ()
568 | _ => error "eqsystem.sml me [EqSys...2x2] finished End_Proof'";
570 "----------- me [linear,system] ..normalize..top_down_sub..-------";
571 "----------- me [linear,system] ..normalize..top_down_sub..-------";
572 "----------- me [linear,system] ..normalize..top_down_sub..-------";
575 \[0 = c_2 + c * 0 + 1 / EI * (L * q_0 / 12 * 0 ^^^ 3 + \
576 \ -1 * q_0 / 24 * 0 ^^^ 4),\
577 \ 0 = c_2 + c * L + 1 / EI * (L * q_0 / 12 * L ^^^ 3 + \
578 \ -1 * q_0 / 24 * L ^^^ 4)]",
579 "solveForVars [c, c_2]", "solution LL"];
581 ("Biegelinie",["linear", "system"], ["no_met"]);
582 val p = e_pos'; val c = [];
583 val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
584 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
585 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
586 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
587 val (p,_,f,nxt,_,pt) = me nxt p c pt;
588 case nxt of (_,Specify_Method ["EqSystem", "normalize", "2x2"]) => ()
589 | _ => error "eqsystem.sml [linear,system] specify b";
590 val (p,_,f,nxt,_,pt) = me nxt p c pt;
591 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
592 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
593 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
594 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
595 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
597 "[c_2 = 0, L * c + c_2 = -1 * q_0 * L ^^^ 4 / (24 * EI)]"
598 then () else error "eqsystem.sml me simpl. before SubProblem b";
600 (_, Subproblem ("Biegelinie", ["triangular", "2x2", "linear",_])) => ()
601 | _ => error "eqsystem.sml me [linear,system] SubProblem b";
603 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
604 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
605 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
606 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
608 (_, Specify_Method ["EqSystem", "top_down_substitution", "2x2"]) => ()
609 | _ => error "eqsystem.sml me [EqSys...2x2] top_down_substitution b";
611 val (p,_,f,nxt,_,pt) = me nxt p c pt;
612 val PblObj {probl,...} = get_obj I pt [5];
613 (writeln o (itms2str_ (thy2ctxt @{theory Isac}))) probl;
615 (1 ,[1] ,true ,#Given ,Cor equalities [c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2] ,(es_, [[c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]])),
616 (2 ,[1] ,true ,#Given ,Cor solveForVars [c, c_2] ,(v_s, [[c, c_2]])),
617 (3 ,[1] ,true ,#Find ,Cor solution ss___ ,(ss___, [ss___]))]
619 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
620 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
621 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
622 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
623 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
624 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
625 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
626 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
628 (_, Check_Postcond ["triangular", "2x2", "linear", "system"]) => ()
629 | _ => error "eqsystem.sml me Subpbl .[EqSys...2x2] finished b";
630 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
631 val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
633 "[c = -1 * q_0 * L ^^^ 4 / (24 * EI * L), c_2 = 0]"
634 then () else error "eqsystem.sml me [EqSys...2x2] finished f2str f b";
636 (_, End_Proof') => ()
637 | _ => error "eqsystem.sml me [EqSys...2x2] finished End_Proof'";
640 "----------- all systems from Biegelinie -------------------------";
641 "----------- all systems from Biegelinie -------------------------";
642 "----------- all systems from Biegelinie -------------------------";
643 val subst = [(str2term "bdv_1", str2term "c"),
644 (str2term "bdv_2", str2term "c_2"),
645 (str2term "bdv_3", str2term "c_3"),
646 (str2term "bdv_4", str2term "c_4")];
649 CalcTree [(["Traegerlaenge L","Streckenlast q_0","Biegelinie y",
650 "Randbedingungen [y 0 = 0, y L = 0, M_b 0 = 0, M_b L = 0]",
651 "FunktionsVariable x"],
652 ("Biegelinie", ["Biegelinien"],
653 ["IntegrierenUndKonstanteBestimmen2"]))];
656 trace_script := true; autoCalculate 1 CompleteCalc; trace_script := false;
657 ##7.27## ordered substs
659 c c_2 c_3 c_4 c c_2 1->2: c
661 c c_2 c c_2 c_3 c_4 [2':c, 1:c_2, 3:c_4] -> 4:c_3*)
662 val t = str2term"[0 = c_4, \
663 \ 0 = c_4 + L * c_3 +(12 * L ^^^ 2 * c_2 + 4 * L ^^^ 3 * c + -1 * L ^^^ 4 * q_0) / (-24 * EI), \
665 \ 0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2]";
666 val SOME (t',_) = rewrite_set_ thy false isolate_bdvs_4x4 t;
668 "[c_4 = 0,\n (12 * L ^^^ 2 * c_2 + 4 * L ^^^ 3 * c + -1 * L ^^^ 4 * q_0) / (-24 * EI) =\n 0 + -1 * (c_4 + L * c_3),\n c_2 = 0, (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2 = 0]";
670 "----- 7.27 go through the rewrites in met_eqsys_norm_4x4";
671 val t = str2term "0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2";
672 val NONE = rewrite_set_ thy false norm_Rational t;
674 rewrite_set_inst_ thy false subst simplify_System_parenthesized t;
675 term2str t = "0 = -1 * q_0 * L ^^^ 2 / 2 + (L * c + c_2)";
676 "--- isolate_bdvs_4x4";
678 val SOME (t,_) = rewrite_set_inst_ thy false subst isolate_bdvs_4x4 t;
680 val SOME (t,_) = rewrite_set_inst_ thy false subst simplify_System t;
682 val SOME (t,_) = rewrite_set_ thy false order_system t;
686 "------- Bsp 7.28 ---------------vvvvvvvvvvvvv Momentenlinie postponed";
688 CalcTree [(["Traegerlaenge L","Momentenlinie (-q_0 / L * x^3 / 6)",
690 "Randbedingungen [y L = 0, y' L = 0]",
691 "FunktionsVariable x"],
692 ("Biegelinie", ["vonMomentenlinieZu","Biegelinien"],
693 ["Biegelinien", "AusMomentenlinie"]))];
696 trace_script := true; autoCalculate 1 CompleteCalc; trace_script := false;
701 CalcTree [(["Traegerlaenge L","Streckenlast q_0","Biegelinie y",
702 "Randbedingungen [y 0 = 0, y L = 0, y' 0 = 0, y' L = 0]",
703 "FunktionsVariable x"],
704 ("Biegelinie", ["Biegelinien"],
705 ["IntegrierenUndKonstanteBestimmen2"] ))];
708 trace_script := true; autoCalculate 1 CompleteCalc; trace_script := false;
709 ##7.69## ordered subst 2x2
711 c c_2 c_3 c_4 c c_2 c_3 1:c_3 -> 2:c c_2 2: c c_2
713 c c_2 c_3 c c_2 c_3 c_4 3:c_4 -> 4:c c_2 c_3 1:c_3 -> 4:c c_2*)
714 val t = str2term"[0 = c_4 + 0 / (-1 * EI), \
715 \ 0 = c_4 + L * c_3 + (12 * L ^^^ 2 * c_2 + 4 * L ^^^ 3 * c + -1 * L ^^^ 4 * q_0) / (-24 * EI), \
716 \ 0 = c_3 + 0 / (-1 * EI), \
717 \ 0 = c_3 + (6 * L * c_2 + 3 * L ^^^ 2 * c + -1 * L ^^^ 3 * q_0) / (-6 * EI)]";
721 CalcTree [(["Traegerlaenge L","Streckenlast q_0","Biegelinie y",
722 "Randbedingungen [Q 0 = q_0 * L, M_b L = 0, y 0 = 0, y' 0 = 0]",
723 "FunktionsVariable x"],
724 ("Biegelinie", ["Biegelinien"],
725 ["IntegrierenUndKonstanteBestimmen2"] ))];
728 trace_script := true; autoCalculate 1 CompleteCalc; trace_script := false;
733 c_4 | STOPPED.WN06? test methods @@@@@@@@@@@@@@@@@@@@@@@*)
736 "----- 7.70 go through the rewrites in met_eqsys_norm_4x4";
737 val t = str2term"[L * q_0 = c, \
738 \ 0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2,\
742 rewrite_ thy e_rew_ord e_rls false (num_str @{thm commute_0_equality}) t;
744 rewrite_ thy e_rew_ord e_rls false (num_str @{thm commute_0_equality}) t;
746 rewrite_ thy e_rew_ord e_rls false (num_str @{thm commute_0_equality}) t;
748 "[L * q_0 = c, (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2 = 0, c_4 = 0,\n c_3 = 0]";
750 rewrite_set_inst_ thy false subst simplify_System_parenthesized t;
752 "[L * q_0 = c, -1 * q_0 * L ^^^ 2 / 2 + (L * c + c_2) = 0, c_4 = 0, c_3 = 0]";
753 val SOME (t,_) = rewrite_set_inst_ thy false subst isolate_bdvs_4x4 t;
755 "[c = (-1 * (L * q_0) + 0) / -1,\n L * c + c_2 = -1 * (-1 * q_0 * L ^^^ 2 / 2) + 0, c_4 = 0, c_3 = 0]";
757 rewrite_set_inst_ thy false subst simplify_System_parenthesized t;
759 term2str t ="[c = L * q_0, L * c + c_2 = q_0 * L ^^^ 2 / 2, c_4 = 0, c_3 = 0]";
760 val SOME (t,_) = rewrite_set_ thy false order_system t;
761 if term2str t ="[c = L * q_0, L * c + c_2 = q_0 * L ^^^ 2 / 2, c_3 = 0, c_4 = 0]" then ()
762 else error "eqsystem.sml: exp 7.70 normalize 4x4 by rewrite changed";
765 "----- 7.70 with met normalize: ";
766 val fmz = ["equalities \
768 \ 0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2,\
771 "solveForVars [c, c_2, c_3, c_4]", "solution LL"];
773 ("Biegelinie",["linear", "system"],["no_met"]);
774 val p = e_pos'; val c = [];
775 (*============ inhibit exn WN120314 TODO: investigate type error (same as above)==
776 in next but one test below the same type error.
777 /-------------------------------------------------------\
778 Type unification failed
779 Type error in application: incompatible operand type
781 Operator: op # c_3 :: 'a list \<Rightarrow> 'a list
782 Operand: [c_4] :: 'b list
783 \-------------------------------------------------------/
785 val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
786 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
787 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
788 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
789 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
790 case nxt of (_,Apply_Method ["EqSystem", "normalize", "4x4"]) => ()
791 | _ => error "eqsystem.sml [EqSystem,normalize,4x4] specify";
792 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
793 "----- outcommented before Isabelle2002 --> 2011 -------------------------";
794 (*vvvWN080102 Exception- Match raised
795 since assod Rewrite .. Rewrite'_Set
796 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
798 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
799 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
801 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
802 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
803 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
804 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
805 if f2str f ="[c = L * q_0, L * c + c_2 = q_0 * L ^^^ 2 / 2, c_3 = 0, c_4 = 0]"
806 then () else error "eqsystem.sml: exp 7.70 normalize 4x4 by met changed";
807 --------------------------------------------------------------------------*)
809 "----- 7.70 with met top_down_: me";
810 val fmz = ["equalities \
811 \[c = L * q_0, L * c + c_2 = q_0 * L ^^^ 2 / 2, c_3 = 0, c_4 = 0]",
812 "solveForVars [c, c_2, c_3, c_4]", "solution LL"];
814 ("Biegelinie",["linear", "system"],["no_met"]);
815 val p = e_pos'; val c = [];
816 val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
817 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
818 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
819 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
820 val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
821 case nxt of (_,Apply_Method ["EqSystem", "top_down_substitution", "4x4"]) => ()
822 | _ => error "eqsystem.sml [EqSystem,top_down_,4x4] specify";
823 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
824 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
825 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
826 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
827 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
828 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
829 if nxt = ("End_Proof'", End_Proof') andalso
830 f2str f = "[c = L * q_0, c_2 = -1 * L ^^^ 2 * q_0 / 2, c_3 = 0, c_4 = 0]"
831 then () else error "eqsystem.sml: 7.70 with met top_down_: me";
832 ============ inhibit exn WN120314 ==============================================*)
836 CalcTree [(["Traegerlaenge L","Streckenlast q_0","Biegelinie y",
837 "Randbedingungen [M_b L = 0, y 0 = 0, y L = 0, y' 0 = 0]",
838 "FunktionsVariable x"],
839 ("Biegelinie", ["Biegelinien"],
840 ["IntegrierenUndKonstanteBestimmen2"] ))];
843 trace_script := true; autoCalculate 1 CompleteCalc; trace_script := false;
844 ##7.71## |ordered |subst.singles (recurs) |2x2 |diagonal
845 c c_2 |c c_2 |1' |1': c c_2 |
846 c_4 | c_3 |2:c_3 -> 4' :c c_2 c_4 | |
847 c c_2 c_3 c_4 | c_4 |3' | |
848 c_3 |c c_2 c_3 c_4 |3:c_4 -> 4'':c c_2 |4'':c c_2 | *)
849 val t = str2term"[0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2, \
850 \ 0 = c_4 + 0 / (-1 * EI), \
851 \ 0 = c_4 + L * c_3 +(12 * L ^^^ 2 * c_2 + 4 * L ^^^ 3 * c + -1 * L ^^^ 4 * q_0) /(-24 * EI),\
852 \ 0 = c_3 + 0 / (-1 * EI)]";
854 "------- Bsp 7.72a ---------------vvvvvvvvvvvvv Momentenlinie postponed";
856 CalcTree [(["Traegerlaenge L",
857 "Momentenlinie ((q_0 * L)/ 6 * x - q_0 /(6 * L) * x^3)",
859 "Randbedingungen [y 0 = 0, y L = 0]",
860 "FunktionsVariable x"],
861 ("Biegelinie", ["vonMomentenlinieZu","Biegelinien"],
862 ["Biegelinien", "AusMomentenlinie"]))];
865 trace_script := true; autoCalculate 1 CompleteCalc; trace_script := false;
870 CalcTree [(["Traegerlaenge L","Streckenlast (q_0 / L * x)","Biegelinie y",
871 "Randbedingungen [M_b 0 = 0, M_b L = 0, y 0 = 0, y L = 0]",
872 "FunktionsVariable x"],
873 ("Biegelinie", ["Biegelinien"],
874 ["IntegrierenUndKonstanteBestimmen2"] ))];
877 trace_script := true; autoCalculate 1 CompleteCalc; trace_script := false;
878 ##7.72b## |ord. |subst.singles |ord.triang.
880 c c_2 | |1:c_2 -> 2':c |c_2 c
882 c c_2 c_3 c_4 | |3:c_4 -> 4':c c_2 c_3 |c_2 c c_3*)
883 val t = str2term"[0 = c_2, \
884 \ 0 = (6 * c_2 + 6 * L * c + -1 * L ^^^ 2 * q_0) / 6, \
885 \ 0 = c_4 + 0 / (-1 * EI), \
886 \ 0 = c_4 + L * c_3 + (60 * L ^^^ 2 * c_2 + 20 * L ^^^ 3 * c + -1 * L ^^^ 4 * q_0) / (-120 * EI)]";
888 "------- Bsp 7.73 ---------------vvvvvvvvvvvvv Momentenlinie postponed";
890 CalcTree [(["Traegerlaenge L","Momentenlinie ???",(*description unclear*)
892 "Randbedingungen [y L = 0, y' L = 0]",
893 "FunktionsVariable x"],
894 ("Biegelinie", ["vonMomentenlinieZu","Biegelinien"],
895 ["Biegelinien", "AusMomentenlinie"]))];
898 trace_script := true; autoCalculate 1 CompleteCalc; trace_script := false;
901 "----------- 4x4 systems from Biegelinie -------------------------";
902 "----------- 4x4 systems from Biegelinie -------------------------";
903 "----------- 4x4 systems from Biegelinie -------------------------";
904 (*STOPPED.WN08?? replace this test with 7.70 *)
906 val fmz = ["equalities \
908 \ 0 = c_4 + L * c_3 +(12 * L ^^^ 2 * c_2 + 4 * L ^^^ 3 * c + -1 * L ^^^ 4 * q_0) / (-24 * EI), \
910 \ 0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2]",
911 "solveForVars [c, c_2, c_3, c_4]", "solution LL"];
913 ("Biegelinie",["normalize", "4x4", "linear", "system"],
914 ["EqSystem","normalize","4x4"]);
915 val p = e_pos'; val c = [];
916 val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
917 val (p,_,f,nxt,_,pt) = me nxt p c pt; val (p,_,f,nxt,_,pt) = me nxt p c pt;
918 val (p,_,f,nxt,_,pt) = me nxt p c pt; val (p,_,f,nxt,_,pt) = me nxt p c pt;
919 val (p,_,f,nxt,_,pt) = me nxt p c pt; val (p,_,f,nxt,_,pt) = me nxt p c pt;
920 val (p,_,f,nxt,_,pt) = me nxt p c pt; val (p,_,f,nxt,_,pt) = me nxt p c pt;
921 "------------------------------------------- Apply_Method...";
922 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
924 \ 0 = c_4 + L * c_3 +\n (12 * L ^^^ 2 * c_2 + 4 * L ^^^ 3 * c + -1 * L ^^^ 4 * q_0) / (-24 * EI), \
926 \ 0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2]";
927 (*vvvWN080102 Exception- Match raised
928 since assod Rewrite .. Rewrite'_Set
929 "------------------------------------------- simplify_System_parenthesized...";
930 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
932 \ 0 = -1 * q_0 * L ^^^ 4 / (-24 * EI) + \
933 \ (4 * L ^^^ 3 * c / (-24 * EI) + \
934 \ (12 * L ^^^ 2 * c_2 / (-24 * EI) + \
935 \ (L * c_3 + c_4))), \
937 \ 0 = -1 * q_0 * L ^^^ 2 / 2 + (L * c + c_2)]";
938 (*? "(4 * L ^^^ 3 / (-24 * EI) * c" statt "(4 * L ^^^ 3 * c / (-24 * EI)" ?*)
939 "------------------------------------------- isolate_bdvs...";
940 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
942 \ c_4 = 0 + -1 * (-1 * q_0 * L ^^^ 4 / (-24 * EI)) + -1 * (4 * L ^^^ 3 * c / (-24 * EI)) + -1 * (12 * L ^^^ 2 * c_2 / (-24 * EI)) + -1 * (L * c_3),\
944 \ c_2 = 0 + -1 * (-1 * q_0 * L ^^^ 2 / 2) + -1 * (L * c)]";
945 val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
947 ---------------------------------------------------------------------*)