1 (* Title: "Minisubpbl/790-complete-NEXT_STEP.sml"
2 Author: Walther Neuper 1105
3 (c) copyright due to lincense terms.
6 "----------- Minisubpbl/790-complete-NEXT_STEP.sml --------------------------------------------";
7 "----------- Minisubpbl/790-complete-NEXT_STEP.sml --------------------------------------------";
8 "----------- Minisubpbl/790-complete-NEXT_STEP.sml --------------------------------------------";
10 val fmz = ["equality (x+1=(2::real))", "solveFor x", "solutions L"];
12 ("Test", ["sqroot-test", "univariate", "equation", "test"],
13 ["Test", "squ-equ-test-subpbl1"]);
14 val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
15 (*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Model_Problem*)
16 (*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Specify_Theory*)
17 (*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Specify_Problem ["sqroot-test", "univariate", "equation", "test"*)
18 (*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Specify_Method ["Test", "squ-equ-test-subpbl1"]*)
19 (*1], Frm*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Apply_Method ["Test", "squ-equ-test-subpbl1"]*)
20 (*[1], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Rewrite_Set "norm_equation"*)
21 (*[2], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Rewrite_Set "Test_simplify"*)
22 (*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Subproblem ("Test", ["LINEAR", "univariate", "equation", "test"])*)
23 (*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Model_Problem*)
24 (*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Specify_Theory "Test"*)
25 (*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Specify_Problem ["LINEAR", "univariate", "equation", "test"]*)
26 (*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Specify_Method ["Test", "solve_linear"]*)
27 (*[3, 1], Frm*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Apply_Method ["Test", "solve_linear"]*)
28 (*[3, 1], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Rewrite_Set_Inst (["(''bdv'', x)"], "isolate_bdv")*)
29 (*[3, 2], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Rewrite_Set "Test_simplify"*)
30 (*[3], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*\<rightarrow>Check_Postcond ["LINEAR", "univariate", "equation", "test"]*)
32 ((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms) = "[]";(*isa*)
33 ((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms) = "[\"matches (?a = ?b) (-1 + x = 0)\"]";(*REP*)
34 (* there are questionable assumptions either --------- \<up> \<up> \<up> \<up> \<up> \<up> \<up> \<up> \<up> \<up> \<up> \<up> ^^*)
36 (*[4], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Check_elementwise "Assumptions"*)
38 ((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms) = "[]";(*isa*)
39 ((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms) = "[\"precond_rootmet 1\"]";(*REP*)
41 (*[], Res*)val ("ok", ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Check_Postcond ["sqroot-test", "univariate", "equation", "test"]*)
43 ((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms) = "[]";(*isa*)
44 ((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms) = "[\"precond_rootmet 1\"]";(*REP*)
46 (*[], Res*)val ("end-of-calculation", ([], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(**)
48 (*/--------------------- final test ----------------------------------\\*)
49 val (res, asm) = (get_obj g_result pt (fst p));
51 if UnparseC.term res = "[x = 1]" andalso
52 map UnparseC.term asm = [] (* assumptions have gone to the ctxt *)
53 then () else error "Minisubpbl/790-complete-NEXT_STEP.sml, find_next_step CHANGED";
57 case get_obj g_tac pt (fst p) of
58 Apply_Method ["Test", "squ-equ-test-subpbl1"] => ()
59 | _ => error "Minisubpbl/790-complete-NEXT_STEP.sml, WRONG RESULT CHANGED 2"
60 else error "Minisubpbl/790-complete-NEXT_STEP.sml, WRONG RESULT CHANGED 1";
62 (*ctxt*)Proof_Context.theory_of (Ctree.get_ctxt pt p); (*"Test"*)