neuper@37906: (* neuper@37906: use"systest/tacis.sml"; neuper@37906: use"tacis.sml"; neuper@37906: *) neuper@37906: "================================================================="; neuper@37906: "------ fetchProposedTactic -> autoCalculate (Step1 ) ------------"; neuper@37906: "------ setNextTactic -> autoCalculate (Step1 ) ------------------"; neuper@37906: "================================================================="; neuper@37906: neuper@37906: neuper@37906: neuper@37906: "------ fetchProposedTactic -> autoCalculate (Step1 ) ------------"; neuper@37906: "------ fetchProposedTactic -> autoCalculate (Step1 ) ------------"; neuper@37906: "------ fetchProposedTactic -> autoCalculate (Step1 ) ------------"; neuper@37906: states:=[]; neuper@37906: CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"], neuper@37906: ("Test.thy", neuper@37906: ["sqroot-test","univariate","equation","test"], neuper@37906: ["Test","squ-equ-test-subpbl1"]))]; neuper@37906: Iterator 1; moveActiveRoot 1; neuper@37906: autoCalculate 1 CompleteCalcHead; neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*x + 1 = 2*); neuper@37906: neuper@37906: fetchProposedTactic 1 (*'Rewrite_Set norm_equation' in tacis*); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*x + 1 + -1 * 2 = 0*); neuper@37906: neuper@37906: fetchProposedTactic 1 (*'Rewrite_Set Test_simplify' in tacis*); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*-1 + x = 0*); neuper@37906: val ((pt,_),_) = get_calc 1; neuper@37906: val str = pr_ptree pr_short pt; neuper@37906: writeln str; neuper@37906: neuper@37906: fetchProposedTactic 1 (*'Subproblem ...' in tacis*); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*solve (-1 + x = 0,x)*); neuper@37906: neuper@37906: fetchProposedTactic 1 (*'Model_Problem' in tacis*); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*equality ///*); neuper@37926: (*----- WN060222 since complete_mod_ case cas of SOME headline ----- neuper@37906: fetchProposedTactic 1 (*'Add_Given equality (-1 + x = 0)' in tacis*); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*equality (-1 + x =0)*); neuper@37906: ---------------------------------------------------------------------*) neuper@37906: neuper@37906: fetchProposedTactic 1 (*'Add_Given solveFor x' in tacis*); neuper@37926: (*----- WN060222 since complete_mod_ case cas of SOME headline: neuper@37906: (*Specify_Theory Test.thy*) neuper@37906: ---------------------------------------------------------------------*) neuper@37906: autoCalculate 1 CompleteCalcHead; refFormula 1 (get_pos 1 1) (*OK*); neuper@37906: (*###########################################autoCalculate 1 (Step 1);*) neuper@37906: fetchProposedTactic 1 (*'Apply_Method Test solve_linear' in tacis*); neuper@37906: (* there was the only error ^^^^^^^^^ in step/nxt_solv ..Apply_Method.. neuper@37906: val (str', (tacis', (pt',p'))) = step ip (ptp, tacis); neuper@37906: writeln (tacis2str tacis'); neuper@37906: ######################################################################*) neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*-1 + x = 0*); neuper@37906: neuper@37906: fetchProposedTactic 1 (*'Rewrite_Set_Inst isolate_bdv' in tacis*); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*x = 0 + -1 * -1*); neuper@37906: neuper@37906: fetchProposedTactic 1 (*'Rewrite_Set Test_simplify' in tacis*); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*x = 1*); neuper@37906: val ((pt,_),_) = get_calc 1; neuper@37906: val str = pr_ptree pr_short pt; neuper@37906: writeln str; neuper@37906: neuper@37906: fetchProposedTactic 1 (*'Check_Postcond linear...' in tacis*); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*[x = 1]*); neuper@37906: neuper@37906: fetchProposedTactic 1 (*'Check_elementwise Assumptions' in tacis*); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*[x = 1]*); neuper@37906: neuper@37906: fetchProposedTactic 1 (*'Check_Postcond sqroot-test...' in tacis*); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*[x = 1]*); neuper@37906: neuper@37906: fetchProposedTactic 1 (*'' in tacis*); neuper@37906: val ((pt,p),tacis) = get_calc 1; neuper@37906: val ip = get_pos 1 1; neuper@37906: val (Form f, tac, asms) = pt_extract (pt, p); neuper@37906: if term2str f = "[x = 1]"andalso p = ([],Res) andalso ip = ([],Res)then()else neuper@37906: raise error "tacis.sml: diff.behav. in fetchProposedTactic autoCalculate"; neuper@37906: neuper@37906: neuper@37906: neuper@37906: "------ setNextTactic -> autoCalculate (Step1 ) ------------------"; neuper@37906: "------ setNextTactic -> autoCalculate (Step1 ) ------------------"; neuper@37906: "------ setNextTactic -> autoCalculate (Step1 ) ------------------"; neuper@37906: states:=[]; neuper@37906: CalcTree [(["equality (x+1=2)", "solveFor x","solutions L"], neuper@37906: ("Test.thy", neuper@37906: ["sqroot-test","univariate","equation","test"], neuper@37906: ["Test","squ-equ-test-subpbl1"]))]; neuper@37906: Iterator 1; moveActiveRoot 1; neuper@37906: autoCalculate 1 CompleteCalcHead; neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*x + 1 = 2*); neuper@37906: neuper@37906: setNextTactic 1 (Rewrite_Set "norm_equation"); neuper@37906: val (_, tacis) = get_calc 1; neuper@37906: case tacis of [(Rewrite_Set "norm_equation",_,(([1], Res), _))] => () | _ => neuper@37906: raise error "tacis.sml: diff.behav. in setNextTactic -> autoCalculate (1)"; neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*x + 1 + -1 * 2 = 0*); neuper@37906: neuper@37906: setNextTactic 1 (Rewrite_Set "Test_simplify"); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*-1 + x = 0*); neuper@37906: val ((pt,_),_) = get_calc 1; neuper@37906: val str = pr_ptree pr_short pt; neuper@37906: writeln str; neuper@37906: neuper@37906: setNextTactic 1 (Subproblem ("Test.thy",["linear","univariate", neuper@37906: "equation","test"])); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*solve (-1 + x = 0, x)*); neuper@37906: val ((pt,_),_) = get_calc 1; neuper@37906: val str = pr_ptree pr_short pt; neuper@37906: writeln str; neuper@37906: neuper@37906: setNextTactic 1 (Model_Problem (*["linear","univariate","equation","test"]*)); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*equality ///*); neuper@37906: neuper@37906: setNextTactic 1 (Add_Given "equality (-1 + x = 0)"); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*equality (-1 + x = 0)*); neuper@37906: neuper@37906: setNextTactic 1 (Add_Given "solveFor x"); neuper@37906: autoCalculate 1 CompleteCalcHead; refFormula 1 (get_pos 1 1) (*OK*); neuper@37906: neuper@37906: setNextTactic 1 (Apply_Method ["Test", "solve_linear"]); neuper@37906: val (_, tacis) = get_calc 1; neuper@37906: case tacis of neuper@37906: [((Apply_Method ["Test","solve_linear"],_,(([3,1], Frm), _)))] =>() | _ => neuper@37906: raise error "tacis.sml: diff.behav. in setNextTactic -> autoCalculate (2)"; neuper@37906: (*#######################################################################*) neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*-1 + x = 0*); neuper@37906: neuper@37906: setNextTactic 1 (Rewrite_Set_Inst (["(bdv,x)"], "isolate_bdv")); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*x = 0 + -1 * -1*); neuper@37906: neuper@37906: setNextTactic 1 (Rewrite_Set "Test_simplify"); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*x = 1*); neuper@37906: neuper@37906: setNextTactic 1 (Check_Postcond ["linear","univariate","equation","test"]); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*[x = 1]*); neuper@37906: neuper@37906: setNextTactic 1 (Check_elementwise "Assumptions"); neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*[x = 1]*); neuper@37906: val ((pt,_),_) = get_calc 1; neuper@37906: val str = pr_ptree pr_short pt; neuper@37906: writeln str; neuper@37906: neuper@37906: setNextTactic 1 (Check_Postcond neuper@37906: ["sqroot-test","univariate","equation","test"]); neuper@37906: val (_, tacis) = get_calc 1; neuper@37906: neuper@37906: (*case tacis of 040609 suddenly ???! neuper@37906: [((Check_Postcond _, _,(([], Res), _)))] =>() | _ => neuper@37906: raise error "tacis.sml: diff.behav. in setNextTactic -> autoCalculate (3)"; neuper@37906: #######################################################################*) neuper@37906: autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*[x = 1]*); neuper@37906: neuper@37906: val ((pt,p),tacis) = get_calc 1; neuper@37906: val ip = get_pos 1 1; neuper@37906: val (Form f, tac, asms) = pt_extract (pt, p); neuper@37906: if term2str f = "[x = 1]"andalso p = ([],Res) andalso ip = ([],Res)then()else neuper@37906: raise error "tacis.sml: diff.behav. in setNextTactic -> autoCalculate (4)"; neuper@37906: neuper@37906: neuper@37906: