make Test_Isac.thy run in jEdit; intermed.
jEdit behaves differently from emacs in file dependencies.
Test_Isac.thy runs in emacs now.
For jEdit different uses seem appropriate; done in next step.
1 (* tests on AlgEin, Algebra Einf"uhrung, , Unterrichtsversuch IMST-Projekt
2 author: Walther Neuper 2007
3 (c) due to copyright terms
5 use"../smltest/IsacKnowledge/algein.sml";
9 "-----------------------------------------------------------------";
10 "table of contents -----------------------------------------------";
11 "-----------------------------------------------------------------";
12 "----------- build method 'Berechnung' 'erstSymbolisch' ----------";
13 "----------- me 'Berechnung' 'erstNumerisch' ---------------------";
14 "----------- auto 'Berechnung' 'erstSymbolisch' ------------------";
15 "----------- Widerspruch 3 = 777 ---------------------------------";
16 "-----------------------------------------------------------------";
17 "-----------------------------------------------------------------";
18 "-----------------------------------------------------------------";
20 (*=== inhibit exn ?=============================================================
24 (* use"../smltest/IsacKnowledge/algein.sml";
27 "----------- build method 'Berechnung' 'erstSymbolisch' ----------";
28 "----------- build method 'Berechnung' 'erstSymbolisch' ----------";
29 "----------- build method 'Berechnung' 'erstSymbolisch' ----------";
31 "Script RechnenSymbolScript (k_::bool) (q__::bool) \
32 \(u_::bool list) (s_::bool list) (o_::bool list) (l_::real) =\
36 val sc = ((inst_abs thy) o term_of o the o (parse thy)) str;
37 (*---^^^-OK-----------------------------------------------------------------*)
39 "Script RechnenSymbolScript (k_::bool) (q__::bool) \
40 \(u_::bool list) (s_::bool list) (o_::bool list) (l_::real) =\
41 \ (let t_ = Take (l_ = Oben + Senkrecht + Unten); \
42 \ sum_ = boollist2sum o_;\
43 \ t_ = Substitute [Oben = sum_] t_;\
44 \ t_ = Substitute o_ t_;\
45 \ t_ = Substitute [k_, q__] t_;\
46 \ t_ = Repeat (Try (Rewrite_Set norm_Poly False)) t_\
49 val sc = ((inst_abs thy) o term_of o the o (parse thy)) str;
50 (*---vvv-NOTok--------------------------------------------------------------*)
58 "----------- me 'Berechnung' 'erstNumerisch' ---------------------";
59 "----------- me 'Berechnung' 'erstNumerisch' ---------------------";
60 "----------- me 'Berechnung' 'erstNumerisch' ---------------------";
62 ["KantenLaenge (k=10)","Querschnitt (q=1)",
63 "KantenUnten [b1 = k - 2*q, b2 = k - 2*q, b3 = k - 2*q, b4 = k - 2*q ]",
64 "KantenSenkrecht [v1 = k, v2 = k, v3 = k, v4 = k]",
65 "KantenOben [t1 = k - 2*q, t2 = k - 2*q, t3 = k - 2*q, t4 = k - 2*q ]",
68 ("Isac",["numerischSymbolische", "Berechnung"],
69 ["Berechnung","erstNumerisch"]);
70 val p = e_pos'; val c = [];
71 val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))](*nxt = ("Model_Pr*);
72 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Given "KantenLaenge (k = 10)"*);
73 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Given "Querschnitt (q = 1)"*);
74 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Given "KantenUnten [b1 = k - 2*q]"*);
75 val (p,_,f,nxt,_,pt) = me nxt p c pt(*..KantenUnten [b2 = k - 2 * q, b3=..b4*);
76 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Given "KantenSenkrecht [v1 = k]"*);
77 val (p,_,f,nxt,_,pt) = me nxt p c pt(*..KantenSenkrecht [v2 = k, v3 = k, v4]*);
78 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Given "KantenOben [b1 = k - 2 *q])*);
79 val (p,_,f,nxt,_,pt) = me nxt p c pt(*..KantenOben [b2 = k - 2 * q, b3 =, b4*);
80 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Find "GesamtLaenge L"*);
81 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Specify_Theory "AlgEin"*);
82 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Specify_Problem ["numerischSymbolis,Be*);
83 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Specify_Method ["Berechnung", "erstSym*);
84 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Apply_Method*);
85 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Substitute["Oben = boollist2sum [b1 =*);
87 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Substitute ["t1 = k - 2 * q", *);f2str f;
88 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Substitute ["k = 10", "q = 1"]*);f2str f;
89 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Rewrite_Set "norm_Rational"*);f2str f;
90 val (p,_,f,nxt,_,pt) = me nxt p c pt(**);
91 if f2str f = "L = 32 + senkrecht + unten" then ()
92 else error "algein.sml diff.behav. in erstSymbolisch 1";
93 val (p,_,f,nxt,_,pt) = me nxt p c pt;val(p,_,f,nxt,_,pt)=me nxt p c pt;f2str f;
94 val (p,_,f,nxt,_,pt) = me nxt p c pt;val(p,_,f,nxt,_,pt)=me nxt p c pt;f2str f;
95 val (p,_,f,nxt,_,pt) = me nxt p c pt;val(p,_,f,nxt,_,pt)=me nxt p c pt;f2str f;
96 val (p,_,f,nxt,_,pt) = me nxt p c pt;val(p,_,f,nxt,_,pt)=me nxt p c pt;f2str f;
97 val (p,_,f,nxt,_,pt) = me nxt p c pt;
98 if f2str f = "L = 104" andalso nxt = ("End_Proof'", End_Proof') then ()
99 else error "algein.sml diff.behav. in erstSymbolisch 99";
102 "----------- auto 'Berechnung' 'erstSymbolisch' ------------------";
103 "----------- auto 'Berechnung' 'erstSymbolisch' ------------------";
104 "----------- auto 'Berechnung' 'erstSymbolisch' ------------------";
107 [(["KantenLaenge (k=10)","Querschnitt (q=1)",
108 "KantenUnten [b1 = k - 2*q, b2 = k - 2*q, b3 = k - 2*q, b4 = k - 2*q ]",
109 "KantenSenkrecht [v1 = k, v2 = k, v3 = k, v4 = k]",
110 "KantenOben [t1 = k - 2*q, t2 = k - 2*q, t3 = k - 2*q, t4 = k - 2*q ]",
112 ("Isac",["numerischSymbolische", "Berechnung"],
113 ["Berechnung","erstSymbolisch"]))];
116 autoCalculate 1 CompleteCalc;
117 val ((pt,p),_) = get_calc 1; show_pt pt;
118 if p = ([], Res) andalso term2str (get_obj g_res pt (fst p)) = "L = 104" then()
119 else error "algein.sml: 'Berechnung' 'erstSymbolisch' changed";
124 trace_rewrite:=false;
129 "----------- Widerspruch 3 = 777 ---------------------------------";
130 "----------- Widerspruch 3 = 777 ---------------------------------";
131 "----------- Widerspruch 3 = 777 ---------------------------------";
132 val thy = (theory "Isac");
133 val rew_ord = dummy_ord;
136 val thm = assoc_thm' thy ("sym_real_mult_0_right","");
137 val t = str2term "0 = 0";
138 val SOME (t',_) = rewrite_ thy rew_ord erls false thm t;
140 (********"0 = ?z1 * 0"*)
142 (*testing code in ME/appl.sml*)
143 val sube = ["?z1 = 3"];
144 val subte = sube2subte sube;
145 val subst = sube2subst thy sube;
146 foldl and_ (true, map contains_Var subte);
148 val t'' = subst_atomic subst t';
150 (********"0 = 3 * 0"*)
152 val thm = assoc_thm' thy ("sym","");
153 (*----- GOON Widerspruch 3 = 777: sym contains "==>" instead of "=" !!!
154 val SOME (t''',_) = rewrite_ thy rew_ord erls false thm t'';
157 (* use"../smltest/IsacKnowledge/algein.sml";
160 ===== inhibit exn ?===========================================================*)