test/Tools/isac/Minisubpbl/790-complete-NEXT_STEP.sml
author wneuper <Walther.Neuper@jku.at>
Mon, 01 Jan 2024 11:31:16 +0100
changeset 60789 8fa678b678e8
parent 60725 25233d8f7019
permissions -rw-r--r--
Doc/Specify_Phase 4: start use antiquotations from isar-ref
walther@59722
     1
(* Title:  "Minisubpbl/790-complete-NEXT_STEP.sml"
walther@59686
     2
   Author: Walther Neuper 1105
walther@59686
     3
   (c) copyright due to lincense terms.
walther@59686
     4
*)
walther@59686
     5
walther@59722
     6
"----------- Minisubpbl/790-complete-NEXT_STEP.sml --------------------------------------------";
walther@59722
     7
"----------- Minisubpbl/790-complete-NEXT_STEP.sml --------------------------------------------";
walther@59722
     8
"----------- Minisubpbl/790-complete-NEXT_STEP.sml --------------------------------------------";
walther@59997
     9
val fmz = ["equality (x+1=(2::real))", "solveFor x", "solutions L"];
walther@59686
    10
val (dI',pI',mI') =
walther@59997
    11
  ("Test", ["sqroot-test", "univariate", "equation", "test"],
walther@59997
    12
   ["Test", "squ-equ-test-subpbl1"]);
Walther@60571
    13
val (p,_,f,nxt,_,pt) = Test_Code.init_calc @{context} [(fmz, (dI',pI',mI'))];
Walther@60725
    14
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Model_Problem = tac;
Walther@60725
    15
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Specify_Theory "Test" = tac;
Walther@60725
    16
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Specify_Problem ["sqroot-test", "univariate", "equation", "test"] = tac;
Walther@60725
    17
(*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Specify_Method ["Test", "squ-equ-test-subpbl1"] = tac;
Walther@60725
    18
(*[1], Frm*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Apply_Method ["Test", "squ-equ-test-subpbl1"] = tac;
Walther@60725
    19
(*[1], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Rewrite_Set "norm_equation" = tac;
Walther@60725
    20
(*[2], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Rewrite_Set "Test_simplify" = tac;
Walther@60725
    21
(*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Subproblem ("Test", ["LINEAR", "univariate", "equation", "test"]) = tac;
Walther@60725
    22
(*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Model_Problem = tac;
Walther@60725
    23
(*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Specify_Theory "Test" = tac;
Walther@60725
    24
(*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Specify_Problem ["LINEAR", "univariate", "equation", "test"] = tac;
Walther@60725
    25
(*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Specify_Method ["Test", "solve_linear"] = tac;
Walther@60725
    26
(*[3, 1], Frm*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Apply_Method ["Test", "solve_linear"] = tac;
Walther@60725
    27
(*[3, 1], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Rewrite_Set_Inst (["(''bdv'', x)"], "isolate_bdv") = tac;
Walther@60725
    28
(*[3, 2], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Rewrite_Set "Test_simplify" = tac;
Walther@60725
    29
(*[3], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Check_Postcond ["LINEAR", "univariate", "equation", "test"] = tac;
walther@59686
    30
Walther@60675
    31
((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms @{context}) = "[]";(*isa*)
Walther@60675
    32
((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms @{context}) = "[\"matches (?a = ?b) (-1 + x = 0)\"]";(*REP*)
walther@60242
    33
(* there are questionable assumptions either --------- \<up> \<up> \<up> \<up> \<up> \<up> \<up> \<up> \<up> \<up> \<up>  \<up> ^^*)
walther@59686
    34
Walther@60725
    35
(*[4], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Check_elementwise "Assumptions" = tac;
walther@59686
    36
Walther@60675
    37
((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms @{context}) = "[]";(*isa*)
Walther@60675
    38
((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms @{context}) = "[\"precond_rootmet 1\"]";(*REP*)
walther@59686
    39
Walther@60725
    40
(*[], Res*)val ("ok", ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Check_Postcond ["sqroot-test", "univariate", "equation", "test"] = tac;
walther@59686
    41
Walther@60675
    42
((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms @{context}) = "[]";(*isa*)
Walther@60675
    43
((get_obj g_result pt (fst p)) |> snd |> UnparseC.terms @{context}) = "[\"precond_rootmet 1\"]";(*REP*)
walther@59686
    44
walther@59765
    45
(*[], Res*)val ("end-of-calculation", ([], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(**)
walther@59686
    46
walther@59686
    47
(*/--------------------- final test ----------------------------------\\*)
walther@59686
    48
val (res, asm) = (get_obj g_result pt (fst p));
walther@59686
    49
Walther@60675
    50
if UnparseC.term @{context} res = "[x = 1]" andalso
Walther@60675
    51
  map (UnparseC.term @{context}) asm = []    (* assumptions have gone to the ctxt *)
walther@59772
    52
then () else error "Minisubpbl/790-complete-NEXT_STEP.sml, find_next_step CHANGED";
walther@59686
    53
walther@59686
    54
if p = ([], Und)
walther@59686
    55
then
walther@59686
    56
  case get_obj g_tac pt (fst p) of
walther@59686
    57
    Apply_Method ["Test", "squ-equ-test-subpbl1"] => ()
walther@59722
    58
  | _ => error "Minisubpbl/790-complete-NEXT_STEP.sml, WRONG RESULT CHANGED 2"
Walther@60529
    59
else error "Minisubpbl/790-complete-NEXT_STEP.sml, WRONG RESULT CHANGED 1";
Walther@60529
    60
Walther@60533
    61
Proof_Context.theory_of (Ctree.get_ctxt pt p); (*"Test"*)