test/Tools/isac/Knowledge/diffapp.sml
branchisac-update-Isa09-2
changeset 38031 460c24a6a6ba
parent 37995 fac82f29f143
child 38043 6a36acec95d9
equal deleted inserted replaced
38030:95d956108461 38031:460c24a6a6ba
   278 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   278 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   279 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   279 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   280 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   280 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   281 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   281 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   282 case nxt of (_, Specify_Method ["DiffApp","max_by_calculus"]) => ()
   282 case nxt of (_, Specify_Method ["DiffApp","max_by_calculus"]) => ()
   283 	  | _ => raise error "diffapp.sml: max-exp me, nxt = Specify_Method";
   283 	  | _ => error "diffapp.sml: max-exp me, nxt = Specify_Method";
   284 
   284 
   285 val oris = fst3 (get_obj g_origin pt (fst p)); writeln(oris2str oris);
   285 val oris = fst3 (get_obj g_origin pt (fst p)); writeln(oris2str oris);
   286 val pits = get_obj g_pbl pt (fst p); writeln(itms2str_ ctxt pits);
   286 val pits = get_obj g_pbl pt (fst p); writeln(itms2str_ ctxt pits);
   287 
   287 
   288 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   288 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   289 val mits = get_obj g_met pt (fst p); writeln(itms2str_ ctxt mits);
   289 val mits = get_obj g_met pt (fst p); writeln(itms2str_ ctxt mits);
   290 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   290 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   291 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   291 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   292 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   292 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   293 case nxt of (_,Apply_Method ["DiffApp","max_by_calculus"] ) => ()
   293 case nxt of (_,Apply_Method ["DiffApp","max_by_calculus"] ) => ()
   294 	  | _ => raise error "diffapp.sml: max-exp me, nxt = Apply_Method";
   294 	  | _ => error "diffapp.sml: max-exp me, nxt = Apply_Method";
   295 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   295 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   296 
   296 
   297 (*since 0508 Apply_Method does the 1st step, if NONE init_form -------------
   297 (*since 0508 Apply_Method does the 1st step, if NONE init_form -------------
   298 (*val nxt = ("Subproblem",Subproblem ("DiffApp",["make","function"]))*)
   298 (*val nxt = ("Subproblem",Subproblem ("DiffApp",["make","function"]))*)
   299 val (p,_,f,nxt,_,pt) = (me nxt p c pt) handle e => print_exn_G e;
   299 val (p,_,f,nxt,_,pt) = (me nxt p c pt) handle e => print_exn_G e;
   300 (*val nxt = ("Refine_Tacitly",Refine_Tacitly ["make","function"])*)
   300 (*val nxt = ("Refine_Tacitly",Refine_Tacitly ["make","function"])*)
   301 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   301 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   302 (*val nxt = ("Model_Problem",Model_Problem ["by_explicit","make","function"])*)
   302 (*val nxt = ("Model_Problem",Model_Problem ["by_explicit","make","function"])*)
   303 ----------------------------------------------------------------------------*)
   303 ----------------------------------------------------------------------------*)
   304 case nxt of (_, Model_Problem(*["by_explicit", "make", "function"]*)) => ()
   304 case nxt of (_, Model_Problem(*["by_explicit", "make", "function"]*)) => ()
   305 	  | _ => raise error "diffapp.sml: max-exp me, nxt = Model_Problem";
   305 	  | _ => error "diffapp.sml: max-exp me, nxt = Model_Problem";
   306 
   306 
   307 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   307 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   308 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   308 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   309 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   309 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   310 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   310 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   316 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   316 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   317 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   317 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   318 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   318 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   319 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   319 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   320 case nxt of (_, Apply_Method ["DiffApp", "make_fun_by_explicit"]) => ()
   320 case nxt of (_, Apply_Method ["DiffApp", "make_fun_by_explicit"]) => ()
   321 	  | _ => raise error "diffapp.sml: max-exp Apply_Method ([1], Met) ";
   321 	  | _ => error "diffapp.sml: max-exp Apply_Method ([1], Met) ";
   322 
   322 
   323 (*----since WN050901 (ie. corr. mathengine#nxt_specify_ ..nxt_spec Pbl->p_
   323 (*----since WN050901 (ie. corr. mathengine#nxt_specify_ ..nxt_spec Pbl->p_
   324 we get at ...
   324 we get at ...
   325 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   325 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   326 ...
   326 ...
   427  val ((pt,p),_) = get_calc 1;
   427  val ((pt,p),_) = get_calc 1;
   428  val mits = get_obj g_met pt (fst p);
   428  val mits = get_obj g_met pt (fst p);
   429  writeln (itms2str_ ctxt mits);
   429  writeln (itms2str_ ctxt mits);
   430 (*
   430 (*
   431  if itms2str_ ctxt mits = "[\n(1 ,[1] ,true ,#Given ,Cor functionEq (hd r_s) ,(t_, [hd r_s])),\n(2 ,[1] ,true ,#Given ,Cor boundVariable v_v ,(v_, [v_])),\n(3 ,[1] ,true ,#Given ,Cor interval itv_ ,(itv_, [itv_])),\n(4 ,[1] ,true ,#Find ,Cor maxArgument v__0 ,(v_0, [v__0]))]" then ()
   431  if itms2str_ ctxt mits = "[\n(1 ,[1] ,true ,#Given ,Cor functionEq (hd r_s) ,(t_, [hd r_s])),\n(2 ,[1] ,true ,#Given ,Cor boundVariable v_v ,(v_, [v_])),\n(3 ,[1] ,true ,#Given ,Cor interval itv_ ,(itv_, [itv_])),\n(4 ,[1] ,true ,#Find ,Cor maxArgument v__0 ,(v_0, [v__0]))]" then ()
   432  else raise error "diffapp.sml: diff.behav. in autoCalc .. scripts for max 1";
   432  else error "diffapp.sml: diff.behav. in autoCalc .. scripts for max 1";
   433 *)
   433 *)
   434  (*FIXME: the environments contain identifers, and NOT values ?!?!?*)
   434  (*FIXME: the environments contain identifers, and NOT values ?!?!?*)
   435 (* WN051209 while extending 'fun step' for initac, this became better ...
   435 (* WN051209 while extending 'fun step' for initac, this became better ...
   436  if itms2str_ ctxt mits = "[\n(1 ,[1,2,3] ,true ,#Given ,Cor fixedValues [r = Arbfix] ,(f_ix, [[r = Arbfix]])),\n(2 ,[1,2,3] ,true ,#Find ,Cor maximum A ,(m_, [A])),\n(3 ,[1,2,3] ,true ,#Find ,Cor valuesFor [a, b] ,(v_s, [[a],[b]])),\n(4 ,[1,2] ,true ,#Relate ,Cor relations [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2] ,(r_s, [[A = a * b],[(a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]])),\n(6 ,[1] ,true ,#undef ,Cor boundVariable a ,(v_, [a])),\n(9 ,[1,2] ,true ,#undef ,Cor interval {x. 0 <= x & x <= 2 * r} ,(itv_, [{x. 0 <= x & x <= 2 * r}])),\n(11 ,[1,2,3] ,true ,#undef ,Cor errorBound (eps = 0) ,(err_, [eps = 0]))]" then ()
   436  if itms2str_ ctxt mits = "[\n(1 ,[1,2,3] ,true ,#Given ,Cor fixedValues [r = Arbfix] ,(f_ix, [[r = Arbfix]])),\n(2 ,[1,2,3] ,true ,#Find ,Cor maximum A ,(m_, [A])),\n(3 ,[1,2,3] ,true ,#Find ,Cor valuesFor [a, b] ,(v_s, [[a],[b]])),\n(4 ,[1,2] ,true ,#Relate ,Cor relations [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2] ,(r_s, [[A = a * b],[(a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]])),\n(6 ,[1] ,true ,#undef ,Cor boundVariable a ,(v_, [a])),\n(9 ,[1,2] ,true ,#undef ,Cor interval {x. 0 <= x & x <= 2 * r} ,(itv_, [{x. 0 <= x & x <= 2 * r}])),\n(11 ,[1,2,3] ,true ,#undef ,Cor errorBound (eps = 0) ,(err_, [eps = 0]))]" then ()
   437  else raise error "diffapp.sml: diff.behav. in autoCalc .. scripts for max 1";
   437  else error "diffapp.sml: diff.behav. in autoCalc .. scripts for max 1";
   438 *)
   438 *)
   439 
   439 
   440 
   440 
   441 
   441 
   442 "--------------------- 30.4.03: maximum .. rewrite_set_ list_rls ---------";
   442 "--------------------- 30.4.03: maximum .. rewrite_set_ list_rls ---------";
   476 val s = subst_atomic env t;
   476 val s = subst_atomic env t;
   477 term2str s;
   477 term2str s;
   478 "(hd o filterVar A) [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]";
   478 "(hd o filterVar A) [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]";
   479 val SOME (s',_) = rewrite_set_ thy false list_rls s;
   479 val SOME (s',_) = rewrite_set_ thy false list_rls s;
   480 val s'' = term2str s';
   480 val s'' = term2str s';
   481 if s''="A = a * b" then () else raise error "new behaviour with list_rls 1.1.";
   481 if s''="A = a * b" then () else error "new behaviour with list_rls 1.1.";
   482 val env = env @ [(str2term "e_::bool",str2term "A = a * b")];
   482 val env = env @ [(str2term "e_::bool",str2term "A = a * b")];
   483 
   483 
   484 (*--- 2.line: condition alone ---*)
   484 (*--- 2.line: condition alone ---*)
   485 val t = str2term "1 < length_ (r_s::bool list)";
   485 val t = str2term "1 < length_ (r_s::bool list)";
   486 val s = subst_atomic env t;
   486 val s = subst_atomic env t;
   487 term2str s;
   487 term2str s;
   488 "1 < length_ [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]";
   488 "1 < length_ [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]";
   489 val SOME (s',_) = rewrite_set_ thy false list_rls s;
   489 val SOME (s',_) = rewrite_set_ thy false list_rls s;
   490 val s'' = term2str s';
   490 val s'' = term2str s';
   491 if s''="True" then () else raise error "new behaviour with list_rls 1.2.";
   491 if s''="True" then () else error "new behaviour with list_rls 1.2.";
   492 
   492 
   493 (*--- 2.line in script ---*)
   493 (*--- 2.line in script ---*)
   494 val t = str2term 
   494 val t = str2term 
   495 	    "(if 1 < length_ r_s                            \
   495 	    "(if 1 < length_ r_s                            \
   496    \           then (SubProblem (Reals_,[make,function],[no_met])\
   496    \           then (SubProblem (Reals_,[make,function],[no_met])\
   507 val s'' = term2str s';
   507 val s'' = term2str s';
   508 if s'' = 
   508 if s'' = 
   509 "SubProblem (Reals_, [make, function], [no_met])\n\
   509 "SubProblem (Reals_, [make, function], [no_met])\n\
   510 \ [REAL A, REAL b,\n\
   510 \ [REAL A, REAL b,\n\
   511 \  BOOL_LIST [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]]" then ()
   511 \  BOOL_LIST [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]]" then ()
   512 else raise error "new behaviour with list_rls 1.3.";
   512 else error "new behaviour with list_rls 1.3.";
   513 val env = env @ [(str2term "t_::bool",
   513 val env = env @ [(str2term "t_::bool",
   514 		  str2term "A = (2*sqrt(r^^^2-(b/2)^^^2)) * b")];
   514 		  str2term "A = (2*sqrt(r^^^2-(b/2)^^^2)) * b")];
   515 
   515 
   516 
   516 
   517 
   517 
   542 term2str s;
   542 term2str s;
   543 val t = str2term 
   543 val t = str2term 
   544      "(hd o filterVar b) [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]";
   544      "(hd o filterVar b) [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]";
   545 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   545 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   546 val s' = term2str t';
   546 val s' = term2str t';
   547 if s' = "A = a * b" then () else raise error "new behaviour with list_rls 2.1";
   547 if s' = "A = a * b" then () else error "new behaviour with list_rls 2.1";
   548 val env = env @ [(str2term "h_::bool", str2term s')];
   548 val env = env @ [(str2term "h_::bool", str2term s')];
   549 
   549 
   550 (*--- 2.line in script ---*)
   550 (*--- 2.line in script ---*)
   551 val t = str2term "hd (dropWhile (ident h_) (eqs::bool list))";
   551 val t = str2term "hd (dropWhile (ident h_) (eqs::bool list))";
   552 val s = subst_atomic env t;
   552 val s = subst_atomic env t;
   557 mem_rls "dropWhile_Cons" list_rls;
   557 mem_rls "dropWhile_Cons" list_rls;
   558 mem_rls "Atools.ident" list_rls;
   558 mem_rls "Atools.ident" list_rls;
   559 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   559 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   560 val s' = term2str t';
   560 val s' = term2str t';
   561 if s' = "(a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2" then () 
   561 if s' = "(a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2" then () 
   562 else raise error "new behaviour with list_rls 2.2";
   562 else error "new behaviour with list_rls 2.2";
   563 val env = env @ [(str2term "e_1::bool", str2term s')];
   563 val env = env @ [(str2term "e_1::bool", str2term s')];
   564 
   564 
   565 (*--- 3.line in script ---*)
   565 (*--- 3.line in script ---*)
   566 val t = str2term "dropWhile (ident f_) (Vars (h_::bool))";
   566 val t = str2term "dropWhile (ident f_) (Vars (h_::bool))";
   567 val s = subst_atomic env t;
   567 val s = subst_atomic env t;
   568 term2str s;
   568 term2str s;
   569 val t = str2term "dropWhile (ident A) (Vars (A = a * b))";
   569 val t = str2term "dropWhile (ident A) (Vars (A = a * b))";
   570 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   570 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   571 val s' = term2str t';
   571 val s' = term2str t';
   572 if s' = "[a, b]" then () else raise error "new behaviour with list_rls 2.3";
   572 if s' = "[a, b]" then () else error "new behaviour with list_rls 2.3";
   573 val env = env @ [(str2term "vs_::real list", str2term s')];
   573 val env = env @ [(str2term "vs_::real list", str2term s')];
   574 
   574 
   575 (*--- 4.line in script ---*)
   575 (*--- 4.line in script ---*)
   576 val t = str2term "hd (dropWhile (ident v_v) v_s)";
   576 val t = str2term "hd (dropWhile (ident v_v) v_s)";
   577 val s = subst_atomic env t;
   577 val s = subst_atomic env t;
   578 term2str s;
   578 term2str s;
   579 val t = str2term "hd (dropWhile (ident b) [a, b])";
   579 val t = str2term "hd (dropWhile (ident b) [a, b])";
   580 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   580 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   581 val s' = term2str t';
   581 val s' = term2str t';
   582 if s' = "a" then () else raise error "new behaviour with list_rls 2.4.";
   582 if s' = "a" then () else error "new behaviour with list_rls 2.4.";
   583 val env = env @ [(str2term "v_1::real", str2term s')];
   583 val env = env @ [(str2term "v_1::real", str2term s')];
   584 
   584 
   585 (*--- 5.line in script ---*)
   585 (*--- 5.line in script ---*)
   586 val t = str2term "(SubProblem(Reals_,[univar,equation],[no_met])\
   586 val t = str2term "(SubProblem(Reals_,[univar,equation],[no_met])\
   587 		 \           [BOOL e_1, REAL v_1])";
   587 		 \           [BOOL e_1, REAL v_1])";
   601 \ (A = a * b)";
   601 \ (A = a * b)";
   602 mem_rls "Tools.rhs" list_rls;
   602 mem_rls "Tools.rhs" list_rls;
   603 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   603 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   604 val s' = term2str t';
   604 val s' = term2str t';
   605 if s' = "Substitute [a = 2 * sqrt (r ^^^ 2 - (b / 2) ^^^ 2)] (A = a * b)" 
   605 if s' = "Substitute [a = 2 * sqrt (r ^^^ 2 - (b / 2) ^^^ 2)] (A = a * b)" 
   606 then () else raise error "new behaviour with list_rls 2.6.";
   606 then () else error "new behaviour with list_rls 2.6.";
   607 
   607 
   608 
   608 
   609 "---------------------- 2.5.03: Make_fun_by_new_variable -----------------";
   609 "---------------------- 2.5.03: Make_fun_by_new_variable -----------------";
   610 "---------------------- 2.5.03: Make_fun_by_new_variable -----------------";
   610 "---------------------- 2.5.03: Make_fun_by_new_variable -----------------";
   611 "---------------------- 2.5.03: Make_fun_by_new_variable -----------------";
   611 "---------------------- 2.5.03: Make_fun_by_new_variable -----------------";
   640 "(hd o filterVar A) [A = a * b, a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
   640 "(hd o filterVar A) [A = a * b, a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
   641 trace_rewrite:=true;
   641 trace_rewrite:=true;
   642 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   642 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   643 trace_rewrite:=false;
   643 trace_rewrite:=false;
   644 val s' = term2str t';
   644 val s' = term2str t';
   645 if s' = "A = a * b" then() else raise error "new behaviour with list_rls 3.1.";
   645 if s' = "A = a * b" then() else error "new behaviour with list_rls 3.1.";
   646 val env = env @ [(str2term "h_::bool", str2term s')];
   646 val env = env @ [(str2term "h_::bool", str2term s')];
   647 
   647 
   648 (*--- 2.line in script ---*)
   648 (*--- 2.line in script ---*)
   649 val t = str2term "dropWhile (ident (h_::bool)) (eqs::bool list)";
   649 val t = str2term "dropWhile (ident (h_::bool)) (eqs::bool list)";
   650 val s = subst_atomic env t;
   650 val s = subst_atomic env t;
   653 "dropWhile (ident (A = a * b))\
   653 "dropWhile (ident (A = a * b))\
   654 \ [A = a * b, a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
   654 \ [A = a * b, a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
   655 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   655 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   656 val s' = term2str t';
   656 val s' = term2str t';
   657 if s' = "[a / 2 = r * sin alpha, b / 2 = r * cos alpha]" 
   657 if s' = "[a / 2 = r * sin alpha, b / 2 = r * cos alpha]" 
   658 then () else raise error "new behaviour with list_rls 3.2.";
   658 then () else error "new behaviour with list_rls 3.2.";
   659 val env = env @ [(str2term "es_::bool list", str2term s')];
   659 val env = env @ [(str2term "es_::bool list", str2term s')];
   660 
   660 
   661 (*--- 3.line in script ---*)
   661 (*--- 3.line in script ---*)
   662 val t = str2term "dropWhile (ident (f_f::real)) (Vars (h_::bool))";
   662 val t = str2term "dropWhile (ident (f_f::real)) (Vars (h_::bool))";
   663 val s = subst_atomic env t;
   663 val s = subst_atomic env t;
   664 term2str s;
   664 term2str s;
   665 val t = str2term "dropWhile (ident A) (Vars (A = a * b))";
   665 val t = str2term "dropWhile (ident A) (Vars (A = a * b))";
   666 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   666 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   667 val s' = term2str t';
   667 val s' = term2str t';
   668 if s' = "[a, b]" then () else raise error "new behaviour with list_rls 3.3.";
   668 if s' = "[a, b]" then () else error "new behaviour with list_rls 3.3.";
   669 val env = env @ [(str2term "vs_::real list", str2term s')];
   669 val env = env @ [(str2term "vs_::real list", str2term s')];
   670 
   670 
   671 (*--- 4.line in script ---*)
   671 (*--- 4.line in script ---*)
   672 val t = str2term "nth_ 1 v_s";
   672 val t = str2term "nth_ 1 v_s";
   673 val s = subst_atomic env t;
   673 val s = subst_atomic env t;
   674 term2str s;
   674 term2str s;
   675 val t = str2term "nth_ 1 [a, b]";
   675 val t = str2term "nth_ 1 [a, b]";
   676 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   676 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   677 val s' = term2str t';
   677 val s' = term2str t';
   678 if s' = "a" then () else raise error "new behaviour with list_rls 3.4.";
   678 if s' = "a" then () else error "new behaviour with list_rls 3.4.";
   679 val env = env @ [(str2term "v_1", str2term s')];
   679 val env = env @ [(str2term "v_1", str2term s')];
   680 
   680 
   681 (*--- 5.line in script ---*)
   681 (*--- 5.line in script ---*)
   682 val t = str2term "nth_ 2 v_s";
   682 val t = str2term "nth_ 2 v_s";
   683 val s = subst_atomic env t;
   683 val s = subst_atomic env t;
   684 term2str s;
   684 term2str s;
   685 val t = str2term "nth_ 2 [a, b]";
   685 val t = str2term "nth_ 2 [a, b]";
   686 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   686 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   687 val s' = term2str t';
   687 val s' = term2str t';
   688 if s' = "b" then () else raise error "new behaviour with list_rls 3.5.";
   688 if s' = "b" then () else error "new behaviour with list_rls 3.5.";
   689 val env = env @ [(str2term "v_2", str2term s')];
   689 val env = env @ [(str2term "v_2", str2term s')];
   690 
   690 
   691 (*--- 6.line in script ---*)
   691 (*--- 6.line in script ---*)
   692 val t = str2term "(hd o (filterVar v_1)) (es_::bool list)";
   692 val t = str2term "(hd o (filterVar v_1)) (es_::bool list)";
   693 val s = subst_atomic env t;
   693 val s = subst_atomic env t;
   695 val t = str2term 
   695 val t = str2term 
   696 	   "(hd o filterVar a) [a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
   696 	   "(hd o filterVar a) [a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
   697 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   697 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   698 val s' = term2str t';
   698 val s' = term2str t';
   699 if s' = "a / 2 = r * sin alpha" then () 
   699 if s' = "a / 2 = r * sin alpha" then () 
   700 else raise error "new behaviour with list_rls 3.6.";
   700 else error "new behaviour with list_rls 3.6.";
   701 val e_1 = str2term "e_1::bool";
   701 val e_1 = str2term "e_1::bool";
   702 val env = env @ [(e_1, str2term s')];
   702 val env = env @ [(e_1, str2term s')];
   703 
   703 
   704 (*--- 7.line in script ---*)
   704 (*--- 7.line in script ---*)
   705 val t = str2term "(hd o (filterVar v_2)) (es_::bool list)";
   705 val t = str2term "(hd o (filterVar v_2)) (es_::bool list)";
   708 val t = str2term 
   708 val t = str2term 
   709 	  "(hd o filterVar b) [a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
   709 	  "(hd o filterVar b) [a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
   710 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   710 val SOME (t',_) = rewrite_set_ thy false list_rls t;
   711 val s' = term2str t';
   711 val s' = term2str t';
   712 if s' = "b / 2 = r * cos alpha" then () 
   712 if s' = "b / 2 = r * cos alpha" then () 
   713 else raise error "new behaviour with list_rls 3.7.";
   713 else error "new behaviour with list_rls 3.7.";
   714 val env = env @ [(str2term "e_2::bool", str2term s')];
   714 val env = env @ [(str2term "e_2::bool", str2term s')];
   715 
   715 
   716 (*--- 8.line in script ---*)
   716 (*--- 8.line in script ---*)
   717 val t = str2term "(SubProblem (Reals_,[univar,equation],[no_met])\
   717 val t = str2term "(SubProblem (Reals_,[univar,equation],[no_met])\
   718 		 \            [BOOL e_1, REAL v_1])";
   718 		 \            [BOOL e_1, REAL v_1])";
   742 \              (b = (rhs o hd) [b = 2 * r * cos alpha])] (A = a * b)";
   742 \              (b = (rhs o hd) [b = 2 * r * cos alpha])] (A = a * b)";
   743 val SOME (s',_) = rewrite_set_ thy false list_rls s;
   743 val SOME (s',_) = rewrite_set_ thy false list_rls s;
   744 val s'' = term2str s';
   744 val s'' = term2str s';
   745 if s'' = 
   745 if s'' = 
   746 "Substitute [a = 2 * r * sin alpha, b = 2 * r * cos alpha] (A = a * b)"
   746 "Substitute [a = 2 * r * sin alpha, b = 2 * r * cos alpha] (A = a * b)"
   747 then () else raise error "new behaviour with list_rls 3.10.";
   747 then () else error "new behaviour with list_rls 3.10.";
   748 
   748 
   749 
   749 
   750 
   750 
   751 
   751 
   752 
   752