use new struct "Rule_Set" for renaming identifiers
authorWalther Neuper <walther.neuper@jku.at>
Wed, 08 Apr 2020 12:32:51 +0200
changeset 59852ea7e6679080e
parent 59851 4dd533681fef
child 59853 e18f30c44998
use new struct "Rule_Set" for renaming identifiers
src/Tools/isac/BridgeLibisabelle/datatypes.sml
src/Tools/isac/BridgeLibisabelle/pbl-met-hierarchy.sml
src/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml
src/Tools/isac/Build_Isac.thy
src/Tools/isac/CalcElements/KEStore.thy
src/Tools/isac/CalcElements/calcelems.sml
src/Tools/isac/CalcElements/rule-set.sml
src/Tools/isac/CalcElements/rule.sml
src/Tools/isac/Interpret/error-pattern.sml
src/Tools/isac/Interpret/lucas-interpreter.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.thy
src/Tools/isac/Knowledge/DiophantEq.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/LogExp.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/Simplify.thy
src/Tools/isac/Knowledge/Test.thy
src/Tools/isac/Knowledge/Test_Build_Thydata.thy
src/Tools/isac/MathEngBasic/istate-def.sml
src/Tools/isac/MathEngBasic/tactic.sml
src/Tools/isac/ProgLang/Prog_Expr.thy
src/Tools/isac/ProgLang/rewrite.sml
src/Tools/isac/TODO.thy
test/Tools/isac/ADDTESTS/accumulate-val/Lucas_Interpreter.thy
test/Tools/isac/ADDTESTS/accumulate-val/Thy_2.thy
test/Tools/isac/ADDTESTS/accumulate-val/Thy_2b.thy
test/Tools/isac/ADDTESTS/accumulate-val/Thy_3.thy
test/Tools/isac/ADDTESTS/accumulate-val/lucas_interpreter.sml
test/Tools/isac/ADDTESTS/course/CADGME/example_2.thy
test/Tools/isac/ADDTESTS/course/SignalProcess/Build_Inverse_Z_Transform.thy
test/Tools/isac/BridgeLibisabelle/datatypes.sml
test/Tools/isac/BridgeLibisabelle/pbl-met-hierarchy.sml
test/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml
test/Tools/isac/BridgeLibisabelle/use-cases.sml
test/Tools/isac/CalcElements/calcelems.sml
test/Tools/isac/CalcElements/kestore.sml
test/Tools/isac/CalcElements/libraryC.sml
test/Tools/isac/Interpret/error-pattern.sml
test/Tools/isac/Interpret/lucas-interpreter.sml
test/Tools/isac/Interpret/ptyps.thy
test/Tools/isac/Interpret/rewtools.sml
test/Tools/isac/Knowledge/biegelinie-1.sml
test/Tools/isac/Knowledge/biegelinie-4.sml
test/Tools/isac/Knowledge/diophanteq.sml
test/Tools/isac/Knowledge/eqsystem.sml
test/Tools/isac/Knowledge/integrate.sml
test/Tools/isac/Knowledge/integrate.thy
test/Tools/isac/Knowledge/partial_fractions.sml
test/Tools/isac/Knowledge/poly.sml
test/Tools/isac/Knowledge/polyeq-1.sml
test/Tools/isac/Knowledge/polyeq-2.sml
test/Tools/isac/Knowledge/polyminus.sml
test/Tools/isac/Knowledge/rateq.sml
test/Tools/isac/Knowledge/rational-old.sml
test/Tools/isac/Knowledge/rational.sml
test/Tools/isac/Knowledge/rootrat.sml
test/Tools/isac/MathEngBasic/tactic.sml
test/Tools/isac/MathEngine/mathengine-stateless.sml
test/Tools/isac/MathEngine/step.sml
test/Tools/isac/Minisubpbl/200-start-method-NEXT_STEP.sml
test/Tools/isac/Minisubpbl/600-postcond-NEXT_STEP.sml
test/Tools/isac/Minisubpbl/800-append-on-Frm.sml
test/Tools/isac/OLDTESTS/root-equ.sml
test/Tools/isac/OLDTESTS/script.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/calculate.sml
test/Tools/isac/ProgLang/calculate.thy
test/Tools/isac/ProgLang/prog_expr.sml
test/Tools/isac/ProgLang/rewrite.sml
test/Tools/isac/Specify/appl.sml
     1.1 --- a/src/Tools/isac/BridgeLibisabelle/datatypes.sml	Mon Apr 06 11:44:36 2020 +0200
     1.2 +++ b/src/Tools/isac/BridgeLibisabelle/datatypes.sml	Wed Apr 08 12:32:51 2020 +0200
     1.3 @@ -6,8 +6,8 @@
     1.4  signature DATATYPES = (*TODO: redo with xml_of/to *)
     1.5    sig
     1.6      val authors2xml : int -> string -> string list -> Celem.xml
     1.7 -    val calc2xml : int -> Rule.thyID * Rule_Set.calc -> Celem.xml
     1.8 -    val calcrefs2xml : int -> Rule.thyID * Rule_Set.calc list -> Celem.xml
     1.9 +    val calc2xml : int -> Rule.thyID * Rule_Def.calc -> Celem.xml
    1.10 +    val calcrefs2xml : int -> Rule.thyID * Rule_Def.calc list -> Celem.xml
    1.11      val contthy2xml : int -> Rtools.contthy -> Celem.xml
    1.12      val extref2xml : int -> string -> string -> Celem.xml
    1.13      val filterpbl :
    1.14 @@ -112,7 +112,7 @@
    1.15  *)
    1.16    | rule2xml _ _ (Rule.Cal1 (_(*termop*), _)) = ""
    1.17    | rule2xml j thyID (Rule.Rls_ rls) =
    1.18 -      let val rls' = (#id o Rule_Set.rep_rls) rls
    1.19 +      let val rls' = (#id o Rule_Set.rep) rls
    1.20        in
    1.21          indt j ^ "<RULE>\n" ^
    1.22          indt (j+i) ^ "<TAG> Ruleset </TAG>\n" ^
    1.23 @@ -257,7 +257,7 @@
    1.24      calcrefs2xml (j+i) (thyID, calc) ^
    1.25      scr2xml (j+i) scr ^
    1.26      indt j ^"</RULESET>\n";
    1.27 -fun rls2xml j (thyID, Rule_Set.Empty) = rls2xml j (thyID, Rule_Set.e_rls)
    1.28 +fun rls2xml j (thyID, Rule_Set.Empty) = rls2xml j (thyID, Rule_Set.empty)
    1.29    | rls2xml j (thyID, Rule_Def.Repeat data) = rls2xm j (thyID, "Rls", data)
    1.30    | rls2xml j (thyID, Rule_Set.Seqence data) = rls2xm j (thyID, "Seq", data)
    1.31    | rls2xml j (thyID, Rule_Set.Rrls {id, prepat, rew_ord=(ord,_), erls, calc, errpatts, scr}) = 
     2.1 --- a/src/Tools/isac/BridgeLibisabelle/pbl-met-hierarchy.sml	Mon Apr 06 11:44:36 2020 +0200
     2.2 +++ b/src/Tools/isac/BridgeLibisabelle/pbl-met-hierarchy.sml	Wed Apr 08 12:32:51 2020 +0200
     2.3 @@ -118,7 +118,7 @@
     2.4  fun pbl2xml (id:(*pblRD*)Celem.pblID) ({guh,mathauthors,init,cas,met,ppc,prls,
     2.5  			 thy,where_}:Celem.pbt) =
     2.6      let val thy' = Rule.theory2theory' thy
     2.7 -	val prls' = (#id o Rule_Set.rep_rls) prls
     2.8 +	val prls' = (#id o Rule_Set.rep) prls
     2.9      in "<NODECONTENT>\n" ^
    2.10         indt i ^ "<GUH> " ^ guh ^ " </GUH>\n" ^
    2.11         (((id2xml i)(* o rev*)) id) ^ 
    2.12 @@ -173,7 +173,7 @@
    2.13  	       | _ => (indt i) ^ "<METHODS>\n" ^
    2.14  		      foldl op^ ("", map (keref2xml (i+i) Celem.Met_) met) ^
    2.15  		      (indt i) ^ "</METHODS>\n") ^
    2.16 -    indt i ^ "<EVALPRECOND> " ^ (#id o Rule_Set.rep_rls) 
    2.17 +    indt i ^ "<EVALPRECOND> " ^ (#id o Rule_Set.rep) 
    2.18  				    prls ^ " </EVALPRECOND>\n" ^ 
    2.19      authors2xml i "MATHAUTHORS" mathauthors ^
    2.20      authors2xml i "COURSEDESIGNS" ["isac team 2006"] ^
    2.21 @@ -194,11 +194,11 @@
    2.22  fun met2xml (id: Celem.metID) ({guh,mathauthors,init,ppc,pre,scr,calc,
    2.23  			 crls,erls,errpats,nrls,prls,srls,rew_ord'}: Celem.met) =
    2.24      let val thy' = "Isac_Knowledge" (*FIXME.WN0607 get thy from met ?!?*)
    2.25 -	val crls' = (#id o Rule_Set.rep_rls) crls
    2.26 -	val erls' = (#id o Rule_Set.rep_rls) erls
    2.27 -	val nrls' = (#id o Rule_Set.rep_rls) nrls
    2.28 -	val prls' = (#id o Rule_Set.rep_rls) prls
    2.29 -	val srls' = (#id o Rule_Set.rep_rls) srls
    2.30 +	val crls' = (#id o Rule_Set.rep) crls
    2.31 +	val erls' = (#id o Rule_Set.rep) erls
    2.32 +	val nrls' = (#id o Rule_Set.rep) nrls
    2.33 +	val prls' = (#id o Rule_Set.rep) prls
    2.34 +	val srls' = (#id o Rule_Set.rep) srls
    2.35      in "<NODECONTENT>\n" ^
    2.36         indt i ^ "<GUH> " ^ guh ^ " </GUH>\n" ^
    2.37         id2xml i id ^ 
    2.38 @@ -238,12 +238,12 @@
    2.39      scr2xml i scr ^
    2.40      pattern2xml i ppc pre ^
    2.41      indt i ^ "<EXPLANATIONS> </EXPLANATIONS>\n" ^
    2.42 -    indt i ^ "<EVALPRECOND> " ^  (#id o Rule_Set.rep_rls) prls ^ " </EVALPRECOND>\n" ^
    2.43 -    indt i ^ "<EVALCOND> " ^ (#id o Rule_Set.rep_rls) erls ^ " </EVALCOND>\n" ^
    2.44 -    indt i ^ "<EVALLISTEXPR> "^ (#id o Rule_Set.rep_rls) srls ^ " </EVALLISTEXPR>\n" ^
    2.45 -    indt i ^ "<CHECKELEMENTWISE> " ^ (#id o Rule_Set.rep_rls) 
    2.46 +    indt i ^ "<EVALPRECOND> " ^  (#id o Rule_Set.rep) prls ^ " </EVALPRECOND>\n" ^
    2.47 +    indt i ^ "<EVALCOND> " ^ (#id o Rule_Set.rep) erls ^ " </EVALCOND>\n" ^
    2.48 +    indt i ^ "<EVALLISTEXPR> "^ (#id o Rule_Set.rep) srls ^ " </EVALLISTEXPR>\n" ^
    2.49 +    indt i ^ "<CHECKELEMENTWISE> " ^ (#id o Rule_Set.rep) 
    2.50  					 crls ^ " </CHECKELEMENTWISE>\n" ^
    2.51 -    indt i ^ "<NORMALFORM> "  ^ (#id o Rule_Set.rep_rls) nrls ^ " </NORMALFORM>\n" ^
    2.52 +    indt i ^ "<NORMALFORM> "  ^ (#id o Rule_Set.rep) nrls ^ " </NORMALFORM>\n" ^
    2.53      indt i ^ "<REWORDER> " ^ rew_ord' ^ " </REWORDER>\n" ^
    2.54      calcs2xmlOLD i calc ^
    2.55      authors2xml i "MATHAUTHORS" mathauthors ^
     3.1 --- a/src/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml	Mon Apr 06 11:44:36 2020 +0200
     3.2 +++ b/src/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml	Wed Apr 08 12:32:51 2020 +0200
     3.3 @@ -25,7 +25,7 @@
     3.4      in (theID, Celem.Hthm {guh = Celem.theID2guh theID, coursedesign = [], 
     3.5  		     mathauthors = ["isac-team"], fillpats = [], thm = thm})
     3.6      end;
     3.7 -fun makeHrls (part : string) (rls' : Rule_Set.rls', thy_rls as (thyID, rls): Rule.thyID * Rule_Set.T) =
     3.8 +fun makeHrls (part : string) (rls' : Rule_Set.identifier, thy_rls as (thyID, rls): Rule.thyID * Rule_Set.T) =
     3.9      let val theID = [part, thyID,"Rulesets"] @ [rls'] : Celem.theID
    3.10      in (theID, Celem.Hrls {guh = Celem.theID2guh theID, coursedesign = [], 
    3.11  		     mathauthors = ["isac-team"], thy_rls = thy_rls})
    3.12 @@ -52,7 +52,7 @@
    3.13    else Rule.Thm (Thm.get_name_hint thm, thm)
    3.14  
    3.15  (* get all theorems from the list of rule-sets (defined in Knowledge) *)
    3.16 -fun thms_of_rlss thy rlss = (rlss : (Rule_Set.rls' * (Rule.theory' * Rule_Set.T)) list)
    3.17 +fun thms_of_rlss thy rlss = (rlss : (Rule_Set.identifier * (Rule.theory' * Rule_Set.T)) list)
    3.18    |> map (Rtools.thms_of_rls o #2 o #2)
    3.19    |> flat
    3.20    |> map (revert_sym thy)
    3.21 @@ -64,7 +64,7 @@
    3.22  
    3.23  fun collect_thms part thy =
    3.24    map (makeHthm (part, Context.theory_name thy)) (rev (thms_of thy))
    3.25 -fun collect_rlss part rlss thys = (rlss : (Rule_Set.rls' * (Rule.thyID * Rule_Set.T)) list)
    3.26 +fun collect_rlss part rlss thys = (rlss : (Rule_Set.identifier * (Rule.thyID * Rule_Set.T)) list)
    3.27    |> filter (fn (_, (thyID, _)) => member (op=) (map Context.theory_name thys) thyID)
    3.28    |> map (makeHrls part)
    3.29  fun collect_cals (part, thy') =
    3.30 @@ -221,7 +221,7 @@
    3.31  
    3.32  fun make_rls thy rls (mathauthors : Celem.authors) =
    3.33    let 
    3.34 -    val guh = Celem.rls2guh ("IsacKnowledge", Rule.theory2thyID thy) ((#id o Rule_Set.rep_rls) rls)
    3.35 +    val guh = Celem.rls2guh ("IsacKnowledge", Rule.theory2thyID thy) ((#id o Rule_Set.rep) rls)
    3.36      val theID = Rtools.guh2theID guh
    3.37      val the = Celem.Hrls {guh = guh, coursedesign = [], mathauthors = mathauthors,
    3.38  			thy_rls = (Rule.theory2thyID thy, rls)}
     4.1 --- a/src/Tools/isac/Build_Isac.thy	Mon Apr 06 11:44:36 2020 +0200
     4.2 +++ b/src/Tools/isac/Build_Isac.thy	Wed Apr 08 12:32:51 2020 +0200
     4.3 @@ -17,6 +17,7 @@
     4.4        ML_file libraryC.sml
     4.5        ML_file "rule-def.sml"
     4.6        ML_file rule.sml
     4.7 +      ML_file "rule-set.sml"
     4.8        ML_file calcelems.sml
     4.9    theory CalcElements imports KEStore
    4.10      ML_file termC.sml
     5.1 --- a/src/Tools/isac/CalcElements/KEStore.thy	Mon Apr 06 11:44:36 2020 +0200
     5.2 +++ b/src/Tools/isac/CalcElements/KEStore.thy	Wed Apr 08 12:32:51 2020 +0200
     5.3 @@ -31,8 +31,8 @@
     5.4  *)
     5.5  signature KESTORE_ELEMS =
     5.6  sig
     5.7 -  val get_rlss: theory -> (Rule_Set.rls' * (Rule.theory' * Rule_Set.T)) list
     5.8 -  val add_rlss: (Rule_Set.rls' * (Rule.theory' * Rule_Set.T)) list -> theory -> theory
     5.9 +  val get_rlss: theory -> (Rule_Set.identifier * (Rule.theory' * Rule_Set.T)) list
    5.10 +  val add_rlss: (Rule_Set.identifier * (Rule.theory' * Rule_Set.T)) list -> theory -> theory
    5.11    val get_calcs: theory -> (Rule_Set.prog_calcID * (Rule.calID * Rule.eval_fn)) list
    5.12    val add_calcs: (Rule_Set.prog_calcID * (Rule.calID * Rule.eval_fn)) list -> theory -> theory
    5.13    val get_cas: theory -> Celem.cas_elem list
    5.14 @@ -53,13 +53,13 @@
    5.15    fun union_overwrite eq l1 l2 = fold (insert eq) l2 (*..swapped..*) l1;
    5.16  
    5.17    structure Data = Theory_Data (
    5.18 -    type T = (Rule_Set.rls' * (Rule.theory' * Rule_Set.T)) list;
    5.19 +    type T = (Rule_Set.identifier * (Rule.theory' * Rule_Set.T)) list;
    5.20      val empty = [];
    5.21      val extend = I;
    5.22 -    val merge = Rule_Set.merge_rlss;
    5.23 +    val merge = Rule_Set.to_kestore;
    5.24      );  
    5.25    fun get_rlss thy = Data.get thy
    5.26 -  fun add_rlss rlss = Data.map (union_overwrite Rule_Set.rls_eq rlss)
    5.27 +  fun add_rlss rlss = Data.map (union_overwrite Rule_Set.equal rlss)
    5.28  
    5.29    structure Data = Theory_Data (
    5.30      type T = (Rule_Set.prog_calcID * (Rule.calID * Rule.eval_fn)) list;
    5.31 @@ -141,13 +141,13 @@
    5.32  ML \<open>
    5.33  val get_ref_thy = KEStore_Elems.get_ref_thy;
    5.34  
    5.35 -fun assoc_rls (rls' : Rule_Set.rls') =
    5.36 +fun assoc_rls (rls' : Rule_Set.identifier) =
    5.37    case AList.lookup (op =) (KEStore_Elems.get_rlss (Rule.Thy_Info_get_theory "Isac_Knowledge")) rls' of
    5.38      SOME (_, rls) => rls
    5.39    | NONE => raise ERROR ("rls \""^ rls' ^ "\" missing in KEStore.\n" ^
    5.40      "TODO exception hierarchy needs to be established.")
    5.41  
    5.42 -fun assoc_rls' thy (rls' : Rule_Set.rls') =
    5.43 +fun assoc_rls' thy (rls' : Rule_Set.identifier) =
    5.44    case AList.lookup (op =) (KEStore_Elems.get_rlss thy) rls' of
    5.45      SOME (_, rls) => rls
    5.46    | NONE => raise ERROR ("rls \""^ rls' ^ "\" missing in KEStore.\n" ^
    5.47 @@ -174,7 +174,7 @@
    5.48  fun get_thes () = get_ref_thy () |> KEStore_Elems.get_thes;
    5.49  \<close>
    5.50  setup \<open>KEStore_Elems.add_rlss 
    5.51 -  [("e_rls", (Context.theory_name @{theory}, Rule_Set.e_rls)), 
    5.52 +  [("empty", (Context.theory_name @{theory}, Rule_Set.empty)), 
    5.53    ("e_rrls", (Context.theory_name @{theory}, Rule_Set.e_rrls))]\<close>
    5.54  
    5.55  section \<open>determine sequence of main parts in thehier\<close>
    5.56 @@ -201,7 +201,7 @@
    5.57  fun check_kestore_rls (rls', (thyID, rls)) =
    5.58    "(" ^ rls' ^ ", (" ^ thyID ^ ", " ^ short_string_of_rls rls ^ "))";
    5.59  
    5.60 -fun check_kestore_calc ((id, (c, _)) : Rule_Set.calc)  = "(" ^ id ^ ", (" ^ c ^ ", fn))";
    5.61 +fun check_kestore_calc ((id, (c, _)) : Rule_Def.calc)  = "(" ^ id ^ ", (" ^ c ^ ", fn))";
    5.62  
    5.63  (* we avoid term_to_string''' defined later *)
    5.64  fun check_kestore_cas ((t, (s, _)) : Celem.cas_elem) =
     6.1 --- a/src/Tools/isac/CalcElements/calcelems.sml	Mon Apr 06 11:44:36 2020 +0200
     6.2 +++ b/src/Tools/isac/CalcElements/calcelems.sml	Wed Apr 08 12:32:51 2020 +0200
     6.3 @@ -24,7 +24,7 @@
     6.4  
     6.5      type fillpat
     6.6      datatype thydata
     6.7 -      = Hcal of {calc: Rule_Set.calc, coursedesign: authors, guh: guh, mathauthors: authors}
     6.8 +      = Hcal of {calc: Rule_Def.calc, coursedesign: authors, guh: guh, mathauthors: authors}
     6.9        | Hord of {coursedesign: authors, guh: guh, mathauthors: authors, ord: Rule.subst -> term * term -> bool}
    6.10        | Hrls of {coursedesign: authors, guh: guh, mathauthors: authors, thy_rls: Rule.thyID * Rule_Set.T}
    6.11        | Hthm of {coursedesign: authors, fillpats: fillpat list, guh: guh, mathauthors: authors, thm: thm}
    6.12 @@ -79,7 +79,7 @@
    6.13      val partID': Rule.theory' -> string
    6.14      val thm2guh: string * Rule.thyID -> thmID -> guh
    6.15      val thmID_of_derivation_name: string -> string
    6.16 -    val rls2guh: string * Rule.thyID -> Rule_Set.rls' -> guh
    6.17 +    val rls2guh: string * Rule.thyID -> Rule_Set.identifier -> guh
    6.18      val theID2guh: theID -> guh
    6.19      eqtype fillpatID
    6.20      type pbt_ = string * (term * term)
    6.21 @@ -109,8 +109,8 @@
    6.22  ( *\--- ! aktivate for Test_Isac END ----------------------------------------------------------/*)
    6.23  
    6.24  (*----- unused code, kept as hints to design ideas ---------------------------------------------*)
    6.25 -val overwritelthy: theory -> (Rule_Set.rls' * (string * Rule_Set.T)) list * (Rule_Set.rls' * Rule_Set.T) list ->
    6.26 -  (Rule_Set.rls' * (string * Rule_Set.T)) list  end
    6.27 +val overwritelthy: theory -> (Rule_Set.identifier * (string * Rule_Set.T)) list * (Rule_Set.identifier * Rule_Set.T) list ->
    6.28 +  (Rule_Set.identifier * (string * Rule_Set.T)) list  end
    6.29  
    6.30  (**)
    6.31  structure Celem(**): CALC_ELEMENT(**) =
    6.32 @@ -286,7 +286,7 @@
    6.33  | Hthm of {guh: guh, coursedesign: authors, mathauthors: authors, fillpats: fillpat list,
    6.34     thm: thm} (* here no sym_thm, thus no thmID required *)
    6.35  | Hrls of {guh: guh, coursedesign: authors, mathauthors: authors, thy_rls: (Rule.thyID * Rule_Set.T)}
    6.36 -| Hcal of {guh: guh, coursedesign: authors, mathauthors: authors, calc: Rule_Set.calc}
    6.37 +| Hcal of {guh: guh, coursedesign: authors, mathauthors: authors, calc: Rule_Def.calc}
    6.38  | Hord of {guh: guh, coursedesign: authors, mathauthors: authors,
    6.39      ord: (Rule.subst -> (term * term) -> bool)};
    6.40  fun the2str (Html {guh, ...}) = guh
    6.41 @@ -411,7 +411,7 @@
    6.42     in scripts...
    6.43     actually a hack to get alltogether run again with minimal effort *)
    6.44  fun insthy thy' (rls', rls) = (rls', (thy', rls));
    6.45 -fun overwritelthy thy (al, bl: (Rule_Set.rls' * Rule_Set.T) list) =
    6.46 +fun overwritelthy thy (al, bl: (Rule_Set.identifier * Rule_Set.T) list) =
    6.47      let val bl' = map (insthy ((get_thy o Rule.theory2theory') thy)) bl
    6.48      in overwritel (al, bl') end;
    6.49  
    6.50 @@ -550,7 +550,7 @@
    6.51        crls       : Rule_Set.T,        (* for check_elementwise, ie. formulae in calc.  *)
    6.52        nrls       : Rule_Set.T,        (* canonical simplifier specific for this met    *)
    6.53        errpats    : Rule.errpat list,(* error patterns expected in this method        *)
    6.54 -      calc       : Rule_Set.calc list, (* Theory_Data in fun prep_met                   *)
    6.55 +      calc       : Rule_Def.calc list, (* Theory_Data in fun prep_met                   *)
    6.56        (*branch   : TransitiveB set in append_problem at generation ob pblobj         *)
    6.57        scr        : Rule.program,    (* progam, empty as @{thm refl} or Rfuns         *)
    6.58  (*TODO: abstract to ?pre_model?...*)
    6.59 @@ -563,8 +563,8 @@
    6.60        pre        : term list        (* preconditions in where                        *)
    6.61  	   };
    6.62  val e_met = {guh = "met_empty", mathauthors = [], init = e_metID, rew_ord' = "e_rew_ord'",
    6.63 -	erls = Rule_Set.e_rls, srls = Rule_Set.e_rls, prls = Rule_Set.e_rls, calc = [], crls = Rule_Set.e_rls,
    6.64 -	errpats = [], nrls = Rule_Set.e_rls, ppc = [], pre = [], scr = Rule.EmptyScr};
    6.65 +	erls = Rule_Set.empty, srls = Rule_Set.empty, prls = Rule_Set.empty, calc = [], crls = Rule_Set.empty,
    6.66 +	errpats = [], nrls = Rule_Set.empty, ppc = [], pre = [], scr = Rule.EmptyScr};
    6.67  val e_Mets = Ptyp ("e_metID", [e_met],[]);
    6.68  
    6.69  type mets = (met ptyp) list;
     7.1 --- a/src/Tools/isac/CalcElements/rule-set.sml	Mon Apr 06 11:44:36 2020 +0200
     7.2 +++ b/src/Tools/isac/CalcElements/rule-set.sml	Wed Apr 08 12:32:51 2020 +0200
     7.3 @@ -1,4 +1,4 @@
     7.4 -(* Title:  KEStore/rule-set.sml
     7.5 +(* Title:  CalcElements/rule-set.sml
     7.6     Author: Walther Neuper
     7.7     (c) due to copyright terms
     7.8  
     7.9 @@ -7,67 +7,167 @@
    7.10  signature RULE_SET =
    7.11  sig
    7.12    datatype T = datatype Rule_Def.rule_set
    7.13 -  eqtype rls'
    7.14 +  eqtype identifier
    7.15  
    7.16 -  type calc = Rule_Def.calc                                                    (*..from Rule_Def*)
    7.17 -  val e_rls: T
    7.18 +  val rep: T -> {calc: Rule_Def.calc list, erls: T, errpats: Rule_Def.errpatID list, id: string,
    7.19 +    preconds: term list, rew_ord: Rule_Def.rew_ord, rules: Rule_Def.rule list, scr: Rule_Def.program, srls: T}
    7.20 +
    7.21 +  val append_rules: string -> T -> Rule_Def.rule list -> T
    7.22 +  val keep_unique_rules: string -> T ->  Rule_Def.rule list -> T
    7.23 +  val merge: string -> T -> T -> T
    7.24 +  val get_rules: T -> Rule_Def.rule list
    7.25 +
    7.26 +  type for_kestore
    7.27 +  val equal: (''a * ('b * 'c)) * (''a * ('d * 'e)) -> bool
    7.28 +  val to_kestore: for_kestore list * for_kestore list -> for_kestore list
    7.29 +
    7.30 +(*/------- this will disappear eventually -----------\*)
    7.31 +  val empty: T
    7.32  
    7.33    type rrlsstate = term * term * Rule_Def.rule list list * (Rule_Def.rule * (term * term list)) list
    7.34    val e_rrlsstate: rrlsstate
    7.35    val e_rrls: T
    7.36 -  type rlss_elem
    7.37 +(*\------- this will disappear eventually -----------/*)
    7.38  
    7.39 -  val append_rls: string -> T -> Rule_Def.rule list -> T
    7.40 -  val rep_rls: T -> {calc: calc list, erls: T, errpats: Rule_Def.errpatID list, id: string,
    7.41 -    preconds: term list, rew_ord: Rule_Def.rew_ord, rules: Rule_Def.rule list, scr: Rule_Def.program, srls: T}
    7.42 -
    7.43 -  val rls2str: T -> string
    7.44 -  val id_rls: T -> string
    7.45 +(*val id_rls: T -> string*)
    7.46 +(*/------- back to rule.sml -----------------------\*)
    7.47 +  val rls2str: T(*Rule_Def.rule_set*) -> string
    7.48 +  val id_rls: T(*Rule_Def.rule_set*) -> string
    7.49    val id_rule: Rule_Def.rule -> string
    7.50    val eq_rule: Rule_Def.rule * Rule_Def.rule -> bool
    7.51 -
    7.52 -  val merge_rls: string -> T -> T -> T
    7.53 -  val merge_rlss: rlss_elem list * rlss_elem list -> rlss_elem list
    7.54 -  val remove_rls: string -> T ->  Rule_Def.rule list -> T
    7.55 -
    7.56    val rule2str: Rule_Def.rule -> string
    7.57    val rule2str': Rule_Def.rule -> string
    7.58 +(*\------- back to rule.sml -----------------------/*)
    7.59  
    7.60 +(*/------- to exec-def.sml ------------------------\*)
    7.61    eqtype prog_calcID
    7.62    type cal
    7.63    type calc_elem
    7.64    val calc_eq: calc_elem * calc_elem -> bool
    7.65    val e_evalfn: Rule_Def.eval_fn
    7.66 -
    7.67 -  val get_rules: T -> Rule_Def.rule list
    7.68 -  val rls_eq: (''a * ('b * 'c)) * (''a * ('d * 'e)) -> bool
    7.69 +(*\------- to exec-def.sml ------------------------/*)
    7.70  
    7.71  (* ---- for tests only: shifted from below to remove the Warning "unused" at fun.def. --------- *)
    7.72    (*NONE*)
    7.73  (*/-------------------------------------------------------- ! aktivate for Test_Isac BEGIN ---\* )
    7.74 -  (*NONE*)
    7.75 +  val insert_merge: for_kestore -> for_kestore list -> for_kestore list
    7.76  ( *\--- ! aktivate for Test_Isac END ----------------------------------------------------------/*)
    7.77  end
    7.78 +
    7.79  (**)
    7.80  structure Rule_Set(**): RULE_SET(**) =
    7.81  struct
    7.82  (**)
    7.83  datatype T = datatype Rule_Def.rule_set
    7.84 -type rls' = string
    7.85 +type identifier = string
    7.86  
    7.87 -type calc = Rule_Def.calc
    7.88 -type subst = (term * term) list;
    7.89 -fun dummy_ord (_: subst) (_: term, _: term) = true;
    7.90 +(*/------- this will disappear eventually ----------------------------------------------------\*)
    7.91 +fun dummy_ord (_: (term * term) list) (_: term, _: term) = true;
    7.92 +val empty =
    7.93 +  Rule_Def.Repeat {id = "empty", preconds = [], rew_ord = ("dummy_ord", dummy_ord), erls = Rule_Def.Empty,
    7.94 +    srls = Rule_Def.Empty, calc = [], rules = [], errpatts = [], scr = Rule_Def.EmptyScr}
    7.95 +(*\------- this will disappear eventually ----------------------------------------------------/*)
    7.96  
    7.97 -val e_rls =
    7.98 -  Rule_Def.Repeat {id = "e_rls", preconds = [], rew_ord = ("dummy_ord", dummy_ord), erls = Rule_Def.Empty,
    7.99 -    srls = Rule_Def.Empty, calc = [], rules = [], errpatts = [], scr = Rule_Def.EmptyScr}
   7.100 +fun rep Rule_Def.Empty = rep empty
   7.101 +  | rep (Rule_Def.Repeat {id, preconds, rew_ord, erls, srls, calc, errpatts, rules, scr}) =
   7.102 +    {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls, errpats = errpatts,
   7.103 +      calc = calc, rules = rules, scr = scr}
   7.104 +  | rep (Rule_Def.Seqence {id, preconds, rew_ord, erls, srls, calc, errpatts, rules, scr}) =
   7.105 +    {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls, errpats = errpatts,
   7.106 +      calc = calc, rules = rules, scr = scr}
   7.107 +  | rep (Rule_Def.Rrls _)  = rep empty
   7.108  
   7.109 -(*/--------------------------------------\*)
   7.110 +fun append_rules id Rule_Def.Empty _ = raise ERROR ("append_rules: with \"" ^ id ^ "\" not for Rule_Def.Empty")
   7.111 +  | append_rules id (Rule_Def.Repeat {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.112 +			rules = rs, errpatts = errpatts, scr = sc}) r =
   7.113 +    Rule_Def.Repeat {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.114 +      rules = rs @ r, errpatts = errpatts, scr = sc}
   7.115 +  | append_rules id (Rule_Def.Seqence {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.116 +			rules = rs, errpatts = errpatts, scr = sc}) r =
   7.117 +    Rule_Def.Seqence {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.118 +      rules = rs @ r, errpatts = errpatts, scr = sc}
   7.119 +  | append_rules id (Rule_Def.Rrls _) _ = raise ERROR ("append_rules: not for reverse-rewrite-rule-set " ^ id);
   7.120 +
   7.121 +fun merge_ids rls1 rls2 =
   7.122 +  let 
   7.123 +    val id1 = (#id o rep) rls1
   7.124 +    val id2 = (#id o rep) rls2
   7.125 +  in
   7.126 +    if id1 = id2 then id1 else "merged_" ^ id1 ^ "_" ^ id2
   7.127 +  end
   7.128 +
   7.129 +(*/------- to exec-def.sml ------------------------\*)
   7.130 +type prog_calcID = string;
   7.131 +(* op in isa-term "Const(op,_)" *)
   7.132 +type cal = Rule_Def.calID * Rule_Def.eval_fn;
   7.133 +type calc_elem =  (* fun calculate_ fetches the evaluation-function via this list *)
   7.134 +  prog_calcID *   (* a simple identifier used in programs                    *)
   7.135 +  (Rule_Def.calID *        (* a long identifier used in Const                         *)
   7.136 +    Rule_Def.eval_fn)      (* an ML function                                          *)
   7.137 +fun calc_eq ((pi1, (ci1, _)), (pi2, (ci2, _))) =
   7.138 +  if pi1 = pi2
   7.139 +  then if ci1 = ci2 then true else error ("calc_eq: " ^ ci1 ^ " <> " ^ ci2)
   7.140 +  else false
   7.141 +fun e_evalfn (_ : 'a) (_ : term) (_ : theory) = NONE : (string * term) option;
   7.142 +(*\------- to exec-def.sml ------------------------/*)
   7.143 +
   7.144 +(*val id_rls = Rule.identifier *)
   7.145 +
   7.146 +(*/------- back to rule.sml -----------------------\*)
   7.147 +fun id_rls Rule_Def.Empty = "empty" (*WN060714 quick and dirty: recursive defs! TODO "Rule_Def.Empty"*)
   7.148 +  | id_rls (Rule_Def.Repeat {id, ...}) = id
   7.149 +  | id_rls (Rule_Def.Seqence {id, ...}) = id
   7.150 +  | id_rls (Rule_Def.Rrls {id, ...}) = id;
   7.151 +val rls2str = id_rls; (*drop*)
   7.152 +
   7.153 +fun id_rule (Rule_Def.Thm (id, _)) = id
   7.154 +  | id_rule (Rule_Def.Num_Calc (id, _)) = id
   7.155 +  | id_rule (Rule_Def.Cal1 (id, _)) = id
   7.156 +  | id_rule (Rule_Def.Rls_ rls) = id_rls rls
   7.157 +  | id_rule Rule_Def.Erule = "Erule";
   7.158 +fun eq_rule (Rule_Def.Thm (thm1, _), Rule_Def.Thm (thm2, _)) = thm1 = thm2
   7.159 +  | eq_rule (Rule_Def.Num_Calc (id1, _), Rule_Def.Num_Calc (id2, _)) = id1 = id2
   7.160 +  | eq_rule (Rule_Def.Rls_ rls1, Rule_Def.Rls_ rls2) = id_rls rls1 = id_rls rls2
   7.161 +  | eq_rule _ = false;
   7.162 +(*\------- back to rule.sml -----------------------/*)
   7.163 +
   7.164 +fun merge _ Rule_Def.Empty rls = rls
   7.165 +  | merge _ rls Rule_Def.Empty = rls
   7.166 +  | merge _ (Rrls x) _ = Rrls x (* required for merging Theory_Data *)
   7.167 +  | merge _ _ (Rrls x) = Rrls x
   7.168 +  | merge id
   7.169 +	  (Rule_Def.Repeat {preconds = pc1, rew_ord = ro1, erls = er1, srls = sr1, calc = ca1,
   7.170 +	    rules = rs1, errpatts = eps1, scr = sc1, ...})
   7.171 +	  (Rule_Def.Repeat {preconds = pc2, erls = er2, srls = sr2, calc = ca2,
   7.172 +	    rules = rs2, errpatts = eps2, ...})
   7.173 +    =
   7.174 +	  Rule_Def.Repeat {id = id, rew_ord = ro1, scr = sc1,
   7.175 +	    preconds = union (op =) pc1 pc2,	    
   7.176 +	    erls = merge (merge_ids er1 er2) er1 er2,
   7.177 +	    srls = merge (merge_ids sr1 sr2) sr1 sr2,
   7.178 +	    calc = union calc_eq ca1 ca2,
   7.179 +		  rules = union eq_rule rs1 rs2,
   7.180 +      errpatts = union (op =) eps1 eps2}
   7.181 +  | merge id
   7.182 +	  (Rule_Def.Seqence {preconds = pc1, rew_ord = ro1, erls = er1, srls = sr1, calc = ca1,
   7.183 +	    rules = rs1, errpatts = eps1, scr = sc1, ...})
   7.184 +	  (Rule_Def.Seqence {preconds = pc2, erls = er2, srls = sr2, calc = ca2,
   7.185 +	    rules = rs2, errpatts = eps2, ...})
   7.186 +    =
   7.187 +	  Rule_Def.Seqence {id = id, rew_ord = ro1, scr = sc1,
   7.188 +	    preconds = union (op =) pc1 pc2,	    
   7.189 +	    erls = merge (merge_ids er1 er2) er1 er2,
   7.190 +	    srls = merge (merge_ids sr1 sr2) sr1 sr2,
   7.191 +	    calc = union calc_eq ca1 ca2,
   7.192 +		  rules = union eq_rule rs1 rs2,
   7.193 +      errpatts = union (op =) eps1 eps2}
   7.194 +  | merge id _ _ = error ("merge: \"" ^ id ^ 
   7.195 +    "\"; not for reverse-rewrite-rule-sets and not for mixed Rls -- Rule_Def.Seqence");
   7.196 +
   7.197 +(*/------- this will disappear eventually -----------\*)
   7.198  type rrlsstate =  (* state for reverse rewriting, comments see type rule and scr | Rfuns *)
   7.199    (term * term * Rule_Def.rule list list * (Rule_Def.rule * (term * term list)) list);
   7.200  val e_rrlsstate = (Rule.e_term, Rule.e_term, [[Rule_Def.Erule]], [(Rule_Def.Erule, (Rule.e_term, []))]) : rrlsstate;
   7.201 -(*\--------------------------------------/*)
   7.202  local
   7.203      fun ii (_: term) = e_rrlsstate;
   7.204      fun no (_: term) = SOME (Rule.e_term, [Rule.e_term]);
   7.205 @@ -79,142 +179,62 @@
   7.206  		  next_rule = ne, attach_form = fo};
   7.207  end;
   7.208  val e_rrls =
   7.209 -  Rrls {id = "e_rrls", prepat = [], rew_ord = ("dummy_ord", dummy_ord), erls = Rule_Def.Empty,
   7.210 +  Rule_Def.Rrls {id = "e_rrls", prepat = [], rew_ord = ("dummy_ord", dummy_ord), erls = Rule_Def.Empty,
   7.211      calc = [], errpatts = [], scr = e_rfuns}
   7.212 +(*\------- this will disappear eventually -----------/*)
   7.213  
   7.214 -fun rep_rls Rule_Def.Empty = rep_rls e_rls
   7.215 -  | rep_rls (Rule_Def.Repeat {id, preconds, rew_ord, erls, srls, calc, errpatts, rules, scr}) =
   7.216 -    {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls, errpats = errpatts,
   7.217 -      calc = calc, rules = rules, scr = scr}
   7.218 -  | rep_rls (Rule_Def.Seqence {id, preconds, rew_ord, erls, srls, calc, errpatts, rules, scr}) =
   7.219 -    {id = id, preconds = preconds, rew_ord = rew_ord, erls = erls, srls = srls, errpats = errpatts,
   7.220 -      calc = calc, rules = rules, scr = scr}
   7.221 -  | rep_rls (Rrls _)  = rep_rls e_rls
   7.222 -
   7.223 -fun append_rls id Rule_Def.Empty _ = raise ERROR ("append_rls: with \"" ^ id ^ "\" not for Rule_Def.Empty")
   7.224 -  | append_rls id (Rule_Def.Repeat {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.225 -			rules = rs, errpatts = errpatts, scr = sc}) r =
   7.226 -    Rule_Def.Repeat {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.227 -      rules = rs @ r, errpatts = errpatts, scr = sc}
   7.228 -  | append_rls id (Rule_Def.Seqence {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.229 -			rules = rs, errpatts = errpatts, scr = sc}) r =
   7.230 -    Rule_Def.Seqence {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.231 -      rules = rs @ r, errpatts = errpatts, scr = sc}
   7.232 -  | append_rls id (Rrls _) _ = raise ERROR ("append_rls: not for reverse-rewrite-rule-set " ^ id);
   7.233 -
   7.234 -fun id_rls Rule_Def.Empty = "e_rls" (*WN060714 quick and dirty: recursive defs! TODO "Rule_Def.Empty"*)
   7.235 -  | id_rls (Rule_Def.Repeat {id, ...}) = id
   7.236 -  | id_rls (Rule_Def.Seqence {id, ...}) = id
   7.237 -  | id_rls (Rule_Def.Rrls {id, ...}) = id;
   7.238 -val rls2str = id_rls;
   7.239 -
   7.240 -fun id_rule (Rule_Def.Thm (id, _)) = id
   7.241 -  | id_rule (Rule_Def.Num_Calc (id, _)) = id
   7.242 -  | id_rule (Rule_Def.Cal1 (id, _)) = id
   7.243 -  | id_rule (Rule_Def.Rls_ rls) = id_rls rls
   7.244 -  | id_rule Rule_Def.Erule = "Erule";
   7.245 +(*/------- back to rule.sml -----------------------\*)
   7.246  fun eq_rule (Rule_Def.Thm (thm1, _), Rule_Def.Thm (thm2, _)) = thm1 = thm2
   7.247    | eq_rule (Rule_Def.Num_Calc (id1, _), Rule_Def.Num_Calc (id2, _)) = id1 = id2
   7.248    | eq_rule (Rule_Def.Rls_ rls1, Rule_Def.Rls_ rls2) = id_rls rls1 = id_rls rls2
   7.249    | eq_rule _ = false;
   7.250  
   7.251 -fun rule2str Rule_Def.Erule = "Erule"
   7.252 -  | rule2str (Rule_Def.Thm (str, thm)) = "Thm (\""^str^"\"," ^ Rule.string_of_thmI thm ^")"
   7.253 -  | rule2str (Rule_Def.Num_Calc (str, _)) = "Num_Calc (\""^str^"\",fn)"
   7.254 -  | rule2str (Rule_Def.Cal1 (str, _)) = "Cal1 (\""^str^"\",fn)"
   7.255 -  | rule2str (Rule_Def.Rls_ rls) = "Rls_ (\""^id_rls rls^"\")";
   7.256 +fun rule2str Rule_Def.Erule = "Erule" 
   7.257 +  | rule2str (Rule_Def.Thm (str, thm)) = "Thm (\"" ^ str ^ "\"," ^ Rule.string_of_thmI thm ^ ")"
   7.258 +  | rule2str (Rule_Def.Num_Calc (str, _)) = "Num_Calc (\"" ^ str ^ "\",fn)"
   7.259 +  | rule2str (Rule_Def.Cal1 (str, _)) = "Cal1 (\"" ^ str ^ "\",fn)"
   7.260 +  | rule2str (Rule_Def.Rls_ rls) = "Rls_ (\"" ^ id_rls rls ^ "\")";
   7.261  fun rule2str' Rule_Def.Erule = "Erule"
   7.262 -  | rule2str' (Rule_Def.Thm (str, _)) = "Thm (\""^str^"\",\"\")"
   7.263 -  | rule2str' (Rule_Def.Num_Calc (str, _)) = "Num_Calc (\""^str^"\",fn)"
   7.264 -  | rule2str' (Rule_Def.Cal1 (str, _)) = "Cal1 (\""^str^"\",fn)"
   7.265 -  | rule2str' (Rule_Def.Rls_ rls) = "Rls_ (\""^id_rls rls^"\")";
   7.266 +  | rule2str' (Rule_Def.Thm (str, _)) = "Thm (\"" ^ str ^ "\",\"\")"
   7.267 +  | rule2str' (Rule_Def.Num_Calc (str, _)) = "Num_Calc (\"" ^ str ^ "\",fn)"
   7.268 +  | rule2str' (Rule_Def.Cal1 (str, _)) = "Cal1 (\"" ^ str ^ "\",fn)"
   7.269 +  | rule2str' (Rule_Def.Rls_ rls) = "Rls_ (\"" ^ id_rls rls ^ "\")";
   7.270 +(*\------- back to rule.sml -----------------------/*)
   7.271  
   7.272 -fun merge_ids rls1 rls2 =
   7.273 -  let 
   7.274 -    val id1 = (#id o rep_rls) rls1
   7.275 -    val id2 = (#id o rep_rls) rls2
   7.276 -  in
   7.277 -    if id1 = id2 then id1 else "merged_" ^ id1 ^ "_" ^ id2
   7.278 -  end
   7.279 -(* op in isa-term "Const(op,_)" *)
   7.280 -type cal = Rule_Def.calID * Rule_Def.eval_fn;
   7.281 -
   7.282 -type prog_calcID = string;
   7.283 -
   7.284 -type calc_elem =  (* fun calculate_ fetches the evaluation-function via this list *)
   7.285 -  prog_calcID *   (* a simple identifier used in programs                    *)
   7.286 -  (Rule_Def.calID *        (* a long identifier used in Const                         *)
   7.287 -    Rule_Def.eval_fn)      (* an ML function                                          *)
   7.288 -fun calc_eq ((pi1, (ci1, _)), (pi2, (ci2, _))) =
   7.289 -  if pi1 = pi2
   7.290 -  then if ci1 = ci2 then true else error ("calc_eq: " ^ ci1 ^ " <> " ^ ci2)
   7.291 -  else false
   7.292 -fun e_evalfn (_ : 'a) (_ : term) (_ : theory) = NONE : (string * term) option;
   7.293 -
   7.294 -fun merge_rls _ Rule_Def.Empty rls = rls
   7.295 -  | merge_rls _ rls Rule_Def.Empty = rls
   7.296 -  | merge_rls _ (Rrls x) _ = Rrls x (* required for merging Theory_Data *)
   7.297 -  | merge_rls _ _ (Rrls x) = Rrls x
   7.298 -  | merge_rls id
   7.299 -	  (Rule_Def.Repeat {preconds = pc1, rew_ord = ro1, erls = er1, srls = sr1, calc = ca1,
   7.300 -	    rules = rs1, errpatts = eps1, scr = sc1, ...})
   7.301 -	  (Rule_Def.Repeat {preconds = pc2, erls = er2, srls = sr2, calc = ca2,
   7.302 -	    rules = rs2, errpatts = eps2, ...})
   7.303 -    =
   7.304 -	  Rule_Def.Repeat {id = id, rew_ord = ro1, scr = sc1,
   7.305 -	    preconds = union (op =) pc1 pc2,	    
   7.306 -	    erls = merge_rls (merge_ids er1 er2) er1 er2,
   7.307 -	    srls = merge_rls (merge_ids sr1 sr2) sr1 sr2,
   7.308 -	    calc = union calc_eq ca1 ca2,
   7.309 -		  rules = union eq_rule rs1 rs2,
   7.310 -      errpatts = union (op =) eps1 eps2}
   7.311 -  | merge_rls id
   7.312 -	  (Rule_Def.Seqence {preconds = pc1, rew_ord = ro1, erls = er1, srls = sr1, calc = ca1,
   7.313 -	    rules = rs1, errpatts = eps1, scr = sc1, ...})
   7.314 -	  (Rule_Def.Seqence {preconds = pc2, erls = er2, srls = sr2, calc = ca2,
   7.315 -	    rules = rs2, errpatts = eps2, ...})
   7.316 -    =
   7.317 -	  Rule_Def.Seqence {id = id, rew_ord = ro1, scr = sc1,
   7.318 -	    preconds = union (op =) pc1 pc2,	    
   7.319 -	    erls = merge_rls (merge_ids er1 er2) er1 er2,
   7.320 -	    srls = merge_rls (merge_ids sr1 sr2) sr1 sr2,
   7.321 -	    calc = union calc_eq ca1 ca2,
   7.322 -		  rules = union eq_rule rs1 rs2,
   7.323 -      errpatts = union (op =) eps1 eps2}
   7.324 -  | merge_rls id _ _ = error ("merge_rls: \"" ^ id ^ 
   7.325 -    "\"; not for reverse-rewrite-rule-sets and not for mixed Rls -- Rule_Def.Seqence");
   7.326  
   7.327  (* datastructure for KEStore_Elems, intermediate for thehier *)
   7.328 -type rlss_elem = 
   7.329 -  (rls' *     (* identifier unique within Isac *)
   7.330 +type for_kestore = 
   7.331 +  (identifier *     (* identifier unique within Isac *)
   7.332    (Rule.theory' *  (* just for assignment in thehier, not appropriate for parsing etc *)
   7.333 -    T))     (* ((#id o rep_rls) T) = rls'   by coding discipline *)
   7.334 -fun rls_eq ((id1, (_, _)), (id2, (_, _))) = id1 = id2
   7.335 +    T))     (* ((#id o rep) T) = identifier   by coding discipline *)
   7.336 +fun equal ((id1, (_, _)), (id2, (_, _))) = id1 = id2
   7.337  
   7.338 -fun insert_merge_rls (re as (id, (thyID, r1)) : rlss_elem) ys = 
   7.339 -    case get_index (fn y => if curry rls_eq re y then SOME y else NONE) ys of
   7.340 +fun insert_merge (re as (id, (thyID, r1))) ys = 
   7.341 +    case get_index (fn y => if curry equal re y then SOME y else NONE) ys of
   7.342        NONE => re :: ys
   7.343      | SOME (i, (_, (_, r2))) => 
   7.344        let
   7.345 -        val r12 = merge_rls id r1 r2
   7.346 +        val r12 = merge id r1 r2
   7.347        in list_update ys i (id, (thyID, r12)) end
   7.348 -fun merge_rlss (s1, s2) = fold insert_merge_rls s1 s2;
   7.349 +fun to_kestore (s1, s2) = fold insert_merge s1 s2;
   7.350  
   7.351 -(* used only for one hack TODO remove *)
   7.352 -fun remove_rls id (Rule_Def.Repeat {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.353 -		  rules = rs, errpatts = eps, scr = sc}) r =
   7.354 -    Rule_Def.Repeat {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.355 -	    rules = gen_rems eq_rule (rs, r),
   7.356 -	    errpatts = eps,
   7.357 -	    scr = sc}
   7.358 -  | remove_rls id (Rule_Def.Seqence {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.359 -		  rules = rs, errpatts = eps, scr = sc}) r =
   7.360 -    Rule_Def.Seqence {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.361 -	    rules = gen_rems eq_rule (rs, r),
   7.362 -	    errpatts = eps,
   7.363 -	    scr = sc}
   7.364 -  | remove_rls id (Rule_Def.Rrls _) _ = raise ERROR ("remove_rls: not for reverse-rewrite-rule-set "^id)
   7.365 -  | remove_rls _ rls _ = raise ERROR ("remove_rls called with " ^ rls2str rls);
   7.366 +(* used only for one hack *)
   7.367 +fun keep_unique_rules id 
   7.368 +     (Rule_Def.Repeat {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.369 +  		  rules = rs, errpatts = eps, scr = sc}) r =
   7.370 +      Rule_Def.Repeat {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.371 +  	    rules = gen_rems eq_rule (rs, r),
   7.372 +  	    errpatts = eps,
   7.373 +  	    scr = sc}
   7.374 +  | keep_unique_rules id
   7.375 +     (Rule_Def.Seqence {id = _, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.376 +  		  rules = rs, errpatts = eps, scr = sc}) r =
   7.377 +      Rule_Def.Seqence {id = id, preconds = pc, rew_ord = ro, erls = er, srls = sr, calc = ca,
   7.378 +  	    rules = gen_rems eq_rule (rs, r),
   7.379 +  	    errpatts = eps,
   7.380 +  	    scr = sc}
   7.381 +  | keep_unique_rules id (Rule_Def.Rrls _) _ = raise ERROR ("keep_unique_rules: not for reverse-rewrite-rule-set "^id)
   7.382 +  | keep_unique_rules _ rls _ = raise ERROR ("remove_rls called with " ^ rls2str rls);
   7.383  
   7.384  fun get_rules Rule_Def.Empty = []
   7.385    | get_rules (Rule_Def.Repeat {rules, ...}) = rules
     8.1 --- a/src/Tools/isac/CalcElements/rule.sml	Mon Apr 06 11:44:36 2020 +0200
     8.2 +++ b/src/Tools/isac/CalcElements/rule.sml	Wed Apr 08 12:32:51 2020 +0200
     8.3 @@ -15,42 +15,46 @@
     8.4    datatype rule = datatype Rule_Def.rule
     8.5    datatype program = datatype Rule_Def.program
     8.6  
     8.7 +(*/------- to exec-def.sml ------------------------\*)
     8.8    eqtype calID
     8.9    type eval_fn = Rule_Def.eval_fn
    8.10 +(*\------- to exec-def.sml ------------------------/*)
    8.11  
    8.12    eqtype cterm'
    8.13    type subst = (term * term) list
    8.14  
    8.15 +(*/------- to rewrite-ord.sml ---------------------\*)
    8.16    val dummy_ord: Rule_Def.rew_ord_
    8.17    val e_rew_ord_: Rule_Def.rew_ord_
    8.18    val e_rew_ord: Rule_Def.rew_ord_
    8.19    val e_rew_ordX: Rule_Def.rew_ord
    8.20    val rew_ord': (Rule_Def.rew_ord' * (subst -> term * term -> bool)) list Unsynchronized.ref
    8.21    val assoc_rew_ord: string -> subst -> term * term -> bool
    8.22 +(*\------- to rewrite-ord.sml ---------------------/*)
    8.23  
    8.24    eqtype errpatID                                                              (*..from Rule_Def*)
    8.25    type errpat = errpatID * term list * thm list
    8.26  
    8.27    val scr2str: program -> string
    8.28  
    8.29 -  val thy2ctxt: theory -> Proof.context                      (* shift up in sequence of defs *)
    8.30 -  val thy2ctxt': string -> Proof.context                     (* shift up in sequence of defs *)
    8.31 -  val Thy_Info_get_theory: string -> theory                  (* shift up in sequence of defs *)
    8.32 +(*/------- to theoryC.sml -------------------------\*)
    8.33 +  val thy2ctxt: theory -> Proof.context
    8.34 +  val thy2ctxt': string -> Proof.context
    8.35 +  val Thy_Info_get_theory: string -> theory
    8.36 +  eqtype thyID
    8.37 +  eqtype domID
    8.38 +  val e_domID: domID
    8.39 +  eqtype theory'
    8.40 +  val theory'2thyID: theory' -> theory'
    8.41 +  val theory2theory': theory -> theory'
    8.42 +  val theory2thyID: theory -> thyID
    8.43 +  val thyID2theory': thyID -> thyID
    8.44 +  val string_of_thy: theory -> theory'
    8.45 +  val theory2domID: theory -> theory'
    8.46 +  val Isac: 'a -> theory
    8.47 +  val string_of_thmI: thm -> string
    8.48 +(*\------- to theoryC.sml -------------------------/*)
    8.49  
    8.50 -  eqtype thyID                                               (* shift up in sequence of defs *)
    8.51 -  eqtype domID                                               (* shift up in sequence of defs *)
    8.52 -  val e_domID: domID                                         (* shift up in sequence of defs *)
    8.53 -  eqtype theory'                                             (* shift up in sequence of defs *)
    8.54 -  val theory'2thyID: theory' -> theory'                      (* shift up in sequence of defs *)
    8.55 -  val theory2theory': theory -> theory'                      (* shift up in sequence of defs *)
    8.56 -  val theory2thyID: theory -> thyID                          (* shift up in sequence of defs *)
    8.57 -  val thyID2theory': thyID -> thyID                          (* shift up in sequence of defs *)
    8.58 -  val string_of_thy: theory -> theory'                       (* shift up in sequence of defs *)
    8.59 -  val theory2domID: theory -> theory'                        (* shift up in sequence of defs *)
    8.60 -
    8.61 -  val Isac: 'a -> theory                                     (* shift up in sequence of defs *)
    8.62 -
    8.63 -  val string_of_thmI: thm -> string                          (* shift up to Unparse *)
    8.64    val e_term: term                                           (* shift up to Unparse *)
    8.65    val e_type: typ                                            (* shift up to Unparse *)
    8.66    val type2str: typ -> string
     9.1 --- a/src/Tools/isac/Interpret/error-pattern.sml	Mon Apr 06 11:44:36 2020 +0200
     9.2 +++ b/src/Tools/isac/Interpret/error-pattern.sml	Wed Apr 08 12:32:51 2020 +0200
     9.3 @@ -97,7 +97,7 @@
     9.4  fun check_err_patt (res, inf) subst (errpatID, pat) rls =
     9.5    let 
     9.6      val (res', _, _, rewritten) =
     9.7 -      Rewrite.rew_sub (Rule.Isac()) 1 subst Rule.e_rew_ord Rule_Set.e_rls false [] (HOLogic.Trueprop $ pat) res;
     9.8 +      Rewrite.rew_sub (Rule.Isac()) 1 subst Rule.e_rew_ord Rule_Set.empty false [] (HOLogic.Trueprop $ pat) res;
     9.9    in
    9.10      if rewritten then 
    9.11        let
    9.12 @@ -134,7 +134,7 @@
    9.13  fun get_fillform (subs_opt, subst) (thm, form) errpatID (fillpatID, pat, erpaID) =
    9.14    let
    9.15      val (form', _, _, rewritten) =
    9.16 -      Rewrite.rew_sub (Rule.Isac()) 1 subst Rule.e_rew_ord Rule_Set.e_rls false [] (HOLogic.Trueprop $ pat) form;
    9.17 +      Rewrite.rew_sub (Rule.Isac()) 1 subst Rule.e_rew_ord Rule_Set.empty false [] (HOLogic.Trueprop $ pat) form;
    9.18    in (*the fillpat of the thm must be dedicated to errpatID*)
    9.19      if errpatID = erpaID andalso rewritten then
    9.20        SOME (fillpatID, HOLogic.mk_eq (form, form'), thm, subs_opt) 
    9.21 @@ -199,7 +199,7 @@
    9.22        case tac of
    9.23         Tactic.Rewrite_Set rlsID => rlsID
    9.24        |Tactic.Rewrite_Set_Inst (_, rlsID) => rlsID
    9.25 -      | _ => "e_rls"
    9.26 +      | _ => "empty"
    9.27      val (part, thyID) = Rtools.thy_containing_rls "Isac_Knowledge" rlsID;
    9.28      val rls = case Specify.get_the [part, thyID, "Rulesets", rlsID] of
    9.29        Celem.Hrls {thy_rls = (_, rls), ...} => rls
    10.1 --- a/src/Tools/isac/Interpret/lucas-interpreter.sml	Mon Apr 06 11:44:36 2020 +0200
    10.2 +++ b/src/Tools/isac/Interpret/lucas-interpreter.sml	Wed Apr 08 12:32:51 2020 +0200
    10.3 @@ -621,7 +621,7 @@
    10.4    let
    10.5      val fo = Calc.get_current_formula ptp
    10.6  	  val {nrls, ...} = Specify.get_met (Ctree.get_obj Ctree.g_metID pt (Ctree.par_pblobj pt p))
    10.7 -	  val {rew_ord, erls, rules, ...} = Rule_Set.rep_rls nrls
    10.8 +	  val {rew_ord, erls, rules, ...} = Rule_Set.rep nrls
    10.9  	  val (found, der) = Error_Pattern.concat_deriv rew_ord erls rules fo ifo; (*<---------------*)
   10.10    in
   10.11      if found
    11.1 --- a/src/Tools/isac/Interpret/rewtools.sml	Mon Apr 06 11:44:36 2020 +0200
    11.2 +++ b/src/Tools/isac/Interpret/rewtools.sml	Wed Apr 08 12:32:51 2020 +0200
    11.3 @@ -10,17 +10,17 @@
    11.4    type deriv
    11.5    val contains_rule : Rule.rule -> Rule_Set.T -> bool
    11.6    val atomic_appl_tacs : theory -> string -> Rule_Set.T -> term -> Tactic.input -> Tactic.input list
    11.7 -  val thy_containing_rls : Rule.theory' -> Rule_Set.rls' -> string * Rule.theory'
    11.8 +  val thy_containing_rls : Rule.theory' -> Rule_Set.identifier -> string * Rule.theory'
    11.9    val thy_containing_cal : Rule.theory' -> Rule_Set.prog_calcID -> string * string
   11.10    datatype contthy
   11.11    = ContNOrew of {applto: term, thm_rls: Celem.guh, thyID: Rule.thyID}
   11.12       | ContNOrewInst of {applto: term, bdvs: Rule.subst, thm_rls: Celem.guh, thminst: term, thyID: Rule.thyID}
   11.13       | ContRls of {applto: term, asms: term list, result: term, rls: Celem.guh, thyID: Rule.thyID}
   11.14       | ContRlsInst of {applto: term, asms: term list, bdvs: Rule.subst, result: term, rls: Celem.guh, thyID: Rule.thyID}
   11.15 -     | ContThm of {applat: term, applto: term, asmrls: Rule_Set.rls', asms: (term * term) list,
   11.16 +     | ContThm of {applat: term, applto: term, asmrls: Rule_Set.identifier, asms: (term * term) list,
   11.17         lhs: term * term, resasms: term list, result: term, reword: Rule_Def.rew_ord', rhs: term * term,
   11.18         thm: Celem.guh, thyID: Rule.thyID}
   11.19 -     | ContThmInst of {applat: term, applto: term, asmrls: Rule_Set.rls', asms: (term * term) list,
   11.20 +     | ContThmInst of {applat: term, applto: term, asmrls: Rule_Set.identifier, asms: (term * term) list,
   11.21         bdvs: Rule.subst, lhs: term * term, resasms: term list, result: term, reword: Rule_Def.rew_ord',
   11.22         rhs: term * term, thm: Celem.guh, thminst: term, thyID: Rule.thyID}
   11.23       | EContThy
   11.24 @@ -285,7 +285,7 @@
   11.25     	   * term,                  (* ... instantiated                   .*)
   11.26       result  : term,	          (* resulting from the rewrite         .*)
   11.27       resasms : term list,       (* ... with asms stored               .*)
   11.28 -     asmrls  : Rule_Set.rls'        (* ruleset for evaluating asms        .*)
   11.29 +     asmrls  : Rule_Set.identifier        (* ruleset for evaluating asms        .*)
   11.30     	}						 
   11.31    | ContThmInst of (* a theorem with bdvs in contex ============ *)
   11.32      {thyID   : Rule.thyID,      (*for *2guh in sub-elems here         .*)
   11.33 @@ -303,7 +303,7 @@
   11.34     	   * term,                  (*... instantiated                    .*)
   11.35       result  : term,	          (*resulting from the rewrite          .*)
   11.36       resasms : term list,       (*... with asms stored                .*)
   11.37 -     asmrls  : Rule_Set.rls'        (*ruleset for evaluating asms         .*)
   11.38 +     asmrls  : Rule_Set.identifier        (*ruleset for evaluating asms         .*)
   11.39      }						 
   11.40    | ContRls of (* a rule set in contex ========================= *)
   11.41      {thyID   : Rule.thyID,      (*for *2guh in sub-elems here         .*)
   11.42 @@ -479,7 +479,7 @@
   11.43  (* decide if a tactic is applicable to a given formula; 
   11.44     in case of Rewrite_Set* go down to _atomic_ rewrite-tactics *)
   11.45  fun atomic_appl_tacs thy _ _ f (Tactic.Calculate scrID) =
   11.46 -    try_rew thy Rule.e_rew_ordX Rule_Set.e_rls [] f (Rule.Num_Calc (assoc_calc' thy scrID |> snd))
   11.47 +    try_rew thy Rule.e_rew_ordX Rule_Set.empty [] f (Rule.Num_Calc (assoc_calc' thy scrID |> snd))
   11.48    | atomic_appl_tacs thy ro erls f (Tactic.Rewrite thm'') =
   11.49      try_rew thy (ro, Rule.assoc_rew_ord ro) erls [] f (Rule.Thm thm'')
   11.50    | atomic_appl_tacs thy ro erls f (Tactic.Rewrite_Inst (subs, thm'')) =
    12.1 --- a/src/Tools/isac/Knowledge/AlgEin.thy	Mon Apr 06 11:44:36 2020 +0200
    12.2 +++ b/src/Tools/isac/Knowledge/AlgEin.thy	Wed Apr 08 12:32:51 2020 +0200
    12.3 @@ -24,14 +24,14 @@
    12.4  \<close>
    12.5  (** problems **)
    12.6  setup \<open>KEStore_Elems.add_pbts
    12.7 -  [(Specify.prep_pbt thy "pbl_algein" [] Celem.e_pblID (["Berechnung"], [], Rule_Set.e_rls, NONE, [])),
    12.8 +  [(Specify.prep_pbt thy "pbl_algein" [] Celem.e_pblID (["Berechnung"], [], Rule_Set.empty, NONE, [])),
    12.9      (Specify.prep_pbt thy "pbl_algein_numsym" [] Celem.e_pblID
   12.10        (["numerischSymbolische", "Berechnung"],
   12.11          [("#Given",
   12.12              ["KantenLaenge k_k","Querschnitt q__q"(*q_ in Biegelinie.thy*), "KantenUnten u_u",
   12.13                "KantenSenkrecht s_s", "KantenOben o_o"]),
   12.14            ("#Find", ["GesamtLaenge l_l"])],
   12.15 -        Rule_Set.e_rls, NONE, [["Berechnung", "erstNumerisch"], ["Berechnung", "erstSymbolisch"]]))]\<close>
   12.16 +        Rule_Set.empty, NONE, [["Berechnung", "erstNumerisch"], ["Berechnung", "erstSymbolisch"]]))]\<close>
   12.17  
   12.18  setup \<open>KEStore_Elems.add_mets
   12.19      [Specify.prep_met thy "met_algein" [] Celem.e_metID
   12.20 @@ -74,10 +74,10 @@
   12.21  	       [("#Given" ,["KantenLaenge k_k","Querschnitt q__q", "KantenUnten u_u",
   12.22  	           "KantenSenkrecht s_s", "KantenOben o_o"]),
   12.23  	         ("#Find"  ,["GesamtLaenge l_l"])],
   12.24 -	       {rew_ord'="tless_true", rls'= Rule_Set.e_rls, calc = [],
   12.25 -           srls = Rule_Set.append_rls "srls_..Berechnung-erstSymbolisch" Rule_Set.e_rls 
   12.26 +	       {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [],
   12.27 +           srls = Rule_Set.append_rules "srls_..Berechnung-erstSymbolisch" Rule_Set.empty 
   12.28  				       [Rule.Num_Calc ("Prog_Expr.boollist2sum", Prog_Expr.eval_boollist2sum "")], 
   12.29 -		       prls = Rule_Set.e_rls, crls =Rule_Set.e_rls , errpats = [], nrls = norm_Rational},
   12.30 +		       prls = Rule_Set.empty, crls =Rule_Set.empty , errpats = [], nrls = norm_Rational},
   12.31           @{thm symbolisch_rechnen.simps})]
   12.32  \<close>
   12.33  
   12.34 @@ -107,10 +107,10 @@
   12.35  	        [("#Given" ,["KantenLaenge k_k","Querschnitt q__q", "KantenUnten u_u",
   12.36                  "KantenSenkrecht s_s", "KantenOben o_o"]),
   12.37  		        ("#Find"  ,["GesamtLaenge l_l"])],
   12.38 -	        {rew_ord'="tless_true", rls'= Rule_Set.e_rls, calc = [], 
   12.39 -	          srls = Rule_Set.append_rls "srls_..Berechnung-erstSymbolisch" Rule_Set.e_rls 
   12.40 +	        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], 
   12.41 +	          srls = Rule_Set.append_rules "srls_..Berechnung-erstSymbolisch" Rule_Set.empty 
   12.42  				        [Rule.Num_Calc ("Prog_Expr.boollist2sum", Prog_Expr.eval_boollist2sum "")], 
   12.43 -				    prls = Rule_Set.e_rls, crls =Rule_Set.e_rls , errpats = [], nrls = norm_Rational},
   12.44 +				    prls = Rule_Set.empty, crls =Rule_Set.empty , errpats = [], nrls = norm_Rational},
   12.45              @{thm symbolisch_rechnen.simps})]
   12.46  \<close>
   12.47  
    13.1 --- a/src/Tools/isac/Knowledge/Base_Tools.thy	Mon Apr 06 11:44:36 2020 +0200
    13.2 +++ b/src/Tools/isac/Knowledge/Base_Tools.thy	Wed Apr 08 12:32:51 2020 +0200
    13.3 @@ -57,7 +57,7 @@
    13.4  subsection \<open>rule-sets\<close>
    13.5  ML \<open>
    13.6  \<close> ML \<open>
    13.7 -val Atools_erls = Rule_Set.append_rls "Atools_erls" Rule_Set.e_rls
    13.8 +val Atools_erls = Rule_Set.append_rules "Atools_erls" Rule_Set.empty
    13.9    [ Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   13.10      Rule.Thm ("not_true", TermC.num_str @{thm not_true}),
   13.11  		(*"(~ True) = False"*)
   13.12 @@ -89,7 +89,7 @@
   13.13  \<close>
   13.14  
   13.15  ML \<open>
   13.16 -val Atools_crls = Rule_Set.append_rls "Atools_crls" Rule_Set.e_rls
   13.17 +val Atools_crls = Rule_Set.append_rules "Atools_crls" Rule_Set.empty
   13.18    [ Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   13.19      Rule.Thm ("not_true", TermC.num_str @{thm not_true}),
   13.20  		Rule.Thm ("not_false", TermC.num_str @{thm not_false}),
   13.21 @@ -117,7 +117,7 @@
   13.22  subsection \<open>ONCE AGAIN extend rule-set for evaluating pre-conditions and program-expressions\<close>
   13.23  text \<open>requires "eval_binop" from above\<close>
   13.24  ML \<open>
   13.25 -val prog_expr = Rule_Set.append_rls "prog_expr" prog_expr
   13.26 +val prog_expr = Rule_Set.append_rules "prog_expr" prog_expr
   13.27  	[ Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   13.28  		Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"), 
   13.29  		Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   13.30 @@ -130,10 +130,10 @@
   13.31  		Rule.Thm ("if_True",TermC.num_str @{thm if_True}),
   13.32  		Rule.Thm ("if_False",TermC.num_str @{thm if_False})];
   13.33  
   13.34 -val prog_expr = Auto_Prog.prep_rls @{theory} (Rule_Set.merge_rls "list_erls"
   13.35 +val prog_expr = Auto_Prog.prep_rls @{theory} (Rule_Set.merge "list_erls"
   13.36  	(Rule_Def.Repeat {id = "replaced", preconds = [], rew_ord = ("termlessI", termlessI),
   13.37      erls = Rule_Def.Repeat {id = "list_elrs", preconds = [], rew_ord = ("termlessI", termlessI), 
   13.38 -    erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
   13.39 +    erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   13.40      rules = [Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   13.41        Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_")
   13.42        (*    ~~~~~~ for nth_Cons_*)],
    14.1 --- a/src/Tools/isac/Knowledge/Biegelinie.thy	Mon Apr 06 11:44:36 2020 +0200
    14.2 +++ b/src/Tools/isac/Knowledge/Biegelinie.thy	Wed Apr 08 12:32:51 2020 +0200
    14.3 @@ -78,7 +78,7 @@
    14.4            (*("#Where",["0 < l_l"]), ...wait for &lt; and handling Arbfix*)
    14.5            ("#Find"  ,["Biegelinie b_b"]),
    14.6            ("#Relate",["Randbedingungen r_b"])],
    14.7 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [], NONE, [["IntegrierenUndKonstanteBestimmen2"]])),
    14.8 +        Rule_Set.append_rules "empty" Rule_Set.empty [], NONE, [["IntegrierenUndKonstanteBestimmen2"]])),
    14.9      (Specify.prep_pbt @{theory} "pbl_bieg_mom" [] Celem.e_pblID
   14.10        (["MomentBestimmte","Biegelinien"],
   14.11          [("#Given" ,["Traegerlaenge l_l", "Streckenlast q_q"]),
   14.12 @@ -86,38 +86,38 @@
   14.13            ("#Find"  ,["Biegelinie b_b"]),
   14.14            ("#Relate",["RandbedingungenBiegung r_b","RandbedingungenMoment r_m"])
   14.15          ],
   14.16 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [], NONE, [["IntegrierenUndKonstanteBestimmen"]])),
   14.17 +        Rule_Set.append_rules "empty" Rule_Set.empty [], NONE, [["IntegrierenUndKonstanteBestimmen"]])),
   14.18      (Specify.prep_pbt @{theory} "pbl_bieg_momg" [] Celem.e_pblID
   14.19 -      (["MomentGegebene","Biegelinien"], [], Rule_Set.append_rls "e_rls" Rule_Set.e_rls [], NONE,
   14.20 +      (["MomentGegebene","Biegelinien"], [], Rule_Set.append_rules "empty" Rule_Set.empty [], NONE,
   14.21          [["IntegrierenUndKonstanteBestimmen","2xIntegrieren"]])),
   14.22      (Specify.prep_pbt @{theory} "pbl_bieg_einf" [] Celem.e_pblID
   14.23 -      (["einfache","Biegelinien"], [], Rule_Set.append_rls "e_rls" Rule_Set.e_rls [], NONE,
   14.24 +      (["einfache","Biegelinien"], [], Rule_Set.append_rules "empty" Rule_Set.empty [], NONE,
   14.25          [["IntegrierenUndKonstanteBestimmen","4x4System"]])),
   14.26      (Specify.prep_pbt @{theory} "pbl_bieg_momquer" [] Celem.e_pblID
   14.27 -      (["QuerkraftUndMomentBestimmte","Biegelinien"], [], Rule_Set.append_rls "e_rls" Rule_Set.e_rls [], NONE,
   14.28 +      (["QuerkraftUndMomentBestimmte","Biegelinien"], [], Rule_Set.append_rules "empty" Rule_Set.empty [], NONE,
   14.29          [["IntegrierenUndKonstanteBestimmen","1xIntegrieren"]])),
   14.30      (Specify.prep_pbt @{theory} "pbl_bieg_vonq" [] Celem.e_pblID
   14.31        (["vonBelastungZu","Biegelinien"],
   14.32            [("#Given" ,["Streckenlast q_q","FunktionsVariable v_v"]),
   14.33              ("#Find"  ,["Funktionen funs'''"])],
   14.34 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [], NONE, [["Biegelinien","ausBelastung"]])),
   14.35 +        Rule_Set.append_rules "empty" Rule_Set.empty [], NONE, [["Biegelinien","ausBelastung"]])),
   14.36      (Specify.prep_pbt @{theory} "pbl_bieg_randbed" [] Celem.e_pblID
   14.37        (["setzeRandbedingungen","Biegelinien"],
   14.38            [("#Given" ,["Funktionen fun_s","Randbedingungen r_b"]),
   14.39              ("#Find"  ,["Gleichungen equs'''"])],
   14.40 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [], NONE, [["Biegelinien","setzeRandbedingungenEin"]])),
   14.41 +        Rule_Set.append_rules "empty" Rule_Set.empty [], NONE, [["Biegelinien","setzeRandbedingungenEin"]])),
   14.42      (Specify.prep_pbt @{theory} "pbl_equ_fromfun" [] Celem.e_pblID
   14.43        (["makeFunctionTo","equation"],
   14.44            [("#Given" ,["functionEq fu_n","substitution su_b"]),
   14.45              ("#Find"  ,["equality equ'''"])],
   14.46 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [], NONE, [["Equation","fromFunction"]]))]\<close>
   14.47 +        Rule_Set.append_rules "empty" Rule_Set.empty [], NONE, [["Equation","fromFunction"]]))]\<close>
   14.48  ML \<open>
   14.49  (** methods **)
   14.50  
   14.51  val srls = Rule_Def.Repeat {id="srls_IntegrierenUnd..", 
   14.52  		preconds = [], 
   14.53  		rew_ord = ("termlessI",termlessI), 
   14.54 -		erls = Rule_Set.append_rls "erls_in_srls_IntegrierenUnd.." Rule_Set.e_rls
   14.55 +		erls = Rule_Set.append_rules "erls_in_srls_IntegrierenUnd.." Rule_Set.empty
   14.56  				  [(*for asm in NTH_CONS ...*)
   14.57  				   Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   14.58  				   (*2nd NTH_CONS pushes n+-1 into asms*)
   14.59 @@ -137,7 +137,7 @@
   14.60      Rule_Def.Repeat {id="srls_IntegrierenUnd..", 
   14.61  	 preconds = [], 
   14.62  	 rew_ord = ("termlessI",termlessI), 
   14.63 -	 erls = Rule_Set.append_rls "erls_in_srls_IntegrierenUnd.." Rule_Set.e_rls
   14.64 +	 erls = Rule_Set.append_rules "erls_in_srls_IntegrierenUnd.." Rule_Set.empty
   14.65  			   [(*for asm in NTH_CONS ...*)
   14.66  			    Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   14.67  			    (*2nd NTH_CONS pushes n+-1 into asms*)
   14.68 @@ -194,12 +194,12 @@
   14.69  		      ("#Find"  ,["Biegelinie b"]),
   14.70  		      ("#Relate",["Randbedingungen s"])],
   14.71  	      {rew_ord'="tless_true", 
   14.72 -	        rls' = Rule_Set.append_rls "erls_IntegrierenUndK.." Rule_Set.e_rls 
   14.73 +	        rls' = Rule_Set.append_rules "erls_IntegrierenUndK.." Rule_Set.empty 
   14.74  				      [Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   14.75  				        Rule.Thm ("not_true",TermC.num_str @{thm not_true}),
   14.76  				        Rule.Thm ("not_false",TermC.num_str @{thm not_false})], 
   14.77  				  calc = [], 
   14.78 -				  srls = Rule_Set.append_rls "erls_IntegrierenUndK.." Rule_Set.e_rls 
   14.79 +				  srls = Rule_Set.append_rules "erls_IntegrierenUndK.." Rule_Set.empty 
   14.80  				      [Rule.Num_Calc("Prog_Expr.rhs", Prog_Expr.eval_rhs"eval_rhs_"),
   14.81  				        Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   14.82  				        Rule.Thm ("last_thmI",TermC.num_str @{thm last_thmI}),
   14.83 @@ -211,23 +211,23 @@
   14.84  setup \<open>KEStore_Elems.add_mets
   14.85      [Specify.prep_met @{theory} "met_biege_intconst_2" [] Celem.e_metID
   14.86  	    (["IntegrierenUndKonstanteBestimmen","2xIntegrieren"], [],
   14.87 -	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls, crls = Atools_erls,
   14.88 -          errpats = [], nrls = Rule_Set.e_rls},
   14.89 +	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty, crls = Atools_erls,
   14.90 +          errpats = [], nrls = Rule_Set.empty},
   14.91          @{thm refl}),
   14.92      Specify.prep_met @{theory} "met_biege_intconst_4" [] Celem.e_metID
   14.93  	    (["IntegrierenUndKonstanteBestimmen","4x4System"], [],
   14.94 -	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls, crls = Atools_erls,
   14.95 -          errpats = [], nrls = Rule_Set.e_rls},
   14.96 +	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty, crls = Atools_erls,
   14.97 +          errpats = [], nrls = Rule_Set.empty},
   14.98          @{thm refl}),
   14.99      Specify.prep_met @{theory} "met_biege_intconst_1" [] Celem.e_metID
  14.100  	    (["IntegrierenUndKonstanteBestimmen","1xIntegrieren"], [],
  14.101 -        {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls, crls = Atools_erls,
  14.102 -          errpats = [], nrls = Rule_Set.e_rls},
  14.103 +        {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty, crls = Atools_erls,
  14.104 +          errpats = [], nrls = Rule_Set.empty},
  14.105          @{thm refl}),
  14.106      Specify.prep_met @{theory} "met_biege2" [] Celem.e_metID
  14.107  	    (["Biegelinien"], [],
  14.108 -	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls, crls = Atools_erls,
  14.109 -          errpats = [], nrls = Rule_Set.e_rls},
  14.110 +	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty, crls = Atools_erls,
  14.111 +          errpats = [], nrls = Rule_Set.empty},
  14.112          @{thm refl})]
  14.113  \<close>
  14.114  subsection \<open>Compute the general bending line\<close>
  14.115 @@ -260,14 +260,14 @@
  14.116              "Biegelinie id_fun", "AbleitungBiegelinie id_abl"]),
  14.117  	       ("#Find"  ,["Funktionen fun_s"])],
  14.118  	      {rew_ord'="tless_true", 
  14.119 -	        rls' = Rule_Set.append_rls "erls_ausBelastung" Rule_Set.e_rls 
  14.120 +	        rls' = Rule_Set.append_rules "erls_ausBelastung" Rule_Set.empty 
  14.121  				      [Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
  14.122  				        Rule.Thm ("not_true", TermC.num_str @{thm not_true}),
  14.123  				        Rule.Thm ("not_false", TermC.num_str @{thm not_false})], 
  14.124  				  calc = [], 
  14.125 -				  srls = Rule_Set.append_rls "srls_ausBelastung" Rule_Set.e_rls 
  14.126 +				  srls = Rule_Set.append_rules "srls_ausBelastung" Rule_Set.empty 
  14.127  				      [Rule.Num_Calc ("Prog_Expr.rhs", Prog_Expr.eval_rhs "eval_rhs_")], 
  14.128 -				  prls = Rule_Set.e_rls, crls = Atools_erls, errpats = [], nrls = Rule_Set.e_rls},
  14.129 +				  prls = Rule_Set.empty, crls = Atools_erls, errpats = [], nrls = Rule_Set.empty},
  14.130          @{thm belastung_zu_biegelinie.simps})]
  14.131  \<close>
  14.132  subsection \<open>Substitute the constraints into the equations\<close>
  14.133 @@ -299,8 +299,8 @@
  14.134  	    (["Biegelinien", "setzeRandbedingungenEin"],
  14.135  	      [("#Given" , ["Funktionen fun_s", "Randbedingungen r_b"]),
  14.136  	        ("#Find"  , ["Gleichungen equs'''"])],
  14.137 -	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = srls2, prls=Rule_Set.e_rls, crls = Atools_erls,
  14.138 -          errpats = [], nrls = Rule_Set.e_rls},
  14.139 +	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = srls2, prls=Rule_Set.empty, crls = Atools_erls,
  14.140 +          errpats = [], nrls = Rule_Set.empty},
  14.141          @{thm setzte_randbedingungen.simps})]
  14.142  \<close>
  14.143  subsection \<open>Transform an equality into a function\<close>
  14.144 @@ -324,10 +324,10 @@
  14.145  	      [("#Given" ,["functionEq fu_n","substitution su_b"]),
  14.146  	        ("#Find"  ,["equality equ'''"])],
  14.147  	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [],
  14.148 -          srls = Rule_Set.append_rls "srls_in_EquationfromFunc" Rule_Set.e_rls
  14.149 +          srls = Rule_Set.append_rules "srls_in_EquationfromFunc" Rule_Set.empty
  14.150  				      [Rule.Num_Calc("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
  14.151  				        Rule.Num_Calc("Prog_Expr.argument'_in", Prog_Expr.eval_argument_in "Prog_Expr.argument'_in")], 
  14.152 -				  prls=Rule_Set.e_rls, crls = Atools_erls, errpats = [], nrls = Rule_Set.e_rls},
  14.153 +				  prls=Rule_Set.empty, crls = Atools_erls, errpats = [], nrls = Rule_Set.empty},
  14.154          (*(M_b x = c_2 + c * x + -1 * q_0 / 2 * x ^^^ 2) (M_b L = 0) -->
  14.155                 0 = c_2 + c * L + -1 * q_0 / 2 * L ^^^ 2*)
  14.156          @{thm function_to_equality.simps})]
    15.1 --- a/src/Tools/isac/Knowledge/Diff.thy	Mon Apr 06 11:44:36 2020 +0200
    15.2 +++ b/src/Tools/isac/Knowledge/Diff.thy	Wed Apr 08 12:32:51 2020 +0200
    15.3 @@ -109,7 +109,7 @@
    15.4      Rule_Def.Repeat {id="diff_conv", 
    15.5  	 preconds = [], 
    15.6  	 rew_ord = ("termlessI",termlessI), 
    15.7 -	 erls = Rule_Set.append_rls "erls_diff_conv" Rule_Set.e_rls 
    15.8 +	 erls = Rule_Set.append_rules "erls_diff_conv" Rule_Set.empty 
    15.9  			   [Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in ""),
   15.10  			    Rule.Thm ("not_true",TermC.num_str @{thm not_true}),
   15.11  			    Rule.Thm ("not_false",TermC.num_str @{thm not_false}),
   15.12 @@ -147,7 +147,7 @@
   15.13      Rule_Def.Repeat {id="diff_sym_conv", 
   15.14  	 preconds = [], 
   15.15  	 rew_ord = ("termlessI",termlessI), 
   15.16 -	 erls = Rule_Set.append_rls "erls_diff_sym_conv" Rule_Set.e_rls 
   15.17 +	 erls = Rule_Set.append_rules "erls_diff_sym_conv" Rule_Set.empty 
   15.18  			   [Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_")
   15.19  			    ], 
   15.20  	 srls = Rule_Set.Empty, calc = [], errpatts = [],
   15.21 @@ -172,7 +172,7 @@
   15.22      Rule_Def.Repeat {id="srls_differentiate..", 
   15.23  	 preconds = [], 
   15.24  	 rew_ord = ("termlessI",termlessI), 
   15.25 -	 erls = Rule_Set.e_rls, 
   15.26 +	 erls = Rule_Set.empty, 
   15.27  	 srls = Rule_Set.Empty, calc = [], errpatts = [],
   15.28  	 rules = [Rule.Num_Calc("Prog_Expr.lhs", Prog_Expr.eval_lhs "eval_lhs_"),
   15.29  		  Rule.Num_Calc("Prog_Expr.rhs", Prog_Expr.eval_rhs "eval_rhs_"),
   15.30 @@ -183,7 +183,7 @@
   15.31  ML \<open>
   15.32  (*..*)
   15.33  val erls_diff = 
   15.34 -    Rule_Set.append_rls "erls_differentiate.." Rule_Set.e_rls
   15.35 +    Rule_Set.append_rules "erls_differentiate.." Rule_Set.empty
   15.36                 [Rule.Thm ("not_true",TermC.num_str @{thm not_true}),
   15.37  		Rule.Thm ("not_false",TermC.num_str @{thm not_false}),
   15.38  		
   15.39 @@ -239,12 +239,12 @@
   15.40  
   15.41  (** problem types **)
   15.42  setup \<open>KEStore_Elems.add_pbts
   15.43 -  [(Specify.prep_pbt thy "pbl_fun" [] Celem.e_pblID (["function"], [], Rule_Set.e_rls, NONE, [])),
   15.44 +  [(Specify.prep_pbt thy "pbl_fun" [] Celem.e_pblID (["function"], [], Rule_Set.empty, NONE, [])),
   15.45      (Specify.prep_pbt thy "pbl_fun_deriv" [] Celem.e_pblID
   15.46        (["derivative_of","function"],
   15.47          [("#Given" ,["functionTerm f_f","differentiateFor v_v"]),
   15.48            ("#Find"  ,["derivative f_f'"])],
   15.49 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [],
   15.50 +        Rule_Set.append_rules "empty" Rule_Set.empty [],
   15.51          SOME "Diff (f_f, v_v)", [["diff","differentiate_on_R"],
   15.52  			  ["diff","after_simplification"]])),
   15.53      (*here "named" is used differently from Integration"*)
   15.54 @@ -252,7 +252,7 @@
   15.55        (["named","derivative_of","function"],
   15.56          [("#Given" ,["functionEq f_f","differentiateFor v_v"]),
   15.57            ("#Find"  ,["derivativeEq f_f'"])],
   15.58 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [],
   15.59 +        Rule_Set.append_rules "empty" Rule_Set.empty [],
   15.60          SOME "Differentiate (f_f, v_v)",
   15.61          [["diff","differentiate_equality"]]))]\<close>
   15.62  
   15.63 @@ -274,7 +274,7 @@
   15.64  setup \<open>KEStore_Elems.add_mets
   15.65      [Specify.prep_met thy "met_diff" [] Celem.e_metID
   15.66        (["diff"], [],
   15.67 -        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
   15.68 +        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
   15.69            crls = Atools_erls, errpats = [], nrls = norm_diff},
   15.70          @{thm refl})]
   15.71  \<close>
   15.72 @@ -311,7 +311,7 @@
   15.73        (["diff","differentiate_on_R"],
   15.74          [("#Given" ,["functionTerm f_f","differentiateFor v_v"]),
   15.75            ("#Find"  ,["derivative f_f'"])],
   15.76 -        {rew_ord'="tless_true", rls' = erls_diff, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
   15.77 +        {rew_ord'="tless_true", rls' = erls_diff, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
   15.78            crls = Atools_erls, errpats = [], nrls = norm_diff},
   15.79          @{thm differentiate_on_R.simps})]
   15.80  \<close>
   15.81 @@ -346,7 +346,7 @@
   15.82        (["diff","diff_simpl"],
   15.83          [("#Given", ["functionTerm f_f","differentiateFor v_v"]),
   15.84           ("#Find" , ["derivative f_f'"])],
   15.85 -        {rew_ord'="tless_true", rls' = erls_diff, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
   15.86 +        {rew_ord'="tless_true", rls' = erls_diff, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
   15.87            crls = Atools_erls, errpats = [], nrls = norm_diff},
   15.88          @{thm differentiateX.simps})]
   15.89  \<close>
   15.90 @@ -384,7 +384,7 @@
   15.91        (["diff","differentiate_equality"],
   15.92          [("#Given" ,["functionEq f_f","differentiateFor v_v"]),
   15.93            ("#Find"  ,["derivativeEq f_f'"])],
   15.94 -        {rew_ord'="tless_true", rls' = erls_diff, calc = [], srls = srls_diff, prls=Rule_Set.e_rls,
   15.95 +        {rew_ord'="tless_true", rls' = erls_diff, calc = [], srls = srls_diff, prls=Rule_Set.empty,
   15.96            crls=Atools_erls, errpats = [], nrls = norm_diff},
   15.97          @{thm differentiate_equality.simps})]
   15.98  \<close>
   15.99 @@ -407,7 +407,7 @@
  15.100        (["diff","after_simplification"],
  15.101          [("#Given" ,["functionTerm term","differentiateFor bound_variable"]),
  15.102            ("#Find"  ,["derivative term'"])],
  15.103 -        {rew_ord'="tless_true", rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
  15.104 +        {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
  15.105            crls=Atools_erls, errpats = [], nrls = norm_Rational},
  15.106          @{thm simplify_derivative.simps})]
  15.107  \<close>
    16.1 --- a/src/Tools/isac/Knowledge/DiffApp.thy	Mon Apr 06 11:44:36 2020 +0200
    16.2 +++ b/src/Tools/isac/Knowledge/DiffApp.thy	Wed Apr 08 12:32:51 2020 +0200
    16.3 @@ -36,7 +36,7 @@
    16.4  
    16.5  val eval_rls = prep_rls' (
    16.6    Rule_Def.Repeat {id = "eval_rls", preconds = [], rew_ord = ("termlessI", termlessI), 
    16.7 -    erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
    16.8 +    erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
    16.9      rules = [Rule.Thm ("refl", TermC.num_str @{thm refl}),
   16.10        Rule.Thm ("order_refl", TermC.num_str @{thm order_refl}),
   16.11        Rule.Thm ("radd_left_cancel_le", TermC.num_str @{thm radd_left_cancel_le}),
   16.12 @@ -68,44 +68,44 @@
   16.13          [("#Given" ,["fixedValues f_ix"]),
   16.14            ("#Find"  ,["maximum m_m","valuesFor v_s"]),
   16.15            ("#Relate",["relations r_s"])],
   16.16 -        Rule_Set.e_rls, NONE, [])),
   16.17 +        Rule_Set.empty, NONE, [])),
   16.18      (Specify.prep_pbt thy "pbl_fun_make" [] Celem.e_pblID
   16.19        (["make","function"],
   16.20          [("#Given" ,["functionOf f_f","boundVariable v_v","equalities eqs"]),
   16.21            ("#Find"  ,["functionEq f_1"])],
   16.22 -        Rule_Set.e_rls, NONE, [])),
   16.23 +        Rule_Set.empty, NONE, [])),
   16.24      (Specify.prep_pbt thy "pbl_fun_max_expl" [] Celem.e_pblID
   16.25        (["by_explicit","make","function"],
   16.26          [("#Given" ,["functionOf f_f","boundVariable v_v","equalities eqs"]),
   16.27            ("#Find"  ,["functionEq f_1"])],
   16.28 -      Rule_Set.e_rls, NONE, [["DiffApp","make_fun_by_explicit"]])),
   16.29 +      Rule_Set.empty, NONE, [["DiffApp","make_fun_by_explicit"]])),
   16.30      (Specify.prep_pbt thy "pbl_fun_max_newvar" [] Celem.e_pblID
   16.31        (["by_new_variable","make","function"],
   16.32          [("#Given" ,["functionOf f_f","boundVariable v_v","equalities eqs"]),
   16.33            (*WN.12.5.03: precond for distinction still missing*)
   16.34            ("#Find"  ,["functionEq f_1"])],
   16.35 -      Rule_Set.e_rls, NONE, [["DiffApp","make_fun_by_new_variable"]])),
   16.36 +      Rule_Set.empty, NONE, [["DiffApp","make_fun_by_new_variable"]])),
   16.37      (Specify.prep_pbt thy "pbl_fun_max_interv" [] Celem.e_pblID
   16.38        (["on_interval","maximum_of","function"],
   16.39          [("#Given" ,["functionEq t_t","boundVariable v_v","interval i_tv"]),
   16.40            (*WN.12.5.03: precond for distinction still missing*)
   16.41            ("#Find"  ,["maxArgument v_0"])],
   16.42 -      Rule_Set.e_rls, NONE, [])),
   16.43 +      Rule_Set.empty, NONE, [])),
   16.44      (Specify.prep_pbt thy "pbl_tool" [] Celem.e_pblID
   16.45 -      (["tool"], [], Rule_Set.e_rls, NONE, [])),
   16.46 +      (["tool"], [], Rule_Set.empty, NONE, [])),
   16.47      (Specify.prep_pbt thy "pbl_tool_findvals" [] Celem.e_pblID
   16.48        (["find_values","tool"],
   16.49          [("#Given" ,["maxArgument m_ax","functionEq f_f","boundVariable v_v"]),
   16.50            ("#Find"  ,["valuesFor v_ls"]),
   16.51            ("#Relate",["additionalRels r_s"])],
   16.52 -      Rule_Set.e_rls, NONE, []))]\<close>
   16.53 +      Rule_Set.empty, NONE, []))]\<close>
   16.54  
   16.55  
   16.56  (** methods, scripts not yet implemented **)
   16.57  setup \<open>KEStore_Elems.add_mets
   16.58      [Specify.prep_met thy "met_diffapp" [] Celem.e_metID
   16.59        (["DiffApp"], [],
   16.60 -        {rew_ord'="tless_true", rls'=Atools_erls,calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.e_rls,
   16.61 +        {rew_ord'="tless_true", rls'=Atools_erls,calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty,
   16.62            crls = Atools_erls, errpats = [], nrls = norm_Rational (*, asm_rls=[],asm_thm=[]*)},
   16.63          @{thm refl})]
   16.64  \<close>
   16.65 @@ -131,7 +131,7 @@
   16.66                "interval i_tv","errorBound e_rr"]),
   16.67            ("#Find"  ,["valuesFor v_s"]),
   16.68            ("#Relate",[])],
   16.69 -      {rew_ord'="tless_true",rls'=eval_rls,calc=[],srls=prog_expr,prls=Rule_Set.e_rls, crls = eval_rls,
   16.70 +      {rew_ord'="tless_true",rls'=eval_rls,calc=[],srls=prog_expr,prls=Rule_Set.empty, crls = eval_rls,
   16.71          errpats = [], nrls = norm_Rational (*,  asm_rls=[],asm_thm=[]*)},
   16.72        @{thm maximum_value.simps})]
   16.73  \<close>
   16.74 @@ -156,7 +156,7 @@
   16.75        (["DiffApp","make_fun_by_new_variable"],
   16.76          [("#Given" ,["functionOf f_f","boundVariable v_v","equalities eqs"]),
   16.77            ("#Find"  ,["functionEq f_1"])],
   16.78 -        {rew_ord'="tless_true",rls'=eval_rls,srls=prog_expr,prls=Rule_Set.e_rls, calc=[], crls = eval_rls,
   16.79 +        {rew_ord'="tless_true",rls'=eval_rls,srls=prog_expr,prls=Rule_Set.empty, calc=[], crls = eval_rls,
   16.80            errpats = [], nrls = norm_Rational(*,asm_rls=[],asm_thm=[]*)},
   16.81          @{thm make_fun_by_new_variable.simps})]
   16.82  \<close>
   16.83 @@ -176,7 +176,7 @@
   16.84        (["DiffApp","make_fun_by_explicit"],
   16.85          [("#Given" ,["functionOf f_f","boundVariable v_v","equalities eqs"]),
   16.86            ("#Find"  ,["functionEq f_1"])],
   16.87 -        {rew_ord'="tless_true",rls'=eval_rls,calc=[],srls=prog_expr,prls=Rule_Set.e_rls, crls = eval_rls,
   16.88 +        {rew_ord'="tless_true",rls'=eval_rls,calc=[],srls=prog_expr,prls=Rule_Set.empty, crls = eval_rls,
   16.89            errpats = [], nrls = norm_Rational (*, asm_rls=[],asm_thm=[]*)},
   16.90          @{thm make_fun_by_explicit.simps})]
   16.91  \<close>
   16.92 @@ -185,17 +185,17 @@
   16.93        (["DiffApp","max_on_interval_by_calculus"],
   16.94          [("#Given" ,["functionEq t_t","boundVariable v_v","interval i_tv"(*, "errorBound e_rr"*)]),
   16.95            ("#Find"  ,["maxArgument v_0"])],
   16.96 -      {rew_ord'="tless_true",rls'=eval_rls,calc=[],srls = Rule_Set.e_rls,prls=Rule_Set.e_rls, crls = eval_rls,
   16.97 +      {rew_ord'="tless_true",rls'=eval_rls,calc=[],srls = Rule_Set.empty,prls=Rule_Set.empty, crls = eval_rls,
   16.98          errpats = [], nrls = norm_Rational (*, asm_rls=[],asm_thm=[]*)},
   16.99        @{thm refl}),
  16.100      Specify.prep_met thy "met_diffapp_findvals" [] Celem.e_metID
  16.101        (["DiffApp","find_values"], [],
  16.102 -        {rew_ord'="tless_true",rls'=eval_rls,calc=[],srls = Rule_Set.e_rls,prls=Rule_Set.e_rls, crls = eval_rls,
  16.103 +        {rew_ord'="tless_true",rls'=eval_rls,calc=[],srls = Rule_Set.empty,prls=Rule_Set.empty, crls = eval_rls,
  16.104            errpats = [], nrls = norm_Rational(*, asm_rls = [], asm_thm = []*)},
  16.105          @{thm refl})]
  16.106  \<close>
  16.107  ML \<open>
  16.108 -val prog_expr = Rule_Set.append_rls "prog_expr" prog_expr
  16.109 +val prog_expr = Rule_Set.append_rules "prog_expr" prog_expr
  16.110    [Rule.Thm ("filterVar_Const", TermC.num_str @{thm filterVar_Const}),
  16.111     Rule.Thm ("filterVar_Nil", TermC.num_str @{thm filterVar_Nil})];
  16.112  \<close>
    17.1 --- a/src/Tools/isac/Knowledge/DiophantEq.thy	Mon Apr 06 11:44:36 2020 +0200
    17.2 +++ b/src/Tools/isac/Knowledge/DiophantEq.thy	Wed Apr 08 12:32:51 2020 +0200
    17.3 @@ -21,7 +21,7 @@
    17.4            (*                                      TODO: drop ^^^^^*)
    17.5            ("#Where" ,[]),
    17.6            ("#Find"  ,["boolTestFind s_s"])],
    17.7 -        Rule_Set.e_rls, SOME "solve (e_e::bool, v_v::int)", [["LinEq","solve_lineq_equation"]]))]\<close>
    17.8 +        Rule_Set.empty, SOME "solve (e_e::bool, v_v::int)", [["LinEq","solve_lineq_equation"]]))]\<close>
    17.9  
   17.10  text \<open>method solving the usecase\<close>
   17.11  
   17.12 @@ -39,7 +39,7 @@
   17.13            (*                                      TODO: drop ^^^^^*)
   17.14            ("#Where" ,[]),
   17.15            ("#Find"  ,["boolTestFind s_s"])],
   17.16 -        {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = Rule_Set.e_rls, prls = Rule_Set.e_rls, calc = [],
   17.17 +        {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = Rule_Set.empty, prls = Rule_Set.empty, calc = [],
   17.18            crls = tval_rls, errpats = [], nrls = Test_simplify},
   17.19          @{thm diophant_equation.simps})]
   17.20  \<close>
    18.1 --- a/src/Tools/isac/Knowledge/EqSystem.thy	Mon Apr 06 11:44:36 2020 +0200
    18.2 +++ b/src/Tools/isac/Knowledge/EqSystem.thy	Wed Apr 08 12:32:51 2020 +0200
    18.3 @@ -173,7 +173,7 @@
    18.4    Rule_Def.Repeat{id = "order_add_mult_System", preconds = [], 
    18.5        rew_ord = ("ord_simplify_System",
    18.6  		 ord_simplify_System false @{theory "Integrate"}),
    18.7 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty, calc = [], errpatts = [],
    18.8 +      erls = Rule_Set.empty,srls = Rule_Set.Empty, calc = [], errpatts = [],
    18.9        rules = [Rule.Thm ("mult_commute",TermC.num_str @{thm mult.commute}),
   18.10  	       (* z * w = w * z *)
   18.11  	       Rule.Thm ("real_mult_left_commute",TermC.num_str @{thm real_mult_left_commute}),
   18.12 @@ -281,7 +281,7 @@
   18.13        scr = Rule.EmptyScr};      
   18.14  (*
   18.15  val simplify_System = 
   18.16 -    Rule_Set.append_rls "simplify_System" simplify_System_parenthesized
   18.17 +    Rule_Set.append_rules "simplify_System" simplify_System_parenthesized
   18.18  	       [Rule.Thm ("sym_add_assoc",
   18.19                        TermC.num_str (@{thm add.assoc} RS @{thm sym}))];
   18.20  *)
   18.21 @@ -290,7 +290,7 @@
   18.22  val isolate_bdvs = 
   18.23      Rule_Def.Repeat {id="isolate_bdvs", preconds = [], 
   18.24  	 rew_ord = ("e_rew_ord", Rule.e_rew_ord), 
   18.25 -	 erls = Rule_Set.append_rls "erls_isolate_bdvs" Rule_Set.e_rls 
   18.26 +	 erls = Rule_Set.append_rules "erls_isolate_bdvs" Rule_Set.empty 
   18.27  			   [(Rule.Num_Calc ("EqSystem.occur'_exactly'_in", 
   18.28  				   eval_occur_exactly_in 
   18.29  				       "#eval_occur_exactly_in_"))
   18.30 @@ -306,8 +306,8 @@
   18.31  val isolate_bdvs_4x4 = 
   18.32      Rule_Def.Repeat {id="isolate_bdvs_4x4", preconds = [], 
   18.33  	 rew_ord = ("e_rew_ord", Rule.e_rew_ord), 
   18.34 -	 erls = Rule_Set.append_rls 
   18.35 -		    "erls_isolate_bdvs_4x4" Rule_Set.e_rls 
   18.36 +	 erls = Rule_Set.append_rules 
   18.37 +		    "erls_isolate_bdvs_4x4" Rule_Set.empty 
   18.38  		    [Rule.Num_Calc ("EqSystem.occur'_exactly'_in", 
   18.39  			   eval_occur_exactly_in "#eval_occur_exactly_in_"),
   18.40  		     Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   18.41 @@ -410,20 +410,20 @@
   18.42        (["system"],
   18.43          [("#Given" ,["equalities e_s", "solveForVars v_s"]),
   18.44            ("#Find"  ,["solution ss'''"](*''' is copy-named*))],
   18.45 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)], SOME "solveSystem e_s v_s", [])),
   18.46 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], SOME "solveSystem e_s v_s", [])),
   18.47      (Specify.prep_pbt thy "pbl_equsys_lin" [] Celem.e_pblID
   18.48        (["LINEAR", "system"],
   18.49          [("#Given" ,["equalities e_s", "solveForVars v_s"]),
   18.50            (*TODO.WN050929 check linearity*)
   18.51            ("#Find"  ,["solution ss'''"])],
   18.52 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)], SOME "solveSystem e_s v_s", [])),
   18.53 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], SOME "solveSystem e_s v_s", [])),
   18.54      (Specify.prep_pbt thy "pbl_equsys_lin_2x2" [] Celem.e_pblID
   18.55        (["2x2", "LINEAR", "system"],
   18.56        (*~~~~~~~~~~~~~~~~~~~~~~~~~*)
   18.57          [("#Given" ,["equalities e_s", "solveForVars v_s"]),
   18.58            ("#Where"  ,["LENGTH (e_s:: bool list) = 2", "LENGTH v_s = 2"]),
   18.59            ("#Find"  ,["solution ss'''"])],
   18.60 -        Rule_Set.append_rls "prls_2x2_linear_system" Rule_Set.e_rls 
   18.61 +        Rule_Set.append_rules "prls_2x2_linear_system" Rule_Set.empty 
   18.62  			    [Rule.Thm ("LENGTH_CONS",TermC.num_str @{thm LENGTH_CONS}),
   18.63  			      Rule.Thm ("LENGTH_NIL",TermC.num_str @{thm LENGTH_NIL}),
   18.64  			      Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   18.65 @@ -441,7 +441,7 @@
   18.66        (["normalise", "2x2", "LINEAR", "system"],
   18.67          [("#Given" ,["equalities e_s", "solveForVars v_s"]),
   18.68            ("#Find"  ,["solution ss'''"])],
   18.69 -      Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)], 
   18.70 +      Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], 
   18.71        SOME "solveSystem e_s v_s", 
   18.72        [["EqSystem","normalise","2x2"]])),
   18.73      (Specify.prep_pbt thy "pbl_equsys_lin_3x3" [] Celem.e_pblID
   18.74 @@ -450,7 +450,7 @@
   18.75          [("#Given" ,["equalities e_s", "solveForVars v_s"]),
   18.76            ("#Where"  ,["LENGTH (e_s:: bool list) = 3", "LENGTH v_s = 3"]),
   18.77            ("#Find"  ,["solution ss'''"])],
   18.78 -        Rule_Set.append_rls "prls_3x3_linear_system" Rule_Set.e_rls 
   18.79 +        Rule_Set.append_rules "prls_3x3_linear_system" Rule_Set.empty 
   18.80  			    [Rule.Thm ("LENGTH_CONS",TermC.num_str @{thm LENGTH_CONS}),
   18.81  			      Rule.Thm ("LENGTH_NIL",TermC.num_str @{thm LENGTH_NIL}),
   18.82  			      Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   18.83 @@ -462,7 +462,7 @@
   18.84          [("#Given" ,["equalities e_s", "solveForVars v_s"]),
   18.85            ("#Where"  ,["LENGTH (e_s:: bool list) = 4", "LENGTH v_s = 4"]),
   18.86            ("#Find"  ,["solution ss'''"])],
   18.87 -        Rule_Set.append_rls "prls_4x4_linear_system" Rule_Set.e_rls 
   18.88 +        Rule_Set.append_rules "prls_4x4_linear_system" Rule_Set.empty 
   18.89  			    [Rule.Thm ("LENGTH_CONS",TermC.num_str @{thm LENGTH_CONS}),
   18.90  			      Rule.Thm ("LENGTH_NIL",TermC.num_str @{thm LENGTH_NIL}),
   18.91  			      Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   18.92 @@ -477,7 +477,7 @@
   18.93                "(NTH 3 (v_s::real list)) occurs_in (NTH 3 (e_s::bool list))",
   18.94                "(NTH 4 (v_s::real list)) occurs_in (NTH 4 (e_s::bool list))"]),
   18.95            ("#Find"  ,["solution ss'''"])],
   18.96 -      Rule_Set.append_rls "prls_tri_4x4_lin_sys" prls_triangular
   18.97 +      Rule_Set.append_rules "prls_tri_4x4_lin_sys" prls_triangular
   18.98  	      [Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in "")], 
   18.99        SOME "solveSystem e_s v_s", 
  18.100        [["EqSystem","top_down_substitution","4x4"]])),
  18.101 @@ -486,7 +486,7 @@
  18.102          [("#Given" ,["equalities e_s", "solveForVars v_s"]),
  18.103            (*LENGTH is checked 1 level above*)
  18.104            ("#Find"  ,["solution ss'''"])],
  18.105 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)], 
  18.106 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], 
  18.107          SOME "solveSystem e_s v_s", 
  18.108          [["EqSystem","normalise","4x4"]]))]\<close>
  18.109  
  18.110 @@ -495,7 +495,7 @@
  18.111  val srls = Rule_Def.Repeat {id="srls_normalise_4x4", 
  18.112  		preconds = [], 
  18.113  		rew_ord = ("termlessI",termlessI), 
  18.114 -		erls = Rule_Set.append_rls "erls_in_srls_IntegrierenUnd.." Rule_Set.e_rls
  18.115 +		erls = Rule_Set.append_rules "erls_in_srls_IntegrierenUnd.." Rule_Set.empty
  18.116  				  [(*for asm in NTH_CONS ...*)
  18.117  				   Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
  18.118  				   (*2nd NTH_CONS pushes n+-1 into asms*)
  18.119 @@ -550,7 +550,7 @@
  18.120                "    v_s  from v_s occur_exactly_in (NTH 2 (e_s::bool list))"]),
  18.121            ("#Find"  ,["solution ss'''"])],
  18.122  	      {rew_ord'="ord_simplify_System", rls' = Rule_Set.Empty, calc = [], 
  18.123 -	        srls = Rule_Set.append_rls "srls_top_down_2x2" Rule_Set.e_rls
  18.124 +	        srls = Rule_Set.append_rules "srls_top_down_2x2" Rule_Set.empty
  18.125  				      [Rule.Thm ("hd_thm",TermC.num_str @{thm hd_thm}),
  18.126  				        Rule.Thm ("tl_Cons",TermC.num_str @{thm tl_Cons}),
  18.127  				        Rule.Thm ("tl_Nil",TermC.num_str @{thm tl_Nil})], 
  18.128 @@ -585,7 +585,7 @@
  18.129  	      [("#Given" ,["equalities e_s", "solveForVars v_s"]),
  18.130  		      ("#Find"  ,["solution ss'''"])],
  18.131  	      {rew_ord'="tless_true", rls' = Rule_Set.Empty, calc = [], 
  18.132 -	        srls = Rule_Set.append_rls "srls_normalise_2x2" Rule_Set.e_rls
  18.133 +	        srls = Rule_Set.append_rules "srls_normalise_2x2" Rule_Set.empty
  18.134  				      [Rule.Thm ("hd_thm",TermC.num_str @{thm hd_thm}),
  18.135  				        Rule.Thm ("tl_Cons",TermC.num_str @{thm tl_Cons}),
  18.136  				        Rule.Thm ("tl_Nil",TermC.num_str @{thm tl_Nil})], 
  18.137 @@ -617,7 +617,7 @@
  18.138  	       [("#Given" ,["equalities e_s", "solveForVars v_s"]),
  18.139  	         ("#Find"  ,["solution ss'''"])],
  18.140  	       {rew_ord'="tless_true", rls' = Rule_Set.Empty, calc = [], 
  18.141 -	         srls = Rule_Set.append_rls "srls_normalise_4x4" srls
  18.142 +	         srls = Rule_Set.append_rules "srls_normalise_4x4" srls
  18.143  	             [Rule.Thm ("hd_thm",TermC.num_str @{thm hd_thm}),
  18.144  	               Rule.Thm ("tl_Cons",TermC.num_str @{thm tl_Cons}),
  18.145  	               Rule.Thm ("tl_Nil",TermC.num_str @{thm tl_Nil})], 
  18.146 @@ -654,8 +654,8 @@
  18.147                "(NTH 4 (v_s::real list)) occurs_in (NTH 4 (e_s::bool list))"]),
  18.148  	        ("#Find", ["solution ss'''"])],
  18.149  	    {rew_ord'="ord_simplify_System", rls' = Rule_Set.Empty, calc = [], 
  18.150 -	      srls = Rule_Set.append_rls "srls_top_down_4x4" srls [], 
  18.151 -	      prls = Rule_Set.append_rls "prls_tri_4x4_lin_sys" prls_triangular
  18.152 +	      srls = Rule_Set.append_rules "srls_top_down_4x4" srls [], 
  18.153 +	      prls = Rule_Set.append_rules "prls_tri_4x4_lin_sys" prls_triangular
  18.154  			      [Rule.Num_Calc ("Prog_Expr.occurs'_in", Prog_Expr.eval_occurs_in "")], 
  18.155  	      crls = Rule_Set.Empty, errpats = [], nrls = Rule_Set.Empty},
  18.156  	    (*FIXXXXME.WN060916: this script works ONLY for exp 7.79 #>#>#>#>#>#>#>#>#>#>*)
    19.1 --- a/src/Tools/isac/Knowledge/Equation.thy	Mon Apr 06 11:44:36 2020 +0200
    19.2 +++ b/src/Tools/isac/Knowledge/Equation.thy	Wed Apr 08 12:32:51 2020 +0200
    19.3 @@ -37,7 +37,7 @@
    19.4  val ctxt = Rule.thy2ctxt thy;
    19.5  
    19.6  val univariate_equation_prls = 
    19.7 -    Rule_Set.append_rls "univariate_equation_prls" Rule_Set.e_rls 
    19.8 +    Rule_Set.append_rules "univariate_equation_prls" Rule_Set.empty 
    19.9  	       [Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "")];
   19.10  \<close>
   19.11  setup \<open>KEStore_Elems.add_rlss [("univariate_equation_prls",
   19.12 @@ -48,7 +48,7 @@
   19.13          [("#Given" ,["equality e_e","solveFor v_v"]),
   19.14            ("#Where" ,["matches (?a = ?b) e_e"]),
   19.15            ("#Find"  ,["solutions v_v'i'"])],
   19.16 -        Rule_Set.append_rls "equation_prls" Rule_Set.e_rls  [Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "")],
   19.17 +        Rule_Set.append_rules "equation_prls" Rule_Set.empty  [Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "")],
   19.18          SOME "solve (e_e::bool, v_v)", [])),
   19.19      (Specify.prep_pbt thy "pbl_equ_univ" [] Celem.e_pblID
   19.20        (["univariate","equation"],
   19.21 @@ -83,8 +83,8 @@
   19.22  setup \<open>KEStore_Elems.add_mets
   19.23      [Specify.prep_met thy "met_equ" [] Celem.e_metID
   19.24  	    (["Equation"], [],
   19.25 -	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls, crls = Atools_erls,
   19.26 -          errpats = [], nrls = Rule_Set.e_rls},
   19.27 +	      {rew_ord'="tless_true", rls'=Rule_Set.Empty, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty, crls = Atools_erls,
   19.28 +          errpats = [], nrls = Rule_Set.empty},
   19.29          @{thm refl})]
   19.30  \<close>
   19.31  
    20.1 --- a/src/Tools/isac/Knowledge/InsSort.thy	Mon Apr 06 11:44:36 2020 +0200
    20.2 +++ b/src/Tools/isac/Knowledge/InsSort.thy	Wed Apr 08 12:32:51 2020 +0200
    20.3 @@ -48,8 +48,8 @@
    20.4  ML \<open>
    20.5  val ins_sort = 
    20.6    Rule_Def.Repeat {
    20.7 -    id = "ins_sort", preconds = [], rew_ord = ("tless_true", tless_true), erls = Rule_Set.e_rls,
    20.8 -    srls = Rule_Set.e_rls, calc = [], rules = [
    20.9 +    id = "ins_sort", preconds = [], rew_ord = ("tless_true", tless_true), erls = Rule_Set.empty,
   20.10 +    srls = Rule_Set.empty, calc = [], rules = [
   20.11        Rule.Thm ("xfoldr_Nil",(*num_str*) @{thm xfoldr_Nil} (* foldr ?f [] = id *)),
   20.12  	    Rule.Thm ("xfoldr_Cons", @{thm xfoldr_Cons} (* foldr ?f (?x # ?xs) = ?f ?x \<circ> foldr ?f ?xs *)),
   20.13  
   20.14 @@ -73,13 +73,13 @@
   20.15  section \<open>problems\<close>
   20.16  setup \<open>KEStore_Elems.add_pbts
   20.17    [(Specify.prep_pbt @{theory} "pbl_Programming" [] Celem.e_pblID 
   20.18 -     (["Programming"], [], Rule_Set.e_rls, NONE, [])),
   20.19 +     (["Programming"], [], Rule_Set.empty, NONE, [])),
   20.20     (Specify.prep_pbt @{theory} "pbl_Prog_sort" [] Celem.e_pblID 
   20.21 -     (["SORT","Programming"], [], Rule_Set.e_rls, NONE, [])),
   20.22 +     (["SORT","Programming"], [], Rule_Set.empty, NONE, [])),
   20.23     (Specify.prep_pbt @{theory} "pbl_Prog_sort_ins" [] Celem.e_pblID
   20.24       (["insertion","SORT","Programming"], 
   20.25       [("#Given", ["unsorted u_u"]), ("#Find", ["sorted s_s"])], 
   20.26 -     Rule_Set.e_rls, 
   20.27 +     Rule_Set.empty, 
   20.28       SOME "Sort u_u", [["Programming","SORT","insertion_steps"]]))]\<close>
   20.29  
   20.30  section \<open>methods\<close>
   20.31 @@ -87,12 +87,12 @@
   20.32  setup \<open>KEStore_Elems.add_mets
   20.33    [ Specify.prep_met @{theory} "met_Programming" [] Celem.e_metID
   20.34        (["Programming"], [],
   20.35 -        {rew_ord'="tless_true",rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.e_rls,
   20.36 -          crls = Rule_Set.e_rls, errpats = [], nrls = Rule_Set.e_rls}, @{thm refl}),
   20.37 +        {rew_ord'="tless_true",rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty,
   20.38 +          crls = Rule_Set.empty, errpats = [], nrls = Rule_Set.empty}, @{thm refl}),
   20.39      Specify.prep_met @{theory} "met_Prog_sort" [] Celem.e_metID
   20.40        (["Programming","SORT"], [],
   20.41 -        {rew_ord'="tless_true",rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.e_rls,
   20.42 -          crls = Rule_Set.e_rls, errpats = [], nrls = Rule_Set.e_rls},
   20.43 +        {rew_ord'="tless_true",rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty,
   20.44 +          crls = Rule_Set.empty, errpats = [], nrls = Rule_Set.empty},
   20.45          @{thm refl})]
   20.46  \<close>
   20.47  
   20.48 @@ -107,7 +107,7 @@
   20.49     [Specify.prep_met @{theory} "met_Prog_sort_ins" [] Celem.e_metID
   20.50        (["Programming","SORT","insertion"], 
   20.51        [("#Given", ["unsorted u_u"]), ("#Find", ["sorted s_s"])],
   20.52 -        {rew_ord'="tless_true",rls' = Atools_erls, calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.e_rls,
   20.53 +        {rew_ord'="tless_true",rls' = Atools_erls, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty,
   20.54            crls = Atools_crls, errpats = [], nrls = norm_Rational},
   20.55          @{thm sort_program.simps})]
   20.56  \<close>
   20.57 @@ -137,7 +137,7 @@
   20.58     [Specify.prep_met @{theory} "met_Prog_sort_ins_steps" [] Celem.e_metID
   20.59        (["Programming","SORT","insertion_steps"], 
   20.60        [("#Given", ["unsorted u_u"]), ("#Find", ["sorted s_s"])],
   20.61 -        {rew_ord'="tless_true",rls' = Atools_erls, calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.e_rls,
   20.62 +        {rew_ord'="tless_true",rls' = Atools_erls, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty,
   20.63            crls = Atools_crls, errpats = [], nrls = norm_Rational},
   20.64          @{thm sort_program2.simps})]
   20.65  \<close>
    21.1 --- a/src/Tools/isac/Knowledge/Integrate.thy	Mon Apr 06 11:44:36 2020 +0200
    21.2 +++ b/src/Tools/isac/Knowledge/Integrate.thy	Wed Apr 08 12:32:51 2020 +0200
    21.3 @@ -169,8 +169,8 @@
    21.4  	      Rule.Rls_ (*rat_mult_div_pow original corrected WN051028*)
    21.5  		  (Rule_Def.Repeat {id = "rat_mult_div_pow", preconds = [], 
    21.6  		       rew_ord = ("dummy_ord",Rule.dummy_ord), 
    21.7 -		       erls = (*FIXME.WN051028 Rule_Set.e_rls,*)
    21.8 -		       Rule_Set.append_rls "Rule_Set.e_rls-is_polyexp" Rule_Set.e_rls
    21.9 +		       erls = (*FIXME.WN051028 Rule_Set.empty,*)
   21.10 +		       Rule_Set.append_rules "Rule_Set.empty-is_polyexp" Rule_Set.empty
   21.11  				  [Rule.Num_Calc ("Poly.is'_polyexp", 
   21.12  					 eval_is_polyexp "")],
   21.13  				  srls = Rule_Set.Empty, calc = [], errpatts = [],
   21.14 @@ -226,7 +226,7 @@
   21.15     *1* expand the term, ie. distribute * and / over +
   21.16  .*)
   21.17  val separate_bdv2 =
   21.18 -    Rule_Set.append_rls "separate_bdv2"
   21.19 +    Rule_Set.append_rules "separate_bdv2"
   21.20  	       collect_bdv
   21.21  	       [Rule.Thm ("separate_bdv", TermC.num_str @{thm separate_bdv}),
   21.22  		(*"?a * ?bdv / ?b = ?a / ?b * ?bdv"*)
   21.23 @@ -279,7 +279,7 @@
   21.24  * 	       Rule.Rls_ discard_parentheses,
   21.25  * 	       Rule.Rls_ collect_bdv,
   21.26  * 	       (*below inserted from 'make_ratpoly_in'*)
   21.27 -* 	       Rule.Rls_ (Rule_Set.append_rls "separate_bdv"
   21.28 +* 	       Rule.Rls_ (Rule_Set.append_rules "separate_bdv"
   21.29  * 			 collect_bdv
   21.30  * 			 [Rule.Thm ("separate_bdv", TermC.num_str @{thm separate_bdv}),
   21.31  * 			  (*"?a * ?bdv / ?b = ?a / ?b * ?bdv"*)
   21.32 @@ -335,7 +335,7 @@
   21.33        (["integrate","function"],
   21.34          [("#Given" ,["functionTerm f_f", "integrateBy v_v"]),
   21.35            ("#Find"  ,["antiDerivative F_F"])],
   21.36 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)], 
   21.37 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], 
   21.38          SOME "Integrate (f_f, v_v)", 
   21.39          [["diff","integration"]])),
   21.40      (*here "named" is used differently from Differentiation"*)
   21.41 @@ -343,7 +343,7 @@
   21.42        (["named","integrate","function"],
   21.43          [("#Given" ,["functionTerm f_f", "integrateBy v_v"]),
   21.44            ("#Find"  ,["antiDerivativeName F_F"])],
   21.45 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)], 
   21.46 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], 
   21.47          SOME "Integrate (f_f, v_v)", 
   21.48          [["diff","integration","named"]]))]\<close>
   21.49  
   21.50 @@ -360,8 +360,8 @@
   21.51      [Specify.prep_met thy "met_diffint" [] Celem.e_metID
   21.52  	    (["diff","integration"],
   21.53  	      [("#Given" ,["functionTerm f_f", "integrateBy v_v"]), ("#Find"  ,["antiDerivative F_F"])],
   21.54 -	      {rew_ord'="tless_true", rls'=Atools_erls, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
   21.55 -	        crls = Atools_erls, errpats = [], nrls = Rule_Set.e_rls},
   21.56 +	      {rew_ord'="tless_true", rls'=Atools_erls, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
   21.57 +	        crls = Atools_erls, errpats = [], nrls = Rule_Set.empty},
   21.58  	      @{thm integrate.simps})]
   21.59  \<close>
   21.60  
   21.61 @@ -379,8 +379,8 @@
   21.62  	    (["diff","integration","named"],
   21.63  	      [("#Given" ,["functionTerm f_f", "integrateBy v_v"]),
   21.64  	        ("#Find"  ,["antiDerivativeName F_F"])],
   21.65 -	      {rew_ord'="tless_true", rls'=Atools_erls, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
   21.66 -          crls = Atools_erls, errpats = [], nrls = Rule_Set.e_rls},
   21.67 +	      {rew_ord'="tless_true", rls'=Atools_erls, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
   21.68 +          crls = Atools_erls, errpats = [], nrls = Rule_Set.empty},
   21.69          @{thm intergrate_named.simps})]
   21.70  \<close>
   21.71  
    22.1 --- a/src/Tools/isac/Knowledge/Inverse_Z_Transform.thy	Mon Apr 06 11:44:36 2020 +0200
    22.2 +++ b/src/Tools/isac/Knowledge/Inverse_Z_Transform.thy	Wed Apr 08 12:32:51 2020 +0200
    22.3 @@ -46,14 +46,14 @@
    22.4  val thy = @{theory};
    22.5  \<close>
    22.6  setup \<open>KEStore_Elems.add_pbts
    22.7 -  [(Specify.prep_pbt thy "pbl_SP" [] Celem.e_pblID (["SignalProcessing"], [], Rule_Set.e_rls, NONE, [])),
    22.8 +  [(Specify.prep_pbt thy "pbl_SP" [] Celem.e_pblID (["SignalProcessing"], [], Rule_Set.empty, NONE, [])),
    22.9      (Specify.prep_pbt thy "pbl_SP_Ztrans" [] Celem.e_pblID
   22.10 -      (["Z_Transform","SignalProcessing"], [], Rule_Set.e_rls, NONE, [])),
   22.11 +      (["Z_Transform","SignalProcessing"], [], Rule_Set.empty, NONE, [])),
   22.12      (Specify.prep_pbt thy "pbl_SP_Ztrans_inv" [] Celem.e_pblID
   22.13        (["Inverse", "Z_Transform", "SignalProcessing"],
   22.14          [("#Given" , ["filterExpression X_eq"]),
   22.15            ("#Find"  ,["stepResponse n_eq"])], \<comment> \<open>TODO: unused, "u [n]" is introduced by rule1..6\<close>
   22.16 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)], NONE, 
   22.17 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], NONE, 
   22.18          [["SignalProcessing","Z_Transform","Inverse"]]))]\<close>
   22.19  
   22.20  subsection \<open>Setup Parent Nodes in Hierarchy of Method\<close>
   22.21 @@ -61,12 +61,12 @@
   22.22  setup \<open>KEStore_Elems.add_mets
   22.23      [Specify.prep_met thy "met_SP" [] Celem.e_metID
   22.24        (["SignalProcessing"], [],
   22.25 -        {rew_ord'="tless_true", rls'= Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.e_rls, crls = Rule_Set.e_rls,
   22.26 -          errpats = [], nrls = Rule_Set.e_rls}, @{thm refl}),
   22.27 +        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty, crls = Rule_Set.empty,
   22.28 +          errpats = [], nrls = Rule_Set.empty}, @{thm refl}),
   22.29      Specify.prep_met thy "met_SP_Ztrans" [] Celem.e_metID
   22.30        (["SignalProcessing", "Z_Transform"], [],
   22.31 -        {rew_ord'="tless_true", rls'= Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.e_rls, crls = Rule_Set.e_rls,
   22.32 -          errpats = [], nrls = Rule_Set.e_rls}, @{thm refl})]
   22.33 +        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty, crls = Rule_Set.empty,
   22.34 +          errpats = [], nrls = Rule_Set.empty}, @{thm refl})]
   22.35  \<close>
   22.36  
   22.37  partial_function (tailrec) inverse_ztransform :: "bool \<Rightarrow> real \<Rightarrow> bool"
   22.38 @@ -91,8 +91,8 @@
   22.39        (["SignalProcessing", "Z_Transform", "Inverse"],
   22.40          [("#Given" ,["filterExpression X_eq", "functionName X_z"]),
   22.41            ("#Find"  ,["stepResponse n_eq"])], \<comment> \<open>TODO: unused, "u [n]" is introduced by rule1..6\<close>
   22.42 -        {rew_ord'="tless_true", rls'= Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.e_rls, crls = Rule_Set.e_rls,
   22.43 -          errpats = [], nrls = Rule_Set.e_rls},
   22.44 +        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty, crls = Rule_Set.empty,
   22.45 +          errpats = [], nrls = Rule_Set.empty},
   22.46          @{thm inverse_ztransform.simps})]
   22.47  \<close>
   22.48  
   22.49 @@ -119,10 +119,10 @@
   22.50        (["SignalProcessing", "Z_Transform", "Inverse_sub"],
   22.51          [("#Given" ,["filterExpression X_eq", "functionName X_z"]),
   22.52            ("#Find"  ,["stepResponse n_eq"])], \<comment> \<open>TODO: unused, "u [n]" is introduced by rule1..6\<close>
   22.53 -        {rew_ord'="tless_true", rls'= Rule_Set.e_rls, calc = [],
   22.54 +        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [],
   22.55            srls = Rule_Def.Repeat {id="srls_partial_fraction", 
   22.56                preconds = [], rew_ord = ("termlessI",termlessI),
   22.57 -              erls = Rule_Set.append_rls "erls_in_srls_partial_fraction" Rule_Set.e_rls
   22.58 +              erls = Rule_Set.append_rules "erls_in_srls_partial_fraction" Rule_Set.empty
   22.59                    [(*for asm in NTH_CONS ...*)
   22.60                      Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   22.61                      (*2nd NTH_CONS pushes n+-1 into asms*)
   22.62 @@ -139,7 +139,7 @@
   22.63                    Rule.Num_Calc ("Partial_Fractions.factors_from_solution",
   22.64                      eval_factors_from_solution "#factors_from_solution")
   22.65                    ], scr = Rule.EmptyScr},
   22.66 -          prls = Rule_Set.e_rls, crls = Rule_Set.e_rls, errpats = [], nrls = norm_Rational},
   22.67 +          prls = Rule_Set.empty, crls = Rule_Set.empty, errpats = [], nrls = norm_Rational},
   22.68          @{thm inverse_ztransform2.simps})]
   22.69  \<close>
   22.70  ML \<open>
    23.1 --- a/src/Tools/isac/Knowledge/LinEq.thy	Mon Apr 06 11:44:36 2020 +0200
    23.2 +++ b/src/Tools/isac/Knowledge/LinEq.thy	Wed Apr 08 12:32:51 2020 +0200
    23.3 @@ -26,7 +26,7 @@
    23.4  val thy = @{theory};
    23.5  
    23.6  val LinEq_prls = (*3.10.02:just the following order due to subterm evaluation*)
    23.7 -  Rule_Set.append_rls "LinEq_prls" Rule_Set.e_rls 
    23.8 +  Rule_Set.append_rules "LinEq_prls" Rule_Set.empty 
    23.9  	     [Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   23.10  	      Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   23.11  	      Rule.Num_Calc ("Prog_Expr.lhs"    , Prog_Expr.eval_lhs ""),
   23.12 @@ -44,7 +44,7 @@
   23.13                ];
   23.14  (* ----- erls ----- *)
   23.15  val LinEq_crls = 
   23.16 -   Rule_Set.append_rls "LinEq_crls" poly_crls
   23.17 +   Rule_Set.append_rules "LinEq_crls" poly_crls
   23.18     [Rule.Thm  ("real_assoc_1",TermC.num_str @{thm real_assoc_1})
   23.19      (*		
   23.20       Don't use
   23.21 @@ -55,7 +55,7 @@
   23.22  
   23.23  (* ----- crls ----- *)
   23.24  val LinEq_erls = 
   23.25 -   Rule_Set.append_rls "LinEq_erls" Poly_erls
   23.26 +   Rule_Set.append_rules "LinEq_erls" Poly_erls
   23.27     [Rule.Thm  ("real_assoc_1",TermC.num_str @{thm real_assoc_1})
   23.28      (*		
   23.29       Don't use
   23.30 @@ -129,7 +129,7 @@
   23.31  setup \<open>KEStore_Elems.add_mets
   23.32      [Specify.prep_met thy "met_eqlin" [] Celem.e_metID
   23.33        (["LinEq"], [],
   23.34 -        {rew_ord' = "tless_true",rls' = Atools_erls,calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.e_rls,
   23.35 +        {rew_ord' = "tless_true",rls' = Atools_erls,calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty,
   23.36            crls = LinEq_crls, errpats = [], nrls = norm_Poly},
   23.37          @{thm refl})]
   23.38  \<close>
   23.39 @@ -156,7 +156,7 @@
   23.40          [("#Given", ["equality e_e", "solveFor v_v"]),
   23.41            ("#Where", ["Not ((lhs e_e) is_polyrat_in v_v)", "((lhs e_e)  has_degree_in v_v) = 1"]),
   23.42            ("#Find",  ["solutions v_v'i'"])],
   23.43 -        {rew_ord' = "termlessI", rls' = LinEq_erls, srls = Rule_Set.e_rls, prls = LinEq_prls, calc = [],
   23.44 +        {rew_ord' = "termlessI", rls' = LinEq_erls, srls = Rule_Set.empty, prls = LinEq_prls, calc = [],
   23.45            crls = LinEq_crls, errpats = [], nrls = norm_Poly},
   23.46          @{thm solve_linear_equation.simps})]
   23.47  \<close>
    24.1 --- a/src/Tools/isac/Knowledge/LogExp.thy	Mon Apr 06 11:44:36 2020 +0200
    24.2 +++ b/src/Tools/isac/Knowledge/LogExp.thy	Wed Apr 08 12:32:51 2020 +0200
    24.3 @@ -49,7 +49,7 @@
    24.4          [("#Given" ,["equality e_e","solveFor v_v"]),
    24.5            ("#Where" ,["matches ((?a log ?v_v) = ?b) e_e"]),
    24.6            ("#Find"  ,["solutions v_v'i'"])],
    24.7 -        {rew_ord' = "termlessI", rls' = PolyEq_erls, srls = Rule_Set.e_rls, prls = PolyEq_prls, calc = [],
    24.8 +        {rew_ord' = "termlessI", rls' = PolyEq_erls, srls = Rule_Set.empty, prls = PolyEq_prls, calc = [],
    24.9            crls = PolyEq_crls, errpats = [], nrls = norm_Rational},
   24.10          @{thm solve_log.simps})]
   24.11  \<close>
    25.1 --- a/src/Tools/isac/Knowledge/Partial_Fractions.thy	Mon Apr 06 11:44:36 2020 +0200
    25.2 +++ b/src/Tools/isac/Knowledge/Partial_Fractions.thy	Wed Apr 08 12:32:51 2020 +0200
    25.3 @@ -156,7 +156,7 @@
    25.4              ("#Where" ,["((get_numerator t_t) has_degree_in v_v) < 
    25.5                 ((get_denominator t_t) has_degree_in v_v)"]), TODO*)
    25.6            ("#Find"  ,["decomposedFunction p_p'''"])],
    25.7 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_ TODO*)], 
    25.8 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_ TODO*)], 
    25.9          NONE, 
   25.10          [["simplification","of_rationals","to_partial_fraction"]]))]\<close>
   25.11  
   25.12 @@ -166,7 +166,7 @@
   25.13    val srls_partial_fraction = Rule_Def.Repeat {id="srls_partial_fraction", 
   25.14      preconds = [],
   25.15      rew_ord = ("termlessI",termlessI),
   25.16 -    erls = Rule_Set.append_rls "erls_in_srls_partial_fraction" Rule_Set.e_rls
   25.17 +    erls = Rule_Set.append_rules "erls_in_srls_partial_fraction" Rule_Set.empty
   25.18        [(*for asm in NTH_CONS ...*)
   25.19         Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   25.20         (*2nd NTH_CONS pushes n+-1 into asms*)
   25.21 @@ -235,8 +235,8 @@
   25.22              ((get_denominator t_t) has_degree_in v_v)"]), TODO*)
   25.23            ("#Find"  ,["decomposedFunction p_p'''"])],
   25.24          (*f_f = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)), zzz: z*)
   25.25 -        {rew_ord'="tless_true", rls'= Rule_Set.e_rls, calc = [], srls = srls_partial_fraction, prls = Rule_Set.e_rls,
   25.26 -          crls = Rule_Set.e_rls, errpats = [], nrls = Rule_Set.e_rls},
   25.27 +        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = srls_partial_fraction, prls = Rule_Set.empty,
   25.28 +          crls = Rule_Set.empty, errpats = [], nrls = Rule_Set.empty},
   25.29          (*([], Frm), Problem (Partial_Fractions, [partial_fraction, rational, simplification])*)
   25.30          @{thm partial_fraction.simps})]
   25.31  \<close>
    26.1 --- a/src/Tools/isac/Knowledge/Poly.thy	Mon Apr 06 11:44:36 2020 +0200
    26.2 +++ b/src/Tools/isac/Knowledge/Poly.thy	Wed Apr 08 12:32:51 2020 +0200
    26.3 @@ -648,10 +648,10 @@
    26.4  subsubsection \<open>without specific order\<close>
    26.5  ML \<open>
    26.6  (* used only for merge *)
    26.7 -val calculate_Poly = Rule_Set.append_rls "calculate_PolyFIXXXME.not.impl." Rule_Set.e_rls [];
    26.8 +val calculate_Poly = Rule_Set.append_rules "calculate_PolyFIXXXME.not.impl." Rule_Set.empty [];
    26.9  
   26.10  (*.for evaluation of conditions in rewrite rules.*)
   26.11 -val Poly_erls = Rule_Set.append_rls "Poly_erls" Atools_erls
   26.12 +val Poly_erls = Rule_Set.append_rules "Poly_erls" Atools_erls
   26.13    [Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   26.14    Rule.Thm  ("real_unari_minus", TermC.num_str @{thm real_unari_minus}),
   26.15    Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   26.16 @@ -659,7 +659,7 @@
   26.17    Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   26.18    Rule.Num_Calc ("Prog_Expr.pow", (**)eval_binop "#power_")];
   26.19  
   26.20 -val poly_crls = Rule_Set.append_rls "poly_crls" Atools_crls
   26.21 +val poly_crls = Rule_Set.append_rules "poly_crls" Atools_crls
   26.22    [Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   26.23    Rule.Thm ("real_unari_minus", TermC.num_str @{thm real_unari_minus}),
   26.24    Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   26.25 @@ -670,7 +670,7 @@
   26.26  ML \<open>
   26.27  val expand =
   26.28    Rule_Def.Repeat {id = "expand", preconds = [], rew_ord = ("dummy_ord", Rule.dummy_ord),
   26.29 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty, calc = [], errpatts = [],
   26.30 +      erls = Rule_Set.empty,srls = Rule_Set.Empty, calc = [], errpatts = [],
   26.31        rules = [Rule.Thm ("distrib_right" , TermC.num_str @{thm distrib_right}),
   26.32  	       (*"(z1.0 + z2.0) * w = z1.0 * w + z2.0 * w"*)
   26.33  	       Rule.Thm ("distrib_left", TermC.num_str @{thm distrib_left})
   26.34 @@ -679,7 +679,7 @@
   26.35  
   26.36  val discard_minus =
   26.37    Rule_Def.Repeat {id = "discard_minus", preconds = [], rew_ord = ("dummy_ord", Rule.dummy_ord),
   26.38 -      erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
   26.39 +      erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   26.40        rules =
   26.41         [Rule.Thm ("real_diff_minus", TermC.num_str @{thm real_diff_minus}),
   26.42            (*"a - b = a + -1 * b"*)
   26.43 @@ -690,7 +690,7 @@
   26.44  val expand_poly_ = 
   26.45    Rule_Def.Repeat{id = "expand_poly_", preconds = [], 
   26.46        rew_ord = ("dummy_ord", Rule.dummy_ord),
   26.47 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty,
   26.48 +      erls = Rule_Set.empty,srls = Rule_Set.Empty,
   26.49        calc = [], errpatts = [],
   26.50        rules =
   26.51          [Rule.Thm ("real_plus_binom_pow4", TermC.num_str @{thm real_plus_binom_pow4}),
   26.52 @@ -724,7 +724,7 @@
   26.53  val expand_poly_rat_ = 
   26.54    Rule_Def.Repeat{id = "expand_poly_rat_", preconds = [], 
   26.55        rew_ord = ("dummy_ord", Rule.dummy_ord),
   26.56 -      erls =  Rule_Set.append_rls "Rule_Set.e_rls-is_polyexp" Rule_Set.e_rls
   26.57 +      erls =  Rule_Set.append_rules "Rule_Set.empty-is_polyexp" Rule_Set.empty
   26.58  	        [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")
   26.59  		 ],
   26.60        srls = Rule_Set.Empty,
   26.61 @@ -762,7 +762,7 @@
   26.62  val simplify_power_ = 
   26.63    Rule_Def.Repeat{id = "simplify_power_", preconds = [], 
   26.64        rew_ord = ("dummy_ord", Rule.dummy_ord),
   26.65 -      erls = Rule_Set.e_rls, srls = Rule_Set.Empty,
   26.66 +      erls = Rule_Set.empty, srls = Rule_Set.Empty,
   26.67        calc = [], errpatts = [],
   26.68        rules = [(*MG: Reihenfolge der folgenden 2 Rule.Thm muss so bleiben, wegen
   26.69  		a*(a*a) --> a*a^^^2 und nicht a*(a*a) --> a^^^2*a *)
   26.70 @@ -811,7 +811,7 @@
   26.71  val reduce_012_mult_ = 
   26.72    Rule_Def.Repeat{id = "reduce_012_mult_", preconds = [], 
   26.73        rew_ord = ("dummy_ord", Rule.dummy_ord),
   26.74 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty,
   26.75 +      erls = Rule_Set.empty,srls = Rule_Set.Empty,
   26.76        calc = [], errpatts = [],
   26.77        rules = [(* MG: folgende Rule.Thm müssen hier stehen bleiben: *)
   26.78                 Rule.Thm ("mult_1_right",TermC.num_str @{thm mult_1_right}),
   26.79 @@ -854,7 +854,7 @@
   26.80  val reduce_012_ = 
   26.81    Rule_Def.Repeat{id = "reduce_012_", preconds = [], 
   26.82        rew_ord = ("dummy_ord", Rule.dummy_ord),
   26.83 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty, calc = [], errpatts = [],
   26.84 +      erls = Rule_Set.empty,srls = Rule_Set.Empty, calc = [], errpatts = [],
   26.85        rules = [Rule.Thm ("mult_1_left",TermC.num_str @{thm mult_1_left}),                 
   26.86  	       (*"1 * z = z"*)
   26.87  	       Rule.Thm ("mult_zero_left",TermC.num_str @{thm mult_zero_left}),        
   26.88 @@ -873,7 +873,7 @@
   26.89  	       ], scr = Rule.EmptyScr};
   26.90  
   26.91  val discard_parentheses1 = 
   26.92 -    Rule_Set.append_rls "discard_parentheses1" Rule_Set.e_rls 
   26.93 +    Rule_Set.append_rules "discard_parentheses1" Rule_Set.empty 
   26.94  	       [Rule.Thm ("sym_mult_assoc",
   26.95                        TermC.num_str (@{thm mult.assoc} RS @{thm sym}))
   26.96  		(*"?z1.1 * (?z2.1 * ?z3.1) = ?z1.1 * ?z2.1 * ?z3.1"*)
   26.97 @@ -885,7 +885,7 @@
   26.98  val expand_poly =
   26.99    Rule_Def.Repeat{id = "expand_poly", preconds = [], 
  26.100        rew_ord = ("dummy_ord", Rule.dummy_ord),
  26.101 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty,
  26.102 +      erls = Rule_Set.empty,srls = Rule_Set.Empty,
  26.103        calc = [], errpatts = [],
  26.104        (*asm_thm = [],*)
  26.105        rules = [Rule.Thm ("distrib_right" ,TermC.num_str @{thm distrib_right}),
  26.106 @@ -924,7 +924,7 @@
  26.107  val simplify_power = 
  26.108    Rule_Def.Repeat{id = "simplify_power", preconds = [], 
  26.109        rew_ord = ("dummy_ord", Rule.dummy_ord),
  26.110 -      erls = Rule_Set.e_rls, srls = Rule_Set.Empty,
  26.111 +      erls = Rule_Set.empty, srls = Rule_Set.Empty,
  26.112        calc = [], errpatts = [],
  26.113        rules = [Rule.Thm ("realpow_multI", TermC.num_str @{thm realpow_multI}),
  26.114  	       (*"(r * s) ^^^ n = r ^^^ n * s ^^^ n"*)
  26.115 @@ -969,7 +969,7 @@
  26.116  val reduce_012 = 
  26.117    Rule_Def.Repeat{id = "reduce_012", preconds = [], 
  26.118        rew_ord = ("dummy_ord", Rule.dummy_ord),
  26.119 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty,
  26.120 +      erls = Rule_Set.empty,srls = Rule_Set.Empty,
  26.121        calc = [], errpatts = [],
  26.122        rules = [Rule.Thm ("mult_1_left",TermC.num_str @{thm mult_1_left}),                 
  26.123  	       (*"1 * z = z"*)
  26.124 @@ -995,7 +995,7 @@
  26.125  	       ], scr = Rule.EmptyScr};
  26.126  
  26.127  val discard_parentheses = 
  26.128 -    Rule_Set.append_rls "discard_parentheses" Rule_Set.e_rls 
  26.129 +    Rule_Set.append_rules "discard_parentheses" Rule_Set.empty 
  26.130  	       [Rule.Thm ("sym_mult_assoc",
  26.131                        TermC.num_str (@{thm mult.assoc} RS @{thm sym})),
  26.132  		Rule.Thm ("sym_add_assoc",
  26.133 @@ -1009,7 +1009,7 @@
  26.134  val order_add_mult = 
  26.135    Rule_Def.Repeat{id = "order_add_mult", preconds = [], 
  26.136        rew_ord = ("ord_make_polynomial",ord_make_polynomial false thy),
  26.137 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty,
  26.138 +      erls = Rule_Set.empty,srls = Rule_Set.Empty,
  26.139        calc = [], errpatts = [],
  26.140        rules = [Rule.Thm ("mult_commute",TermC.num_str @{thm mult.commute}),
  26.141  	       (* z * w = w * z *)
  26.142 @@ -1029,7 +1029,7 @@
  26.143  val order_mult = 
  26.144    Rule_Def.Repeat{id = "order_mult", preconds = [], 
  26.145        rew_ord = ("ord_make_polynomial",ord_make_polynomial false thy),
  26.146 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty,
  26.147 +      erls = Rule_Set.empty,srls = Rule_Set.Empty,
  26.148        calc = [], errpatts = [],
  26.149        rules = [Rule.Thm ("mult_commute",TermC.num_str @{thm mult.commute}),
  26.150  	       (* z * w = w * z *)
  26.151 @@ -1056,7 +1056,7 @@
  26.152  	  [([TermC.parse_patt thy "?p is_multUnordered"], 
  26.153               TermC.parse_patt thy "?p :: real")],
  26.154  	  rew_ord = ("dummy_ord", Rule.dummy_ord),
  26.155 -	  erls = Rule_Set.append_rls "Rule_Set.e_rls-is_multUnordered" Rule_Set.e_rls
  26.156 +	  erls = Rule_Set.append_rules "Rule_Set.empty-is_multUnordered" Rule_Set.empty
  26.157  			    [Rule.Num_Calc ("Poly.is'_multUnordered", 
  26.158                                      eval_is_multUnordered "")],
  26.159  	  calc = [("PLUS"  , ("Groups.plus_class.plus", (**)eval_binop "#add_")),
  26.160 @@ -1072,7 +1072,7 @@
  26.161  val order_mult_rls_ = 
  26.162    Rule_Def.Repeat {id = "order_mult_rls_", preconds = [], 
  26.163        rew_ord = ("dummy_ord", Rule.dummy_ord),
  26.164 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty,
  26.165 +      erls = Rule_Set.empty,srls = Rule_Set.Empty,
  26.166        calc = [], errpatts = [],
  26.167        rules = [Rule.Rls_ order_mult_
  26.168  	       ], scr = Rule.EmptyScr};
  26.169 @@ -1096,7 +1096,7 @@
  26.170  	    (*WN.18.6.03 also KEIN pattern, dieses erzeugt nur das Environment 
  26.171  	      fuer die Evaluation der Precondition "p is_addUnordered"*))],
  26.172  	  rew_ord = ("dummy_ord", Rule.dummy_ord),
  26.173 -	  erls = Rule_Set.append_rls "Rule_Set.e_rls-is_addUnordered" Rule_Set.e_rls(*MG: poly_erls*)
  26.174 +	  erls = Rule_Set.append_rules "Rule_Set.empty-is_addUnordered" Rule_Set.empty(*MG: poly_erls*)
  26.175  			    [Rule.Num_Calc ("Poly.is'_addUnordered", eval_is_addUnordered "")],
  26.176  	  calc = [("PLUS"  ,("Groups.plus_class.plus", (**)eval_binop "#add_")),
  26.177  		  ("TIMES" ,("Groups.times_class.times", (**)eval_binop "#mult_")),
  26.178 @@ -1112,7 +1112,7 @@
  26.179  val order_add_rls_ =
  26.180    Rule_Def.Repeat {id = "order_add_rls_", preconds = [], 
  26.181        rew_ord = ("dummy_ord", Rule.dummy_ord),
  26.182 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty,
  26.183 +      erls = Rule_Set.empty,srls = Rule_Set.Empty,
  26.184        calc = [], errpatts = [],
  26.185        rules = [Rule.Rls_ order_add_
  26.186  	       ], scr = Rule.EmptyScr};
  26.187 @@ -1439,7 +1439,7 @@
  26.188          [("#Given" ,["Term t_t"]),
  26.189            ("#Where" ,["t_t is_polyexp"]),
  26.190            ("#Find"  ,["normalform n_n"])],
  26.191 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)
  26.192 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)
  26.193  			  Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")], 
  26.194          SOME "Simplify t_t", 
  26.195          [["simplification","for_polynomials"]]))]\<close>
  26.196 @@ -1455,11 +1455,11 @@
  26.197  	      [("#Given" ,["Term t_t"]),
  26.198  	        ("#Where" ,["t_t is_polyexp"]),
  26.199  	        ("#Find"  ,["normalform n_n"])],
  26.200 -	      {rew_ord'="tless_true", rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, 
  26.201 -	        prls = Rule_Set.append_rls "simplification_for_polynomials_prls" Rule_Set.e_rls 
  26.202 +	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  26.203 +	        prls = Rule_Set.append_rules "simplification_for_polynomials_prls" Rule_Set.empty 
  26.204  				    [(*for preds in where_*)
  26.205  				      Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp"")],
  26.206 -				  crls = Rule_Set.e_rls, errpats = [], nrls = norm_Poly},
  26.207 +				  crls = Rule_Set.empty, errpats = [], nrls = norm_Poly},
  26.208          @{thm simplify.simps})]
  26.209  \<close>
  26.210  ML \<open>
    27.1 --- a/src/Tools/isac/Knowledge/PolyEq.thy	Mon Apr 06 11:44:36 2020 +0200
    27.2 +++ b/src/Tools/isac/Knowledge/PolyEq.thy	Wed Apr 08 12:32:51 2020 +0200
    27.3 @@ -323,7 +323,7 @@
    27.4  
    27.5  (*-------------------------rulse-------------------------*)
    27.6  val PolyEq_prls = (*3.10.02:just the following order due to subterm evaluation*)
    27.7 -  Rule_Set.append_rls "PolyEq_prls" Rule_Set.e_rls 
    27.8 +  Rule_Set.append_rules "PolyEq_prls" Rule_Set.empty 
    27.9  	     [Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   27.10  	      Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   27.11  	      Rule.Num_Calc ("Prog_Expr.lhs", Prog_Expr.eval_lhs ""),
   27.12 @@ -346,8 +346,8 @@
   27.13  	       ];
   27.14  
   27.15  val PolyEq_erls = 
   27.16 -    Rule_Set.merge_rls "PolyEq_erls" LinEq_erls
   27.17 -    (Rule_Set.append_rls "ops_preds" calculate_Rational
   27.18 +    Rule_Set.merge "PolyEq_erls" LinEq_erls
   27.19 +    (Rule_Set.append_rules "ops_preds" calculate_Rational
   27.20  		[Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   27.21  		 Rule.Thm ("plus_leq", TermC.num_str @{thm plus_leq}),
   27.22  		 Rule.Thm ("minus_leq", TermC.num_str @{thm minus_leq}),
   27.23 @@ -357,8 +357,8 @@
   27.24  		 ]);
   27.25  
   27.26  val PolyEq_crls = 
   27.27 -    Rule_Set.merge_rls "PolyEq_crls" LinEq_crls
   27.28 -    (Rule_Set.append_rls "ops_preds" calculate_Rational
   27.29 +    Rule_Set.merge "PolyEq_crls" LinEq_crls
   27.30 +    (Rule_Set.append_rules "ops_preds" calculate_Rational
   27.31  		[Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   27.32  		 Rule.Thm ("plus_leq", TermC.num_str @{thm plus_leq}),
   27.33  		 Rule.Thm ("minus_leq", TermC.num_str @{thm minus_leq}),
   27.34 @@ -903,7 +903,7 @@
   27.35  setup \<open>KEStore_Elems.add_mets
   27.36      [Specify.prep_met thy "met_polyeq" [] Celem.e_metID
   27.37        (["PolyEq"], [],
   27.38 -        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
   27.39 +        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
   27.40            crls=PolyEq_crls, errpats = [], nrls = norm_Rational},
   27.41          @{thm refl})]
   27.42  \<close>
   27.43 @@ -927,7 +927,7 @@
   27.44          [("#Given" ,["equality e_e","solveFor v_v"]),
   27.45            ("#Where" ,["(Not((matches (?a = 0 ) e_e ))) | (Not(((lhs e_e) is_poly_in v_v)))"]),
   27.46            ("#Find"  ,["solutions v_v'i'"])],
   27.47 -        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.e_rls, prls=PolyEq_prls, calc=[],
   27.48 +        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.empty, prls=PolyEq_prls, calc=[],
   27.49            crls=PolyEq_crls, errpats = [], nrls = norm_Rational},
   27.50          @{thm normalize_poly_eq.simps})]
   27.51  \<close>
   27.52 @@ -945,7 +945,7 @@
   27.53          [("#Given" ,["equality e_e","solveFor v_v"]),
   27.54            ("#Where" ,["(lhs e_e) is_poly_in v_v ", "((lhs e_e) has_degree_in v_v) = 0"]),
   27.55            ("#Find"  ,["solutions v_v'i'"])],
   27.56 -        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.e_rls, prls=PolyEq_prls,
   27.57 +        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.empty, prls=PolyEq_prls,
   27.58            calc=[("sqrt", ("NthRoot.sqrt", eval_sqrt "#sqrt_"))], crls=PolyEq_crls, errpats = [],
   27.59            nrls = norm_Rational},
   27.60          @{thm solve_poly_equ.simps})]
   27.61 @@ -968,7 +968,7 @@
   27.62          [("#Given" ,["equality e_e","solveFor v_v"]),
   27.63            ("#Where" ,["(lhs e_e) is_poly_in v_v ", "((lhs e_e) has_degree_in v_v) = 1"]),
   27.64            ("#Find"  ,["solutions v_v'i'"])],
   27.65 -        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.e_rls, prls=PolyEq_prls,
   27.66 +        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.empty, prls=PolyEq_prls,
   27.67            calc=[("sqrt", ("NthRoot.sqrt", eval_sqrt "#sqrt_"))], crls=PolyEq_crls, errpats = [],
   27.68            nrls = norm_Rational},
   27.69          @{thm solve_poly_eq1.simps})]
   27.70 @@ -993,7 +993,7 @@
   27.71          [("#Given" ,["equality e_e","solveFor v_v"]),
   27.72            ("#Where" ,["(lhs e_e) is_poly_in v_v ", "((lhs e_e) has_degree_in v_v) = 2"]),
   27.73            ("#Find"  ,["solutions v_v'i'"])],
   27.74 -        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.e_rls, prls=PolyEq_prls,
   27.75 +        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.empty, prls=PolyEq_prls,
   27.76            calc=[("sqrt", ("NthRoot.sqrt", eval_sqrt "#sqrt_"))], crls=PolyEq_crls, errpats = [],
   27.77            nrls = norm_Rational},
   27.78          @{thm solve_poly_equ2.simps})]
   27.79 @@ -1018,7 +1018,7 @@
   27.80          [("#Given" ,["equality e_e","solveFor v_v"]),
   27.81            ("#Where" ,["(lhs e_e) is_poly_in v_v ", "((lhs e_e) has_degree_in v_v) = 2"]),
   27.82            ("#Find"  ,["solutions v_v'i'"])],
   27.83 -        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.e_rls, prls=PolyEq_prls,
   27.84 +        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.empty, prls=PolyEq_prls,
   27.85            calc=[("sqrt", ("NthRoot.sqrt", eval_sqrt "#sqrt_"))], crls=PolyEq_crls, errpats = [],
   27.86            nrls = norm_Rational},
   27.87          @{thm solve_poly_equ0.simps})]
   27.88 @@ -1041,7 +1041,7 @@
   27.89          [("#Given" ,["equality e_e","solveFor v_v"]),
   27.90            ("#Where" ,["(lhs e_e) is_poly_in v_v ", "((lhs e_e) has_degree_in v_v) = 2"]),
   27.91            ("#Find"  ,["solutions v_v'i'"])],
   27.92 -        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.e_rls, prls=PolyEq_prls,
   27.93 +        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.empty, prls=PolyEq_prls,
   27.94            calc=[("sqrt", ("NthRoot.sqrt", eval_sqrt "#sqrt_"))], crls=PolyEq_crls, errpats = [],
   27.95            nrls = norm_Rational},
   27.96          @{thm solve_poly_equ_sqrt.simps})]
   27.97 @@ -1064,7 +1064,7 @@
   27.98          [("#Given" ,["equality e_e","solveFor v_v"]),
   27.99            ("#Where" ,["(lhs e_e) is_poly_in v_v ", "((lhs e_e) has_degree_in v_v) = 2"]),
  27.100            ("#Find"  ,["solutions v_v'i'"])],
  27.101 -        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.e_rls, prls=PolyEq_prls,
  27.102 +        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.empty, prls=PolyEq_prls,
  27.103            calc=[("sqrt", ("NthRoot.sqrt", eval_sqrt "#sqrt_"))], crls=PolyEq_crls, errpats = [],
  27.104            nrls = norm_Rational},
  27.105          @{thm solve_poly_equ_pq.simps})]
  27.106 @@ -1086,7 +1086,7 @@
  27.107          [("#Given" ,["equality e_e","solveFor v_v"]),
  27.108            ("#Where" ,["(lhs e_e) is_poly_in v_v ", "((lhs e_e) has_degree_in v_v) = 2"]),
  27.109            ("#Find"  ,["solutions v_v'i'"])],
  27.110 -        {rew_ord'="termlessI", rls'=PolyEq_erls,srls=Rule_Set.e_rls, prls=PolyEq_prls,
  27.111 +        {rew_ord'="termlessI", rls'=PolyEq_erls,srls=Rule_Set.empty, prls=PolyEq_prls,
  27.112            calc=[("sqrt", ("NthRoot.sqrt", eval_sqrt "#sqrt_"))], crls=PolyEq_crls, errpats = [],
  27.113            nrls = norm_Rational},
  27.114          @{thm solve_poly_equ_abc.simps})]
  27.115 @@ -1113,7 +1113,7 @@
  27.116          [("#Given" ,["equality e_e","solveFor v_v"]),
  27.117            ("#Where" ,["(lhs e_e) is_poly_in v_v ", "((lhs e_e) has_degree_in v_v) = 3"]),
  27.118            ("#Find"  ,["solutions v_v'i'"])],
  27.119 -        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.e_rls, prls=PolyEq_prls,
  27.120 +        {rew_ord'="termlessI", rls'=PolyEq_erls, srls=Rule_Set.empty, prls=PolyEq_prls,
  27.121            calc=[("sqrt", ("NthRoot.sqrt", eval_sqrt "#sqrt_"))], crls=PolyEq_crls, errpats = [],
  27.122            nrls = norm_Rational},
  27.123          @{thm solve_poly_equ3.simps})]
  27.124 @@ -1143,7 +1143,7 @@
  27.125          [("#Given" ,["equality e_e","solveFor v_v"]),
  27.126            ("#Where" ,["matches (?a = 0) e_e", "((lhs e_e) has_degree_in v_v) = 2"]),
  27.127            ("#Find"  ,["solutions v_v'i'"])],
  27.128 -        {rew_ord'="termlessI",rls'=PolyEq_erls,srls=Rule_Set.e_rls,prls=PolyEq_prls,
  27.129 +        {rew_ord'="termlessI",rls'=PolyEq_erls,srls=Rule_Set.empty,prls=PolyEq_prls,
  27.130            calc=[("sqrt", ("NthRoot.sqrt", eval_sqrt "#sqrt_"))], crls=PolyEq_crls, errpats = [],
  27.131            nrls = norm_Rational},
  27.132          @{thm solve_by_completing_square.simps})]
  27.133 @@ -1235,7 +1235,7 @@
  27.134    Rule_Def.Repeat{id = "order_add_mult_in", preconds = [], 
  27.135        rew_ord = ("ord_make_polynomial_in",
  27.136  		 ord_make_polynomial_in false @{theory "Poly"}),
  27.137 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty,
  27.138 +      erls = Rule_Set.empty,srls = Rule_Set.Empty,
  27.139        calc = [], errpatts = [],
  27.140        rules = [Rule.Thm ("mult_commute",TermC.num_str @{thm mult.commute}),
  27.141  	       (* z * w = w * z *)
  27.142 @@ -1256,7 +1256,7 @@
  27.143  val collect_bdv = prep_rls'(
  27.144    Rule_Def.Repeat{id = "collect_bdv", preconds = [], 
  27.145        rew_ord = ("dummy_ord", Rule.dummy_ord),
  27.146 -      erls = Rule_Set.e_rls,srls = Rule_Set.Empty,
  27.147 +      erls = Rule_Set.empty,srls = Rule_Set.Empty,
  27.148        calc = [], errpatts = [],
  27.149        rules = [Rule.Thm ("bdv_collect_1",TermC.num_str @{thm bdv_collect_1}),
  27.150  	       Rule.Thm ("bdv_collect_2",TermC.num_str @{thm bdv_collect_2}),
  27.151 @@ -1308,7 +1308,7 @@
  27.152  \<close>
  27.153  ML\<open>
  27.154  val separate_bdvs = 
  27.155 -    Rule_Set.append_rls "separate_bdvs"
  27.156 +    Rule_Set.append_rules "separate_bdvs"
  27.157  	       collect_bdv
  27.158  	       [Rule.Thm ("separate_bdv", TermC.num_str @{thm separate_bdv}),
  27.159  		(*"?a * ?bdv / ?b = ?a / ?b * ?bdv"*)
    28.1 --- a/src/Tools/isac/Knowledge/PolyMinus.thy	Mon Apr 06 11:44:36 2020 +0200
    28.2 +++ b/src/Tools/isac/Knowledge/PolyMinus.thy	Wed Apr 08 12:32:51 2020 +0200
    28.3 @@ -185,7 +185,7 @@
    28.4  (** rulesets **)
    28.5  
    28.6  val erls_ordne_alphabetisch =
    28.7 -    Rule_Set.append_rls "erls_ordne_alphabetisch" Rule_Set.e_rls
    28.8 +    Rule_Set.append_rules "erls_ordne_alphabetisch" Rule_Set.empty
    28.9  	       [Rule.Num_Calc ("PolyMinus.kleiner", eval_kleiner ""),
   28.10  		Rule.Num_Calc ("PolyMinus.ist'_monom", eval_ist_monom "")
   28.11  		];
   28.12 @@ -215,7 +215,7 @@
   28.13  val fasse_zusammen = 
   28.14      Rule_Def.Repeat{id = "fasse_zusammen", preconds = [], 
   28.15  	rew_ord = ("dummy_ord", Rule.dummy_ord),
   28.16 -	erls = Rule_Set.append_rls "erls_fasse_zusammen" Rule_Set.e_rls 
   28.17 +	erls = Rule_Set.append_rules "erls_fasse_zusammen" Rule_Set.empty 
   28.18  			  [Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_")], 
   28.19  	srls = Rule_Set.Empty, calc = [], errpatts = [],
   28.20  	rules = 
   28.21 @@ -281,7 +281,7 @@
   28.22  val verschoenere = 
   28.23    Rule_Def.Repeat{id = "verschoenere", preconds = [], 
   28.24        rew_ord = ("dummy_ord", Rule.dummy_ord), srls = Rule_Set.Empty, calc = [], errpatts = [],
   28.25 -      erls = Rule_Set.append_rls "erls_verschoenere" Rule_Set.e_rls 
   28.26 +      erls = Rule_Set.append_rules "erls_verschoenere" Rule_Set.empty 
   28.27  			[Rule.Num_Calc ("PolyMinus.kleiner", eval_kleiner "")], 
   28.28        rules = [Rule.Thm ("vorzeichen_minus_weg1",TermC.num_str @{thm vorzeichen_minus_weg1}),
   28.29  	       (*"l kleiner 0 ==> a + l * b = a - -l * b"*)
   28.30 @@ -343,7 +343,7 @@
   28.31  val ordne_monome = 
   28.32    Rule_Def.Repeat{id = "ordne_monome", preconds = [], 
   28.33        rew_ord = ("dummy_ord", Rule.dummy_ord), srls = Rule_Set.Empty, calc = [], errpatts = [], 
   28.34 -      erls = Rule_Set.append_rls "erls_ordne_monome" Rule_Set.e_rls
   28.35 +      erls = Rule_Set.append_rules "erls_ordne_monome" Rule_Set.empty
   28.36  	       [Rule.Num_Calc ("PolyMinus.kleiner", eval_kleiner ""),
   28.37  		Rule.Num_Calc ("Prog_Expr.is'_atom", Prog_Expr.eval_is_atom "")
   28.38  		], 
   28.39 @@ -362,20 +362,20 @@
   28.40  
   28.41  
   28.42  val rls_p_33 = 
   28.43 -    Rule_Set.append_rls "rls_p_33" Rule_Set.e_rls
   28.44 +    Rule_Set.append_rules "rls_p_33" Rule_Set.empty
   28.45  	       [Rule.Rls_ ordne_alphabetisch,
   28.46  		Rule.Rls_ fasse_zusammen,
   28.47  		Rule.Rls_ verschoenere
   28.48  		];
   28.49  val rls_p_34 = 
   28.50 -    Rule_Set.append_rls "rls_p_34" Rule_Set.e_rls
   28.51 +    Rule_Set.append_rules "rls_p_34" Rule_Set.empty
   28.52  	       [Rule.Rls_ klammern_aufloesen,
   28.53  		Rule.Rls_ ordne_alphabetisch,
   28.54  		Rule.Rls_ fasse_zusammen,
   28.55  		Rule.Rls_ verschoenere
   28.56  		];
   28.57  val rechnen = 
   28.58 -    Rule_Set.append_rls "rechnen" Rule_Set.e_rls
   28.59 +    Rule_Set.append_rules "rechnen" Rule_Set.empty
   28.60  	       [Rule.Num_Calc ("Groups.times_class.times", (**)eval_binop "#mult_"),
   28.61  		Rule.Num_Calc ("Groups.plus_class.plus", (**)eval_binop "#add_"),
   28.62  		Rule.Num_Calc ("Groups.minus_class.minus", (**)eval_binop "#subtr_")
   28.63 @@ -407,7 +407,7 @@
   28.64              "     matchsub ((?b + ?c) * ?a) t_t | " ^
   28.65              "     matchsub ((?b - ?c) * ?a) t_t )"]),
   28.66            ("#Find", ["normalform n_n"])],
   28.67 -        Rule_Set.append_rls "prls_pbl_vereinf_poly" Rule_Set.e_rls 
   28.68 +        Rule_Set.append_rules "prls_pbl_vereinf_poly" Rule_Set.empty 
   28.69  	        [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp ""),
   28.70  	          Rule.Num_Calc ("Prog_Expr.matchsub", Prog_Expr.eval_matchsub ""),
   28.71  	          Rule.Thm ("or_true", TermC.num_str @{thm or_true}),
   28.72 @@ -428,7 +428,7 @@
   28.73              "     matchsub ((?b + ?c) * ?a) t_t | " ^
   28.74              "     matchsub ((?b - ?c) * ?a) t_t )"]),
   28.75            ("#Find"  ,["normalform n_n"])],
   28.76 -        Rule_Set.append_rls "prls_pbl_vereinf_poly_klammer" Rule_Set.e_rls
   28.77 +        Rule_Set.append_rules "prls_pbl_vereinf_poly_klammer" Rule_Set.empty
   28.78            [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp ""),
   28.79  	           Rule.Num_Calc ("Prog_Expr.matchsub", Prog_Expr.eval_matchsub ""),
   28.80               Rule.Thm ("or_true", TermC.num_str @{thm or_true}),
   28.81 @@ -446,7 +446,7 @@
   28.82          [("#Given", ["Term t_t"]),
   28.83            ("#Where", ["t_t is_polyexp"]),
   28.84            ("#Find", ["normalform n_n"])],
   28.85 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)
   28.86 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)
   28.87  			      Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")], 
   28.88          SOME "Vereinfache t_t", 
   28.89          [["simplification","for_polynomials","with_parentheses_mult"]])),
   28.90 @@ -456,7 +456,7 @@
   28.91          [("#Given", ["Pruefe e_e", "mitWert w_w"]),
   28.92            ("#Where", ["e_e is_polyexp"]),
   28.93            ("#Find", ["Geprueft p_p"])],
   28.94 -        Rule_Set.append_rls "prls_pbl_probe_poly" Rule_Set.e_rls [(*for preds in where_*)
   28.95 +        Rule_Set.append_rules "prls_pbl_probe_poly" Rule_Set.empty [(*for preds in where_*)
   28.96  		      Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")], 
   28.97          SOME "Probe e_e w_w", 
   28.98          [["probe","fuer_polynom"]])),
   28.99 @@ -465,7 +465,7 @@
  28.100          [("#Given" ,["Pruefe e_e", "mitWert w_w"]),
  28.101            ("#Where" ,["e_e is_ratpolyexp"]),
  28.102            ("#Find"  ,["Geprueft p_p"])],
  28.103 -        Rule_Set.append_rls "prls_pbl_probe_bruch" Rule_Set.e_rls [(*for preds in where_*)
  28.104 +        Rule_Set.append_rules "prls_pbl_probe_bruch" Rule_Set.empty [(*for preds in where_*)
  28.105  		      Rule.Num_Calc ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")], 
  28.106          SOME "Probe e_e w_w", [["probe","fuer_bruch"]]))]\<close>
  28.107  
  28.108 @@ -489,8 +489,8 @@
  28.109  	            "     matchsub (?a - (?b + ?c)) t_t | " ^
  28.110  	            "     matchsub (?a + (?b - ?c)) t_t )"]),
  28.111  	        ("#Find"  ,["normalform n_n"])],
  28.112 -	      {rew_ord'="tless_true", rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls,
  28.113 -	        prls = Rule_Set.append_rls "prls_met_simp_poly_minus" Rule_Set.e_rls 
  28.114 +	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty,
  28.115 +	        prls = Rule_Set.append_rules "prls_met_simp_poly_minus" Rule_Set.empty 
  28.116  				      [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp ""),
  28.117  				        Rule.Num_Calc ("Prog_Expr.matchsub", Prog_Expr.eval_matchsub ""),
  28.118  				        Rule.Thm ("and_true",TermC.num_str @{thm and_true}),
  28.119 @@ -501,7 +501,7 @@
  28.120                  (*"(~ True) = False"*)
  28.121                  Rule.Thm ("not_false",TermC.num_str @{thm not_false})
  28.122                  (*"(~ False) = True"*)],
  28.123 -          crls = Rule_Set.e_rls, errpats = [], nrls = rls_p_33},
  28.124 +          crls = Rule_Set.empty, errpats = [], nrls = rls_p_33},
  28.125            @{thm simplify.simps})]
  28.126  \<close>
  28.127  
  28.128 @@ -520,10 +520,10 @@
  28.129  	      [("#Given" ,["Term t_t"]),
  28.130  	        ("#Where" ,["t_t is_polyexp"]),
  28.131  	        ("#Find"  ,["normalform n_n"])],
  28.132 -	      {rew_ord'="tless_true", rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, 
  28.133 -	        prls = Rule_Set.append_rls "simplification_for_polynomials_prls" Rule_Set.e_rls 
  28.134 +	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  28.135 +	        prls = Rule_Set.append_rules "simplification_for_polynomials_prls" Rule_Set.empty 
  28.136  				    [(*for preds in where_*) Rule.Num_Calc("Poly.is'_polyexp", eval_is_polyexp"")],
  28.137 -				  crls = Rule_Set.e_rls, errpats = [], nrls = rls_p_34},
  28.138 +				  crls = Rule_Set.empty, errpats = [], nrls = rls_p_34},
  28.139  				@{thm simplify2.simps})]
  28.140  \<close>
  28.141  
  28.142 @@ -543,16 +543,16 @@
  28.143      [Specify.prep_met thy "met_simp_poly_parenth_mult" [] Celem.e_metID
  28.144  	    (["simplification","for_polynomials","with_parentheses_mult"],
  28.145  	      [("#Given" ,["Term t_t"]), ("#Where" ,["t_t is_polyexp"]), ("#Find"  ,["normalform n_n"])],
  28.146 -	        {rew_ord'="tless_true", rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, 
  28.147 -	          prls = Rule_Set.append_rls "simplification_for_polynomials_prls" Rule_Set.e_rls 
  28.148 +	        {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  28.149 +	          prls = Rule_Set.append_rules "simplification_for_polynomials_prls" Rule_Set.empty 
  28.150  				      [(*for preds in where_*) Rule.Num_Calc("Poly.is'_polyexp", eval_is_polyexp"")],
  28.151 -				    crls = Rule_Set.e_rls, errpats = [], nrls = rls_p_34},
  28.152 +				    crls = Rule_Set.empty, errpats = [], nrls = rls_p_34},
  28.153  				  @{thm simplify3.simps})]
  28.154  \<close>
  28.155  setup \<open>KEStore_Elems.add_mets
  28.156      [Specify.prep_met thy "met_probe" [] Celem.e_metID
  28.157  	    (["probe"], [],
  28.158 -	      {rew_ord'="tless_true", rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.Empty, crls = Rule_Set.e_rls,
  28.159 +	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls = Rule_Set.Empty, crls = Rule_Set.empty,
  28.160  	        errpats = [], nrls = Rule_Set.Empty}, 
  28.161  	      @{thm refl})]
  28.162  \<close>
  28.163 @@ -575,10 +575,10 @@
  28.164  	      [("#Given" ,["Pruefe e_e", "mitWert w_w"]),
  28.165  	        ("#Where" ,["e_e is_polyexp"]),
  28.166  	        ("#Find"  ,["Geprueft p_p"])],
  28.167 -	      {rew_ord'="tless_true", rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, 
  28.168 -	        prls = Rule_Set.append_rls "prls_met_probe_bruch" Rule_Set.e_rls
  28.169 +	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  28.170 +	        prls = Rule_Set.append_rules "prls_met_probe_bruch" Rule_Set.empty
  28.171  	            [(*for preds in where_*) Rule.Num_Calc ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")], 
  28.172 -	        crls = Rule_Set.e_rls, errpats = [], nrls = rechnen}, 
  28.173 +	        crls = Rule_Set.empty, errpats = [], nrls = rechnen}, 
  28.174  	      @{thm mache_probe.simps})]
  28.175  \<close>
  28.176  setup \<open>KEStore_Elems.add_mets
  28.177 @@ -587,10 +587,10 @@
  28.178  	      [("#Given" ,["Pruefe e_e", "mitWert w_w"]),
  28.179  	        ("#Where" ,["e_e is_ratpolyexp"]),
  28.180  	        ("#Find"  ,["Geprueft p_p"])],
  28.181 -	      {rew_ord'="tless_true", rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, 
  28.182 -	        prls = Rule_Set.append_rls "prls_met_probe_bruch" Rule_Set.e_rls
  28.183 +	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  28.184 +	        prls = Rule_Set.append_rules "prls_met_probe_bruch" Rule_Set.empty
  28.185  	            [(*for preds in where_*) Rule.Num_Calc ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")], 
  28.186 -	        crls = Rule_Set.e_rls, errpats = [], nrls = Rule_Set.Empty}, 
  28.187 +	        crls = Rule_Set.empty, errpats = [], nrls = Rule_Set.Empty}, 
  28.188  	      @{thm refl})]
  28.189  \<close>
  28.190  
    29.1 --- a/src/Tools/isac/Knowledge/RatEq.thy	Mon Apr 06 11:44:36 2020 +0200
    29.2 +++ b/src/Tools/isac/Knowledge/RatEq.thy	Wed Apr 08 12:32:51 2020 +0200
    29.3 @@ -81,7 +81,7 @@
    29.4  subsection \<open>rule-sets\<close>
    29.5  ML \<open>
    29.6  val RatEq_prls = (*15.10.02:just the following order due to subterm evaluation*)
    29.7 -  Rule_Set.append_rls "RatEq_prls" Rule_Set.e_rls 
    29.8 +  Rule_Set.append_rules "RatEq_prls" Rule_Set.empty 
    29.9  	     [Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   29.10  	      Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   29.11  	      Rule.Num_Calc ("Prog_Expr.lhs", Prog_Expr.eval_lhs ""),
   29.12 @@ -97,11 +97,11 @@
   29.13  	      ];
   29.14  
   29.15  \<close> ML \<open>
   29.16 -(*rls = Rule_Set.merge_rls erls Poly_erls *)
   29.17 +(*rls = Rule_Set.merge erls Poly_erls *)
   29.18  val rateq_erls = 
   29.19 -  Rule_Set.remove_rls "rateq_erls"                             (*WN: ein Hack*)
   29.20 -	  (Rule_Set.merge_rls "is_ratequation_in" calculate_Rational
   29.21 -		  (Rule_Set.append_rls "is_ratequation_in"
   29.22 +  Rule_Set.keep_unique_rules "rateq_erls"                             (*WN: ein Hack*)
   29.23 +	  (Rule_Set.merge "is_ratequation_in" calculate_Rational
   29.24 +		  (Rule_Set.append_rules "is_ratequation_in"
   29.25  			  Poly_erls [(*Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),*)
   29.26  			    Rule.Num_Calc ("RatEq.is'_ratequation'_in", eval_is_ratequation_in "")]))
   29.27   [Rule.Thm ("and_commute",TermC.num_str @{thm and_commute}), (*WN: ein Hack*)
   29.28 @@ -109,9 +109,9 @@
   29.29  
   29.30  \<close> ML \<open>
   29.31  val RatEq_crls = 
   29.32 -  Rule_Set.remove_rls "RatEq_crls"                              (*WN: ein Hack*)
   29.33 -	  (Rule_Set.merge_rls "is_ratequation_in" calculate_Rational
   29.34 -		  (Rule_Set.append_rls "is_ratequation_in"
   29.35 +  Rule_Set.keep_unique_rules "RatEq_crls"                              (*WN: ein Hack*)
   29.36 +	  (Rule_Set.merge "is_ratequation_in" calculate_Rational
   29.37 +		  (Rule_Set.append_rules "is_ratequation_in"
   29.38  			  Poly_erls [(*Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),*)
   29.39  			    Rule.Num_Calc ("RatEq.is'_ratequation'_in", eval_is_ratequation_in "")]))
   29.40   [Rule.Thm ("and_commute",TermC.num_str @{thm and_commute}), (*WN: ein Hack*)
   29.41 @@ -172,7 +172,7 @@
   29.42  setup \<open>KEStore_Elems.add_mets
   29.43      [Specify.prep_met thy "met_rateq" [] Celem.e_metID
   29.44        (["RatEq"], [],
   29.45 -        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
   29.46 +        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
   29.47            crls=RatEq_crls, errpats = [], nrls = norm_Rational}, @{thm refl})]\<close>
   29.48  
   29.49  partial_function (tailrec) solve_rational_equ :: "bool \<Rightarrow> real \<Rightarrow> bool list"
   29.50 @@ -193,7 +193,7 @@
   29.51          [("#Given" ,["equality e_e","solveFor v_v"]),
   29.52            ("#Where" ,["(e_e::bool) is_ratequation_in (v_v::real)"]),
   29.53            ("#Find"  ,["solutions v_v'i'"])],
   29.54 -        {rew_ord'="termlessI", rls'=rateq_erls, srls=Rule_Set.e_rls, prls=RatEq_prls, calc=[],
   29.55 +        {rew_ord'="termlessI", rls'=rateq_erls, srls=Rule_Set.empty, prls=RatEq_prls, calc=[],
   29.56            crls=RatEq_crls, errpats = [], nrls = norm_Rational},
   29.57          @{thm solve_rational_equ.simps})]
   29.58  \<close>
    30.1 --- a/src/Tools/isac/Knowledge/Rational-WN.sml	Mon Apr 06 11:44:36 2020 +0200
    30.2 +++ b/src/Tools/isac/Knowledge/Rational-WN.sml	Wed Apr 08 12:32:51 2020 +0200
    30.3 @@ -194,7 +194,7 @@
    30.4        | rew_once ruls asm ct apno (rul::thms) =
    30.5        case rul of
    30.6  	Rule.Thm (thmid, thm) =>
    30.7 -	  (case rewrite_ thy ((snd o #rew_ord o Rule_Set.rep_rls) ruless) 
    30.8 +	  (case rewrite_ thy ((snd o #rew_ord o Rule_Set.rep) ruless) 
    30.9  	     rls put_asm (Celem.thm_of_thm rul) ct of
   30.10  	     NONE => rew_once ruls asm ct apno thms
   30.11  	   | SOME (ct',asm') => 
   30.12 @@ -205,14 +205,14 @@
   30.13  	   | SOME (thmid, thm') => 
   30.14  	       let 
   30.15  		 val pairopt = 
   30.16 -		   rewrite_ thy ((snd o #rew_ord o Rule_Set.rep_rls) ruless) 
   30.17 +		   rewrite_ thy ((snd o #rew_ord o Rule_Set.rep) ruless) 
   30.18  		   rls put_asm thm' ct;
   30.19  		 val _ = if pairopt <> NONE then () 
   30.20  			 else error("rewrite_set_, rewrite_ \""^
   30.21  			 (string_of_thmI thm')^"\" \""^
   30.22  			 (Syntax.string_of_term (Rule.thy2ctxt thy) ct)^"\" = NONE")
   30.23  	       in rew_once ruls asm ((fst o the) pairopt) Appl(rul::thms) end);
   30.24 -    val ruls = (#rules o Rule_Set.rep_rls) ruless;
   30.25 +    val ruls = (#rules o Rule_Set.rep) ruless;
   30.26      val (ct',asm') = rew_once ruls [] ct Noap ruls;
   30.27    in if ct = ct' then NONE else SOME (ct',asm') end;
   30.28  
   30.29 @@ -230,7 +230,7 @@
   30.30        | rew_once ruls asm ct apno (rul::thms) =
   30.31        case rul of
   30.32  	Rule.Thm (thmid, thm) =>
   30.33 -	  (case rewrite_ thy ((snd o #rew_ord o Rule_Set.rep_rls) ruless) 
   30.34 +	  (case rewrite_ thy ((snd o #rew_ord o Rule_Set.rep) ruless) 
   30.35  	     rls put_asm (Celem.thm_of_thm rul) ct of
   30.36  	     NONE => rew_once ruls asm ct apno thms
   30.37  	   | SOME (ct',asm') => 
   30.38 @@ -241,14 +241,14 @@
   30.39  	   | SOME (thmid, thm') => 
   30.40  	       let 
   30.41  		 val pairopt = 
   30.42 -		   rewrite_ thy ((snd o #rew_ord o Rule_Set.rep_rls) ruless) 
   30.43 +		   rewrite_ thy ((snd o #rew_ord o Rule_Set.rep) ruless) 
   30.44  		   rls put_asm thm' ct;
   30.45  		 val _ = if pairopt <> NONE then () 
   30.46  			 else error("rewrite_set_, rewrite_ \""^
   30.47  			 (string_of_thmI thm')^"\" \""^
   30.48  			 (Syntax.string_of_term (Rule.thy2ctxt thy) ct)^"\" = NONE")
   30.49  	       in rew_once ruls asm ((fst o the) pairopt) Appl(rul::thms) end);
   30.50 -    val ruls = (#rules o Rule_Set.rep_rls) ruless;
   30.51 +    val ruls = (#rules o Rule_Set.rep) ruless;
   30.52      val (ct',asm') = rew_once ruls [] ct Noap ruls;
   30.53    in if ct = ct' then NONE else SOME (ct',asm') end;
   30.54  
    31.1 --- a/src/Tools/isac/Knowledge/Rational.thy	Mon Apr 06 11:44:36 2020 +0200
    31.2 +++ b/src/Tools/isac/Knowledge/Rational.thy	Wed Apr 08 12:32:51 2020 +0200
    31.3 @@ -392,7 +392,7 @@
    31.4  val calc_rat_erls =
    31.5    prep_rls'
    31.6      (Rule_Def.Repeat {id = "calc_rat_erls", preconds = [], rew_ord = ("dummy_ord", Rule.dummy_ord), 
    31.7 -      erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
    31.8 +      erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
    31.9        rules = 
   31.10          [Rule.Num_Calc ("HOL.eq", Prog_Expr.eval_equal "#equal_"),
   31.11          Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_"),
   31.12 @@ -404,7 +404,7 @@
   31.13     does NOT rearrange the term by AC-rewriting; thus terms with variables 
   31.14     need to have constants to be commuted together respectively           *)
   31.15  val calculate_Rational =
   31.16 -  prep_rls' (Rule_Set.merge_rls "calculate_Rational"
   31.17 +  prep_rls' (Rule_Set.merge "calculate_Rational"
   31.18      (Rule_Def.Repeat {id = "divide", preconds = [], rew_ord = ("dummy_ord", Rule.dummy_ord), 
   31.19        erls = calc_rat_erls, srls = Rule_Set.Empty,
   31.20        calc = [], errpatts = [],
   31.21 @@ -462,8 +462,8 @@
   31.22    [("is_expanded", ("Rational.is'_expanded", eval_is_expanded ""))]\<close>
   31.23  ML \<open>
   31.24  val rational_erls = 
   31.25 -  Rule_Set.merge_rls "rational_erls" calculate_Rational 
   31.26 -    (Rule_Set.append_rls "is_expanded" Atools_erls 
   31.27 +  Rule_Set.merge "rational_erls" calculate_Rational 
   31.28 +    (Rule_Set.append_rules "is_expanded" Atools_erls 
   31.29        [Rule.Num_Calc ("Rational.is'_expanded", eval_is_expanded "")]);
   31.30  \<close>
   31.31  
   31.32 @@ -471,7 +471,7 @@
   31.33  ML \<open>
   31.34  (**)local (* cancel_p *)
   31.35  
   31.36 -val {rules = rules, rew_ord = (_, ro), ...} = Rule_Set.rep_rls (assoc_rls' @{theory} "rev_rew_p");
   31.37 +val {rules = rules, rew_ord = (_, ro), ...} = Rule_Set.rep (assoc_rls' @{theory} "rev_rew_p");
   31.38  
   31.39  fun init_state thy eval_rls ro t =
   31.40    let
   31.41 @@ -531,8 +531,8 @@
   31.42  ML \<open>
   31.43  (** )local ( * add_fractions_p *)
   31.44  
   31.45 -(*val {rules = rules, rew_ord = (_, ro), ...} = Rule_Set.rep_rls (assoc_rls "make_polynomial");*)
   31.46 -val {rules, rew_ord=(_,ro),...} = Rule_Set.rep_rls (assoc_rls' @{theory} "rev_rew_p");
   31.47 +(*val {rules = rules, rew_ord = (_, ro), ...} = Rule_Set.rep (assoc_rls "make_polynomial");*)
   31.48 +val {rules, rew_ord=(_,ro),...} = Rule_Set.rep (assoc_rls' @{theory} "rev_rew_p");
   31.49  
   31.50  fun init_state thy eval_rls ro t =
   31.51    let 
   31.52 @@ -604,7 +604,7 @@
   31.53  (*erls for calculate_Rational; make local with FIXX@ME result:term *term list*)
   31.54  val powers_erls = prep_rls'(
   31.55    Rule_Def.Repeat {id = "powers_erls", preconds = [], rew_ord = ("dummy_ord",Rule.dummy_ord), 
   31.56 -      erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
   31.57 +      erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   31.58        rules = [Rule.Num_Calc ("Prog_Expr.is'_atom", Prog_Expr.eval_is_atom "#is_atom_"),
   31.59  	       Rule.Num_Calc ("Prog_Expr.is'_even", Prog_Expr.eval_is_even "#is_even_"),
   31.60  	       Rule.Num_Calc ("Orderings.ord_class.less", Prog_Expr.eval_equ "#less_"),
   31.61 @@ -651,7 +651,7 @@
   31.62  val rat_mult_divide = prep_rls'(
   31.63    Rule_Def.Repeat {id = "rat_mult_divide", preconds = [], 
   31.64        rew_ord = ("dummy_ord", Rule.dummy_ord), 
   31.65 -      erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
   31.66 +      erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   31.67        rules = [Rule.Thm ("rat_mult",TermC.num_str @{thm rat_mult}),
   31.68  	       (*(1)"?a / ?b * (?c / ?d) = ?a * ?c / (?b * ?d)"*)
   31.69  	       Rule.Thm ("times_divide_eq_right",TermC.num_str @{thm times_divide_eq_right}),
   31.70 @@ -675,7 +675,7 @@
   31.71  (*.contains absolute minimum of thms for context in norm_Rational.*)
   31.72  val reduce_0_1_2 = prep_rls'(
   31.73    Rule_Def.Repeat{id = "reduce_0_1_2", preconds = [], rew_ord = ("dummy_ord", Rule.dummy_ord),
   31.74 -      erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
   31.75 +      erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   31.76        rules = [(*Rule.Thm ("divide_1",TermC.num_str @{thm divide_1}),
   31.77  		 "?x / 1 = ?x" unnecess.for normalform*)
   31.78  	       Rule.Thm ("mult_1_left",TermC.num_str @{thm mult_1_left}),                 
   31.79 @@ -706,7 +706,7 @@
   31.80    make local with FIXX@ME result:term *term list WN0609???SKMG*)
   31.81  val norm_rat_erls = prep_rls'(
   31.82    Rule_Def.Repeat {id = "norm_rat_erls", preconds = [], rew_ord = ("dummy_ord",Rule.dummy_ord), 
   31.83 -      erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
   31.84 +      erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   31.85        rules = [Rule.Num_Calc ("Prog_Expr.is'_const", Prog_Expr.eval_const "#is_const_")
   31.86  	       ], scr = Rule.EmptyScr});
   31.87  
   31.88 @@ -741,8 +741,8 @@
   31.89  
   31.90  (*WN030318???SK: simplifies all but cancel and common_nominator*)
   31.91  val simplify_rational = 
   31.92 -    Rule_Set.merge_rls "simplify_rational" expand_binoms
   31.93 -    (Rule_Set.append_rls "divide" calculate_Rational
   31.94 +    Rule_Set.merge "simplify_rational" expand_binoms
   31.95 +    (Rule_Set.append_rules "divide" calculate_Rational
   31.96  		[Rule.Thm ("div_by_1",TermC.num_str @{thm div_by_1}),
   31.97  		 (*"?x / 1 = ?x"*)
   31.98  		 Rule.Thm ("rat_mult",TermC.num_str @{thm rat_mult}),
   31.99 @@ -763,7 +763,7 @@
  31.100  ML \<open>
  31.101  val add_fractions_p_rls = prep_rls'(
  31.102    Rule_Def.Repeat {id = "add_fractions_p_rls", preconds = [], rew_ord = ("dummy_ord", Rule.dummy_ord), 
  31.103 -	  erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
  31.104 +	  erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
  31.105  	  rules = [Rule.Rls_ add_fractions_p], 
  31.106  	  scr = Rule.EmptyScr});
  31.107  
  31.108 @@ -771,7 +771,7 @@
  31.109  val cancel_p_rls = prep_rls'(
  31.110    Rule_Def.Repeat 
  31.111      {id = "cancel_p_rls", preconds = [], rew_ord = ("dummy_ord", Rule.dummy_ord), 
  31.112 -    erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
  31.113 +    erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
  31.114      rules = [Rule.Rls_ cancel_p], 
  31.115  	  scr = Rule.EmptyScr});
  31.116  
  31.117 @@ -779,7 +779,7 @@
  31.118      used in initial part norm_Rational_mg, see example DA-M02-main.p.60.*)
  31.119  val rat_mult_poly = prep_rls'(
  31.120    Rule_Def.Repeat {id = "rat_mult_poly", preconds = [], rew_ord = ("dummy_ord", Rule.dummy_ord), 
  31.121 -	  erls = Rule_Set.append_rls "Rule_Set.e_rls-is_polyexp" Rule_Set.e_rls [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")], 
  31.122 +	  erls = Rule_Set.append_rules "Rule_Set.empty-is_polyexp" Rule_Set.empty [Rule.Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")], 
  31.123  	  srls = Rule_Set.Empty, calc = [], errpatts = [],
  31.124  	  rules = 
  31.125  	    [Rule.Thm ("rat_mult_poly_l",TermC.num_str @{thm rat_mult_poly_l}),
  31.126 @@ -790,12 +790,12 @@
  31.127  
  31.128  (*. makes 'normal' fractions; 'is_polyexp' inhibits double fractions;
  31.129      used in looping part norm_Rational_rls, see example DA-M02-main.p.60 
  31.130 -    .. WHERE THE LATTER DOES ALWAYS WORK, BECAUSE erls = Rule_Set.e_rls, 
  31.131 +    .. WHERE THE LATTER DOES ALWAYS WORK, BECAUSE erls = Rule_Set.empty, 
  31.132      I.E. THE RESPECTIVE ASSUMPTION IS STORED AND Rule.Thm APPLIED; WN051028 
  31.133      ... WN0609???MG.*)
  31.134  val rat_mult_div_pow = prep_rls'(
  31.135    Rule_Def.Repeat {id = "rat_mult_div_pow", preconds = [], rew_ord = ("dummy_ord",Rule.dummy_ord), 
  31.136 -    erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
  31.137 +    erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
  31.138      rules = [Rule.Thm ("rat_mult", TermC.num_str @{thm rat_mult}),
  31.139        (*"?a / ?b * (?c / ?d) = ?a * ?c / (?b * ?d)"*)
  31.140        Rule.Thm ("rat_mult_poly_l", TermC.num_str @{thm rat_mult_poly_l}),
  31.141 @@ -818,7 +818,7 @@
  31.142  
  31.143  val rat_reduce_1 = prep_rls'(
  31.144    Rule_Def.Repeat {id = "rat_reduce_1", preconds = [], rew_ord = ("dummy_ord", Rule.dummy_ord), 
  31.145 -    erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [], 
  31.146 +    erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [], 
  31.147      rules = 
  31.148        [Rule.Thm ("div_by_1", TermC.num_str @{thm div_by_1}),
  31.149        (*"?x / 1 = ?x"*)
  31.150 @@ -884,7 +884,7 @@
  31.151          [("#Given" ,["Term t_t"]),
  31.152            ("#Where" ,["t_t is_ratpolyexp"]),
  31.153            ("#Find"  ,["normalform n_n"])],
  31.154 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)], 
  31.155 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], 
  31.156          SOME "Simplify t_t", [["simplification","of_rationals"]]))]\<close>
  31.157  
  31.158  section \<open>A methods for simplification of rationals\<close>
  31.159 @@ -912,10 +912,10 @@
  31.160          [("#Given" ,["Term t_t"]),
  31.161            ("#Where" ,["t_t is_ratpolyexp"]),
  31.162            ("#Find"  ,["normalform n_n"])],
  31.163 -	      {rew_ord'="tless_true", rls' = Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, 
  31.164 -	        prls = Rule_Set.append_rls "simplification_of_rationals_prls" Rule_Set.e_rls 
  31.165 +	      {rew_ord'="tless_true", rls' = Rule_Set.empty, calc = [], srls = Rule_Set.empty, 
  31.166 +	        prls = Rule_Set.append_rules "simplification_of_rationals_prls" Rule_Set.empty 
  31.167  				    [(*for preds in where_*) Rule.Num_Calc ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")],
  31.168 -				  crls = Rule_Set.e_rls, errpats = [], nrls = norm_Rational_rls},
  31.169 +				  crls = Rule_Set.empty, errpats = [], nrls = norm_Rational_rls},
  31.170  				  @{thm simplify.simps})]
  31.171  \<close>
  31.172  
    32.1 --- a/src/Tools/isac/Knowledge/Root.thy	Mon Apr 06 11:44:36 2020 +0200
    32.2 +++ b/src/Tools/isac/Knowledge/Root.thy	Wed Apr 08 12:32:51 2020 +0200
    32.3 @@ -162,7 +162,7 @@
    32.4  
    32.5  (*-------------------------rulse-------------------------*)
    32.6  val Root_crls = 
    32.7 -      Rule_Set.append_rls "Root_crls" Atools_erls 
    32.8 +      Rule_Set.append_rules "Root_crls" Atools_erls 
    32.9         [Rule.Thm  ("real_unari_minus",TermC.num_str @{thm real_unari_minus}),
   32.10          Rule.Num_Calc ("NthRoot.sqrt" , eval_sqrt "#sqrt_"),
   32.11          Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
   32.12 @@ -174,7 +174,7 @@
   32.13          ];
   32.14  
   32.15  val Root_erls = 
   32.16 -      Rule_Set.append_rls "Root_erls" Atools_erls 
   32.17 +      Rule_Set.append_rules "Root_erls" Atools_erls 
   32.18         [Rule.Thm  ("real_unari_minus",TermC.num_str @{thm real_unari_minus}),
   32.19          Rule.Num_Calc ("NthRoot.sqrt" , eval_sqrt "#sqrt_"),
   32.20          Rule.Num_Calc ("Rings.divide_class.divide", Prog_Expr.eval_cancel "#divide_e"),
    33.1 --- a/src/Tools/isac/Knowledge/RootEq.thy	Mon Apr 06 11:44:36 2020 +0200
    33.2 +++ b/src/Tools/isac/Knowledge/RootEq.thy	Wed Apr 08 12:32:51 2020 +0200
    33.3 @@ -179,7 +179,7 @@
    33.4  subsection \<open>rule-sets\<close>
    33.5  ML \<open>
    33.6  val RootEq_prls =(*15.10.02:just the following order due to subterm evaluation*)
    33.7 -  Rule_Set.append_rls "RootEq_prls" Rule_Set.e_rls 
    33.8 +  Rule_Set.append_rules "RootEq_prls" Rule_Set.empty 
    33.9  	     [Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   33.10  	      Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   33.11  	      Rule.Num_Calc ("Prog_Expr.lhs"    , Prog_Expr.eval_lhs ""),
   33.12 @@ -197,15 +197,15 @@
   33.13  	      ];
   33.14  
   33.15  val RootEq_erls =
   33.16 -  Rule_Set.append_rls "RootEq_erls" Root_erls
   33.17 +  Rule_Set.append_rules "RootEq_erls" Root_erls
   33.18      [Rule.Thm ("divide_divide_eq_left", TermC.num_str @{thm divide_divide_eq_left})];
   33.19  
   33.20  val RootEq_crls = 
   33.21 -  Rule_Set.append_rls "RootEq_crls" Root_crls
   33.22 +  Rule_Set.append_rules "RootEq_crls" Root_crls
   33.23      [Rule.Thm ("divide_divide_eq_left", TermC.num_str @{thm divide_divide_eq_left})];
   33.24  
   33.25  val rooteq_srls = 
   33.26 -  Rule_Set.append_rls "rooteq_srls" Rule_Set.e_rls
   33.27 +  Rule_Set.append_rules "rooteq_srls" Rule_Set.empty
   33.28      [Rule.Num_Calc ("RootEq.is'_sqrtTerm'_in", eval_is_sqrtTerm_in ""),
   33.29       Rule.Num_Calc ("RootEq.is'_normSqrtTerm'_in", eval_is_normSqrtTerm_in""),
   33.30       Rule.Num_Calc ("RootEq.is'_rootTerm'_in", eval_is_rootTerm_in "")];
   33.31 @@ -476,7 +476,7 @@
   33.32  setup \<open>KEStore_Elems.add_mets
   33.33      [Specify.prep_met thy "met_rooteq" [] Celem.e_metID
   33.34        (["RootEq"], [],
   33.35 -        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
   33.36 +        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
   33.37            crls=RootEq_crls, errpats = [], nrls = norm_Poly}, @{thm refl})]
   33.38  \<close>
   33.39      (*-- normalise 20.10.02 --*)
   33.40 @@ -503,7 +503,7 @@
   33.41                "( ((rhs e_e) is_sqrtTerm_in (v_v::real)) &" ^
   33.42                "  Not((rhs e_e) is_normSqrtTerm_in (v_v::real)))"]),
   33.43            ("#Find"  ,["solutions v_v'i'"])],
   33.44 -        {rew_ord'="termlessI", rls'=RootEq_erls, srls=Rule_Set.e_rls, prls=RootEq_prls, calc=[],
   33.45 +        {rew_ord'="termlessI", rls'=RootEq_erls, srls=Rule_Set.empty, prls=RootEq_prls, calc=[],
   33.46            crls=RootEq_crls, errpats = [], nrls = norm_Poly},
   33.47          @{thm norm_sqrt_equ.simps})]
   33.48  \<close>
   33.49 @@ -565,7 +565,7 @@
   33.50          [("#Given" ,["equality e_e","solveFor v_v"]),
   33.51            ("#Where" ,["(rhs e_e) is_sqrtTerm_in v_v"]),
   33.52            ("#Find"  ,["solutions v_v'i'"])],
   33.53 -        {rew_ord' = "termlessI", rls' = RootEq_erls, srls = Rule_Set.e_rls, prls = RootEq_prls, calc = [],
   33.54 +        {rew_ord' = "termlessI", rls' = RootEq_erls, srls = Rule_Set.empty, prls = RootEq_prls, calc = [],
   33.55            crls = RootEq_crls, errpats = [], nrls = norm_Poly},
   33.56          @{thm solve_sqrt_equ_right.simps})]
   33.57  \<close>
   33.58 @@ -594,7 +594,7 @@
   33.59          [("#Given" ,["equality e_e","solveFor v_v"]),
   33.60            ("#Where" ,["(lhs e_e) is_sqrtTerm_in v_v"]),
   33.61            ("#Find"  ,["solutions v_v'i'"])],
   33.62 -        {rew_ord'="termlessI", rls'=RootEq_erls, srls=Rule_Set.e_rls, prls=RootEq_prls, calc=[],
   33.63 +        {rew_ord'="termlessI", rls'=RootEq_erls, srls=Rule_Set.empty, prls=RootEq_prls, calc=[],
   33.64            crls=RootEq_crls, errpats = [], nrls = norm_Poly},
   33.65          @{thm solve_sqrt_equ_left.simps})]
   33.66  \<close>
    34.1 --- a/src/Tools/isac/Knowledge/RootRat.thy	Mon Apr 06 11:44:36 2020 +0200
    34.2 +++ b/src/Tools/isac/Knowledge/RootRat.thy	Wed Apr 08 12:32:51 2020 +0200
    34.3 @@ -9,13 +9,13 @@
    34.4  val thy = @{theory};
    34.5  
    34.6  val rootrat_erls = 
    34.7 -  Rule_Set.merge_rls "rootrat_erls" Root_erls
    34.8 -    (Rule_Set.merge_rls "" rational_erls
    34.9 -      (Rule_Set.append_rls "" Rule_Set.e_rls []));
   34.10 +  Rule_Set.merge "rootrat_erls" Root_erls
   34.11 +    (Rule_Set.merge "" rational_erls
   34.12 +      (Rule_Set.append_rules "" Rule_Set.empty []));
   34.13  
   34.14  (*.calculate numeral groundterms.*)
   34.15  val calculate_RootRat = 
   34.16 -  Rule_Set.append_rls "calculate_RootRat" calculate_Rational
   34.17 +  Rule_Set.append_rules "calculate_RootRat" calculate_Rational
   34.18  	    [Rule.Thm ("distrib_left",TermC.num_str @{thm distrib_left}),
   34.19  		      (* w*(z1.0 + z2.0) = w * z1.0 + w * z2.0 *)
   34.20  		     Rule.Thm ("mult_1_left",TermC.num_str @{thm mult_1_left}),
    35.1 --- a/src/Tools/isac/Knowledge/RootRatEq.thy	Mon Apr 06 11:44:36 2020 +0200
    35.2 +++ b/src/Tools/isac/Knowledge/RootRatEq.thy	Wed Apr 08 12:32:51 2020 +0200
    35.3 @@ -70,7 +70,7 @@
    35.4  subsection \<open>rule-sets\<close>
    35.5  ML \<open>
    35.6  val RootRatEq_prls = 
    35.7 -  Rule_Set.append_rls "RootRatEq_prls" Rule_Set.e_rls
    35.8 +  Rule_Set.append_rules "RootRatEq_prls" Rule_Set.empty
    35.9  		[Rule.Num_Calc ("Prog_Expr.ident", Prog_Expr.eval_ident "#ident_"),
   35.10       Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches ""),
   35.11       Rule.Num_Calc ("Prog_Expr.lhs", Prog_Expr.eval_lhs ""),
   35.12 @@ -86,24 +86,24 @@
   35.13       Rule.Thm ("or_false",TermC.num_str @{thm or_false})];
   35.14  
   35.15  val RooRatEq_erls = 
   35.16 -  Rule_Set.merge_rls "RooRatEq_erls" rootrat_erls
   35.17 -    (Rule_Set.merge_rls "" RootEq_erls
   35.18 -     (Rule_Set.merge_rls "" rateq_erls
   35.19 -      (Rule_Set.append_rls "" Rule_Set.e_rls
   35.20 +  Rule_Set.merge "RooRatEq_erls" rootrat_erls
   35.21 +    (Rule_Set.merge "" RootEq_erls
   35.22 +     (Rule_Set.merge "" rateq_erls
   35.23 +      (Rule_Set.append_rules "" Rule_Set.empty
   35.24  		[])));
   35.25  
   35.26  val RootRatEq_crls = 
   35.27 -  Rule_Set.merge_rls "RootRatEq_crls" rootrat_erls
   35.28 -    (Rule_Set.merge_rls "" RootEq_erls
   35.29 -     (Rule_Set.merge_rls "" rateq_erls
   35.30 -      (Rule_Set.append_rls "" Rule_Set.e_rls
   35.31 +  Rule_Set.merge "RootRatEq_crls" rootrat_erls
   35.32 +    (Rule_Set.merge "" RootEq_erls
   35.33 +     (Rule_Set.merge "" rateq_erls
   35.34 +      (Rule_Set.append_rules "" Rule_Set.empty
   35.35  		[])));
   35.36  \<close> ML \<open>
   35.37  (* Solves a rootrat Equation *)
   35.38  val rootrat_solve = prep_rls'(
   35.39    Rule_Def.Repeat {id = "rootrat_solve", preconds = [], 
   35.40    rew_ord = ("termlessI",termlessI), 
   35.41 -    erls = Rule_Set.e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
   35.42 +    erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   35.43      rules = 
   35.44      [Rule.Thm("rootrat_equation_left_1", TermC.num_str @{thm rootrat_equation_left_1}),   
   35.45          (* [|c is_rootTerm_in bdv|] ==> 
   35.46 @@ -141,7 +141,7 @@
   35.47  setup \<open>KEStore_Elems.add_mets
   35.48      [Specify.prep_met @{theory LinEq} "met_rootrateq" [] Celem.e_metID
   35.49        (["RootRatEq"], [],
   35.50 -        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
   35.51 +        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
   35.52            crls=Atools_erls, errpats = [], nrls = norm_Rational}, @{thm refl})]
   35.53  \<close>
   35.54      (*-- left 20.10.02 --*)
   35.55 @@ -163,7 +163,7 @@
   35.56            ("#Where" ,["( (lhs e_e) is_rootRatAddTerm_in (v_v::real) ) | " ^
   35.57                "( (rhs e_e) is_rootRatAddTerm_in (v_v::real) )"]),
   35.58            ("#Find"  ,["solutions v_v'i'"])],
   35.59 -        {rew_ord'="termlessI", rls'=RooRatEq_erls, srls=Rule_Set.e_rls, prls=RootRatEq_prls, calc=[],
   35.60 +        {rew_ord'="termlessI", rls'=RooRatEq_erls, srls=Rule_Set.empty, prls=RootRatEq_prls, calc=[],
   35.61            crls=RootRatEq_crls, errpats = [], nrls = norm_Rational},
   35.62          @{thm solve_rootrat_equ.simps})]
   35.63  \<close>
    36.1 --- a/src/Tools/isac/Knowledge/Simplify.thy	Mon Apr 06 11:44:36 2020 +0200
    36.2 +++ b/src/Tools/isac/Knowledge/Simplify.thy	Wed Apr 08 12:32:51 2020 +0200
    36.3 @@ -29,12 +29,12 @@
    36.4        (["simplification"],
    36.5          [("#Given" ,["Term t_t"]),
    36.6            ("#Find"  ,["normalform n_n"])],
    36.7 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)], SOME "Simplify t_t", [])),
    36.8 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], SOME "Simplify t_t", [])),
    36.9      (Specify.prep_pbt thy "pbl_vereinfache" [] Celem.e_pblID
   36.10        (["vereinfachen"],
   36.11          [("#Given", ["Term t_t"]),
   36.12            ("#Find", ["normalform n_n"])],
   36.13 -        Rule_Set.append_rls "e_rls" Rule_Set.e_rls [(*for preds in where_*)], SOME "Vereinfache t_t", []))]\<close>
   36.14 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], SOME "Vereinfache t_t", []))]\<close>
   36.15  
   36.16  (** methods **)
   36.17  setup \<open>KEStore_Elems.add_mets
   36.18 @@ -42,8 +42,8 @@
   36.19  	    (["simplification"],
   36.20  	      [("#Given" ,["Term t_t"]),
   36.21  		      ("#Find"  ,["normalform n_n"])],
   36.22 -		    {rew_ord'="tless_true", rls'= Rule_Set.e_rls, calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls, crls = Rule_Set.e_rls,
   36.23 -		      errpats = [], nrls = Rule_Set.e_rls},
   36.24 +		    {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty, crls = Rule_Set.empty,
   36.25 +		      errpats = [], nrls = Rule_Set.empty},
   36.26  	      @{thm refl})]
   36.27  \<close>
   36.28  
    37.1 --- a/src/Tools/isac/Knowledge/Test.thy	Mon Apr 06 11:44:36 2020 +0200
    37.2 +++ b/src/Tools/isac/Knowledge/Test.thy	Wed Apr 08 12:32:51 2020 +0200
    37.3 @@ -360,7 +360,7 @@
    37.4  ML \<open>
    37.5  val testerls = 
    37.6    Rule_Def.Repeat {id = "testerls", preconds = [], rew_ord = ("termlessI",termlessI), 
    37.7 -      erls = Rule_Set.e_rls, srls = Rule_Set.Empty, 
    37.8 +      erls = Rule_Set.empty, srls = Rule_Set.Empty, 
    37.9        calc = [], errpatts = [], 
   37.10        rules = [Rule.Thm ("refl",TermC.num_str @{thm refl}),
   37.11  	       Rule.Thm ("order_refl",TermC.num_str @{thm order_refl}),
   37.12 @@ -394,7 +394,7 @@
   37.13  val tval_rls =  
   37.14    Rule_Def.Repeat{id = "tval_rls", preconds = [], 
   37.15        rew_ord = ("sqrt_right",sqrt_right false @{theory "Pure"}), 
   37.16 -      erls=testerls,srls = Rule_Set.e_rls, 
   37.17 +      erls=testerls,srls = Rule_Set.empty, 
   37.18        calc=[], errpatts = [],
   37.19        rules = [Rule.Thm ("refl",TermC.num_str @{thm refl}),
   37.20  	       Rule.Thm ("order_refl",TermC.num_str @{thm order_refl}),
   37.21 @@ -440,7 +440,7 @@
   37.22  val rearrange_assoc =
   37.23    Rule_Def.Repeat{id = "rearrange_assoc", preconds = [], 
   37.24        rew_ord = ("e_rew_ord",Rule.e_rew_ord), 
   37.25 -      erls = Rule_Set.e_rls, srls = Rule_Set.e_rls, calc = [], errpatts = [],
   37.26 +      erls = Rule_Set.empty, srls = Rule_Set.empty, calc = [], errpatts = [],
   37.27        rules = 
   37.28        [Rule.Thm ("sym_add_assoc",TermC.num_str (@{thm add.assoc} RS @{thm sym})),
   37.29         Rule.Thm ("sym_rmult_assoc",TermC.num_str (@{thm rmult_assoc} RS @{thm sym}))],
   37.30 @@ -449,7 +449,7 @@
   37.31  
   37.32  val ac_plus_times =
   37.33    Rule_Def.Repeat{id = "ac_plus_times", preconds = [], rew_ord = ("term_order",term_order),
   37.34 -      erls = Rule_Set.e_rls, srls = Rule_Set.e_rls, calc = [], errpatts = [],
   37.35 +      erls = Rule_Set.empty, srls = Rule_Set.empty, calc = [], errpatts = [],
   37.36        rules = 
   37.37        [Rule.Thm ("radd_commute",TermC.num_str @{thm radd_commute}),
   37.38         Rule.Thm ("radd_left_commute",TermC.num_str @{thm radd_left_commute}),
   37.39 @@ -463,7 +463,7 @@
   37.40  (*todo: replace by Rewrite("rnorm_equation_add",TermC.num_str @{thm rnorm_equation_add)*)
   37.41  val norm_equation =
   37.42    Rule_Def.Repeat{id = "norm_equation", preconds = [], rew_ord = ("e_rew_ord",Rule.e_rew_ord),
   37.43 -      erls = tval_rls, srls = Rule_Set.e_rls, calc = [], errpatts = [],
   37.44 +      erls = tval_rls, srls = Rule_Set.empty, calc = [], errpatts = [],
   37.45        rules = [Rule.Thm ("rnorm_equation_add",TermC.num_str @{thm rnorm_equation_add})
   37.46  	       ],
   37.47        scr = Rule.EmptyScr
   37.48 @@ -474,7 +474,7 @@
   37.49  val Test_simplify =
   37.50    Rule_Def.Repeat{id = "Test_simplify", preconds = [], 
   37.51        rew_ord = ("sqrt_right",sqrt_right false @{theory "Pure"}),
   37.52 -      erls = tval_rls, srls = Rule_Set.e_rls, 
   37.53 +      erls = tval_rls, srls = Rule_Set.empty, 
   37.54        calc=[(*since 040209 filled by prep_rls'*)], errpatts = [],
   37.55        rules = [
   37.56  	       Rule.Thm ("real_diff_minus",TermC.num_str @{thm real_diff_minus}),
   37.57 @@ -530,7 +530,7 @@
   37.58  (*isolate the root in a root-equation*)
   37.59  val isolate_root =
   37.60    Rule_Def.Repeat{id = "isolate_root", preconds = [], rew_ord = ("e_rew_ord",Rule.e_rew_ord), 
   37.61 -      erls=tval_rls,srls = Rule_Set.e_rls, calc=[], errpatts = [],
   37.62 +      erls=tval_rls,srls = Rule_Set.empty, calc=[], errpatts = [],
   37.63        rules = [Rule.Thm ("rroot_to_lhs",TermC.num_str @{thm rroot_to_lhs}),
   37.64  	       Rule.Thm ("rroot_to_lhs_mult",TermC.num_str @{thm rroot_to_lhs_mult}),
   37.65  	       Rule.Thm ("rroot_to_lhs_add_mult",TermC.num_str @{thm rroot_to_lhs_add_mult}),
   37.66 @@ -544,7 +544,7 @@
   37.67  (*isolate the bound variable in an equation; 'bdv' is a meta-constant*)
   37.68  val isolate_bdv =
   37.69      Rule_Def.Repeat{id = "isolate_bdv", preconds = [], rew_ord = ("e_rew_ord",Rule.e_rew_ord),
   37.70 -	erls=tval_rls,srls = Rule_Set.e_rls, calc= [], errpatts = [],
   37.71 +	erls=tval_rls,srls = Rule_Set.empty, calc= [], errpatts = [],
   37.72  	rules = 
   37.73  	[Rule.Thm ("risolate_bdv_add",TermC.num_str @{thm risolate_bdv_add}),
   37.74  	 Rule.Thm ("risolate_bdv_mult_add",TermC.num_str @{thm risolate_bdv_mult_add}),
   37.75 @@ -564,13 +564,13 @@
   37.76    ("isolate_root", (Context.theory_name @{theory}, prep_rls' isolate_root)), 
   37.77    ("isolate_bdv", (Context.theory_name @{theory}, prep_rls' isolate_bdv)), 
   37.78    ("matches", (Context.theory_name @{theory}, prep_rls'
   37.79 -    (Rule_Set.append_rls "matches" testerls [Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "#matches_")])))]
   37.80 +    (Rule_Set.append_rules "matches" testerls [Rule.Num_Calc ("Prog_Expr.matches", Prog_Expr.eval_matches "#matches_")])))]
   37.81  \<close>
   37.82  
   37.83  subsection \<open>problems\<close>
   37.84  (** problem types **)
   37.85  setup \<open>KEStore_Elems.add_pbts
   37.86 -  [(Specify.prep_pbt thy "pbl_test" [] Celem.e_pblID (["test"], [], Rule_Set.e_rls, NONE, [])),
   37.87 +  [(Specify.prep_pbt thy "pbl_test" [] Celem.e_pblID (["test"], [], Rule_Set.empty, NONE, [])),
   37.88      (Specify.prep_pbt thy "pbl_test_equ" [] Celem.e_pblID
   37.89        (["equation","test"],
   37.90          [("#Given" ,["equality e_e","solveFor v_v"]),
   37.91 @@ -787,28 +787,28 @@
   37.92          [("#Given" ,["equality (v_v ^^^2 + p_p * v_v + q__q = 0)","solveFor v_v"]),
   37.93            ("#Where" ,["HOL.False"]),
   37.94            ("#Find"  ,["solutions v_v'i'"])],
   37.95 -        Rule_Set.e_rls, SOME "solve (e_e::bool, v_v)", [])),
   37.96 +        Rule_Set.empty, SOME "solve (e_e::bool, v_v)", [])),
   37.97      (Specify.prep_pbt thy "pbl_test_uni_poly_deg2" [] Celem.e_pblID
   37.98        (["degree_two","polynomial","univariate","equation","test"],
   37.99          [("#Given" ,["equality (v_v ^^^2 + p_p * v_v + q__q = 0)","solveFor v_v"]),
  37.100            ("#Find"  ,["solutions v_v'i'"])],
  37.101 -        Rule_Set.e_rls, SOME "solve (v_v ^^^2 + p_p * v_v + q__q = 0, v_v)", [])),
  37.102 +        Rule_Set.empty, SOME "solve (v_v ^^^2 + p_p * v_v + q__q = 0, v_v)", [])),
  37.103      (Specify.prep_pbt thy "pbl_test_uni_poly_deg2_pq" [] Celem.e_pblID
  37.104        (["pq_formula","degree_two","polynomial","univariate","equation","test"],
  37.105          [("#Given" ,["equality (v_v ^^^2 + p_p * v_v + q__q = 0)","solveFor v_v"]),
  37.106            ("#Find"  ,["solutions v_v'i'"])],
  37.107 -        Rule_Set.e_rls, SOME "solve (v_v ^^^2 + p_p * v_v + q__q = 0, v_v)", [])),
  37.108 +        Rule_Set.empty, SOME "solve (v_v ^^^2 + p_p * v_v + q__q = 0, v_v)", [])),
  37.109      (Specify.prep_pbt thy "pbl_test_uni_poly_deg2_abc" [] Celem.e_pblID
  37.110        (["abc_formula","degree_two","polynomial","univariate","equation","test"],
  37.111          [("#Given" ,["equality (a_a * x ^^^2 + b_b * x + c_c = 0)","solveFor v_v"]),
  37.112            ("#Find"  ,["solutions v_v'i'"])],
  37.113 -        Rule_Set.e_rls, SOME "solve (a_a * x ^^^2 + b_b * x + c_c = 0, v_v)", [])),
  37.114 +        Rule_Set.empty, SOME "solve (a_a * x ^^^2 + b_b * x + c_c = 0, v_v)", [])),
  37.115      (Specify.prep_pbt thy "pbl_test_uni_root" [] Celem.e_pblID
  37.116        (["squareroot","univariate","equation","test"],
  37.117          [("#Given" ,["equality e_e","solveFor v_v"]),
  37.118            ("#Where" ,["precond_rootpbl v_v"]),
  37.119            ("#Find"  ,["solutions v_v'i'"])],
  37.120 -        Rule_Set.append_rls "contains_root" Rule_Set.e_rls [Rule.Num_Calc ("Test.contains'_root",
  37.121 +        Rule_Set.append_rules "contains_root" Rule_Set.empty [Rule.Num_Calc ("Test.contains'_root",
  37.122              eval_contains_root "#contains_root_")], 
  37.123          SOME "solve (e_e::bool, v_v)", [["Test","square_equation"]])),
  37.124      (Specify.prep_pbt thy "pbl_test_uni_norm" [] Celem.e_pblID
  37.125 @@ -816,27 +816,27 @@
  37.126          [("#Given" ,["equality e_e","solveFor v_v"]),
  37.127            ("#Where" ,[]),
  37.128            ("#Find"  ,["solutions v_v'i'"])],
  37.129 -        Rule_Set.e_rls, SOME "solve (e_e::bool, v_v)", [["Test","norm_univar_equation"]])),
  37.130 +        Rule_Set.empty, SOME "solve (e_e::bool, v_v)", [["Test","norm_univar_equation"]])),
  37.131      (Specify.prep_pbt thy "pbl_test_uni_roottest" [] Celem.e_pblID
  37.132        (["sqroot-test","univariate","equation","test"],
  37.133          [("#Given" ,["equality e_e","solveFor v_v"]),
  37.134            ("#Where" ,["precond_rootpbl v_v"]),
  37.135            ("#Find"  ,["solutions v_v'i'"])],
  37.136 -        Rule_Set.e_rls, SOME "solve (e_e::bool, v_v)", [])),
  37.137 +        Rule_Set.empty, SOME "solve (e_e::bool, v_v)", [])),
  37.138      (Specify.prep_pbt thy "pbl_test_intsimp" [] Celem.e_pblID
  37.139        (["inttype","test"],
  37.140          [("#Given" ,["intTestGiven t_t"]),
  37.141            ("#Where" ,[]),
  37.142            ("#Find"  ,["intTestFind s_s"])],
  37.143 -      Rule_Set.e_rls, NONE, [["Test","intsimp"]]))]\<close>
  37.144 +      Rule_Set.empty, NONE, [["Test","intsimp"]]))]\<close>
  37.145  
  37.146  section \<open>methods\<close>
  37.147  subsection \<open>differentiate\<close>
  37.148  setup \<open>KEStore_Elems.add_mets
  37.149      [Specify.prep_met @{theory "Diff"} "met_test" [] Celem.e_metID
  37.150        (["Test"], [],
  37.151 -        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.e_rls, prls=Rule_Set.e_rls,
  37.152 -          crls=Atools_erls, errpats = [], nrls = Rule_Set.e_rls}, @{thm refl})]
  37.153 +        {rew_ord'="tless_true",rls'=Atools_erls,calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty,
  37.154 +          crls=Atools_erls, errpats = [], nrls = Rule_Set.empty}, @{thm refl})]
  37.155  \<close>
  37.156  
  37.157  partial_function (tailrec) solve_linear :: "bool \<Rightarrow> real \<Rightarrow> bool list"
  37.158 @@ -854,7 +854,7 @@
  37.159          [("#Given" ,["equality e_e","solveFor v_v"]),
  37.160            ("#Where" ,["matches (?a = ?b) e_e"]),
  37.161            ("#Find"  ,["solutions v_v'i'"])],
  37.162 -        {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = Rule_Set.e_rls,
  37.163 +        {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = Rule_Set.empty,
  37.164            prls = assoc_rls' @{theory} "matches", calc = [], crls = tval_rls, errpats = [],
  37.165            nrls = Test_simplify},
  37.166          @{thm solve_linear.simps})]
  37.167 @@ -887,11 +887,11 @@
  37.168            ("#Where" ,["contains_root (e_e::bool)"]),
  37.169            ("#Find"  ,["solutions v_v'i'"])],
  37.170          {rew_ord'="e_rew_ord",rls'=tval_rls,
  37.171 -          srls = Rule_Set.append_rls "srls_contains_root" Rule_Set.e_rls
  37.172 +          srls = Rule_Set.append_rules "srls_contains_root" Rule_Set.empty
  37.173                [Rule.Num_Calc ("Test.contains'_root", eval_contains_root "")],
  37.174 -          prls = Rule_Set.append_rls "prls_contains_root" Rule_Set.e_rls 
  37.175 +          prls = Rule_Set.append_rules "prls_contains_root" Rule_Set.empty 
  37.176                [Rule.Num_Calc ("Test.contains'_root", eval_contains_root "")],
  37.177 -          calc=[], crls=tval_rls, errpats = [], nrls = Rule_Set.e_rls (*,asm_rls=[],
  37.178 +          calc=[], crls=tval_rls, errpats = [], nrls = Rule_Set.empty (*,asm_rls=[],
  37.179            asm_thm=[("square_equation_left",""), ("square_equation_right","")]*)},
  37.180          @{thm solve_root_equ.simps})]
  37.181  \<close>
  37.182 @@ -914,8 +914,8 @@
  37.183          [("#Given" ,["equality e_e","solveFor v_v"]),
  37.184            ("#Where" ,["precond_rootmet v_v"]),
  37.185            ("#Find"  ,["solutions v_v'i'"])],
  37.186 -        {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = Rule_Set.e_rls,
  37.187 -          prls = Rule_Set.append_rls "prls_met_test_squ_sub" Rule_Set.e_rls
  37.188 +        {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = Rule_Set.empty,
  37.189 +          prls = Rule_Set.append_rules "prls_met_test_squ_sub" Rule_Set.empty
  37.190                [Rule.Num_Calc ("Test.precond'_rootmet", eval_precond_rootmet "")],
  37.191            calc=[], crls=tval_rls, errpats = [], nrls = Test_simplify},
  37.192          @{thm minisubpbl.simps})]
  37.193 @@ -946,9 +946,9 @@
  37.194          [("#Given" ,["equality e_e","solveFor v_v"]),
  37.195            ("#Find"  ,["solutions v_v'i'"])],
  37.196          {rew_ord'="e_rew_ord",rls'=tval_rls,
  37.197 -          srls = Rule_Set.append_rls "srls_contains_root" Rule_Set.e_rls 
  37.198 -            [Rule.Num_Calc ("Test.contains'_root", eval_contains_root"")], prls=Rule_Set.e_rls, calc=[], crls=tval_rls,
  37.199 -              errpats = [], nrls = Rule_Set.e_rls(*,asm_rls=[], asm_thm=[("square_equation_left",""),
  37.200 +          srls = Rule_Set.append_rules "srls_contains_root" Rule_Set.empty 
  37.201 +            [Rule.Num_Calc ("Test.contains'_root", eval_contains_root"")], prls=Rule_Set.empty, calc=[], crls=tval_rls,
  37.202 +              errpats = [], nrls = Rule_Set.empty(*,asm_rls=[], asm_thm=[("square_equation_left",""),
  37.203                ("square_equation_right","")]*)},
  37.204          @{thm solve_root_equ2.simps})]
  37.205  \<close>
  37.206 @@ -979,9 +979,9 @@
  37.207            [("#Given" ,["equality e_e","solveFor v_v"]),
  37.208            ("#Find"  ,["solutions v_v'i'"])],
  37.209          {rew_ord'="e_rew_ord",rls'=tval_rls,
  37.210 -          srls = Rule_Set.append_rls "srls_contains_root" Rule_Set.e_rls 
  37.211 +          srls = Rule_Set.append_rules "srls_contains_root" Rule_Set.empty 
  37.212                [Rule.Num_Calc ("Test.contains'_root", eval_contains_root"")],
  37.213 -          prls=Rule_Set.e_rls,calc=[], crls=tval_rls, errpats = [], nrls = Rule_Set.e_rls(*,asm_rls=[],
  37.214 +          prls=Rule_Set.empty,calc=[], crls=tval_rls, errpats = [], nrls = Rule_Set.empty(*,asm_rls=[],
  37.215            asm_thm=[("square_equation_left",""), ("square_equation_right","")]*)},
  37.216          @{thm solve_root_equ3.simps})]
  37.217  \<close>
  37.218 @@ -1012,9 +1012,9 @@
  37.219          [("#Given" ,["equality e_e","solveFor v_v"]),
  37.220            ("#Find"  ,["solutions v_v'i'"])],
  37.221          {rew_ord'="e_rew_ord",rls'=tval_rls,
  37.222 -          srls = Rule_Set.append_rls "srls_contains_root" Rule_Set.e_rls 
  37.223 +          srls = Rule_Set.append_rules "srls_contains_root" Rule_Set.empty 
  37.224                [Rule.Num_Calc ("Test.contains'_root", eval_contains_root"")],
  37.225 -          prls=Rule_Set.e_rls,calc=[], crls=tval_rls, errpats = [], nrls = Rule_Set.e_rls (*,asm_rls=[],
  37.226 +          prls=Rule_Set.empty,calc=[], crls=tval_rls, errpats = [], nrls = Rule_Set.empty (*,asm_rls=[],
  37.227            asm_thm=[("square_equation_left",""), ("square_equation_right","")]*)},
  37.228          @{thm solve_root_equ4.simps})]
  37.229  \<close>
  37.230 @@ -1041,8 +1041,8 @@
  37.231                "(matches (?a +    v_v ^^^2 = 0) e_e) |" ^
  37.232                "(matches (        v_v ^^^2 = 0) e_e)"]), 
  37.233            ("#Find"  ,["solutions v_v'i'"])],
  37.234 -        {rew_ord'="e_rew_ord",rls'=tval_rls,calc=[],srls=Rule_Set.e_rls,
  37.235 -          prls = assoc_rls' @{theory} "matches", crls=tval_rls, errpats = [], nrls = Rule_Set.e_rls(*,
  37.236 +        {rew_ord'="e_rew_ord",rls'=tval_rls,calc=[],srls=Rule_Set.empty,
  37.237 +          prls = assoc_rls' @{theory} "matches", crls=tval_rls, errpats = [], nrls = Rule_Set.empty(*,
  37.238            asm_rls=[],asm_thm=[]*)},
  37.239          @{thm solve_plain_square.simps})]
  37.240  \<close>
  37.241 @@ -1064,8 +1064,8 @@
  37.242          [("#Given",["equality e_e","solveFor v_v"]),
  37.243            ("#Where" ,[]), 
  37.244            ("#Find"  ,["solutions v_v'i'"])],
  37.245 -        {rew_ord'="e_rew_ord",rls'=tval_rls,srls = Rule_Set.e_rls,prls=Rule_Set.e_rls, calc=[], crls=tval_rls,
  37.246 -          errpats = [], nrls = Rule_Set.e_rls},
  37.247 +        {rew_ord'="e_rew_ord",rls'=tval_rls,srls = Rule_Set.empty,prls=Rule_Set.empty, calc=[], crls=tval_rls,
  37.248 +          errpats = [], nrls = Rule_Set.empty},
  37.249          @{thm norm_univariate_equ.simps})]
  37.250  \<close>
  37.251  subsection \<open>diophantine equation\<close>
  37.252 @@ -1082,7 +1082,7 @@
  37.253          [("#Given" ,["intTestGiven t_t"]),
  37.254            ("#Where" ,[]),
  37.255            ("#Find"  ,["intTestFind s_s"])],
  37.256 -        {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = Rule_Set.e_rls,  prls = Rule_Set.e_rls, calc = [],
  37.257 +        {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = Rule_Set.empty,  prls = Rule_Set.empty, calc = [],
  37.258            crls = tval_rls, errpats = [], nrls = Test_simplify},
  37.259          @{thm test_simplify.simps})]
  37.260  \<close>
    38.1 --- a/src/Tools/isac/Knowledge/Test_Build_Thydata.thy	Mon Apr 06 11:44:36 2020 +0200
    38.2 +++ b/src/Tools/isac/Knowledge/Test_Build_Thydata.thy	Wed Apr 08 12:32:51 2020 +0200
    38.3 @@ -14,13 +14,13 @@
    38.4  
    38.5  ML \<open>
    38.6  val rls111 = Rule_Def.Repeat {id = "rls111", 
    38.7 -	preconds = [], rew_ord = ("termlessI", termlessI), erls = Rule_Set.e_rls, 
    38.8 +	preconds = [], rew_ord = ("termlessI", termlessI), erls = Rule_Set.empty, 
    38.9  	srls = Rule_Set.Empty, calc = [], errpatts = [],
   38.10  	rules = [Rule.Thm ("thm111", @{thm thm111}), Rule.Thm ("refl", @{thm refl})],
   38.11  	scr = Rule.EmptyScr};
   38.12  
   38.13  val rls222 = Rule_Def.Repeat {id = "rls222", 
   38.14 -	preconds = [], rew_ord = ("termlessI", termlessI), erls = Rule_Set.e_rls, 
   38.15 +	preconds = [], rew_ord = ("termlessI", termlessI), erls = Rule_Set.empty, 
   38.16  	srls = Rule_Set.Empty, calc = [], errpatts = [],
   38.17  	rules = [Rule.Thm ("sym_thm111", @{thm thm111} RS @{thm sym}), Rule.Thm ("o_def", @{thm o_def})],
   38.18  	scr = Rule.EmptyScr};
   38.19 @@ -39,14 +39,14 @@
   38.20  \<close> ML \<open>
   38.21  val [aaa, bbb, ccc, ddd, eee] = KEStore_Elems.get_rlss @{theory};
   38.22  \<close> ML \<open>
   38.23 -if eq_set op = (map fst [aaa, bbb, ccc], ["e_rrls", "e_rls", "prog_expr"]) then ()
   38.24 +if eq_set op = (map fst [aaa, bbb, ccc], ["e_rrls", "empty", "prog_expr"]) then ()
   38.25  else error "test/../thy-hierarchy CHANGED"
   38.26  \<close> ML \<open>
   38.27  case ddd of
   38.28    ("rls111",
   38.29      ("Test_Build_Thydata",
   38.30       Rule_Def.Repeat {calc = [], erls =
   38.31 -          Rule_Def.Repeat {calc = [], erls = Erls, errpatts = [], id = "e_rls", preconds = [], rew_ord =
   38.32 +          Rule_Def.Repeat {calc = [], erls = Erls, errpatts = [], id = "empty", preconds = [], rew_ord =
   38.33                 ("dummy_ord", _), rules = [], scr = EmptyScr, srls = Rule_Set.Empty},
   38.34            errpatts = [], id = "rls111", preconds = [], rew_ord = ("termlessI", _), rules =
   38.35            [Thm ("thm111", _), Thm ("refl", _)], scr = EmptyScr, srls = Rule_Set.Empty})) => ()
   38.36 @@ -56,7 +56,7 @@
   38.37    ("rls222",
   38.38      ("Test_Build_Thydata",
   38.39       Rule_Def.Repeat {calc = [], erls =
   38.40 -          Rule_Def.Repeat {calc = [], erls = Erls, errpatts = [], id = "e_rls", preconds = [], rew_ord =
   38.41 +          Rule_Def.Repeat {calc = [], erls = Erls, errpatts = [], id = "empty", preconds = [], rew_ord =
   38.42                 ("dummy_ord", _), rules = [], scr = EmptyScr, srls = Rule_Set.Empty},
   38.43            errpatts = [], id = "rls222", preconds = [], rew_ord = ("termlessI", _), rules =
   38.44            [Thm ("sym_thm111", _), Thm ("o_def", _)], scr = EmptyScr, srls = Rule_Set.Empty})) => ()
    39.1 --- a/src/Tools/isac/MathEngBasic/istate-def.sml	Mon Apr 06 11:44:36 2020 +0200
    39.2 +++ b/src/Tools/isac/MathEngBasic/istate-def.sml	Wed Apr 08 12:32:51 2020 +0200
    39.3 @@ -54,7 +54,7 @@
    39.4    found_accept: bool,   (* flag set after execution of a tactic !shall be dropped *)
    39.5    assoc: bool}          (* is the tactic associated to input ?cont.search Unsafe_Step \<rightarrow> Safe_Step*)
    39.6  val e_pstate =
    39.7 -  {env = [], path = [], eval = Rule_Set.e_rls, form_arg = NONE, act_arg = Rule.e_term,
    39.8 +  {env = [], path = [], eval = Rule_Set.empty, form_arg = NONE, act_arg = Rule.e_term,
    39.9      or = ORundef, found_accept = false, assoc = false}
   39.10  fun topt2str NONE = "NONE"
   39.11    | topt2str (SOME t) = "SOME " ^ Rule.term2str t;
    40.1 --- a/src/Tools/isac/MathEngBasic/tactic.sml	Mon Apr 06 11:44:36 2020 +0200
    40.2 +++ b/src/Tools/isac/MathEngBasic/tactic.sml	Wed Apr 08 12:32:51 2020 +0200
    40.3 @@ -77,9 +77,9 @@
    40.4    | Check_elementwise of Rule.cterm'
    40.5    | Del_Find of Rule.cterm' | Del_Given of Rule.cterm' | Del_Relation of Rule.cterm'
    40.6  
    40.7 -  | Derive of Rule_Set.rls'
    40.8 -  | Detail_Set of Rule_Set.rls'
    40.9 -  | Detail_Set_Inst of Selem.subs * Rule_Set.rls'
   40.10 +  | Derive of Rule_Set.identifier
   40.11 +  | Detail_Set of Rule_Set.identifier
   40.12 +  | Detail_Set_Inst of Selem.subs * Rule_Set.identifier
   40.13    | End_Detail
   40.14  
   40.15    | Empty_Tac
   40.16 @@ -93,8 +93,8 @@
   40.17  
   40.18    | Rewrite of Celem.thm''
   40.19    | Rewrite_Inst of Selem.subs * Celem.thm''
   40.20 -  | Rewrite_Set of Rule_Set.rls'
   40.21 -  | Rewrite_Set_Inst of Selem.subs * Rule_Set.rls'
   40.22 +  | Rewrite_Set of Rule_Set.identifier
   40.23 +  | Rewrite_Set_Inst of Selem.subs * Rule_Set.identifier
   40.24  
   40.25    | Specify_Method of Celem.metID
   40.26    | Specify_Problem of Celem.pblID
   40.27 @@ -111,7 +111,7 @@
   40.28    val eq_tac : input * input -> bool
   40.29    val is_rewtac : input -> bool
   40.30    val is_rewset : input -> bool
   40.31 -  val rls_of : input -> Rule_Set.rls'
   40.32 +  val rls_of : input -> Rule_Set.identifier
   40.33    val rule2tac : theory -> (term * term) list ->  Rule.rule -> input
   40.34    val input_from_T : T -> input
   40.35    val result : T -> term
   40.36 @@ -165,9 +165,9 @@
   40.37    | Check_elementwise of Rule.cterm'
   40.38    | Del_Find of Rule.cterm' | Del_Given of Rule.cterm' | Del_Relation of Rule.cterm'
   40.39  
   40.40 -  | Derive of Rule_Set.rls'                 (* WN0509 drop *)
   40.41 -  | Detail_Set of Rule_Set.rls'             (* WN0509 drop *)
   40.42 -  | Detail_Set_Inst of Selem.subs * Rule_Set.rls' (* WN0509 drop *)
   40.43 +  | Derive of Rule_Set.identifier                 (* WN0509 drop *)
   40.44 +  | Detail_Set of Rule_Set.identifier             (* WN0509 drop *)
   40.45 +  | Detail_Set_Inst of Selem.subs * Rule_Set.identifier (* WN0509 drop *)
   40.46    | End_Detail                     (* WN0509 drop *)
   40.47  
   40.48    | Empty_Tac
   40.49 @@ -185,8 +185,8 @@
   40.50       and thm is created from ThmID by assoc_thm'' when entering isabisac *)
   40.51    | Rewrite of Celem.thm''
   40.52    | Rewrite_Inst of Selem.subs * Celem.thm''
   40.53 -  | Rewrite_Set of Rule_Set.rls'
   40.54 -  | Rewrite_Set_Inst of Selem.subs * Rule_Set.rls'
   40.55 +  | Rewrite_Set of Rule_Set.identifier
   40.56 +  | Rewrite_Set_Inst of Selem.subs * Rule_Set.identifier
   40.57  
   40.58    | Specify_Method of Celem.metID
   40.59    | Specify_Problem of Celem.pblID
    41.1 --- a/src/Tools/isac/ProgLang/Prog_Expr.thy	Mon Apr 06 11:44:36 2020 +0200
    41.2 +++ b/src/Tools/isac/ProgLang/Prog_Expr.thy	Wed Apr 08 12:32:51 2020 +0200
    41.3 @@ -360,13 +360,13 @@
    41.4  > reflI;
    41.5  val it = "(?t = ?t) = True"
    41.6  > val t = str2term "x = 0";
    41.7 -> val NONE = rewrite_ thy Rule.dummy_ord Rule_Set.e_rls false reflI t;
    41.8 +> val NONE = rewrite_ thy Rule.dummy_ord Rule_Set.empty false reflI t;
    41.9  
   41.10  > val t = str2term "1 = 0";
   41.11 -> val NONE = rewrite_ thy Rule.dummy_ord Rule_Set.e_rls false reflI t;
   41.12 +> val NONE = rewrite_ thy Rule.dummy_ord Rule_Set.empty false reflI t;
   41.13  ----------- thus needs Rule.Num_Calc !
   41.14  > val t = str2term "0 = 0";
   41.15 -> val SOME (t',_) = rewrite_ thy Rule.dummy_ord Rule_Set.e_rls false reflI t;
   41.16 +> val SOME (t',_) = rewrite_ thy Rule.dummy_ord Rule_Set.empty false reflI t;
   41.17  > Rule.term2str t';
   41.18  val it = "HOL.True"
   41.19  
   41.20 @@ -533,7 +533,7 @@
   41.21  
   41.22  subsection \<open>extend rule-set for evaluating pre-conditions and program-expressions\<close>
   41.23  ML \<open>
   41.24 -val prog_expr = Rule_Set.append_rls "prog_expr" prog_expr [Rule.Num_Calc ("Prog_Expr.rhs", Prog_Expr.eval_rhs "")];
   41.25 +val prog_expr = Rule_Set.append_rules "prog_expr" prog_expr [Rule.Num_Calc ("Prog_Expr.rhs", Prog_Expr.eval_rhs "")];
   41.26  \<close> ML \<open>
   41.27  \<close> ML \<open>
   41.28  \<close>
    42.1 --- a/src/Tools/isac/ProgLang/rewrite.sml	Mon Apr 06 11:44:36 2020 +0200
    42.2 +++ b/src/Tools/isac/ProgLang/rewrite.sml	Wed Apr 08 12:32:51 2020 +0200
    42.3 @@ -141,8 +141,8 @@
    42.4            case rul of
    42.5              Rule.Thm (thmid, thm) =>
    42.6                (trace1 i (" try thm: \"" ^ thmid ^ "\"");
    42.7 -              case rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule_Set.rep_rls) rls)
    42.8 -                  ((#erls o Rule_Set.rep_rls) rls) put_asm thm ct of
    42.9 +              case rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule_Set.rep) rls)
   42.10 +                  ((#erls o Rule_Set.rep) rls) put_asm thm ct of
   42.11                  NONE => rew_once ruls asm ct apno thms
   42.12                | SOME (ct', asm') => 
   42.13                  (trace1 i (" rewrites to: \"" ^ Rule.t2str thy ct' ^ "\"");
   42.14 @@ -155,8 +155,8 @@
   42.15                  NONE => rew_once ruls asm ct apno thms
   42.16                | SOME (_, thm') => 
   42.17                  let 
   42.18 -                  val pairopt = rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule_Set.rep_rls) rls)
   42.19 -                    ((#erls o Rule_Set.rep_rls) rls) put_asm thm' ct;
   42.20 +                  val pairopt = rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule_Set.rep) rls)
   42.21 +                    ((#erls o Rule_Set.rep) rls) put_asm thm' ct;
   42.22                    val _ = if pairopt <> NONE then () else error ("rewrite_set_, rewrite_ \"" ^ 
   42.23                      Rule.string_of_thmI thm' ^ "\" " ^ Rule.t2str thy ct ^ " = NONE")
   42.24                    val _ = trace1 i (" calc. to: " ^ Rule.t2str thy ((fst o the) pairopt))
   42.25 @@ -169,8 +169,8 @@
   42.26                  NONE => (ct, asm)
   42.27                | SOME (_, thm') =>
   42.28                  let 
   42.29 -                  val pairopt = rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule_Set.rep_rls) rls)
   42.30 -                    ((#erls o Rule_Set.rep_rls) rls) put_asm thm' ct;
   42.31 +                  val pairopt = rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule_Set.rep) rls)
   42.32 +                    ((#erls o Rule_Set.rep) rls) put_asm thm' ct;
   42.33                    val _ = if pairopt <> NONE then () else error ("rewrite_set_, rewrite_ \"" ^
   42.34                       Rule.string_of_thmI thm' ^ "\" " ^ Rule.t2str thy ct ^ " = NONE")
   42.35                    val _ = trace1 i (" cal1. to: " ^ Rule.t2str thy ((fst o the) pairopt))
   42.36 @@ -181,7 +181,7 @@
   42.37                SOME (t', asm') => rew_once ruls (union (op =) asm asm') t' Appl thms
   42.38              | NONE => rew_once ruls asm ct apno thms)
   42.39            | r => raise ERROR ("rew_once not appl. to \"" ^ Rule_Set.rule2str r ^ "\"");
   42.40 -      val ruls = (#rules o Rule_Set.rep_rls) rls;
   42.41 +      val ruls = (#rules o Rule_Set.rep) rls;
   42.42        val _ = trace i (" rls: " ^ Rule_Set.id_rls rls ^ " on: " ^ Rule.t2str thy ct)
   42.43        val (ct', asm') = rew_once ruls [] ct Noap ruls;
   42.44  	  in if ct = ct' then NONE else SOME (ct', distinct asm') end
   42.45 @@ -269,7 +269,7 @@
   42.46      in case Num_Calc.adhoc_thm thy isa_fn ct of
   42.47  	   NONE => NONE
   42.48  	 | SOME (thmID, thm) =>
   42.49 -	   (let val rew = case rewrite_ thy Rule.dummy_ord Rule_Set.e_rls false thm ct of
   42.50 +	   (let val rew = case rewrite_ thy Rule.dummy_ord Rule_Set.empty false thm ct of
   42.51           SOME (rew, _) => rew
   42.52         | NONE => raise ERROR ""
   42.53       in SOME (rew, (thmID, thm)) end)
    43.1 --- a/src/Tools/isac/TODO.thy	Mon Apr 06 11:44:36 2020 +0200
    43.2 +++ b/src/Tools/isac/TODO.thy	Wed Apr 08 12:32:51 2020 +0200
    43.3 @@ -217,7 +217,7 @@
    43.4      in Minisubplb/200-start-method-NEXT_STEP.sml:
    43.5       (*+* )------- in f3cac3053e7b (Rule_Set.empty just renamed, NOT deleted) we had
    43.6       (*+*)  prls =
    43.7 -     (*+*)    Rls {calc = [], erls = Erls, errpatts = [], id = "e_rls", preconds = [], rew_ord =
    43.8 +     (*+*)    Rls {calc = [], erls = Erls, errpatts = [], id = "empty", preconds = [], rew_ord =
    43.9       (*+*)      ("dummy_ord", fn), rules = [], scr = EmptyScr, srls = Erls}:
   43.10       (*+*).. THIS IS Rule_Set.empty, BUT IT DID not CAUSE ANY ERROR !
   43.11       (*+*)------- WITH Rule_Set.empty REMOVED (based on f3cac3053e7b) we had
   43.12 @@ -543,7 +543,7 @@
   43.13    \item [*\_prls] 
   43.14    \item [*\_srls] 
   43.15    \end{description}
   43.16 -{\tt Rule_Set.append_rls, Rule_Set.merge_rls, remove_rls} TODO
   43.17 +{\tt Rule_Set.append_rules, Rule_Set.merge, remove_rls} TODO
   43.18  \<close>
   43.19  
   43.20  subsection \<open>get proof-state\<close>
    44.1 --- a/test/Tools/isac/ADDTESTS/accumulate-val/Lucas_Interpreter.thy	Mon Apr 06 11:44:36 2020 +0200
    44.2 +++ b/test/Tools/isac/ADDTESTS/accumulate-val/Lucas_Interpreter.thy	Wed Apr 08 12:32:51 2020 +0200
    44.3 @@ -4,6 +4,6 @@
    44.4  
    44.5  ML_file "lucas_interpreter.sml"
    44.6  ML \<open>
    44.7 -(*val test_ruleset' = Unsynchronized.ref ([] : (rls' * (theory' * rls)) list)*)
    44.8 +(*val test_ruleset' = Unsynchronized.ref ([] : (Rule_Set.identifier * (theory' * rls)) list)*)
    44.9  \<close>
   44.10  end
    45.1 --- a/test/Tools/isac/ADDTESTS/accumulate-val/Thy_2.thy	Mon Apr 06 11:44:36 2020 +0200
    45.2 +++ b/test/Tools/isac/ADDTESTS/accumulate-val/Thy_2.thy	Wed Apr 08 12:32:51 2020 +0200
    45.3 @@ -1,7 +1,7 @@
    45.4  theory Thy_2 imports Thy_1 begin
    45.5  
    45.6  ML \<open>val test_list_rls =
    45.7 -  Rule_Set.append_rls "test_list_rls" Rule_Set.e_rls
    45.8 +  Rule_Set.append_rules "test_list_rls" Rule_Set.empty
    45.9      [Rule.Thm ("refl", @{thm refl}), Rule.Thm ("subst", @{thm subst})]\<close>
   45.10  
   45.11  setup \<open>Test_KEStore_Elems.add_rlss 
    46.1 --- a/test/Tools/isac/ADDTESTS/accumulate-val/Thy_2b.thy	Mon Apr 06 11:44:36 2020 +0200
    46.2 +++ b/test/Tools/isac/ADDTESTS/accumulate-val/Thy_2b.thy	Wed Apr 08 12:32:51 2020 +0200
    46.3 @@ -1,7 +1,7 @@
    46.4  theory Thy_2b imports Thy_1 begin
    46.5  
    46.6  ML \<open>val test_list_rls =
    46.7 -  Rule_Set.append_rls "test_list_rls" Rule_Set.e_rls [Rule.Thm ("False_def", @{thm False_def})]\<close>
    46.8 +  Rule_Set.append_rules "test_list_rls" Rule_Set.empty [Rule.Thm ("False_def", @{thm False_def})]\<close>
    46.9  
   46.10  setup \<open>Test_KEStore_Elems.add_rlss [("test_list_rls", (Context.theory_name @{theory},
   46.11    test_list_rls))]\<close>
    47.1 --- a/test/Tools/isac/ADDTESTS/accumulate-val/Thy_3.thy	Mon Apr 06 11:44:36 2020 +0200
    47.2 +++ b/test/Tools/isac/ADDTESTS/accumulate-val/Thy_3.thy	Wed Apr 08 12:32:51 2020 +0200
    47.3 @@ -1,7 +1,7 @@
    47.4  theory Thy_3 imports Thy_2 Thy_2b begin
    47.5  
    47.6  ML \<open>val test_list_rls =
    47.7 -  Rule_Set.append_rls "test_list_rls" Rule_Set.e_rls [Rule.Thm ("not_def", @{thm not_def})]\<close>
    47.8 +  Rule_Set.append_rules "test_list_rls" Rule_Set.empty [Rule.Thm ("not_def", @{thm not_def})]\<close>
    47.9  
   47.10  setup \<open>Test_KEStore_Elems.add_rlss (*already added in Thy_1.thy and Thy_2.thy*)
   47.11    [("test_list_rls", (Context.theory_name @{theory}, test_list_rls))]\<close>
   47.12 @@ -11,7 +11,7 @@
   47.13    then () else error "rls identified by string-identifier, not by theory: changed"
   47.14  
   47.15  (*test_ruleset' := overwritelthy @{theory} (! test_ruleset', [("test_list_rls", 
   47.16 -    append_rls "test_list_rls" test_list_rls [Num_Calc ("test_function", e_evalfn)])])*)
   47.17 +    Rule_Set.append_rules "test_list_rls" test_list_rls [Num_Calc ("test_function", e_evalfn)])])*)
   47.18    ;
   47.19  (*if length (Test_KEStore_Elems.get_rlss @{theory}) = length (! test_ruleset')
   47.20    then () else error "Test_KEStore_Elems.get_rlss = test_ruleset': changed"*)
   47.21 @@ -22,7 +22,7 @@
   47.22    case rules of
   47.23      [Rule.Thm ("not_def", _)] => ()
   47.24    | _ => error "union rls_eq changed: 1st argument is NOT overwritten anymore"
   47.25 -  (* merge rules of rls with the same identifier rls' must be done one level higher:
   47.26 +  (* merge rules of rls with the same Rule_Set.identifier must be done one level higher:
   47.27      Test_KEStore_Elems.add_rlss does *add* or *overwrite* *)
   47.28  \<close>
   47.29  
    48.1 --- a/test/Tools/isac/ADDTESTS/accumulate-val/lucas_interpreter.sml	Mon Apr 06 11:44:36 2020 +0200
    48.2 +++ b/test/Tools/isac/ADDTESTS/accumulate-val/lucas_interpreter.sml	Wed Apr 08 12:32:51 2020 +0200
    48.3 @@ -7,8 +7,8 @@
    48.4  *)
    48.5  signature KESTORE_ELEMS =
    48.6  sig
    48.7 -  val get_rlss: theory -> (Rule_Set.rls' * (Rule.theory' * Rule_Set.T)) list
    48.8 -  val add_rlss: (Rule_Set.rls' * (Rule.theory' * Rule_Set.T)) list -> theory -> theory
    48.9 +  val get_rlss: theory -> (Rule_Set.identifier * (Rule.theory' * Rule_Set.T)) list
   48.10 +  val add_rlss: (Rule_Set.identifier * (Rule.theory' * Rule_Set.T)) list -> theory -> theory
   48.11    val get_calcs: theory -> (Rule_Set.prog_calcID * (Rule.calID * Rule.eval_fn)) list
   48.12    val add_calcs: (Rule_Set.prog_calcID * (Rule.calID * Rule.eval_fn)) list -> theory -> theory
   48.13    (*etc*)
   48.14 @@ -20,7 +20,7 @@
   48.15  
   48.16    fun rls_eq ((id1, (thyID1, _)), (id2, (thyID2, _))) = id1 = id2 (*andalso thyID1 = thyID2*)
   48.17    structure Data = Theory_Data (
   48.18 -    type T = (Rule_Set.rls' * (Rule.theory' * Rule_Set.T)) list;
   48.19 +    type T = (Rule_Set.identifier * (Rule.theory' * Rule_Set.T)) list;
   48.20      val empty = [];
   48.21      val extend = I;
   48.22      val merge = merge rls_eq;
    49.1 --- a/test/Tools/isac/ADDTESTS/course/CADGME/example_2.thy	Mon Apr 06 11:44:36 2020 +0200
    49.2 +++ b/test/Tools/isac/ADDTESTS/course/CADGME/example_2.thy	Wed Apr 08 12:32:51 2020 +0200
    49.3 @@ -33,7 +33,7 @@
    49.4  text\<open>Create Ruleset and insert rules\<close>
    49.5  
    49.6  ML \<open>
    49.7 -  val transform = append_rls "transform" e_rls
    49.8 +  val transform = Rule_Set.append_rules "transform" Rule_Set.empty
    49.9      [ Thm  ("rule3",num_str @{thm rule3}),
   49.10        Thm  ("rule4",num_str @{thm rule4}),
   49.11        Thm  ("rule1",num_str @{thm rule1})   
    50.1 --- a/test/Tools/isac/ADDTESTS/course/SignalProcess/Build_Inverse_Z_Transform.thy	Mon Apr 06 11:44:36 2020 +0200
    50.2 +++ b/test/Tools/isac/ADDTESTS/course/SignalProcess/Build_Inverse_Z_Transform.thy	Wed Apr 08 12:32:51 2020 +0200
    50.3 @@ -73,7 +73,7 @@
    50.4  text\<open>\noindent We try to apply the rules to a given expression.\<close>
    50.5  
    50.6  ML \<open>
    50.7 -  val inverse_Z = append_rls "inverse_Z" e_rls
    50.8 +  val inverse_Z = Rule_Set.append_rules "inverse_Z" Rule_Set.empty
    50.9      [ Thm  ("rule3",TermC.num_str @{thm rule3}),
   50.10        Thm  ("rule4",TermC.num_str @{thm rule4}),
   50.11        Thm  ("rule1",TermC.num_str @{thm rule1})   
   50.12 @@ -616,7 +616,7 @@
   50.13    
   50.14  ML \<open>
   50.15    val SOME (t1,_) = 
   50.16 -    rewrite_ @{theory} e_rew_ord e_rls false 
   50.17 +    rewrite_ @{theory} e_rew_ord Rule_Set.empty false 
   50.18               @{thm ansatz_2nd_order} expr';
   50.19    term2str t1; atomty t1;
   50.20    val eq1 = HOLogic.mk_eq (expr', t1);
   50.21 @@ -631,7 +631,7 @@
   50.22  
   50.23  ML \<open>
   50.24    val SOME (eq2,_) = 
   50.25 -    rewrite_ @{theory} e_rew_ord e_rls false 
   50.26 +    rewrite_ @{theory} e_rew_ord Rule_Set.empty false 
   50.27               @{thm equival_trans_2nd_order} eq1;
   50.28    term2str eq2;
   50.29  \<close>
   50.30 @@ -699,7 +699,7 @@
   50.31  ML \<open>
   50.32    val ansatz_rls = prep_rls @{theory} (
   50.33      Rule_Set.Repeat {id = "ansatz_rls", preconds = [], rew_ord = ("dummy_ord",dummy_ord),
   50.34 -      erls = e_rls, srls = Rule_Set.Empty, calc = [], errpatts = [],
   50.35 +      erls = Rule_Set.empty, srls = Rule_Set.Empty, calc = [], errpatts = [],
   50.36        rules = [
   50.37          Thm ("ansatz_2nd_order",num_str @{thm ansatz_2nd_order}),
   50.38          Thm ("equival_trans_2nd_order",num_str @{thm equival_trans_2nd_order})
   50.39 @@ -732,7 +732,7 @@
   50.40  
   50.41  ML \<open>
   50.42    val SOME (eq4_1,_) =
   50.43 -    rewrite_terms_ @{theory} e_rew_ord e_rls [s_1] eq3'';
   50.44 +    rewrite_terms_ @{theory} e_rew_ord Rule_Set.empty [s_1] eq3'';
   50.45    term2str eq4_1;
   50.46    val SOME (eq4_2,_) =
   50.47      rewrite_set_ @{theory} false norm_Rational eq4_1;
   50.48 @@ -812,7 +812,7 @@
   50.49  
   50.50  ML \<open>
   50.51    val SOME (eq4b_1,_) =
   50.52 -    rewrite_terms_ @{theory} e_rew_ord e_rls [s_2] eq3'';
   50.53 +    rewrite_terms_ @{theory} e_rew_ord Rule_Set.empty [s_2] eq3'';
   50.54    term2str eq4b_1;
   50.55    val SOME (eq4b_2,_) =
   50.56      rewrite_set_ @{theory} false norm_Rational eq4b_1;
   50.57 @@ -883,9 +883,9 @@
   50.58        \em Z\_Transform\normalfont.\<close>
   50.59  
   50.60  setup \<open>KEStore_Elems.add_pbts
   50.61 -  [prep_pbt thy "pbl_SP" [] e_pblID (["SignalProcessing"], [], e_rls, NONE, []),
   50.62 +  [prep_pbt thy "pbl_SP" [] e_pblID (["SignalProcessing"], [], Rule_Set.empty, NONE, []),
   50.63      prep_pbt thy "pbl_SP_Ztrans" [] e_pblID
   50.64 -      (["Z_Transform","SignalProcessing"], [], e_rls, NONE, [])]\<close>
   50.65 +      (["Z_Transform","SignalProcessing"], [], Rule_Set.empty, NONE, [])]\<close>
   50.66  
   50.67  text\<open>\noindent For the suddenly created node we have to define the input
   50.68         and output parameters. We already prepared their definition in
   50.69 @@ -896,7 +896,7 @@
   50.70        (["Inverse", "Z_Transform", "SignalProcessing"],
   50.71          [("#Given" ,["filterExpression X_eq"]),
   50.72            ("#Find", ["stepResponse n_eq"])],
   50.73 -        append_rls "e_rls" e_rls [(*for preds in where_*)],
   50.74 +        Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)],
   50.75          NONE,
   50.76          [["SignalProcessing","Z_Transform","Inverse"]])]\<close>
   50.77  ML \<open>
   50.78 @@ -923,13 +923,13 @@
   50.79  setup \<open>KEStore_Elems.add_mets
   50.80    [prep_met thy "met_SP" [] e_metID
   50.81        (["SignalProcessing"], [],
   50.82 -        {rew_ord'="tless_true", rls'= e_rls, calc = [], srls = e_rls, prls = e_rls, crls = e_rls,
   50.83 -          errpats = [], nrls = e_rls},
   50.84 +        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty, crls = Rule_Set.empty,
   50.85 +          errpats = [], nrls = Rule_Set.empty},
   50.86          "empty_script"),
   50.87      prep_met thy "met_SP_Ztrans" [] e_metID
   50.88        (["SignalProcessing", "Z_Transform"], [],
   50.89 -        {rew_ord'="tless_true", rls'= e_rls, calc = [], srls = e_rls, prls = e_rls, crls = e_rls,
   50.90 -          errpats = [], nrls = e_rls},
   50.91 +        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty, crls = Rule_Set.empty,
   50.92 +          errpats = [], nrls = Rule_Set.empty},
   50.93          "empty_script")]
   50.94  \<close>
   50.95  
   50.96 @@ -942,8 +942,8 @@
   50.97        (["SignalProcessing", "Z_Transform", "Inverse"], 
   50.98          [("#Given" ,["filterExpression X_eq", "boundVariable X_z"]),
   50.99            ("#Find", ["stepResponse n_eq"])],
  50.100 -        {rew_ord'="tless_true", rls'= e_rls, calc = [], srls = e_rls, prls = e_rls, crls = e_rls,
  50.101 -          errpats = [], nrls = e_rls},
  50.102 +        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty, crls = Rule_Set.empty,
  50.103 +          errpats = [], nrls = Rule_Set.empty},
  50.104          "empty_script")]
  50.105  \<close>
  50.106  
  50.107 @@ -956,8 +956,8 @@
  50.108        (["SignalProcessing", "Z_Transform", "Inverse"], 
  50.109          [("#Given" , ["filterExpression X_eq", "boundVariable X_z"]),
  50.110            ("#Find", ["stepResponse n_eq"])],
  50.111 -        {rew_ord'="tless_true", rls'= e_rls, calc = [], srls = e_rls, prls = e_rls, crls = e_rls,
  50.112 -          errpats = [], nrls = e_rls},
  50.113 +        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty, crls = Rule_Set.empty,
  50.114 +          errpats = [], nrls = Rule_Set.empty},
  50.115          "Program InverseZTransform (Xeq::bool) =" ^ (*TODO boundVariable X_z*)
  50.116            " (let X = Take Xeq;" ^
  50.117            "      X = Rewrite ruleZY X" ^
  50.118 @@ -1088,7 +1088,7 @@
  50.119      Rule_Set.Repeat {id="srls_InverseZTransform", 
  50.120           preconds = [],
  50.121           rew_ord = ("termlessI",termlessI),
  50.122 -         erls = append_rls "erls_in_srls_InverseZTransform" e_rls
  50.123 +         erls = Rule_Set.append_rules "erls_in_srls_InverseZTransform" Rule_Set.empty
  50.124             [(*for asm in NTH_CONS ...*)
  50.125              Num_Calc ("Orderings.ord_class.less",eval_equ "#less_"),
  50.126              (*2nd NTH_CONS pushes n+-1 into asms*)
  50.127 @@ -1126,8 +1126,8 @@
  50.128        (["SignalProcessing", "Z_Transform", "Inverse"], 
  50.129          [("#Given" , ["filterExpression X_eq"]), (*TODO boundVariable X_z*)
  50.130            ("#Find", ["stepResponse n_eq"])],
  50.131 -        {rew_ord'="tless_true", rls'= e_rls, calc = [], srls = srls, prls = e_rls, crls = e_rls,
  50.132 -          errpats = [], nrls = e_rls},
  50.133 +        {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = srls, prls = Rule_Set.empty, crls = Rule_Set.empty,
  50.134 +          errpats = [], nrls = Rule_Set.empty},
  50.135          "Program InverseZTransform (X_eq::bool) =                        "^
  50.136            (*(1/z) instead of z ^^^ -1*)
  50.137            "(let X = Take X_eq;                                            "^
    51.1 --- a/test/Tools/isac/BridgeLibisabelle/datatypes.sml	Mon Apr 06 11:44:36 2020 +0200
    51.2 +++ b/test/Tools/isac/BridgeLibisabelle/datatypes.sml	Wed Apr 08 12:32:51 2020 +0200
    51.3 @@ -189,13 +189,13 @@
    51.4  ". (/THEOREM)\n" ^ 
    51.5  "(/REWRITEINSTTACTIC)\n" then () else error "xml_of_tac Rewrite_Inst CHANGED";
    51.6  
    51.7 -Rewrite_Set: rls' -> Tactic.input;
    51.8 +Rewrite_Set: Rule_Set.identifier -> Tactic.input;
    51.9  val tac = Rewrite_Set("simplify");
   51.10  if xmlstr 0 (xml_of_tac tac) = "(REWRITESETTACTIC name=Rewrite_Set)\n" ^ 
   51.11  ". simplify\n" ^ 
   51.12  "(/REWRITESETTACTIC)\n" then () else error "xml_of_tac Rewrite_Set CHANGED";
   51.13  
   51.14 -Rewrite_Set_Inst: subs * rls' -> Tactic.input;
   51.15 +Rewrite_Set_Inst: subs * Rule_Set.identifier -> Tactic.input;
   51.16  val tac = Rewrite_Set_Inst(["(''bdv'', x)"], "simplify");
   51.17  if xmlstr 0 (xml_of_tac tac) =
   51.18  "(REWRITESETINSTTACTIC name=Rewrite_Set_Inst)\n" ^ 
    52.1 --- a/test/Tools/isac/BridgeLibisabelle/pbl-met-hierarchy.sml	Mon Apr 06 11:44:36 2020 +0200
    52.2 +++ b/test/Tools/isac/BridgeLibisabelle/pbl-met-hierarchy.sml	Wed Apr 08 12:32:51 2020 +0200
    52.3 @@ -84,7 +84,7 @@
    52.4    "    </KESTOREREF>\n"^
    52.5    "  </METHODS>\n"^
    52.6  
    52.7 -  "  <EVALPRECOND> e_rls </EVALPRECOND>\n"^
    52.8 +  "  <EVALPRECOND> empty </EVALPRECOND>\n"^
    52.9    "  <MATHAUTHORS>\n"^
   52.10    "  </MATHAUTHORS>\n"^
   52.11    "  <COURSEDESIGNS>\n"^
    53.1 --- a/test/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml	Mon Apr 06 11:44:36 2020 +0200
    53.2 +++ b/test/Tools/isac/BridgeLibisabelle/thy-hierarchy.sml	Wed Apr 08 12:32:51 2020 +0200
    53.3 @@ -19,7 +19,7 @@
    53.4  "----------- search for data error in thes2file ------------------";
    53.5  "----------- thes2file: thy_containing_rls : rls '...' not in ! --";
    53.6  "----------- fun Thm.make_thm ------------------------------------";
    53.7 -"----------- correct theIDs for e_rls ----------------------------";
    53.8 +"----------- correct theIDs for Rule_Set.empty -------------------";
    53.9  "----------- fun revert_sym --------------------------------------";
   53.10  "----------- fun thms_of_rlss ------------------------------------";
   53.11  "----------- repair thydata2xml for rls --------------------------";
   53.12 @@ -131,7 +131,7 @@
   53.13  		      srls, calc, errpatts, rules, scr})) = (j, (thyID, "Rule_Set.Seqence", data));
   53.14  "~~~~~ fun rules2xml, args:"; val (j, thyID, (r::rs)) = ((j+2*i), thyID, rules);
   53.15  "~~~~~ fun rule2xml, args:"; val (j, thyID, (Rls_ rls)) = (j, thyID, r);
   53.16 -val rls' = (#id o rep_rls) rls;
   53.17 +val rls' = (#id o Rule_Set.rep) rls;
   53.18  (* \----- uncomment in case of "data error in thes2file" ----------------------------(*1*)-----/
   53.19    another way to tackle this kind of error is shown in
   53.20  "----------- thes2file: thy_containing_rls : rls '...' not in ! --";   ------------------------*)
   53.21 @@ -157,15 +157,15 @@
   53.22    theID = ["IsacKnowledge", "Biegelinie", "Theorems", "Belastung_Querkraft"]
   53.23  then () else error "store_thm: guh | theID changed";
   53.24  
   53.25 -"----------- correct theIDs for e_rls ----------------------------";
   53.26 -"----------- correct theIDs for e_rls ----------------------------";
   53.27 -"----------- correct theIDs for e_rls ----------------------------";
   53.28 -if thy_containing_rls "Build_Thydata" "e_rls" = ("IsacScripts", "KEStore") then ()
   53.29 -else error "thy_containing_rls e_rls changed";
   53.30 +"----------- correct theIDs for Rule_Set.empty ----------------------------";
   53.31 +"----------- correct theIDs for Rule_Set.empty ----------------------------";
   53.32 +"----------- correct theIDs for Rule_Set.empty ----------------------------";
   53.33 +if thy_containing_rls "Build_Thydata" "empty" = ("IsacScripts", "KEStore") then ()
   53.34 +else error "thy_containing_rls Rule_Set.empty changed";
   53.35  show_thes ();
   53.36 -(*shows different assignment for "e_rls"...
   53.37 +(*shows different assignment for "empty"...
   53.38    : 
   53.39 -                                                ["IsacScripts", "KEStore", "Rulesets", "e_rls"], 
   53.40 +                                                ["IsacScripts", "KEStore", "Rulesets", "empty"], 
   53.41    :*)
   53.42  
   53.43  "----------- fun revert_sym --------------------------------------";
   53.44 @@ -188,8 +188,8 @@
   53.45  "----------- fun thms_of_rlss ------------------------------------";
   53.46  "----------- fun thms_of_rlss ------------------------------------";
   53.47  val rlss = 
   53.48 -  [("e_rls" : rls', ("KEStore": theory', e_rls)),
   53.49 -  ("discard_minus" : rls', ("Poly": theory', discard_minus))]
   53.50 +  [("empty" : Rule_Set.identifier, ("KEStore": theory', Rule_Set.empty)),
   53.51 +  ("discard_minus" : Rule_Set.identifier, ("Poly": theory', discard_minus))]
   53.52  ;
   53.53  val [_, (thmID, term)] = thms_of_rlss thy rlss;
   53.54  (*
   53.55 @@ -198,7 +198,7 @@
   53.56  *)
   53.57  ;
   53.58  "~~~~~ fun thms_of_rlss, args:"; val (thy, rlss) = (@{theory Isac_Knowledge}, rlss);
   53.59 -val rlss' = (rlss : (rls' * (theory' * Rule_Set.T)) list)
   53.60 +val rlss' = (rlss : (Rule_Set.identifier * (theory' * Rule_Set.T)) list)
   53.61    |> map (thms_of_rls o #2 o #2)
   53.62      (* = [[], [Thm ("real_diff_minus", "?a - ?b = ?a + -1 * ?b"), 
   53.63        Thm ("sym_real_mult_minus1", "- ?z1 = -1 * ?z1")]]*)
   53.64 @@ -249,13 +249,13 @@
   53.65  "    </ORDER>\n" ^
   53.66  "    <ERLS>\n" ^
   53.67  "      <TAG> Ruleset </TAG>\n" ^
   53.68 -"      <STRING> e_rls </STRING>\n" ^
   53.69 -"      <GUH> thy_isac_Poly-rls-e_rls </GUH>\n" ^
   53.70 +"      <STRING> empty </STRING>\n" ^
   53.71 +"      <GUH> thy_isac_Poly-rls-empty </GUH>\n" ^
   53.72  "    </ERLS>\n" ^
   53.73  "    <SRLS>\n" ^
   53.74  "      <TAG> Ruleset </TAG>\n" ^
   53.75 -"      <STRING> e_rls </STRING>\n" ^
   53.76 -"      <GUH> thy_isac_Poly-rls-e_rls </GUH>\n" ^
   53.77 +"      <STRING> empty </STRING>\n" ^
   53.78 +"      <GUH> thy_isac_Poly-rls-empty </GUH>\n" ^
   53.79  "    </SRLS>\n" ^
   53.80  "    <SCRIPT>  </SCRIPT>\n" ^
   53.81  (*
   53.82 @@ -282,7 +282,7 @@
   53.83  (*                         CHANGE FOR CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^*)
   53.84      |> remove (fn (rlsID, (rls', (_, _))) => rlsID = rls') "prog_expr" (*unpleasant in test*)
   53.85      |> remove (fn (rlsID, (rls', (_, _))) => rlsID = rls') "e_rrls"   (*unpleasant in test*)
   53.86 -    |> remove (fn (rlsID, (rls', (_, _))) => rlsID = rls') "e_rls"    (*unpleasant in test*)
   53.87 +    |> remove (fn (rlsID, (rls', (_, _))) => rlsID = rls') "empty"    (*unpleasant in test*)
   53.88      |> thms_of_rlss @{theory}            (*length =  4*)
   53.89  
   53.90    val rlsthmsNOTisac = isacrlsthms       (*length =  2*)
    54.1 --- a/test/Tools/isac/BridgeLibisabelle/use-cases.sml	Mon Apr 06 11:44:36 2020 +0200
    54.2 +++ b/test/Tools/isac/BridgeLibisabelle/use-cases.sml	Wed Apr 08 12:32:51 2020 +0200
    54.3 @@ -161,7 +161,7 @@
    54.4   val (ptp as (pt,p), tacis) = get_calc 1; get_pos 1 1; (*<---------------------- orig. test code*)
    54.5  (*+isa=REP*) if p = ([1], Frm) andalso term2str (get_obj g_form pt [1]) = "1 + -1 * 2 + x = 0"
    54.6  andalso Istate.string_of (get_istate_LI pt p)
    54.7 -  = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [], e_rls, NONE, \n??.empty, ORundef, false, true)"
    54.8 +  = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [], empty, NONE, \n??.empty, ORundef, false, true)"
    54.9  then () else error "refFormula =   1 + -1 * 2 + x = 0   changed";
   54.10  (*-------------------------------------------------------------------------*)
   54.11  
   54.12 @@ -181,11 +181,11 @@
   54.13  (*//******************* Step.by_tactic returns tac_ + istate + cstate *****************************\\*)
   54.14  Step.by_tactic : Tactic.input -> state -> string * (taci list * pos' list * state);
   54.15  if Istate.string_of istate
   54.16 - = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], e_rls, SOME e_e, \nx = 0 + -1 * (1 + -1 * 2), ORundef, true, true)"
   54.17 + = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], empty, SOME e_e, \nx = 0 + -1 * (1 + -1 * 2), ORundef, true, true)"
   54.18  then () else error "from Step.by_tactic return --- changed 1";
   54.19  
   54.20  if Istate.string_of (get_istate_LI (fst cstate) (snd cstate))
   54.21 - = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], e_rls, SOME e_e, \nx = 0 + -1 * (1 + -1 * 2), ORundef, true, true)"
   54.22 + = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], empty, SOME e_e, \nx = 0 + -1 * (1 + -1 * 2), ORundef, true, true)"
   54.23  then () else error "from Step.by_tactic return --- changed 2";
   54.24  (*\\******************* Step.by_tactic returns tac_ + istate + cstate *****************************//*)
   54.25  
   54.26 @@ -204,7 +204,7 @@
   54.27  (*+*)Safe_Step: Istate.T * Proof.context * Tactic.T -> input_tactic_result;
   54.28  (********************* locate_input_tactic returns cstate * istate * Proof.context  *************)
   54.29  (*+*)if Istate.string_of istate
   54.30 -(*+isa*) = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], e_rls, SOME e_e, \nx = 0 + -1 * (1 + -1 * 2), ORundef, true, true)"
   54.31 +(*+isa*) = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], empty, SOME e_e, \nx = 0 + -1 * (1 + -1 * 2), ORundef, true, true)"
   54.32  then case m of Rewrite_Set_Inst' _ => ()
   54.33  else error "from locate_input_tactic return --- changed";
   54.34  
   54.35 @@ -230,7 +230,7 @@
   54.36  (*+isa==REP*)val [(Rewrite_Set_Inst (["(''bdv'', x)"], "isolate_bdv"),
   54.37       Rewrite_Set_Inst' _, (pos', (istate, ctxt)))] = tacis;
   54.38  (*+*)if pos' = ([1], Res) andalso Istate.string_of istate
   54.39 - = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], e_rls, SOME e_e, \nx = 0 + -1 * (1 + -1 * 2), ORundef, true, true)"
   54.40 + = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], empty, SOME e_e, \nx = 0 + -1 * (1 + -1 * 2), ORundef, true, true)"
   54.41  then () else error "init. step 1 + -1 * 2 + x = 0 changed";
   54.42  
   54.43         val pIopt = get_pblID (pt,ip);
   54.44 @@ -242,7 +242,7 @@
   54.45  val ("ok", [], ptp as (pt, p)) = xxxx;
   54.46                                           
   54.47  if Istate.string_of (get_istate_LI pt p) (*                <>                 <>                 <>                 <>                     ^^^^^^^^^^^^^*)
   54.48 -(*REP*) = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], e_rls, SOME e_e, \nx = 0 + -1 * (1 + -1 * 2), ORundef, true, true)"
   54.49 +(*REP*) = "Pstate ([\"\n(e_e, 1 + -1 * 2 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], empty, SOME e_e, \nx = 0 + -1 * (1 + -1 * 2), ORundef, true, true)"
   54.50  then () else error "REP autoCalculate on (e_e, 1 + -1 * 2 + x = 0) changed"
   54.51  
   54.52  "~~~~~ from TOPLEVEL to states return:";  upd_calc cI (ptp, []); upd_ipos cI 1 p;
    55.1 --- a/test/Tools/isac/CalcElements/calcelems.sml	Mon Apr 06 11:44:36 2020 +0200
    55.2 +++ b/test/Tools/isac/CalcElements/calcelems.sml	Wed Apr 08 12:32:51 2020 +0200
    55.3 @@ -11,7 +11,7 @@
    55.4  "-------- fun thmID_of_derivation_name ------------------";
    55.5  "-------- fun term2str ----------------------------------";
    55.6  "-------- fun thmID_of_derivation_name 000---------------";
    55.7 -"-------- fun merge_rlss -----------------------------------------------------";
    55.8 +"-------- fun Rule_Set.merge -----------------------------------------------------";
    55.9  "-------- fun update_ptyps --------------------------------------------------";
   55.10  "-------- fun subst2str' -----------------------------------------------------------------------";
   55.11  "--------------------------------------------------------";
   55.12 @@ -100,21 +100,21 @@
   55.13  if thyID_of_derivation_name long_id = "Groups" then ()
   55.14  else error "fun thyID_of_derivation_name broken";
   55.15  
   55.16 -"-------- fun merge_rlss -----------------------------------------------------";
   55.17 -"-------- fun merge_rlss -----------------------------------------------------";
   55.18 -"-------- fun merge_rlss -----------------------------------------------------";
   55.19 +"-------- fun Rule_Set.merge -----------------------------------------------------";
   55.20 +"-------- fun Rule_Set.merge -----------------------------------------------------";
   55.21 +"-------- fun Rule_Set.merge -----------------------------------------------------";
   55.22  (*theory Thy_2 imports Thy_1*)
   55.23  val rlss2 = [("test_list_rls", (Context.theory_name @{theory},
   55.24 -  append_rls "test_list_rls" e_rls [Thm ("refl", @{thm refl}), Thm ("subst", @{thm subst})]))]
   55.25 +  Rule_Set.append_rules "test_list_rls" Rule_Set.empty [Thm ("refl", @{thm refl}), Thm ("subst", @{thm subst})]))]
   55.26  (*theory Thy_2b imports Thy_1*)
   55.27  val rlss2b = [("test_list_rls", (Context.theory_name @{theory},
   55.28 -  append_rls "test_list_rls" e_rls [Thm ("False_def", @{thm False_def})]))]
   55.29 +  Rule_Set.append_rules "test_list_rls" Rule_Set.empty [Thm ("False_def", @{thm False_def})]))]
   55.30  
   55.31 -val [(_, (_, Rule_Set.Repeat {rules, ...}))] = merge_rlss (rlss2, rlss2b)
   55.32 +val [(_, (_, Rule_Set.Repeat {rules, ...}))] = Rule_Set.to_kestore (rlss2, rlss2b)
   55.33  ;
   55.34  case rules of
   55.35    [Thm ("subst", _), Thm ("refl", _), Thm ("False_def", _)] => ()
   55.36 -| _ => error "merge_rlss changed"
   55.37 +| _ => error "Rule_Set.merge changed"
   55.38  
   55.39  "-------- fun update_ptyps --------------------------------------------------";
   55.40  "-------- fun update_ptyps --------------------------------------------------";
    56.1 --- a/test/Tools/isac/CalcElements/kestore.sml	Mon Apr 06 11:44:36 2020 +0200
    56.2 +++ b/test/Tools/isac/CalcElements/kestore.sml	Wed Apr 08 12:32:51 2020 +0200
    56.3 @@ -15,8 +15,8 @@
    56.4  "-------- fun check_kestore_rls ----------------------------------------------";
    56.5  "-------- fun check_kestore_rls ----------------------------------------------";
    56.6  "-------- fun check_kestore_rls ----------------------------------------------";
    56.7 -if check_kestore_rls ("e_rls", ("KEStore", e_rls)) = 
    56.8 -  "(e_rls, (KEStore, Rls {#calc = 0, #rules = 0, ...))"
    56.9 +if check_kestore_rls ("empty", ("KEStore", Rule_Set.empty)) = 
   56.10 +  "(empty, (KEStore, Rls {#calc = 0, #rules = 0, ...))"
   56.11  then () else error "check_kestore_rls changed"
   56.12  ;
   56.13  Test_KEStore_Elems.get_rlss @{theory Isac_Knowledge}
   56.14 @@ -34,10 +34,10 @@
   56.15  
   56.16  val data1 = [("test", ("theory-1", Rule_Set.Empty)),
   56.17    ("test_rls", ("theory-1", 
   56.18 -    append_rls "test_rls" e_rls [Thm ("refl", @{thm refl}), Thm ("subst", @{thm subst})]))]
   56.19 +    Rule_Set.append_rules "test_rls" Rule_Set.empty [Thm ("refl", @{thm refl}), Thm ("subst", @{thm subst})]))]
   56.20  val data2 = 
   56.21    [("test_rls", ("theory-2",
   56.22 -    append_rls "test_rls" e_rls [Thm ("not_def", @{thm not_def})]))]
   56.23 +    Rule_Set.append_rules "test_rls" Rule_Set.empty [Thm ("not_def", @{thm not_def})]))]
   56.24  val data_3a = union rls_eq data1 data2
   56.25  val data_3b = union_overwrite rls_eq data1 data2
   56.26  
    57.1 --- a/test/Tools/isac/CalcElements/libraryC.sml	Mon Apr 06 11:44:36 2020 +0200
    57.2 +++ b/test/Tools/isac/CalcElements/libraryC.sml	Wed Apr 08 12:32:51 2020 +0200
    57.3 @@ -19,7 +19,7 @@
    57.4  "----------- fun union, fun merge --------------------------------------------------------------";
    57.5  "----------- fun union, fun merge --------------------------------------------------------------";
    57.6  if union (op =) [1,2,3] [3,4,5] = [2, 1, 3, 4, 5] then () else error "union changed";
    57.7 -if merge (op =) ([1,2,3], [3,4,5]) = [4, 5, 1, 2, 3] then () else error "merge changed";
    57.8 +if Library.merge (op =) ([1,2,3], [3,4,5]) = [4, 5, 1, 2, 3] then () else error "merge changed";
    57.9  
   57.10  "----------- fun drop_nth, fun takerest, fun takelast  -----------------------------------------";
   57.11  "----------- fun drop_nth, fun takerest, fun takelast  -----------------------------------------";
    58.1 --- a/test/Tools/isac/Interpret/error-pattern.sml	Mon Apr 06 11:44:36 2020 +0200
    58.2 +++ b/test/Tools/isac/Interpret/error-pattern.sml	Wed Apr 08 12:32:51 2020 +0200
    58.3 @@ -116,13 +116,13 @@
    58.4  "----------------------------------------------------------";
    58.5  
    58.6   val fod = make_deriv (@{theory "Isac_Knowledge"}) Atools_erls 
    58.7 -		       ((#rules o rep_rls) Test_simplify)
    58.8 +		       ((#rules o Rule_Set.rep) Test_simplify)
    58.9  		       (sqrt_right false (@{theory "Pure"})) NONE 
   58.10  		       (str2term "x + 1 + -1 * 2 = 0");
   58.11   (writeln o trtas2str) fod;
   58.12  
   58.13   val ifod = make_deriv (@{theory "Isac_Knowledge"}) Atools_erls 
   58.14 -		       ((#rules o rep_rls) Test_simplify)
   58.15 +		       ((#rules o Rule_Set.rep) Test_simplify)
   58.16  		       (sqrt_right false (@{theory "Pure"})) NONE 
   58.17  		       (str2term "-2 * 1 + (1 + x) = 0");
   58.18   (writeln o trtas2str) ifod;
   58.19 @@ -901,7 +901,7 @@
   58.20  val (res, inf) = (str2term "(2 + 3)/(3 + 4)", str2term "1 / 2");
   58.21  
   58.22  val (res', _, _, rewritten) = (*rewritten: the lhs of the pattern matches in res*)
   58.23 -  rew_sub thy 1 [] e_rew_ord e_rls false [] (HOLogic.Trueprop $ pat) res;
   58.24 +  rew_sub thy 1 [] e_rew_ord Rule_Set.empty false [] (HOLogic.Trueprop $ pat) res;
   58.25  if rewritten then NONE else SOME "e_errpatID";
   58.26  
   58.27  val norm_res = case rewrite_set_ (Isac()) false rls res' of
   58.28 @@ -948,7 +948,7 @@
   58.29  val (res, inf) = (str2term "2 * x + d_d x (sin (x ^^^ 4))", str2term "2 * x + cos (4 * x ^^^ 3)");
   58.30  
   58.31  val (res', _, _, rewritten) = (*rewritten: the lhs of the pattern matches in res*)
   58.32 -  rew_sub thy 1 subst e_rew_ord e_rls false [] (HOLogic.Trueprop $ pat) res;
   58.33 +  rew_sub thy 1 subst e_rew_ord Rule_Set.empty false [] (HOLogic.Trueprop $ pat) res;
   58.34  if term2str res' = "2 * x + cos (d_d x (x ^^^ 4))" andalso rewritten then ()
   58.35  else error "build fun check_err_patt ?bdv changed 2";
   58.36  
   58.37 @@ -1111,7 +1111,7 @@
   58.38    val ((subs_opt, subst), (thm, form), errpatID, (fillpatID, pat, erpaID)) =
   58.39    (subst, (thm, form), errpatID, hd (*simulate beginning of "map"*) fillpats);
   58.40  val (form', _, _, rewritten) =
   58.41 -      rew_sub (Isac()) 1 subst e_rew_ord e_rls false [] (HOLogic.Trueprop $ pat) form;
   58.42 +      rew_sub (Isac()) 1 subst e_rew_ord Rule_Set.empty false [] (HOLogic.Trueprop $ pat) form;
   58.43  
   58.44  if term2str form' = "d_d x (x ^^^ 2) + cos (x ^^^ 4) * d_d x ?_dummy_1" then ()
   58.45  else error "find_fillpatterns changed 3";
   58.46 @@ -1269,7 +1269,7 @@
   58.47  "--------- fun concat_deriv --------------------------------------";
   58.48  (*
   58.49   val ({rew_ord, erls, rules,...}, fo, ifo) = 
   58.50 -     (rep_rls Test_simplify, str2term "x+1+ -1*2=0", str2term "-2*1+(x+1)=0");
   58.51 +     (Rule_Set.rep Test_simplify, str2term "x+1+ -1*2=0", str2term "-2*1+(x+1)=0");
   58.52   (tracing o trtas2str) fod';
   58.53  > ["
   58.54  (x + 1 + -1 * 2 = 0, Thm ("radd_commute","?m + ?n = ?n + ?m"), (-1 * 2 + (x + 1) = 0, []))","
    59.1 --- a/test/Tools/isac/Interpret/lucas-interpreter.sml	Mon Apr 06 11:44:36 2020 +0200
    59.2 +++ b/test/Tools/isac/Interpret/lucas-interpreter.sml	Wed Apr 08 12:32:51 2020 +0200
    59.3 @@ -53,14 +53,14 @@
    59.4        val (is, env, ctxt, sc) = case LItool.init_pstate srls ctxt itms mI of
    59.5          (is as Istate.Pstate {env, ...}, ctxt, sc) =>  (is, env, ctxt, sc)
    59.6        | _ => error "solve Apply_Method: uncovered case init_pstate";
    59.7 -(*+*)pstate2str (the_pstate is) = "([\"\n(f_f, x ^^^ 2 + 1)\",\"\n(v_v, x)\"], [], e_rls, NONE, \n??.empty, ORundef, false, true)";
    59.8 +(*+*)pstate2str (the_pstate is) = "([\"\n(f_f, x ^^^ 2 + 1)\",\"\n(v_v, x)\"], [], empty, NONE, \n??.empty, ORundef, false, true)";
    59.9        val ini = LItool.implicit_take sc env;
   59.10        val p = lev_dn p;
   59.11  
   59.12        val NONE = (*case*) ini (*of*);
   59.13              val Next_Step (is', ctxt', m') =
   59.14                LI.find_next_step sc (pt, (p, Res)) is ctxt;
   59.15 -(*+*)pstate2str (the_pstate is') = "([\"\n(f_f, x ^^^ 2 + 1)\",\"\n(v_v, x)\"], [R,L,R], e_rls, NONE, \nIntegral x ^^^ 2 + 1 D x, ORundef, false, false)";
   59.16 +(*+*)pstate2str (the_pstate is') = "([\"\n(f_f, x ^^^ 2 + 1)\",\"\n(v_v, x)\"], [R,L,R], empty, NONE, \nIntegral x ^^^ 2 + 1 D x, ORundef, false, false)";
   59.17    val Safe_Step (_, _, Take' _) = (*case*)
   59.18             locate_input_tactic sc (pt, (p, Res)) is' ctxt' m' (*of*);
   59.19  "~~~~~ fun locate_input_tactic , args:"; val ((Prog prog), cstate, istate, ctxt, tac)
   59.20 @@ -330,7 +330,7 @@
   59.21     t, (res, asm)) = m;
   59.22  
   59.23  if pstate2str ist =
   59.24 -  "([\"\n(t_t, 5 * e + 6 * f - 8 * g - 9 - 7 * e - 4 * f + 10 * g + 12)\"], [R,L,R,R,L,R,R], e_rls, SOME t_t, \n" ^
   59.25 +  "([\"\n(t_t, 5 * e + 6 * f - 8 * g - 9 - 7 * e - 4 * f + 10 * g + 12)\"], [R,L,R,R,L,R,R], empty, SOME t_t, \n" ^
   59.26    "- (8 * g) + (- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f) + 10 * g, ORundef, true, false)"
   59.27  andalso
   59.28    term2str t = "- (8 * g) + (- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f) + 10 * g"
    60.1 --- a/test/Tools/isac/Interpret/ptyps.thy	Mon Apr 06 11:44:36 2020 +0200
    60.2 +++ b/test/Tools/isac/Interpret/ptyps.thy	Wed Apr 08 12:32:51 2020 +0200
    60.3 @@ -14,32 +14,32 @@
    60.4  section \<open>data for test "-ptyps.thy: store test-pbtyps by 'setup' ---"\<close>
    60.5  setup \<open>KEStore_Elems.add_pbts
    60.6  [(Specify.prep_pbt thy "pbl_test_refine" [] Celem.e_pblID
    60.7 -  (["refine", "test"], [], Rule_Set.e_rls, NONE, [])),
    60.8 +  (["refine", "test"], [], Rule_Set.empty, NONE, [])),
    60.9  (Specify.prep_pbt @{theory DiffApp} "pbl_pbla" [] Celem.e_pblID
   60.10    (["pbla", "refine", "test"],         
   60.11 -  [("#Given", ["fixedValues a_a"])], Rule_Set.e_rls, NONE, [])),
   60.12 +  [("#Given", ["fixedValues a_a"])], Rule_Set.empty, NONE, [])),
   60.13  (Specify.prep_pbt @{theory DiffApp} "pbl_pbla1" [] Celem.e_pblID
   60.14    (["pbla1","pbla", "refine", "test"], 
   60.15 -  [("#Given", ["fixedValues a_a","maximum a_1"])], Rule_Set.e_rls, NONE, [])),
   60.16 +  [("#Given", ["fixedValues a_a","maximum a_1"])], Rule_Set.empty, NONE, [])),
   60.17  (Specify.prep_pbt @{theory DiffApp} "pbl_pbla2" [] Celem.e_pblID
   60.18    (["pbla2","pbla", "refine", "test"], 
   60.19 -  [("#Given", ["fixedValues a_a","valuesFor a_2"])], Rule_Set.e_rls, NONE, [])),
   60.20 +  [("#Given", ["fixedValues a_a","valuesFor a_2"])], Rule_Set.empty, NONE, [])),
   60.21  (Specify.prep_pbt @{theory DiffApp} "pbl_pbla2x" [] Celem.e_pblID
   60.22    (["pbla2x","pbla2","pbla", "refine", "test"],
   60.23    [("#Given", ["fixedValues a_a","valuesFor a_2","functionOf a2_x"])], 
   60.24 -  Rule_Set.e_rls, NONE, [])),
   60.25 +  Rule_Set.empty, NONE, [])),
   60.26  (Specify.prep_pbt @{theory DiffApp} "pbl_pbla2y" [] Celem.e_pblID
   60.27    (["pbla2y","pbla2","pbla", "refine", "test"],
   60.28    [("#Given" ,["fixedValues a_a","valuesFor a_2","boundVariable a2_y"])], 
   60.29 -  Rule_Set.e_rls, NONE, [])),
   60.30 +  Rule_Set.empty, NONE, [])),
   60.31  (Specify.prep_pbt @{theory DiffApp} "pbl_pbla2z" [] Celem.e_pblID
   60.32    (["pbla2z","pbla2","pbla", "refine", "test"],
   60.33    [("#Given" ,["fixedValues a_a","valuesFor a_2","interval a2_z"])], 
   60.34 -  Rule_Set.e_rls, NONE, [])),
   60.35 +  Rule_Set.empty, NONE, [])),
   60.36  (Specify.prep_pbt @{theory DiffApp} "pbl_pbla3" [] Celem.e_pblID
   60.37   (["pbla3","pbla", "refine", "test"],
   60.38    [("#Given" ,["fixedValues a_a","relations a_3"])], 
   60.39 -  Rule_Set.e_rls, NONE, []))]
   60.40 +  Rule_Set.empty, NONE, []))]
   60.41  \<close>
   60.42  
   60.43  (*ML_file "ptyps.sml"    ... is called in Test_Isac.thy *)
    61.1 --- a/test/Tools/isac/Interpret/rewtools.sml	Mon Apr 06 11:44:36 2020 +0200
    61.2 +++ b/test/Tools/isac/Interpret/rewtools.sml	Wed Apr 08 12:32:51 2020 +0200
    61.3 @@ -72,7 +72,7 @@
    61.4  if thy_containing_rls "Biegelinie" "norm_Poly" = ("IsacKnowledge", "Poly") then ()
    61.5  else error ("thy_containing_rls changed for 'Biegelinie', 'norm_Poly'")
    61.6  ;
    61.7 -if thy_containing_rls "Biegelinie" "e_rls" = ("IsacScripts", "KEStore") then ()
    61.8 +if thy_containing_rls "Biegelinie" "empty" = ("IsacScripts", "KEStore") then ()
    61.9  else error ("thy_containing_rls changed for 'Biegelinie', 'e_rls'")
   61.10  ;
   61.11  if thy_containing_rls "Build_Thydata" "prog_expr" = (*FIXME: handle redifinition in several thys*)
    62.1 --- a/test/Tools/isac/Knowledge/biegelinie-1.sml	Mon Apr 06 11:44:36 2020 +0200
    62.2 +++ b/test/Tools/isac/Knowledge/biegelinie-1.sml	Wed Apr 08 12:32:51 2020 +0200
    62.3 @@ -30,7 +30,7 @@
    62.4  val ctxt = thy2ctxt' "Biegelinie";
    62.5  fun str2term str = (Thm.term_of o the o (parse thy)) str;
    62.6  fun term2s t = term_to_string'' "Biegelinie" t;
    62.7 -fun rewrit thm str = fst (the (rewrite_ thy tless_true e_rls true thm str));
    62.8 +fun rewrit thm str = fst (the (rewrite_ thy tless_true Rule_Set.empty true thm str));
    62.9  
   62.10  "----------- the rules -------------------------------------------";
   62.11  "----------- the rules -------------------------------------------";
   62.12 @@ -54,7 +54,7 @@
   62.13  val srls = Rule_Set.Repeat {id="srls_IntegrierenUnd..", 
   62.14  		preconds = [], 
   62.15  		rew_ord = ("termlessI",termlessI), 
   62.16 -		erls = append_rls "erls_in_srls_IntegrierenUnd.." e_rls
   62.17 +		erls = Rule_Set.append_rules "erls_in_srls_IntegrierenUnd.." Rule_Set.empty
   62.18  				  [(*for asm in NTH_CONS ...*)
   62.19  				   Num_Calc ("Orderings.ord_class.less",eval_equ "#less_"),
   62.20  				   (*2nd NTH_CONS pushes n+-1 into asms*)
    63.1 --- a/test/Tools/isac/Knowledge/biegelinie-4.sml	Mon Apr 06 11:44:36 2020 +0200
    63.2 +++ b/test/Tools/isac/Knowledge/biegelinie-4.sml	Wed Apr 08 12:32:51 2020 +0200
    63.3 @@ -166,7 +166,7 @@
    63.4        val p = lev_dn p;
    63.5  val NONE = (*case*) ini (*of*);
    63.6              val (m', (is', ctxt'), _) = LI.find_next_step sc (pt, (p, Res)) is ctxt;
    63.7 -	          val d = Rule_Set.e_rls (*FIXME: get simplifier from domID*);
    63.8 +	          val d = Rule_Set.empty (*FIXME: get simplifier from domID*);
    63.9       val Safe_Step ((pt', p'), _, _, _) = (*case*) locate_input_tactic sc (pt,(p, Res)) is' ctxt' m' (*of*);
   63.10  Safe_Step : state * Istate.T * Proof.context * Tactic.T -> input_tactic_result;
   63.11  
    64.1 --- a/test/Tools/isac/Knowledge/diophanteq.sml	Mon Apr 06 11:44:36 2020 +0200
    64.2 +++ b/test/Tools/isac/Knowledge/diophanteq.sml	Wed Apr 08 12:32:51 2020 +0200
    64.3 @@ -33,7 +33,7 @@
    64.4        SOME t' => t'
    64.5      | NONE => error "diophanteq.sml: syntax error in rewriting for usecase1";
    64.6  
    64.7 -val SOME (t,_) = rewrite_inst_ thy e_rew_ord e_rls true subst 
    64.8 +val SOME (t,_) = rewrite_inst_ thy e_rew_ord Rule_Set.empty true subst 
    64.9    (num_str @{thm "int_isolate_add"}) t; term2str t;
   64.10  
   64.11  val SOME (thmID,thm) = adhoc_thm thy (the(LibraryC.assoc(KEStore_Elems.get_calcs @{theory},"TIMES"))) t; 
    65.1 --- a/test/Tools/isac/Knowledge/eqsystem.sml	Mon Apr 06 11:44:36 2020 +0200
    65.2 +++ b/test/Tools/isac/Knowledge/eqsystem.sml	Wed Apr 08 12:32:51 2020 +0200
    65.3 @@ -82,7 +82,7 @@
    65.4  "----------- problems --------------------------------------------";
    65.5  val t = str2term "LENGTH [x+y=1,y=2] = 2";
    65.6  atomty t;
    65.7 -val testrls = append_rls "testrls" e_rls 
    65.8 +val testrls = Rule_Set.append_rules "testrls" Rule_Set.empty 
    65.9  			 [(Thm ("LENGTH_NIL",num_str @{thm LENGTH_NIL})),
   65.10  			  (Thm ("LENGTH_CONS",num_str @{thm LENGTH_CONS})),
   65.11  			  Num_Calc ("Groups.plus_class.plus", eval_binop "#add_"),
   65.12 @@ -104,7 +104,7 @@
   65.13    "(NTH 1 [c_4 = 1, 2 = 2, 3 = 3, 4 = 4])");
   65.14  val SOME (t,_) = 
   65.15      rewrite_set_ thy true 
   65.16 -		 (append_rls "prls_" e_rls 
   65.17 +		 (Rule_Set.append_rules "prls_" Rule_Set.empty 
   65.18  			     [Thm ("NTH_CONS",num_str @{thm NTH_CONS}),
   65.19  			      Thm ("NTH_NIL",num_str @{thm NTH_NIL}),
   65.20  			      Thm ("TL_CONS",num_str @{thm tl_Cons}),
   65.21 @@ -443,7 +443,7 @@
   65.22  		       [("#Given" ,["equalities es_", "solveForVars v_s"]),
   65.23  			("#Find"  ,["solution ss___"](*___ is copy-named*))
   65.24  			],
   65.25 -		       append_rls "e_rls" e_rls [(*for preds in where_*)], 
   65.26 +		       Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], 
   65.27  		       SOME "solveSystem es_ v_s", 
   65.28  		       []));
   65.29     *)
   65.30 @@ -742,9 +742,9 @@
   65.31    "0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2, " ^
   65.32    "0 = c_4, " ^
   65.33    "0 = c_3]");
   65.34 -val SOME (t,_) = rewrite_ thy e_rew_ord e_rls false (num_str @{thm commute_0_equality}) t;
   65.35 -val SOME (t,_) = rewrite_ thy e_rew_ord e_rls false (num_str @{thm commute_0_equality}) t;
   65.36 -val SOME (t,_) = rewrite_ thy e_rew_ord e_rls false (num_str @{thm commute_0_equality}) t;
   65.37 +val SOME (t,_) = rewrite_ thy e_rew_ord Rule_Set.empty false (num_str @{thm commute_0_equality}) t;
   65.38 +val SOME (t,_) = rewrite_ thy e_rew_ord Rule_Set.empty false (num_str @{thm commute_0_equality}) t;
   65.39 +val SOME (t,_) = rewrite_ thy e_rew_ord Rule_Set.empty false (num_str @{thm commute_0_equality}) t;
   65.40  if term2str t = 
   65.41    "[L * q_0 = c, (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2 = 0, c_4 = 0,\n c_3 = 0]"
   65.42  then () else error "7.70 go through the rewrites in met_eqsys_norm_4x4, 1";
    66.1 --- a/test/Tools/isac/Knowledge/integrate.sml	Mon Apr 06 11:44:36 2020 +0200
    66.2 +++ b/test/Tools/isac/Knowledge/integrate.sml	Wed Apr 08 12:32:51 2020 +0200
    66.3 @@ -196,7 +196,7 @@
    66.4  "===== test 4";
    66.5  val subs = [(str2t "bdv::real", str2t "x::real")];
    66.6  val rls = 
    66.7 -  (append_rls "separate_bdv" collect_bdv
    66.8 +  (Rule_Set.append_rules "separate_bdv" collect_bdv
    66.9   	  [Thm ("separate_bdv", num_str @{thm separate_bdv}),
   66.10   		  (*"?a * ?bdv / ?b = ?a / ?b * ?bdv"*)
   66.11   		 Thm ("separate_bdv_n", num_str @{thm separate_bdv_n}),
    67.1 --- a/test/Tools/isac/Knowledge/integrate.thy	Mon Apr 06 11:44:36 2020 +0200
    67.2 +++ b/test/Tools/isac/Knowledge/integrate.thy	Wed Apr 08 12:32:51 2020 +0200
    67.3 @@ -18,8 +18,8 @@
    67.4    [Specify.prep_met @{theory "Isac_Knowledge"} "met_testint" [] Celem.e_metID
    67.5  	    (["diff","integration","test"],
    67.6  	      [("#Given" ,["functionTerm f_f", "integrateBy v_v"]), ("#Find", ["antiDerivative F_F"])],
    67.7 -	      {rew_ord'="tless_true", rls'=Atools_erls, calc = [], srls = Rule_Set.e_rls, prls = Rule_Set.e_rls,
    67.8 -	        crls = Atools_erls, errpats = [], nrls = Rule_Set.e_rls},
    67.9 +	      {rew_ord'="tless_true", rls'=Atools_erls, calc = [], srls = Rule_Set.empty, prls = Rule_Set.empty,
   67.10 +	        crls = Atools_erls, errpats = [], nrls = Rule_Set.empty},
   67.11  	      @{thm integration_test.simps})]\<close>
   67.12  
   67.13  end
    68.1 --- a/test/Tools/isac/Knowledge/partial_fractions.sml	Mon Apr 06 11:44:36 2020 +0200
    68.2 +++ b/test/Tools/isac/Knowledge/partial_fractions.sml	Wed Apr 08 12:32:51 2020 +0200
    68.3 @@ -285,7 +285,7 @@
    68.4  else error "ansatz_rls - multiply_ansatz - norm_Rational broken"; 
    68.5  
    68.6  (*test for outcommented 3 lines in script: empower erls for x = a*b ==> ...*)
    68.7 -val xxx = append_rls "multiply_ansatz_erls" norm_Rational 
    68.8 +val xxx = Rule_Set.append_rules "multiply_ansatz_erls" norm_Rational 
    68.9    [Num_Calc ("HOL.eq",eval_equal "#equal_")];
   68.10  
   68.11  val multiply_ansatz = prep_rls @{theory} (
    69.1 --- a/test/Tools/isac/Knowledge/poly.sml	Mon Apr 06 11:44:36 2020 +0200
    69.2 +++ b/test/Tools/isac/Knowledge/poly.sml	Wed Apr 08 12:32:51 2020 +0200
    69.3 @@ -344,7 +344,7 @@
    69.4  (* 100928 trace_rewrite shows the first occurring difference in 267b:
    69.5  ###  rls: order_mult_ on: 5 * x ^^^ 2 * (2 * x ^^^ 7) + 5 * x ^^^ 2 * 3 + (6 * x ^^^ 7 + 9) + (-1 * (3 * x ^^^ 5 * (6 * x ^^^ 4)) + -1 * (3 * x ^^^ 5 * -1) +
    69.6   (-48 * x ^^^ 4 + 8))
    69.7 -######  rls: e_rls-is_multUnordered on: p is_multUnordered
    69.8 +######  rls: Rule_Set.empty-is_multUnordered on: p is_multUnordered
    69.9  #######  try calc: Poly.is'_multUnordered'
   69.10  =======  calc. to: False  !!!!!!!!!!!!! INSTEAD OF TRUE in 2002 !!!!!!!!!!!!!
   69.11  *)
    70.1 --- a/test/Tools/isac/Knowledge/polyeq-1.sml	Mon Apr 06 11:44:36 2020 +0200
    70.2 +++ b/test/Tools/isac/Knowledge/polyeq-1.sml	Wed Apr 08 12:32:51 2020 +0200
    70.3 @@ -374,7 +374,7 @@
    70.4  e_metID = get_obj g_metID pt (par_pblobj pt p) (*false*);
    70.5          val thy' = get_obj g_domID pt (par_pblobj pt p);
    70.6  	        val (is, sc) = resume_prog thy' (p,p_) pt;
    70.7 -		        val d = e_rls;
    70.8 +		        val d = Rule_Set.empty;
    70.9  (*locate_input_tactic (thy',srls) m  (pt,(p,p_)) (sc,d) is;
   70.10    WAS: not-found-in-program: NotLocatable from Term_Val1 (Const ("List...*)
   70.11  "~~~~~ fun locate_input_tactic, args:"; val () = ();
    71.1 --- a/test/Tools/isac/Knowledge/polyeq-2.sml	Mon Apr 06 11:44:36 2020 +0200
    71.2 +++ b/test/Tools/isac/Knowledge/polyeq-2.sml	Wed Apr 08 12:32:51 2020 +0200
    71.3 @@ -289,14 +289,14 @@
    71.4  t |> term2str; t |> atomty;
    71.5  val thm = num_str @{thm d2_prescind1};
    71.6  thm |> Thm.prop_of |> term2str; thm |> Thm.prop_of |> atomty;
    71.7 -val SOME (t', _) = rewrite_inst_ thy e_rew_ord e_rls true subst thm t; term2str t';
    71.8 +val SOME (t', _) = rewrite_inst_ thy e_rew_ord Rule_Set.empty true subst thm t; term2str t';
    71.9  
   71.10  (*x * (-6 + 5 * x) = 0   : Rewrite_Inst (["(''bdv'',x)"],("d2_reduce_equation1","")) 
   71.11                                                                          --> x = 0 | -6 + 5 * x = 0*)
   71.12  t' |> term2str; t' |> atomty;
   71.13  val thm = num_str @{thm d2_reduce_equation1};
   71.14  thm |> Thm.prop_of |> term2str; thm |> Thm.prop_of |> atomty;
   71.15 -val SOME (t'', _) = rewrite_inst_ thy e_rew_ord e_rls true subst thm t'; term2str t'';
   71.16 +val SOME (t'', _) = rewrite_inst_ thy e_rew_ord Rule_Set.empty true subst thm t'; term2str t'';
   71.17  (* NONE with d2_reduce_equation1:   "(bdv*(a +b*bdv)=0) = ((bdv=0)|(a+b*bdv=0))"
   71.18     instead   d2_reduce_equation1:   "(bdv*(a +b*bdv)=0) = ((bdv=0)|(a+b*bdv=(0::real)))"
   71.19  *)
    72.1 --- a/test/Tools/isac/Knowledge/polyminus.sml	Mon Apr 06 11:44:36 2020 +0200
    72.2 +++ b/test/Tools/isac/Knowledge/polyminus.sml	Wed Apr 08 12:32:51 2020 +0200
    72.3 @@ -78,13 +78,13 @@
    72.4  val od = ord_make_polynomial true (@{theory "Poly"});
    72.5  val t = str2term "((a + d) + c) + b";
    72.6  "((a + d) + c) + b"; 
    72.7 -val SOME (t,_) = rewrite_ thy od e_rls true @{thm add.commute} t; term2str t;
    72.8 +val SOME (t,_) = rewrite_ thy od Rule_Set.empty true @{thm add.commute} t; term2str t;
    72.9  "b + ((a + d) + c)";
   72.10 -val SOME (t,_) = rewrite_ thy od e_rls true @{thm add.commute} t; term2str t;
   72.11 +val SOME (t,_) = rewrite_ thy od Rule_Set.empty true @{thm add.commute} t; term2str t;
   72.12  "b + (c + (a + d))";
   72.13 -val SOME (t,_) = rewrite_ thy od e_rls true @{thm add.left_commute} t;term2str t;
   72.14 +val SOME (t,_) = rewrite_ thy od Rule_Set.empty true @{thm add.left_commute} t;term2str t;
   72.15  "b + (a + (c + d))";
   72.16 -val SOME (t,_) = rewrite_ thy od e_rls true @{thm add.left_commute} t;term2str t;
   72.17 +val SOME (t,_) = rewrite_ thy od Rule_Set.empty true @{thm add.left_commute} t;term2str t;
   72.18  "a + (b + (c + d))";
   72.19  if term2str t = "a + (b + (c + d))" then ()
   72.20  else error "polyminus.sml 2 watch order_add_mult";
   72.21 @@ -92,11 +92,11 @@
   72.22  "----- if parentheses are right, left_commute is (almost) sufficient...";
   72.23  val t = str2term "a + (d + (c + b))";
   72.24  "a + (d + (c + b))";
   72.25 -val SOME (t,_) = rewrite_ thy od e_rls true @{thm add.left_commute} t;term2str t;
   72.26 +val SOME (t,_) = rewrite_ thy od Rule_Set.empty true @{thm add.left_commute} t;term2str t;
   72.27  "a + (c + (d + b))";
   72.28 -val SOME (t,_) = rewrite_ thy od e_rls true @{thm add.commute} t;term2str t;
   72.29 +val SOME (t,_) = rewrite_ thy od Rule_Set.empty true @{thm add.commute} t;term2str t;
   72.30  "a + (c + (b + d))";
   72.31 -val SOME (t,_) = rewrite_ thy od e_rls true @{thm add.left_commute} t;term2str t;
   72.32 +val SOME (t,_) = rewrite_ thy od Rule_Set.empty true @{thm add.left_commute} t;term2str t;
   72.33  "a + (b + (c + d))";
   72.34  
   72.35  "----- but we do not want the parentheses at right; thus: cond.rew.";
   72.36 @@ -109,8 +109,8 @@
   72.37  "----- here we see rew_sub going into subterm with ord.rew....";
   72.38  val od = ord_make_polynomial false (@{theory "Poly"});
   72.39  val t = str2term "b + a + c + d";
   72.40 -val SOME (t,_) = rewrite_ thy od e_rls false @{thm add.commute} t; term2str t;
   72.41 -val SOME (t,_) = rewrite_ thy od e_rls false @{thm add.commute} t; term2str t;
   72.42 +val SOME (t,_) = rewrite_ thy od Rule_Set.empty false @{thm add.commute} t; term2str t;
   72.43 +val SOME (t,_) = rewrite_ thy od Rule_Set.empty false @{thm add.commute} t; term2str t;
   72.44  (*@@@ rew_sub gosub: t = d + (b + a + c)
   72.45    @@@ rew_sub begin: t = b + a + c*)
   72.46  
   72.47 @@ -566,7 +566,7 @@
   72.48    | _ => error "polyminus.sml matchsub (?a * (?b - ?c)...A";
   72.49  
   72.50  "--- does the respective prls rewrite ?";
   72.51 -val prls = append_rls "prls_pbl_vereinf_poly" e_rls 
   72.52 +val prls = Rule_Set.append_rules "prls_pbl_vereinf_poly" Rule_Set.empty 
   72.53  	     [Num_Calc ("Poly.is'_polyexp", eval_is_polyexp ""),
   72.54  	      Num_Calc ("Prog_Expr.matchsub", eval_matchsub ""),
   72.55  	      Thm ("or_true",@{thm or_true}),
    73.1 --- a/test/Tools/isac/Knowledge/rateq.sml	Mon Apr 06 11:44:36 2020 +0200
    73.2 +++ b/test/Tools/isac/Knowledge/rateq.sml	Wed Apr 08 12:32:51 2020 +0200
    73.3 @@ -328,13 +328,13 @@
    73.4  (*[1], Frm*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*Rewrite_Set "RatEq_simplify":*)
    73.5  
    73.6  (*+*)if (get_istate_LI pt p |> Istate.string_of) (* still specify-phase: found_accept = false ---------------------------------> vvvvv*)
    73.7 -(*+*) = "Pstate ([\"\n(e_e, 5 * x / (x - 2) - x / (x + 2) = 4)\",\"\n(v_v, x)\"], [], e_rls, NONE, \n??.empty, ORundef, false, true)"
    73.8 +(*+*) = "Pstate ([\"\n(e_e, 5 * x / (x - 2) - x / (x + 2) = 4)\",\"\n(v_v, x)\"], [], Rule_Set.empty, NONE, \n??.empty, ORundef, false, true)"
    73.9  (*+*)then () else error "rat-eq + subpbl: istate in specify-phase";
   73.10  
   73.11  (*[1], Res*)val (p,_,f,nxt,_,pt) = me nxt p [1] pt;(*Rewrite_Set "norm_Rational"*)
   73.12  
   73.13  (*+*)if (get_istate_LI pt p |> Istate.string_of) (* solve-phase: found_accept = true -----------------------------------------------------------------------------------------------> vvvvv*)
   73.14 -(*+*) = "Pstate ([\"\n(e_e, 5 * x / (x - 2) - x / (x + 2) = 4)\",\"\n(v_v, x)\"], [R,L,R,L,L,R,R,R], e_rls, SOME e_e, \n5 * x / (x + -1 * 2) + -1 * x / (x + 2) = 4, ORundef, true, true)"
   73.15 +(*+*) = "Pstate ([\"\n(e_e, 5 * x / (x - 2) - x / (x + 2) = 4)\",\"\n(v_v, x)\"], [R,L,R,L,L,R,R,R], Rule_Set.empty, SOME e_e, \n5 * x / (x + -1 * 2) + -1 * x / (x + 2) = 4, ORundef, true, true)"
   73.16  (*+*)then () else error "rat-eq + subpbl: istate after found_accept";
   73.17  
   73.18  (*[2], Res*)val (p,_,f,nxt,_,pt) = me nxt p [] pt;(*Rewrite_Set "RatEq_eliminate"*)
    74.1 --- a/test/Tools/isac/Knowledge/rational-old.sml	Mon Apr 06 11:44:36 2020 +0200
    74.2 +++ b/test/Tools/isac/Knowledge/rational-old.sml	Wed Apr 08 12:32:51 2020 +0200
    74.3 @@ -736,7 +736,7 @@
    74.4  	      "(9 + (-1)*x^^^2) / (9 + ((-6)*x + x^^^2))";
    74.5    val thm = (mk_thm thy "(-6) * x = 2 * ((-3) * x)") 
    74.6        handle e => OldGoals.print_exn e;
    74.7 -  val SOME (t',_) = rewrite_ thy e_rew_ord e_rls false thm t;     
    74.8 +  val SOME (t',_) = rewrite_ thy e_rew_ord Rule_Set.empty false thm t;     
    74.9    term2str t';
   74.10  ----------------------------------------------------------------------*)
   74.11  
    75.1 --- a/test/Tools/isac/Knowledge/rational.sml	Mon Apr 06 11:44:36 2020 +0200
    75.2 +++ b/test/Tools/isac/Knowledge/rational.sml	Wed Apr 08 12:32:51 2020 +0200
    75.3 @@ -750,7 +750,7 @@
    75.4  
    75.5  "-------- gcd_poly integration level 4: iteration cancel_p -- add_fraction_p";
    75.6  (* simpler variant *)
    75.7 -val testrls = append_rls "testrls" e_rls [Rls_ cancel_p, Rls_ add_fractions_p]
    75.8 +val testrls = Rule_Set.append_rules "testrls" Rule_Set.empty [Rls_ cancel_p, Rls_ add_fractions_p]
    75.9  val SOME (t', asm) = rewrite_set_ thy false testrls t;
   75.10  (*trace_rewrite := false;
   75.11  #  rls: testrls on: 123 = a * x / (b * x) + c * x / (d * x) + e * x / (f * x) 
   75.12 @@ -764,7 +764,7 @@
   75.13  then () else error "level 4, rewrite_set_ *_p: changed";
   75.14  
   75.15  (* complicated variant *)
   75.16 -val testrls_rls = append_rls "testrls_rls" e_rls [Rls_ cancel_p_rls, Rls_ add_fractions_p_rls];
   75.17 +val testrls_rls = Rule_Set.append_rules "testrls_rls" Rule_Set.empty [Rls_ cancel_p_rls, Rls_ add_fractions_p_rls];
   75.18  val SOME (t', asm) = rewrite_set_ thy false testrls_rls t;
   75.19  (*#  rls: testrls_rls on: 123 = a * x / (b * x) + c * x / (d * x) + e * x / (f * x) 
   75.20  ##  rls: cancel_p_rls on: 123 = a * x / (b * x) + c * x / (d * x) + e * x / (f * x) 
   75.21 @@ -1699,7 +1699,7 @@
   75.22  term2str tt = "(1 * a + 1 * b) * (1 * a + -1 * b) / ((1 * a + -1 * b) * (1 * a + -1 * b))";
   75.23  
   75.24  "--- with simpler ruleset";
   75.25 -val {rules, rew_ord= (_, ro), ...} = rep_rls (assoc_rls "rev_rew_p");
   75.26 +val {rules, rew_ord= (_, ro), ...} = Rule_Set.rep (assoc_rls "rev_rew_p");
   75.27  val der = make_deriv thy Atools_erls rules ro NONE tt;
   75.28  if length der = 12 then () else error "WN1130912 rls chancel_p 4";
   75.29  (*default_print_depth 99;*) writeln (deriv2str der); (*default_print_depth 3;*)
   75.30 @@ -1713,7 +1713,7 @@
   75.31  	(str2term "(1 * a + 1 * b) * (1 * a + -1 * b)");
   75.32  (*default_print_depth 99;*) writeln (deriv2str der); (*default_print_depth 3;*)
   75.33  
   75.34 -val {rules, rew_ord=(_,ro),...} = rep_rls (assoc_rls "rev_rew_p");
   75.35 +val {rules, rew_ord=(_,ro),...} = Rule_Set.rep (assoc_rls "rev_rew_p");
   75.36  val der = make_deriv thy Atools_erls rules ro NONE 
   75.37  	(str2term "(1 * a + -1 * b) * (1 * a + -1 * b)");
   75.38  (*default_print_depth 99;*) writeln (deriv2str der); (*default_print_depth 3;*)
    76.1 --- a/test/Tools/isac/Knowledge/rootrat.sml	Mon Apr 06 11:44:36 2020 +0200
    76.2 +++ b/test/Tools/isac/Knowledge/rootrat.sml	Wed Apr 08 12:32:51 2020 +0200
    76.3 @@ -15,11 +15,11 @@
    76.4  "----------- val rls = calculate_RootRat > calculate_Rational ----";
    76.5  "----------- val rls = calculate_RootRat > calculate_Rational ----";
    76.6  (*val calculate_RootRat = 
    76.7 -    append_rls "calculate_RootRat" calculate_Rational [...]
    76.8 +    Rule_Set.append_rules "calculate_RootRat" calculate_Rational [...]
    76.9    val calculate_Rational = prep_rls (merge_rls "calculate_Rational" [...]
   76.10  	    calculate_Poly
   76.11    val calculate_Poly =
   76.12 -    append_rls "calculate_PolyFIXXXME.not.impl." e_rls [];
   76.13 +    Rule_Set.append_rules "calculate_PolyFIXXXME.not.impl." Rule_Set.empty [];
   76.14      WN111014.TODO calculate_Poly < calculate_Rational < calculate_RootRat
   76.15  *)
   76.16  
   76.17 @@ -32,7 +32,7 @@
   76.18  "--- val rls = calculate_Poly ---";
   76.19  (*val rls = assoc_rls "calculate_Poly"; WAS ME_Isa: 'calculate_Poly' not in system
   76.20  goon with what just started ...*)
   76.21 -val calculate_Poly = append_rls "calculate_Poly" e_rls
   76.22 +val calculate_Poly = Rule_Set.append_rules "calculate_Poly" Rule_Set.empty
   76.23  	  [ Num_Calc ("Groups.plus_class.plus",eval_binop "#add_"),
   76.24  		    Num_Calc ("Groups.minus_class.minus",eval_binop "#sub_"),
   76.25  		    Num_Calc ("Groups.times_class.times",eval_binop "#mult_"),
    77.1 --- a/test/Tools/isac/MathEngBasic/tactic.sml	Mon Apr 06 11:44:36 2020 +0200
    77.2 +++ b/test/Tools/isac/MathEngBasic/tactic.sml	Wed Apr 08 12:32:51 2020 +0200
    77.3 @@ -19,7 +19,7 @@
    77.4  val (f, res) = (@{term "a * x / (b * x) :: real"}, (@{term "a / b :: real"}, [@{term "k \<noteq> (0 :: real)"}]: term list))
    77.5  ;
    77.6  Rewrite': theory' * Rule_Def.rew_ord' * Rule_Set.T * bool * thm'' * term * result -> Tactic.T;
    77.7 -val tac = Rewrite' ("Diff", "dummy_ord", e_rls, true, thm'', f, res)
    77.8 +val tac = Rewrite' ("Diff", "dummy_ord", Rule_Set.empty, true, thm'', f, res)
    77.9  ;
   77.10  if (Tactic.result tac |> term2str) = "a / b" then () else error "creates_assms CHANGED";
   77.11  if (Tactic.creates_assms tac |> terms2str) = "[\"k \<noteq> 0\"]" then () else error "creates_assms CHANGED";
    78.1 --- a/test/Tools/isac/MathEngine/mathengine-stateless.sml	Mon Apr 06 11:44:36 2020 +0200
    78.2 +++ b/test/Tools/isac/MathEngine/mathengine-stateless.sml	Wed Apr 08 12:32:51 2020 +0200
    78.3 @@ -347,7 +347,7 @@
    78.4  			| Res => (fst o (get_obj g_result pt)) p
    78.5  			| _ => e_term (*on PblObj is fo <> ifo*);
    78.6  	  val {nrls, ...} = get_met (get_obj g_metID pt (par_pblobj pt p))
    78.7 -	  val {rew_ord, erls, rules, ...} = rep_rls nrls;
    78.8 +	  val {rew_ord, erls, rules, ...} = Rule_Set.rep nrls;
    78.9  	  (*val (found, der) = *)concat_deriv rew_ord erls rules fo ifo; (*<---------------*)
   78.10  "~~~~~ fun concat_deriv, args:"; val (rew_ord, erls, rules, fo, ifo) =
   78.11    (rew_ord, erls, rules, fo, ifo);
    79.1 --- a/test/Tools/isac/MathEngine/step.sml	Mon Apr 06 11:44:36 2020 +0200
    79.2 +++ b/test/Tools/isac/MathEngine/step.sml	Wed Apr 08 12:32:51 2020 +0200
    79.3 @@ -51,41 +51,41 @@
    79.4  
    79.5  (* for this output:
    79.6  ========= ([], Pbl)========= Step.by_tactic: Model_Problem  ================================== 
    79.7 -Frm ..... (SOME (Pstate ([], [], e_rls, NONE, ??.empty, ORundef, false, false),
    79.8 +Frm ..... (SOME (Pstate ([], [], Rule_Set.empty, NONE, ??.empty, ORundef, false, false),
    79.9  ... ctxt:    []) , 
   79.10  Res .....  NONE) 
   79.11  --------- ([], Pbl)--------- Step.do_next \<rightarrow> Add_Given equality (x + 1 = 2)---------------------------------- 
   79.12  ========= ([], Met)========= Step.by_tactic: Apply_Method ["Test","squ-equ-test-subpbl1"] ================================== 
   79.13 -Frm ..... (SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [], e_rls, NONE, ??.empty, ORundef, false, true),
   79.14 +Frm ..... (SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [], Rule_Set.empty, NONE, ??.empty, ORundef, false, true),
   79.15  ... ctxt:    ["precond_rootmet x"]) , 
   79.16  Res .....  NONE) 
   79.17  --------- ([1], Frm)--------- Step.do_next \<rightarrow> Rewrite_Set "norm_equation"---------------------------------- 
   79.18 -Frm ..... (SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [], e_rls, NONE, ??.empty, ORundef, false, true),
   79.19 +Frm ..... (SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [], Rule_Set.empty, NONE, ??.empty, ORundef, false, true),
   79.20  ... ctxt:    ["precond_rootmet x"]) , 
   79.21 -Res .....  SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [R,L,R,L,L,R,R], e_rls, SOME e_e, x + 1 + -1 * 2 = 0, ORundef, true, false),
   79.22 +Res .....  SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [R,L,R,L,L,R,R], Rule_Set.empty, SOME e_e, x + 1 + -1 * 2 = 0, ORundef, true, false),
   79.23  ... ctxt:    ["precond_rootmet x"]) ) 
   79.24  ========= ([1], Frm)========= Step.by_tactic: Rewrite_Set "norm_equation" ================================== 
   79.25 -Frm ..... (SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [], e_rls, NONE, ??.empty, ORundef, false, true),
   79.26 +Frm ..... (SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [], Rule_Set.empty, NONE, ??.empty, ORundef, false, true),
   79.27  ... ctxt:    ["precond_rootmet x"]) , 
   79.28 -Res .....  SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [R,L,R,L,L,R,R], e_rls, SOME e_e, x + 1 + -1 * 2 = 0, ORundef, true, true),
   79.29 +Res .....  SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [R,L,R,L,L,R,R], Rule_Set.empty, SOME e_e, x + 1 + -1 * 2 = 0, ORundef, true, true),
   79.30  ... ctxt:    ["precond_rootmet x"]) ) 
   79.31  --------- ([1], Res)--------- Step.do_next \<rightarrow> Rewrite_Set "Test_simplify"---------------------------------- 
   79.32  Frm .....  (NONE, 
   79.33 -Res .....  SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [R,L,R,L,R,R], e_rls, SOME e_e, -1 + x = 0, ORundef, true, false),
   79.34 +Res .....  SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [R,L,R,L,R,R], Rule_Set.empty, SOME e_e, -1 + x = 0, ORundef, true, false),
   79.35  ... ctxt:    ["precond_rootmet x"]) ) 
   79.36  ========= ([1], Res)========= Step.by_tactic: Rewrite_Set "Test_simplify" ================================== 
   79.37  Frm .....  (NONE, 
   79.38 -Res .....  SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [R,L,R,L,R,R], e_rls, SOME e_e, -1 + x = 0, ORundef, true, false),
   79.39 +Res .....  SOME (Pstate ([(e_e, x + 1 = 2),(v_v, x)], [R,L,R,L,R,R], Rule_Set.empty, SOME e_e, -1 + x = 0, ORundef, true, false),
   79.40  ... ctxt:    ["precond_rootmet x"]) ) 
   79.41  --------- ([2], Res)--------- Step.do_next \<rightarrow> Subproblem (Test, ["LINEAR","univariate","equation","test"])---------------------------------- 
   79.42 -Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], e_rls, NONE, Subproblem
   79.43 +Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], Rule_Set.empty, NONE, Subproblem
   79.44   (''Test'',
   79.45    ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''
   79.46     ''test''), ORundef, true, false),
   79.47  ... ctxt:    ["precond_rootmet x"]) , 
   79.48  Res .....  NONE) 
   79.49  ========= ([2], Res)========= Step.by_tactic: Subproblem (Test, ["LINEAR","univariate","equation","test"]) ================================== 
   79.50 -Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], e_rls, NONE, Subproblem
   79.51 +Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], Rule_Set.empty, NONE, Subproblem
   79.52   (''Test'',
   79.53    ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''
   79.54     ''test''), ORundef, true, true),
   79.55 @@ -93,7 +93,7 @@
   79.56  Res .....  NONE) 
   79.57  --------- ([3], Pbl)--------- Step.do_next \<rightarrow> Model_Problem ---------------------------------- 
   79.58  ========= ([3], Pbl)========= Step.by_tactic: Model_Problem  ================================== 
   79.59 -Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], e_rls, NONE, Subproblem
   79.60 +Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], Rule_Set.empty, NONE, Subproblem
   79.61   (''Test'',
   79.62    ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''
   79.63     ''test''), ORundef, true, true),
   79.64 @@ -101,66 +101,66 @@
   79.65  Res .....  NONE) 
   79.66  --------- ([3], Pbl)--------- Step.do_next \<rightarrow> Add_Given equality (-1 + x = 0)---------------------------------- 
   79.67  ========= ([3], Met)========= Step.by_tactic: Apply_Method ["Test","solve_linear"] ================================== 
   79.68 -Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [], e_rls, NONE, ??.empty, ORundef, false, true),
   79.69 +Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [], Rule_Set.empty, NONE, ??.empty, ORundef, false, true),
   79.70  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)"]) , 
   79.71  Res .....  NONE) 
   79.72  --------- ([3,1], Frm)--------- Step.do_next \<rightarrow> Rewrite_Set_Inst ([(''bdv'', x)], "isolate_bdv")---------------------------------- 
   79.73 -Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [], e_rls, NONE, ??.empty, ORundef, false, true),
   79.74 +Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [], Rule_Set.empty, NONE, ??.empty, ORundef, false, true),
   79.75  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)"]) , 
   79.76 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,L,R,L,R,L,R], e_rls, SOME e_e, x = 0 + -1 * -1, ORundef, true, false),
   79.77 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,L,R,L,R,L,R], Rule_Set.empty, SOME e_e, x = 0 + -1 * -1, ORundef, true, false),
   79.78  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)"]) ) 
   79.79  ========= ([3,1], Frm)========= Step.by_tactic: Rewrite_Set_Inst ([(''bdv'', x)], "isolate_bdv") ================================== 
   79.80 -Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [], e_rls, NONE, ??.empty, ORundef, false, true),
   79.81 +Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [], Rule_Set.empty, NONE, ??.empty, ORundef, false, true),
   79.82  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)"]) , 
   79.83 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,L,R,L,R,L,R], e_rls, SOME e_e, x = 0 + -1 * -1, ORundef, true, true),
   79.84 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,L,R,L,R,L,R], Rule_Set.empty, SOME e_e, x = 0 + -1 * -1, ORundef, true, true),
   79.85  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)"]) ) 
   79.86  --------- ([3,1], Res)--------- Step.do_next \<rightarrow> Rewrite_Set "Test_simplify"---------------------------------- 
   79.87  Frm .....  (NONE, 
   79.88 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,L,R,L,R,R], e_rls, SOME e_e, x = 1, ORundef, true, false),
   79.89 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,L,R,L,R,R], Rule_Set.empty, SOME e_e, x = 1, ORundef, true, false),
   79.90  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)"]) ) 
   79.91  ========= ([3,1], Res)========= Step.by_tactic: Rewrite_Set "Test_simplify" ================================== 
   79.92  Frm .....  (NONE, 
   79.93 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,L,R,L,R,R], e_rls, SOME e_e, x = 1, ORundef, true, false),
   79.94 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,L,R,L,R,R], Rule_Set.empty, SOME e_e, x = 1, ORundef, true, false),
   79.95  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)"]) ) 
   79.96  --------- ([3,2], Res)--------- Step.do_next \<rightarrow> Check_Postcond ["LINEAR","univariate","equation","test"]---------------------------------- 
   79.97 -Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], e_rls, NONE, Subproblem
   79.98 +Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], Rule_Set.empty, NONE, Subproblem
   79.99   (''Test'',
  79.100    ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''
  79.101     ''test''), ORundef, true, true),
  79.102  ... ctxt:    []) , 
  79.103 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], e_rls, NONE, [x = 1], ORundef, true, true),
  79.104 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], Rule_Set.empty, NONE, [x = 1], ORundef, true, true),
  79.105  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)","x = 1"]) ) 
  79.106  ========= ([3,2], Res)========= Step.by_tactic: Check_Postcond ["LINEAR","univariate","equation","test"] ================================== 
  79.107 -Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], e_rls, NONE, Subproblem
  79.108 +Frm ..... (SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], Rule_Set.empty, NONE, Subproblem
  79.109   (''Test'',
  79.110    ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''
  79.111     ''test''), ORundef, true, true),
  79.112  ... ctxt:    []) , 
  79.113 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], e_rls, NONE, [x = 1], ORundef, true, true),
  79.114 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x)], [R,R,D,L,R], Rule_Set.empty, NONE, [x = 1], ORundef, true, true),
  79.115  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)","x = 1"]) ) 
  79.116  --------- ([3], Res)--------- Step.do_next \<rightarrow> Check_elementwise "Assumptions"---------------------------------- 
  79.117  Frm .....  (NONE, 
  79.118 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x),(L_L, [x = 1])], [R,R,D,R,D], e_rls, NONE, [x = 1], ORundef, true, false),
  79.119 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x),(L_L, [x = 1])], [R,R,D,R,D], Rule_Set.empty, NONE, [x = 1], ORundef, true, false),
  79.120  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)","x = 1"]) ) 
  79.121  ========= ([3], Res)========= Step.by_tactic: Check_elementwise "Assumptions" ================================== 
  79.122  Frm .....  (NONE, 
  79.123 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x),(L_L, [x = 1])], [R,R,D,R,D], e_rls, NONE, [x = 1], ORundef, true, true),
  79.124 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x),(L_L, [x = 1])], [R,R,D,R,D], Rule_Set.empty, NONE, [x = 1], ORundef, true, true),
  79.125  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)","x = 1"]) ) 
  79.126  --------- ([4], Res)--------- Step.do_next \<rightarrow> Check_Postcond ["sqroot-test","univariate","equation","test"]---------------------------------- 
  79.127 -Frm ..... (SOME (Pstate ([], [], e_rls, NONE, ??.empty, ORundef, false, false),
  79.128 +Frm ..... (SOME (Pstate ([], [], Rule_Set.empty, NONE, ??.empty, ORundef, false, false),
  79.129  ... ctxt:    []) , 
  79.130 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x),(L_L, [x = 1])], [R,R,D,R,D], e_rls, NONE, [x = 1], ORundef, true, true),
  79.131 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x),(L_L, [x = 1])], [R,R,D,R,D], Rule_Set.empty, NONE, [x = 1], ORundef, true, true),
  79.132  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)","x = 1"]) ) 
  79.133  ========= ([4], Res)========= Step.by_tactic: Check_Postcond ["sqroot-test","univariate","equation","test"] ================================== 
  79.134 -Frm ..... (SOME (Pstate ([], [], e_rls, NONE, ??.empty, ORundef, false, false),
  79.135 +Frm ..... (SOME (Pstate ([], [], Rule_Set.empty, NONE, ??.empty, ORundef, false, false),
  79.136  ... ctxt:    []) , 
  79.137 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x),(L_L, [x = 1])], [R,R,D,R,D], e_rls, NONE, [x = 1], ORundef, true, true),
  79.138 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x),(L_L, [x = 1])], [R,R,D,R,D], Rule_Set.empty, NONE, [x = 1], ORundef, true, true),
  79.139  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)","x = 1"]) ) 
  79.140  --------- ([], Res)--------- Step.do_next \<rightarrow> input End_Proof'---------------------------------- 
  79.141  ========= ([], Res)========= Step.by_tactic: input End_Proof' ================================== 
  79.142 -Frm ..... (SOME (Pstate ([], [], e_rls, NONE, ??.empty, ORundef, false, false),
  79.143 +Frm ..... (SOME (Pstate ([], [], Rule_Set.empty, NONE, ??.empty, ORundef, false, false),
  79.144  ... ctxt:    []) , 
  79.145 -Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x),(L_L, [x = 1])], [R,R,D,R,D], e_rls, NONE, [x = 1], ORundef, true, true),
  79.146 +Res .....  SOME (Pstate ([(e_e, -1 + x = 0),(v_v, x),(L_L, [x = 1])], [R,R,D,R,D], Rule_Set.empty, NONE, [x = 1], ORundef, true, true),
  79.147  ... ctxt:    ["matches (?a = ?b) (-1 + x = 0)","x = 1"]) ) 
  79.148  --------- ([], Res)--------- Step.do_next \<rightarrow> input End_Proof'---------------------------------- 
  79.149  *)
  79.150 \ No newline at end of file
    80.1 --- a/test/Tools/isac/Minisubpbl/200-start-method-NEXT_STEP.sml	Mon Apr 06 11:44:36 2020 +0200
    80.2 +++ b/test/Tools/isac/Minisubpbl/200-start-method-NEXT_STEP.sml	Wed Apr 08 12:32:51 2020 +0200
    80.3 @@ -48,7 +48,7 @@
    80.4  
    80.5  (*+* )------- in f3cac3053e7b (Rule_Set.empty just renamed, NOT deleted) we had
    80.6  (*+*)  prls =
    80.7 -(*+*)    Rule_Set.Repeat {calc = [], erls = Rule_Set.Empty, errpatts = [], id = "e_rls", preconds = [], rew_ord =
    80.8 +(*+*)    Rule_Set.Repeat {calc = [], erls = Rule_Set.Empty, errpatts = [], id = "empty", preconds = [], rew_ord =
    80.9  (*+*)      ("dummy_ord", fn), rules = [], scr = EmptyScr, srls = Rule_Set.Empty}:
   80.10  (*+*).. THIS IS Rule_Set.empty, BUT IT DID not CAUSE ANY ERROR !
   80.11  (*+*)------- WITH Rule_Set.empty REMOVED (based on f3cac3053e7b) we had
    81.1 --- a/test/Tools/isac/Minisubpbl/600-postcond-NEXT_STEP.sml	Mon Apr 06 11:44:36 2020 +0200
    81.2 +++ b/test/Tools/isac/Minisubpbl/600-postcond-NEXT_STEP.sml	Wed Apr 08 12:32:51 2020 +0200
    81.3 @@ -17,34 +17,34 @@
    81.4  (*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Specify_Method ["Test", "squ-equ-test-subpbl1"]*)
    81.5  
    81.6  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
    81.7 - = "([], [], e_rls, NONE, \n??.empty, ORundef, false, false)"
    81.8 + = "([], [], empty, NONE, \n??.empty, ORundef, false, false)"
    81.9  then () else error "pstate changed after ([], Met)";
   81.10  
   81.11  (*[1], Frm*)val (_, ([(tac''''', _, _)], _, (pt''''', p'''''))) =(**) Step.do_next p ((pt, e_pos'), []);(*Apply_Method ["Test", "squ-equ-test-subpbl1"]*)
   81.12  
   81.13  (*+*)if (get_istate_LI pt''''' p''''' |> the_pstate |> pstate2str)
   81.14 - = "([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [], e_rls, NONE, \n??.empty, ORundef, false, true)"
   81.15 + = "([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [], empty, NONE, \n??.empty, ORundef, false, true)"
   81.16  then () else error "pstate changed after ([1], Frm)"; (*this shall be corrected ...^^^^^^^^^: a tac has been found !!!*)
   81.17  
   81.18  (*[1], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p''''' ((pt''''', e_pos'), []);(*Rewrite_Set "norm_equation"*)
   81.19  
   81.20  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
   81.21 -(*= "([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [R,L,R,L,L,R,R], e_rls, SOMEe_e, \nx + 1 + -1 * 2 = 0, ORundef, false, false)"*)
   81.22 -  = "([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [R,L,R,L,L,R,R], e_rls, SOME e_e, \nx + 1 + -1 * 2 = 0, ORundef, true, false)"
   81.23 +(*= "([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [R,L,R,L,L,R,R], empty, SOMEe_e, \nx + 1 + -1 * 2 = 0, ORundef, false, false)"*)
   81.24 +  = "([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [R,L,R,L,L,R,R], empty, SOME e_e, \nx + 1 + -1 * 2 = 0, ORundef, true, false)"
   81.25  then () else error "pstate changed after ([1], Res)"; (*this shall be corrected .............................^^^^^^^^^*)
   81.26  
   81.27  (*[2], Res*)val (_, ([(tac, _, _)], _, (pt, p))) =(**) Step.do_next p ((pt, e_pos'), []);(*Rewrite_Set "Test_simplify"*)
   81.28  
   81.29  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
   81.30 -(*= "([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [R,L,R,L,R,R], e_rls, SOMEe_e, \n-1 + x = 0, ORundef, false, false)"*)
   81.31 -  = "([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [R,L,R,L,R,R], e_rls, SOME e_e, \n-1 + x = 0, ORundef, true, false)"
   81.32 +(*= "([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [R,L,R,L,R,R], empty, SOMEe_e, \n-1 + x = 0, ORundef, false, false)"*)
   81.33 +  = "([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [R,L,R,L,R,R], empty, SOME e_e, \n-1 + x = 0, ORundef, true, false)"
   81.34  then () else error "pstate changed after ([2], Res)"; (*this shall be corrected ...................^^^^^^^^^*)
   81.35  
   81.36  (*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Subproblem ("Test", ["LINEAR", "univariate", "equation", "test"])*)
   81.37  
   81.38  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
   81.39 -(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,R,D,L,R], e_rls, NONE, \nSubproblem\n (''Test'',\n  ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''\n   ''test''), ORundef, false, false)"*)
   81.40 -  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,R,D,L,R], e_rls, NONE, \nSubproblem\n (''Test'',\n  ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''\n   ''test''), ORundef, true, false)"
   81.41 +(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,R,D,L,R], empty, NONE, \nSubproblem\n (''Test'',\n  ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''\n   ''test''), ORundef, false, false)"*)
   81.42 +  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,R,D,L,R], empty, NONE, \nSubproblem\n (''Test'',\n  ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''\n   ''test''), ORundef, true, false)"
   81.43  then () else error "pstate changed after ([3], Pbl)";
   81.44  
   81.45  (*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Model_Problem*)
   81.46 @@ -53,48 +53,48 @@
   81.47  (*[3], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Specify_Method ["Test", "solve_linear"]*)
   81.48  
   81.49  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
   81.50 -(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,R,D,L,R], e_rls, NONE, \nSubproblem\n (''Test'',\n  ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''\n   ''test''), ORundef, false, false)"*)
   81.51 -  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,R,D,L,R], e_rls, NONE, \nSubproblem\n (''Test'',\n  ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''\n   ''test''), ORundef, true, false)"
   81.52 +(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,R,D,L,R], empty, NONE, \nSubproblem\n (''Test'',\n  ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''\n   ''test''), ORundef, false, false)"*)
   81.53 +  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,R,D,L,R], empty, NONE, \nSubproblem\n (''Test'',\n  ??.\<^const>String.char.Char ''LINEAR'' ''univariate'' ''equation''\n   ''test''), ORundef, true, false)"
   81.54  then () else error "pstate changed after ([3], Pbl)";
   81.55  
   81.56  (*[3, 1], Frm*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Apply_Method ["Test", "solve_linear"]*)
   81.57  
   81.58  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
   81.59 - = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [], e_rls, NONE, \n??.empty, ORundef, false, true)"
   81.60 + = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [], empty, NONE, \n??.empty, ORundef, false, true)"
   81.61  then () else error "pstate changed after ([3, 1], Frm)";
   81.62  
   81.63  (*[3, 1], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Rewrite_Set_Inst (["(''bdv'', x)"], "isolate_bdv")*)
   81.64  
   81.65  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
   81.66 -(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], e_rls, SOMEe_e, \nx = 0 + -1 * -1, ORundef, false, false)"*)
   81.67 -  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], e_rls, SOME e_e, \nx = 0 + -1 * -1, ORundef, true, false)"
   81.68 +(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], empty, SOMEe_e, \nx = 0 + -1 * -1, ORundef, false, false)"*)
   81.69 +  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,L,R], empty, SOME e_e, \nx = 0 + -1 * -1, ORundef, true, false)"
   81.70  then () else error "pstate changed after ([3, 1], Res)";
   81.71  
   81.72  (*[3, 2], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Rewrite_Set "Test_simplify"*)
   81.73  
   81.74  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
   81.75 -(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,R], e_rls, SOMEe_e, \nx = 1, ORundef, false, false)"*)
   81.76 -  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,R], e_rls, SOME e_e, \nx = 1, ORundef, true, false)"
   81.77 +(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,R], empty, SOMEe_e, \nx = 1, ORundef, false, false)"*)
   81.78 +  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,L,R,L,R,R], empty, SOME e_e, \nx = 1, ORundef, true, false)"
   81.79  then () else error "pstate changed after ([3, 2], Res)"; (*this shall be corrected ............^^^^^^^^^*)
   81.80  
   81.81  (*[3], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Check_Postcond ["LINEAR", "univariate", "equation", "test"]*)
   81.82  
   81.83  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
   81.84 - = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,R,D,L,R], e_rls, NONE, \n[x = 1], ORundef, true, false)"
   81.85 + = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\"], [R,R,D,L,R], empty, NONE, \n[x = 1], ORundef, true, false)"
   81.86  then () else error "pstate changed after ([3], Res)";
   81.87  
   81.88  (*[4], Res*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []);(*Check_elementwise "Assumptions"*)
   81.89  
   81.90  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
   81.91 -(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D,R,D], e_rls, NONE, \n[x = 1], ORundef, false, false)"*)
   81.92 -  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D,R,D], e_rls, NONE, \n[x = 1], ORundef, true, false)"
   81.93 +(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D,R,D], empty, NONE, \n[x = 1], ORundef, false, false)"*)
   81.94 +  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D,R,D], empty, NONE, \n[x = 1], ORundef, true, false)"
   81.95  then () else error "pstate changed after ([4], Res)"; (*this shall be corrected ..................................^^^^^^^^^*)
   81.96  
   81.97  (*[], Res* )val ("ok", ([(tac, _, _)], _, (pt, p))) =( **) Step.do_next p ((pt, e_pos'), []);(*Check_Postcond ["sqroot-test", "univariate", "equation", "test"]*)
   81.98  
   81.99  (*+*)if (get_istate_LI pt p |> the_pstate |> pstate2str)
  81.100 -(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D,R,D], e_rls, NONE, \n[x = 1], ORundef, false, false)"*)
  81.101 -  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D,R,D], e_rls, NONE, \n[x = 1], ORundef, true, false)"
  81.102 +(*= "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D,R,D], empty, NONE, \n[x = 1], ORundef, false, false)"*)
  81.103 +  = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D,R,D], empty, NONE, \n[x = 1], ORundef, true, false)"
  81.104  then () else error "pstate changed after ([], Res)"; (*this shall be corrected ...................................^^^^^^^^^*)
  81.105  
  81.106  "~~~~~ fun do_next , args:"; val ((ip as (_, p_)), (ptp as (pt, p), tacis)) = (p, ((pt, e_pos'), []));
  81.107 @@ -111,7 +111,7 @@
  81.108  	      val ((ist, ctxt), sc) = LItool.resume_prog thy' (p,p_) pt;
  81.109  
  81.110  (*+*)Istate.string_of ist
  81.111 - = "Pstate ([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D,R,D], e_rls, NONE, \n[x = 1],"
  81.112 + = "Pstate ([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D,R,D], empty, NONE, \n[x = 1],"
  81.113    ^ " ORundef, true, false)"; (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~true ok*)
  81.114  
  81.115    (*case*) LI.find_next_step sc (pt, pos) ist ctxt (*of*);
  81.116 @@ -145,6 +145,6 @@
  81.117  
  81.118  (*/--------------------- final test ---------------------------------------------------------\\*)
  81.119  if pstate2str ist
  81.120 - = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D], e_rls, NONE, \n[x = 1],"^
  81.121 + = "([\"\n(e_e, -1 + x = 0)\",\"\n(v_v, x)\",\"\n(L_L, [x = 1])\"], [R,R,D], empty, NONE, \n[x = 1],"^
  81.122    " ORundef, true, false)"
  81.123  then () else error "";
    82.1 --- a/test/Tools/isac/Minisubpbl/800-append-on-Frm.sml	Mon Apr 06 11:44:36 2020 +0200
    82.2 +++ b/test/Tools/isac/Minisubpbl/800-append-on-Frm.sml	Wed Apr 08 12:32:51 2020 +0200
    82.3 @@ -101,7 +101,7 @@
    82.4    (ctxt_res |> get_assumptions |> terms2str) = "[\"precond_rootmet x\"]"
    82.5    andalso
    82.6    Istate.string_of ist_res =
    82.7 -    "Pstate ([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [], e_rls, NONE, \n2 + -1 + x = 2, ORundef, false, true)"
    82.8 +    "Pstate ([\"\n(e_e, x + 1 = 2)\",\"\n(v_v, x)\"], [], empty, NONE, \n2 + -1 + x = 2, ORundef, false, true)"
    82.9  then () else error "/800-append-on-Frm.sml CHANGED";
   82.10  
   82.11  show_pt_tac (fst ptp''''');(*[
    83.1 --- a/test/Tools/isac/OLDTESTS/root-equ.sml	Mon Apr 06 11:44:36 2020 +0200
    83.2 +++ b/test/Tools/isac/OLDTESTS/root-equ.sml	Wed Apr 08 12:32:51 2020 +0200
    83.3 @@ -561,7 +561,7 @@
    83.4        val is = get_istate_LI pt (p,p_);
    83.5        val thy' = get_obj g_domID pt pp;
    83.6        val thy = assoc_thy thy';
    83.7 -      val d = e_rls;
    83.8 +      val d = Rule_Set.empty;
    83.9      val Steps [(m',f',pt',p',c',s')] = 
   83.10  	     locate_input_tactic thy' m  (pt,(p,p_)) (sc,d) is;
   83.11           val is' = get_istate_LI pt' p';
    84.1 --- a/test/Tools/isac/OLDTESTS/script.sml	Mon Apr 06 11:44:36 2020 +0200
    84.2 +++ b/test/Tools/isac/OLDTESTS/script.sml	Wed Apr 08 12:32:51 2020 +0200
    84.3 @@ -242,7 +242,7 @@
    84.4  ---------------------------------me raises exception with not-locatable*)
    84.5  
    84.6  
    84.7 -val d = e_rls;
    84.8 +val d = Rule_Set.empty;
    84.9  
   84.10  "  --- test100:  nxt_tac order------------------------------------ ";
   84.11  "  --- test100:  nxt_tac order------------------------------------ ";
    85.1 --- a/test/Tools/isac/OLDTESTS/script_if.sml	Mon Apr 06 11:44:36 2020 +0200
    85.2 +++ b/test/Tools/isac/OLDTESTS/script_if.sml	Wed Apr 08 12:32:51 2020 +0200
    85.3 @@ -61,7 +61,7 @@
    85.4          [("#Given" ,["equality e_e","solveFor v_v"]),
    85.5            ("#Where" ,["is_rootequation_in (e_e::bool) (v_::real)"]),
    85.6            ("#Find"  ,["solutions v_i_"])],
    85.7 -        append_rls e_rls [Num_Calc ("Test.is'_rootequation'_in", eval_is_rootequation_in "")],
    85.8 +        Rule_Set.append_rules Rule_Set.empty [Num_Calc ("Test.is'_rootequation'_in", eval_is_rootequation_in "")],
    85.9          [("Test","methode")])]
   85.10    thy;
   85.11  
   85.12 @@ -73,7 +73,7 @@
   85.13          [("#Given", ["equality e_e","solveFor v_v","errorBound err_"]),
   85.14            ("#Where", ["matches (?a = ?b) e_e"]),
   85.15            ("#Find", ["solutions v_i_"])],
   85.16 -        append_rls e_rls [Num_Calc ("Prog_Expr.matches",eval_matches "#matches_")], [])]
   85.17 +        Rule_Set.append_rules Rule_Set.empty [Num_Calc ("Prog_Expr.matches",eval_matches "#matches_")], [])]
   85.18    thy;
   85.19  
   85.20  methods:= overwritel (!methods,
   85.21 @@ -83,7 +83,7 @@
   85.22     [("#Given" ,["equality e_e","solveFor v_v","errorBound err_"]),
   85.23      ("#Find"  ,["solutions v_i_"])
   85.24      ],
   85.25 -   {rew_ord'="tless_true",rls'="tval_rls",erls=e_rls,prls=e_rls,calc=[],
   85.26 +   {rew_ord'="tless_true",rls'="tval_rls",erls=Rule_Set.empty,prls=Rule_Set.empty,calc=[],
   85.27      asm_rls=[],asm_thm=[]},
   85.28   "Program Solve_univar_err (e_e::bool) (v_::real) (err_::bool) =  \
   85.29   \ (if (is_rootequation_in e_e v_v)\
    86.1 --- a/test/Tools/isac/OLDTESTS/scriptnew.sml	Mon Apr 06 11:44:36 2020 +0200
    86.2 +++ b/test/Tools/isac/OLDTESTS/scriptnew.sml	Wed Apr 08 12:32:51 2020 +0200
    86.3 @@ -21,12 +21,12 @@
    86.4  "  --- test 30.4.02 Testterm:  Repeat Repeat Or ------------------ ";
    86.5  KEStore_Elems.add_pbts
    86.6    [prep_pbt Test.thy "pbl_testss" [] e_pblID
    86.7 -      (["tests"], []:(string * string list) list, e_rls, NONE, []),
    86.8 +      (["tests"], []:(string * string list) list, Rule_Set.empty, NONE, []),
    86.9      prep_pbt Test.thy "pbl_testss_term" [] e_pblID
   86.10        (["met_testterm","tests"],
   86.11          [("#Given" ,["realTestGiven g_"]),
   86.12            ("#Find"  ,["realTestFind f_"])],
   86.13 -        e_rls, NONE, [])]
   86.14 +        Rule_Set.empty, NONE, [])]
   86.15    thy;
   86.16  
   86.17  store_met
   86.18 @@ -36,8 +36,8 @@
   86.19    [("#Given" ,["realTestGiven g_"]),
   86.20     ("#Find"  ,["realTestFind f_"])
   86.21     ],
   86.22 -   {rew_ord'="tless_true",rls'=tval_rls,srls=e_rls,prls=e_rls,calc=[],
   86.23 -    crls=tval_rls, errpats = [], nrls=e_rls(*,
   86.24 +   {rew_ord'="tless_true",rls'=tval_rls,srls=Rule_Set.empty,prls=Rule_Set.empty,calc=[],
   86.25 +    crls=tval_rls, errpats = [], nrls=Rule_Set.empty(*,
   86.26      asm_rls=[],asm_thm=[]*)},
   86.27   "Program Testterm (g_::real) =   \
   86.28   \Repeat\
   86.29 @@ -94,7 +94,7 @@
   86.30        (["met_testeq","tests"],
   86.31          [("#Given" ,["boolTestGiven e_e"]),
   86.32            ("#Find"  ,["boolTestFind v_i_"])],
   86.33 -        e_rls, NONE, [])]
   86.34 +        Rule_Set.empty, NONE, [])]
   86.35    thy;
   86.36  
   86.37  store_met
   86.38 @@ -105,9 +105,9 @@
   86.39     ("#Find"  ,["boolTestFind v_i_"]) 
   86.40     ],
   86.41     {rew_ord'="tless_true",rls'=tval_rls,
   86.42 -    srls=append_rls "testeq1_srls" e_rls 
   86.43 +    srls=Rule_Set.append_rules "testeq1_srls" Rule_Set.empty 
   86.44  		    [Num_Calc ("Test.contains'_root", eval_contains_root"")],
   86.45 -    prls=e_rls,calc=[], crls=tval_rls, errpats = [], nrls=e_rls
   86.46 +    prls=Rule_Set.empty,calc=[], crls=tval_rls, errpats = [], nrls=Rule_Set.empty
   86.47  		  (*,asm_rls=[],asm_thm=[("square_equation_left","")]*)},
   86.48   "Program Testeq (e_e::bool) =                                        \
   86.49     \(While (contains_root e_e) Do                                     \
   86.50 @@ -163,9 +163,9 @@
   86.51     ("#Find"  ,["boolTestFind v_i_"]) 
   86.52     ],
   86.53     {rew_ord'="tless_true",rls'=tval_rls,
   86.54 -    srls=append_rls "testlet_srls" e_rls 
   86.55 +    srls=Rule_Set.append_rules "testlet_srls" Rule_Set.empty 
   86.56  		    [Num_Calc ("Test.contains'_root",eval_contains_root"")],
   86.57 -    prls=e_rls,calc=[], crls=tval_rls, errpats = [], nrls=e_rls
   86.58 +    prls=Rule_Set.empty,calc=[], crls=tval_rls, errpats = [], nrls=Rule_Set.empty
   86.59  		  (*,asm_rls=[],asm_thm=[("square_equation_left","")]*)},
   86.60     "Program Testeq2 (e_e::bool) =                                        \
   86.61     \(let e_e =\
    87.1 --- a/test/Tools/isac/ProgLang/auto_prog.sml	Mon Apr 06 11:44:36 2020 +0200
    87.2 +++ b/test/Tools/isac/ProgLang/auto_prog.sml	Wed Apr 08 12:32:51 2020 +0200
    87.3 @@ -206,7 +206,7 @@
    87.4  "-------- fun op #> ----------------------------------------------------------------------------";
    87.5  "-------- fun op #> ----------------------------------------------------------------------------";
    87.6  "-------- fun op #> ----------------------------------------------------------------------------";
    87.7 - val rules = (#rules o rep_rls) isolate_root;
    87.8 + val rules = (#rules o Rule_Set.rep) isolate_root;
    87.9   val rs = map (rule2stac @{theory}) rules;
   87.10   val t = #> rs;
   87.11  if term2str t = "Try (Repeat (Rewrite ''rroot_to_lhs'')) #>\n" ^ 
    88.1 --- a/test/Tools/isac/ProgLang/calculate.sml	Mon Apr 06 11:44:36 2020 +0200
    88.2 +++ b/test/Tools/isac/ProgLang/calculate.sml	Wed Apr 08 12:32:51 2020 +0200
    88.3 @@ -52,22 +52,22 @@
    88.4  
    88.5  "~~~~~ fun calculate_, args:"; val (thy, isa_fn, t) = (thy, plus, t);
    88.6  val SOME ("#: 1 + 2 = 3", adh_thm) = adhoc_thm @{theory} isa_fn t;
    88.7 -val SOME (t', []) = rewrite__ thy 0 [] e_rew_ord e_rls true adh_thm t;
    88.8 +val SOME (t', []) = rewrite__ thy 0 [] e_rew_ord Rule_Set.empty true adh_thm t;
    88.9  if term2str t' = "(3 * 4 / 3) ^^^ 2" then () else error "calculate_  1 + 2 = 3  changed";
   88.10  
   88.11  "~~~~~ fun calculate_, args:"; val (thy, isa_fn, t) = (thy, times, t');
   88.12  val SOME ("#: 3 * 4 = 12", adh_thm) = adhoc_thm @{theory} isa_fn t';
   88.13 -val SOME (t'', []) = rewrite__ thy 0 [] e_rew_ord e_rls true adh_thm t;
   88.14 +val SOME (t'', []) = rewrite__ thy 0 [] e_rew_ord Rule_Set.empty true adh_thm t;
   88.15  if term2str t'' = "(12 / 3) ^^^ 2" then () else error "calculate_  3 * 4 = 12  changed";
   88.16  
   88.17  "~~~~~ fun calculate_, args:"; val (thy, isa_fn, t) = (thy, divide, t'');
   88.18  val SOME ("#divide_e12_3", adh_thm) = adhoc_thm @{theory} isa_fn t;
   88.19 -val SOME (t''', []) = rewrite__ thy 0 [] e_rew_ord e_rls true adh_thm t;
   88.20 +val SOME (t''', []) = rewrite__ thy 0 [] e_rew_ord Rule_Set.empty true adh_thm t;
   88.21  if term2str t''' = "4 ^^^ 2" then () else error "calculate_  12 / 3 = 4  changed";
   88.22  
   88.23  "~~~~~ fun calculate_, args:"; val (thy, isa_fn, t) = (thy, pow, t''');
   88.24  val SOME ("#: 4 ^^^ 2 = 16", adh_thm) = adhoc_thm @{theory} isa_fn t;
   88.25 -val SOME (t'''', []) = rewrite__ thy 0 [] e_rew_ord e_rls true adh_thm t;
   88.26 +val SOME (t'''', []) = rewrite__ thy 0 [] e_rew_ord Rule_Set.empty true adh_thm t;
   88.27  if term2str t'''' = "16" then () else error "calculate_  12 / 3 = 4  changed";
   88.28  
   88.29  "----------- calculate from Prog --------------------------------- -----------------------------";
    89.1 --- a/test/Tools/isac/ProgLang/calculate.thy	Mon Apr 06 11:44:36 2020 +0200
    89.2 +++ b/test/Tools/isac/ProgLang/calculate.thy	Wed Apr 08 12:32:51 2020 +0200
    89.3 @@ -18,12 +18,12 @@
    89.4  \<close>
    89.5  
    89.6  setup \<open>KEStore_Elems.add_pbts
    89.7 -  [Specify.prep_pbt @{theory "Test"} "pbl_ttest" [] Celem.e_pblID (["test"], [], Rule_Set.e_rls, NONE, []),
    89.8 +  [Specify.prep_pbt @{theory "Test"} "pbl_ttest" [] Celem.e_pblID (["test"], [], Rule_Set.empty, NONE, []),
    89.9      Specify.prep_pbt @{theory "Test"} "pbl_ttest_calc" [] Celem.e_pblID
   89.10        (["calculate", "test"],
   89.11          [("#Given", ["realTestGiven t_t"]),
   89.12           ("#Find", ["realTestFind s_s"])],
   89.13 -        Rule_Set.e_rls, NONE, [["Test", "test_calculate"]])]\<close>
   89.14 +        Rule_Set.empty, NONE, [["Test", "test_calculate"]])]\<close>
   89.15  
   89.16  partial_function (tailrec) calc_test :: "real \<Rightarrow> real"
   89.17    where
   89.18 @@ -37,12 +37,12 @@
   89.19    [Specify.prep_met (@{theory "Test"}) "met_testcal" [] Celem.e_metID
   89.20        (["Test","test_calculate"],
   89.21          [("#Given" , ["realTestGiven t_t"]), ("#Find", ["realTestFind s_s"])],
   89.22 -        {rew_ord'="sqrt_right",rls'=tval_rls,srls = Rule_Set.e_rls, prls = Rule_Set.e_rls,
   89.23 +        {rew_ord'="sqrt_right",rls'=tval_rls,srls = Rule_Set.empty, prls = Rule_Set.empty,
   89.24            calc=[("PLUS", ("op +", eval_binop "#add_")),
   89.25                ("TIMES", ("Groups.times_class.times", eval_binop "#mult_")),
   89.26                ("DIVIDE", ("HOL.divide", Prog_Expr.eval_cancel "#divide_")),
   89.27                ("POWER", ("Prog_Expr.pow", eval_binop "#power_"))],
   89.28 -          crls=tval_rls, errpats = [], nrls= Rule_Set.e_rls (*, asm_rls=[],asm_thm=[]*)},
   89.29 +          crls=tval_rls, errpats = [], nrls= Rule_Set.empty (*, asm_rls=[],asm_thm=[]*)},
   89.30          @{thm calc_test.simps})]
   89.31  \<close>
   89.32  
    90.1 --- a/test/Tools/isac/ProgLang/prog_expr.sml	Mon Apr 06 11:44:36 2020 +0200
    90.2 +++ b/test/Tools/isac/ProgLang/prog_expr.sml	Wed Apr 08 12:32:51 2020 +0200
    90.3 @@ -231,7 +231,7 @@
    90.4  else error "atools.sml diff.behav. in eval_boollist2sum";
    90.5  
    90.6  trace_rewrite := false;
    90.7 -val srls_ = append_rls "srls_..Berechnung-erstSymbolisch" e_rls 
    90.8 +val srls_ = Rule_Set.append_rules "srls_..Berechnung-erstSymbolisch" Rule_Set.empty 
    90.9  		      [Num_Calc ("Prog_Expr.boollist2sum", eval_boollist2sum "")];
   90.10  val t = str2t 
   90.11         "boollist2sum [b1 = k - 2*q, b2 = k - 2*q, b3 = k - 2*q, b4 = k - 2*q]";
    91.1 --- a/test/Tools/isac/ProgLang/rewrite.sml	Mon Apr 06 11:44:36 2020 +0200
    91.2 +++ b/test/Tools/isac/ProgLang/rewrite.sml	Wed Apr 08 12:32:51 2020 +0200
    91.3 @@ -88,7 +88,7 @@
    91.4  val thm =  @{thm add.commute};
    91.5  val tm = @{term "x + y*z::real"};
    91.6  
    91.7 -val SOME (r,_) = (rewrite_ thy dummy_ord e_rls false thm tm)
    91.8 +val SOME (r,_) = (rewrite_ thy dummy_ord Rule_Set.empty false thm tm)
    91.9    handle _ => error "rewrite.sml diff.behav. in rewriting";
   91.10  (*is displayed on _TOP_ of <response> buffer...*)
   91.11  Pretty.writeln (Proof_Context.pretty_term_abbrev @{context} r);
   91.12 @@ -98,7 +98,7 @@
   91.13  "----- rewriting a subterm";
   91.14  val tm = @{term "w*(x + y*z)::real"};
   91.15  
   91.16 -val SOME (r,_) = (rewrite_ thy dummy_ord e_rls false thm tm)
   91.17 +val SOME (r,_) = (rewrite_ thy dummy_ord Rule_Set.empty false thm tm)
   91.18    handle _ => error "rewrite.sml diff.behav. in rew_sub";
   91.19  
   91.20  "----- ordered rewriting";
   91.21 @@ -106,13 +106,13 @@
   91.22  if tord [] (@{term "x + y*z::real"}, @{term "y*z + x::real"}) then ()
   91.23  else error "rewrite.sml diff.behav. in ord.rewr.";
   91.24  
   91.25 -val NONE = (rewrite_ thy tord e_rls false thm tm)
   91.26 +val NONE = (rewrite_ thy tord Rule_Set.empty false thm tm)
   91.27    handle _ => error "rewrite.sml diff.behav. in rewriting";
   91.28  (*is displayed on _TOP_ of <response> buffer...*)
   91.29  Pretty.writeln (Proof_Context.pretty_term_abbrev @{context} r);
   91.30  
   91.31  val tm = @{term "x*y + z::real"};
   91.32 -val SOME (r,_) = (rewrite_ thy tord e_rls false thm tm)
   91.33 +val SOME (r,_) = (rewrite_ thy tord Rule_Set.empty false thm tm)
   91.34    handle _ => error "rewrite.sml diff.behav. in rewriting";
   91.35  
   91.36  
   91.37 @@ -146,7 +146,7 @@
   91.38  "----- conditional rewriting creating an assumption";
   91.39  val thm =  @{thm nonzero_divide_mult_cancel_right};
   91.40  val tm = @{term "x / (2 * x)::real"};
   91.41 -val SOME (rew, asm) = (rewrite_ thy dummy_ord e_rls false thm tm)
   91.42 +val SOME (rew, asm) = (rewrite_ thy dummy_ord Rule_Set.empty false thm tm)
   91.43    handle _ => error "rewrite.sml diff.behav. in cond.rew.";
   91.44  
   91.45  if rew = @{term "1 / 2::real"} then () (* the rewrite is _NO_ Trueprop *)
   91.46 @@ -163,11 +163,11 @@
   91.47  "----------- step through 'and rew_sub': ----------------";
   91.48  (*and make asms without Trueprop, beginning with the result:*)
   91.49  val tm = @{term "x / (2 * x)::real"};
   91.50 -val (t', asm, _, _) = rew_sub thy 0 [] dummy_ord e_rls true [] (Thm.prop_of thm) tm;
   91.51 +val (t', asm, _, _) = rew_sub thy 0 [] dummy_ord Rule_Set.empty true [] (Thm.prop_of thm) tm;
   91.52  (*show_types := false;*)
   91.53  "----- evaluate arguments";
   91.54  val (thy, i, bdv, tless, rls, put_asm, lrd, r, t) = 
   91.55 -    (thy, 0, [], dummy_ord, e_rls, true, [], (Thm.prop_of thm), tm);
   91.56 +    (thy, 0, [], dummy_ord, Rule_Set.empty, true, [], (Thm.prop_of thm), tm);
   91.57  "----- step 1: LHS, RHS of rule";
   91.58       val (LHS, RHS) = (HOLogic.dest_eq o HOLogic.dest_Trueprop
   91.59                         o Logic.strip_imp_concl) r;
   91.60 @@ -239,7 +239,7 @@
   91.61  (*------------ outcommented WN071210, after inclusion into ROOT.ML 
   91.62  val SOME (t,_) = 
   91.63      rewrite_inst_ thy e_rew_ord 
   91.64 -		  (append_rls "erls_isolate_bdvs" e_rls 
   91.65 +		  (Rule_Set.append_rules "erls_isolate_bdvs" Rule_Set.empty 
   91.66  			      [(Num_Calc ("EqSystem.occur'_exactly'_in", 
   91.67  				      eval_occur_exactly_in 
   91.68  					  "#eval_occur_exactly_in_"))
   91.69 @@ -269,7 +269,7 @@
   91.70  ####  eval asms: L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2 is_polyexp
   91.71  ==> 1 / EI * (L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2) =
   91.72      1 * (L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2) / EI
   91.73 -#####  rls: e_rls-is_polyexp on: L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2
   91.74 +#####  rls: Rule_Set.empty-is_polyexp on: L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2
   91.75  is_polyexp
   91.76  ######  try calc: Poly.is'_polyexp'
   91.77  ======  calc. to: False
   91.78 @@ -288,7 +288,7 @@
   91.79  ####  eval asms: L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2 is_polyexp
   91.80  ==> 1 / EI * (L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2) =
   91.81      1 * (L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2) / EI
   91.82 -#####  rls: e_rls-is_polyexp on: L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2 is_polyexp
   91.83 +#####  rls: Rule_Set.empty-is_polyexp on: L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2 is_polyexp
   91.84  ######  try calc: Poly.is'_polyexp'
   91.85  ======  calc. to: False
   91.86  ######  try calc: Poly.is'_polyexp'
   91.87 @@ -311,7 +311,7 @@
   91.88  "----- rewrite_ rat_mult_poly_r--------------------------";
   91.89  val thm = @{thm rat_mult_poly_r};
   91.90           "?c::real is_polyexp ==> (?a::real) / (?b::real) * ?c = ?a * ?c / ?b";
   91.91 -val erls = append_rls "e_rls-is_polyexp" e_rls 
   91.92 +val erls = Rule_Set.append_rules "Rule_Set.empty-is_polyexp" Rule_Set.empty 
   91.93                        [Num_Calc ("Poly.is'_polyexp", eval_is_polyexp "")];
   91.94  val NONE (*SOME (t'', _)*) = rewrite_ thy dummy_ord erls true thm t;
   91.95  (*t' = t''; (*false because of further rewrites in t'*)*)
   91.96 @@ -396,7 +396,7 @@
   91.97  val pat = parse_patt thy "?p :: real"
   91.98  val pres = [parse_patt thy "?p is_multUnordered"];
   91.99  val prepat = [(pres, pat)];
  91.100 -val erls = append_rls "e_rls-is_multUnordered" e_rls
  91.101 +val erls = Rule_Set.append_rules "Rule_Set.empty-is_multUnordered" Rule_Set.empty
  91.102  		      [Num_Calc ("Poly.is'_multUnordered", 
  91.103                               eval_is_multUnordered "")];
  91.104  
  91.105 @@ -537,8 +537,8 @@
  91.106            case rul of
  91.107              Rule.Thm (thmid, thm) =>
  91.108                (trace1 i (" try thm: " ^ thmid);
  91.109 -              case rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule.rep_rls) rls)
  91.110 -                  ((#erls o Rule.rep_rls) rls) put_asm thm ct of
  91.111 +              case rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule.Rule_Set.rep) rls)
  91.112 +                  ((#erls o Rule.Rule_Set.rep) rls) put_asm thm ct of
  91.113                  NONE => rew_once ruls asm ct apno thms
  91.114                | SOME (ct', asm') => 
  91.115                  (trace1 i (" rewrites to: " ^ Rule.t2str thy ct');
  91.116 @@ -551,8 +551,8 @@
  91.117                  NONE => rew_once ruls asm ct apno thms
  91.118                | SOME (_, thm') => 
  91.119                  let 
  91.120 -                  val pairopt = rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule.rep_rls) rls)
  91.121 -                    ((#erls o Rule.rep_rls) rls) put_asm thm' ct;
  91.122 +                  val pairopt = rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule.Rule_Set.rep) rls)
  91.123 +                    ((#erls o Rule.Rule_Set.rep) rls) put_asm thm' ct;
  91.124                    val _ = if pairopt <> NONE then () else error ("rewrite_set_, rewrite_ \"" ^ 
  91.125                      Rule.string_of_thmI thm' ^ "\" " ^ Rule.t2str thy ct ^ " = NONE")
  91.126                    val _ = trace1 i (" calc. to: " ^ Rule.t2str thy ((fst o the) pairopt))
  91.127 @@ -565,8 +565,8 @@
  91.128                  NONE => (ct, asm)
  91.129                | SOME (_, thm') =>
  91.130                  let 
  91.131 -                  val pairopt = rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule.rep_rls) rls)
  91.132 -                    ((#erls o Rule.rep_rls) rls) put_asm thm' ct;
  91.133 +                  val pairopt = rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule.Rule_Set.rep) rls)
  91.134 +                    ((#erls o Rule.Rule_Set.rep) rls) put_asm thm' ct;
  91.135                    val _ = if pairopt <> NONE then () else error ("rewrite_set_, rewrite_ \"" ^
  91.136                       Rule.string_of_thmI thm' ^ "\" " ^ Rule.t2str thy ct ^ " = NONE")
  91.137                    val _ = trace1 i (" cal1. to: " ^ Rule.t2str thy ((fst o the) pairopt))
  91.138 @@ -577,7 +577,7 @@
  91.139                SOME (t', asm') => rew_once ruls (union (op =) asm asm') t' Appl thms
  91.140              | NONE => rew_once ruls asm ct apno thms)
  91.141            | r => raise ERROR ("rew_once not appl. to \"" ^ Rule.rule2str r ^ "\"");
  91.142 -      val ruls = (#rules o Rule.rep_rls) rls;
  91.143 +      val ruls = (#rules o Rule.Rule_Set.rep) rls;
  91.144  (*    val _ = trace i (" rls: " ^ Rule_Set.id_rls rls ^ " on: " ^ Rule.t2str thy ct)*)
  91.145        val (ct', asm') = rew_once ruls [] ct Noap ruls;
  91.146  "~~~~~ fun rew_once , args:"; val (ruls, asm, ct, apno, (rul :: thms))
  91.147 @@ -585,11 +585,11 @@
  91.148             val Rule.Thm (thmid, thm) = (*case*) rul (*of*);
  91.149  
  91.150      val SOME (ct', asm') = (*case*)
  91.151 -           rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule.rep_rls) rls)
  91.152 -                  ((#erls o Rule.rep_rls) rls) put_asm thm ct (*of*);
  91.153 +           rewrite__ thy (i + 1) bdv ((snd o #rew_ord o Rule.Rule_Set.rep) rls)
  91.154 +                  ((#erls o Rule.Rule_Set.rep) rls) put_asm thm ct (*of*);
  91.155  "~~~~~ fun rewrite__ , args:"; val (thy, i, bdv, tless, rls, put_asm, thm, ct)
  91.156 -  = (thy, (i + 1), bdv, ((snd o #rew_ord o Rule.rep_rls) rls),
  91.157 -                  ((#erls o Rule.rep_rls) rls), put_asm, thm, ct);
  91.158 +  = (thy, (i + 1), bdv, ((snd o #rew_ord o Rule.Rule_Set.rep) rls),
  91.159 +                  ((#erls o Rule.Rule_Set.rep) rls), put_asm, thm, ct);
  91.160  
  91.161      val (t', asms, _ (*lrd*), rew) =
  91.162             rew_sub thy i bdv tless rls put_asm ([(*root of the term*)]: TermC.path)
  91.163 @@ -707,7 +707,7 @@
  91.164  "----------- fun rewrite_ down to Pattern.match ------------------------------------------------";
  91.165  "----------- fun rewrite_ down to Pattern.match ------------------------------------------------";
  91.166  "~~~~~ fun rewrite_ , args:"; val (thy, rew_ord, erls, bool, thm, term) =
  91.167 -  (@{theory}, dummy_ord, e_rls, false, @{thm distrib_left}, @{term "x * (y + z) :: int"});
  91.168 +  (@{theory}, dummy_ord, Rule_Set.empty, false, @{thm distrib_left}, @{term "x * (y + z) :: int"});
  91.169  "~~~~~ fun rewrite__ , args:"; val (thy, i, bdv, tless, rls, put_asm, thm, ct) =
  91.170    (thy, 1, [], rew_ord, erls, bool, thm, term);
  91.171  "~~~~~ and rew_sub , args:"; val (thy, i, bdv, tless, rls, put_asm, lrd, r, t) =
    92.1 --- a/test/Tools/isac/Specify/appl.sml	Mon Apr 06 11:44:36 2020 +0200
    92.2 +++ b/test/Tools/isac/Specify/appl.sml	Wed Apr 08 12:32:51 2020 +0200
    92.3 @@ -110,7 +110,7 @@
    92.4  > val all_results = str2term "[x=a+b,x=b,x=3]";
    92.5  > val bdv = str2term "x";
    92.6  > val asm = str2term "(x ~= a) & (x ~= b)";
    92.7 -> val erls = e_rls;
    92.8 +> val erls = Rule_Set.empty;
    92.9  > val (t, ts) = check_elementwise thy erls all_results (bdv, asm);
   92.10  > term2str t; tracing(terms2str ts);
   92.11  val it = "[x = a + b, x = b, x = c]" : string