test/Tools/isac/IsacKnowledge/biegelinie.sml
branchisac-update-Isa09-2
changeset 37926 e6fc98fbcb85
parent 37924 6c53fe2519e5
child 37934 56f10b13005e
equal deleted inserted replaced
37925:d957275620d4 37926:e6fc98fbcb85
   154 			      eval_argument_in "Atools.argument'_in")
   154 			      eval_argument_in "Atools.argument'_in")
   155 			 ],
   155 			 ],
   156 		scr = EmptyScr};
   156 		scr = EmptyScr};
   157 val rm_ = str2term"[M_b 0 = 0, M_b L = 0]";
   157 val rm_ = str2term"[M_b 0 = 0, M_b L = 0]";
   158 val M__ = str2term"M_b x = -1 * x ^^^ 2 / 2 + x * c + c_2";
   158 val M__ = str2term"M_b x = -1 * x ^^^ 2 / 2 + x * c + c_2";
   159 val Some (e1__,_) = 
   159 val SOME (e1__,_) = 
   160     rewrite_set_ thy false srls 
   160     rewrite_set_ thy false srls 
   161 		 (str2term"(nth_::[real,bool list]=>bool) 1 " $ rm_);
   161 		 (str2term"(nth_::[real,bool list]=>bool) 1 " $ rm_);
   162 if term2str e1__ = "M_b 0 = 0" then ()
   162 if term2str e1__ = "M_b 0 = 0" then ()
   163 else raise error "biegelinie.sml simplify nth_ 1 rm_";
   163 else raise error "biegelinie.sml simplify nth_ 1 rm_";
   164 
   164 
   165 val Some (x1__,_) = 
   165 val SOME (x1__,_) = 
   166     rewrite_set_ thy false srls 
   166     rewrite_set_ thy false srls 
   167 		 (str2term"argument_in (lhs (M_b 0 = 0))");
   167 		 (str2term"argument_in (lhs (M_b 0 = 0))");
   168 if term2str x1__ = "0" then ()
   168 if term2str x1__ = "0" then ()
   169 else raise error "biegelinie.sml simplify argument_in (lhs (M_b 0 = 0)";
   169 else raise error "biegelinie.sml simplify argument_in (lhs (M_b 0 = 0)";
   170 
   170 
   460  moveActiveRoot 1;
   460  moveActiveRoot 1;
   461  autoCalculate 1 CompleteCalcHead; 
   461  autoCalculate 1 CompleteCalcHead; 
   462 
   462 
   463  fetchProposedTactic 1 (*->"Apply_Method" IntegrierenUndKonstanteBestimmen*);
   463  fetchProposedTactic 1 (*->"Apply_Method" IntegrierenUndKonstanteBestimmen*);
   464 (*
   464 (*
   465 > val (_,Apply_Method' (_, None, ScrState is), _)::_ = tacis;
   465 > val (_,Apply_Method' (_, NONE, ScrState is), _)::_ = tacis;
   466 > is = e_scrstate;
   466 > is = e_scrstate;
   467 val it = true : bool
   467 val it = true : bool
   468 *)
   468 *)
   469  autoCalculate 1 (Step 1) (*->GENERATED ([1], Frm)*);
   469  autoCalculate 1 (Step 1) (*->GENERATED ([1], Frm)*);
   470  val ((pt,_),_) = get_calc 1;
   470  val ((pt,_),_) = get_calc 1;
   720 val rb = str2term "[y 0 = 0, y L = 0, M_b 0 = 0, M_b L = 0]";
   720 val rb = str2term "[y 0 = 0, y L = 0, M_b 0 = 0, M_b L = 0]";
   721 
   721 
   722 "--- script expression 1";
   722 "--- script expression 1";
   723 val screxp1_ = str2term "Take (nth_ 1 (rb_::bool list))";
   723 val screxp1_ = str2term "Take (nth_ 1 (rb_::bool list))";
   724 val screxp1  = subst_atomic [(rb_, rb)] screxp1_; term2str screxp1;
   724 val screxp1  = subst_atomic [(rb_, rb)] screxp1_; term2str screxp1;
   725 val Some (b1,_) = rewrite_set_ Isac.thy false srls2 screxp1; term2str b1;
   725 val SOME (b1,_) = rewrite_set_ Isac.thy false srls2 screxp1; term2str b1;
   726 if term2str b1 = "Take (y 0 = 0)" then ()
   726 if term2str b1 = "Take (y 0 = 0)" then ()
   727 else raise error "biegelinie.sml: rew. Bieglie2 --1";
   727 else raise error "biegelinie.sml: rew. Bieglie2 --1";
   728 val b1 = str2term "(y 0 = 0)";
   728 val b1 = str2term "(y 0 = 0)";
   729 
   729 
   730 "--- script expression 2";
   730 "--- script expression 2";
   731 val screxp2_ = str2term "filter (sameFunId (lhs b1_)) funs_";
   731 val screxp2_ = str2term "filter (sameFunId (lhs b1_)) funs_";
   732 val b1_ = str2term "b1_::bool";
   732 val b1_ = str2term "b1_::bool";
   733 val screxp2 = subst_atomic [(b1_,b1),(funs_,funs)] screxp2_; term2str screxp2;
   733 val screxp2 = subst_atomic [(b1_,b1),(funs_,funs)] screxp2_; term2str screxp2;
   734 val Some (fs,_) = rewrite_set_ Isac.thy false srls2 screxp2; term2str fs;
   734 val SOME (fs,_) = rewrite_set_ Isac.thy false srls2 screxp2; term2str fs;
   735 if term2str fs =  "[y x =\n c_4 + c_3 * x +\n 1 / (-1 * EI) *\n (c_2 / 2 * x ^^^ 2 + c / 6 * x ^^^ 3 + -1 * q_0 / 24 * x ^^^ 4)]" then ()
   735 if term2str fs =  "[y x =\n c_4 + c_3 * x +\n 1 / (-1 * EI) *\n (c_2 / 2 * x ^^^ 2 + c / 6 * x ^^^ 3 + -1 * q_0 / 24 * x ^^^ 4)]" then ()
   736 else raise error "biegelinie.sml: rew. Bieglie2 --2";
   736 else raise error "biegelinie.sml: rew. Bieglie2 --2";
   737 
   737 
   738 "--- script expression 3";
   738 "--- script expression 3";
   739 val screxp3_ = str2term "SubProblem (Biegelinie_,[makeFunctionTo,equation],\
   739 val screxp3_ = str2term "SubProblem (Biegelinie_,[makeFunctionTo,equation],\
   740 \                          [Equation,fromFunction])         \
   740 \                          [Equation,fromFunction])         \
   741 \                          [bool_ (hd fs_), bool_ b1_]";
   741 \                          [bool_ (hd fs_), bool_ b1_]";
   742 val fs_ = str2term "fs_::bool list";
   742 val fs_ = str2term "fs_::bool list";
   743 val screxp3 = subst_atomic [(fs_,fs),(b1_,b1)] screxp3_; 
   743 val screxp3 = subst_atomic [(fs_,fs),(b1_,b1)] screxp3_; 
   744 writeln (term2str screxp3);
   744 writeln (term2str screxp3);
   745 val Some (equ,_) = rewrite_set_ Isac.thy false srls2 screxp3; 
   745 val SOME (equ,_) = rewrite_set_ Isac.thy false srls2 screxp3; 
   746 if term2str equ = "SubProblem\n (Biegelinie_, [makeFunctionTo, equation], [Equation, fromFunction])\n [bool_\n   (y x =\n    c_4 + c_3 * x +\n    1 / (-1 * EI) *\n    (c_2 / 2 * x ^^^ 2 + c / 6 * x ^^^ 3 + -1 * q_0 / 24 * x ^^^ 4)),\n  bool_ (y 0 = 0)]" then ()
   746 if term2str equ = "SubProblem\n (Biegelinie_, [makeFunctionTo, equation], [Equation, fromFunction])\n [bool_\n   (y x =\n    c_4 + c_3 * x +\n    1 / (-1 * EI) *\n    (c_2 / 2 * x ^^^ 2 + c / 6 * x ^^^ 3 + -1 * q_0 / 24 * x ^^^ 4)),\n  bool_ (y 0 = 0)]" then ()
   747 else raise error "biegelinie.sml: rew. Bieglie2 --3";
   747 else raise error "biegelinie.sml: rew. Bieglie2 --3";
   748 writeln (term2str equ);
   748 writeln (term2str equ);
   749 (*SubProblem
   749 (*SubProblem
   750  (Biegelinie_, [makeFunctionTo, equation], [Equation, fromFunction])
   750  (Biegelinie_, [makeFunctionTo, equation], [Equation, fromFunction])
  1017 		       Thm ("if_False",num_str if_False)
  1017 		       Thm ("if_False",num_str if_False)
  1018 		       ]
  1018 		       ]
  1019 		      ;
  1019 		      ;
  1020 val t = str2term "last [1,2,3,4]";
  1020 val t = str2term "last [1,2,3,4]";
  1021 trace_rewrite := true;
  1021 trace_rewrite := true;
  1022 val Some (e1__,_) = rewrite_set_ thy false srls t;
  1022 val SOME (e1__,_) = rewrite_set_ thy false srls t;
  1023 trace_rewrite := false;
  1023 trace_rewrite := false;
  1024 term2str e1__;
  1024 term2str e1__;
  1025 
  1025 
  1026 trace_script := true;
  1026 trace_script := true;
  1027 trace_script := false;
  1027 trace_script := false;