1 (* tests on AlgEin, Algebra Einf"uhrung, , Unterrichtsversuch IMST-Projekt
2 author: Walther Neuper 2007
3 (c) due to copyright terms
6 "-----------------------------------------------------------------";
7 "table of contents -----------------------------------------------";
8 "-----------------------------------------------------------------";
9 "----------- build method 'Berechnung' 'erstSymbolisch' ----------";
10 "----------- me 'Berechnung' 'erstNumerisch' ---------------------";
11 "----------- auto 'Berechnung' 'erstSymbolisch' ------------------";
12 "----------- Widerspruch 3 = 777 ---------------------------------";
13 "-----------------------------------------------------------------";
14 "-----------------------------------------------------------------";
15 "-----------------------------------------------------------------";
17 val thy = @{theory "AlgEin"};
20 (* use"../smltest/IsacKnowledge/algein.sml";
23 "----------- build method 'Berechnung' 'erstSymbolisch' ----------";
24 "----------- build method 'Berechnung' 'erstSymbolisch' ----------";
25 "----------- build method 'Berechnung' 'erstSymbolisch' ----------";
27 "Script RechnenSymbolScript (k_k::bool) (q__q::bool) \
28 \(u_u::bool list) (s_s::bool list) (o_o::bool list) (l_l::real) =\
29 \ (let t_t = (l_l = 1)\
32 val sc = ((inst_abs thy) o Thm.term_of o the o (parse thy)) str;
36 "----------- me 'Berechnung' 'erstNumerisch' ---------------------";
37 "----------- me 'Berechnung' 'erstNumerisch' ---------------------";
38 "----------- me 'Berechnung' 'erstNumerisch' ---------------------";
40 ["KantenLaenge (k=(10::real))","Querschnitt (q=(1::real))",
41 "KantenUnten [b1 = k - 2*(q::real), b2 = k - 2*(q::real), b3 = k - 2*(q::real), b4 = k - 2*(q::real) ]",
42 "KantenSenkrecht [v1 = (k::real), v2 = (k::real), v3 = (k::real), v4 = (k::real)]",
43 "KantenOben [t1 = k - 2*(q::real), t2 = k - 2*(q::real), t3 = k - 2*(q::real), t4 = k - 2*(q::real) ]",
46 ("Isac",["numerischSymbolische", "Berechnung"],
47 ["Berechnung","erstNumerisch"]);
48 val p = e_pos'; val c = [];
49 val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))](*nxt = ("Model_Pr*);
50 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Given "KantenLaenge (k = 10)"*);
51 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Given "Querschnitt (q = 1)"*);
52 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Given "KantenUnten [b1 = k - 2*q]"*);
53 val (p,_,f,nxt,_,pt) = me nxt p c pt(*..KantenUnten [b2 = k - 2 * q, b3=..b4*);
54 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Given "KantenSenkrecht [v1 = k]"*);
55 val (p,_,f,nxt,_,pt) = me nxt p c pt(*..KantenSenkrecht [v2 = k, v3 = k, v4]*);
56 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Given "KantenOben [b1 = k - 2 *q])*);
57 val (p,_,f,nxt,_,pt) = me nxt p c pt(*..KantenOben [b2 = k - 2 * q, b3 =, b4*);
58 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Add_Find "GesamtLaenge L"*);
59 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Specify_Theory "AlgEin"*);
60 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Specify_Problem ["numerischSymbolis,Be*);
61 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Specify_Method ["Berechnung", "erstSym*);
62 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Apply_Method*);
63 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Substitute["Oben = boollist2sum [b1 =*);
65 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Substitute ["t1 = k - 2 * q", *);f2str f;
66 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Substitute ["k = 10", "q = 1"]*);f2str f;
67 val (p,_,f,nxt,_,pt) = me nxt p c pt(*Rewrite_Set "norm_Rational"*);f2str f;
68 val (p,_,f,nxt,_,pt) = me nxt p c pt(**);
69 if f2str f = "L = 32 + senkrecht + unten" then ()
70 else error "algein.sml diff.behav. in erstSymbolisch 1";
71 val (p,_,f,nxt,_,pt) = me nxt p c pt;val(p,_,f,nxt,_,pt)=me nxt p c pt;f2str f;
72 val (p,_,f,nxt,_,pt) = me nxt p c pt;val(p,_,f,nxt,_,pt)=me nxt p c pt;f2str f;
73 val (p,_,f,nxt,_,pt) = me nxt p c pt;val(p,_,f,nxt,_,pt)=me nxt p c pt;f2str f;
74 val (p,_,f,nxt,_,pt) = me nxt p c pt;val(p,_,f,nxt,_,pt)=me nxt p c pt;f2str f;
75 val (p,_,f,nxt,_,pt) = me nxt p c pt;
76 if f2str f = "L = 104" andalso nxt = ("End_Proof'", End_Proof') then ()
77 else error "algein.sml diff.behav. in erstSymbolisch 99";
80 "----------- auto 'Berechnung' 'erstSymbolisch' ------------------";
81 "----------- auto 'Berechnung' 'erstSymbolisch' ------------------";
82 "----------- auto 'Berechnung' 'erstSymbolisch' ------------------";
84 [(["KantenLaenge (k=(10::real))","Querschnitt (q=(1::real))",
85 "KantenUnten [b1 = k - 2*(q::real), b2 = k - 2*(q::real), b3 = k - 2*(q::real), b4 = k - 2*(q::real) ]",
86 "KantenSenkrecht [v1 = (k::real), v2 = (k::real), v3 = (k::real), v4 = (k::real)]",
87 "KantenOben [t1 = k - 2*(q::real), t2 = k - 2*(q::real), t3 = k - 2*(q::real), t4 = k - 2*(q::real) ]",
89 ("Isac",["numerischSymbolische", "Berechnung"],
90 ["Berechnung","erstSymbolisch"]))];
93 autoCalculate' 1 CompleteCalc;
94 val ((pt,p),_) = get_calc 1; show_pt pt;
95 if p = ([], Res) andalso term2str (get_obj g_res pt (fst p)) = "L = 104" then()
96 else error "algein.sml: 'Berechnung' 'erstSymbolisch' changed";
98 "----------- Widerspruch 3 = 777 ---------------------------------";
99 "----------- Widerspruch 3 = 777 ---------------------------------";
100 "----------- Widerspruch 3 = 777 ---------------------------------";
101 val thy = @{theory "Isac"};
102 val rew_ord = dummy_ord;
104 val thm = assoc_thm' thy ("sym_mult_zero_right","");
105 val t = str2term "0 = (0::real)";
106 val SOME (t',_) = rewrite_ thy rew_ord erls false thm t;
107 term2str t' = "0 = ?a1 * 0"; (* = true*)
109 (*testing code in ME/appl.sml*)
110 val sube = ["?a1 = (3::real)"];
111 val subte = sube2subte sube;
112 terms2str' subte = "[?a1 = 3]"; (* = true*)
113 val subst = sube2subst thy sube;
114 foldl and_ (true, map contains_Var subte);
116 val t'' = subst_atomic subst t';
117 term2str t'' = "0 = 3 * 0"; (* = true*)
119 val thm = assoc_thm' thy ("sym","");
120 (*----- STOPPED.WN0x?: Widerspruch 3 = 777: sym contains "==>" instead of "=" !!!
121 val SOME (t''',_) = rewrite_ thy rew_ord erls false thm t'';