cleanup
authorWalther Neuper <walther.neuper@jku.at>
Wed, 15 Apr 2020 11:37:43 +0200
changeset 598783163e63a5111
parent 59877 e5a83a9fe58d
child 59879 33449c96d99f
cleanup
src/Tools/isac/BaseDefinitions/KEStore.thy
src/Tools/isac/BaseDefinitions/calcelems.sml
src/Tools/isac/BaseDefinitions/exec-def.sml
src/Tools/isac/BaseDefinitions/rule-def.sml
src/Tools/isac/BaseDefinitions/rule-set.sml
src/Tools/isac/BaseDefinitions/rule.sml
src/Tools/isac/BaseDefinitions/termC.sml
src/Tools/isac/BaseDefinitions/unparseC.sml
src/Tools/isac/BridgeLibisabelle/datatypes.sml
src/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml
src/Tools/isac/Build_Isac.thy
src/Tools/isac/Interpret/error-fill-pattern.sml
src/Tools/isac/Interpret/li-tool.sml
src/Tools/isac/Interpret/rewtools.sml
src/Tools/isac/Knowledge/AlgEin.thy
src/Tools/isac/Knowledge/Base_Tools.thy
src/Tools/isac/Knowledge/Biegelinie.thy
src/Tools/isac/Knowledge/Diff.thy
src/Tools/isac/Knowledge/DiffApp-scrpbl.sml
src/Tools/isac/Knowledge/DiffApp.sml
src/Tools/isac/Knowledge/DiffApp.thy
src/Tools/isac/Knowledge/EqSystem.thy
src/Tools/isac/Knowledge/Equation.thy
src/Tools/isac/Knowledge/InsSort.thy
src/Tools/isac/Knowledge/Integrate.thy
src/Tools/isac/Knowledge/Inverse_Z_Transform.thy
src/Tools/isac/Knowledge/LinEq.thy
src/Tools/isac/Knowledge/Partial_Fractions.thy
src/Tools/isac/Knowledge/Poly.thy
src/Tools/isac/Knowledge/PolyEq.thy
src/Tools/isac/Knowledge/PolyMinus.thy
src/Tools/isac/Knowledge/RatEq.thy
src/Tools/isac/Knowledge/Rational-WN.sml
src/Tools/isac/Knowledge/Rational.thy
src/Tools/isac/Knowledge/Root.thy
src/Tools/isac/Knowledge/RootEq.thy
src/Tools/isac/Knowledge/RootRat.thy
src/Tools/isac/Knowledge/RootRatEq.thy
src/Tools/isac/Knowledge/Test.thy
src/Tools/isac/Knowledge/Test_Build_Thydata.thy
src/Tools/isac/MathEngBasic/rewrite.sml
src/Tools/isac/MathEngBasic/tactic.sml
src/Tools/isac/MathEngBasic/thmC.sml
src/Tools/isac/ProgLang/Auto_Prog.thy
src/Tools/isac/ProgLang/Calculate.thy
src/Tools/isac/ProgLang/ListC.thy
src/Tools/isac/ProgLang/Prog_Expr.thy
src/Tools/isac/ProgLang/Program.thy
src/Tools/isac/ProgLang/calculate.sml
src/Tools/isac/Specify/appl.sml
src/Tools/isac/Specify/calchead.sml
src/Tools/isac/Specify/ptyps.sml
src/Tools/isac/TODO.thy
test/Tools/isac/ADDTESTS/accumulate-val/Thy_3.thy
test/Tools/isac/ADDTESTS/course/CADGME/example_1.thy
test/Tools/isac/ADDTESTS/course/SignalProcess/Build_Inverse_Z_Transform.thy
test/Tools/isac/ADDTESTS/course/SignalProcess/document/Build_Inverse_Z_Transform.tex
test/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml
test/Tools/isac/BridgeLibisabelle/use-cases.sml
test/Tools/isac/Interpret/lucas-interpreter.sml
test/Tools/isac/Interpret/rewtools.sml
test/Tools/isac/Knowledge/biegelinie-1.sml
test/Tools/isac/Knowledge/eqsystem.sml
test/Tools/isac/Knowledge/integrate.sml
test/Tools/isac/Knowledge/partial_fractions.sml
test/Tools/isac/Knowledge/polyminus.sml
test/Tools/isac/Knowledge/rootrat.sml
test/Tools/isac/MathEngBasic/rewrite.sml
test/Tools/isac/Minisubpbl/200-start-method-NEXT_STEP.sml
test/Tools/isac/OLDTESTS/script_if.sml
test/Tools/isac/OLDTESTS/scriptnew.sml
test/Tools/isac/ProgLang/auto_prog.sml
test/Tools/isac/ProgLang/prog_expr.sml
test/Tools/isac/Test_Isac.thy
test/Tools/isac/Test_Isac_Short.thy
test/Tools/isac/Test_Some.thy
test/Tools/isac/Test_Some_meld.thy
     1.1 --- a/src/Tools/isac/BaseDefinitions/KEStore.thy	Wed Apr 15 11:11:54 2020 +0200
     1.2 +++ b/src/Tools/isac/BaseDefinitions/KEStore.thy	Wed Apr 15 11:37:43 2020 +0200
     1.3 @@ -208,7 +208,7 @@
     1.4    | short_string_of_rls (Rule_Def.Repeat {calc, rules, ...}) =
     1.5      "Rls {#calc = " ^ string_of_int (length calc) ^
     1.6      ", #rules = " ^ string_of_int (length rules) ^ ", ..."
     1.7 -  | short_string_of_rls (Rule_Set.Seqence {calc, rules, ...}) =
     1.8 +  | short_string_of_rls (Rule_Set.Sequence {calc, rules, ...}) =
     1.9      "Seq {#calc = " ^ string_of_int (length calc) ^
    1.10      ", #rules = " ^ string_of_int (length rules) ^ ", ..."
    1.11    | short_string_of_rls (Rule_Set.Rrls _) = "Rrls {...}";
     2.1 --- a/src/Tools/isac/BaseDefinitions/calcelems.sml	Wed Apr 15 11:11:54 2020 +0200
     2.2 +++ b/src/Tools/isac/BaseDefinitions/calcelems.sml	Wed Apr 15 11:37:43 2020 +0200
     2.3 @@ -492,7 +492,7 @@
     2.4  	   };
     2.5  val e_met = {guh = "met_empty", mathauthors = [], init = e_metID, rew_ord' = Rewrite_Ord.e_rew_ord',
     2.6  	erls = Rule_Set.empty, srls = Rule_Set.empty, prls = Rule_Set.empty, calc = [], crls = Rule_Set.empty,
     2.7 -	errpats = [], nrls = Rule_Set.empty, ppc = [], pre = [], scr = Rule.EmptyScr};
     2.8 +	errpats = [], nrls = Rule_Set.empty, ppc = [], pre = [], scr = Rule.Empty_Prog};
     2.9  val e_Mets = Ptyp ("e_metID", [e_met],[]);
    2.10  
    2.11  type mets = (met ptyp) list;
    2.12 @@ -545,8 +545,8 @@
    2.13            Rule_Def.Repeat {id, preconds, rew_ord, erls, srls, calc, rules, scr, ...}
    2.14            => Rule_Def.Repeat {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls,
    2.15                 calc = calc, rules = rules, scr = scr, errpatts = errpatIDs}
    2.16 -        | Rule_Set.Seqence {id, preconds, rew_ord, erls, srls, calc, rules, scr, ...}
    2.17 -          => Rule_Set.Seqence {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls,
    2.18 +        | Rule_Set.Sequence {id, preconds, rew_ord, erls, srls, calc, rules, scr, ...}
    2.19 +          => Rule_Set.Sequence {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls,
    2.20                 calc = calc, rules = rules, scr = scr, errpatts = errpatIDs}
    2.21          | Rule_Set.Rrls {id, prepat, rew_ord, erls, calc, scr, ...}
    2.22            => Rule_Set.Rrls {id = id, prepat = prepat, rew_ord = rew_ord, erls = erls, calc = calc,
     3.1 --- a/src/Tools/isac/BaseDefinitions/exec-def.sml	Wed Apr 15 11:11:54 2020 +0200
     3.2 +++ b/src/Tools/isac/BaseDefinitions/exec-def.sml	Wed Apr 15 11:37:43 2020 +0200
     3.3 @@ -41,9 +41,9 @@
     3.4  (* eval function calling sml code during rewriting.
     3.5  Unifying "type cal" and "type calc" would make Lucas-Interpretation more efficient,
     3.6    see "fun rule2stac": instead of 
     3.7 -    Num_Calc: calID * eval_fn -> rule
     3.8 +    Eval: calID * eval_fn -> rule
     3.9    would be better
    3.10 -    Num_Calc: prog_calcID * (calID * eval_fn)) -> rule*)
    3.11 +    Eval: prog_calcID * (calID * eval_fn)) -> rule*)
    3.12  type eval_fn = Rule_Def.eval_fn
    3.13  fun e_evalfn (_ : 'a) (_ : term) (_ : theory) = NONE : (string * term) option;
    3.14  end
     4.1 --- a/src/Tools/isac/BaseDefinitions/rule-def.sml	Wed Apr 15 11:11:54 2020 +0200
     4.2 +++ b/src/Tools/isac/BaseDefinitions/rule-def.sml	Wed Apr 15 11:37:43 2020 +0200
     4.3 @@ -19,14 +19,14 @@
     4.4         Empty
     4.5       | Repeat of {calc: calc list, erls: rule_set, errpatts: errpatID list, id: string,
     4.6         preconds: term list, rew_ord: rew_ord, rules: rule list, scr: program, srls: rule_set}
     4.7 -     | Seqence of {calc: calc list, erls: rule_set, errpatts: errpatID list, id: string,
     4.8 +     | Sequence of {calc: calc list, erls: rule_set, errpatts: errpatID list, id: string,
     4.9         preconds: term list, rew_ord: rew_ord, rules: rule list, scr: program, srls: rule_set}
    4.10       | Rrls of {calc: calc list, erls: rule_set, errpatts: errpatID list, id: string,
    4.11         prepat: (term list * term) list, rew_ord: rew_ord, scr: program}
    4.12 -  and rule = Cal1 of string * eval_fn | Num_Calc of string * eval_fn | Erule
    4.13 +  and rule = Cal1 of string * eval_fn | Eval of string * eval_fn | Erule
    4.14       | Rls_ of rule_set | Thm of string * thm
    4.15    and program =
    4.16 -       EmptyScr
    4.17 +       Empty_Prog
    4.18       | Prog of term
    4.19       | Rfuns of
    4.20           {attach_form: rule list list -> term -> term -> (rule * (term * term list)) list,
    4.21 @@ -66,14 +66,14 @@
    4.22    | Thm of            (* theorem associated with the identifier for reflection        *)
    4.23        string *        (* needless since Thm.get_name_hint                             *)
    4.24          Thm.thm       (* see TODO CLEANUP Thm                                         *)
    4.25 -  | Num_Calc of       (* evaluation by rewriting                                      *)
    4.26 +  | Eval of       (* evaluation by rewriting                                      *)
    4.27        string *        (* unique identifier for the evaluation function                *)
    4.28    	    eval_fn       (* evaluation function in ML code                               *)
    4.29    | Cal1 of string *  (* applied once to whole term or lhs/rhs of an eqality          *)
    4.30    	  eval_fn         (* evaluation function in ML code                               *)
    4.31    | Rls_ of rule_set  (* rule sets may be nested                                      *)
    4.32  and program =         (* program for Lucas-Interpretation                             *)
    4.33 -    EmptyScr          (* DEPRECATED: needless after removal of Rfuns                  *)
    4.34 +    Empty_Prog          (* DEPRECATED: needless after removal of Rfuns                  *)
    4.35    | Prog of term      (* Lucas-Interpretation works on Isabelle's terms               *)
    4.36    | Rfuns of          (* DEPRECATED, replaced by Auto_Prog                            *)
    4.37      {init_state :     (* initialise for reverse rewriting by the Interpreter          *)
    4.38 @@ -82,7 +82,7 @@
    4.39        term *          (* the final formula                                            *)
    4.40        rule list       (* of reverse rewrite set (#1#)                                 *)
    4.41          list *        (*   may be serveral, eg. in norm_rational                      *)
    4.42 -      ( rule *        (* Thm (+ Thm generated from Num_Calc) resulting in ...         *)
    4.43 +      ( rule *        (* Thm (+ Thm generated from Eval) resulting in ...         *)
    4.44          (term *       (*   ... rewrite with ...                                       *)
    4.45          term list))   (*   ... assumptions                                            *)
    4.46        list,           (* derivation from given term to normalform in reverse order    *)  
    4.47 @@ -120,7 +120,7 @@
    4.48       rules: rule list,
    4.49       errpatts: errpatID list,(* by dialog-authoring in Build_Thydata.thy              *)
    4.50       scr: program}    (* DEPRECATED: intersteps are created on the fly now            *)
    4.51 -  | Seqence of        (* a sequence of rules to be tried only once                    *)
    4.52 +  | Sequence of        (* a sequence of rules to be tried only once                    *)
    4.53      {id: string, preconds: term list, rew_ord: rew_ord, erls: rule_set, srls: rule_set,
    4.54       calc: calc list, rules: rule list, errpatts: errpatID list, scr: program}
    4.55    | Rrls of           (* ML-functions within rewriting, _ONE_ redex rewritten per call*)
     5.1 --- a/src/Tools/isac/BaseDefinitions/rule-set.sml	Wed Apr 15 11:11:54 2020 +0200
     5.2 +++ b/src/Tools/isac/BaseDefinitions/rule-set.sml	Wed Apr 15 11:37:43 2020 +0200
     5.3 @@ -47,7 +47,7 @@
     5.4  fun dummy_ord (_: (term * term) list) (_: term, _: term) = true;
     5.5  val empty =
     5.6    Rule_Def.Repeat {id = "empty", preconds = [], rew_ord = ("dummy_ord", dummy_ord), erls = Rule_Def.Empty,
     5.7 -    srls = Rule_Def.Empty, calc = [], rules = [], errpatts = [], scr = Rule_Def.EmptyScr}
     5.8 +    srls = Rule_Def.Empty, calc = [], rules = [], errpatts = [], scr = Rule_Def.Empty_Prog}
     5.9  (*\------- this will disappear eventually ----------------------------------------------------/*)
    5.10  
    5.11  val id = Rule.set_id;
    5.12 @@ -55,7 +55,7 @@
    5.13    | rep (Rule_Def.Repeat {id, preconds, rew_ord, erls, srls, calc, errpatts, rules, scr}) =
    5.14      {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls, errpats = errpatts,
    5.15        calc = calc, rules = rules, scr = scr}
    5.16 -  | rep (Rule_Def.Seqence {id, preconds, rew_ord, erls, srls, calc, errpatts, rules, scr}) =
    5.17 +  | rep (Rule_Def.Sequence {id, preconds, rew_ord, erls, srls, calc, errpatts, rules, scr}) =
    5.18      {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls, errpats = errpatts,
    5.19        calc = calc, rules = rules, scr = scr}
    5.20    | rep (Rule_Def.Rrls _)  = rep empty
    5.21 @@ -65,9 +65,9 @@
    5.22  			rules = rs, errpatts = errpatts, scr = sc}) r =
    5.23      Rule_Def.Repeat {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
    5.24        rules = rs @ r, errpatts = errpatts, scr = sc}
    5.25 -  | append_rules id (Rule_Def.Seqence {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
    5.26 +  | append_rules id (Rule_Def.Sequence {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
    5.27  			rules = rs, errpatts = errpatts, scr = sc}) r =
    5.28 -    Rule_Def.Seqence {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
    5.29 +    Rule_Def.Sequence {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
    5.30        rules = rs @ r, errpatts = errpatts, scr = sc}
    5.31    | append_rules id (Rule_Def.Rrls _) _ = raise ERROR ("append_rules: not for reverse-rewrite-rule-set " ^ id);
    5.32  
    5.33 @@ -97,12 +97,12 @@
    5.34  		  rules = union Rule.equal rs1 rs2,
    5.35        errpatts = union (op =) eps1 eps2}
    5.36    | merge id
    5.37 -	  (Rule_Def.Seqence {preconds = pc1, rew_ord = ro1, erls = er1, srls = sr1, calc = ca1,
    5.38 +	  (Rule_Def.Sequence {preconds = pc1, rew_ord = ro1, erls = er1, srls = sr1, calc = ca1,
    5.39  	    rules = rs1, errpatts = eps1, scr = sc1, ...})
    5.40 -	  (Rule_Def.Seqence {preconds = pc2, erls = er2, srls = sr2, calc = ca2,
    5.41 +	  (Rule_Def.Sequence {preconds = pc2, erls = er2, srls = sr2, calc = ca2,
    5.42  	    rules = rs2, errpatts = eps2, ...})
    5.43      =
    5.44 -	  Rule_Def.Seqence {id = id, rew_ord = ro1, scr = sc1,
    5.45 +	  Rule_Def.Sequence {id = id, rew_ord = ro1, scr = sc1,
    5.46  	    preconds = union (op =) pc1 pc2,	    
    5.47  	    erls = merge (merge_ids er1 er2) er1 er2,
    5.48  	    srls = merge (merge_ids sr1 sr2) sr1 sr2,
    5.49 @@ -110,7 +110,7 @@
    5.50  		  rules = union Rule.equal rs1 rs2,
    5.51        errpatts = union (op =) eps1 eps2}
    5.52    | merge id _ _ = error ("merge: \"" ^ id ^ 
    5.53 -    "\"; not for reverse-rewrite-rule-sets and not for mixed Rls -- Rule_Def.Seqence");
    5.54 +    "\"; not for reverse-rewrite-rule-sets and not for mixed Rls -- Rule_Def.Sequence");
    5.55  
    5.56  (* datastructure for KEStore_Elems, intermediate for thehier *)
    5.57  type for_kestore = 
    5.58 @@ -137,9 +137,9 @@
    5.59    	    errpatts = eps,
    5.60    	    scr = sc}
    5.61    | keep_unique_rules id
    5.62 -     (Rule_Def.Seqence {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
    5.63 +     (Rule_Def.Sequence {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
    5.64    		  rules = rs, errpatts = eps, scr = sc}) r =
    5.65 -      Rule_Def.Seqence {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
    5.66 +      Rule_Def.Sequence {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
    5.67    	    rules = gen_rems Rule.equal (rs, r),
    5.68    	    errpatts = eps,
    5.69    	    scr = sc}
    5.70 @@ -148,7 +148,7 @@
    5.71  
    5.72  fun get_rules Rule_Def.Empty = []
    5.73    | get_rules (Rule_Def.Repeat {rules, ...}) = rules
    5.74 -  | get_rules (Rule_Def.Seqence {rules, ...}) = rules
    5.75 +  | get_rules (Rule_Def.Sequence {rules, ...}) = rules
    5.76    | get_rules (Rule_Def.Rrls _) = [];
    5.77  
    5.78  (*/------- this will disappear eventually -----------\*)
     6.1 --- a/src/Tools/isac/BaseDefinitions/rule.sml	Wed Apr 15 11:11:54 2020 +0200
     6.2 +++ b/src/Tools/isac/BaseDefinitions/rule.sml	Wed Apr 15 11:37:43 2020 +0200
     6.3 @@ -40,27 +40,27 @@
     6.4  
     6.5  fun set_id Rule_Def.Empty = "empty" (*WN060714 quick and dirty: recursive defs! TODO "Rule_Def.Empty"*)
     6.6    | set_id (Rule_Def.Repeat {id, ...}) = id
     6.7 -  | set_id (Rule_Def.Seqence {id, ...}) = id
     6.8 +  | set_id (Rule_Def.Sequence {id, ...}) = id
     6.9    | set_id (Rule_Def.Rrls {id, ...}) = id;
    6.10  
    6.11  fun id (Rule_Def.Thm (id, _)) = id
    6.12 -  | id (Rule_Def.Num_Calc (id, _)) = id
    6.13 +  | id (Rule_Def.Eval (id, _)) = id
    6.14    | id (Rule_Def.Cal1 (id, _)) = id
    6.15    | id (Rule_Def.Rls_ rls) = set_id rls
    6.16    | id Rule_Def.Erule = "Erule";
    6.17  fun equal (Rule_Def.Thm (thm1, _), Rule_Def.Thm (thm2, _)) = thm1 = thm2
    6.18 -  | equal (Rule_Def.Num_Calc (id1, _), Rule_Def.Num_Calc (id2, _)) = id1 = id2
    6.19 +  | equal (Rule_Def.Eval (id1, _), Rule_Def.Eval (id2, _)) = id1 = id2
    6.20    | equal (Rule_Def.Rls_ rls1, Rule_Def.Rls_ rls2) = set_id rls1 = set_id rls2
    6.21    | equal _ = false;
    6.22  
    6.23  fun to_string Rule_Def.Erule = "Erule" 
    6.24    | to_string (Rule_Def.Thm (str, thm)) = "Thm (\"" ^ str ^ "\"," ^ ThmC_Def.string_of_thm thm ^ ")"
    6.25 -  | to_string (Rule_Def.Num_Calc (str, _)) = "Num_Calc (\"" ^ str ^ "\",fn)"
    6.26 +  | to_string (Rule_Def.Eval (str, _)) = "Eval (\"" ^ str ^ "\",fn)"
    6.27    | to_string (Rule_Def.Cal1 (str, _)) = "Cal1 (\"" ^ str ^ "\",fn)"
    6.28    | to_string (Rule_Def.Rls_ rls) = "Rls_ (\"" ^ set_id rls ^ "\")";
    6.29  fun to_string_short Rule_Def.Erule = "Erule"
    6.30    | to_string_short (Rule_Def.Thm (str, _)) = "Thm (\"" ^ str ^ "\",\"\")"
    6.31 -  | to_string_short (Rule_Def.Num_Calc (str, _)) = "Num_Calc (\"" ^ str ^ "\",fn)"
    6.32 +  | to_string_short (Rule_Def.Eval (str, _)) = "Eval (\"" ^ str ^ "\",fn)"
    6.33    | to_string_short (Rule_Def.Cal1 (str, _)) = "Cal1 (\"" ^ str ^ "\",fn)"
    6.34    | to_string_short (Rule_Def.Rls_ rls) = "Rls_ (\"" ^ set_id rls ^ "\")";
    6.35  
     7.1 --- a/src/Tools/isac/BaseDefinitions/termC.sml	Wed Apr 15 11:11:54 2020 +0200
     7.2 +++ b/src/Tools/isac/BaseDefinitions/termC.sml	Wed Apr 15 11:37:43 2020 +0200
     7.3 @@ -9,7 +9,7 @@
     7.4  sig
     7.5    type as_string
     7.6    val empty: term
     7.7 -  val type_empty: typ
     7.8 +  val typ_empty: typ
     7.9  
    7.10    datatype lrd = D | L | R
    7.11    type path
    7.12 @@ -115,7 +115,7 @@
    7.13  
    7.14  type as_string = UnparseC.term_as_string
    7.15  val empty = UnparseC.term_empty
    7.16 -val type_empty = UnparseC.type_empty
    7.17 +val typ_empty = UnparseC.typ_empty
    7.18  
    7.19  datatype lrd = L (*t1 in "t1$t2"*)
    7.20               | R (*t2 in "t1$t2"*) | D; (*b in Abs(_,_,b*)
     8.1 --- a/src/Tools/isac/BaseDefinitions/unparseC.sml	Wed Apr 15 11:11:54 2020 +0200
     8.2 +++ b/src/Tools/isac/BaseDefinitions/unparseC.sml	Wed Apr 15 11:37:43 2020 +0200
     8.3 @@ -9,7 +9,7 @@
     8.4    type subst = (term * term) list
     8.5  
     8.6    val term_empty: term
     8.7 -  val type_empty: typ
     8.8 +  val typ_empty: typ
     8.9  
    8.10    val term: term -> term_as_string
    8.11    val term_in_ctxt: Proof.context -> term -> term_as_string
    8.12 @@ -73,7 +73,7 @@
    8.13  fun typ typ = type_to_string'' "Isac_Knowledge" typ; (*TODO legacy*)
    8.14  fun typ_by_thyID thy typ = type_to_string'' thy typ; (*legacy*)
    8.15  
    8.16 -val type_empty = Type ("empty", []);
    8.17 +val typ_empty = Type ("empty", []);
    8.18  val term_empty = Const ("empty", Type("'a", []));
    8.19  
    8.20  (**)end(**)
     9.1 --- a/src/Tools/isac/BridgeLibisabelle/datatypes.sml	Wed Apr 15 11:11:54 2020 +0200
     9.2 +++ b/src/Tools/isac/BridgeLibisabelle/datatypes.sml	Wed Apr 15 11:37:43 2020 +0200
     9.3 @@ -100,8 +100,8 @@
     9.4        indt (j+i) ^ "<GUH> " ^ 
     9.5          Celem.thm2guh (Rtools.thy_containing_thm thmDeriv) (ThmC.cut_id thmDeriv) ^ " </GUH>\n" ^
     9.6          indt j ^ "</RULE>\n"
     9.7 -  | rule2xml _ _ (Rule.Num_Calc (_(*termop*), _)) = ""
     9.8 -(*FIXXXXXXXME.WN060714 in rls make Num_Calc : calc -> rule [add scriptop!]
     9.9 +  | rule2xml _ _ (Rule.Eval (_(*termop*), _)) = ""
    9.10 +(*FIXXXXXXXME.WN060714 in rls make Eval : calc -> rule [add scriptop!]
    9.11    see smltest/../datatypes.sml !
    9.12      indt j ^ "<RULE>\n" ^
    9.13      indt (j+i) ^ "<STRING> " ^ termop ^ " </STRING>\n" ^
    9.14 @@ -190,7 +190,7 @@
    9.15     writeln(authors2xml 2 "MATHAUTHORS" 
    9.16  		       ["isac-team 2001", "Richard Lang 2003"]);
    9.17     *)
    9.18 -fun scr2xml j Rule.EmptyScr =
    9.19 +fun scr2xml j Rule.Empty_Prog =
    9.20      indt j ^"<SCRIPT>  </SCRIPT>\n"
    9.21    | scr2xml j (Rule.Prog term) =
    9.22      if term = TermC.empty 
    9.23 @@ -258,7 +258,7 @@
    9.24      indt j ^"</RULESET>\n";
    9.25  fun rls2xml j (thyID, Rule_Set.Empty) = rls2xml j (thyID, Rule_Set.empty)
    9.26    | rls2xml j (thyID, Rule_Def.Repeat data) = rls2xm j (thyID, "Rls", data)
    9.27 -  | rls2xml j (thyID, Rule_Set.Seqence data) = rls2xm j (thyID, "Seq", data)
    9.28 +  | rls2xml j (thyID, Rule_Set.Sequence data) = rls2xm j (thyID, "Seq", data)
    9.29    | rls2xml j (thyID, Rule_Set.Rrls {id, prepat, rew_ord=(ord,_), erls, calc, errpatts, scr}) = 
    9.30      indt j ^"<RULESET>\n"^
    9.31      indt (j+i) ^"<ID> "^ id ^" </ID>\n"^
    9.32 @@ -507,11 +507,11 @@
    9.33          XML.Text term])])) = (ID, ThmC.thm_from_thy (ThyC.Isac ()) ID)
    9.34    | xml_to_thm'' x = raise ERROR ("xml_of_thm' wrong arg:" ^ xmlstr 0 x)
    9.35  
    9.36 -fun xml_of_src Rule.EmptyScr =
    9.37 +fun xml_of_src Rule.Empty_Prog =
    9.38      XML.Elem (("NOCODE", []), [XML.Text "empty"])
    9.39    | xml_of_src (Rule.Prog term) =
    9.40      XML.Elem (("CODE", []), [
    9.41 -      if term = TermC.empty then xml_of_src Rule.EmptyScr
    9.42 +      if term = TermC.empty then xml_of_src Rule.Empty_Prog
    9.43        else xml_of_term (TermC.inst_abs term)])
    9.44    | xml_of_src (Rule.Rfuns _) =
    9.45      XML.Elem (("NOCODE", []), [XML.Text "reverse rewrite functions"])
    10.1 --- a/src/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml	Wed Apr 15 11:11:54 2020 +0200
    10.2 +++ b/src/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml	Wed Apr 15 11:37:43 2020 +0200
    10.3 @@ -112,7 +112,7 @@
    10.4    in map (makeHcal (part, thy')) cals end;
    10.5  fun collect_ords (part, thy') =
    10.6      let val thy = Celem.assoc_thy (ThyC.thyID2theory' thy')
    10.7 -    in [(*TODO.WN060120 rew_ord, Num_Calc*)]:(Celem.theID * Celem.thydata) list end;
    10.8 +    in [(*TODO.WN060120 rew_ord, Eval*)]:(Celem.theID * Celem.thydata) list end;
    10.9  
   10.10  (* parts are: Isabelle | IsacKnowledge | IsacScripts, see KEStore.thy *)
   10.11  fun collect_part part parent thys =
    11.1 --- a/src/Tools/isac/Build_Isac.thy	Wed Apr 15 11:11:54 2020 +0200
    11.2 +++ b/src/Tools/isac/Build_Isac.thy	Wed Apr 15 11:37:43 2020 +0200
    11.3 @@ -123,7 +123,7 @@
    11.4  \<close> ML \<open>
    11.5  \<close> ML \<open>
    11.6  \<close>
    11.7 -ML \<open>Num_Calc.adhoc_thm; (*from "ProgLang/calculate.sml" *)\<close>
    11.8 +ML \<open>Eval.adhoc_thm; (*from "ProgLang/calculate.sml" *)\<close>
    11.9  ML \<open>Rewrite.rewrite_; (*from "ProgLang/rewrite.sml" *)\<close>
   11.10  ML \<open>Input_Descript.is_reall_dsc; (*from "ProgLang/scrtools.sml" *)\<close>
   11.11  ML \<open>Test_Code.me;\<close>
    12.1 --- a/src/Tools/isac/Interpret/error-fill-pattern.sml	Wed Apr 15 11:11:54 2020 +0200
    12.2 +++ b/src/Tools/isac/Interpret/error-fill-pattern.sml	Wed Apr 15 11:37:43 2020 +0200
    12.3 @@ -214,7 +214,7 @@
    12.4      | _ => error "fetchErrorpatterns: uncovered case of get_the"
    12.5    in case rls of
    12.6      Rule_Def.Repeat {errpatts, ...} => errpatts
    12.7 -  | Rule_Set.Seqence {errpatts, ...} => errpatts
    12.8 +  | Rule_Set.Sequence {errpatts, ...} => errpatts
    12.9    | Rule_Set.Rrls {errpatts, ...} => errpatts
   12.10    | Rule_Set.Empty => []
   12.11    end
    13.1 --- a/src/Tools/isac/Interpret/li-tool.sml	Wed Apr 15 11:11:54 2020 +0200
    13.2 +++ b/src/Tools/isac/Interpret/li-tool.sml	Wed Apr 15 11:37:43 2020 +0200
    13.3 @@ -177,12 +177,12 @@
    13.4              if f = f_ then Associated (m, f', ctxt) else Ass_Weak (m ,f', ctxt)
    13.5    	      else Not_Associated
    13.6        | (Const ("Prog_Tac.Rewrite'_Set'_Inst", _) $ _ $ rls_ $ f_)  =>
    13.7 -          if Rtools.contains_rule (Rule.Num_Calc (assoc_calc' (Celem.assoc_thy "Isac_Knowledge")
    13.8 +          if Rtools.contains_rule (Rule.Eval (assoc_calc' (Celem.assoc_thy "Isac_Knowledge")
    13.9              op_ |> snd)) (assoc_rls (HOLogic.dest_string rls_)) then
   13.10              if f = f_ then Associated (m, f', ctxt) else Ass_Weak (m ,f', ctxt)
   13.11            else Not_Associated
   13.12        | (Const ("Prog_Tac.Rewrite'_Set",_) $ rls_ $ f_) =>
   13.13 -          if Rtools.contains_rule (Rule.Num_Calc (assoc_calc' ( Celem.assoc_thy "Isac_Knowledge")
   13.14 +          if Rtools.contains_rule (Rule.Eval (assoc_calc' ( Celem.assoc_thy "Isac_Knowledge")
   13.15              op_ |> snd)) (assoc_rls (HOLogic.dest_string rls_)) then
   13.16              if f = f_ then Associated (m, f', ctxt) else Ass_Weak (m ,f', ctxt)
   13.17            else Not_Associated
    14.1 --- a/src/Tools/isac/Interpret/rewtools.sml	Wed Apr 15 11:11:54 2020 +0200
    14.2 +++ b/src/Tools/isac/Interpret/rewtools.sml	Wed Apr 15 11:37:43 2020 +0200
    14.3 @@ -148,12 +148,12 @@
    14.4              | SOME (t', a') =>
    14.5                (if ! Celem.trace_rewrite then tracing ("=== rewrites to: " ^ UnparseC.term t') else ();
    14.6                rew_once (lim - 1) (rts @ [(t, r, (t', a'))]) t' Appl rrs'))
    14.7 -        | Rule.Num_Calc (c as (op_, _)) => 
    14.8 +        | Rule.Eval (c as (op_, _)) => 
    14.9            let 
   14.10              val _ = if not (! Celem.trace_rewrite) then () else tracing ("### trying calc. \"" ^ op_^"\"")
   14.11              val t = TermC.uminus_to_string t
   14.12            in 
   14.13 -            case Num_Calc.adhoc_thm thy c t of
   14.14 +            case Eval.adhoc_thm thy c t of
   14.15                NONE => rew_once lim rts t apno rs'
   14.16              | SOME (thmid, tm) => 
   14.17                (let
   14.18 @@ -163,7 +163,7 @@
   14.19                  val _ = if not (! Celem.trace_rewrite) then () else tracing("=== calc. to: " ^ UnparseC.term t')
   14.20                  val r' = Rule.Thm (thmid, tm)
   14.21                in rew_once (lim - 1) (rts @ [(t, r', (t', a'))]) t' Appl rrs' end) 
   14.22 -                handle _ => error "derive_norm, Num_Calc: no rewrite"
   14.23 +                handle _ => error "derive_norm, Eval: no rewrite"
   14.24            end
   14.25        (*| Cal1 (cc as (op_,_)) => ... WN080222 see rewrite__set_: see 7df94616c1bd and earlier*)
   14.26          | Rule.Rls_ rls =>           (* WN060829: CREATES "sym_rlsID", see 7df94616c1bd and earlier*)
   14.27 @@ -327,7 +327,7 @@
   14.28  	     Applicable.Appl (Tactic.Rewrite_Inst' (thy', ord', erls, _, subst, _, f, (res, asm))) =>
   14.29  	       let
   14.30             val thm_deriv = Thm.get_name_hint thm
   14.31 -           val thminst = TermC.inst_bdv subst ((Num_Calc.norm o #prop o Thm.rep_thm) thm)
   14.32 +           val thminst = TermC.inst_bdv subst ((Eval.norm o #prop o Thm.rep_thm) thm)
   14.33  	       in
   14.34  	         ContThmInst
   14.35  	          {thyID = ThyC.theory'2thyID thy',
   14.36 @@ -344,7 +344,7 @@
   14.37             val pp = Ctree.par_pblobj pt p
   14.38             val thy' = Ctree.get_obj Ctree.g_domID pt pp
   14.39             val subst = Selem.subs2subst (Celem.assoc_thy thy') subs
   14.40 -           val thminst = TermC.inst_bdv subst ((Num_Calc.norm o #prop o Thm.rep_thm) thm)
   14.41 +           val thminst = TermC.inst_bdv subst ((Eval.norm o #prop o Thm.rep_thm) thm)
   14.42             val f = case p_ of
   14.43                 Pos.Frm => Ctree.get_obj Ctree.g_form pt p
   14.44               | Pos.Res => (fst o (Ctree.get_obj Ctree.g_result pt)) p 
   14.45 @@ -379,12 +379,12 @@
   14.46  (* get all theorems in a rule set (recursivley containing rule sets) *)
   14.47  fun thm_of_rule Rule.Erule = []
   14.48    | thm_of_rule (thm as Rule.Thm _) = [thm]
   14.49 -  | thm_of_rule (Rule.Num_Calc _) = []
   14.50 +  | thm_of_rule (Rule.Eval _) = []
   14.51    | thm_of_rule (Rule.Cal1 _) = []
   14.52    | thm_of_rule (Rule.Rls_ rls) = thms_of_rls rls
   14.53  and thms_of_rls Rule_Set.Empty = []
   14.54    | thms_of_rls (Rule_Def.Repeat {rules,...}) = (flat o (map  thm_of_rule)) rules
   14.55 -  | thms_of_rls (Rule_Set.Seqence {rules,...}) = (flat o (map  thm_of_rule)) rules
   14.56 +  | thms_of_rls (Rule_Set.Sequence {rules,...}) = (flat o (map  thm_of_rule)) rules
   14.57    | thms_of_rls (Rule_Set.Rrls _) = []
   14.58  
   14.59  (* check if a rule is contained in a rule-set (recursivley down in Rls_);
   14.60 @@ -409,19 +409,19 @@
   14.61      else (case Rewrite.rewrite_ thy ro erls false thm f of
   14.62  	    SOME _ => [Tactic.rule2tac thy [] thm']
   14.63  	  | NONE => [])
   14.64 -  | try_rew thy _ _ _ f (cal as Rule.Num_Calc c) = 
   14.65 -    (case Num_Calc.adhoc_thm thy c f of
   14.66 +  | try_rew thy _ _ _ f (cal as Rule.Eval c) = 
   14.67 +    (case Eval.adhoc_thm thy c f of
   14.68  	    SOME _ => [Tactic.rule2tac thy [] cal]
   14.69      | NONE => [])
   14.70    | try_rew thy _ _ _ f (cal as Rule.Cal1 c) = 
   14.71 -    (case Num_Calc.adhoc_thm thy c f of
   14.72 +    (case Eval.adhoc_thm thy c f of
   14.73  	      SOME _ => [Tactic.rule2tac thy [] cal]
   14.74        | NONE => [])
   14.75    | try_rew thy _ _ subst f (Rule.Rls_ rls) = filter_appl_rews thy subst f rls
   14.76    | try_rew _ _ _ _ _ _ = error "try_rew: uncovered case"
   14.77  and filter_appl_rews thy subst f (Rule_Def.Repeat {rew_ord = ro, erls, rules, ...}) = 
   14.78      gen_distinct Tactic.eq_tac (flat (map (try_rew thy ro erls subst f) rules))
   14.79 -  | filter_appl_rews thy subst f (Rule_Set.Seqence {rew_ord = ro, erls, rules,...}) = 
   14.80 +  | filter_appl_rews thy subst f (Rule_Set.Sequence {rew_ord = ro, erls, rules,...}) = 
   14.81      gen_distinct Tactic.eq_tac (flat (map (try_rew thy ro erls subst f) rules))
   14.82    | filter_appl_rews _ _ _ (Rule_Set.Rrls _) = []
   14.83    | filter_appl_rews _ _ _ _ = error "filter_appl_rews: uncovered case"
   14.84 @@ -429,7 +429,7 @@
   14.85  (* decide if a tactic is applicable to a given formula; 
   14.86     in case of Rewrite_Set* go down to _atomic_ rewrite-tactics *)
   14.87  fun atomic_appl_tacs thy _ _ f (Tactic.Calculate scrID) =
   14.88 -    try_rew thy Rewrite_Ord.e_rew_ordX Rule_Set.empty [] f (Rule.Num_Calc (assoc_calc' thy scrID |> snd))
   14.89 +    try_rew thy Rewrite_Ord.e_rew_ordX Rule_Set.empty [] f (Rule.Eval (assoc_calc' thy scrID |> snd))
   14.90    | atomic_appl_tacs thy ro erls f (Tactic.Rewrite thm'') =
   14.91      try_rew thy (ro, Rewrite_Ord.assoc_rew_ord ro) erls [] f (Rule.Thm thm'')
   14.92    | atomic_appl_tacs thy ro erls f (Tactic.Rewrite_Inst (subs, thm'')) =
    15.1 --- a/src/Tools/isac/Knowledge/AlgEin.thy	Wed Apr 15 11:11:54 2020 +0200
    15.2 +++ b/src/Tools/isac/Knowledge/AlgEin.thy	Wed Apr 15 11:37:43 2020 +0200
    15.3 @@ -76,7 +76,7 @@
    15.4  	         ("#Find"  ,["GesamtLaenge l_l"])],
    15.5  	       {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [],
    15.6             srls = Rule_Set.append_rules "srls_..Berechnung-erstSymbolisch" Rule_Set.empty 
    15.7 -				       [Rule.Num_Calc ("Prog_Expr.boollist2sum", Prog_Expr.eval_boollist2sum "")], 
    15.8 +				       [Rule.Eval ("Prog_Expr.boollist2sum", Prog_Expr.eval_boollist2sum "")], 
    15.9  		       prls = Rule_Set.empty, crls =Rule_Set.empty , errpats = [], nrls = norm_Rational},
   15.10           @{thm symbolisch_rechnen.simps})]
   15.11  \<close>
   15.12 @@ -109,7 +109,7 @@
   15.13  		        ("#Find"  ,["GesamtLaenge l_l"])],
   15.14  	        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], 
   15.15  	          srls = Rule_Set.append_rules "srls_..Berechnung-erstSymbolisch" Rule_Set.empty 
   15.16 -				        [Rule.Num_Calc ("Prog_Expr.boollist2sum", Prog_Expr.eval_boollist2sum "")], 
   15.17 +				        [Rule.Eval ("Prog_Expr.boollist2sum", Prog_Expr.eval_boollist2sum "")], 
   15.18  				    prls = Rule_Set.empty, crls =Rule_Set.empty , errpats = [], nrls = norm_Rational},
   15.19              @{thm symbolisch_rechnen.simps})]
   15.20  \<close>
    16.1 --- a/src/Tools/isac/Knowledge/Base_Tools.thy	Wed Apr 15 11:11:54 2020 +0200
    16.2 +++ b/src/Tools/isac/Knowledge/Base_Tools.thy	Wed Apr 15 11:37:43 2020 +0200
    16.3 @@ -58,7 +58,7 @@
    16.4  ML \<open>
    16.5  \<close> ML \<open>
    16.6  val Atools_erls = Rule_Set.append_rules "Atools_erls" Rule_Set.empty
    16.7 -  [ Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
    16.8 +  [ Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
    16.9      Rule.Thm ("not_true", ThmC.numerals_to_Free @{thm not_true}),
   16.10  		(*"(~ True) = False"*)
   16.11  		Rule.Thm ("not_false", ThmC.numerals_to_Free @{thm not_false}),
   16.12 @@ -79,18 +79,18 @@
   16.13  		Rule.Thm ("order_refl", ThmC.numerals_to_Free @{thm order_refl}),
   16.14  		Rule.Thm ("radd_left_cancel_le", ThmC.numerals_to_Free @{thm radd_left_cancel_le}),
   16.15  		
   16.16 -		Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   16.17 -		Rule.Num_Calc ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   16.18 +		Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   16.19 +		Rule.Eval ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   16.20  		
   16.21 -		Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),    
   16.22 -		Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   16.23 -		Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),    
   16.24 -		Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "")];
   16.25 +		Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),    
   16.26 +		Rule.Eval ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   16.27 +		Rule.Eval ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),    
   16.28 +		Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches "")];
   16.29  \<close>
   16.30  
   16.31  ML \<open>
   16.32  val Atools_crls = Rule_Set.append_rules "Atools_crls" Rule_Set.empty
   16.33 -  [ Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   16.34 +  [ Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   16.35      Rule.Thm ("not_true", ThmC.numerals_to_Free @{thm not_true}),
   16.36  		Rule.Thm ("not_false", ThmC.numerals_to_Free @{thm not_false}),
   16.37  		Rule.Thm ("and_true", ThmC.numerals_to_Free @{thm and_true}),
   16.38 @@ -105,27 +105,27 @@
   16.39  		Rule.Thm ("order_refl", ThmC.numerals_to_Free @{thm order_refl}),
   16.40  		Rule.Thm ("radd_left_cancel_le", ThmC.numerals_to_Free @{thm radd_left_cancel_le}),
   16.41  		
   16.42 -		Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   16.43 -		Rule.Num_Calc ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   16.44 +		Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   16.45 +		Rule.Eval ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   16.46  		
   16.47 -		Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),    
   16.48 -		Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   16.49 -		Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),    
   16.50 -		Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "")];
   16.51 +		Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),    
   16.52 +		Rule.Eval ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   16.53 +		Rule.Eval ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),    
   16.54 +		Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches "")];
   16.55  \<close>
   16.56  
   16.57  subsection \<open>ONCE AGAIN extend rule-set for evaluating pre-conditions and program-expressions\<close>
   16.58  text \<open>requires "eval_binop" from above\<close>
   16.59  ML \<open>
   16.60  val prog_expr = Rule_Set.append_rules "prog_expr" prog_expr
   16.61 -	[ Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   16.62 -		Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   16.63 -		Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   16.64 -		Rule.Num_Calc ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   16.65 -		Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   16.66 -		Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),(*atom <> atom -> False*)
   16.67 +	[ Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   16.68 +		Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   16.69 +		Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   16.70 +		Rule.Eval ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   16.71 +		Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   16.72 +		Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),(*atom <> atom -> False*)
   16.73         
   16.74 -		Rule.Num_Calc ("Prog_Expr.Vars",Prog_Expr.eval_var "#Vars_"),
   16.75 +		Rule.Eval ("Prog_Expr.Vars",Prog_Expr.eval_var "#Vars_"),
   16.76  		
   16.77  		Rule.Thm ("if_True",ThmC.numerals_to_Free @{thm if_True}),
   16.78  		Rule.Thm ("if_False",ThmC.numerals_to_Free @{thm if_False})];
   16.79 @@ -134,12 +134,12 @@
   16.80  	(Rule_Def.Repeat {id = "replaced", preconds = [], rew_ord = ("termlessI", termlessI),
   16.81      erls = Rule_Def.Repeat {id = "list_elrs", preconds = [], rew_ord = ("termlessI", termlessI), 
   16.82      erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   16.83 -    rules = [Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   16.84 -      Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_")
   16.85 +    rules = [Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   16.86 +      Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_")
   16.87        (*    ~~~~~~ for nth_Cons_*)],
   16.88 -    scr = Rule.EmptyScr},
   16.89 +    scr = Rule.Empty_Prog},
   16.90      srls = Rule_Set.Empty, calc = [], errpatts = [],
   16.91 -    rules = [], scr = Rule.EmptyScr})
   16.92 +    rules = [], scr = Rule.Empty_Prog})
   16.93    prog_expr);
   16.94  \<close>
   16.95  subsection \<open>setup for extended rule-set\<close>
    17.1 --- a/src/Tools/isac/Knowledge/Biegelinie.thy	Wed Apr 15 11:11:54 2020 +0200
    17.2 +++ b/src/Tools/isac/Knowledge/Biegelinie.thy	Wed Apr 15 11:37:43 2020 +0200
    17.3 @@ -119,19 +119,19 @@
    17.4  		rew_ord = ("termlessI",termlessI), 
    17.5  		erls = Rule_Set.append_rules "erls_in_srls_IntegrierenUnd.." Rule_Set.empty
    17.6  				  [(*for asm in NTH_CONS ...*)
    17.7 -				   Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
    17.8 +				   Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
    17.9  				   (*2nd NTH_CONS pushes n+-1 into asms*)
   17.10 -				   Rule.Num_Calc("Groups.plus_class.plus", (**)eval_binop "#add_")
   17.11 +				   Rule.Eval("Groups.plus_class.plus", (**)eval_binop "#add_")
   17.12  				   ], 
   17.13  		srls = Rule_Set.Empty, calc = [], errpatts = [],
   17.14  		rules = [Rule.Thm ("NTH_CONS",ThmC.numerals_to_Free @{thm NTH_CONS}),
   17.15 -			 Rule.Num_Calc("Groups.plus_class.plus", (**)eval_binop "#add_"),
   17.16 +			 Rule.Eval("Groups.plus_class.plus", (**)eval_binop "#add_"),
   17.17  			 Rule.Thm ("NTH_NIL",ThmC.numerals_to_Free @{thm NTH_NIL}),
   17.18 -			 Rule.Num_Calc("Prog_Expr.lhs", Prog_Expr.eval_lhs"eval_lhs_"),
   17.19 -			 Rule.Num_Calc("Prog_Expr.rhs", Prog_Expr.eval_rhs"eval_rhs_"),
   17.20 -			 Rule.Num_Calc("Prog_Expr.argument'_in", Prog_Expr.eval_argument_in "Prog_Expr.argument'_in")
   17.21 +			 Rule.Eval("Prog_Expr.lhs", Prog_Expr.eval_lhs"eval_lhs_"),
   17.22 +			 Rule.Eval("Prog_Expr.rhs", Prog_Expr.eval_rhs"eval_rhs_"),
   17.23 +			 Rule.Eval("Prog_Expr.argument'_in", Prog_Expr.eval_argument_in "Prog_Expr.argument'_in")
   17.24  			 ],
   17.25 -		scr = Rule.EmptyScr};
   17.26 +		scr = Rule.Empty_Prog};
   17.27      
   17.28  val srls2 = 
   17.29      Rule_Def.Repeat {id="srls_IntegrierenUnd..", 
   17.30 @@ -139,25 +139,25 @@
   17.31  	 rew_ord = ("termlessI",termlessI), 
   17.32  	 erls = Rule_Set.append_rules "erls_in_srls_IntegrierenUnd.." Rule_Set.empty
   17.33  			   [(*for asm in NTH_CONS ...*)
   17.34 -			    Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   17.35 +			    Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   17.36  			    (*2nd NTH_CONS pushes n+-1 into asms*)
   17.37 -			    Rule.Num_Calc("Groups.plus_class.plus", (**)eval_binop "#add_")
   17.38 +			    Rule.Eval("Groups.plus_class.plus", (**)eval_binop "#add_")
   17.39  			    ], 
   17.40  	 srls = Rule_Set.Empty, calc = [], errpatts = [],
   17.41  	 rules = [Rule.Thm ("NTH_CONS",ThmC.numerals_to_Free @{thm NTH_CONS}),
   17.42 -		  Rule.Num_Calc("Groups.plus_class.plus", (**)eval_binop "#add_"),
   17.43 +		  Rule.Eval("Groups.plus_class.plus", (**)eval_binop "#add_"),
   17.44  		  Rule.Thm ("NTH_NIL", ThmC.numerals_to_Free @{thm NTH_NIL}),
   17.45 -		  Rule.Num_Calc("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
   17.46 -		  Rule.Num_Calc("Prog_Expr.filter'_sameFunId", Prog_Expr.eval_filter_sameFunId "Prog_Expr.filter'_sameFunId"),
   17.47 +		  Rule.Eval("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
   17.48 +		  Rule.Eval("Prog_Expr.filter'_sameFunId", Prog_Expr.eval_filter_sameFunId "Prog_Expr.filter'_sameFunId"),
   17.49  		  (*WN070514 just for smltest/../biegelinie.sml ...*)
   17.50 -		  Rule.Num_Calc("Prog_Expr.sameFunId", Prog_Expr.eval_sameFunId "Prog_Expr.sameFunId"),
   17.51 +		  Rule.Eval("Prog_Expr.sameFunId", Prog_Expr.eval_sameFunId "Prog_Expr.sameFunId"),
   17.52  		  Rule.Thm ("filter_Cons", ThmC.numerals_to_Free @{thm filter_Cons}),
   17.53  		  Rule.Thm ("filter_Nil", ThmC.numerals_to_Free @{thm filter_Nil}),
   17.54  		  Rule.Thm ("if_True", ThmC.numerals_to_Free @{thm if_True}),
   17.55  		  Rule.Thm ("if_False", ThmC.numerals_to_Free @{thm if_False}),
   17.56  		  Rule.Thm ("hd_thm", ThmC.numerals_to_Free @{thm hd_thm})
   17.57  		  ],
   17.58 -	 scr = Rule.EmptyScr};
   17.59 +	 scr = Rule.Empty_Prog};
   17.60  \<close>
   17.61  
   17.62  section \<open>Methods\<close>
   17.63 @@ -195,13 +195,13 @@
   17.64  		      ("#Relate",["Randbedingungen s"])],
   17.65  	      {rew_ord'="tless_true", 
   17.66  	        rls' = Rule_Set.append_rules "erls_IntegrierenUndK.." Rule_Set.empty 
   17.67 -				      [Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   17.68 +				      [Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   17.69  				        Rule.Thm ("not_true",ThmC.numerals_to_Free @{thm not_true}),
   17.70  				        Rule.Thm ("not_false",ThmC.numerals_to_Free @{thm not_false})], 
   17.71  				  calc = [], 
   17.72  				  srls = Rule_Set.append_rules "erls_IntegrierenUndK.." Rule_Set.empty 
   17.73 -				      [Rule.Num_Calc("Prog_Expr.rhs", Prog_Expr.eval_rhs"eval_rhs_"),
   17.74 -				        Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   17.75 +				      [Rule.Eval("Prog_Expr.rhs", Prog_Expr.eval_rhs"eval_rhs_"),
   17.76 +				        Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   17.77  				        Rule.Thm ("last_thmI",ThmC.numerals_to_Free @{thm last_thmI}),
   17.78  				        Rule.Thm ("if_True",ThmC.numerals_to_Free @{thm if_True}),
   17.79  				        Rule.Thm ("if_False",ThmC.numerals_to_Free @{thm if_False})],
   17.80 @@ -261,12 +261,12 @@
   17.81  	       ("#Find"  ,["Funktionen fun_s"])],
   17.82  	      {rew_ord'="tless_true", 
   17.83  	        rls' = Rule_Set.append_rules "erls_ausBelastung" Rule_Set.empty 
   17.84 -				      [Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   17.85 +				      [Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   17.86  				        Rule.Thm ("not_true", ThmC.numerals_to_Free @{thm not_true}),
   17.87  				        Rule.Thm ("not_false", ThmC.numerals_to_Free @{thm not_false})], 
   17.88  				  calc = [], 
   17.89  				  srls = Rule_Set.append_rules "srls_ausBelastung" Rule_Set.empty 
   17.90 -				      [Rule.Num_Calc ("Prog_Expr.rhs", Prog_Expr.eval_rhs "eval_rhs_")], 
   17.91 +				      [Rule.Eval ("Prog_Expr.rhs", Prog_Expr.eval_rhs "eval_rhs_")], 
   17.92  				  prls = Rule_Set.empty, crls = Atools_erls, errpats = [], nrls = Rule_Set.empty},
   17.93          @{thm belastung_zu_biegelinie.simps})]
   17.94  \<close>
   17.95 @@ -325,8 +325,8 @@
   17.96  	        ("#Find"  ,["equality equ'''"])],
   17.97  	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [],
   17.98            srls = Rule_Set.append_rules "srls_in_EquationfromFunc" Rule_Set.empty
   17.99 -				      [Rule.Num_Calc("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
  17.100 -				        Rule.Num_Calc("Prog_Expr.argument'_in", Prog_Expr.eval_argument_in "Prog_Expr.argument'_in")], 
  17.101 +				      [Rule.Eval("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
  17.102 +				        Rule.Eval("Prog_Expr.argument'_in", Prog_Expr.eval_argument_in "Prog_Expr.argument'_in")], 
  17.103  				  prls=Rule_Set.empty, crls = Atools_erls, errpats = [], nrls = Rule_Set.empty},
  17.104          (*(M_b x = c_2 + c * x + -1 * q_0 / 2 * x ^^^ 2) (M_b L = 0) -->
  17.105                 0 = c_2 + c * L + -1 * q_0 / 2 * L ^^^ 2*)
    18.1 --- a/src/Tools/isac/Knowledge/Diff.thy	Wed Apr 15 11:11:54 2020 +0200
    18.2 +++ b/src/Tools/isac/Knowledge/Diff.thy	Wed Apr 15 11:37:43 2020 +0200
    18.3 @@ -110,10 +110,10 @@
    18.4  	 preconds = [], 
    18.5  	 rew_ord = ("termlessI",termlessI), 
    18.6  	 erls = Rule_Set.append_rules "erls_diff_conv" Rule_Set.empty 
    18.7 -			   [Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),
    18.8 +			   [Rule.Eval ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),
    18.9  			    Rule.Thm ("not_true",ThmC.numerals_to_Free @{thm not_true}),
   18.10  			    Rule.Thm ("not_false",ThmC.numerals_to_Free @{thm not_false}),
   18.11 -			    Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   18.12 +			    Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   18.13  			    Rule.Thm ("and_true",ThmC.numerals_to_Free @{thm and_true}),
   18.14  			    Rule.Thm ("and_false",ThmC.numerals_to_Free @{thm and_false})
   18.15  			    ], 
   18.16 @@ -131,7 +131,7 @@
   18.17  		     (*"?bdv occurs_in ?u \<Longrightarrow> nroot ?n ?u = ?u ^^^ (1 / ?n)"*)
   18.18  		   Rule.Thm ("realpow_pow_bdv", ThmC.numerals_to_Free @{thm realpow_pow_bdv}),
   18.19  		     (* "(?bdv ^^^ ?b) ^^^ ?c = ?bdv ^^^ (?b * ?c)"*)
   18.20 -		   Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   18.21 +		   Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   18.22  		   Rule.Thm ("rat_mult",ThmC.numerals_to_Free @{thm rat_mult}),
   18.23  		     (*a / b * (c / d) = a * c / (b * d)*)
   18.24  		   Rule.Thm ("times_divide_eq_right",ThmC.numerals_to_Free @{thm times_divide_eq_right}),
   18.25 @@ -139,7 +139,7 @@
   18.26  		   Rule.Thm ("times_divide_eq_left",ThmC.numerals_to_Free @{thm times_divide_eq_left})
   18.27  		     (*?y / ?z * ?x = ?y * ?x / ?z*)
   18.28  		 ],
   18.29 -	 scr = Rule.EmptyScr};
   18.30 +	 scr = Rule.Empty_Prog};
   18.31  \<close>
   18.32  ML \<open>
   18.33  (*.beautifies a term after differentiation.*)
   18.34 @@ -148,7 +148,7 @@
   18.35  	 preconds = [], 
   18.36  	 rew_ord = ("termlessI",termlessI), 
   18.37  	 erls = Rule_Set.append_rules "erls_diff_sym_conv" Rule_Set.empty 
   18.38 -			   [Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_")
   18.39 +			   [Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_")
   18.40  			    ], 
   18.41  	 srls = Rule_Set.Empty, calc = [], errpatts = [],
   18.42  	 rules = [Rule.Thm ("frac_sym_conv", ThmC.numerals_to_Free @{thm frac_sym_conv}),
   18.43 @@ -163,9 +163,9 @@
   18.44  		  (*?x * (?y / ?z) = ?x * ?y / ?z*)
   18.45  		  Rule.Thm ("times_divide_eq_left",ThmC.numerals_to_Free @{thm times_divide_eq_left}),
   18.46  		  (*?y / ?z * ?x = ?y * ?x / ?z*)
   18.47 -		  Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_")
   18.48 +		  Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_")
   18.49  		 ],
   18.50 -	 scr = Rule.EmptyScr};
   18.51 +	 scr = Rule.Empty_Prog};
   18.52  
   18.53  (*..*)
   18.54  val srls_diff = 
   18.55 @@ -174,11 +174,11 @@
   18.56  	 rew_ord = ("termlessI",termlessI), 
   18.57  	 erls = Rule_Set.empty, 
   18.58  	 srls = Rule_Set.Empty, calc = [], errpatts = [],
   18.59 -	 rules = [Rule.Num_Calc("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
   18.60 -		  Rule.Num_Calc("Prog_Expr.rhs", Prog_Expr.eval_rhs "eval_rhs_"),
   18.61 -		  Rule.Num_Calc("Diff.primed", eval_primed "Diff.primed")
   18.62 +	 rules = [Rule.Eval("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
   18.63 +		  Rule.Eval("Prog_Expr.rhs", Prog_Expr.eval_rhs "eval_rhs_"),
   18.64 +		  Rule.Eval("Diff.primed", eval_primed "Diff.primed")
   18.65  		  ],
   18.66 -	 scr = Rule.EmptyScr};
   18.67 +	 scr = Rule.Empty_Prog};
   18.68  \<close>
   18.69  ML \<open>
   18.70  (*..*)
   18.71 @@ -187,10 +187,10 @@
   18.72                 [Rule.Thm ("not_true",ThmC.numerals_to_Free @{thm not_true}),
   18.73  		Rule.Thm ("not_false",ThmC.numerals_to_Free @{thm not_false}),
   18.74  		
   18.75 -		Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),    
   18.76 -		Rule.Num_Calc ("Prog_Expr.is'_atom", Prog_Expr.eval_is_atom "#is_atom_"),
   18.77 -		Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),
   18.78 -		Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_")
   18.79 +		Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),    
   18.80 +		Rule.Eval ("Prog_Expr.is'_atom", Prog_Expr.eval_is_atom "#is_atom_"),
   18.81 +		Rule.Eval ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),
   18.82 +		Rule.Eval ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_")
   18.83  		];
   18.84  
   18.85  (*.rules for differentiation, _no_ simplification.*)
   18.86 @@ -219,7 +219,7 @@
   18.87  		  Rule.Thm ("diff_const",ThmC.numerals_to_Free @{thm diff_const}),
   18.88  		  Rule.Thm ("diff_var",ThmC.numerals_to_Free @{thm diff_var})
   18.89  		  ],
   18.90 -	 scr = Rule.EmptyScr};
   18.91 +	 scr = Rule.Empty_Prog};
   18.92  \<close>
   18.93  ML \<open>
   18.94  (*.normalisation for checking user-input.*)
   18.95 @@ -228,7 +228,7 @@
   18.96      {id="norm_diff", preconds = [], rew_ord = ("termlessI",termlessI), 
   18.97       erls = Rule_Set.Empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   18.98       rules = [Rule.Rls_ diff_rules, Rule.Rls_ norm_Poly ],
   18.99 -     scr = Rule.EmptyScr};
  18.100 +     scr = Rule.Empty_Prog};
  18.101  \<close>
  18.102  setup \<open>KEStore_Elems.add_rlss 
  18.103    [("erls_diff", (Context.theory_name @{theory}, prep_rls' erls_diff)), 
    19.1 --- a/src/Tools/isac/Knowledge/DiffApp-scrpbl.sml	Wed Apr 15 11:11:54 2020 +0200
    19.2 +++ b/src/Tools/isac/Knowledge/DiffApp-scrpbl.sml	Wed Apr 15 11:37:43 2020 +0200
    19.3 @@ -420,10 +420,10 @@
    19.4  val p = e_pos'; val c = []; 
    19.5  
    19.6  val (mI,m) = ("Init_Proof",Init_Proof (cts, (dI',pI',mI')));
    19.7 -val (pst as (sc,pt,cl):pstate) = (Rule.EmptyScr, e_ctree, []);
    19.8 +val (pst as (sc,pt,cl):pstate) = (Rule.Empty_Prog, e_ctree, []);
    19.9  val (p,_,f,nxt,_,(_,pt,_)) = do_ (mI,m) p c pst;
   19.10  (*val nxt = ("Add_Given",Add_Given "fixedValues [R = R]")*)
   19.11  
   19.12  val (p,_,Form' (PpcKF (_,_,ppc)),nxt,_,(_,pt,_)) = 
   19.13 -  do_ nxt p c (Rule.EmptyScr,pt,[]);
   19.14 +  do_ nxt p c (Rule.Empty_Prog,pt,[]);
   19.15  (*val nxt = ("Add_Given",Add_Given "boundVariable a") *)
    20.1 --- a/src/Tools/isac/Knowledge/DiffApp.sml	Wed Apr 15 11:11:54 2020 +0200
    20.2 +++ b/src/Tools/isac/Knowledge/DiffApp.sml	Wed Apr 15 11:37:43 2020 +0200
    20.3 @@ -63,7 +63,7 @@
    20.4      ("#Relate","relations r_s")
    20.5      ],
    20.6     rew_ord'="tless_true",rls'="eval_rls",asm_rls=[],asm_thm=[],
    20.7 -   scr =Rule.EmptyScr} : met),
    20.8 +   scr =Rule.Empty_Prog} : met),
    20.9  
   20.10   (("DiffAppl","make_fun_by_new_variable"),
   20.11    {ppc = prep_met DiffAppl.thy
   20.12 @@ -73,7 +73,7 @@
   20.13      ("#Find"  ,"functionTerm f_0_")
   20.14      ],
   20.15     rew_ord'="tless_true",rls'="eval_rls",asm_rls=[],asm_thm=[],
   20.16 -   scr =Rule.EmptyScr} : met),
   20.17 +   scr =Rule.Empty_Prog} : met),
   20.18  
   20.19   (("DiffAppl","make_fun_by_explicit"),
   20.20    {ppc = prep_met DiffAppl.thy
   20.21 @@ -83,7 +83,7 @@
   20.22      ("#Find"  ,"functionTerm f_0_")
   20.23      ],
   20.24     rew_ord'="tless_true",rls'="eval_rls",asm_rls=[],asm_thm=[],
   20.25 -   scr =Rule.EmptyScr} : met),
   20.26 +   scr =Rule.Empty_Prog} : met),
   20.27    
   20.28   (("DiffAppl","max_on_interval_by_calculus"),
   20.29    {ppc = prep_met DiffAppl.thy
   20.30 @@ -94,11 +94,11 @@
   20.31      ("#Find"  ,"maxArgument v_0")
   20.32      ],
   20.33     rew_ord'="tless_true",rls'="eval_rls",asm_rls=[],asm_thm=[],
   20.34 -   scr =Rule.EmptyScr} : met),
   20.35 +   scr =Rule.Empty_Prog} : met),
   20.36  
   20.37   (("DiffAppl","find_values"),
   20.38    {ppc = prep_met DiffAppl.thy
   20.39     [],
   20.40     rew_ord'="tless_true",rls'="eval_rls",asm_rls=[],asm_thm=[],
   20.41 -   scr =Rule.EmptyScr} : met)
   20.42 +   scr =Rule.Empty_Prog} : met)
   20.43  ]);
    21.1 --- a/src/Tools/isac/Knowledge/DiffApp.thy	Wed Apr 15 11:11:54 2020 +0200
    21.2 +++ b/src/Tools/isac/Knowledge/DiffApp.thy	Wed Apr 15 11:37:43 2020 +0200
    21.3 @@ -49,14 +49,14 @@
    21.4        Rule.Thm ("and_commute", ThmC.numerals_to_Free @{thm and_commute}),
    21.5        Rule.Thm ("or_commute", ThmC.numerals_to_Free @{thm or_commute}),
    21.6        
    21.7 -      Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
    21.8 -      Rule.Num_Calc ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
    21.9 +      Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   21.10 +      Rule.Eval ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   21.11        
   21.12 -      Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),    
   21.13 -      Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   21.14 -      Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),    
   21.15 -      Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "")],
   21.16 -    scr = Rule.EmptyScr
   21.17 +      Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),    
   21.18 +      Rule.Eval ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   21.19 +      Rule.Eval ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),    
   21.20 +      Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches "")],
   21.21 +    scr = Rule.Empty_Prog
   21.22      });
   21.23  \<close>
   21.24  setup \<open>KEStore_Elems.add_rlss [("eval_rls", (Context.theory_name @{theory}, eval_rls))]\<close>
    22.1 --- a/src/Tools/isac/Knowledge/EqSystem.thy	Wed Apr 15 11:11:54 2020 +0200
    22.2 +++ b/src/Tools/isac/Knowledge/EqSystem.thy	Wed Apr 15 11:37:43 2020 +0200
    22.3 @@ -187,7 +187,7 @@
    22.4  	       Rule.Thm ("add.assoc",ThmC.numerals_to_Free @{thm add.assoc})	               
    22.5  	       (*z1.0 + z2.0 + z3.0 = z1.0 + (z2.0 + z3.0)*)
    22.6  	       ], 
    22.7 -      scr = Rule.EmptyScr};
    22.8 +      scr = Rule.Empty_Prog};
    22.9  \<close>
   22.10  ML \<open>
   22.11  (*.adapted from 'norm_Rational' by
   22.12 @@ -208,7 +208,7 @@
   22.13  		(*Rule.Rls_ add_fractions_p, #2*)
   22.14  		Rule.Rls_ cancel_p
   22.15  		],
   22.16 -       scr = Rule.EmptyScr
   22.17 +       scr = Rule.Empty_Prog
   22.18         };
   22.19  \<close>
   22.20  ML \<open>
   22.21 @@ -229,7 +229,7 @@
   22.22  		Rule.Rls_ add_fractions_p,
   22.23  		Rule.Rls_ cancel_p
   22.24  		],
   22.25 -       scr = Rule.EmptyScr
   22.26 +       scr = Rule.Empty_Prog
   22.27         };
   22.28  \<close>
   22.29  ML \<open>
   22.30 @@ -243,7 +243,7 @@
   22.31     *3* discard_parentheses only for (.*(.*.))
   22.32     analoguous to simplify_Integral                                       .*)
   22.33  val simplify_System_parenthesized = 
   22.34 -  Rule_Set.Seqence {id = "simplify_System_parenthesized", preconds = []:term list, 
   22.35 +  Rule_Set.Sequence {id = "simplify_System_parenthesized", preconds = []:term list, 
   22.36         rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
   22.37        erls = Atools_erls, srls = Rule_Set.Empty, calc = [], errpatts = [],
   22.38        rules = [Rule.Thm ("distrib_right",ThmC.numerals_to_Free @{thm distrib_right}),
   22.39 @@ -258,9 +258,9 @@
   22.40  	       (*Rule.Rls_ discard_parentheses *3**),
   22.41  	       Rule.Rls_ collect_bdv, (*from make_polynomial_in WN051031 welldone?*)
   22.42  	       Rule.Rls_ separate_bdv2,
   22.43 -	       Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e")
   22.44 +	       Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e")
   22.45  	       ],
   22.46 -      scr = Rule.EmptyScr};      
   22.47 +      scr = Rule.Empty_Prog};      
   22.48  \<close>
   22.49  ML \<open>
   22.50  (*.simplify an equational system AFTER solving it;
   22.51 @@ -268,7 +268,7 @@
   22.52     *1* ord_simplify_System instead of termlessI           .*)
   22.53  (*TODO.WN051031 ^^^^^^^^^^ should be in EACH rls contained *)
   22.54  val simplify_System = 
   22.55 -  Rule_Set.Seqence {id = "simplify_System", preconds = []:term list, 
   22.56 +  Rule_Set.Sequence {id = "simplify_System", preconds = []:term list, 
   22.57         rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
   22.58        erls = Atools_erls, srls = Rule_Set.Empty, calc = [], errpatts = [],
   22.59        rules = [Rule.Rls_ norm_Rational,
   22.60 @@ -276,9 +276,9 @@
   22.61  	       Rule.Rls_ discard_parentheses,
   22.62  	       Rule.Rls_ collect_bdv, (*from make_polynomial_in WN051031 welldone?*)
   22.63  	       Rule.Rls_ separate_bdv2,
   22.64 -	       Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e")
   22.65 +	       Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e")
   22.66  	       ],
   22.67 -      scr = Rule.EmptyScr};      
   22.68 +      scr = Rule.Empty_Prog};      
   22.69  (*
   22.70  val simplify_System = 
   22.71      Rule_Set.append_rules "simplify_System" simplify_System_parenthesized
   22.72 @@ -291,7 +291,7 @@
   22.73      Rule_Def.Repeat {id="isolate_bdvs", preconds = [], 
   22.74  	 rew_ord = ("e_rew_ord", Rewrite_Ord.e_rew_ord), 
   22.75  	 erls = Rule_Set.append_rules "erls_isolate_bdvs" Rule_Set.empty 
   22.76 -			   [(Rule.Num_Calc ("EqSystem.occur'_exactly'_in", 
   22.77 +			   [(Rule.Eval ("EqSystem.occur'_exactly'_in", 
   22.78  				   eval_occur_exactly_in 
   22.79  				       "#eval_occur_exactly_in_"))
   22.80  			    ], 
   22.81 @@ -300,7 +300,7 @@
   22.82               [Rule.Thm ("commute_0_equality", ThmC.numerals_to_Free @{thm commute_0_equality}),
   22.83  	      Rule.Thm ("separate_bdvs_add", ThmC.numerals_to_Free @{thm separate_bdvs_add}),
   22.84  	      Rule.Thm ("separate_bdvs_mult", ThmC.numerals_to_Free @{thm separate_bdvs_mult})],
   22.85 -	      scr = Rule.EmptyScr};
   22.86 +	      scr = Rule.Empty_Prog};
   22.87  \<close>
   22.88  ML \<open>
   22.89  val isolate_bdvs_4x4 = 
   22.90 @@ -308,10 +308,10 @@
   22.91  	 rew_ord = ("e_rew_ord", Rewrite_Ord.e_rew_ord), 
   22.92  	 erls = Rule_Set.append_rules 
   22.93  		    "erls_isolate_bdvs_4x4" Rule_Set.empty 
   22.94 -		    [Rule.Num_Calc ("EqSystem.occur'_exactly'_in", 
   22.95 +		    [Rule.Eval ("EqSystem.occur'_exactly'_in", 
   22.96  			   eval_occur_exactly_in "#eval_occur_exactly_in_"),
   22.97 -		     Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   22.98 -		     Rule.Num_Calc ("Prog_Expr.some'_occur'_in", Prog_Expr.eval_some_occur_in "#some_occur_in_"),
   22.99 +		     Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
  22.100 +		     Rule.Eval ("Prog_Expr.some'_occur'_in", Prog_Expr.eval_some_occur_in "#some_occur_in_"),
  22.101           Rule.Thm ("not_true",ThmC.numerals_to_Free @{thm not_true}),
  22.102  		     Rule.Thm ("not_false",ThmC.numerals_to_Free @{thm not_false})
  22.103  			    ], 
  22.104 @@ -321,7 +321,7 @@
  22.105  		  Rule.Thm ("separate_bdvs_add1", ThmC.numerals_to_Free @{thm separate_bdvs_add1}),
  22.106  		  Rule.Thm ("separate_bdvs_add1", ThmC.numerals_to_Free @{thm separate_bdvs_add2}),
  22.107  		  Rule.Thm ("separate_bdvs_mult", ThmC.numerals_to_Free @{thm separate_bdvs_mult})
  22.108 -                 ], scr = Rule.EmptyScr};
  22.109 +                 ], scr = Rule.Empty_Prog};
  22.110  
  22.111  \<close>
  22.112  ML \<open>
  22.113 @@ -335,7 +335,7 @@
  22.114  	 erls = Rule_Set.Empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
  22.115  	 rules = [Rule.Thm ("order_system_NxN", ThmC.numerals_to_Free @{thm order_system_NxN})
  22.116  		  ],
  22.117 -	 scr = Rule.EmptyScr};
  22.118 +	 scr = Rule.Empty_Prog};
  22.119  
  22.120  val prls_triangular = 
  22.121      Rule_Def.Repeat {id="prls_triangular", preconds = [], 
  22.122 @@ -344,23 +344,23 @@
  22.123  		     rew_ord = ("e_rew_ord", Rewrite_Ord.e_rew_ord), 
  22.124  		     erls = Rule_Set.Empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
  22.125  		     rules = [(*for precond NTH_CONS ...*)
  22.126 -			      Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
  22.127 -			      Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_")
  22.128 +			      Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
  22.129 +			      Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_")
  22.130  			      (*immediately repeated rewrite pushes
  22.131  					    '+' into precondition !*)
  22.132  			      ],
  22.133 -		     scr = Rule.EmptyScr}, 
  22.134 +		     scr = Rule.Empty_Prog}, 
  22.135  	 srls = Rule_Set.Empty, calc = [], errpatts = [],
  22.136  	 rules = [Rule.Thm ("NTH_CONS",ThmC.numerals_to_Free @{thm NTH_CONS}),
  22.137 -		  Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.138 +		  Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.139  		  Rule.Thm ("NTH_NIL",ThmC.numerals_to_Free @{thm NTH_NIL}),
  22.140  		  Rule.Thm ("tl_Cons",ThmC.numerals_to_Free @{thm tl_Cons}),
  22.141  		  Rule.Thm ("tl_Nil",ThmC.numerals_to_Free @{thm tl_Nil}),
  22.142 -		  Rule.Num_Calc ("EqSystem.occur'_exactly'_in", 
  22.143 +		  Rule.Eval ("EqSystem.occur'_exactly'_in", 
  22.144  			eval_occur_exactly_in 
  22.145  			    "#eval_occur_exactly_in_")
  22.146  		  ],
  22.147 -	 scr = Rule.EmptyScr};
  22.148 +	 scr = Rule.Empty_Prog};
  22.149  \<close>
  22.150  ML \<open>
  22.151  
  22.152 @@ -373,23 +373,23 @@
  22.153  		     rew_ord = ("e_rew_ord", Rewrite_Ord.e_rew_ord), 
  22.154  		     erls = Rule_Set.Empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
  22.155  		     rules = [(*for precond NTH_CONS ...*)
  22.156 -			      Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
  22.157 -			      Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_")
  22.158 +			      Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
  22.159 +			      Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_")
  22.160  			      (*immediately repeated rewrite pushes
  22.161  					    '+' into precondition !*)
  22.162  			      ],
  22.163 -		     scr = Rule.EmptyScr}, 
  22.164 +		     scr = Rule.Empty_Prog}, 
  22.165  	 srls = Rule_Set.Empty, calc = [], errpatts = [],
  22.166  	 rules = [Rule.Thm ("NTH_CONS",ThmC.numerals_to_Free @{thm NTH_CONS}),
  22.167 -		  Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.168 +		  Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.169  		  Rule.Thm ("NTH_NIL",ThmC.numerals_to_Free @{thm NTH_NIL}),
  22.170  		  Rule.Thm ("tl_Cons",ThmC.numerals_to_Free @{thm tl_Cons}),
  22.171  		  Rule.Thm ("tl_Nil",ThmC.numerals_to_Free @{thm tl_Nil}),
  22.172 -		  Rule.Num_Calc ("EqSystem.occur'_exactly'_in", 
  22.173 +		  Rule.Eval ("EqSystem.occur'_exactly'_in", 
  22.174  			eval_occur_exactly_in 
  22.175  			    "#eval_occur_exactly_in_")
  22.176  		  ],
  22.177 -	 scr = Rule.EmptyScr};
  22.178 +	 scr = Rule.Empty_Prog};
  22.179  \<close>
  22.180  
  22.181  setup \<open>KEStore_Elems.add_rlss 
  22.182 @@ -426,8 +426,8 @@
  22.183          Rule_Set.append_rules "prls_2x2_linear_system" Rule_Set.empty 
  22.184  			    [Rule.Thm ("LENGTH_CONS",ThmC.numerals_to_Free @{thm LENGTH_CONS}),
  22.185  			      Rule.Thm ("LENGTH_NIL",ThmC.numerals_to_Free @{thm LENGTH_NIL}),
  22.186 -			      Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.187 -			      Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_")], 
  22.188 +			      Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.189 +			      Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_")], 
  22.190          SOME "solveSystem e_s v_s", [])),
  22.191      (Specify.prep_pbt thy "pbl_equsys_lin_2x2_tri" [] Celem.e_pblID
  22.192        (["triangular", "2x2", "LINEAR", "system"],
  22.193 @@ -453,8 +453,8 @@
  22.194          Rule_Set.append_rules "prls_3x3_linear_system" Rule_Set.empty 
  22.195  			    [Rule.Thm ("LENGTH_CONS",ThmC.numerals_to_Free @{thm LENGTH_CONS}),
  22.196  			      Rule.Thm ("LENGTH_NIL",ThmC.numerals_to_Free @{thm LENGTH_NIL}),
  22.197 -			      Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.198 -			      Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_")],
  22.199 +			      Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.200 +			      Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_")],
  22.201          SOME "solveSystem e_s v_s", [])),
  22.202      (Specify.prep_pbt thy "pbl_equsys_lin_4x4" [] Celem.e_pblID
  22.203        (["4x4", "LINEAR", "system"],
  22.204 @@ -465,8 +465,8 @@
  22.205          Rule_Set.append_rules "prls_4x4_linear_system" Rule_Set.empty 
  22.206  			    [Rule.Thm ("LENGTH_CONS",ThmC.numerals_to_Free @{thm LENGTH_CONS}),
  22.207  			      Rule.Thm ("LENGTH_NIL",ThmC.numerals_to_Free @{thm LENGTH_NIL}),
  22.208 -			      Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.209 -			      Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_")],
  22.210 +			      Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.211 +			      Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_")],
  22.212          SOME "solveSystem e_s v_s", [])),
  22.213      (Specify.prep_pbt thy "pbl_equsys_lin_4x4_tri" [] Celem.e_pblID
  22.214        (["triangular", "4x4", "LINEAR", "system"],
  22.215 @@ -478,7 +478,7 @@
  22.216                "(NTH 4 (v_s::real list)) occurs_in (NTH 4 (e_s::bool list))"]),
  22.217            ("#Find"  ,["solution ss'''"])],
  22.218        Rule_Set.append_rules "prls_tri_4x4_lin_sys" prls_triangular
  22.219 -	      [Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in "")], 
  22.220 +	      [Rule.Eval ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in "")], 
  22.221        SOME "solveSystem e_s v_s", 
  22.222        [["EqSystem","top_down_substitution","4x4"]])),
  22.223      (Specify.prep_pbt thy "pbl_equsys_lin_4x4_norm" [] Celem.e_pblID
  22.224 @@ -497,15 +497,15 @@
  22.225  		rew_ord = ("termlessI",termlessI), 
  22.226  		erls = Rule_Set.append_rules "erls_in_srls_IntegrierenUnd.." Rule_Set.empty
  22.227  				  [(*for asm in NTH_CONS ...*)
  22.228 -				   Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
  22.229 +				   Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
  22.230  				   (*2nd NTH_CONS pushes n+-1 into asms*)
  22.231 -				   Rule.Num_Calc("Groups.plus_class.plus", (**)eval_binop "#add_")
  22.232 +				   Rule.Eval("Groups.plus_class.plus", (**)eval_binop "#add_")
  22.233  				   ], 
  22.234  		srls = Rule_Set.Empty, calc = [], errpatts = [],
  22.235  		rules = [Rule.Thm ("NTH_CONS",ThmC.numerals_to_Free @{thm NTH_CONS}),
  22.236 -			 Rule.Num_Calc("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.237 +			 Rule.Eval("Groups.plus_class.plus", (**)eval_binop "#add_"),
  22.238  			 Rule.Thm ("NTH_NIL",ThmC.numerals_to_Free @{thm NTH_NIL})],
  22.239 -		scr = Rule.EmptyScr};
  22.240 +		scr = Rule.Empty_Prog};
  22.241  \<close>
  22.242  
  22.243  (**methods**)
  22.244 @@ -656,7 +656,7 @@
  22.245  	    {rew_ord'="ord_simplify_System", rls' = Rule_Set.Empty, calc = [], 
  22.246  	      srls = Rule_Set.append_rules "srls_top_down_4x4" srls [], 
  22.247  	      prls = Rule_Set.append_rules "prls_tri_4x4_lin_sys" prls_triangular
  22.248 -			      [Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in "")], 
  22.249 +			      [Rule.Eval ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in "")], 
  22.250  	      crls = Rule_Set.Empty, errpats = [], nrls = Rule_Set.Empty},
  22.251  	    (*FIXXXXME.WN060916: this script works ONLY for exp 7.79 #>#>#>#>#>#>#>#>#>#>*)
  22.252  	    @{thm solve_system4.simps})]
    23.1 --- a/src/Tools/isac/Knowledge/Equation.thy	Wed Apr 15 11:11:54 2020 +0200
    23.2 +++ b/src/Tools/isac/Knowledge/Equation.thy	Wed Apr 15 11:37:43 2020 +0200
    23.3 @@ -38,7 +38,7 @@
    23.4  
    23.5  val univariate_equation_prls = 
    23.6      Rule_Set.append_rules "univariate_equation_prls" Rule_Set.empty 
    23.7 -	       [Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "")];
    23.8 +	       [Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches "")];
    23.9  \<close>
   23.10  setup \<open>KEStore_Elems.add_rlss [("univariate_equation_prls",
   23.11    (Context.theory_name @{theory}, Auto_Prog.prep_rls @{theory} univariate_equation_prls))]\<close>
   23.12 @@ -48,7 +48,7 @@
   23.13          [("#Given" ,["equality e_e","solveFor v_v"]),
   23.14            ("#Where" ,["matches (?a = ?b) e_e"]),
   23.15            ("#Find"  ,["solutions v_v'i'"])],
   23.16 -        Rule_Set.append_rules "equation_prls" Rule_Set.empty  [Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "")],
   23.17 +        Rule_Set.append_rules "equation_prls" Rule_Set.empty  [Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches "")],
   23.18          SOME "solve (e_e::bool, v_v)", [])),
   23.19      (Specify.prep_pbt thy "pbl_equ_univ" [] Celem.e_pblID
   23.20        (["univariate","equation"],
    24.1 --- a/src/Tools/isac/Knowledge/InsSort.thy	Wed Apr 15 11:11:54 2020 +0200
    24.2 +++ b/src/Tools/isac/Knowledge/InsSort.thy	Wed Apr 15 11:37:43 2020 +0200
    24.3 @@ -62,11 +62,11 @@
    24.4  	    Rule.Thm ("o_apply", @{thm o_apply} (* (?f \<circ> ?g) ?x = ?f (?g ?x) *)),
    24.5  	    Rule.Thm ("id_apply", @{thm id_apply} (* id ?x = ?x *)),
    24.6        
    24.7 -	    Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
    24.8 +	    Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
    24.9  	    Rule.Thm ("If_def", @{thm If_def} (* if ?P then ?x else ?y \<equiv> THE z. (?P = True \<longrightarrow> z = ?x) \<and> (?P = False \<longrightarrow> z = ?y) *)),
   24.10  	    Rule.Thm ("if_True", @{thm if_True} (* "(if True then x else y) = x" *)),
   24.11  	    Rule.Thm ("if_False", @{thm if_False} (* "(if False then x else y) = y" *))],
   24.12 -	  errpatts = [], scr = Rule.EmptyScr};      
   24.13 +	  errpatts = [], scr = Rule.Empty_Prog};      
   24.14  \<close>
   24.15  setup \<open>KEStore_Elems.add_rlss [("ins_sort", (Context.theory_name @{theory}, ins_sort))]\<close>
   24.16  
    25.1 --- a/src/Tools/isac/Knowledge/Integrate.thy	Wed Apr 15 11:11:54 2020 +0200
    25.2 +++ b/src/Tools/isac/Knowledge/Integrate.thy	Wed Apr 15 11:37:43 2020 +0200
    25.3 @@ -44,7 +44,7 @@
    25.4  (** eval functions **)
    25.5  
    25.6  val c = Free ("c", HOLogic.realT);
    25.7 -(*.create a new unique variable 'c..' in a term; for use by Rule.Num_Calc in a rls;
    25.8 +(*.create a new unique variable 'c..' in a term; for use by Rule.Eval in a rls;
    25.9     an alternative to do this would be '(Try (Calculate new_c_) (new_c es__))'
   25.10     in the script; this will be possible if currying doesnt take the value
   25.11     from a variable, but the value '(new_c es__)' itself.*)
   25.12 @@ -118,11 +118,11 @@
   25.13  		     erls = Rule_Set.Empty, 
   25.14  		     srls = Rule_Set.Empty, calc = [], errpatts = [],
   25.15  		     rules = [(*for rewriting conditions in Thm's*)
   25.16 -			      Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in "#occurs_in_"),
   25.17 +			      Rule.Eval ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in "#occurs_in_"),
   25.18  			      Rule.Thm ("not_true", ThmC.numerals_to_Free @{thm not_true}),
   25.19  			      Rule.Thm ("not_false",@{thm not_false})
   25.20  			      ],
   25.21 -		     scr = Rule.EmptyScr}, 
   25.22 +		     scr = Rule.Empty_Prog}, 
   25.23  	 srls = Rule_Set.Empty, calc = [], errpatts = [],
   25.24  	 rules = [
   25.25  		  Rule.Thm ("integral_const", ThmC.numerals_to_Free @{thm integral_const}),
   25.26 @@ -130,31 +130,31 @@
   25.27  		  Rule.Thm ("integral_add", ThmC.numerals_to_Free @{thm integral_add}),
   25.28  		  Rule.Thm ("integral_mult", ThmC.numerals_to_Free @{thm integral_mult}),
   25.29  		  Rule.Thm ("integral_pow", ThmC.numerals_to_Free @{thm integral_pow}),
   25.30 -		  Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_")(*for n+1*)
   25.31 +		  Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_")(*for n+1*)
   25.32  		  ],
   25.33 -	 scr = Rule.EmptyScr};
   25.34 +	 scr = Rule.Empty_Prog};
   25.35  \<close>
   25.36  ML \<open>
   25.37  val add_new_c = 
   25.38 -    Rule_Set.Seqence {id="add_new_c", preconds = [], 
   25.39 +    Rule_Set.Sequence {id="add_new_c", preconds = [], 
   25.40  	 rew_ord = ("termlessI",termlessI), 
   25.41  	 erls = Rule_Def.Repeat {id="conditions_in_add_new_c", 
   25.42  		     preconds = [], 
   25.43  		     rew_ord = ("termlessI",termlessI), 
   25.44  		     erls = Rule_Set.Empty, 
   25.45  		     srls = Rule_Set.Empty, calc = [], errpatts = [],
   25.46 -		     rules = [Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches""),
   25.47 -			      Rule.Num_Calc ("Integrate.is'_f'_x", 
   25.48 +		     rules = [Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches""),
   25.49 +			      Rule.Eval ("Integrate.is'_f'_x", 
   25.50  				    eval_is_f_x "is_f_x_"),
   25.51  			      Rule.Thm ("not_true", ThmC.numerals_to_Free @{thm not_true}),
   25.52  			      Rule.Thm ("not_false", ThmC.numerals_to_Free @{thm not_false})
   25.53  			      ],
   25.54 -		     scr = Rule.EmptyScr}, 
   25.55 +		     scr = Rule.Empty_Prog}, 
   25.56  	 srls = Rule_Set.Empty, calc = [], errpatts = [],
   25.57  	 rules = [ (*Rule.Thm ("call_for_new_c", ThmC.numerals_to_Free @{thm call_for_new_c}),*)
   25.58  		   Rule.Cal1 ("Integrate.add'_new'_c", eval_add_new_c "new_c_")
   25.59  		   ],
   25.60 -	 scr = Rule.EmptyScr};
   25.61 +	 scr = Rule.Empty_Prog};
   25.62  \<close>
   25.63  ML \<open>
   25.64  
   25.65 @@ -171,7 +171,7 @@
   25.66  		       rew_ord = ("dummy_ord",Rewrite_Ord.dummy_ord), 
   25.67  		       erls = (*FIXME.WN051028 Rule_Set.empty,*)
   25.68  		       Rule_Set.append_rules "Rule_Set.empty-is_polyexp" Rule_Set.empty
   25.69 -				  [Rule.Num_Calc ("Poly.is'_polyexp", 
   25.70 +				  [Rule.Eval ("Poly.is'_polyexp", 
   25.71  					 eval_is_polyexp "")],
   25.72  				  srls = Rule_Set.Empty, calc = [], errpatts = [],
   25.73  				  rules = [Rule.Thm ("rat_mult", ThmC.numerals_to_Free @{thm rat_mult}),
   25.74 @@ -190,23 +190,23 @@
   25.75  	       Rule.Thm ("divide_divide_eq_left",
   25.76                       ThmC.numerals_to_Free @{thm divide_divide_eq_left}),
   25.77  	       (*"?x / ?y / ?z = ?x / (?y * ?z)"*)
   25.78 -	       Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   25.79 +	       Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   25.80  	      
   25.81  	       Rule.Thm ("rat_power", ThmC.numerals_to_Free @{thm rat_power})
   25.82  		(*"(?a / ?b) ^^^ ?n = ?a ^^^ ?n / ?b ^^^ ?n"*)
   25.83  	       ],
   25.84 -      scr = Rule.EmptyScr
   25.85 +      scr = Rule.Empty_Prog
   25.86        }),
   25.87  		Rule.Rls_ make_rat_poly_with_parentheses,
   25.88  		Rule.Rls_ cancel_p_rls,(*FIXME:cancel_p does NOT order sometimes*)
   25.89  		Rule.Rls_ rat_reduce_1
   25.90  		],
   25.91 -       scr = Rule.EmptyScr
   25.92 +       scr = Rule.Empty_Prog
   25.93         };
   25.94  
   25.95  (*.for simplify_Integral adapted from 'norm_Rational'.*)
   25.96  val norm_Rational_noadd_fractions = 
   25.97 -   Rule_Set.Seqence {id = "norm_Rational_noadd_fractions", preconds = [], 
   25.98 +   Rule_Set.Sequence {id = "norm_Rational_noadd_fractions", preconds = [], 
   25.99         rew_ord = ("dummy_ord",Rewrite_Ord.dummy_ord), 
  25.100         erls = norm_rat_erls, srls = Rule_Set.Empty, calc = [], errpatts = [],
  25.101         rules = [Rule.Rls_ discard_minus,
  25.102 @@ -216,7 +216,7 @@
  25.103  		Rule.Rls_ norm_Rational_rls_noadd_fractions,(* the main rls (#)   *)
  25.104  		Rule.Rls_ discard_parentheses1 (* mult only                       *)
  25.105  		],
  25.106 -       scr = Rule.EmptyScr
  25.107 +       scr = Rule.Empty_Prog
  25.108         };
  25.109  
  25.110  (*.simplify terms before and after Integration such that  
  25.111 @@ -240,7 +240,7 @@
  25.112  			  (*"(?x + ?y) / ?z = ?x / ?z + ?y / ?z"*)----------*)
  25.113  		];
  25.114  val simplify_Integral = 
  25.115 -  Rule_Set.Seqence {id = "simplify_Integral", preconds = []:term list, 
  25.116 +  Rule_Set.Sequence {id = "simplify_Integral", preconds = []:term list, 
  25.117         rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  25.118        erls = Atools_erls, srls = Rule_Set.Empty,
  25.119        calc = [],  errpatts = [],
  25.120 @@ -254,9 +254,9 @@
  25.121  	       Rule.Rls_ discard_parentheses,
  25.122  	       (*Rule.Rls_ collect_bdv, from make_polynomial_in*)
  25.123  	       Rule.Rls_ separate_bdv2,
  25.124 -	       Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e")
  25.125 +	       Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e")
  25.126  	       ],
  25.127 -      scr = Rule.EmptyScr};      
  25.128 +      scr = Rule.Empty_Prog};      
  25.129  
  25.130  
  25.131  (*simplify terms before and after Integration such that  
  25.132 @@ -266,7 +266,7 @@
  25.133     'make_ratpoly_in' 
  25.134  THIS IS KEPT FOR COMPARISON ............................................   
  25.135  * val simplify_Integral = prep_rls'(
  25.136 -*   Rule_Set.Seqence {id = "", preconds = []:term list, 
  25.137 +*   Rule_Set.Sequence {id = "", preconds = []:term list, 
  25.138  *        rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  25.139  *       erls = Atools_erls, srls = Rule_Set.Empty,
  25.140  *       calc = [], (*asm_thm = [],*)
  25.141 @@ -292,14 +292,14 @@
  25.142  * 				  ThmC.numerals_to_Free @{thm add_divide_distrib})
  25.143  * 			   (*"(?x + ?y) / ?z = ?x / ?z + ?y / ?z"*)*)
  25.144  * 			  ]),
  25.145 -* 	       Rule.Num_Calc ("Rings.divide_class.divide"  , eval_cancel "#divide_e")
  25.146 +* 	       Rule.Eval ("Rings.divide_class.divide"  , eval_cancel "#divide_e")
  25.147  * 	       ],
  25.148 -*       scr = Rule.EmptyScr
  25.149 +*       scr = Rule.Empty_Prog
  25.150  *       }); 
  25.151  .......................................................................*)
  25.152  
  25.153  val integration = 
  25.154 -    Rule_Set.Seqence {id="integration", preconds = [], 
  25.155 +    Rule_Set.Sequence {id="integration", preconds = [], 
  25.156  	 rew_ord = ("termlessI",termlessI), 
  25.157  	 erls = Rule_Def.Repeat {id="conditions_in_integration", 
  25.158  		     preconds = [], 
  25.159 @@ -307,13 +307,13 @@
  25.160  		     erls = Rule_Set.Empty, 
  25.161  		     srls = Rule_Set.Empty, calc = [], errpatts = [],
  25.162  		     rules = [],
  25.163 -		     scr = Rule.EmptyScr}, 
  25.164 +		     scr = Rule.Empty_Prog}, 
  25.165  	 srls = Rule_Set.Empty, calc = [], errpatts = [],
  25.166  	 rules = [ Rule.Rls_ integration_rules,
  25.167  		   Rule.Rls_ add_new_c,
  25.168  		   Rule.Rls_ simplify_Integral
  25.169  		   ],
  25.170 -	 scr = Rule.EmptyScr};
  25.171 +	 scr = Rule.Empty_Prog};
  25.172  
  25.173  val prep_rls' = Auto_Prog.prep_rls @{theory};
  25.174  \<close>
    26.1 --- a/src/Tools/isac/Knowledge/Inverse_Z_Transform.thy	Wed Apr 15 11:11:54 2020 +0200
    26.2 +++ b/src/Tools/isac/Knowledge/Inverse_Z_Transform.thy	Wed Apr 15 11:37:43 2020 +0200
    26.3 @@ -33,7 +33,7 @@
    26.4  	   [
    26.5      Rule.Thm ("rule4", @{thm rule4})
    26.6  	   ], 
    26.7 -	 scr = Rule.EmptyScr});
    26.8 +	 scr = Rule.Empty_Prog});
    26.9  \<close>
   26.10  
   26.11  
   26.12 @@ -124,21 +124,21 @@
   26.13                preconds = [], rew_ord = ("termlessI",termlessI),
   26.14                erls = Rule_Set.append_rules "erls_in_srls_partial_fraction" Rule_Set.empty
   26.15                    [(*for asm in NTH_CONS ...*)
   26.16 -                    Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   26.17 +                    Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   26.18                      (*2nd NTH_CONS pushes n+-1 into asms*)
   26.19 -                    Rule.Num_Calc("Groups.plus_class.plus", (**)eval_binop "#add_")], 
   26.20 +                    Rule.Eval("Groups.plus_class.plus", (**)eval_binop "#add_")], 
   26.21                srls = Rule_Set.Empty, calc = [], errpatts = [],
   26.22                rules = [Rule.Thm ("NTH_CONS", @{thm NTH_CONS}),
   26.23 -                  Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   26.24 +                  Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   26.25                    Rule.Thm ("NTH_NIL", @{thm NTH_NIL}),
   26.26 -                  Rule.Num_Calc ("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
   26.27 -                  Rule.Num_Calc ("Prog_Expr.rhs", Prog_Expr.eval_rhs"eval_rhs_"),
   26.28 -                  Rule.Num_Calc ("Prog_Expr.argument'_in", Prog_Expr.eval_argument_in "Prog_Expr.argument'_in"),
   26.29 -                  Rule.Num_Calc ("Rational.get_denominator", eval_get_denominator "#get_denominator"),
   26.30 -                  Rule.Num_Calc ("Rational.get_numerator", eval_get_numerator "#get_numerator"),
   26.31 -                  Rule.Num_Calc ("Partial_Fractions.factors_from_solution",
   26.32 +                  Rule.Eval ("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
   26.33 +                  Rule.Eval ("Prog_Expr.rhs", Prog_Expr.eval_rhs"eval_rhs_"),
   26.34 +                  Rule.Eval ("Prog_Expr.argument'_in", Prog_Expr.eval_argument_in "Prog_Expr.argument'_in"),
   26.35 +                  Rule.Eval ("Rational.get_denominator", eval_get_denominator "#get_denominator"),
   26.36 +                  Rule.Eval ("Rational.get_numerator", eval_get_numerator "#get_numerator"),
   26.37 +                  Rule.Eval ("Partial_Fractions.factors_from_solution",
   26.38                      eval_factors_from_solution "#factors_from_solution")
   26.39 -                  ], scr = Rule.EmptyScr},
   26.40 +                  ], scr = Rule.Empty_Prog},
   26.41            prls = Rule_Set.empty, crls = Rule_Set.empty, errpats = [], nrls = norm_Rational},
   26.42          @{thm inverse_ztransform2.simps})]
   26.43  \<close>
    27.1 --- a/src/Tools/isac/Knowledge/LinEq.thy	Wed Apr 15 11:11:54 2020 +0200
    27.2 +++ b/src/Tools/isac/Knowledge/LinEq.thy	Wed Apr 15 11:37:43 2020 +0200
    27.3 @@ -27,14 +27,14 @@
    27.4  
    27.5  val LinEq_prls = (*3.10.02:just the following order due to subterm evaluation*)
    27.6    Rule_Set.append_rules "LinEq_prls" Rule_Set.empty 
    27.7 -	     [Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
    27.8 -	      Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
    27.9 -	      Rule.Num_Calc ("Prog_Expr.lhs"    , Prog_Expr.eval_lhs ""),
   27.10 -	      Rule.Num_Calc ("Prog_Expr.rhs"    , Prog_Expr.eval_rhs ""),
   27.11 -	      Rule.Num_Calc ("Poly.has'_degree'_in", eval_has_degree_in ""),
   27.12 - 	      Rule.Num_Calc ("Poly.is'_polyrat'_in", eval_is_polyrat_in ""),
   27.13 -	      Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),    
   27.14 -	      Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   27.15 +	     [Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   27.16 +	      Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   27.17 +	      Rule.Eval ("Prog_Expr.lhs"    , Prog_Expr.eval_lhs ""),
   27.18 +	      Rule.Eval ("Prog_Expr.rhs"    , Prog_Expr.eval_rhs ""),
   27.19 +	      Rule.Eval ("Poly.has'_degree'_in", eval_has_degree_in ""),
   27.20 + 	      Rule.Eval ("Poly.is'_polyrat'_in", eval_is_polyrat_in ""),
   27.21 +	      Rule.Eval ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),    
   27.22 +	      Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   27.23  	      Rule.Thm ("not_true",ThmC.numerals_to_Free @{thm not_true}),
   27.24  	      Rule.Thm ("not_false",ThmC.numerals_to_Free @{thm not_false}),
   27.25  	      Rule.Thm ("and_true",ThmC.numerals_to_Free @{thm and_true}),
   27.26 @@ -48,8 +48,8 @@
   27.27     [Rule.Thm  ("real_assoc_1",ThmC.numerals_to_Free @{thm real_assoc_1})
   27.28      (*		
   27.29       Don't use
   27.30 -     Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   27.31 -     Rule.Num_Calc ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   27.32 +     Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   27.33 +     Rule.Eval ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   27.34       *)
   27.35      ];
   27.36  
   27.37 @@ -59,8 +59,8 @@
   27.38     [Rule.Thm  ("real_assoc_1",ThmC.numerals_to_Free @{thm real_assoc_1})
   27.39      (*		
   27.40       Don't use
   27.41 -     Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   27.42 -     Rule.Num_Calc ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   27.43 +     Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   27.44 +     Rule.Eval ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   27.45       *)
   27.46      ];
   27.47  \<close>
   27.48 @@ -76,16 +76,16 @@
   27.49         calc = [], errpatts = [],
   27.50         rules = [
   27.51  		Rule.Thm  ("real_assoc_1",ThmC.numerals_to_Free @{thm real_assoc_1}),
   27.52 -		Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   27.53 -		Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   27.54 -		Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   27.55 +		Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   27.56 +		Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   27.57 +		Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   27.58  		(*  Dont use  
   27.59 -		 Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),		
   27.60 -		 Rule.Num_Calc ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   27.61 +		 Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),		
   27.62 +		 Rule.Eval ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   27.63  		 *)
   27.64 -		Rule.Num_Calc ("Prog_Expr.pow" , (**)eval_binop "#power_")
   27.65 +		Rule.Eval ("Prog_Expr.pow" , (**)eval_binop "#power_")
   27.66  		],
   27.67 -       scr = Rule.EmptyScr});
   27.68 +       scr = Rule.Empty_Prog});
   27.69  \<close>
   27.70  setup \<open>KEStore_Elems.add_rlss 
   27.71    [("LinPoly_simplify", (Context.theory_name @{theory}, LinPoly_simplify))]\<close>
   27.72 @@ -106,7 +106,7 @@
   27.73  	      Rule.Thm("lin_isolate_div",ThmC.numerals_to_Free @{thm lin_isolate_div})    
   27.74  	      (*   bx=c -> x=c/b *)  
   27.75  	      ],
   27.76 -     scr = Rule.EmptyScr});
   27.77 +     scr = Rule.Empty_Prog});
   27.78  \<close>
   27.79  setup \<open>KEStore_Elems.add_rlss 
   27.80    [("LinEq_simplify", (Context.theory_name @{theory}, LinEq_simplify))]\<close>
    28.1 --- a/src/Tools/isac/Knowledge/Partial_Fractions.thy	Wed Apr 15 11:11:54 2020 +0200
    28.2 +++ b/src/Tools/isac/Knowledge/Partial_Fractions.thy	Wed Apr 15 11:37:43 2020 +0200
    28.3 @@ -112,7 +112,7 @@
    28.4  	   [Rule.Thm ("ansatz_2nd_order",ThmC.numerals_to_Free @{thm ansatz_2nd_order}),
    28.5  	    Rule.Thm ("ansatz_3rd_order",ThmC.numerals_to_Free @{thm ansatz_3rd_order})
    28.6  	   ], 
    28.7 -	 scr = Rule.EmptyScr});
    28.8 +	 scr = Rule.Empty_Prog});
    28.9  
   28.10  val equival_trans = prep_rls'(
   28.11    Rule_Def.Repeat {id = "equival_trans", preconds = [], rew_ord = ("dummy_ord",Rewrite_Ord.dummy_ord), 
   28.12 @@ -121,7 +121,7 @@
   28.13  	   [Rule.Thm ("equival_trans_2nd_order",ThmC.numerals_to_Free @{thm equival_trans_2nd_order}),
   28.14  	    Rule.Thm ("equival_trans_3rd_order",ThmC.numerals_to_Free @{thm equival_trans_3rd_order})
   28.15  	   ], 
   28.16 -	 scr = Rule.EmptyScr});
   28.17 +	 scr = Rule.Empty_Prog});
   28.18  
   28.19  val multiply_ansatz = prep_rls'(
   28.20    Rule_Def.Repeat {id = "multiply_ansatz", preconds = [], rew_ord = ("dummy_ord",Rewrite_Ord.dummy_ord), 
   28.21 @@ -130,7 +130,7 @@
   28.22  	  rules = 
   28.23  	   [Rule.Thm ("multiply_2nd_order",ThmC.numerals_to_Free @{thm multiply_2nd_order})
   28.24  	   ], 
   28.25 -	 scr = Rule.EmptyScr});
   28.26 +	 scr = Rule.Empty_Prog});
   28.27  \<close>
   28.28  
   28.29  text \<open>store the rule set for math engine\<close>
   28.30 @@ -168,23 +168,23 @@
   28.31      rew_ord = ("termlessI",termlessI),
   28.32      erls = Rule_Set.append_rules "erls_in_srls_partial_fraction" Rule_Set.empty
   28.33        [(*for asm in NTH_CONS ...*)
   28.34 -       Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   28.35 +       Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   28.36         (*2nd NTH_CONS pushes n+-1 into asms*)
   28.37 -       Rule.Num_Calc("Groups.plus_class.plus", (**)eval_binop "#add_")], 
   28.38 +       Rule.Eval("Groups.plus_class.plus", (**)eval_binop "#add_")], 
   28.39      srls = Rule_Set.Empty, calc = [], errpatts = [],
   28.40      rules = [
   28.41         Rule.Thm ("NTH_CONS",ThmC.numerals_to_Free @{thm NTH_CONS}),
   28.42 -       Rule.Num_Calc("Groups.plus_class.plus", (**)eval_binop "#add_"),
   28.43 +       Rule.Eval("Groups.plus_class.plus", (**)eval_binop "#add_"),
   28.44         Rule.Thm ("NTH_NIL",ThmC.numerals_to_Free @{thm NTH_NIL}),
   28.45 -       Rule.Num_Calc("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
   28.46 -       Rule.Num_Calc("Prog_Expr.rhs", Prog_Expr.eval_rhs"eval_rhs_"),
   28.47 -       Rule.Num_Calc("Prog_Expr.argument'_in", Prog_Expr.eval_argument_in "Prog_Expr.argument'_in"),
   28.48 -       Rule.Num_Calc("Rational.get_denominator", eval_get_denominator "#get_denominator"),
   28.49 -       Rule.Num_Calc("Rational.get_numerator", eval_get_numerator "#get_numerator"),
   28.50 -       Rule.Num_Calc("Partial_Fractions.factors_from_solution",
   28.51 +       Rule.Eval("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
   28.52 +       Rule.Eval("Prog_Expr.rhs", Prog_Expr.eval_rhs"eval_rhs_"),
   28.53 +       Rule.Eval("Prog_Expr.argument'_in", Prog_Expr.eval_argument_in "Prog_Expr.argument'_in"),
   28.54 +       Rule.Eval("Rational.get_denominator", eval_get_denominator "#get_denominator"),
   28.55 +       Rule.Eval("Rational.get_numerator", eval_get_numerator "#get_numerator"),
   28.56 +       Rule.Eval("Partial_Fractions.factors_from_solution",
   28.57           eval_factors_from_solution "#factors_from_solution")
   28.58         ],
   28.59 -    scr = Rule.EmptyScr};
   28.60 +    scr = Rule.Empty_Prog};
   28.61  \<close>
   28.62  
   28.63  (* current version, error outcommented *)
    29.1 --- a/src/Tools/isac/Knowledge/Poly.thy	Wed Apr 15 11:11:54 2020 +0200
    29.2 +++ b/src/Tools/isac/Knowledge/Poly.thy	Wed Apr 15 11:37:43 2020 +0200
    29.3 @@ -652,20 +652,20 @@
    29.4  
    29.5  (*.for evaluation of conditions in rewrite rules.*)
    29.6  val Poly_erls = Rule_Set.append_rules "Poly_erls" Atools_erls
    29.7 -  [Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
    29.8 +  [Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
    29.9    Rule.Thm  ("real_unari_minus", ThmC.numerals_to_Free @{thm real_unari_minus}),
   29.10 -  Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   29.11 -  Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   29.12 -  Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   29.13 -  Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_")];
   29.14 +  Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   29.15 +  Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   29.16 +  Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   29.17 +  Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_")];
   29.18  
   29.19  val poly_crls = Rule_Set.append_rules "poly_crls" Atools_crls
   29.20 -  [Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   29.21 +  [Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   29.22    Rule.Thm ("real_unari_minus", ThmC.numerals_to_Free @{thm real_unari_minus}),
   29.23 -  Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   29.24 -  Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   29.25 -  Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   29.26 -  Rule.Num_Calc ("Prog_Expr.pow" , (**)eval_binop "#power_")];
   29.27 +  Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   29.28 +  Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   29.29 +  Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   29.30 +  Rule.Eval ("Prog_Expr.pow" , (**)eval_binop "#power_")];
   29.31  \<close>
   29.32  ML \<open>
   29.33  val expand =
   29.34 @@ -675,7 +675,7 @@
   29.35  	       (*"(z1.0 + z2.0) * w = z1.0 * w + z2.0 * w"*)
   29.36  	       Rule.Thm ("distrib_left", ThmC.numerals_to_Free @{thm distrib_left})
   29.37  	       (*"w * (z1.0 + z2.0) = w * z1.0 + w * z2.0"*)
   29.38 -	       ], scr = Rule.EmptyScr};
   29.39 +	       ], scr = Rule.Empty_Prog};
   29.40  
   29.41  val discard_minus =
   29.42    Rule_Def.Repeat {id = "discard_minus", preconds = [], rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
   29.43 @@ -685,7 +685,7 @@
   29.44            (*"a - b = a + -1 * b"*)
   29.45  	        Rule.Thm ("sym_real_mult_minus1", ThmC.numerals_to_Free (@{thm real_mult_minus1} RS @{thm sym}))
   29.46  	          (*- ?z = "-1 * ?z"*)],
   29.47 -	      scr = Rule.EmptyScr};
   29.48 +	      scr = Rule.Empty_Prog};
   29.49  
   29.50  val expand_poly_ = 
   29.51    Rule_Def.Repeat{id = "expand_poly_", preconds = [], 
   29.52 @@ -719,13 +719,13 @@
   29.53  	           (*"(r * s) ^^^ n = r ^^^ n * s ^^^ n"*)
   29.54  	         Rule.Thm ("realpow_pow",ThmC.numerals_to_Free @{thm realpow_pow})
   29.55  	           (*"(a ^^^ b) ^^^ c = a ^^^ (b * c)"*)
   29.56 -	       ], scr = Rule.EmptyScr};
   29.57 +	       ], scr = Rule.Empty_Prog};
   29.58  
   29.59  val expand_poly_rat_ = 
   29.60    Rule_Def.Repeat{id = "expand_poly_rat_", preconds = [], 
   29.61        rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
   29.62        erls =  Rule_Set.append_rules "Rule_Set.empty-is_polyexp" Rule_Set.empty
   29.63 -	        [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")
   29.64 +	        [Rule.Eval ("Poly.is'_polyexp", eval_is_polyexp "")
   29.65  		 ],
   29.66        srls = Rule_Set.Empty,
   29.67        calc = [], errpatts = [],
   29.68 @@ -757,7 +757,7 @@
   29.69  		            (r * s) ^^^ n = r ^^^ n * s ^^^ n"*)
   29.70  	  Rule.Thm ("realpow_pow",ThmC.numerals_to_Free @{thm realpow_pow})
   29.71  	      (*"(a ^^^ b) ^^^ c = a ^^^ (b * c)"*)
   29.72 -	 ], scr = Rule.EmptyScr};
   29.73 +	 ], scr = Rule.Empty_Prog};
   29.74  
   29.75  val simplify_power_ = 
   29.76    Rule_Def.Repeat{id = "simplify_power_", preconds = [], 
   29.77 @@ -792,7 +792,7 @@
   29.78  		  "r * r = r ^^^ 2" wenn r=a^^^b*)
   29.79  	       Rule.Thm ("realpow_pow",ThmC.numerals_to_Free @{thm realpow_pow})
   29.80  	       (*"(a ^^^ b) ^^^ c = a ^^^ (b * c)"*)
   29.81 -	       ], scr = Rule.EmptyScr};
   29.82 +	       ], scr = Rule.Empty_Prog};
   29.83  
   29.84  val calc_add_mult_pow_ = 
   29.85    Rule_Def.Repeat{id = "calc_add_mult_pow_", preconds = [], 
   29.86 @@ -803,10 +803,10 @@
   29.87  	      ("POWER", ("Prog_Expr.pow", (**)eval_binop "#power_"))
   29.88  	      ],
   29.89        errpatts = [],
   29.90 -      rules = [Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   29.91 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   29.92 -	       Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_")
   29.93 -	       ], scr = Rule.EmptyScr};
   29.94 +      rules = [Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   29.95 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   29.96 +	       Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_")
   29.97 +	       ], scr = Rule.Empty_Prog};
   29.98  
   29.99  val reduce_012_mult_ = 
  29.100    Rule_Def.Repeat{id = "reduce_012_mult_", preconds = [], 
  29.101 @@ -822,7 +822,7 @@
  29.102  	       (*"r ^^^ 1 = r"*)
  29.103  	       Rule.Thm ("realpow_eq_oneI",ThmC.numerals_to_Free @{thm realpow_eq_oneI})
  29.104  	       (*"1 ^^^ n = 1"*)
  29.105 -	       ], scr = Rule.EmptyScr};
  29.106 +	       ], scr = Rule.Empty_Prog};
  29.107  
  29.108  val collect_numerals_ = 
  29.109    Rule_Def.Repeat{id = "collect_numerals_", preconds = [], 
  29.110 @@ -841,7 +841,7 @@
  29.111  	 Rule.Thm ("real_one_collect_assoc_r",ThmC.numerals_to_Free @{thm real_one_collect_assoc_r}), 
  29.112  	     (*"m is_const ==> (k + n) + m * n = k + (m + 1) * n"*)
  29.113  
  29.114 -         Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  29.115 +         Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  29.116  
  29.117  	 (*MG: Reihenfolge der folgenden 2 Rule.Thm muss so bleiben, wegen
  29.118  		     (a+a)+a --> a + 2*a --> 3*a and not (a+a)+a --> 2*a + a *)
  29.119 @@ -849,7 +849,7 @@
  29.120  	     (*"(k + z1) + z1 = k + 2 * z1"*)
  29.121  	 Rule.Thm ("sym_real_mult_2",ThmC.numerals_to_Free (@{thm real_mult_2} RS @{thm sym}))
  29.122  	     (*"z1 + z1 = 2 * z1"*)
  29.123 -	], scr = Rule.EmptyScr};
  29.124 +	], scr = Rule.Empty_Prog};
  29.125  
  29.126  val reduce_012_ = 
  29.127    Rule_Def.Repeat{id = "reduce_012_", preconds = [], 
  29.128 @@ -870,7 +870,7 @@
  29.129  	       (*"?r ^^^ 1 = ?r"*)
  29.130  	       Rule.Thm ("division_ring_divide_zero",ThmC.numerals_to_Free @{thm division_ring_divide_zero})
  29.131  	       (*"0 / ?x = 0"*)
  29.132 -	       ], scr = Rule.EmptyScr};
  29.133 +	       ], scr = Rule.Empty_Prog};
  29.134  
  29.135  val discard_parentheses1 = 
  29.136      Rule_Set.append_rules "discard_parentheses1" Rule_Set.empty 
  29.137 @@ -919,7 +919,7 @@
  29.138  	       (*"- (?x + ?y) = - ?x + - ?y"*)
  29.139  	       (*Rule.Thm ("real_diff_plus",ThmC.numerals_to_Free @{thm real_diff_plus})*)
  29.140  	       (*"a - b = a + -b"*)
  29.141 -	       ], scr = Rule.EmptyScr};
  29.142 +	       ], scr = Rule.Empty_Prog};
  29.143  
  29.144  val simplify_power = 
  29.145    Rule_Def.Repeat{id = "simplify_power", preconds = [], 
  29.146 @@ -943,7 +943,7 @@
  29.147  	       (*"r ^^^ 1 = r"*)
  29.148  	       Rule.Thm ("realpow_eq_oneI",ThmC.numerals_to_Free @{thm realpow_eq_oneI})
  29.149  	       (*"1 ^^^ n = 1"*)
  29.150 -	       ], scr = Rule.EmptyScr};
  29.151 +	       ], scr = Rule.Empty_Prog};
  29.152  
  29.153  val collect_numerals = 
  29.154    Rule_Def.Repeat{id = "collect_numerals", preconds = [], 
  29.155 @@ -962,10 +962,10 @@
  29.156  	       (*"m is_const ==> n + m * n = (1 + m) * n"*)
  29.157  	       Rule.Thm ("real_one_collect_assoc",ThmC.numerals_to_Free @{thm real_one_collect_assoc}), 
  29.158  	       (*"m is_const ==> k + (n + m * n) = k + (1 + m) * n"*)
  29.159 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  29.160 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.161 -	       Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_")
  29.162 -	       ], scr = Rule.EmptyScr};
  29.163 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  29.164 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.165 +	       Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_")
  29.166 +	       ], scr = Rule.Empty_Prog};
  29.167  val reduce_012 = 
  29.168    Rule_Def.Repeat{id = "reduce_012", preconds = [], 
  29.169        rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  29.170 @@ -992,7 +992,7 @@
  29.171  	       (*"z1 + z1 = 2 * z1"*)
  29.172  	       Rule.Thm ("real_mult_2_assoc",ThmC.numerals_to_Free @{thm real_mult_2_assoc})
  29.173  	       (*"z1 + (z1 + k) = 2 * z1 + k"*)
  29.174 -	       ], scr = Rule.EmptyScr};
  29.175 +	       ], scr = Rule.Empty_Prog};
  29.176  
  29.177  val discard_parentheses = 
  29.178      Rule_Set.append_rules "discard_parentheses" Rule_Set.empty 
  29.179 @@ -1023,7 +1023,7 @@
  29.180  	       (*x + (y + z) = y + (x + z)*)
  29.181  	       Rule.Thm ("add.assoc",ThmC.numerals_to_Free @{thm add.assoc})	               
  29.182  	       (*z1.0 + z2.0 + z3.0 = z1.0 + (z2.0 + z3.0)*)
  29.183 -	       ], scr = Rule.EmptyScr};
  29.184 +	       ], scr = Rule.Empty_Prog};
  29.185  (*MG.0401: termorders for multivariate polys dropped due to principal problems:
  29.186    (total-degree-)ordering of monoms NOT possible with size_of_term GIVEN*)
  29.187  val order_mult = 
  29.188 @@ -1037,7 +1037,7 @@
  29.189  	       (*z1.0 * (z2.0 * z3.0) = z2.0 * (z1.0 * z3.0)*)
  29.190  	       Rule.Thm ("mult.assoc",ThmC.numerals_to_Free @{thm mult.assoc})	
  29.191  	       (*z1.0 * z2.0 * z3.0 = z1.0 * (z2.0 * z3.0)*)
  29.192 -	       ], scr = Rule.EmptyScr};
  29.193 +	       ], scr = Rule.Empty_Prog};
  29.194  \<close>
  29.195  ML \<open>
  29.196  fun attach_form (_: Rule.rule list list) (_: term) (_: term) = (*still missing*)
  29.197 @@ -1057,7 +1057,7 @@
  29.198               TermC.parse_patt thy "?p :: real")],
  29.199  	  rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  29.200  	  erls = Rule_Set.append_rules "Rule_Set.empty-is_multUnordered" Rule_Set.empty
  29.201 -			    [Rule.Num_Calc ("Poly.is'_multUnordered", 
  29.202 +			    [Rule.Eval ("Poly.is'_multUnordered", 
  29.203                                      eval_is_multUnordered "")],
  29.204  	  calc = [("PLUS"  , ("Groups.plus_class.plus", (**)eval_binop "#add_")),
  29.205  		  ("TIMES" , ("Groups.times_class.times", (**)eval_binop "#mult_")),
  29.206 @@ -1075,7 +1075,7 @@
  29.207        erls = Rule_Set.empty,srls = Rule_Set.Empty,
  29.208        calc = [], errpatts = [],
  29.209        rules = [Rule.Rls_ order_mult_
  29.210 -	       ], scr = Rule.EmptyScr};
  29.211 +	       ], scr = Rule.Empty_Prog};
  29.212  
  29.213  \<close> ML \<open>
  29.214  
  29.215 @@ -1097,7 +1097,7 @@
  29.216  	      fuer die Evaluation der Precondition "p is_addUnordered"*))],
  29.217  	  rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  29.218  	  erls = Rule_Set.append_rules "Rule_Set.empty-is_addUnordered" Rule_Set.empty(*MG: poly_erls*)
  29.219 -			    [Rule.Num_Calc ("Poly.is'_addUnordered", eval_is_addUnordered "")],
  29.220 +			    [Rule.Eval ("Poly.is'_addUnordered", eval_is_addUnordered "")],
  29.221  	  calc = [("PLUS"  ,("Groups.plus_class.plus", (**)eval_binop "#add_")),
  29.222  		  ("TIMES" ,("Groups.times_class.times", (**)eval_binop "#mult_")),
  29.223  		  ("DIVIDE",("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e")),
  29.224 @@ -1115,7 +1115,7 @@
  29.225        erls = Rule_Set.empty,srls = Rule_Set.Empty,
  29.226        calc = [], errpatts = [],
  29.227        rules = [Rule.Rls_ order_add_
  29.228 -	       ], scr = Rule.EmptyScr};
  29.229 +	       ], scr = Rule.Empty_Prog};
  29.230  \<close>
  29.231  
  29.232  text \<open>rule-set make_polynomial also named norm_Poly:
  29.233 @@ -1130,12 +1130,12 @@
  29.234  (*. see MG-DA.p.52ff .*)
  29.235  val make_polynomial(*MG.03, overwrites version from above, 
  29.236      previously 'make_polynomial_'*) =
  29.237 -  Rule_Set.Seqence {id = "make_polynomial", preconds = []:term list, 
  29.238 +  Rule_Set.Sequence {id = "make_polynomial", preconds = []:term list, 
  29.239        rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  29.240        erls = Atools_erls, srls = Rule_Set.Empty,calc = [], errpatts = [],
  29.241        rules = [Rule.Rls_ discard_minus,
  29.242  	       Rule.Rls_ expand_poly_,
  29.243 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.244 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.245  	       Rule.Rls_ order_mult_rls_,
  29.246  	       Rule.Rls_ simplify_power_, 
  29.247  	       Rule.Rls_ calc_add_mult_pow_, 
  29.248 @@ -1145,17 +1145,17 @@
  29.249  	       Rule.Rls_ reduce_012_,
  29.250  	       Rule.Rls_ discard_parentheses1
  29.251  	       ],
  29.252 -      scr = Rule.EmptyScr
  29.253 +      scr = Rule.Empty_Prog
  29.254        };
  29.255  \<close>
  29.256  ML \<open>
  29.257  val norm_Poly(*=make_polynomial*) = 
  29.258 -  Rule_Set.Seqence {id = "norm_Poly", preconds = []:term list, 
  29.259 +  Rule_Set.Sequence {id = "norm_Poly", preconds = []:term list, 
  29.260        rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  29.261        erls = Atools_erls, srls = Rule_Set.Empty, calc = [], errpatts = [],
  29.262        rules = [Rule.Rls_ discard_minus,
  29.263  	       Rule.Rls_ expand_poly_,
  29.264 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.265 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.266  	       Rule.Rls_ order_mult_rls_,
  29.267  	       Rule.Rls_ simplify_power_, 
  29.268  	       Rule.Rls_ calc_add_mult_pow_, 
  29.269 @@ -1165,7 +1165,7 @@
  29.270  	       Rule.Rls_ reduce_012_,
  29.271  	       Rule.Rls_ discard_parentheses1
  29.272  	       ],
  29.273 -      scr = Rule.EmptyScr
  29.274 +      scr = Rule.Empty_Prog
  29.275        };
  29.276  \<close>
  29.277  ML \<open>
  29.278 @@ -1173,12 +1173,12 @@
  29.279     and expand_poly_rat_ instead of expand_poly_, see MG-DA.p.56ff*)
  29.280  (* MG necessary  for termination of norm_Rational(*_mg*) in Rational.ML*)
  29.281  val make_rat_poly_with_parentheses =
  29.282 -  Rule_Set.Seqence{id = "make_rat_poly_with_parentheses", preconds = []:term list, 
  29.283 +  Rule_Set.Sequence{id = "make_rat_poly_with_parentheses", preconds = []:term list, 
  29.284        rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  29.285        erls = Atools_erls, srls = Rule_Set.Empty, calc = [], errpatts = [],
  29.286        rules = [Rule.Rls_ discard_minus,
  29.287  	       Rule.Rls_ expand_poly_rat_,(*ignors rationals*)
  29.288 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.289 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.290  	       Rule.Rls_ order_mult_rls_,
  29.291  	       Rule.Rls_ simplify_power_, 
  29.292  	       Rule.Rls_ calc_add_mult_pow_, 
  29.293 @@ -1188,14 +1188,14 @@
  29.294  	       Rule.Rls_ reduce_012_
  29.295  	       (*Rule.Rls_ discard_parentheses1 *)
  29.296  	       ],
  29.297 -      scr = Rule.EmptyScr
  29.298 +      scr = Rule.Empty_Prog
  29.299        };
  29.300  \<close>
  29.301  ML \<open>
  29.302  (*.a minimal ruleset for reverse rewriting of factions [2];
  29.303     compare expand_binoms.*)
  29.304  val rev_rew_p = 
  29.305 -Rule_Set.Seqence{id = "rev_rew_p", preconds = [], rew_ord = ("termlessI",termlessI),
  29.306 +Rule_Set.Sequence{id = "rev_rew_p", preconds = [], rew_ord = ("termlessI",termlessI),
  29.307      erls = Atools_erls, srls = Rule_Set.Empty,
  29.308      calc = [(*("PLUS"  , ("Groups.plus_class.plus", (**)eval_binop "#add_")), 
  29.309  	    ("TIMES" , ("Groups.times_class.times", (**)eval_binop "#mult_")),
  29.310 @@ -1220,9 +1220,9 @@
  29.311  	     Rule.Rls_ order_mult_rls_,
  29.312  	     (*Rule.Rls_ order_add_rls_,*)
  29.313  
  29.314 -	     Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  29.315 -	     Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.316 -	     Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_"),
  29.317 +	     Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  29.318 +	     Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.319 +	     Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_"),
  29.320  	     
  29.321  	     Rule.Thm ("sym_realpow_twoI",
  29.322                     ThmC.numerals_to_Free (@{thm realpow_twoI} RS @{thm sym})),
  29.323 @@ -1246,9 +1246,9 @@
  29.324  	     Rule.Thm ("realpow_multI", ThmC.numerals_to_Free @{thm realpow_multI}),
  29.325  	     (*"(r * s) ^^^ n = r ^^^ n * s ^^^ n"*)
  29.326  
  29.327 -	     Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  29.328 -	     Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.329 -	     Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_"),
  29.330 +	     Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  29.331 +	     Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.332 +	     Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_"),
  29.333  
  29.334  	     Rule.Thm ("mult_1_left",ThmC.numerals_to_Free @{thm mult_1_left}),(*"1 * z = z"*)
  29.335  	     Rule.Thm ("mult_zero_left",ThmC.numerals_to_Free @{thm mult_zero_left}),(*"0 * z = 0"*)
  29.336 @@ -1257,7 +1257,7 @@
  29.337  	     (*Rule.Rls_ order_add_rls_*)
  29.338  	     ],
  29.339  
  29.340 -    scr = Rule.EmptyScr};      
  29.341 +    scr = Rule.Empty_Prog};      
  29.342  \<close>
  29.343  
  29.344  subsection \<open>rule-sets with explicit program for intermediate steps\<close>
  29.345 @@ -1354,9 +1354,9 @@
  29.346                 (*"0 * z = 0"*)
  29.347  	       Rule.Thm ("add_0_left",ThmC.numerals_to_Free @{thm add_0_left}),(*"0 + z = z"*)
  29.348  
  29.349 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  29.350 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.351 -	       Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_"),
  29.352 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  29.353 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.354 +	       Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_"),
  29.355                (*Rule.Thm ("mult.commute",ThmC.numerals_to_Free @{thm mult.commute}),
  29.356  		(*AC-rewriting*)
  29.357  	       Rule.Thm ("real_mult_left_commute",
  29.358 @@ -1389,9 +1389,9 @@
  29.359                       ThmC.numerals_to_Free @{thm real_one_collect_assoc}), 
  29.360  	       (*"m is_const ==> k + (n + m * n) = k + (1 + m) * n"*)
  29.361  
  29.362 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  29.363 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.364 -	       Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_")
  29.365 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  29.366 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  29.367 +	       Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_")
  29.368  	       ],
  29.369        scr = Rule.Prog (Program.prep_program @{thm expand_binoms_2.simps})
  29.370        };      
  29.371 @@ -1440,7 +1440,7 @@
  29.372            ("#Where" ,["t_t is_polyexp"]),
  29.373            ("#Find"  ,["normalform n_n"])],
  29.374          Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)
  29.375 -			  Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")], 
  29.376 +			  Rule.Eval ("Poly.is'_polyexp", eval_is_polyexp "")], 
  29.377          SOME "Simplify t_t", 
  29.378          [["simplification","for_polynomials"]]))]\<close>
  29.379  
  29.380 @@ -1458,7 +1458,7 @@
  29.381  	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  29.382  	        prls = Rule_Set.append_rules "simplification_for_polynomials_prls" Rule_Set.empty 
  29.383  				    [(*for preds in where_*)
  29.384 -				      Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp"")],
  29.385 +				      Rule.Eval ("Poly.is'_polyexp", eval_is_polyexp"")],
  29.386  				  crls = Rule_Set.empty, errpats = [], nrls = norm_Poly},
  29.387          @{thm simplify.simps})]
  29.388  \<close>
    30.1 --- a/src/Tools/isac/Knowledge/PolyEq.thy	Wed Apr 15 11:11:54 2020 +0200
    30.2 +++ b/src/Tools/isac/Knowledge/PolyEq.thy	Wed Apr 15 11:37:43 2020 +0200
    30.3 @@ -324,19 +324,19 @@
    30.4  (*-------------------------rulse-------------------------*)
    30.5  val PolyEq_prls = (*3.10.02:just the following order due to subterm evaluation*)
    30.6    Rule_Set.append_rules "PolyEq_prls" Rule_Set.empty 
    30.7 -	     [Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
    30.8 -	      Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
    30.9 -	      Rule.Num_Calc ("Prog_Expr.lhs", Prog_Expr.eval_lhs ""),
   30.10 -	      Rule.Num_Calc ("Prog_Expr.rhs", Prog_Expr.eval_rhs ""),
   30.11 -	      Rule.Num_Calc ("Poly.is'_expanded'_in", eval_is_expanded_in ""),
   30.12 -	      Rule.Num_Calc ("Poly.is'_poly'_in", eval_is_poly_in ""),
   30.13 -	      Rule.Num_Calc ("Poly.has'_degree'_in", eval_has_degree_in ""),    
   30.14 -              Rule.Num_Calc ("Poly.is'_polyrat'_in", eval_is_polyrat_in ""),
   30.15 -	      (*Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),   *) 
   30.16 -	      (*Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),*)
   30.17 -	      Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   30.18 -              Rule.Num_Calc ("RootEq.is'_rootTerm'_in", eval_is_rootTerm_in ""),
   30.19 -	      Rule.Num_Calc ("RatEq.is'_ratequation'_in", eval_is_ratequation_in ""),
   30.20 +	     [Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   30.21 +	      Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   30.22 +	      Rule.Eval ("Prog_Expr.lhs", Prog_Expr.eval_lhs ""),
   30.23 +	      Rule.Eval ("Prog_Expr.rhs", Prog_Expr.eval_rhs ""),
   30.24 +	      Rule.Eval ("Poly.is'_expanded'_in", eval_is_expanded_in ""),
   30.25 +	      Rule.Eval ("Poly.is'_poly'_in", eval_is_poly_in ""),
   30.26 +	      Rule.Eval ("Poly.has'_degree'_in", eval_has_degree_in ""),    
   30.27 +              Rule.Eval ("Poly.is'_polyrat'_in", eval_is_polyrat_in ""),
   30.28 +	      (*Rule.Eval ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),   *) 
   30.29 +	      (*Rule.Eval ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),*)
   30.30 +	      Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   30.31 +              Rule.Eval ("RootEq.is'_rootTerm'_in", eval_is_rootTerm_in ""),
   30.32 +	      Rule.Eval ("RatEq.is'_ratequation'_in", eval_is_ratequation_in ""),
   30.33  	      Rule.Thm ("not_true",ThmC.numerals_to_Free @{thm not_true}),
   30.34  	      Rule.Thm ("not_false",ThmC.numerals_to_Free @{thm not_false}),
   30.35  	      Rule.Thm ("and_true",ThmC.numerals_to_Free @{thm and_true}),
   30.36 @@ -348,7 +348,7 @@
   30.37  val PolyEq_erls = 
   30.38      Rule_Set.merge "PolyEq_erls" LinEq_erls
   30.39      (Rule_Set.append_rules "ops_preds" calculate_Rational
   30.40 -		[Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   30.41 +		[Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   30.42  		 Rule.Thm ("plus_leq", ThmC.numerals_to_Free @{thm plus_leq}),
   30.43  		 Rule.Thm ("minus_leq", ThmC.numerals_to_Free @{thm minus_leq}),
   30.44  		 Rule.Thm ("rat_leq1", ThmC.numerals_to_Free @{thm rat_leq1}),
   30.45 @@ -359,7 +359,7 @@
   30.46  val PolyEq_crls = 
   30.47      Rule_Set.merge "PolyEq_crls" LinEq_crls
   30.48      (Rule_Set.append_rules "ops_preds" calculate_Rational
   30.49 -		[Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   30.50 +		[Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   30.51  		 Rule.Thm ("plus_leq", ThmC.numerals_to_Free @{thm plus_leq}),
   30.52  		 Rule.Thm ("minus_leq", ThmC.numerals_to_Free @{thm minus_leq}),
   30.53  		 Rule.Thm ("rat_leq1", ThmC.numerals_to_Free @{thm rat_leq1}),
   30.54 @@ -385,7 +385,7 @@
   30.55         Rule.Thm ("cancel_leading_coeff11",ThmC.numerals_to_Free @{thm cancel_leading_coeff11}),
   30.56         Rule.Thm ("cancel_leading_coeff12",ThmC.numerals_to_Free @{thm cancel_leading_coeff12}),
   30.57         Rule.Thm ("cancel_leading_coeff13",ThmC.numerals_to_Free @{thm cancel_leading_coeff13})
   30.58 -       ],scr = Rule.EmptyScr});
   30.59 +       ],scr = Rule.Empty_Prog});
   30.60  
   30.61  val prep_rls' = Auto_Prog.prep_rls @{theory};
   30.62  \<close>
   30.63 @@ -400,7 +400,7 @@
   30.64  	       Rule.Thm ("complete_square4",ThmC.numerals_to_Free @{thm complete_square4}),
   30.65  	       Rule.Thm ("complete_square5",ThmC.numerals_to_Free @{thm complete_square5})
   30.66  	       ],
   30.67 -      scr = Rule.EmptyScr
   30.68 +      scr = Rule.Empty_Prog
   30.69        });
   30.70  
   30.71  val polyeq_simplify = prep_rls'(
   30.72 @@ -414,15 +414,15 @@
   30.73  		Rule.Thm  ("real_diff_minus",ThmC.numerals_to_Free @{thm real_diff_minus}),
   30.74  		Rule.Thm  ("real_unari_minus",ThmC.numerals_to_Free @{thm real_unari_minus}),
   30.75  		Rule.Thm  ("realpow_multI",ThmC.numerals_to_Free @{thm realpow_multI}),
   30.76 -		Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   30.77 -		Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   30.78 -		Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   30.79 -		Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   30.80 -		Rule.Num_Calc ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   30.81 -		Rule.Num_Calc ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   30.82 +		Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   30.83 +		Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   30.84 +		Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   30.85 +		Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   30.86 +		Rule.Eval ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   30.87 +		Rule.Eval ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   30.88                  Rule.Rls_ reduce_012
   30.89                  ],
   30.90 -       scr = Rule.EmptyScr
   30.91 +       scr = Rule.Empty_Prog
   30.92         });
   30.93  \<close>
   30.94  setup \<open>KEStore_Elems.add_rlss 
   30.95 @@ -444,7 +444,7 @@
   30.96         rules = [Rule.Thm("d0_true",ThmC.numerals_to_Free @{thm d0_true}),
   30.97  		Rule.Thm("d0_false",ThmC.numerals_to_Free @{thm  d0_false})
   30.98  		],
   30.99 -       scr = Rule.EmptyScr
  30.100 +       scr = Rule.Empty_Prog
  30.101         });
  30.102  
  30.103  (* -- d1 -- *)
  30.104 @@ -463,7 +463,7 @@
  30.105  		Rule.Thm("d1_isolate_div",ThmC.numerals_to_Free @{thm d1_isolate_div})    
  30.106  		(*   bx=c -> x=c/b *)  
  30.107  		],
  30.108 -       scr = Rule.EmptyScr
  30.109 +       scr = Rule.Empty_Prog
  30.110         });
  30.111  
  30.112  \<close>
  30.113 @@ -486,7 +486,7 @@
  30.114         Rule.Thm ("d2_reduce_equation2", ThmC.numerals_to_Free @{thm d2_reduce_equation2}),(* x(a+ x)=0 -> x=0 |a+ x=0*)
  30.115         Rule.Thm ("d2_isolate_div", ThmC.numerals_to_Free @{thm d2_isolate_div})           (* bx^2=c -> x^2=c/b      *)
  30.116         ],
  30.117 -       scr = Rule.EmptyScr
  30.118 +       scr = Rule.Empty_Prog
  30.119         });
  30.120  \<close>
  30.121  ML\<open>
  30.122 @@ -513,7 +513,7 @@
  30.123  		Rule.Thm("d2_isolate_div",ThmC.numerals_to_Free @{thm d2_isolate_div})
  30.124                   (* bx^2=c -> x^2=c/b*)
  30.125  		],
  30.126 -       scr = Rule.EmptyScr
  30.127 +       scr = Rule.Empty_Prog
  30.128         });
  30.129  \<close>
  30.130  ML\<open>
  30.131 @@ -559,7 +559,7 @@
  30.132                  (*       x^2=0 *)
  30.133  		Rule.Thm("d2_sqrt_equation3",ThmC.numerals_to_Free @{thm d2_sqrt_equation3})
  30.134                 (*      1x^2=0 *)
  30.135 -	       ],scr = Rule.EmptyScr
  30.136 +	       ],scr = Rule.Empty_Prog
  30.137         });
  30.138  \<close>
  30.139  ML\<open>
  30.140 @@ -606,7 +606,7 @@
  30.141  		Rule.Thm("d2_sqrt_equation3",ThmC.numerals_to_Free @{thm d2_sqrt_equation3})
  30.142                 (*     bx^2=0 *)  
  30.143  	       ],
  30.144 -       scr = Rule.EmptyScr
  30.145 +       scr = Rule.Empty_Prog
  30.146         });
  30.147  \<close>
  30.148  ML\<open>
  30.149 @@ -666,7 +666,7 @@
  30.150  		Rule.Thm("d2_isolate_div",ThmC.numerals_to_Free @{thm d2_isolate_div})
  30.151                 (* bx^2=c -> x^2=c/b*)
  30.152  	       ],
  30.153 -       scr = Rule.EmptyScr
  30.154 +       scr = Rule.Empty_Prog
  30.155        });
  30.156  \<close>
  30.157  ML\<open>
  30.158 @@ -739,7 +739,7 @@
  30.159  	Rule.Thm("d3_root_equation1",ThmC.numerals_to_Free @{thm d3_root_equation1})
  30.160         (*bdv^^^3=c) = (bdv = nroot 3 c*)
  30.161         ],
  30.162 -       scr = Rule.EmptyScr
  30.163 +       scr = Rule.Empty_Prog
  30.164        });
  30.165  \<close>
  30.166  ML\<open>
  30.167 @@ -754,7 +754,7 @@
  30.168         [Rule.Thm("d4_sub_u1",ThmC.numerals_to_Free @{thm d4_sub_u1})  
  30.169         (* ax^4+bx^2+c=0 -> x=+-sqrt(ax^2+bx^+c) *)
  30.170         ],
  30.171 -       scr = Rule.EmptyScr
  30.172 +       scr = Rule.Empty_Prog
  30.173        });
  30.174  \<close>
  30.175  setup \<open>KEStore_Elems.add_rlss 
  30.176 @@ -1249,7 +1249,7 @@
  30.177  	       (*x + (y + z) = y + (x + z)*)
  30.178  	       Rule.Thm ("add.assoc",ThmC.numerals_to_Free @{thm add.assoc})	               
  30.179  	       (*z1.0 + z2.0 + z3.0 = z1.0 + (z2.0 + z3.0)*)
  30.180 -	       ], scr = Rule.EmptyScr});
  30.181 +	       ], scr = Rule.Empty_Prog});
  30.182  
  30.183  \<close>
  30.184  ML\<open>
  30.185 @@ -1282,14 +1282,14 @@
  30.186  	       Rule.Thm ("bdv_n_collect_assoc2_1",ThmC.numerals_to_Free @{thm bdv_n_collect_assoc2_1}),
  30.187  	       Rule.Thm ("bdv_n_collect_assoc2_2",ThmC.numerals_to_Free @{thm bdv_n_collect_assoc2_2}),
  30.188  	       Rule.Thm ("bdv_n_collect_assoc2_3",ThmC.numerals_to_Free @{thm bdv_n_collect_assoc2_3})
  30.189 -	       ], scr = Rule.EmptyScr});
  30.190 +	       ], scr = Rule.Empty_Prog});
  30.191  
  30.192  \<close>
  30.193  ML\<open>
  30.194  (*.transforms an arbitrary term without roots to a polynomial [4] 
  30.195     according to knowledge/Poly.sml.*) 
  30.196  val make_polynomial_in = prep_rls'(
  30.197 -  Rule_Set.Seqence {id = "make_polynomial_in", preconds = []:term list, 
  30.198 +  Rule_Set.Sequence {id = "make_polynomial_in", preconds = []:term list, 
  30.199         rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  30.200        erls = Atools_erls, srls = Rule_Set.Empty,
  30.201        calc = [], errpatts = [],
  30.202 @@ -1302,7 +1302,7 @@
  30.203  	       Rule.Rls_ discard_parentheses,
  30.204  	       Rule.Rls_ collect_bdv
  30.205  	       ],
  30.206 -      scr = Rule.EmptyScr
  30.207 +      scr = Rule.Empty_Prog
  30.208        });     
  30.209  
  30.210  \<close>
  30.211 @@ -1325,7 +1325,7 @@
  30.212  \<close>
  30.213  ML\<open>
  30.214  val make_ratpoly_in = prep_rls'(
  30.215 -  Rule_Set.Seqence {id = "make_ratpoly_in", preconds = []:term list, 
  30.216 +  Rule_Set.Sequence {id = "make_ratpoly_in", preconds = []:term list, 
  30.217         rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  30.218        erls = Atools_erls, srls = Rule_Set.Empty,
  30.219        calc = [], errpatts = [],
  30.220 @@ -1335,9 +1335,9 @@
  30.221  	       Rule.Rls_ separate_bdvs,
  30.222  	       (* Rule.Rls_ rearrange_assoc, WN060916 why does cancel_p not work?*)
  30.223  	       Rule.Rls_ cancel_p
  30.224 -	       (*Rule.Num_Calc ("Rings.divide_class.divide"  , eval_cancel "#divide_e") too weak!*)
  30.225 +	       (*Rule.Eval ("Rings.divide_class.divide"  , eval_cancel "#divide_e") too weak!*)
  30.226  	       ],
  30.227 -      scr = Rule.EmptyScr});      
  30.228 +      scr = Rule.Empty_Prog});      
  30.229  \<close>
  30.230  setup \<open>KEStore_Elems.add_rlss 
  30.231    [("order_add_mult_in", (Context.theory_name @{theory}, order_add_mult_in)), 
    31.1 --- a/src/Tools/isac/Knowledge/PolyMinus.thy	Wed Apr 15 11:11:54 2020 +0200
    31.2 +++ b/src/Tools/isac/Knowledge/PolyMinus.thy	Wed Apr 15 11:37:43 2020 +0200
    31.3 @@ -186,8 +186,8 @@
    31.4  
    31.5  val erls_ordne_alphabetisch =
    31.6      Rule_Set.append_rules "erls_ordne_alphabetisch" Rule_Set.empty
    31.7 -	       [Rule.Num_Calc ("PolyMinus.kleiner", eval_kleiner ""),
    31.8 -		Rule.Num_Calc ("PolyMinus.ist'_monom", eval_ist_monom "")
    31.9 +	       [Rule.Eval ("PolyMinus.kleiner", eval_kleiner ""),
   31.10 +		Rule.Eval ("PolyMinus.ist'_monom", eval_ist_monom "")
   31.11  		];
   31.12  
   31.13  val ordne_alphabetisch = 
   31.14 @@ -210,13 +210,13 @@
   31.15  	       (*"c kleiner b ==> (a - c + b) = (a + b - c)"*)
   31.16  	       Rule.Thm ("tausche_minus_minus",ThmC.numerals_to_Free @{thm tausche_minus_minus})
   31.17  	       (*"c kleiner b ==> (a - c - b) = (a - b - c)"*)
   31.18 -	       ], scr = Rule.EmptyScr};
   31.19 +	       ], scr = Rule.Empty_Prog};
   31.20  
   31.21  val fasse_zusammen = 
   31.22      Rule_Def.Repeat{id = "fasse_zusammen", preconds = [], 
   31.23  	rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
   31.24  	erls = Rule_Set.append_rules "erls_fasse_zusammen" Rule_Set.empty 
   31.25 -			  [Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_")], 
   31.26 +			  [Rule.Eval ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_")], 
   31.27  	srls = Rule_Set.Empty, calc = [], errpatts = [],
   31.28  	rules = 
   31.29  	[Rule.Thm ("real_num_collect",ThmC.numerals_to_Free @{thm real_num_collect}), 
   31.30 @@ -257,8 +257,8 @@
   31.31  	 Rule.Thm ("subtrahiere_x_minus_minus1",ThmC.numerals_to_Free @{thm subtrahiere_x_minus_minus1}),
   31.32  	 (*"[| m is_const |] ==> (x - m * v) - v = x + (-m - 1) * v"*)
   31.33  	 
   31.34 -	 Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   31.35 -	 Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#subtr_"),
   31.36 +	 Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   31.37 +	 Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#subtr_"),
   31.38  	 
   31.39  	 (*MG: Reihenfolge der folgenden 2 Rule.Thm muss so bleiben, wegen
   31.40             (a+a)+a --> a + 2*a --> 3*a and not (a+a)+a --> 2*a + a *)
   31.41 @@ -276,13 +276,13 @@
   31.42  	 Rule.Thm ("subtrahiere_eins_vor_minus",ThmC.numerals_to_Free @{thm subtrahiere_eins_vor_minus})
   31.43  	 (*"[| m is_const |] ==> -  v -  m * v = (-1 - m) * v"*)
   31.44  	 
   31.45 -	 ], scr = Rule.EmptyScr};
   31.46 +	 ], scr = Rule.Empty_Prog};
   31.47      
   31.48  val verschoenere = 
   31.49    Rule_Def.Repeat{id = "verschoenere", preconds = [], 
   31.50        rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord), srls = Rule_Set.Empty, calc = [], errpatts = [],
   31.51        erls = Rule_Set.append_rules "erls_verschoenere" Rule_Set.empty 
   31.52 -			[Rule.Num_Calc ("PolyMinus.kleiner", eval_kleiner "")], 
   31.53 +			[Rule.Eval ("PolyMinus.kleiner", eval_kleiner "")], 
   31.54        rules = [Rule.Thm ("vorzeichen_minus_weg1",ThmC.numerals_to_Free @{thm vorzeichen_minus_weg1}),
   31.55  	       (*"l kleiner 0 ==> a + l * b = a - -l * b"*)
   31.56  	       Rule.Thm ("vorzeichen_minus_weg2",ThmC.numerals_to_Free @{thm vorzeichen_minus_weg2}),
   31.57 @@ -292,7 +292,7 @@
   31.58  	       Rule.Thm ("vorzeichen_minus_weg4",ThmC.numerals_to_Free @{thm vorzeichen_minus_weg4}),
   31.59  	       (*"l kleiner 0 ==> k - a - l * b = k - a + -l * b"*)
   31.60  
   31.61 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   31.62 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   31.63  
   31.64  	       Rule.Thm ("mult_zero_left",ThmC.numerals_to_Free @{thm mult_zero_left}),    
   31.65  	       (*"0 * z = 0"*)
   31.66 @@ -307,7 +307,7 @@
   31.67  
   31.68  	       (*Rule.Thm ("",ThmC.numerals_to_Free @{}),*)
   31.69  	       (**)
   31.70 -	       ], scr = Rule.EmptyScr} (*end verschoenere*);
   31.71 +	       ], scr = Rule.Empty_Prog} (*end verschoenere*);
   31.72  
   31.73  val klammern_aufloesen = 
   31.74    Rule_Def.Repeat{id = "klammern_aufloesen", preconds = [], 
   31.75 @@ -321,7 +321,7 @@
   31.76  	       (*"a - (b + c) = (a - b) - c"*)
   31.77  	       Rule.Thm ("klammer_minus_minus",ThmC.numerals_to_Free @{thm klammer_minus_minus})
   31.78  	       (*"a - (b - c) = (a - b) + c"*)
   31.79 -	       ], scr = Rule.EmptyScr};
   31.80 +	       ], scr = Rule.Empty_Prog};
   31.81  
   31.82  val klammern_ausmultiplizieren = 
   31.83    Rule_Def.Repeat{id = "klammern_ausmultiplizieren", preconds = [], 
   31.84 @@ -338,14 +338,14 @@
   31.85  
   31.86  	       (*Rule.Thm ("",ThmC.numerals_to_Free @{}),
   31.87  	       (*""*)*)
   31.88 -	       ], scr = Rule.EmptyScr};
   31.89 +	       ], scr = Rule.Empty_Prog};
   31.90  
   31.91  val ordne_monome = 
   31.92    Rule_Def.Repeat{id = "ordne_monome", preconds = [], 
   31.93        rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord), srls = Rule_Set.Empty, calc = [], errpatts = [], 
   31.94        erls = Rule_Set.append_rules "erls_ordne_monome" Rule_Set.empty
   31.95 -	       [Rule.Num_Calc ("PolyMinus.kleiner", eval_kleiner ""),
   31.96 -		Rule.Num_Calc ("Prog_Expr.is'_atom", Prog_Expr.eval_is_atom "")
   31.97 +	       [Rule.Eval ("PolyMinus.kleiner", eval_kleiner ""),
   31.98 +		Rule.Eval ("Prog_Expr.is'_atom", Prog_Expr.eval_is_atom "")
   31.99  		], 
  31.100        rules = [Rule.Thm ("tausche_mal",ThmC.numerals_to_Free @{thm tausche_mal}),
  31.101  	       (*"[| b is_atom; a kleiner b  |] ==> (b * a) = (a * b)"*)
  31.102 @@ -358,7 +358,7 @@
  31.103  
  31.104  	       (*Rule.Thm ("",ThmC.numerals_to_Free @{}),
  31.105  	       (*""*)*)
  31.106 -	       ], scr = Rule.EmptyScr};
  31.107 +	       ], scr = Rule.Empty_Prog};
  31.108  
  31.109  
  31.110  val rls_p_33 = 
  31.111 @@ -376,9 +376,9 @@
  31.112  		];
  31.113  val rechnen = 
  31.114      Rule_Set.append_rules "rechnen" Rule_Set.empty
  31.115 -	       [Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  31.116 -		Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  31.117 -		Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#subtr_")
  31.118 +	       [Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  31.119 +		Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
  31.120 +		Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#subtr_")
  31.121  		];
  31.122  \<close>
  31.123  setup \<open>KEStore_Elems.add_rlss 
  31.124 @@ -408,8 +408,8 @@
  31.125              "     matchsub ((?b - ?c) * ?a) t_t )"]),
  31.126            ("#Find", ["normalform n_n"])],
  31.127          Rule_Set.append_rules "prls_pbl_vereinf_poly" Rule_Set.empty 
  31.128 -	        [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp ""),
  31.129 -	          Rule.Num_Calc ("Prog_Expr.matchsub", Prog_Expr.eval_matchsub ""),
  31.130 +	        [Rule.Eval ("Poly.is'_polyexp", eval_is_polyexp ""),
  31.131 +	          Rule.Eval ("Prog_Expr.matchsub", Prog_Expr.eval_matchsub ""),
  31.132  	          Rule.Thm ("or_true", ThmC.numerals_to_Free @{thm or_true}),
  31.133              (*"(?a | True) = True"*)
  31.134              Rule.Thm ("or_false", ThmC.numerals_to_Free @{thm or_false}),
  31.135 @@ -429,8 +429,8 @@
  31.136              "     matchsub ((?b - ?c) * ?a) t_t )"]),
  31.137            ("#Find"  ,["normalform n_n"])],
  31.138          Rule_Set.append_rules "prls_pbl_vereinf_poly_klammer" Rule_Set.empty
  31.139 -          [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp ""),
  31.140 -	           Rule.Num_Calc ("Prog_Expr.matchsub", Prog_Expr.eval_matchsub ""),
  31.141 +          [Rule.Eval ("Poly.is'_polyexp", eval_is_polyexp ""),
  31.142 +	           Rule.Eval ("Prog_Expr.matchsub", Prog_Expr.eval_matchsub ""),
  31.143               Rule.Thm ("or_true", ThmC.numerals_to_Free @{thm or_true}),
  31.144               (*"(?a | True) = True"*)
  31.145               Rule.Thm ("or_false", ThmC.numerals_to_Free @{thm or_false}),
  31.146 @@ -447,7 +447,7 @@
  31.147            ("#Where", ["t_t is_polyexp"]),
  31.148            ("#Find", ["normalform n_n"])],
  31.149          Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)
  31.150 -			      Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")], 
  31.151 +			      Rule.Eval ("Poly.is'_polyexp", eval_is_polyexp "")], 
  31.152          SOME "Vereinfache t_t", 
  31.153          [["simplification","for_polynomials","with_parentheses_mult"]])),
  31.154      (Specify.prep_pbt thy "pbl_probe" [] Celem.e_pblID (["probe"], [], Rule_Set.Empty, NONE, [])),
  31.155 @@ -457,7 +457,7 @@
  31.156            ("#Where", ["e_e is_polyexp"]),
  31.157            ("#Find", ["Geprueft p_p"])],
  31.158          Rule_Set.append_rules "prls_pbl_probe_poly" Rule_Set.empty [(*for preds in where_*)
  31.159 -		      Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")], 
  31.160 +		      Rule.Eval ("Poly.is'_polyexp", eval_is_polyexp "")], 
  31.161          SOME "Probe e_e w_w", 
  31.162          [["probe","fuer_polynom"]])),
  31.163      (Specify.prep_pbt thy "pbl_probe_bruch" [] Celem.e_pblID
  31.164 @@ -466,7 +466,7 @@
  31.165            ("#Where" ,["e_e is_ratpolyexp"]),
  31.166            ("#Find"  ,["Geprueft p_p"])],
  31.167          Rule_Set.append_rules "prls_pbl_probe_bruch" Rule_Set.empty [(*for preds in where_*)
  31.168 -		      Rule.Num_Calc ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")], 
  31.169 +		      Rule.Eval ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")], 
  31.170          SOME "Probe e_e w_w", [["probe","fuer_bruch"]]))]\<close>
  31.171  
  31.172  (** methods **)
  31.173 @@ -491,8 +491,8 @@
  31.174  	        ("#Find"  ,["normalform n_n"])],
  31.175  	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty,
  31.176  	        prls = Rule_Set.append_rules "prls_met_simp_poly_minus" Rule_Set.empty 
  31.177 -				      [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp ""),
  31.178 -				        Rule.Num_Calc ("Prog_Expr.matchsub", Prog_Expr.eval_matchsub ""),
  31.179 +				      [Rule.Eval ("Poly.is'_polyexp", eval_is_polyexp ""),
  31.180 +				        Rule.Eval ("Prog_Expr.matchsub", Prog_Expr.eval_matchsub ""),
  31.181  				        Rule.Thm ("and_true",ThmC.numerals_to_Free @{thm and_true}),
  31.182                  (*"(?a & True) = ?a"*)
  31.183                  Rule.Thm ("and_false",ThmC.numerals_to_Free @{thm and_false}),
  31.184 @@ -522,7 +522,7 @@
  31.185  	        ("#Find"  ,["normalform n_n"])],
  31.186  	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  31.187  	        prls = Rule_Set.append_rules "simplification_for_polynomials_prls" Rule_Set.empty 
  31.188 -				    [(*for preds in where_*) Rule.Num_Calc("Poly.is'_polyexp", eval_is_polyexp"")],
  31.189 +				    [(*for preds in where_*) Rule.Eval("Poly.is'_polyexp", eval_is_polyexp"")],
  31.190  				  crls = Rule_Set.empty, errpats = [], nrls = rls_p_34},
  31.191  				@{thm simplify2.simps})]
  31.192  \<close>
  31.193 @@ -545,7 +545,7 @@
  31.194  	      [("#Given" ,["Term t_t"]), ("#Where" ,["t_t is_polyexp"]), ("#Find"  ,["normalform n_n"])],
  31.195  	        {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  31.196  	          prls = Rule_Set.append_rules "simplification_for_polynomials_prls" Rule_Set.empty 
  31.197 -				      [(*for preds in where_*) Rule.Num_Calc("Poly.is'_polyexp", eval_is_polyexp"")],
  31.198 +				      [(*for preds in where_*) Rule.Eval("Poly.is'_polyexp", eval_is_polyexp"")],
  31.199  				    crls = Rule_Set.empty, errpats = [], nrls = rls_p_34},
  31.200  				  @{thm simplify3.simps})]
  31.201  \<close>
  31.202 @@ -577,7 +577,7 @@
  31.203  	        ("#Find"  ,["Geprueft p_p"])],
  31.204  	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  31.205  	        prls = Rule_Set.append_rules "prls_met_probe_bruch" Rule_Set.empty
  31.206 -	            [(*for preds in where_*) Rule.Num_Calc ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")], 
  31.207 +	            [(*for preds in where_*) Rule.Eval ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")], 
  31.208  	        crls = Rule_Set.empty, errpats = [], nrls = rechnen}, 
  31.209  	      @{thm mache_probe.simps})]
  31.210  \<close>
  31.211 @@ -589,7 +589,7 @@
  31.212  	        ("#Find"  ,["Geprueft p_p"])],
  31.213  	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  31.214  	        prls = Rule_Set.append_rules "prls_met_probe_bruch" Rule_Set.empty
  31.215 -	            [(*for preds in where_*) Rule.Num_Calc ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")], 
  31.216 +	            [(*for preds in where_*) Rule.Eval ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")], 
  31.217  	        crls = Rule_Set.empty, errpats = [], nrls = Rule_Set.Empty}, 
  31.218  	      @{thm refl})]
  31.219  \<close>
    32.1 --- a/src/Tools/isac/Knowledge/RatEq.thy	Wed Apr 15 11:11:54 2020 +0200
    32.2 +++ b/src/Tools/isac/Knowledge/RatEq.thy	Wed Apr 15 11:37:43 2020 +0200
    32.3 @@ -82,12 +82,12 @@
    32.4  ML \<open>
    32.5  val RatEq_prls = (*15.10.02:just the following order due to subterm evaluation*)
    32.6    Rule_Set.append_rules "RatEq_prls" Rule_Set.empty 
    32.7 -	     [Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
    32.8 -	      Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
    32.9 -	      Rule.Num_Calc ("Prog_Expr.lhs", Prog_Expr.eval_lhs ""),
   32.10 -	      Rule.Num_Calc ("Prog_Expr.rhs", Prog_Expr.eval_rhs ""),
   32.11 -	      Rule.Num_Calc ("RatEq.is'_ratequation'_in", eval_is_ratequation_in ""),
   32.12 -	      Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   32.13 +	     [Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   32.14 +	      Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   32.15 +	      Rule.Eval ("Prog_Expr.lhs", Prog_Expr.eval_lhs ""),
   32.16 +	      Rule.Eval ("Prog_Expr.rhs", Prog_Expr.eval_rhs ""),
   32.17 +	      Rule.Eval ("RatEq.is'_ratequation'_in", eval_is_ratequation_in ""),
   32.18 +	      Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   32.19  	      Rule.Thm ("not_true",ThmC.numerals_to_Free @{thm not_true}),
   32.20  	      Rule.Thm ("not_false",ThmC.numerals_to_Free @{thm not_false}),
   32.21  	      Rule.Thm ("and_true",ThmC.numerals_to_Free @{thm and_true}),
   32.22 @@ -102,8 +102,8 @@
   32.23    Rule_Set.keep_unique_rules "rateq_erls"                             (*WN: ein Hack*)
   32.24  	  (Rule_Set.merge "is_ratequation_in" calculate_Rational
   32.25  		  (Rule_Set.append_rules "is_ratequation_in"
   32.26 -			  Poly_erls [(*Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),*)
   32.27 -			    Rule.Num_Calc ("RatEq.is'_ratequation'_in", eval_is_ratequation_in "")]))
   32.28 +			  Poly_erls [(*Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),*)
   32.29 +			    Rule.Eval ("RatEq.is'_ratequation'_in", eval_is_ratequation_in "")]))
   32.30   [Rule.Thm ("and_commute",ThmC.numerals_to_Free @{thm and_commute}), (*WN: ein Hack*)
   32.31  	Rule.Thm ("or_commute",ThmC.numerals_to_Free @{thm or_commute})];  (*WN: ein Hack*)
   32.32  
   32.33 @@ -112,8 +112,8 @@
   32.34    Rule_Set.keep_unique_rules "RatEq_crls"                              (*WN: ein Hack*)
   32.35  	  (Rule_Set.merge "is_ratequation_in" calculate_Rational
   32.36  		  (Rule_Set.append_rules "is_ratequation_in"
   32.37 -			  Poly_erls [(*Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),*)
   32.38 -			    Rule.Num_Calc ("RatEq.is'_ratequation'_in", eval_is_ratequation_in "")]))
   32.39 +			  Poly_erls [(*Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),*)
   32.40 +			    Rule.Eval ("RatEq.is'_ratequation'_in", eval_is_ratequation_in "")]))
   32.41   [Rule.Thm ("and_commute",ThmC.numerals_to_Free @{thm and_commute}), (*WN: ein Hack*)
   32.42  	Rule.Thm ("or_commute",ThmC.numerals_to_Free @{thm or_commute})];  (*WN: ein Hack*)
   32.43  
   32.44 @@ -129,7 +129,7 @@
   32.45  	     Rule.Thm("rat_mult_denominator_right",ThmC.numerals_to_Free @{thm rat_mult_denominator_right})
   32.46  	     (* a/b=c   ->  a=cb *)
   32.47  	     ],
   32.48 -    scr = Rule.EmptyScr});
   32.49 +    scr = Rule.Empty_Prog});
   32.50  
   32.51  \<close> ML \<open>
   32.52  val RatEq_simplify = prep_rls'(
   32.53 @@ -153,7 +153,7 @@
   32.54         (* ((a/b) / (c/d) = (a*d) / (b*c)) *)
   32.55         Rule.Thm("rat_double_rat_3",ThmC.numerals_to_Free @{thm rat_double_rat_3}) 
   32.56         (* ((a/b) / c = a / (b*c) ) *)],
   32.57 -     scr = Rule.EmptyScr});
   32.58 +     scr = Rule.Empty_Prog});
   32.59  \<close>
   32.60  setup \<open>KEStore_Elems.add_rlss [("rateq_erls", (Context.theory_name @{theory}, rateq_erls))]\<close>
   32.61  setup \<open>KEStore_Elems.add_rlss [("RatEq_eliminate", (Context.theory_name @{theory}, RatEq_eliminate))]\<close>
    33.1 --- a/src/Tools/isac/Knowledge/Rational-WN.sml	Wed Apr 15 11:11:54 2020 +0200
    33.2 +++ b/src/Tools/isac/Knowledge/Rational-WN.sml	Wed Apr 15 11:37:43 2020 +0200
    33.3 @@ -199,7 +199,7 @@
    33.4  	     NONE => rew_once ruls asm ct apno thms
    33.5  	   | SOME (ct',asm') => 
    33.6  	     rew_once ruls (asm union asm') ct' Appl (rul::thms))
    33.7 -      | Rule.Num_Calc (cc as (op_,_)) => 
    33.8 +      | Rule.Eval (cc as (op_,_)) => 
    33.9  	  (case adhoc_thm thy cc ct of
   33.10  	       NONE => rew_once ruls asm ct apno thms
   33.11  	   | SOME (thmid, thm') => 
   33.12 @@ -235,7 +235,7 @@
   33.13  	     NONE => rew_once ruls asm ct apno thms
   33.14  	   | SOME (ct',asm') => 
   33.15  	     rew_once ruls (asm union asm') ct' Appl (rul::thms))
   33.16 -      | Rule.Num_Calc (cc as (op_,_)) => 
   33.17 +      | Rule.Eval (cc as (op_,_)) => 
   33.18  	  (case adhoc_thm thy cc ct of
   33.19  	       NONE => rew_once ruls asm ct apno thms
   33.20  	   | SOME (thmid, thm') => 
    34.1 --- a/src/Tools/isac/Knowledge/Rational.thy	Wed Apr 15 11:11:54 2020 +0200
    34.2 +++ b/src/Tools/isac/Knowledge/Rational.thy	Wed Apr 15 11:37:43 2020 +0200
    34.3 @@ -11,7 +11,7 @@
    34.4  imports Poly GCD_Poly_ML
    34.5  begin
    34.6  
    34.7 -section \<open>Constants for evaluation by "Rule.Num_Calc"\<close>
    34.8 +section \<open>Constants for evaluation by "Rule.Eval"\<close>
    34.9  consts
   34.10  
   34.11    is'_expanded    :: "real => bool" ("_ is'_expanded")     (*RL->Poly.thy*)
   34.12 @@ -393,11 +393,11 @@
   34.13      (Rule_Def.Repeat {id = "calc_rat_erls", preconds = [], rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord), 
   34.14        erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   34.15        rules = 
   34.16 -        [Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   34.17 -        Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   34.18 +        [Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   34.19 +        Rule.Eval ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   34.20          Rule.Thm ("not_true", ThmC.numerals_to_Free @{thm not_true}),
   34.21          Rule.Thm ("not_false", ThmC.numerals_to_Free @{thm not_false})], 
   34.22 -      scr = Rule.EmptyScr});
   34.23 +      scr = Rule.Empty_Prog});
   34.24  
   34.25  (* simplifies expressions with numerals;
   34.26     does NOT rearrange the term by AC-rewriting; thus terms with variables 
   34.27 @@ -408,7 +408,7 @@
   34.28        erls = calc_rat_erls, srls = Rule_Set.Empty,
   34.29        calc = [], errpatts = [],
   34.30        rules = 
   34.31 -        [Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   34.32 +        [Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   34.33  
   34.34          Rule.Thm ("minus_divide_left", ThmC.numerals_to_Free (@{thm minus_divide_left} RS @{thm sym})),
   34.35            (*SYM - ?x / ?y = - (?x / ?y)  may come from subst*)
   34.36 @@ -444,7 +444,7 @@
   34.37            (*"   b ~= 0            ==> (a / b = c    ) = (a     = b * c)*)
   34.38          Rule.Thm ("mult_cross2", ThmC.numerals_to_Free @{thm mult_cross2})
   34.39            (*"           d ~= 0    ==> (a     = c / d) = (a * d =     c)*)], 
   34.40 -      scr = Rule.EmptyScr})
   34.41 +      scr = Rule.Empty_Prog})
   34.42      calculate_Poly);
   34.43  
   34.44  (*("is_expanded", ("Rational.is'_expanded", eval_is_expanded ""))*)
   34.45 @@ -463,7 +463,7 @@
   34.46  val rational_erls = 
   34.47    Rule_Set.merge "rational_erls" calculate_Rational 
   34.48      (Rule_Set.append_rules "is_expanded" Atools_erls 
   34.49 -      [Rule.Num_Calc ("Rational.is'_expanded", eval_is_expanded "")]);
   34.50 +      [Rule.Eval ("Rational.is'_expanded", eval_is_expanded "")]);
   34.51  \<close>
   34.52  
   34.53  subsection \<open>Embed cancellation into rewriting\<close>
   34.54 @@ -603,14 +603,14 @@
   34.55  val powers_erls = prep_rls'(
   34.56    Rule_Def.Repeat {id = "powers_erls", preconds = [], rew_ord = ("dummy_ord",Rewrite_Ord.dummy_ord), 
   34.57        erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   34.58 -      rules = [Rule.Num_Calc ("Prog_Expr.is'_atom", Prog_Expr.eval_is_atom "#is_atom_"),
   34.59 -	       Rule.Num_Calc ("Prog_Expr.is'_even", Prog_Expr.eval_is_even "#is_even_"),
   34.60 -	       Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   34.61 +      rules = [Rule.Eval ("Prog_Expr.is'_atom", Prog_Expr.eval_is_atom "#is_atom_"),
   34.62 +	       Rule.Eval ("Prog_Expr.is'_even", Prog_Expr.eval_is_even "#is_even_"),
   34.63 +	       Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   34.64  	       Rule.Thm ("not_false", ThmC.numerals_to_Free @{thm not_false}),
   34.65  	       Rule.Thm ("not_true", ThmC.numerals_to_Free @{thm not_true}),
   34.66 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_")
   34.67 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_")
   34.68  	       ],
   34.69 -      scr = Rule.EmptyScr
   34.70 +      scr = Rule.Empty_Prog
   34.71        });
   34.72  (*.all powers over + distributed; atoms over * collected, other distributed
   34.73     contains absolute minimum of thms for context in norm_Rational .*)
   34.74 @@ -641,9 +641,9 @@
   34.75  	       (*"[| 1 < n; not(r is_atom) |]==>r ^^^ n = r * r ^^^ (n + -1)"*)
   34.76  	       Rule.Thm ("realpow_eq_oneI",ThmC.numerals_to_Free @{thm realpow_eq_oneI}),
   34.77  	       (*"1 ^^^ n = 1"*)
   34.78 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_")
   34.79 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_")
   34.80  	       ],
   34.81 -      scr = Rule.EmptyScr
   34.82 +      scr = Rule.Empty_Prog
   34.83        });
   34.84  (*.contains absolute minimum of thms for context in norm_Rational.*)
   34.85  val rat_mult_divide = prep_rls'(
   34.86 @@ -665,9 +665,9 @@
   34.87  	       Rule.Thm ("divide_divide_eq_left",
   34.88                       ThmC.numerals_to_Free @{thm divide_divide_eq_left}),
   34.89  	       (*"?x / ?y / ?z = ?x / (?y * ?z)"*)
   34.90 -	       Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e")
   34.91 +	       Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e")
   34.92  	       ],
   34.93 -      scr = Rule.EmptyScr
   34.94 +      scr = Rule.Empty_Prog
   34.95        });
   34.96  
   34.97  (*.contains absolute minimum of thms for context in norm_Rational.*)
   34.98 @@ -698,15 +698,15 @@
   34.99  
  34.100  	       Rule.Thm ("division_ring_divide_zero",ThmC.numerals_to_Free @{thm division_ring_divide_zero})
  34.101  	       (*"0 / ?x = 0"*)
  34.102 -	       ], scr = Rule.EmptyScr});
  34.103 +	       ], scr = Rule.Empty_Prog});
  34.104  
  34.105  (*erls for calculate_Rational; 
  34.106    make local with FIXX@ME result:term *term list WN0609???SKMG*)
  34.107  val norm_rat_erls = prep_rls'(
  34.108    Rule_Def.Repeat {id = "norm_rat_erls", preconds = [], rew_ord = ("dummy_ord",Rewrite_Ord.dummy_ord), 
  34.109        erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
  34.110 -      rules = [Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_")
  34.111 -	       ], scr = Rule.EmptyScr});
  34.112 +      rules = [Rule.Eval ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_")
  34.113 +	       ], scr = Rule.Empty_Prog});
  34.114  
  34.115  (* consists of rls containing the absolute minimum of thms *)
  34.116  (*040209: this version has been used by RL for his equations,
  34.117 @@ -725,17 +725,17 @@
  34.118  	       Rule.Rls_ add_fractions_p,
  34.119  	       Rule.Rls_ cancel_p
  34.120  	       ],
  34.121 -      scr = Rule.EmptyScr});
  34.122 +      scr = Rule.Empty_Prog});
  34.123  
  34.124  val norm_Rational_parenthesized = prep_rls'(
  34.125 -  Rule_Set.Seqence {id = "norm_Rational_parenthesized", preconds = []:term list, 
  34.126 +  Rule_Set.Sequence {id = "norm_Rational_parenthesized", preconds = []:term list, 
  34.127         rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord),
  34.128        erls = Atools_erls, srls = Rule_Set.Empty,
  34.129        calc = [], errpatts = [],
  34.130        rules = [Rule.Rls_  norm_Rational_min,
  34.131  	       Rule.Rls_ discard_parentheses
  34.132  	       ],
  34.133 -      scr = Rule.EmptyScr});      
  34.134 +      scr = Rule.Empty_Prog});      
  34.135  
  34.136  (*WN030318???SK: simplifies all but cancel and common_nominator*)
  34.137  val simplify_rational = 
  34.138 @@ -763,7 +763,7 @@
  34.139    Rule_Def.Repeat {id = "add_fractions_p_rls", preconds = [], rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord), 
  34.140  	  erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
  34.141  	  rules = [Rule.Rls_ add_fractions_p], 
  34.142 -	  scr = Rule.EmptyScr});
  34.143 +	  scr = Rule.Empty_Prog});
  34.144  
  34.145  (* "Rule_Def.Repeat" causes repeated application of cancel_p to one and the same term *)
  34.146  val cancel_p_rls = prep_rls'(
  34.147 @@ -771,20 +771,20 @@
  34.148      {id = "cancel_p_rls", preconds = [], rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord), 
  34.149      erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
  34.150      rules = [Rule.Rls_ cancel_p], 
  34.151 -	  scr = Rule.EmptyScr});
  34.152 +	  scr = Rule.Empty_Prog});
  34.153  
  34.154  (*. makes 'normal' fractions; 'is_polyexp' inhibits double fractions;
  34.155      used in initial part norm_Rational_mg, see example DA-M02-main.p.60.*)
  34.156  val rat_mult_poly = prep_rls'(
  34.157    Rule_Def.Repeat {id = "rat_mult_poly", preconds = [], rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord), 
  34.158 -	  erls = Rule_Set.append_rules "Rule_Set.empty-is_polyexp" Rule_Set.empty [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")], 
  34.159 +	  erls = Rule_Set.append_rules "Rule_Set.empty-is_polyexp" Rule_Set.empty [Rule.Eval ("Poly.is'_polyexp", eval_is_polyexp "")], 
  34.160  	  srls = Rule_Set.Empty, calc = [], errpatts = [],
  34.161  	  rules = 
  34.162  	    [Rule.Thm ("rat_mult_poly_l",ThmC.numerals_to_Free @{thm rat_mult_poly_l}),
  34.163  	    (*"?c is_polyexp ==> ?c * (?a / ?b) = ?c * ?a / ?b"*)
  34.164  	    Rule.Thm ("rat_mult_poly_r",ThmC.numerals_to_Free @{thm rat_mult_poly_r})
  34.165  	    (*"?c is_polyexp ==> ?a / ?b * ?c = ?a * ?c / ?b"*) ], 
  34.166 -	  scr = Rule.EmptyScr});
  34.167 +	  scr = Rule.Empty_Prog});
  34.168  
  34.169  (*. makes 'normal' fractions; 'is_polyexp' inhibits double fractions;
  34.170      used in looping part norm_Rational_rls, see example DA-M02-main.p.60 
  34.171 @@ -807,12 +807,12 @@
  34.172        (*"?x / (?y / ?z) = ?x * ?z / ?y"*)
  34.173        Rule.Thm ("divide_divide_eq_left", ThmC.numerals_to_Free @{thm divide_divide_eq_left}),
  34.174        (*"?x / ?y / ?z = ?x / (?y * ?z)"*)
  34.175 -      Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
  34.176 +      Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
  34.177        
  34.178        Rule.Thm ("rat_power", ThmC.numerals_to_Free @{thm rat_power})
  34.179        (*"(?a / ?b) ^^^ ?n = ?a ^^^ ?n / ?b ^^^ ?n"*)
  34.180        ],
  34.181 -    scr = Rule.EmptyScr});
  34.182 +    scr = Rule.Empty_Prog});
  34.183  
  34.184  val rat_reduce_1 = prep_rls'(
  34.185    Rule_Def.Repeat {id = "rat_reduce_1", preconds = [], rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord), 
  34.186 @@ -823,7 +823,7 @@
  34.187        Rule.Thm ("mult_1_left", ThmC.numerals_to_Free @{thm mult_1_left})           
  34.188        (*"1 * z = z"*)
  34.189        ],
  34.190 -    scr = Rule.EmptyScr});
  34.191 +    scr = Rule.Empty_Prog});
  34.192  
  34.193  (* looping part of norm_Rational *)
  34.194  val norm_Rational_rls = prep_rls' (
  34.195 @@ -835,10 +835,10 @@
  34.196        Rule.Rls_ cancel_p_rls,
  34.197        Rule.Rls_ rat_reduce_1
  34.198        ],
  34.199 -    scr = Rule.EmptyScr});
  34.200 +    scr = Rule.Empty_Prog});
  34.201  
  34.202  val norm_Rational = prep_rls' (
  34.203 -  Rule_Set.Seqence 
  34.204 +  Rule_Set.Sequence 
  34.205      {id = "norm_Rational", preconds = [], rew_ord = ("dummy_ord", Rewrite_Ord.dummy_ord), 
  34.206      erls = norm_rat_erls, srls = Rule_Set.Empty, calc = [], errpatts = [],
  34.207      rules = [Rule.Rls_ discard_minus,
  34.208 @@ -848,7 +848,7 @@
  34.209        Rule.Rls_ norm_Rational_rls,         (* the main rls, looping (#) *)
  34.210        Rule.Rls_ discard_parentheses1       (* mult only *)
  34.211        ],
  34.212 -    scr = Rule.EmptyScr});
  34.213 +    scr = Rule.Empty_Prog});
  34.214  \<close>
  34.215  
  34.216  setup \<open>KEStore_Elems.add_rlss 
  34.217 @@ -912,7 +912,7 @@
  34.218            ("#Find"  ,["normalform n_n"])],
  34.219  	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  34.220  	        prls = Rule_Set.append_rules "simplification_of_rationals_prls" Rule_Set.empty 
  34.221 -				    [(*for preds in where_*) Rule.Num_Calc ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")],
  34.222 +				    [(*for preds in where_*) Rule.Eval ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")],
  34.223  				  crls = Rule_Set.empty, errpats = [], nrls = norm_Rational_rls},
  34.224  				  @{thm simplify.simps})]
  34.225  \<close>
    35.1 --- a/src/Tools/isac/Knowledge/Root.thy	Wed Apr 15 11:11:54 2020 +0200
    35.2 +++ b/src/Tools/isac/Knowledge/Root.thy	Wed Apr 15 11:37:43 2020 +0200
    35.3 @@ -54,7 +54,7 @@
    35.4  	     SOME ni => 
    35.5  	     if ni < 0 then NONE
    35.6  	     else
    35.7 -		 let val fact = Num_Calc.squfact ni;
    35.8 +		 let val fact = Eval.squfact ni;
    35.9  		 in if fact*fact = ni 
   35.10  		    then SOME ("#sqrt #"^(string_of_int ni)^" = #"
   35.11  			       ^(string_of_int (if ni = 0 then 0
   35.12 @@ -164,25 +164,25 @@
   35.13  val Root_crls = 
   35.14        Rule_Set.append_rules "Root_crls" Atools_erls 
   35.15         [Rule.Thm  ("real_unari_minus",ThmC.numerals_to_Free @{thm real_unari_minus}),
   35.16 -        Rule.Num_Calc ("NthRoot.sqrt" , eval_sqrt "#sqrt_"),
   35.17 -        Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   35.18 -        Rule.Num_Calc ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   35.19 -        Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   35.20 -        Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   35.21 -        Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   35.22 -        Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_") 
   35.23 +        Rule.Eval ("NthRoot.sqrt" , eval_sqrt "#sqrt_"),
   35.24 +        Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   35.25 +        Rule.Eval ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   35.26 +        Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   35.27 +        Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   35.28 +        Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   35.29 +        Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_") 
   35.30          ];
   35.31  
   35.32  val Root_erls = 
   35.33        Rule_Set.append_rules "Root_erls" Atools_erls 
   35.34         [Rule.Thm  ("real_unari_minus",ThmC.numerals_to_Free @{thm real_unari_minus}),
   35.35 -        Rule.Num_Calc ("NthRoot.sqrt" , eval_sqrt "#sqrt_"),
   35.36 -        Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   35.37 -        Rule.Num_Calc ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   35.38 -        Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   35.39 -        Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   35.40 -        Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   35.41 -        Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_") 
   35.42 +        Rule.Eval ("NthRoot.sqrt" , eval_sqrt "#sqrt_"),
   35.43 +        Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   35.44 +        Rule.Eval ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   35.45 +        Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   35.46 +        Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   35.47 +        Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   35.48 +        Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_") 
   35.49          ];
   35.50  \<close>
   35.51  setup \<open>KEStore_Elems.add_rlss [("Root_erls", (Context.theory_name @{theory}, Root_erls))]\<close>
   35.52 @@ -246,11 +246,11 @@
   35.53  	       Rule.Thm ("real_one_collect_assoc",ThmC.numerals_to_Free @{thm real_one_collect_assoc}), 
   35.54  	       (*"m is_const ==> k + (n + m * n) = k + (1 + m) * n"*)
   35.55  
   35.56 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   35.57 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   35.58 -	       Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_")
   35.59 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   35.60 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   35.61 +	       Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_")
   35.62  	       ],
   35.63 -      scr = Rule.EmptyScr
   35.64 +      scr = Rule.Empty_Prog
   35.65        });      
   35.66  \<close>
   35.67  setup \<open>KEStore_Elems.add_rlss [("make_rooteq", (Context.theory_name @{theory}, make_rooteq))]\<close>
   35.68 @@ -292,12 +292,12 @@
   35.69  	       Rule.Thm ("add_0_left",ThmC.numerals_to_Free @{thm add_0_left}), 
   35.70                   (*"0 + z = z"*)
   35.71  
   35.72 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   35.73 -	       Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#sub_"), 
   35.74 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   35.75 -	       Rule.Num_Calc ("Rings.divide_class.divide"  , Prog_Expr.eval_cancel "#divide_e"),
   35.76 -	       Rule.Num_Calc ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   35.77 -	       Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_"),
   35.78 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   35.79 +	       Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#sub_"), 
   35.80 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   35.81 +	       Rule.Eval ("Rings.divide_class.divide"  , Prog_Expr.eval_cancel "#divide_e"),
   35.82 +	       Rule.Eval ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   35.83 +	       Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_"),
   35.84  
   35.85  	       Rule.Thm ("sym_realpow_twoI",
   35.86                       ThmC.numerals_to_Free (@{thm realpow_twoI} RS @{thm sym})),
   35.87 @@ -317,14 +317,14 @@
   35.88  	       Rule.Thm ("real_one_collect_assoc",ThmC.numerals_to_Free @{thm real_one_collect_assoc}), 
   35.89  	       (*"m is_const ==> k + (n + m * n) = k + (1 + m) * n"*)
   35.90  
   35.91 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   35.92 -	       Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#sub_"), 
   35.93 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   35.94 -	       Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   35.95 -	       Rule.Num_Calc ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   35.96 -	       Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_")
   35.97 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   35.98 +	       Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#sub_"), 
   35.99 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  35.100 +	       Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
  35.101 +	       Rule.Eval ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
  35.102 +	       Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_")
  35.103  	       ],
  35.104 -      scr = Rule.EmptyScr
  35.105 +      scr = Rule.Empty_Prog
  35.106         });      
  35.107  \<close>
  35.108  setup \<open>KEStore_Elems.add_rlss
    36.1 --- a/src/Tools/isac/Knowledge/RootEq.thy	Wed Apr 15 11:11:54 2020 +0200
    36.2 +++ b/src/Tools/isac/Knowledge/RootEq.thy	Wed Apr 15 11:37:43 2020 +0200
    36.3 @@ -180,14 +180,14 @@
    36.4  ML \<open>
    36.5  val RootEq_prls =(*15.10.02:just the following order due to subterm evaluation*)
    36.6    Rule_Set.append_rules "RootEq_prls" Rule_Set.empty 
    36.7 -	     [Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
    36.8 -	      Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
    36.9 -	      Rule.Num_Calc ("Prog_Expr.lhs"    , Prog_Expr.eval_lhs ""),
   36.10 -	      Rule.Num_Calc ("Prog_Expr.rhs"    , Prog_Expr.eval_rhs ""),
   36.11 -	      Rule.Num_Calc ("RootEq.is'_sqrtTerm'_in", eval_is_sqrtTerm_in ""),
   36.12 -	      Rule.Num_Calc ("RootEq.is'_rootTerm'_in", eval_is_rootTerm_in ""),
   36.13 -	      Rule.Num_Calc ("RootEq.is'_normSqrtTerm'_in", eval_is_normSqrtTerm_in ""),
   36.14 -	      Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   36.15 +	     [Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   36.16 +	      Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   36.17 +	      Rule.Eval ("Prog_Expr.lhs"    , Prog_Expr.eval_lhs ""),
   36.18 +	      Rule.Eval ("Prog_Expr.rhs"    , Prog_Expr.eval_rhs ""),
   36.19 +	      Rule.Eval ("RootEq.is'_sqrtTerm'_in", eval_is_sqrtTerm_in ""),
   36.20 +	      Rule.Eval ("RootEq.is'_rootTerm'_in", eval_is_rootTerm_in ""),
   36.21 +	      Rule.Eval ("RootEq.is'_normSqrtTerm'_in", eval_is_normSqrtTerm_in ""),
   36.22 +	      Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   36.23  	      Rule.Thm ("not_true", ThmC.numerals_to_Free @{thm not_true}),
   36.24  	      Rule.Thm ("not_false", ThmC.numerals_to_Free @{thm not_false}),
   36.25  	      Rule.Thm ("and_true", ThmC.numerals_to_Free @{thm and_true}),
   36.26 @@ -206,9 +206,9 @@
   36.27  
   36.28  val rooteq_srls = 
   36.29    Rule_Set.append_rules "rooteq_srls" Rule_Set.empty
   36.30 -    [Rule.Num_Calc ("RootEq.is'_sqrtTerm'_in", eval_is_sqrtTerm_in ""),
   36.31 -     Rule.Num_Calc ("RootEq.is'_normSqrtTerm'_in", eval_is_normSqrtTerm_in""),
   36.32 -     Rule.Num_Calc ("RootEq.is'_rootTerm'_in", eval_is_rootTerm_in "")];
   36.33 +    [Rule.Eval ("RootEq.is'_sqrtTerm'_in", eval_is_sqrtTerm_in ""),
   36.34 +     Rule.Eval ("RootEq.is'_normSqrtTerm'_in", eval_is_normSqrtTerm_in""),
   36.35 +     Rule.Eval ("RootEq.is'_rootTerm'_in", eval_is_rootTerm_in "")];
   36.36  \<close>
   36.37  ML \<open>
   36.38  
   36.39 @@ -307,7 +307,7 @@
   36.40  	      (* a=c/e*sqrt(x) ->a^2=c^2/e^2x *)
   36.41         Rule.Thm("sqrt_square_equation_right_6",ThmC.numerals_to_Free @{thm sqrt_square_equation_right_6})
   36.42  	      (* a=c*d/g*sqrt(x) ->a^2=c^2*d^2/g^2*x *)
   36.43 -       ],scr = Rule.EmptyScr
   36.44 +       ],scr = Rule.Empty_Prog
   36.45        });
   36.46  
   36.47  \<close> ML \<open>
   36.48 @@ -352,7 +352,7 @@
   36.49       Rule.Thm("sqrt_square_equation_left_6",ThmC.numerals_to_Free @{thm sqrt_square_equation_left_6})  
   36.50  	      (* c*d/g*sqrt(x)=b -> c^2*d^2/g^2x=b^2 *)
   36.51      ],
   36.52 -    scr = Rule.EmptyScr
   36.53 +    scr = Rule.Empty_Prog
   36.54     });
   36.55  
   36.56  \<close> ML \<open>
   36.57 @@ -398,7 +398,7 @@
   36.58       Rule.Thm("sqrt_square_equation_right_6",ThmC.numerals_to_Free @{thm sqrt_square_equation_right_6})
   36.59  	      (* a=c*d/g*sqrt(x) ->a^2=c^2*d^2/g^2*x *)
   36.60      ],
   36.61 -    scr = Rule.EmptyScr
   36.62 +    scr = Rule.Empty_Prog
   36.63     });
   36.64  
   36.65  \<close> ML \<open>
   36.66 @@ -411,12 +411,12 @@
   36.67                               (* a+(b+c) = a+b+c *)
   36.68                  Rule.Thm  ("real_assoc_2",ThmC.numerals_to_Free @{thm real_assoc_2}),
   36.69                               (* a*(b*c) = a*b*c *)
   36.70 -                Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   36.71 -                Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   36.72 -                Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   36.73 -                Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   36.74 -                Rule.Num_Calc ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   36.75 -                Rule.Num_Calc ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   36.76 +                Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   36.77 +                Rule.Eval ("Groups.minus_class.minus", (**)eval_binop "#sub_"),
   36.78 +                Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   36.79 +                Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   36.80 +                Rule.Eval ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   36.81 +                Rule.Eval ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   36.82                  Rule.Thm("real_plus_binom_pow2",ThmC.numerals_to_Free @{thm real_plus_binom_pow2}),
   36.83                  Rule.Thm("real_minus_binom_pow2",ThmC.numerals_to_Free @{thm real_minus_binom_pow2}),
   36.84                  Rule.Thm("realpow_mul",ThmC.numerals_to_Free @{thm realpow_mul}),    
   36.85 @@ -430,7 +430,7 @@
   36.86                  Rule.Thm("sqrt_square_1",ThmC.numerals_to_Free @{thm sqrt_square_1}) 
   36.87                              (* sqrt a ^^^ 2 = a *)
   36.88                  ],
   36.89 -       scr = Rule.EmptyScr
   36.90 +       scr = Rule.Empty_Prog
   36.91      });
   36.92  \<close>
   36.93  setup \<open>KEStore_Elems.add_rlss 
    37.1 --- a/src/Tools/isac/Knowledge/RootRat.thy	Wed Apr 15 11:11:54 2020 +0200
    37.2 +++ b/src/Tools/isac/Knowledge/RootRat.thy	Wed Apr 15 11:37:43 2020 +0200
    37.3 @@ -22,7 +22,7 @@
    37.4  		      (* 1 * z = z *)
    37.5  		     Rule.Thm ("sym_real_mult_minus1",ThmC.numerals_to_Free (@{thm real_mult_minus1} RS @{thm sym})),
    37.6  		       (* "- z1 = -1 * z1"  *)
    37.7 -		     Rule.Num_Calc ("NthRoot.sqrt", eval_sqrt "#sqrt_")
    37.8 +		     Rule.Eval ("NthRoot.sqrt", eval_sqrt "#sqrt_")
    37.9  		     ];
   37.10  
   37.11  val prep_rls' = Auto_Prog.prep_rls @{theory};
    38.1 --- a/src/Tools/isac/Knowledge/RootRatEq.thy	Wed Apr 15 11:11:54 2020 +0200
    38.2 +++ b/src/Tools/isac/Knowledge/RootRatEq.thy	Wed Apr 15 11:37:43 2020 +0200
    38.3 @@ -71,13 +71,13 @@
    38.4  ML \<open>
    38.5  val RootRatEq_prls = 
    38.6    Rule_Set.append_rules "RootRatEq_prls" Rule_Set.empty
    38.7 -		[Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
    38.8 -     Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
    38.9 -     Rule.Num_Calc ("Prog_Expr.lhs", Prog_Expr.eval_lhs ""),
   38.10 -     Rule.Num_Calc ("Prog_Expr.rhs", Prog_Expr.eval_rhs ""),
   38.11 -     Rule.Num_Calc ("RootEq.is'_rootTerm'_in", eval_is_rootTerm_in ""),
   38.12 -     Rule.Num_Calc ("RootRatEq.is'_rootRatAddTerm'_in", eval_is_rootRatAddTerm_in ""),
   38.13 -     Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   38.14 +		[Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   38.15 +     Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   38.16 +     Rule.Eval ("Prog_Expr.lhs", Prog_Expr.eval_lhs ""),
   38.17 +     Rule.Eval ("Prog_Expr.rhs", Prog_Expr.eval_rhs ""),
   38.18 +     Rule.Eval ("RootEq.is'_rootTerm'_in", eval_is_rootTerm_in ""),
   38.19 +     Rule.Eval ("RootRatEq.is'_rootRatAddTerm'_in", eval_is_rootRatAddTerm_in ""),
   38.20 +     Rule.Eval ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   38.21       Rule.Thm ("not_true",ThmC.numerals_to_Free @{thm not_true}),
   38.22       Rule.Thm ("not_false",ThmC.numerals_to_Free @{thm not_false}),
   38.23       Rule.Thm ("and_true",ThmC.numerals_to_Free @{thm and_true}),
   38.24 @@ -115,7 +115,7 @@
   38.25                                     ( (a = d + e/f) = ( (a - d) * f = e )) *)
   38.26       Rule.Thm("rootrat_equation_right_2",ThmC.numerals_to_Free @{thm rootrat_equation_right_2})
   38.27  	(* [|f is_rootTerm_in bdv|] ==> ( (a =  e/f) = ( a  * f = e ))*)
   38.28 -     ], scr = Rule.EmptyScr});
   38.29 +     ], scr = Rule.Empty_Prog});
   38.30  \<close>
   38.31  setup \<open>KEStore_Elems.add_rlss
   38.32    [("RooRatEq_erls", (Context.theory_name @{theory}, RooRatEq_erls)),
    39.1 --- a/src/Tools/isac/Knowledge/Test.thy	Wed Apr 15 11:11:54 2020 +0200
    39.2 +++ b/src/Tools/isac/Knowledge/Test.thy	Wed Apr 15 11:37:43 2020 +0200
    39.3 @@ -374,18 +374,18 @@
    39.4  	       Rule.Thm ("and_commute",ThmC.numerals_to_Free @{thm and_commute}),
    39.5  	       Rule.Thm ("or_commute",ThmC.numerals_to_Free @{thm or_commute}),
    39.6  
    39.7 -	       Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
    39.8 -	       Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
    39.9 +	       Rule.Eval ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   39.10 +	       Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   39.11      
   39.12 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   39.13 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   39.14 -	       Rule.Num_Calc ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   39.15 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   39.16 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   39.17 +	       Rule.Eval ("Prog_Expr.pow" , (**)eval_binop "#power_"),
   39.18  		    
   39.19 -	       Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   39.20 -	       Rule.Num_Calc ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   39.21 +	       Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   39.22 +	       Rule.Eval ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   39.23  	     	    
   39.24 -	       Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_")],
   39.25 -      scr = Rule.EmptyScr
   39.26 +	       Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_")],
   39.27 +      scr = Rule.Empty_Prog
   39.28        };      
   39.29  \<close>
   39.30  ML \<open>
   39.31 @@ -415,22 +415,22 @@
   39.32  	       Rule.Thm ("root_ge0_1",ThmC.numerals_to_Free @{thm root_ge0_1}),
   39.33  	       Rule.Thm ("root_ge0_2",ThmC.numerals_to_Free @{thm root_ge0_2}),
   39.34  
   39.35 -	       Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   39.36 -	       Rule.Num_Calc ("Test.contains'_root", eval_contains_root "#eval_contains_root"),
   39.37 -	       Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   39.38 -	       Rule.Num_Calc ("Test.contains'_root",
   39.39 +	       Rule.Eval ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   39.40 +	       Rule.Eval ("Test.contains'_root", eval_contains_root "#eval_contains_root"),
   39.41 +	       Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   39.42 +	       Rule.Eval ("Test.contains'_root",
   39.43  		     eval_contains_root"#contains_root_"),
   39.44      
   39.45 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   39.46 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   39.47 -	       Rule.Num_Calc ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   39.48 -	       Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_"),
   39.49 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   39.50 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
   39.51 +	       Rule.Eval ("NthRoot.sqrt", eval_sqrt "#sqrt_"),
   39.52 +	       Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_"),
   39.53  		    
   39.54 -	       Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   39.55 -	       Rule.Num_Calc ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   39.56 +	       Rule.Eval ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   39.57 +	       Rule.Eval ("Orderings.ord_class.less_eq", Prog_Expr.eval_equ "#less_equal_"),
   39.58  	     	    
   39.59 -	       Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_")],
   39.60 -      scr = Rule.EmptyScr
   39.61 +	       Rule.Eval ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_")],
   39.62 +      scr = Rule.Empty_Prog
   39.63        };      
   39.64  \<close>
   39.65  setup \<open>KEStore_Elems.add_rlss [("testerls", (Context.theory_name @{theory}, prep_rls' testerls))]\<close>
   39.66 @@ -444,7 +444,7 @@
   39.67        rules = 
   39.68        [Rule.Thm ("sym_add.assoc",ThmC.numerals_to_Free (@{thm add.assoc} RS @{thm sym})),
   39.69         Rule.Thm ("sym_rmult_assoc",ThmC.numerals_to_Free (@{thm rmult_assoc} RS @{thm sym}))],
   39.70 -      scr = Rule.EmptyScr
   39.71 +      scr = Rule.Empty_Prog
   39.72        };      
   39.73  
   39.74  val ac_plus_times =
   39.75 @@ -457,7 +457,7 @@
   39.76         Rule.Thm ("rmult_commute",ThmC.numerals_to_Free @{thm rmult_commute}),
   39.77         Rule.Thm ("rmult_left_commute",ThmC.numerals_to_Free @{thm rmult_left_commute}),
   39.78         Rule.Thm ("rmult_assoc",ThmC.numerals_to_Free @{thm rmult_assoc})],
   39.79 -      scr = Rule.EmptyScr
   39.80 +      scr = Rule.Empty_Prog
   39.81        };      
   39.82  
   39.83  (*todo: replace by Rewrite("rnorm_equation_add",ThmC.numerals_to_Free @{thm rnorm_equation_add)*)
   39.84 @@ -466,7 +466,7 @@
   39.85        erls = tval_rls, srls = Rule_Set.empty, calc = [], errpatts = [],
   39.86        rules = [Rule.Thm ("rnorm_equation_add",ThmC.numerals_to_Free @{thm rnorm_equation_add})
   39.87  	       ],
   39.88 -      scr = Rule.EmptyScr
   39.89 +      scr = Rule.Empty_Prog
   39.90        };      
   39.91  \<close>
   39.92  ML \<open>
   39.93 @@ -495,10 +495,10 @@
   39.94  	       Rule.Thm ("radd_real_const",ThmC.numerals_to_Free @{thm radd_real_const}),
   39.95  	       (* these 2 rules are invers to distr_div_right wrt. termination.
   39.96  		  thus they MUST be done IMMEDIATELY before calc *)
   39.97 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   39.98 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   39.99 -	       Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
  39.100 -	       Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_"),
  39.101 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  39.102 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  39.103 +	       Rule.Eval ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
  39.104 +	       Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_"),
  39.105  
  39.106  	       Rule.Thm ("rcollect_right",ThmC.numerals_to_Free @{thm rcollect_right}),
  39.107  	       Rule.Thm ("rcollect_one_left",ThmC.numerals_to_Free @{thm rcollect_one_left}),
  39.108 @@ -522,7 +522,7 @@
  39.109  	       Rule.Thm ("radd_0",ThmC.numerals_to_Free @{thm radd_0}),
  39.110  	       Rule.Thm ("radd_0_right",ThmC.numerals_to_Free @{thm radd_0_right})
  39.111  	       ],
  39.112 -      scr = Rule.EmptyScr
  39.113 +      scr = Rule.Empty_Prog
  39.114  		    (*since 040209 filled by prep_rls': STest_simplify*)
  39.115        };      
  39.116  \<close>
  39.117 @@ -564,7 +564,7 @@
  39.118    ("isolate_root", (Context.theory_name @{theory}, prep_rls' isolate_root)), 
  39.119    ("isolate_bdv", (Context.theory_name @{theory}, prep_rls' isolate_bdv)), 
  39.120    ("matches", (Context.theory_name @{theory}, prep_rls'
  39.121 -    (Rule_Set.append_rules "matches" testerls [Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "#matches_")])))]
  39.122 +    (Rule_Set.append_rules "matches" testerls [Rule.Eval ("Prog_Expr.matches", Prog_Expr.eval_matches "#matches_")])))]
  39.123  \<close>
  39.124  
  39.125  subsection \<open>problems\<close>
  39.126 @@ -658,11 +658,11 @@
  39.127  	       Rule.Thm ("real_one_collect_assoc",ThmC.numerals_to_Free @{thm real_one_collect_assoc}), 
  39.128  	       (*"m is_const ==> k + (n + m * n) = k + (1 + m) * n"*)
  39.129  
  39.130 -	       Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  39.131 -	       Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  39.132 -	       Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_")
  39.133 +	       Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  39.134 +	       Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  39.135 +	       Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_")
  39.136  	       ],
  39.137 -      scr = Rule.EmptyScr(*Rule.Prog ((Thm.term_of o the o (parse thy)) 
  39.138 +      scr = Rule.Empty_Prog(*Rule.Prog ((Thm.term_of o the o (parse thy)) 
  39.139        scr_make_polytest)*)
  39.140        }; 
  39.141  
  39.142 @@ -721,9 +721,9 @@
  39.143  	Rule.Thm ("add_0_left",ThmC.numerals_to_Free @{thm add_0_left}),
  39.144           (*"0 + z = z"*)
  39.145  
  39.146 -	Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  39.147 -	Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  39.148 -	Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_"),
  39.149 +	Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  39.150 +	Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  39.151 +	Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_"),
  39.152          (*	       
  39.153  	 Rule.Thm ("mult.commute",ThmC.numerals_to_Free @{thm mult.commute}),		
  39.154          (*AC-rewriting*)
  39.155 @@ -754,11 +754,11 @@
  39.156  	Rule.Thm ("real_one_collect_assoc",ThmC.numerals_to_Free @{thm real_one_collect_assoc}), 
  39.157  	(*"m is_const ==> k + (n + m * n) = k + (1 + m) * n"*)
  39.158  
  39.159 -	Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  39.160 -	Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
  39.161 -	Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_")
  39.162 +	Rule.Eval ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
  39.163 +	Rule.Eval ("Groups.times_class.times", (**)eval_binop "#mult_"),
  39.164 +	Rule.Eval ("Prog_Expr.pow", (**)eval_binop "#power_")
  39.165  	],
  39.166 -      scr = Rule.EmptyScr
  39.167 +      scr = Rule.Empty_Prog
  39.168  (*Program ((Thm.term_of o the o (parse thy)) scr_expand_binomtest)*)
  39.169        };      
  39.170  \<close>
  39.171 @@ -808,7 +808,7 @@
  39.172          [("#Given" ,["equality e_e","solveFor v_v"]),
  39.173            ("#Where" ,["precond_rootpbl v_v"]),
  39.174            ("#Find"  ,["solutions v_v'i'"])],
  39.175 -        Rule_Set.append_rules "contains_root" Rule_Set.empty [Rule.Num_Calc ("Test.contains'_root",
  39.176 +        Rule_Set.append_rules "contains_root" Rule_Set.empty [Rule.Eval ("Test.contains'_root",
  39.177              eval_contains_root "#contains_root_")], 
  39.178          SOME "solve (e_e::bool, v_v)", [["Test","square_equation"]])),
  39.179      (Specify.prep_pbt thy "pbl_test_uni_norm" [] Celem.e_pblID
  39.180 @@ -888,9 +888,9 @@
  39.181            ("#Find"  ,["solutions v_v'i'"])],
  39.182          {rew_ord'="e_rew_ord",rls'=tval_rls,
  39.183            srls = Rule_Set.append_rules "srls_contains_root" Rule_Set.empty
  39.184 -              [Rule.Num_Calc ("Test.contains'_root", eval_contains_root "")],
  39.185 +              [Rule.Eval ("Test.contains'_root", eval_contains_root "")],
  39.186            prls = Rule_Set.append_rules "prls_contains_root" Rule_Set.empty 
  39.187 -              [Rule.Num_Calc ("Test.contains'_root", eval_contains_root "")],
  39.188 +              [Rule.Eval ("Test.contains'_root", eval_contains_root "")],
  39.189            calc=[], crls=tval_rls, errpats = [], nrls = Rule_Set.empty (*,asm_rls=[],
  39.190            asm_thm=[("square_equation_left",""), ("square_equation_right","")]*)},
  39.191          @{thm solve_root_equ.simps})]
  39.192 @@ -916,7 +916,7 @@
  39.193            ("#Find"  ,["solutions v_v'i'"])],
  39.194          {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = Rule_Set.empty,
  39.195            prls = Rule_Set.append_rules "prls_met_test_squ_sub" Rule_Set.empty
  39.196 -              [Rule.Num_Calc ("Test.precond'_rootmet", eval_precond_rootmet "")],
  39.197 +              [Rule.Eval ("Test.precond'_rootmet", eval_precond_rootmet "")],
  39.198            calc=[], crls=tval_rls, errpats = [], nrls = Test_simplify},
  39.199          @{thm minisubpbl.simps})]
  39.200  \<close>
  39.201 @@ -947,7 +947,7 @@
  39.202            ("#Find"  ,["solutions v_v'i'"])],
  39.203          {rew_ord'="e_rew_ord",rls'=tval_rls,
  39.204            srls = Rule_Set.append_rules "srls_contains_root" Rule_Set.empty 
  39.205 -            [Rule.Num_Calc ("Test.contains'_root", eval_contains_root"")], prls=Rule_Set.empty, calc=[], crls=tval_rls,
  39.206 +            [Rule.Eval ("Test.contains'_root", eval_contains_root"")], prls=Rule_Set.empty, calc=[], crls=tval_rls,
  39.207                errpats = [], nrls = Rule_Set.empty(*,asm_rls=[], asm_thm=[("square_equation_left",""),
  39.208                ("square_equation_right","")]*)},
  39.209          @{thm solve_root_equ2.simps})]
  39.210 @@ -980,7 +980,7 @@
  39.211            ("#Find"  ,["solutions v_v'i'"])],
  39.212          {rew_ord'="e_rew_ord",rls'=tval_rls,
  39.213            srls = Rule_Set.append_rules "srls_contains_root" Rule_Set.empty 
  39.214 -              [Rule.Num_Calc ("Test.contains'_root", eval_contains_root"")],
  39.215 +              [Rule.Eval ("Test.contains'_root", eval_contains_root"")],
  39.216            prls=Rule_Set.empty,calc=[], crls=tval_rls, errpats = [], nrls = Rule_Set.empty(*,asm_rls=[],
  39.217            asm_thm=[("square_equation_left",""), ("square_equation_right","")]*)},
  39.218          @{thm solve_root_equ3.simps})]
  39.219 @@ -1013,7 +1013,7 @@
  39.220            ("#Find"  ,["solutions v_v'i'"])],
  39.221          {rew_ord'="e_rew_ord",rls'=tval_rls,
  39.222            srls = Rule_Set.append_rules "srls_contains_root" Rule_Set.empty 
  39.223 -              [Rule.Num_Calc ("Test.contains'_root", eval_contains_root"")],
  39.224 +              [Rule.Eval ("Test.contains'_root", eval_contains_root"")],
  39.225            prls=Rule_Set.empty,calc=[], crls=tval_rls, errpats = [], nrls = Rule_Set.empty (*,asm_rls=[],
  39.226            asm_thm=[("square_equation_left",""), ("square_equation_right","")]*)},
  39.227          @{thm solve_root_equ4.simps})]
    40.1 --- a/src/Tools/isac/Knowledge/Test_Build_Thydata.thy	Wed Apr 15 11:11:54 2020 +0200
    40.2 +++ b/src/Tools/isac/Knowledge/Test_Build_Thydata.thy	Wed Apr 15 11:37:43 2020 +0200
    40.3 @@ -17,13 +17,13 @@
    40.4  	preconds = [], rew_ord = ("termlessI", termlessI), erls = Rule_Set.empty, 
    40.5  	srls = Rule_Set.Empty, calc = [], errpatts = [],
    40.6  	rules = [Rule.Thm ("thm111", @{thm thm111}), Rule.Thm ("refl", @{thm refl})],
    40.7 -	scr = Rule.EmptyScr};
    40.8 +	scr = Rule.Empty_Prog};
    40.9  
   40.10  val rls222 = Rule_Def.Repeat {id = "rls222", 
   40.11  	preconds = [], rew_ord = ("termlessI", termlessI), erls = Rule_Set.empty, 
   40.12  	srls = Rule_Set.Empty, calc = [], errpatts = [],
   40.13  	rules = [Rule.Thm ("sym_thm111", @{thm thm111} RS @{thm sym}), Rule.Thm ("o_def", @{thm o_def})],
   40.14 -	scr = Rule.EmptyScr};
   40.15 +	scr = Rule.Empty_Prog};
   40.16  
   40.17  val prep_rls' = Auto_Prog.prep_rls @{theory};
   40.18  \<close>
   40.19 @@ -47,9 +47,9 @@
   40.20      ("Test_Build_Thydata",
   40.21       Rule_Def.Repeat {calc = [], erls =
   40.22            Rule_Def.Repeat {calc = [], erls = Erls, errpatts = [], id = "empty", preconds = [], rew_ord =
   40.23 -               ("dummy_ord", _), rules = [], scr = EmptyScr, srls = Rule_Set.Empty},
   40.24 +               ("dummy_ord", _), rules = [], scr = Empty_Prog, srls = Rule_Set.Empty},
   40.25            errpatts = [], id = "rls111", preconds = [], rew_ord = ("termlessI", _), rules =
   40.26 -          [Thm ("thm111", _), Thm ("refl", _)], scr = EmptyScr, srls = Rule_Set.Empty})) => ()
   40.27 +          [Thm ("thm111", _), Thm ("refl", _)], scr = Empty_Prog, srls = Rule_Set.Empty})) => ()
   40.28  | _ => error "test/../thy-hierarchy CHANGED 4";
   40.29  \<close> ML \<open>
   40.30  case eee of
   40.31 @@ -57,9 +57,9 @@
   40.32      ("Test_Build_Thydata",
   40.33       Rule_Def.Repeat {calc = [], erls =
   40.34            Rule_Def.Repeat {calc = [], erls = Erls, errpatts = [], id = "empty", preconds = [], rew_ord =
   40.35 -               ("dummy_ord", _), rules = [], scr = EmptyScr, srls = Rule_Set.Empty},
   40.36 +               ("dummy_ord", _), rules = [], scr = Empty_Prog, srls = Rule_Set.Empty},
   40.37            errpatts = [], id = "rls222", preconds = [], rew_ord = ("termlessI", _), rules =
   40.38 -          [Thm ("sym_thm111", _), Thm ("o_def", _)], scr = EmptyScr, srls = Rule_Set.Empty})) => ()
   40.39 +          [Thm ("sym_thm111", _), Thm ("o_def", _)], scr = Empty_Prog, srls = Rule_Set.Empty})) => ()
   40.40  | _ => error "test/../thy-hierarchy CHANGED 5";
   40.41  \<close>
   40.42  
    41.1 --- a/src/Tools/isac/MathEngBasic/rewrite.sml	Wed Apr 15 11:11:54 2020 +0200
    41.2 +++ b/src/Tools/isac/MathEngBasic/rewrite.sml	Wed Apr 15 11:37:43 2020 +0200
    41.3 @@ -47,7 +47,7 @@
    41.4  fun rewrite__ thy i bdv tless rls put_asm thm ct =
    41.5    let
    41.6      val (t', asms, _ (*lrd*), rew) = rew_sub thy i bdv tless rls put_asm ([(*root of the term*)]: TermC.path)
    41.7 -		  (((TermC.inst_bdv bdv) o Num_Calc.norm o #prop o Thm.rep_thm) thm) ct
    41.8 +		  (((TermC.inst_bdv bdv) o Eval.norm o #prop o Thm.rep_thm) thm) ct
    41.9    in if rew then SOME (t', distinct asms) else NONE end
   41.10    (* one rewrite (possibly conditional, ordered) EXOR exn EXOR go into subterms *)
   41.11  and rew_sub thy i bdv tless rls put_asm lrd r t = 
   41.12 @@ -125,14 +125,14 @@
   41.13        val _= trace i (" rls: " ^ Rule_Set.id rrls ^ " on: " ^ UnparseC.term_in_thy thy t)
   41.14  	    val (t', asm, rew) = app_rev thy (i + 1) rrls t                   
   41.15      in if rew then SOME (t', distinct asm) else NONE end
   41.16 -  | rewrite__set_ thy i put_asm bdv rls ct =          (* Rls, Seq containing Thms or Num_Calc, Cal1 *)
   41.17 +  | rewrite__set_ thy i put_asm bdv rls ct =          (* Rls, Seq containing Thms or Eval, Cal1 *)
   41.18      let
   41.19        (* attention with cp to test/..: unbound thy, i, bdv, rls; TODO1803? pull out to rewrite__*)
   41.20        datatype switch = Appl | Noap;
   41.21        fun rew_once _ asm ct Noap [] = (ct, asm)         (* ?TODO unify with Prog_Expr.rew_once? *)
   41.22          | rew_once ruls asm ct Appl [] = 
   41.23            (case rls of Rule_Def.Repeat _ => rew_once ruls asm ct Noap ruls
   41.24 -          | Rule_Set.Seqence _ => (ct, asm)
   41.25 +          | Rule_Set.Sequence _ => (ct, asm)
   41.26            | rls => raise ERROR ("rew_once not appl. to \"" ^ Rule_Set.id rls ^ "\""))
   41.27          | rew_once ruls asm ct apno (rul :: thms) =
   41.28            case rul of
   41.29 @@ -145,10 +145,10 @@
   41.30                  (trace1 i (" rewrites to: \"" ^ UnparseC.term_in_thy thy ct' ^ "\"");
   41.31                  rew_once ruls (union (op =) asm asm') ct' Appl (rul :: thms)))
   41.32                  (* once again try the same rule, e.g. associativity against "()"*)
   41.33 -          | Rule.Num_Calc (cc as (op_, _)) => 
   41.34 +          | Rule.Eval (cc as (op_, _)) => 
   41.35              let val _= trace1 i (" try calc: \"" ^ op_ ^ "\"")
   41.36                val ct = TermC.uminus_to_string ct (*WN190312: superfluous?*)
   41.37 -            in case Num_Calc.adhoc_thm thy cc ct of
   41.38 +            in case Eval.adhoc_thm thy cc ct of
   41.39                  NONE => rew_once ruls asm ct apno thms
   41.40                | SOME (_, thm') => 
   41.41                  let 
   41.42 @@ -162,7 +162,7 @@
   41.43            | Rule.Cal1 (cc as (op_, _)) => 
   41.44              let val _= trace1 i (" try cal1: " ^ op_ ^ "'");
   41.45                val ct = TermC.uminus_to_string ct
   41.46 -            in case Num_Calc.adhoc_thm1_ thy cc ct of
   41.47 +            in case Eval.adhoc_thm1_ thy cc ct of
   41.48                  NONE => (ct, asm)
   41.49                | SOME (_, thm') =>
   41.50                  let 
   41.51 @@ -262,7 +262,7 @@
   41.52  (* search ct for adjacent numerals and calculate them by operator isa_fn *)
   41.53  fun calculate_ thy isa_fn ct =
   41.54    let val ct = TermC.uminus_to_string ct
   41.55 -    in case Num_Calc.adhoc_thm thy isa_fn ct of
   41.56 +    in case Eval.adhoc_thm thy isa_fn ct of
   41.57  	   NONE => NONE
   41.58  	 | SOME (thmID, thm) =>
   41.59  	   (let val rew = case rewrite_ thy Rewrite_Ord.dummy_ord Rule_Set.empty false thm ct of
    42.1 --- a/src/Tools/isac/MathEngBasic/tactic.sml	Wed Apr 15 11:11:54 2020 +0200
    42.2 +++ b/src/Tools/isac/MathEngBasic/tactic.sml	Wed Apr 15 11:37:43 2020 +0200
    42.3 @@ -311,7 +311,7 @@
    42.4    | rls_of (Rewrite_Set rls) = rls
    42.5    | rls_of input = error ("rls_of: called with input \"" ^ tac2IDstr input ^ "\"");
    42.6  
    42.7 -fun rule2tac thy _ (Rule.Num_Calc (opID, _)) = Calculate (assoc_calc thy opID)
    42.8 +fun rule2tac thy _ (Rule.Eval (opID, _)) = Calculate (assoc_calc thy opID)
    42.9    | rule2tac _ [] (Rule.Thm thm'') = Rewrite thm''
   42.10    | rule2tac _ subst (Rule.Thm thm'') = 
   42.11      Rewrite_Inst (Selem.subst2subs subst, thm'')
    43.1 --- a/src/Tools/isac/MathEngBasic/thmC.sml	Wed Apr 15 11:11:54 2020 +0200
    43.2 +++ b/src/Tools/isac/MathEngBasic/thmC.sml	Wed Apr 15 11:37:43 2020 +0200
    43.3 @@ -67,7 +67,7 @@
    43.4  
    43.5  (* get the theorem associated with the xstring-identifier;
    43.6     if the identifier starts with "sym_" then swap lhs = rhs" around "=";
    43.7 -   in case identifiers starting with "#" come from Num_Calc and
    43.8 +   in case identifiers starting with "#" come from Eval and
    43.9     get an ad-hoc theorem (containing numerals only) -- rejected here
   43.10  *)
   43.11  fun thm_from_thy thy thmid =
   43.12 @@ -99,8 +99,8 @@
   43.13    | make_sym_rule_set (Rule_Def.Repeat {id, scr, calc, errpatts, erls, srls, rules, rew_ord, preconds}) =
   43.14      Rule_Def.Repeat {id = "sym_" ^ id, scr = scr, calc = calc, errpatts = errpatts, erls = erls, srls = srls, 
   43.15        rules = rules, rew_ord = rew_ord, preconds = preconds}
   43.16 -  | make_sym_rule_set (Rule_Set.Seqence {id, scr, calc, errpatts, erls, srls, rules, rew_ord, preconds}) =
   43.17 -    Rule_Set.Seqence {id = "sym_" ^ id, scr = scr, calc = calc, errpatts = errpatts, erls = erls, srls = srls, 
   43.18 +  | make_sym_rule_set (Rule_Set.Sequence {id, scr, calc, errpatts, erls, srls, rules, rew_ord, preconds}) =
   43.19 +    Rule_Set.Sequence {id = "sym_" ^ id, scr = scr, calc = calc, errpatts = errpatts, erls = erls, srls = srls, 
   43.20        rules = rules, rew_ord = rew_ord, preconds = preconds}
   43.21    | make_sym_rule_set (Rule_Set.Rrls {id, scr, calc, errpatts, erls, prepat, rew_ord}) = 
   43.22      Rule_Set.Rrls {id = "sym_" ^ id, scr = scr, calc = calc,  errpatts = errpatts, erls = erls,
    44.1 --- a/src/Tools/isac/ProgLang/Auto_Prog.thy	Wed Apr 15 11:11:54 2020 +0200
    44.2 +++ b/src/Tools/isac/ProgLang/Auto_Prog.thy	Wed Apr 15 11:37:43 2020 +0200
    44.3 @@ -131,13 +131,13 @@
    44.4          \   (Try (Repeat (Rewrite ''mult_commute'')))) t";
    44.5  
    44.6  fun rule2stac _ (Rule.Thm (thmID, _)) = Try $ (Repeat $ (Rew $ HOLogic.mk_string thmID))
    44.7 -  | rule2stac thy (Rule.Num_Calc (c, _)) = Try $ (Repeat $ (Cal $ HOLogic.mk_string (assoc_calc thy c)))
    44.8 +  | rule2stac thy (Rule.Eval (c, _)) = Try $ (Repeat $ (Cal $ HOLogic.mk_string (assoc_calc thy c)))
    44.9    | rule2stac thy (Rule.Cal1 (c, _)) = Try $ (Repeat $ (Ca1 $ HOLogic.mk_string (assoc_calc thy c)))
   44.10    | rule2stac _ (Rule.Rls_ rls) = Try $ (Rew_Set $ HOLogic.mk_string (Rule_Set.id rls))
   44.11    | rule2stac _ r = raise ERROR ("rule2stac: not applicable to \"" ^ Rule.to_string r ^ "\"");
   44.12  fun rule2stac_inst _ (Rule.Thm (thmID, _)) = 
   44.13      Try $ (Repeat $ (Rew_Inst $ Subs $ HOLogic.mk_string thmID))
   44.14 -  | rule2stac_inst thy (Rule.Num_Calc (c, _)) = 
   44.15 +  | rule2stac_inst thy (Rule.Eval (c, _)) = 
   44.16      Try $ (Repeat $ (Cal $ HOLogic.mk_string (assoc_calc thy c)))
   44.17    | rule2stac_inst thy (Rule.Cal1 (c, _)) = 
   44.18      Try $ (Repeat $ (Cal $ HOLogic.mk_string (assoc_calc thy c)))
   44.19 @@ -164,7 +164,7 @@
   44.20      if (not o contains_bdv) thm
   44.21      then contain_bdv rs
   44.22      else true
   44.23 -  | contain_bdv (Rule.Num_Calc _ :: rs) = contain_bdv rs
   44.24 +  | contain_bdv (Rule.Eval _ :: rs) = contain_bdv rs
   44.25    | contain_bdv (Rule.Cal1 _ :: rs) = contain_bdv rs
   44.26    | contain_bdv (Rule.Rls_ rls :: rs) = 
   44.27      contain_bdv (Rule_Set.get_rules rls) orelse contain_bdv rs
   44.28 @@ -205,7 +205,7 @@
   44.29  (* REPLACED BY Auto_Prog.gen:
   44.30     prepare the input for an rls for use:
   44.31     # generate a program for stepwise execution of the rls
   44.32 -   # filter the operators for Num_Calc out of the script ?WN111014?
   44.33 +   # filter the operators for Eval out of the script ?WN111014?
   44.34     use this function while storing (TODO integrate..) into KEStore_Elems.add_rlss
   44.35  *)
   44.36  fun prep_rls _ Rule_Set.Empty = error "prep_rls: not required for Erls"
   44.37 @@ -216,15 +216,15 @@
   44.38          Rule_Def.Repeat {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls,
   44.39    	      calc = get_calcs thy sc,
   44.40    	      rules = rules, errpatts = errpatts,
   44.41 -  	      scr = Rule.EmptyScr (*Rule.Prog sc  AD-HOC REPLACED BY Auto_Prog.gen*)} end
   44.42 -  | prep_rls thy (Rule_Set.Seqence {id, preconds, rew_ord, erls, srls, rules, errpatts, ...}) = 
   44.43 +  	      scr = Rule.Empty_Prog (*Rule.Prog sc  AD-HOC REPLACED BY Auto_Prog.gen*)} end
   44.44 +  | prep_rls thy (Rule_Set.Sequence {id, preconds, rew_ord, erls, srls, rules, errpatts, ...}) = 
   44.45        let
   44.46          val sc = (rules2scr_Seq thy rules)
   44.47        in
   44.48 -        Rule_Set.Seqence {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls,
   44.49 +        Rule_Set.Sequence {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls,
   44.50  	        calc = get_calcs thy sc,
   44.51  	        rules = rules, errpatts = errpatts,
   44.52 -  	      scr = Rule.EmptyScr (*Rule.Prog sc  AD-HOC REPLACED BY Auto_Prog.gen*)} end
   44.53 +  	      scr = Rule.Empty_Prog (*Rule.Prog sc  AD-HOC REPLACED BY Auto_Prog.gen*)} end
   44.54    | prep_rls _ (Rule_Set.Rrls {id, ...}) = 
   44.55        error ("prep_rls: not required for Rrls \"" ^ id ^ "\"");
   44.56  
   44.57 @@ -236,7 +236,7 @@
   44.58    let
   44.59      val prog = case rls of
   44.60  	      Rule_Def.Repeat {rules, ...} => rules2scr_Rls thy rules
   44.61 -	    | Rule_Set.Seqence {rules, ...} => rules2scr_Seq thy rules
   44.62 +	    | Rule_Set.Sequence {rules, ...} => rules2scr_Seq thy rules
   44.63  	    | _ => raise ERROR ("Auto_Prog.gen: not for rule-set \"" ^ Rule_Set.id rls ^ "\"")
   44.64    in
   44.65      subst_typs prog (type_of t) (TermC.guess_bdv_typ t)
    45.1 --- a/src/Tools/isac/ProgLang/Calculate.thy	Wed Apr 15 11:11:54 2020 +0200
    45.2 +++ b/src/Tools/isac/ProgLang/Calculate.thy	Wed Apr 15 11:37:43 2020 +0200
    45.3 @@ -28,14 +28,14 @@
    45.4  fun eval_binop (_(*thmid*) : string) (op_: string)
    45.5        (t as (Const (op0, t0) $ (Const (op0', _) $ v $ t1) $ t2)) _ =  (* binary . (v.n1).n2 *)
    45.6      if op0 = op0' then
    45.7 -      case (Num_Calc.numeral t1, Num_Calc.numeral t2) of
    45.8 +      case (Eval.numeral t1, Eval.numeral t2) of
    45.9          (SOME n1, SOME n2) =>
   45.10            let 
   45.11              val (T1, _, _) = TermC.dest_binop_typ t0
   45.12              val res = 
   45.13 -              Num_Calc.calcul (if op0 = "Groups.minus_class.minus" then "Groups.plus_class.plus" else op0)n1 n2
   45.14 +              Eval.calcul (if op0 = "Groups.minus_class.minus" then "Groups.plus_class.plus" else op0)n1 n2
   45.15                (*WN071229 "Rings.divide_class.divide" never tried*)
   45.16 -            val rhs = Num_Calc.var_op_float v op_ t0 T1 res
   45.17 +            val rhs = Eval.var_op_float v op_ t0 T1 res
   45.18              val prop = HOLogic.Trueprop $ (TermC.mk_equality (t, rhs))
   45.19            in SOME ("#: " ^ UnparseC.term prop, prop) end
   45.20        | _ => NONE
   45.21 @@ -43,24 +43,24 @@
   45.22    | eval_binop _ (op_ : string) 
   45.23        (t as (Const (op0, t0) $ t1 $ (Const (op0', _) $ t2 $ v))) _ =  (* binary . n1.(n2.v) *)
   45.24      if op0 = op0' then
   45.25 -      case (Num_Calc.numeral t1, Num_Calc.numeral t2) of
   45.26 +      case (Eval.numeral t1, Eval.numeral t2) of
   45.27          (SOME n1, SOME n2) =>
   45.28            if op0 = "Groups.minus_class.minus" then NONE 
   45.29            else let 
   45.30              val (T1, _, _) = TermC.dest_binop_typ t0
   45.31 -            val res = Num_Calc.calcul op0 n1 n2
   45.32 -            val rhs = Num_Calc.float_op_var v op_ t0 T1 res
   45.33 +            val res = Eval.calcul op0 n1 n2
   45.34 +            val rhs = Eval.float_op_var v op_ t0 T1 res
   45.35              val prop = HOLogic.Trueprop $ (TermC.mk_equality (t, rhs))
   45.36            in SOME ("#: " ^ UnparseC.term prop, prop) end
   45.37        | _ => NONE
   45.38      else NONE
   45.39    | eval_binop _ _ (t as (Const (op0, t0) $ t1 $ t2)) _ =   (* binary . n1.n2 *)
   45.40 -    (case (Num_Calc.numeral t1, Num_Calc.numeral t2) of
   45.41 +    (case (Eval.numeral t1, Eval.numeral t2) of
   45.42        (SOME n1, SOME n2) =>
   45.43          let 
   45.44            val (_, _, Trange) = TermC.dest_binop_typ t0;
   45.45 -          val res = Num_Calc.calcul op0 n1 n2;
   45.46 -          val rhs = Num_Calc.term_of_float Trange res;
   45.47 +          val res = Eval.calcul op0 n1 n2;
   45.48 +          val rhs = Eval.term_of_float Trange res;
   45.49            val prop = HOLogic.Trueprop $ (TermC.mk_equality (t, rhs));
   45.50          in SOME ("#: " ^ UnparseC.term prop, prop) end
   45.51      | _ => NONE)
    46.1 --- a/src/Tools/isac/ProgLang/ListC.thy	Wed Apr 15 11:11:54 2020 +0200
    46.2 +++ b/src/Tools/isac/ProgLang/ListC.thy	Wed Apr 15 11:37:43 2020 +0200
    46.3 @@ -176,7 +176,7 @@
    46.4         Rule_Def.Thm ("tl_Nil",ThmC_Def.numerals_to_Free @{thm tl_Nil}),
    46.5         Rule_Def.Thm ("zip_Cons",ThmC_Def.numerals_to_Free @{thm zip_Cons}),
    46.6         Rule_Def.Thm ("zip_Nil",ThmC_Def.numerals_to_Free @{thm zip_Nil})],
    46.7 -    scr = Rule_Def.EmptyScr}: Rule_Set.T;
    46.8 +    scr = Rule_Def.Empty_Prog}: Rule_Set.T;
    46.9  \<close>
   46.10  setup \<open>KEStore_Elems.add_rlss [("prog_expr", (Context.theory_name @{theory}, prog_expr))]\<close>
   46.11  
    47.1 --- a/src/Tools/isac/ProgLang/Prog_Expr.thy	Wed Apr 15 11:11:54 2020 +0200
    47.2 +++ b/src/Tools/isac/ProgLang/Prog_Expr.thy	Wed Apr 15 11:37:43 2020 +0200
    47.3 @@ -346,7 +346,7 @@
    47.4  	       (Const (op0, _) $ Free (n1, _) $ Free(n2, _))) _ = 
    47.5      (case (ThmC_Def.int_opt_of_string n1, ThmC_Def.int_opt_of_string n2) of
    47.6  	 (SOME n1', SOME n2') =>
    47.7 -  if Num_Calc.calc_equ (strip_thy op0) (n1', n2')
    47.8 +  if Eval.calc_equ (strip_thy op0) (n1', n2')
    47.9      then SOME (TermC.mk_thmid thmid n1 n2, 
   47.10  	  HOLogic.Trueprop $ (TermC.mk_equality (t, @{term True})))
   47.11    else SOME (TermC.mk_thmid thmid n1 n2,  
   47.12 @@ -364,7 +364,7 @@
   47.13  
   47.14  > val t = str2term "1 = 0";
   47.15  > val NONE = rewrite_ thy Rewrite_Ord.dummy_ord Rule_Set.empty false reflI t;
   47.16 ------------ thus needs Rule.Num_Calc !
   47.17 +----------- thus needs Rule.Eval !
   47.18  > val t = str2term "0 = 0";
   47.19  > val SOME (t',_) = rewrite_ thy Rewrite_Ord.dummy_ord Rule_Set.empty false reflI t;
   47.20  > UnparseC.term t';
   47.21 @@ -440,9 +440,9 @@
   47.22      (case (ThmC_Def.int_opt_of_string n1, ThmC_Def.int_opt_of_string n2) of
   47.23      	(SOME n1', SOME n2') =>
   47.24          let 
   47.25 -          val sg = Num_Calc.sign_mult n1' n2';
   47.26 +          val sg = Eval.sign_mult n1' n2';
   47.27            val (T1,T2,Trange) = TermC.dest_binop_typ t0;
   47.28 -          val gcd' = Num_Calc.gcd (abs n1') (abs n2');
   47.29 +          val gcd' = Eval.gcd (abs n1') (abs n2');
   47.30          in if gcd' = abs n2' 
   47.31             then let val rhs = TermC.term_of_num Trange (sg * (abs n1') div gcd')
   47.32      	        val prop = HOLogic.Trueprop $ (TermC.mk_equality (t, rhs))
   47.33 @@ -533,7 +533,7 @@
   47.34  
   47.35  subsection \<open>extend rule-set for evaluating pre-conditions and program-expressions\<close>
   47.36  ML \<open>
   47.37 -val prog_expr = Rule_Set.append_rules "prog_expr" prog_expr [Rule.Num_Calc ("Prog_Expr.rhs", Prog_Expr.eval_rhs "")];
   47.38 +val prog_expr = Rule_Set.append_rules "prog_expr" prog_expr [Rule.Eval ("Prog_Expr.rhs", Prog_Expr.eval_rhs "")];
   47.39  \<close> ML \<open>
   47.40  \<close> ML \<open>
   47.41  \<close>
    48.1 --- a/src/Tools/isac/ProgLang/Program.thy	Wed Apr 15 11:11:54 2020 +0200
    48.2 +++ b/src/Tools/isac/ProgLang/Program.thy	Wed Apr 15 11:37:43 2020 +0200
    48.3 @@ -95,7 +95,7 @@
    48.4    |> snd)
    48.5    handle TERM _ => raise TERM ("body_of", [tm])
    48.6  
    48.7 -fun to_string Rule_Def.EmptyScr = "EmptyScr"
    48.8 +fun to_string Rule_Def.Empty_Prog = "Empty_Prog"
    48.9    | to_string (Rule_Def.Prog s) = "Prog " ^ UnparseC.term s
   48.10    | to_string (Rule_Def.Rfuns _)  = "Rfuns";
   48.11  
    49.1 --- a/src/Tools/isac/ProgLang/calculate.sml	Wed Apr 15 11:11:54 2020 +0200
    49.2 +++ b/src/Tools/isac/ProgLang/calculate.sml	Wed Apr 15 11:37:43 2020 +0200
    49.3 @@ -31,7 +31,7 @@
    49.4    end
    49.5  
    49.6  (**)
    49.7 -structure Num_Calc(**): NUMERAL_CALCULATION(**) =
    49.8 +structure Eval(**): NUMERAL_CALCULATION(**) =
    49.9  struct
   49.10  (**)
   49.11  
    50.1 --- a/src/Tools/isac/Specify/appl.sml	Wed Apr 15 11:11:54 2020 +0200
    50.2 +++ b/src/Tools/isac/Specify/appl.sml	Wed Apr 15 11:37:43 2020 +0200
    50.3 @@ -25,7 +25,7 @@
    50.4  
    50.5  fun rew_info (Rule_Def.Repeat {erls, rew_ord = (rew_ord', _), calc = ca, ...}) =
    50.6      (rew_ord', erls, ca)
    50.7 -  | rew_info (Rule_Set.Seqence {erls, rew_ord = (rew_ord', _), calc = ca, ...}) =
    50.8 +  | rew_info (Rule_Set.Sequence {erls, rew_ord = (rew_ord', _), calc = ca, ...}) =
    50.9      (rew_ord', erls, ca)
   50.10    | rew_info (Rule_Set.Rrls {erls, rew_ord = (rew_ord', _), calc = ca, ...}) =
   50.11      (rew_ord', erls, ca)
    51.1 --- a/src/Tools/isac/Specify/calchead.sml	Wed Apr 15 11:11:54 2020 +0200
    51.2 +++ b/src/Tools/isac/Specify/calchead.sml	Wed Apr 15 11:37:43 2020 +0200
    51.3 @@ -197,11 +197,11 @@
    51.4  
    51.5  (* make a term 'typeless' for comparing with another 'typeless' term;
    51.6     'type-less' usually is illtyped                                  *)
    51.7 -fun typeless (Const (s, _)) = (Const (s, TermC.type_empty)) 
    51.8 -  | typeless (Free (s, _)) = (Free (s, TermC.type_empty))
    51.9 -  | typeless (Var (n, _)) = (Var (n, TermC.type_empty))
   51.10 +fun typeless (Const (s, _)) = (Const (s, TermC.typ_empty)) 
   51.11 +  | typeless (Free (s, _)) = (Free (s, TermC.typ_empty))
   51.12 +  | typeless (Var (n, _)) = (Var (n, TermC.typ_empty))
   51.13    | typeless (Bound i) = (Bound i)
   51.14 -  | typeless (Abs (s, _,t)) = Abs(s, TermC.type_empty, typeless t)
   51.15 +  | typeless (Abs (s, _,t)) = Abs(s, TermC.typ_empty, typeless t)
   51.16    | typeless (t1 $ t2) = (typeless t1) $ (typeless t2)
   51.17  
   51.18  (* to an input (d,ts) find the according ori and insert the ts)
    52.1 --- a/src/Tools/isac/Specify/ptyps.sml	Wed Apr 15 11:11:54 2020 +0200
    52.2 +++ b/src/Tools/isac/Specify/ptyps.sml	Wed Apr 15 11:37:43 2020 +0200
    52.3 @@ -112,7 +112,7 @@
    52.4  
    52.5  fun fun_id_of ({scr = prog, ...} : Celem.met) = 
    52.6    case prog of
    52.7 -    Rule.EmptyScr => NONE
    52.8 +    Rule.Empty_Prog => NONE
    52.9    | Rule.Prog t => 
   52.10      (case t of
   52.11        Const ("HOL.eq", _) $ Free ("t", _) $ Free ("t", _) (*=@{thm refl}*) => NONE
    53.1 --- a/src/Tools/isac/TODO.thy	Wed Apr 15 11:11:54 2020 +0200
    53.2 +++ b/src/Tools/isac/TODO.thy	Wed Apr 15 11:37:43 2020 +0200
    53.3 @@ -26,12 +26,6 @@
    53.4  (*/------- to  -------\*)
    53.5  (*\------- to  -------/*)
    53.6    \begin{itemize}
    53.7 -  \item type_empty -> typ_empty
    53.8 -  \item Seqence -> Sequence
    53.9 -  \item EmptyScr -> Empty_Prog
   53.10 -  \item Num_Calc -> Exec, eval_* -> exec_*
   53.11 -  \item xxx
   53.12 -  \item xxx
   53.13    \item ML_file "rule-set.sml" KEStore -> MathEngBasic (=ThmC, Rewrite)
   53.14      probably first review calcelems.sml
   53.15    \item xxx
   53.16 @@ -227,7 +221,7 @@
   53.17       (*+* )------- in f3cac3053e7b (Rule_Set.empty just renamed, NOT deleted) we had
   53.18       (*+*)  prls =
   53.19       (*+*)    Rls {calc = [], erls = Erls, errpatts = [], id = "empty", preconds = [], rew_ord =
   53.20 -     (*+*)      ("dummy_ord", fn), rules = [], scr = EmptyScr, srls = Erls}:
   53.21 +     (*+*)      ("dummy_ord", fn), rules = [], scr = Empty_Prog, srls = Erls}:
   53.22       (*+*).. THIS IS Rule_Set.empty, BUT IT DID not CAUSE ANY ERROR !
   53.23       (*+*)------- WITH Rule_Set.empty REMOVED (based on f3cac3053e7b) we had
   53.24       (*+*)val Empty = prls (* <---ERROR: rewrite__set_ called with 'Erls' for 'precond_rootpbl x' *)
   53.25 @@ -424,7 +418,7 @@
   53.26  \<close>
   53.27  subsection \<open>Rfuns, Begin_/End_Detail', Rrls, Istate\<close>
   53.28  text \<open>
   53.29 -remove refactor Rfuns, Rule.Prog, Rule.EmptyScr, RrlsState: this is a concept never brought to work.
   53.30 +remove refactor Rfuns, Rule.Prog, Rule.Empty_Prog, RrlsState: this is a concept never brought to work.
   53.31    Clarify relation to reverse rewriting!
   53.32    \begin{itemize}
   53.33    \item separate mut.recursion program with rule and rls by deleting fild scr in rls
    54.1 --- a/test/Tools/isac/ADDTESTS/accumulate-val/Thy_3.thy	Wed Apr 15 11:11:54 2020 +0200
    54.2 +++ b/test/Tools/isac/ADDTESTS/accumulate-val/Thy_3.thy	Wed Apr 15 11:37:43 2020 +0200
    54.3 @@ -11,7 +11,7 @@
    54.4    then () else error "rls identified by string-identifier, not by theory: changed"
    54.5  
    54.6  (*test_ruleset' := overwritelthy @{theory} (! test_ruleset', [("test_list_rls", 
    54.7 -    Rule_Set.append_rules "test_list_rls" test_list_rls [Num_Calc ("test_function", e_evalfn)])])*)
    54.8 +    Rule_Set.append_rules "test_list_rls" test_list_rls [Eval ("test_function", e_evalfn)])])*)
    54.9    ;
   54.10  (*if length (Test_KEStore_Elems.get_rlss @{theory}) = length (! test_ruleset')
   54.11    then () else error "Test_KEStore_Elems.get_rlss = test_ruleset': changed"*)
    55.1 --- a/test/Tools/isac/ADDTESTS/course/CADGME/example_1.thy	Wed Apr 15 11:11:54 2020 +0200
    55.2 +++ b/test/Tools/isac/ADDTESTS/course/CADGME/example_1.thy	Wed Apr 15 11:37:43 2020 +0200
    55.3 @@ -4,7 +4,7 @@
    55.4  begin
    55.5  
    55.6  section \<open>Equation Solving\<close>
    55.7 -text \<open>Setup equation, Num_Calc Tree,\ldots\<close>
    55.8 +text \<open>Setup equation, Eval Tree,\ldots\<close>
    55.9  
   55.10  ML \<open>
   55.11    val expr = ["equality (-1 + -2 * z + 8 * z ^^^ 2 = (0::real))", 
    56.1 --- a/test/Tools/isac/ADDTESTS/course/SignalProcess/Build_Inverse_Z_Transform.thy	Wed Apr 15 11:11:54 2020 +0200
    56.2 +++ b/test/Tools/isac/ADDTESTS/course/SignalProcess/Build_Inverse_Z_Transform.thy	Wed Apr 15 11:37:43 2020 +0200
    56.3 @@ -536,9 +536,9 @@
    56.4  \begin{verbatim}
    56.5    val srls = 
    56.6      Rule_Set.Repeat{id = "srls_InverseZTransform",
    56.7 -        rules = [Num_Calc("Rational.get_numerator",
    56.8 +        rules = [Eval("Rational.get_numerator",
    56.9                     eval_get_numerator "Rational.get_numerator"),
   56.10 -                 Num_Calc("Partial_Fractions.factors_from_solution",
   56.11 +                 Eval("Partial_Fractions.factors_from_solution",
   56.12                     eval_factors_from_solution 
   56.13                       "Partial_Fractions.factors_from_solution")]}
   56.14  \end{verbatim}                
   56.15 @@ -704,7 +704,7 @@
   56.16          Thm ("ansatz_2nd_order",ThmC.numerals_to_Free @{thm ansatz_2nd_order}),
   56.17          Thm ("equival_trans_2nd_order",ThmC.numerals_to_Free @{thm equival_trans_2nd_order})
   56.18                ], 
   56.19 -      scr = EmptyScr});
   56.20 +      scr = Empty_Prog});
   56.21  \<close>
   56.22  
   56.23  text\<open>\noindent We apply the ruleset\ldots\<close>
   56.24 @@ -1090,26 +1090,26 @@
   56.25           rew_ord = ("termlessI",termlessI),
   56.26           erls = Rule_Set.append_rules "erls_in_srls_InverseZTransform" Rule_Set.empty
   56.27             [(*for asm in NTH_CONS ...*)
   56.28 -            Num_Calc ("Orderings.ord_class.less",eval_equ "#less_"),
   56.29 +            Eval ("Orderings.ord_class.less",eval_equ "#less_"),
   56.30              (*2nd NTH_CONS pushes n+-1 into asms*)
   56.31 -            Num_Calc("Groups.plus_class.plus", eval_binop "#add_")
   56.32 +            Eval("Groups.plus_class.plus", eval_binop "#add_")
   56.33             ], 
   56.34           srls = Rule_Set.Empty, calc = [], errpatts = [],
   56.35           rules = [
   56.36                    Thm ("NTH_CONS",ThmC.numerals_to_Free @{thm NTH_CONS}),
   56.37 -                  Num_Calc("Groups.plus_class.plus", eval_binop "#add_"),
   56.38 +                  Eval("Groups.plus_class.plus", eval_binop "#add_"),
   56.39                    Thm ("NTH_NIL",ThmC.numerals_to_Free @{thm NTH_NIL}),
   56.40 -                  Num_Calc("Prog_Expr.lhs", eval_lhs"eval_lhs_"),
   56.41 -                  Num_Calc("Prog_Expr.rhs", eval_rhs"eval_rhs_"),
   56.42 -                  Num_Calc("Prog_Expr.argument'_in", eval_argument_in "Prog_Expr.argument'_in"),
   56.43 -                  Num_Calc("Rational.get_denominator", eval_get_denominator "#get_denominator"),
   56.44 -                  Num_Calc("Rational.get_numerator", eval_get_numerator "#get_numerator"),
   56.45 -                  Num_Calc("Partial_Fractions.factors_from_solution",
   56.46 +                  Eval("Prog_Expr.lhs", eval_lhs"eval_lhs_"),
   56.47 +                  Eval("Prog_Expr.rhs", eval_rhs"eval_rhs_"),
   56.48 +                  Eval("Prog_Expr.argument'_in", eval_argument_in "Prog_Expr.argument'_in"),
   56.49 +                  Eval("Rational.get_denominator", eval_get_denominator "#get_denominator"),
   56.50 +                  Eval("Rational.get_numerator", eval_get_numerator "#get_numerator"),
   56.51 +                  Eval("Partial_Fractions.factors_from_solution",
   56.52                         eval_factors_from_solution "#factors_from_solution"),
   56.53 -                  Num_Calc("Partial_Fractions.drop_questionmarks",
   56.54 +                  Eval("Partial_Fractions.drop_questionmarks",
   56.55                         eval_drop_questionmarks "#drop_?")
   56.56                   ],
   56.57 -         scr = EmptyScr};
   56.58 +         scr = Empty_Prog};
   56.59  \<close>
   56.60  
   56.61  
    57.1 --- a/test/Tools/isac/ADDTESTS/course/SignalProcess/document/Build_Inverse_Z_Transform.tex	Wed Apr 15 11:11:54 2020 +0200
    57.2 +++ b/test/Tools/isac/ADDTESTS/course/SignalProcess/document/Build_Inverse_Z_Transform.tex	Wed Apr 15 11:37:43 2020 +0200
    57.3 @@ -1025,9 +1025,9 @@
    57.4  \begin{verbatim}
    57.5    val srls = 
    57.6      Rule_Set.Repeat{id = "srls_InverseZTransform",
    57.7 -        rules = [Num_Calc("Rational.get_numerator",
    57.8 +        rules = [Eval("Rational.get_numerator",
    57.9                     eval_get_numerator "Rational.get_numerator"),
   57.10 -                 Num_Calc("Partial_Fractions.factors_from_solution",
   57.11 +                 Eval("Partial_Fractions.factors_from_solution",
   57.12                     eval_factors_from_solution 
   57.13                       "Partial_Fractions.factors_from_solution")]}
   57.14  \end{verbatim}                
   57.15 @@ -1368,7 +1368,7 @@
   57.16  \endisaantiq
   57.17  {\isaliteral{29}{\isacharparenright}}\isanewline
   57.18  \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isaliteral{5D}{\isacharbrackright}}{\isaliteral{2C}{\isacharcomma}}\ \isanewline
   57.19 -\ \ \ \ \ \ scr\ {\isaliteral{3D}{\isacharequal}}\ EmptyScr{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{3B}{\isacharsemicolon}}\isanewline
   57.20 +\ \ \ \ \ \ scr\ {\isaliteral{3D}{\isacharequal}}\ Empty_Prog{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{3B}{\isacharsemicolon}}\isanewline
   57.21  {\isaliteral{2A7D}{\isacharverbatimclose}}%
   57.22  \endisatagML
   57.23  {\isafoldML}%
   57.24 @@ -2087,7 +2087,7 @@
   57.25  \ \ \ \ \ \ \ \ \ \ \ {\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{2A}{\isacharasterisk}}for\ asm\ in\ NTH{\isaliteral{5F}{\isacharunderscore}}CONS\ {\isaliteral{2E}{\isachardot}}{\isaliteral{2E}{\isachardot}}{\isaliteral{2E}{\isachardot}}{\isaliteral{2A}{\isacharasterisk}}{\isaliteral{29}{\isacharparenright}}\isanewline
   57.26  \ \ \ \ \ \ \ \ \ \ \ \ Num_Calc\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Orderings{\isaliteral{2E}{\isachardot}}ord{\isaliteral{5F}{\isacharunderscore}}class{\isaliteral{2E}{\isachardot}}less{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}eval{\isaliteral{5F}{\isacharunderscore}}equ\ {\isaliteral{22}{\isachardoublequote}}{\isaliteral{23}{\isacharhash}}less{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.27  \ \ \ \ \ \ \ \ \ \ \ \ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{2A}{\isacharasterisk}}{\isadigit{2}}nd\ NTH{\isaliteral{5F}{\isacharunderscore}}CONS\ pushes\ n{\isaliteral{2B}{\isacharplus}}{\isaliteral{2D}{\isacharminus}}{\isadigit{1}}\ into\ asms{\isaliteral{2A}{\isacharasterisk}}{\isaliteral{29}{\isacharparenright}}\isanewline
   57.28 -\ \ \ \ \ \ \ \ \ \ \ \ Num_Calc{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Groups{\isaliteral{2E}{\isachardot}}plus{\isaliteral{5F}{\isacharunderscore}}class{\isaliteral{2E}{\isachardot}}plus{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\ eval{\isaliteral{5F}{\isacharunderscore}}binop\ {\isaliteral{22}{\isachardoublequote}}{\isaliteral{23}{\isacharhash}}add{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}\isanewline
   57.29 +\ \ \ \ \ \ \ \ \ \ \ \ Eval{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Groups{\isaliteral{2E}{\isachardot}}plus{\isaliteral{5F}{\isacharunderscore}}class{\isaliteral{2E}{\isachardot}}plus{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\ eval{\isaliteral{5F}{\isacharunderscore}}binop\ {\isaliteral{22}{\isachardoublequote}}{\isaliteral{23}{\isacharhash}}add{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}\isanewline
   57.30  \ \ \ \ \ \ \ \ \ \ \ {\isaliteral{5D}{\isacharbrackright}}{\isaliteral{2C}{\isacharcomma}}\ \isanewline
   57.31  \ \ \ \ \ \ \ \ \ srls\ {\isaliteral{3D}{\isacharequal}}\ Rule_Set.Empty{\isaliteral{2C}{\isacharcomma}}\ calc\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.32  \ \ \ \ \ \ \ \ \ rules\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5B}{\isacharbrackleft}}\isanewline
   57.33 @@ -2096,28 +2096,28 @@
   57.34  thm\ NTH{\isaliteral{5F}{\isacharunderscore}}CONS{}%
   57.35  \endisaantiq
   57.36  {\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.37 -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Num_Calc{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Groups{\isaliteral{2E}{\isachardot}}plus{\isaliteral{5F}{\isacharunderscore}}class{\isaliteral{2E}{\isachardot}}plus{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\ \isanewline
   57.38 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Eval{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Groups{\isaliteral{2E}{\isachardot}}plus{\isaliteral{5F}{\isacharunderscore}}class{\isaliteral{2E}{\isachardot}}plus{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\ \isanewline
   57.39  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ eval{\isaliteral{5F}{\isacharunderscore}}binop\ {\isaliteral{22}{\isachardoublequote}}{\isaliteral{23}{\isacharhash}}add{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.40  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Thm\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}NTH{\isaliteral{5F}{\isacharunderscore}}NIL{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}num{\isaliteral{5F}{\isacharunderscore}}str\ %
   57.41  \isaantiq
   57.42  thm\ NTH{\isaliteral{5F}{\isacharunderscore}}NIL{}%
   57.43  \endisaantiq
   57.44  {\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.45 -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Num_Calc{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Tools{\isaliteral{2E}{\isachardot}}lhs{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\ eval{\isaliteral{5F}{\isacharunderscore}}lhs{\isaliteral{22}{\isachardoublequote}}eval{\isaliteral{5F}{\isacharunderscore}}lhs{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.46 -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Num_Calc{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Tools{\isaliteral{2E}{\isachardot}}rhs{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\ eval{\isaliteral{5F}{\isacharunderscore}}rhs{\isaliteral{22}{\isachardoublequote}}eval{\isaliteral{5F}{\isacharunderscore}}rhs{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.47 -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Num_Calc{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Prog_Expr{\isaliteral{2E}{\isachardot}}argument{\isaliteral{27}{\isacharprime}}{\isaliteral{5F}{\isacharunderscore}}in{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.48 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Eval{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Tools{\isaliteral{2E}{\isachardot}}lhs{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\ eval{\isaliteral{5F}{\isacharunderscore}}lhs{\isaliteral{22}{\isachardoublequote}}eval{\isaliteral{5F}{\isacharunderscore}}lhs{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.49 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Eval{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Tools{\isaliteral{2E}{\isachardot}}rhs{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\ eval{\isaliteral{5F}{\isacharunderscore}}rhs{\isaliteral{22}{\isachardoublequote}}eval{\isaliteral{5F}{\isacharunderscore}}rhs{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.50 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Eval{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Prog_Expr{\isaliteral{2E}{\isachardot}}argument{\isaliteral{27}{\isacharprime}}{\isaliteral{5F}{\isacharunderscore}}in{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.51  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ eval{\isaliteral{5F}{\isacharunderscore}}argument{\isaliteral{5F}{\isacharunderscore}}in\ {\isaliteral{22}{\isachardoublequote}}Prog_Expr{\isaliteral{2E}{\isachardot}}argument{\isaliteral{27}{\isacharprime}}{\isaliteral{5F}{\isacharunderscore}}in{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.52 -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Num_Calc{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Rational{\isaliteral{2E}{\isachardot}}get{\isaliteral{5F}{\isacharunderscore}}denominator{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.53 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Eval{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Rational{\isaliteral{2E}{\isachardot}}get{\isaliteral{5F}{\isacharunderscore}}denominator{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.54  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ eval{\isaliteral{5F}{\isacharunderscore}}get{\isaliteral{5F}{\isacharunderscore}}denominator\ {\isaliteral{22}{\isachardoublequote}}{\isaliteral{23}{\isacharhash}}get{\isaliteral{5F}{\isacharunderscore}}denominator{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.55 -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Num_Calc{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Rational{\isaliteral{2E}{\isachardot}}get{\isaliteral{5F}{\isacharunderscore}}numerator{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.56 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Eval{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Rational{\isaliteral{2E}{\isachardot}}get{\isaliteral{5F}{\isacharunderscore}}numerator{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.57  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ eval{\isaliteral{5F}{\isacharunderscore}}get{\isaliteral{5F}{\isacharunderscore}}numerator\ {\isaliteral{22}{\isachardoublequote}}{\isaliteral{23}{\isacharhash}}get{\isaliteral{5F}{\isacharunderscore}}numerator{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.58 -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Num_Calc{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Partial{\isaliteral{5F}{\isacharunderscore}}Fractions{\isaliteral{2E}{\isachardot}}factors{\isaliteral{5F}{\isacharunderscore}}from{\isaliteral{5F}{\isacharunderscore}}solution{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.59 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Eval{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Partial{\isaliteral{5F}{\isacharunderscore}}Fractions{\isaliteral{2E}{\isachardot}}factors{\isaliteral{5F}{\isacharunderscore}}from{\isaliteral{5F}{\isacharunderscore}}solution{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.60  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ eval{\isaliteral{5F}{\isacharunderscore}}factors{\isaliteral{5F}{\isacharunderscore}}from{\isaliteral{5F}{\isacharunderscore}}solution\ \isanewline
   57.61  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isaliteral{22}{\isachardoublequote}}{\isaliteral{23}{\isacharhash}}factors{\isaliteral{5F}{\isacharunderscore}}from{\isaliteral{5F}{\isacharunderscore}}solution{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.62 -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Num_Calc{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Partial{\isaliteral{5F}{\isacharunderscore}}Fractions{\isaliteral{2E}{\isachardot}}drop{\isaliteral{5F}{\isacharunderscore}}questionmarks{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.63 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Eval{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}Partial{\isaliteral{5F}{\isacharunderscore}}Fractions{\isaliteral{2E}{\isachardot}}drop{\isaliteral{5F}{\isacharunderscore}}questionmarks{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.64  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ eval{\isaliteral{5F}{\isacharunderscore}}drop{\isaliteral{5F}{\isacharunderscore}}questionmarks\ {\isaliteral{22}{\isachardoublequote}}{\isaliteral{23}{\isacharhash}}drop{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}\isanewline
   57.65  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isaliteral{5D}{\isacharbrackright}}{\isaliteral{2C}{\isacharcomma}}\isanewline
   57.66 -\ \ \ \ \ \ \ \ \ scr\ {\isaliteral{3D}{\isacharequal}}\ EmptyScr{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{3B}{\isacharsemicolon}}\isanewline
   57.67 +\ \ \ \ \ \ \ \ \ scr\ {\isaliteral{3D}{\isacharequal}}\ Empty_Prog{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{3B}{\isacharsemicolon}}\isanewline
   57.68  {\isaliteral{2A7D}{\isacharverbatimclose}}%
   57.69  \endisatagML
   57.70  {\isafoldML}%
    58.1 --- a/test/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml	Wed Apr 15 11:11:54 2020 +0200
    58.2 +++ b/test/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml	Wed Apr 15 11:37:43 2020 +0200
    58.3 @@ -77,14 +77,14 @@
    58.4  val (theID:theID, Hrls {guh, coursedesign, mathauthors, thy_rls}) = (theID, thydata);
    58.5  rls2xml i thy_rls            (*reported Exception- Match in question*);
    58.6  ;
    58.7 -val (j, (thyID, Rule_Set.Seqence data)) = (i, thy_rls);
    58.8 -rls2xml j (thyID, Rule_Set.Seqence data)  (*reported Exception- Match in question*);
    58.9 +val (j, (thyID, Rule_Set.Sequence data)) = (i, thy_rls);
   58.10 +rls2xml j (thyID, Rule_Set.Sequence data)  (*reported Exception- Match in question*);
   58.11  ;
   58.12 -val (j, (thyID, Rule_Set.Seqence {id, preconds, rew_ord=(ord,_), erls, errpatts, srls, calc, rules, scr})) = 
   58.13 -  (j, (thyID, Rule_Set.Seqence data));
   58.14 +val (j, (thyID, Rule_Set.Sequence {id, preconds, rew_ord=(ord,_), erls, errpatts, srls, calc, rules, scr})) = 
   58.15 +  (j, (thyID, Rule_Set.Sequence data));
   58.16  ;
   58.17  rules2xml (j+2*i) thyID rules  (*reports Exception- Match in question*);
   58.18 -(*TODO: Num_Calc + Cal1 in datatypes.sml *)
   58.19 +(*TODO: Eval + Cal1 in datatypes.sml *)
   58.20  
   58.21  "----------- search for data error in thes2file ------------------";
   58.22  "----------- search for data error in thes2file ------------------";
   58.23 @@ -126,9 +126,9 @@
   58.24    (pa, po', (ids@[id]), n);
   58.25  "~~~~~ fun thydata2xml, args:"; val (theID, Hrls {guh, coursedesign, mathauthors, thy_rls}) =
   58.26    (theID:theID, thydata);
   58.27 -"~~~~~ fun rls2xml, args:"; val (j, (thyID, Rule_Set.Seqence data)) = (i, thy_rls);
   58.28 +"~~~~~ fun rls2xml, args:"; val (j, (thyID, Rule_Set.Sequence data)) = (i, thy_rls);
   58.29  "~~~~~ fun rls2xm, args:"; val (j, (thyID, seqrls, {id, preconds, rew_ord=(ord,_), erls,
   58.30 -		      srls, calc, errpatts, rules, scr})) = (j, (thyID, "Rule_Set.Seqence", data));
   58.31 +		      srls, calc, errpatts, rules, scr})) = (j, (thyID, "Rule_Set.Sequence", data));
   58.32  "~~~~~ fun rules2xml, args:"; val (j, thyID, (r::rs)) = ((j+2*i), thyID, rules);
   58.33  "~~~~~ fun rule2xml, args:"; val (j, thyID, (Rls_ rls)) = (j, thyID, r);
   58.34  val rls' = (#id o Rule_Set.rep) rls;
    59.1 --- a/test/Tools/isac/BridgeLibisabelle/use-cases.sml	Wed Apr 15 11:11:54 2020 +0200
    59.2 +++ b/test/Tools/isac/BridgeLibisabelle/use-cases.sml	Wed Apr 15 11:37:43 2020 +0200
    59.3 @@ -29,7 +29,7 @@
    59.4  "--------- miniscript with mini-subpbl ------------------";
    59.5  "--------- mini-subpbl AUTOCALCULATE Steps 1 ------------";
    59.6  "--------- solve_linear as rootpbl AUTO CompleteCalc ----";
    59.7 -"--------- solve_linear as rootpbl AUTO CompleteHead/Num_Calc ";
    59.8 +"--------- solve_linear as rootpbl AUTO CompleteHead/Eval ";
    59.9  "--------- mini-subpbl AUTOCALCULATE CompleteCalc -------";
   59.10  "--------- mini-subpbl AUTO CompleteCalcHead ------------";
   59.11  "--------- solve_linear as rootpbl AUTO CompleteModel ---";
   59.12 @@ -491,9 +491,9 @@
   59.13   error "FE-interface.sml: diff.behav. in solve_linear/rt AUTOCALCULATE ";
   59.14  DEconstrCalcTree 1;
   59.15  
   59.16 -"--------- solve_linear as rootpbl AUTO CompleteHead/Num_Calc ";
   59.17 -"--------- solve_linear as rootpbl AUTO CompleteHead/Num_Calc ";
   59.18 -"--------- solve_linear as rootpbl AUTO CompleteHead/Num_Calc ";
   59.19 +"--------- solve_linear as rootpbl AUTO CompleteHead/Eval ";
   59.20 +"--------- solve_linear as rootpbl AUTO CompleteHead/Eval ";
   59.21 +"--------- solve_linear as rootpbl AUTO CompleteHead/Eval ";
   59.22  (* ERROR: error in kernel ?? *)
   59.23   CalcTree
   59.24       [(["equality (1+-1*2+x=(0::real))", "solveFor x","solutions L"],
   59.25 @@ -510,7 +510,7 @@
   59.26   autoCalculate 1 CompleteCalc; 
   59.27   val ((pt,p),_) = get_calc 1;
   59.28   if p=([], Res) then () else 
   59.29 - error "FE-interface.sml: diff.behav. in solve_linear AUTOC Head/Num_Calc ";
   59.30 + error "FE-interface.sml: diff.behav. in solve_linear AUTOC Head/Eval ";
   59.31  DEconstrCalcTree 1;
   59.32  
   59.33  "--------- mini-subpbl AUTOCALCULATE CompleteCalc -------";
    60.1 --- a/test/Tools/isac/Interpret/lucas-interpreter.sml	Wed Apr 15 11:11:54 2020 +0200
    60.2 +++ b/test/Tools/isac/Interpret/lucas-interpreter.sml	Wed Apr 15 11:37:43 2020 +0200
    60.3 @@ -371,25 +371,25 @@
    60.4          val thy' = get_obj g_domID pt (par_pblobj pt p);
    60.5  	      val ((ist, ctxt), sc) = LItool.resume_prog thy' (p,p_) pt;
    60.6  
    60.7 -val Next_Step (_, _, Rewrite_Set' ("Poly", _, Rule_Set.Seqence {id = "norm_Poly", ...}, _, _)) =
    60.8 +val Next_Step (_, _, Rewrite_Set' ("Poly", _, Rule_Set.Sequence {id = "norm_Poly", ...}, _, _)) =
    60.9             LI.find_next_step sc (pt, pos) ist ctxt (*of*);
   60.10  "~~~~~ fun find_next_step , args:"; val ((Rule.Prog prog), (ptp as(pt, (p, _))), (Pstate ist), ctxt)
   60.11    = (sc, (pt, pos), ist, ctxt);
   60.12  
   60.13 -val Accept_Tac (Rewrite_Set' ("Poly", _, Rule_Set.Seqence {id = "norm_Poly", ...}, _, _), _, _) =
   60.14 +val Accept_Tac (Rewrite_Set' ("Poly", _, Rule_Set.Sequence {id = "norm_Poly", ...}, _, _), _, _) =
   60.15    (*case*) scan_to_tactic (prog, (ptp, ctxt)) (Pstate ist) (*of*);
   60.16  "~~~~~ fun scan_to_tactic , args:"; val ((prog, cc), (Pstate (ist as {path, ...})))
   60.17    = ((prog, (ptp, ctxt)), (Pstate ist));
   60.18    (*if*) path = [] (*then*);
   60.19  
   60.20 -val Accept_Tac (Rewrite_Set' ("Poly", _, Rule_Set.Seqence {id = "norm_Poly", ...}, _, _), _, _) =
   60.21 +val Accept_Tac (Rewrite_Set' ("Poly", _, Rule_Set.Sequence {id = "norm_Poly", ...}, _, _), _, _) =
   60.22              scan_dn cc (trans_scan_dn ist) (Program.body_of prog);
   60.23  "~~~~~ fun scan_dn , args:"; val ((cc as (_, ctxt)), (ist as {eval, ...}), t)
   60.24    = (cc, (trans_scan_dn ist), (Program.body_of prog));
   60.25      (*if*) Tactical.contained_in t (*else*);
   60.26        val (Program.Tac prog_tac, form_arg) = (*case*) LItool.check_leaf "next  " ctxt eval (get_subst ist) t (*of*);
   60.27  
   60.28 -val Accept_Tac (Rewrite_Set' ("Poly", _, Rule_Set.Seqence {id = "norm_Poly", ...}, _, _), _, _) =
   60.29 +val Accept_Tac (Rewrite_Set' ("Poly", _, Rule_Set.Sequence {id = "norm_Poly", ...}, _, _), _, _) =
   60.30            check_tac cc ist (prog_tac, form_arg)  (*return from xxx*);
   60.31  "~~~~~ from fun scan_dn\<longrightarrow>fun scan_to_tactic\<longrightarrow>fun find_next_step, return:"; val (Accept_Tac (tac, ist, ctxt))
   60.32    = (check_tac cc ist (prog_tac, form_arg));
    61.1 --- a/test/Tools/isac/Interpret/rewtools.sml	Wed Apr 15 11:11:54 2020 +0200
    61.2 +++ b/test/Tools/isac/Interpret/rewtools.sml	Wed Apr 15 11:37:43 2020 +0200
    61.3 @@ -353,13 +353,13 @@
    61.4  if Rtools.contains_rule r1 Test_simplify then ()
    61.5  else error "rewtools.sml Rtools.contains_rule Thm";
    61.6  
    61.7 -val r1 = Num_Calc ("Groups.plus_class.plus", eval_binop "#add_");
    61.8 +val r1 = Eval ("Groups.plus_class.plus", eval_binop "#add_");
    61.9  if Rtools.contains_rule r1 Test_simplify then ()
   61.10 -else error "rewtools.sml Rtools.contains_rule Num_Calc";
   61.11 +else error "rewtools.sml Rtools.contains_rule Eval";
   61.12  
   61.13 -val r1 = Num_Calc ("Groups.minus_class.minus", eval_binop "#add_");
   61.14 +val r1 = Eval ("Groups.minus_class.minus", eval_binop "#add_");
   61.15  if not (Rtools.contains_rule r1 Test_simplify) then ()
   61.16 -else error "rewtools.sml Rtools.contains_rule Num_Calc";
   61.17 +else error "rewtools.sml Rtools.contains_rule Eval";
   61.18  
   61.19  "----------- build fun get_bdv_subst --------------------------------";
   61.20  "----------- build fun get_bdv_subst --------------------------------";
    62.1 --- a/test/Tools/isac/Knowledge/biegelinie-1.sml	Wed Apr 15 11:11:54 2020 +0200
    62.2 +++ b/test/Tools/isac/Knowledge/biegelinie-1.sml	Wed Apr 15 11:37:43 2020 +0200
    62.3 @@ -56,19 +56,19 @@
    62.4  		rew_ord = ("termlessI",termlessI), 
    62.5  		erls = Rule_Set.append_rules "erls_in_srls_IntegrierenUnd.." Rule_Set.empty
    62.6  				  [(*for asm in NTH_CONS ...*)
    62.7 -				   Num_Calc ("Orderings.ord_class.less",eval_equ "#less_"),
    62.8 +				   Eval ("Orderings.ord_class.less",eval_equ "#less_"),
    62.9  				   (*2nd NTH_CONS pushes n+-1 into asms*)
   62.10 -				   Num_Calc("Groups.plus_class.plus", eval_binop "#add_")
   62.11 +				   Eval("Groups.plus_class.plus", eval_binop "#add_")
   62.12  				   ], 
   62.13  		srls = Rule_Set.Empty, calc = [], errpatts = [],
   62.14  		rules = [Thm ("NTH_CONS",ThmC.numerals_to_Free @{thm NTH_CONS}),
   62.15 -			 Num_Calc("Groups.plus_class.plus", eval_binop "#add_"),
   62.16 +			 Eval("Groups.plus_class.plus", eval_binop "#add_"),
   62.17  			 Thm ("NTH_NIL",ThmC.numerals_to_Free @{thm NTH_NIL}),
   62.18 -			 Num_Calc("Prog_Expr.lhs", eval_lhs "eval_lhs_"),
   62.19 -			 Num_Calc("Prog_Expr.rhs", eval_rhs "eval_rhs_"),
   62.20 -			 Num_Calc("Prog_Expr.argument'_in", eval_argument_in "Prog_Expr.argument'_in")
   62.21 +			 Eval("Prog_Expr.lhs", eval_lhs "eval_lhs_"),
   62.22 +			 Eval("Prog_Expr.rhs", eval_rhs "eval_rhs_"),
   62.23 +			 Eval("Prog_Expr.argument'_in", eval_argument_in "Prog_Expr.argument'_in")
   62.24  			 ],
   62.25 -		scr = EmptyScr};
   62.26 +		scr = Empty_Prog};
   62.27  val rm_ = str2term"[M_b 0 = 0, M_b L = 0]";
   62.28  val M__ = str2term"M_b x = -1 * x ^^^ 2 / 2 + x * c + c_2";
   62.29  val SOME (e1__,_) = rewrite_set_ thy false srls 
    63.1 --- a/test/Tools/isac/Knowledge/eqsystem.sml	Wed Apr 15 11:11:54 2020 +0200
    63.2 +++ b/test/Tools/isac/Knowledge/eqsystem.sml	Wed Apr 15 11:37:43 2020 +0200
    63.3 @@ -85,8 +85,8 @@
    63.4  val testrls = Rule_Set.append_rules "testrls" Rule_Set.empty 
    63.5  			 [(Thm ("LENGTH_NIL",ThmC.numerals_to_Free @{thm LENGTH_NIL})),
    63.6  			  (Thm ("LENGTH_CONS",ThmC.numerals_to_Free @{thm LENGTH_CONS})),
    63.7 -			  Num_Calc ("Groups.plus_class.plus", eval_binop "#add_"),
    63.8 -			  Num_Calc ("HOL.eq",eval_equal "#equal_")
    63.9 +			  Eval ("Groups.plus_class.plus", eval_binop "#add_"),
   63.10 +			  Eval ("HOL.eq",eval_equal "#equal_")
   63.11  			  ];
   63.12  val SOME (t',_) = rewrite_set_ thy false testrls t;
   63.13  if UnparseC.term t' = "True" then () 
   63.14 @@ -109,7 +109,7 @@
   63.15  			      Thm ("NTH_NIL",ThmC.numerals_to_Free @{thm NTH_NIL}),
   63.16  			      Thm ("TL_CONS",ThmC.numerals_to_Free @{thm tl_Cons}),
   63.17  			      Thm ("TL_NIL",ThmC.numerals_to_Free @{thm tl_Nil}),
   63.18 -			      Num_Calc ("EqSystem.occur'_exactly'_in", eval_occur_exactly_in "#eval_occur_exactly_in_")
   63.19 +			      Eval ("EqSystem.occur'_exactly'_in", eval_occur_exactly_in "#eval_occur_exactly_in_")
   63.20  			      ]) t;
   63.21  if t = @{term True} then () 
   63.22  else error "eqsystem.sml ..occur_exactly_in (nth_ 1 [c_4..";
   63.23 @@ -371,7 +371,7 @@
   63.24  #####  try calc: op <'
   63.25  ###  asms accepted: ["1 < 2 + - 1"]   stored: ["1 < 2 + -1"]
   63.26  
   63.27 -... i.e Num_Calc ("Groups.plus_class.plus", eval_binop "#add_") was missing in erls_prls_triangular*)
   63.28 +... i.e Eval ("Groups.plus_class.plus", eval_binop "#add_") was missing in erls_prls_triangular*)
   63.29  trace_rewrite:=false;
   63.30  
   63.31  "===== case 3: relaxed preconditions for triangular system =====";
    64.1 --- a/test/Tools/isac/Knowledge/integrate.sml	Wed Apr 15 11:11:54 2020 +0200
    64.2 +++ b/test/Tools/isac/Knowledge/integrate.sml	Wed Apr 15 11:37:43 2020 +0200
    64.3 @@ -36,11 +36,11 @@
    64.4      erls = Rule_Set.Empty, 
    64.5      srls = Rule_Set.Empty, calc = [], errpatts = [],
    64.6      rules = [(*for rewriting conditions in Thm's*)
    64.7 -	    Num_Calc ("Prog_Expr.occurs'_in", 
    64.8 +	    Eval ("Prog_Expr.occurs'_in", 
    64.9  		  eval_occurs_in "#occurs_in_"),
   64.10  	    Thm ("not_true",ThmC.numerals_to_Free @{thm not_true}),
   64.11  	    Thm ("not_false",ThmC.numerals_to_Free @{thm not_false})],
   64.12 -    scr = EmptyScr};
   64.13 +    scr = Empty_Prog};
   64.14  val subs = [(str2t "bdv::real", str2t "x::real")];
   64.15  fun rewrit thm str = 
   64.16      fst (the (rewrite_inst_ thy tless_true 
   64.17 @@ -146,13 +146,13 @@
   64.18       rew_ord = ("termlessI",termlessI), 
   64.19       erls = Rule_Set.Empty, 
   64.20       srls = Rule_Set.Empty, calc = [], errpatts = [],
   64.21 -     rules = [Num_Calc ("Prog_Expr.matches",eval_matches ""),
   64.22 -      	Num_Calc ("Integrate.is'_f'_x", 
   64.23 +     rules = [Eval ("Prog_Expr.matches",eval_matches ""),
   64.24 +      	Eval ("Integrate.is'_f'_x", 
   64.25        	      eval_is_f_x "is_f_x_"),
   64.26        	Thm ("not_true",ThmC.numerals_to_Free @{thm not_true}),
   64.27        	Thm ("not_false",ThmC.numerals_to_Free @{thm not_false})
   64.28        	],
   64.29 -     scr = EmptyScr};
   64.30 +     scr = Empty_Prog};
   64.31  fun rewrit thm t = 
   64.32      fst (the (rewrite_inst_ thy tless_true 
   64.33  			    conditions_in_integration true subs thm t));
    65.1 --- a/test/Tools/isac/Knowledge/partial_fractions.sml	Wed Apr 15 11:11:54 2020 +0200
    65.2 +++ b/test/Tools/isac/Knowledge/partial_fractions.sml	Wed Apr 15 11:37:43 2020 +0200
    65.3 @@ -286,7 +286,7 @@
    65.4  
    65.5  (*test for outcommented 3 lines in script: empower erls for x = a*b ==> ...*)
    65.6  val xxx = Rule_Set.append_rules "multiply_ansatz_erls" norm_Rational 
    65.7 -  [Num_Calc ("HOL.eq",eval_equal "#equal_")];
    65.8 +  [Eval ("HOL.eq",eval_equal "#equal_")];
    65.9  
   65.10  val multiply_ansatz = prep_rls @{theory} (
   65.11    Rule_Set.Repeat {id = "multiply_ansatz", preconds = [], rew_ord = ("dummy_ord",dummy_ord), 
   65.12 @@ -295,7 +295,7 @@
   65.13  	  rules = 
   65.14  	   [Thm ("multiply_2nd_order",ThmC.numerals_to_Free @{thm multiply_2nd_order})
   65.15  	   ], 
   65.16 -	 scr = EmptyScr}:rls);
   65.17 +	 scr = Empty_Prog}:rls);
   65.18  
   65.19  rewrite_set_ thy true xxx @{term "a+b = a+(b::real)"}; (*SOME ok*)
   65.20  rewrite_set_ thy true multiply_ansatz @{term "a+b = a+(b::real)"}; (*why NONE?*)
    66.1 --- a/test/Tools/isac/Knowledge/polyminus.sml	Wed Apr 15 11:11:54 2020 +0200
    66.2 +++ b/test/Tools/isac/Knowledge/polyminus.sml	Wed Apr 15 11:37:43 2020 +0200
    66.3 @@ -567,8 +567,8 @@
    66.4  
    66.5  "--- does the respective prls rewrite ?";
    66.6  val prls = Rule_Set.append_rules "prls_pbl_vereinf_poly" Rule_Set.empty 
    66.7 -	     [Num_Calc ("Poly.is'_polyexp", eval_is_polyexp ""),
    66.8 -	      Num_Calc ("Prog_Expr.matchsub", eval_matchsub ""),
    66.9 +	     [Eval ("Poly.is'_polyexp", eval_is_polyexp ""),
   66.10 +	      Eval ("Prog_Expr.matchsub", eval_matchsub ""),
   66.11  	      Thm ("or_true",@{thm or_true}),
   66.12  	      (*"(?a | True) = True"*)
   66.13  	      Thm ("or_false",@{thm or_false}),
    67.1 --- a/test/Tools/isac/Knowledge/rootrat.sml	Wed Apr 15 11:11:54 2020 +0200
    67.2 +++ b/test/Tools/isac/Knowledge/rootrat.sml	Wed Apr 15 11:37:43 2020 +0200
    67.3 @@ -33,10 +33,10 @@
    67.4  (*val rls = assoc_rls "calculate_Poly"; WAS ME_Isa: 'calculate_Poly' not in system
    67.5  goon with what just started ...*)
    67.6  val calculate_Poly = Rule_Set.append_rules "calculate_Poly" Rule_Set.empty
    67.7 -	  [ Num_Calc ("Groups.plus_class.plus",eval_binop "#add_"),
    67.8 -		    Num_Calc ("Groups.minus_class.minus",eval_binop "#sub_"),
    67.9 -		    Num_Calc ("Groups.times_class.times",eval_binop "#mult_"),
   67.10 -		    Num_Calc ("Prog_Expr.pow" ,eval_binop "#power_")
   67.11 +	  [ Eval ("Groups.plus_class.plus",eval_binop "#add_"),
   67.12 +		    Eval ("Groups.minus_class.minus",eval_binop "#sub_"),
   67.13 +		    Eval ("Groups.times_class.times",eval_binop "#mult_"),
   67.14 +		    Eval ("Prog_Expr.pow" ,eval_binop "#power_")
   67.15    ];
   67.16  val rls = calculate_Poly;
   67.17  
    68.1 --- a/test/Tools/isac/MathEngBasic/rewrite.sml	Wed Apr 15 11:11:54 2020 +0200
    68.2 +++ b/test/Tools/isac/MathEngBasic/rewrite.sml	Wed Apr 15 11:37:43 2020 +0200
    68.3 @@ -238,7 +238,7 @@
    68.4  val SOME (t,_) = 
    68.5      rewrite_inst_ thy e_rew_ord 
    68.6  		  (Rule_Set.append_rules "erls_isolate_bdvs" Rule_Set.empty 
    68.7 -			      [(Num_Calc ("EqSystem.occur'_exactly'_in", 
    68.8 +			      [(Eval ("EqSystem.occur'_exactly'_in", 
    68.9  				      eval_occur_exactly_in 
   68.10  					  "#eval_occur_exactly_in_"))
   68.11  			       ]) 
   68.12 @@ -310,7 +310,7 @@
   68.13  val thm = @{thm rat_mult_poly_r};
   68.14           "?c::real is_polyexp ==> (?a::real) / (?b::real) * ?c = ?a * ?c / ?b";
   68.15  val erls = Rule_Set.append_rules "Rule_Set.empty-is_polyexp" Rule_Set.empty 
   68.16 -                      [Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")];
   68.17 +                      [Eval ("Poly.is'_polyexp", eval_is_polyexp "")];
   68.18  val NONE (*SOME (t'', _)*) = rewrite_ thy dummy_ord erls true thm t;
   68.19  (*t' = t''; (*false because of further rewrites in t'*)*)
   68.20  "----- rew_sub  --------------------------------";
   68.21 @@ -395,7 +395,7 @@
   68.22  val pres = [parse_patt thy "?p is_multUnordered"];
   68.23  val prepat = [(pres, pat)];
   68.24  val erls = Rule_Set.append_rules "Rule_Set.empty-is_multUnordered" Rule_Set.empty
   68.25 -		      [Num_Calc ("Poly.is'_multUnordered", 
   68.26 +		      [Eval ("Poly.is'_multUnordered", 
   68.27                               eval_is_multUnordered "")];
   68.28  
   68.29  val subst = Pattern.match thy (pat, t) (Vartab.empty, Vartab.empty);
   68.30 @@ -529,7 +529,7 @@
   68.31        fun rew_once _ asm ct Noap [] = (ct, asm) (* ?TODO unify with Prog_Expr.rew_once? *)
   68.32          | rew_once ruls asm ct Appl [] = 
   68.33            (case rls of Rule_Set.Repeat _ => rew_once ruls asm ct Noap ruls
   68.34 -          | Rule_Set.Seqence _ => (ct, asm)
   68.35 +          | Rule_Set.Sequence _ => (ct, asm)
   68.36            | rls => raise ERROR ("rew_once not appl. to \"" ^ Rule_Set.id rls ^ "\""))
   68.37          | rew_once ruls asm ct apno (rul :: thms) =
   68.38            case rul of
   68.39 @@ -542,10 +542,10 @@
   68.40                  (trace1 i (" rewrites to: " ^ UnparseC.term_in_thy thy ct');
   68.41                  rew_once ruls (union (op =) asm asm') ct' Appl (rul :: thms)))
   68.42                  (* once again try the same rule, e.g. associativity against "()"*)
   68.43 -          | Rule.Num_Calc (cc as (op_, _)) => 
   68.44 +          | Rule.Eval (cc as (op_, _)) => 
   68.45              let val _= trace1 i (" try calc: " ^ op_ ^ "'")
   68.46                val ct = TermC.uminus_to_string ct (*WN190312: superfluous?*)
   68.47 -            in case Num_Calc.adhoc_thm thy cc ct of
   68.48 +            in case Eval.adhoc_thm thy cc ct of
   68.49                  NONE => rew_once ruls asm ct apno thms
   68.50                | SOME (_, thm') => 
   68.51                  let 
   68.52 @@ -559,7 +559,7 @@
   68.53            | Rule.Cal1 (cc as (op_, _)) => 
   68.54              let val _= trace1 i (" try cal1: " ^ op_ ^ "'");
   68.55                val ct = TermC.uminus_to_string ct
   68.56 -            in case Num_Calc.adhoc_thm1_ thy cc ct of
   68.57 +            in case Eval.adhoc_thm1_ thy cc ct of
   68.58                  NONE => (ct, asm)
   68.59                | SOME (_, thm') =>
   68.60                  let 
   68.61 @@ -591,10 +591,10 @@
   68.62  
   68.63      val (t', asms, _ (*lrd*), rew) =
   68.64             rew_sub thy i bdv tless rls put_asm ([(*root of the term*)]: TermC.path)
   68.65 -		  (((TermC.inst_bdv bdv) o Num_Calc.norm o #prop o Thm.rep_thm) thm) ct;
   68.66 +		  (((TermC.inst_bdv bdv) o Eval.norm o #prop o Thm.rep_thm) thm) ct;
   68.67  "~~~~~ and rew_sub , args:"; val (thy, i, bdv, tless, rls, put_asm, lrd, r, t)
   68.68    = (thy, i, bdv, tless, rls, put_asm, ([(*root of the term*)]: TermC.path),
   68.69 -		  (((TermC.inst_bdv bdv) o Num_Calc.norm o #prop o Thm.rep_thm) thm), ct);
   68.70 +		  (((TermC.inst_bdv bdv) o Eval.norm o #prop o Thm.rep_thm) thm), ct);
   68.71      val (lhs, rhs) = (HOLogic.dest_eq o HOLogic.dest_Trueprop o Logic.strip_imp_concl) r
   68.72      val r' = Envir.subst_term (Pattern.match thy (lhs, t) (Vartab.empty, Vartab.empty)) r
   68.73  ;
   68.74 @@ -641,15 +641,15 @@
   68.75  
   68.76  (*+*)val Rule_Set.Repeat {id = "rateq_erls", rules, ...} = rls;
   68.77  (*+*)(*val rules =
   68.78 -(*+*)   [Num_Calc ("Rings.divide_class.divide", fn),
   68.79 +(*+*)   [Eval ("Rings.divide_class.divide", fn),
   68.80  (*+*)    Thm ("minus_divide_left", "- ?a1 / ?b1 = - (?a1 / ?b1)"),
   68.81  (*+*)    :
   68.82 -(*+*)    Num_Calc ("HOL.eq", fn),
   68.83 +(*+*)    Eval ("HOL.eq", fn),
   68.84  (*+*)    Thm ("not_true", "(\<not> True) = False"),
   68.85  (*+*)    Thm ("not_false", "(\<not> False) = True"),
   68.86  (*+*)    :
   68.87 -(*+*)    Num_Calc ("Prog_Expr.pow", fn),
   68.88 -(*+*)    Num_Calc ("RatEq.is'_ratequation'_in", fn)]:
   68.89 +(*+*)    Eval ("Prog_Expr.pow", fn),
   68.90 +(*+*)    Eval ("RatEq.is'_ratequation'_in", fn)]:
   68.91  (*+*)   rule list*)
   68.92  (*+*)chk: term list -> term list -> term list * bool
   68.93  
    69.1 --- a/test/Tools/isac/Minisubpbl/200-start-method-NEXT_STEP.sml	Wed Apr 15 11:11:54 2020 +0200
    69.2 +++ b/test/Tools/isac/Minisubpbl/200-start-method-NEXT_STEP.sml	Wed Apr 15 11:37:43 2020 +0200
    69.3 @@ -49,7 +49,7 @@
    69.4  (*+* )------- in f3cac3053e7b (Rule_Set.empty just renamed, NOT deleted) we had
    69.5  (*+*)  prls =
    69.6  (*+*)    Rule_Set.Repeat {calc = [], erls = Rule_Set.Empty, errpatts = [], id = "empty", preconds = [], rew_ord =
    69.7 -(*+*)      ("dummy_ord", fn), rules = [], scr = EmptyScr, srls = Rule_Set.Empty}:
    69.8 +(*+*)      ("dummy_ord", fn), rules = [], scr = Empty_Prog, srls = Rule_Set.Empty}:
    69.9  (*+*).. THIS IS Rule_Set.empty, BUT IT DID not CAUSE ANY ERROR !
   69.10  (*+*)------- WITH Rule_Set.empty REMOVED (based on f3cac3053e7b) we had
   69.11  (*+*)val Empty = prls (* <---ERROR: rewrite__set_ called with 'Rule_Set.Empty' for 'precond_rootpbl x' *)
    70.1 --- a/test/Tools/isac/OLDTESTS/script_if.sml	Wed Apr 15 11:11:54 2020 +0200
    70.2 +++ b/test/Tools/isac/OLDTESTS/script_if.sml	Wed Apr 15 11:37:43 2020 +0200
    70.3 @@ -61,7 +61,7 @@
    70.4          [("#Given" ,["equality e_e","solveFor v_v"]),
    70.5            ("#Where" ,["is_rootequation_in (e_e::bool) (v_::real)"]),
    70.6            ("#Find"  ,["solutions v_i_"])],
    70.7 -        Rule_Set.append_rules Rule_Set.empty [Num_Calc ("Test.is'_rootequation'_in", eval_is_rootequation_in "")],
    70.8 +        Rule_Set.append_rules Rule_Set.empty [Eval ("Test.is'_rootequation'_in", eval_is_rootequation_in "")],
    70.9          [("Test","methode")])]
   70.10    thy;
   70.11  
   70.12 @@ -73,7 +73,7 @@
   70.13          [("#Given", ["equality e_e","solveFor v_v","errorBound err_"]),
   70.14            ("#Where", ["matches (?a = ?b) e_e"]),
   70.15            ("#Find", ["solutions v_i_"])],
   70.16 -        Rule_Set.append_rules Rule_Set.empty [Num_Calc ("Prog_Expr.matches",eval_matches "#matches_")], [])]
   70.17 +        Rule_Set.append_rules Rule_Set.empty [Eval ("Prog_Expr.matches",eval_matches "#matches_")], [])]
   70.18    thy;
   70.19  
   70.20  methods:= overwritel (!methods,
    71.1 --- a/test/Tools/isac/OLDTESTS/scriptnew.sml	Wed Apr 15 11:11:54 2020 +0200
    71.2 +++ b/test/Tools/isac/OLDTESTS/scriptnew.sml	Wed Apr 15 11:37:43 2020 +0200
    71.3 @@ -106,7 +106,7 @@
    71.4     ],
    71.5     {rew_ord'="tless_true",rls'=tval_rls,
    71.6      srls=Rule_Set.append_rules "testeq1_srls" Rule_Set.empty 
    71.7 -		    [Num_Calc ("Test.contains'_root", eval_contains_root"")],
    71.8 +		    [Eval ("Test.contains'_root", eval_contains_root"")],
    71.9      prls=Rule_Set.empty,calc=[], crls=tval_rls, errpats = [], nrls=Rule_Set.empty
   71.10  		  (*,asm_rls=[],asm_thm=[("square_equation_left","")]*)},
   71.11   "Program Testeq (e_e::bool) =                                        \
   71.12 @@ -164,7 +164,7 @@
   71.13     ],
   71.14     {rew_ord'="tless_true",rls'=tval_rls,
   71.15      srls=Rule_Set.append_rules "testlet_srls" Rule_Set.empty 
   71.16 -		    [Num_Calc ("Test.contains'_root",eval_contains_root"")],
   71.17 +		    [Eval ("Test.contains'_root",eval_contains_root"")],
   71.18      prls=Rule_Set.empty,calc=[], crls=tval_rls, errpats = [], nrls=Rule_Set.empty
   71.19  		  (*,asm_rls=[],asm_thm=[("square_equation_left","")]*)},
   71.20     "Program Testeq2 (e_e::bool) =                                        \
    72.1 --- a/test/Tools/isac/ProgLang/auto_prog.sml	Wed Apr 15 11:11:54 2020 +0200
    72.2 +++ b/test/Tools/isac/ProgLang/auto_prog.sml	Wed Apr 15 11:37:43 2020 +0200
    72.3 @@ -33,7 +33,7 @@
    72.4  "~~~~~ fun generate , args:"; val (thy, t, rls) = (thy', t, rls);
    72.5      val prog = case rls of
    72.6  	      Rule_Set.Repeat {rules, ...} => rules2scr_Rls thy rules
    72.7 -	    | Rule_Set.Seqence {rules, ...} => rules2scr_Seq thy rules
    72.8 +	    | Rule_Set.Sequence {rules, ...} => rules2scr_Seq thy rules
    72.9      val auto_script = subst_typs prog (type_of t) (TermC.guess_bdv_typ t) (*return from generate*);
   72.10  
   72.11  if UnparseC.term auto_script =
   72.12 @@ -115,7 +115,7 @@
   72.13  (*if*) (not o is_interpos) ip = false;
   72.14  val ip' = lev_pred' pt ip;
   72.15  
   72.16 -(*Detail_Step.go pt ip      ..ERROR interSteps>..>init_istate: "norm_Poly" has EmptyScr*)
   72.17 +(*Detail_Step.go pt ip      ..ERROR interSteps>..>init_istate: "norm_Poly" has Empty_Prog*)
   72.18  val ("donesteps", ctree_BEFORE_step_into, pos'_BEFORE_step_into) = Detail_Step.go pt ip;
   72.19  "~~~~~ fun go, args:"; val (pt, (pos as (p, _))) = (pt, ip);
   72.20      val nd = Ctree.get_nd pt p
   72.21 @@ -246,9 +246,9 @@
   72.22  if UnparseC.term t = "Try (Repeat (Rewrite ''real_diff_minus''))" then ()
   72.23  else error "rule2stac Thm.. changed";
   72.24  
   72.25 -val t = rule2stac @{theory} (Num_Calc ("Groups.plus_class.plus", eval_binop "#add_"));
   72.26 +val t = rule2stac @{theory} (Eval ("Groups.plus_class.plus", eval_binop "#add_"));
   72.27  if UnparseC.term t = "Try (Repeat (Calculate ''PLUS''))" then ()
   72.28 -else error "rule2stac Num_Calc.. changed";
   72.29 +else error "rule2stac Eval.. changed";
   72.30  
   72.31  val t = rule2stac @{theory} (Rls_ rearrange_assoc);
   72.32  if UnparseC.term t = "Try (Rewrite_Set ''rearrange_assoc'')" then ()
    73.1 --- a/test/Tools/isac/ProgLang/prog_expr.sml	Wed Apr 15 11:11:54 2020 +0200
    73.2 +++ b/test/Tools/isac/ProgLang/prog_expr.sml	Wed Apr 15 11:37:43 2020 +0200
    73.3 @@ -232,7 +232,7 @@
    73.4  
    73.5  trace_rewrite := false;
    73.6  val srls_ = Rule_Set.append_rules "srls_..Berechnung-erstSymbolisch" Rule_Set.empty 
    73.7 -		      [Num_Calc ("Prog_Expr.boollist2sum", eval_boollist2sum "")];
    73.8 +		      [Eval ("Prog_Expr.boollist2sum", eval_boollist2sum "")];
    73.9  val t = str2t 
   73.10         "boollist2sum [b1 = k - 2*q, b2 = k - 2*q, b3 = k - 2*q, b4 = k - 2*q]";
   73.11  case rewrite_set_ thy false srls_ t of SOME _ => ()
    74.1 --- a/test/Tools/isac/Test_Isac.thy	Wed Apr 15 11:11:54 2020 +0200
    74.2 +++ b/test/Tools/isac/Test_Isac.thy	Wed Apr 15 11:37:43 2020 +0200
    74.3 @@ -124,7 +124,7 @@
    74.4    open Tactic;                 (* NONE *)
    74.5    open Model;                  (* NONE *)
    74.6    open Rewrite;                mk_thm;
    74.7 -  open Num_Calc;                   get_pair;
    74.8 +  open Eval;                   get_pair;
    74.9    open TermC;                  atomt;
   74.10    open Celem;                  e_pbt;
   74.11    open Rule;
    75.1 --- a/test/Tools/isac/Test_Isac_Short.thy	Wed Apr 15 11:11:54 2020 +0200
    75.2 +++ b/test/Tools/isac/Test_Isac_Short.thy	Wed Apr 15 11:37:43 2020 +0200
    75.3 @@ -124,11 +124,11 @@
    75.4    open Tactic;                 (* NONE *)
    75.5    open Model;                  (* NONE *)
    75.6    open Rewrite;
    75.7 -  open Num_Calc;                   get_pair;
    75.8 +  open Eval;                   get_pair;
    75.9    open TermC;                  atomt;
   75.10    open Celem;                  e_pbt;
   75.11    open Rule;
   75.12 -  open Rule_Set
   75.13 +  open Rule_Set;               Sequence;
   75.14    open Exec_Def
   75.15    open ThyC
   75.16    open ThmC_Def
    76.1 --- a/test/Tools/isac/Test_Some.thy	Wed Apr 15 11:11:54 2020 +0200
    76.2 +++ b/test/Tools/isac/Test_Some.thy	Wed Apr 15 11:37:43 2020 +0200
    76.3 @@ -44,7 +44,7 @@
    76.4    open Tactic;                 (* NONE *)
    76.5    open Model;                  (* NONE *)
    76.6    open Rewrite;
    76.7 -  open Num_Calc;               get_pair;
    76.8 +  open Eval;                   get_pair;
    76.9    open TermC;                  atomt;
   76.10    open Celem;                  e_pbt;
   76.11    open Rule;
    77.1 --- a/test/Tools/isac/Test_Some_meld.thy	Wed Apr 15 11:11:54 2020 +0200
    77.2 +++ b/test/Tools/isac/Test_Some_meld.thy	Wed Apr 15 11:37:43 2020 +0200
    77.3 @@ -31,7 +31,7 @@
    77.4    open Tactic;                 (* NONE *)
    77.5    open Model;                  (* NONE *)
    77.6    open Rewrite;                mk_thm;
    77.7 -  open Num_Calc;                   get_pair;
    77.8 +  open Eval;                   get_pair;
    77.9    open TermC;                  atomt;
   77.10    open Celem;                  e_pbt;
   77.11    open Rule;                   ThmC.string_of_thm;