1 (* Title: "Interpret/step-solve.sml"
3 (c) due to copyright terms
6 "-----------------------------------------------------------------------------------------------";
7 "table of contents -----------------------------------------------------------------------------";
8 "-----------------------------------------------------------------------------------------------";
9 "-----------------------------------------------------------------------------------------------";
10 "----------- Apply_Method with explicit Take by fun me (from integrate) ------------------------";
11 "-----------------------------------------------------------------------------------------------";
12 "-----------------------------------------------------------------------------------------------";
13 "-----------------------------------------------------------------------------------------------";
15 "----------- Apply_Method with explicit Take by fun me (from integrate) ------------------------";
16 "----------- Apply_Method with explicit Take by fun me (from integrate) ------------------------";
17 "----------- Apply_Method with explicit Take by fun me (from integrate) ------------------------";
19 "----------- me method [diff,integration] ---------------";
20 val fmz = ["functionTerm (x \<up> 2 + 1)", "integrateBy x", "antiDerivative FF"];
21 val spec = ("Integrate", ["integrate", "function"], ["diff", "integration"]);
22 (*[], Pbl*)val (p,_,f,nxt,_,pt) = Test_Code.init_calc @{context} [(fmz, spec)];(*\<rightarrow>Model_Problem*)
23 (*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*\<rightarrow>Add_Given "functionTerm (x \<up> 2 + 1)"*)
24 (*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*\<rightarrow>Add_Given "integrateBy x"*)
25 (*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*\<rightarrow>Add_Find "Integrate.antiDerivative FF"*)
26 (*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*\<rightarrow>Specify_Theory "Integrate"*)
27 (*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*\<rightarrow>Specify_Problem ["integrate", "function"]*)
28 (*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*\<rightarrow>Specify_Method ["diff", "integration"]*)
29 (*[], Met*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*\<rightarrow>Apply_Method ["diff", "integration"]*)
31 (*+*)case nxt of (Apply_Method ["diff", "integration"]) => ()
32 (*+*) | _ => error "integrate.sml -- me method [diff,integration] -- spec";
34 (*[1], Frm*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*\<rightarrow>Rewrite_Set_Inst (["(''bdv'', x)"], "integration")*)
35 (*/--------- step into Apply_Method ----------------------------------------------------------\*)
36 (*\--------- step into Apply_Method ----------------------------------------------------------/*)
38 (*[1], Res*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*\<rightarrow>Check_Postcond ["integrate", "function"]*)
39 (*[], Res*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*\<rightarrow>End_Proof'*)
41 (*/--------- final test ----------------------------------------------------------------------\*)
42 val (res, asm) = (get_obj g_result pt (fst p));
43 if UnparseC.term @{context} res = "c + x + 1 / 3 * x \<up> 3" then ()
44 else error "Apply_Method with explicit Take CHANGED";