
diff -r 902c99093693 -r 3b63f6bcf05f doc-src/isac/mat-eng-de.tex
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc-src/isac/mat-eng-de.tex	Fri Jul 23 11:45:15 2010 +0200
@@ -0,0 +1,2010 @@
+\documentclass[11pt,a4paper,headline,headcount,towside,nocenter]{report}
+\usepackage{latexsym} 
+%\usepackage{ngerman}
+%\grmn@dq@error ...and \dq \string #1 is undefined}
+%l.989 ...tch the problem type \\{\tt["squareroot",
+%                                                  "univ
+\bibliographystyle{alpha}
+
+\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}
+
+\title{\isac --- Interface for\\
+  Developers of Math Knowledge\\[1.0ex]
+  and\\[1.0ex]
+  Tools for Experiments in\\
+  Symbolic Computation\\[1.0ex]}
+\author{The \isac-Team\\
+  \tt isac-users@ist.tugraz.at\\[1.0ex]}
+\date{\today}
+
+\begin{document}
+\maketitle
+\newpage
+\tableofcontents
+\newpage
+\listoftables
+\newpage
+
+\chapter{Einleitung}
+\section{``Authoring'' und ``Tutoring''}
+{TO DO} Mathematik lernen -- verschiedene Autoren -- Isabelle
+Die Grundlage f\"ur \isac{} bildet Isabelle. Dies ist ein ``theorem prover'', der von L. Paulson und T. Nipkow entwickelt wird und Hard- und Software pr\"uft.
+\section{Der Inhalt des Dokuments}
+\paragraph{TO DO} {Als Anleitung:} Dieses Dokument beschreibt das Kerngebiet (KE) von \isac{}, das Gebiet der mathematics engine (ME) im Kerngebiet und die verschiedenen Funktionen wie das Umschreiben und der Vergleich.
+
+\isac{} und KE wurden in SML geschrieben, die Sprache in Verbindung mit dem Vorg\"anger des Theorem Provers Isabelle entwickelt. So kam es, dass in diesem Dokument die Ebene ASCII als SML Code pr\"asentiert wird. Der Leser wird vermutlich erkennen, dass der \isac{} Benutzer eine vollkommen andere Sichtweise auf eine grafische Benutzeroberfl\"ache bekommt.
+
+Das Dokument ist eigenst\"andig; Basiswissen \"uber SML (für eine Einf\"uhrung siehe \cite{Paulson:91}), Terme und Umschreibung wird vorrausgesetzt.
+
+%The interfaces will be moderately exended during the first phase of development of the mathematics knowledge. The work on the subprojects defined should {\em not} create interfaces of any interest to a user or another author of knowledge except identifiers (of type string) for theorems, rulesets etc.
+
+Hinweis: SML Code, Verzeichnis, Dateien sind {\tt in 'tt' geschrieben}; besonders in {\tt ML>} ist das Kerngebiet schnell.
+
+\paragraph{Versuchen Sie es!}  Ein weiteres Anliegen dieses Textes ist, dem Leser Tipps f\"ur Versuche mit den Anwendungen zu geben.
+
+\section{Gleich am Computer ausprobieren!}\label{get-started}
+\paragraph{TO DO screenshot} Bevor Sie mit Ihren Versuchen beginnen, m\"ochten wir Ihnen noch einige Hinweise geben.
+\begin{itemize}
+ \item System starten
+ \item Shell aufmachen und die Datei mat-eng-de.sml \"offnen.
+ \item $>$  :  Hinter diesem Zeichen (``Prompt'') stehen jene, die Sie selbst eingeben bzw. mit Copy und Paste aus der Datei kopieren.
+ \item Die Eingabe wird mit ``;'' und ``Enter'' abgeschlossen.
+ \item Zeilen, die nicht mit Prompt beginnen, werden vom Computer ausgegeben.
+ 
+\end{itemize}
+
+\part{Experimentelle Ann\"aherung}
+
+\chapter{Terme und Theorien}
+Wie bereits erw\"ahnt, geht es um Computer-Mathematik. In den letzten Jahren hat die ``computer science'' grosse Fortschritte darin gemacht, Mathematik auf dem Computer verst\"andlich darzustellen. Dies gilt f\"ur mathematische Formeln, f\"ur die Beschreibung von Problem (behandelt in Abs.\ref{pbl}), f\"ur L\"osungsmethoden (behandelt in Abs.\ref{met}) etc. Wir beginnen mit mathematischen Formeln --- gleich zum Ausprobieren wie in Abs.\ref{get-started} oben vorbereitet.
+
+\section{Von der Formel zum Term}
+Um ein Beispiel zu nennen: Die Formel $a+b\cdot 3$ l\"asst sich in lesbarer Form so eingeben:
+{\footnotesize\begin{verbatim}
+  > "a + b * 3";
+  val it = "a + b * 3" : string
+\end{verbatim}}
+\noindent ``a + b * 3'' ist also ein String (=Zeichenfolge). In dieser Form weiss der Computer nicht, dass z.B. eine Multiplikation {\em vor} einer Addition zu rechnen ist. Isabelle braucht Formeln in einer anderen Form; Diese kann man mit der Funktion ``str2term'' (= string to term) umrechnen:
+{\footnotesize\begin{verbatim}
+  > str2term "a + b * 3";
+  val it =
+     Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
+           Free ("a", "RealDef.real") $
+        (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
+           ...) : Term.term
+\end{verbatim}}
+\noindent Jene Form braucht Isabelle intern zum rechnen. Sie heisst Term und ist nicht lesbar, daf\"ur aber speicherbar mit Hilfe von ``val'' (=value) 
+{\footnotesize\begin{verbatim}
+  > val term = str2term "a + b * 3";
+  val term =  
+     Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
+           Free ("a", "RealDef.real") $
+        (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
+           ...) : Term.term
+\end{verbatim}
+Der gespeicherte Term kann einer Funktion ``atomty'' \"ubergeben werden, die jenen in einer abstrakten Struktur zeigt:
+{\footnotesize\begin{verbatim}
+  > atomty term;
+ 
+  ***
+  *** Const (op +, [real, real] => real)
+  *** . Free (a, real)
+  *** . Const (op *, [real, real] => real)
+  *** . . Free (b, real)
+  *** . . Free (3, real)
+  ***
+ 
+  val it = () : unit
+\end{verbatim}%size
+
+
+\section{``Theory'' und ``Parsing``}
+Die theory gibt an, welcher Ausdruck wo steht. Eine derzeitige theory wird intern als \texttt{thy} gekennzeichnet. Jene theory, die alles Wissen ent\"ahlt ist \isac{}. 
+
+{\footnotesize\begin{verbatim}
+  > Isac.thy;
+       val it =
+          {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp,
+          Sum_Type, Relation, Record, Inductive, Transitive_Closure,
+          Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power,
+          SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe,
+          Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv,
+          IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map,
+          Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd,
+          RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow,
+          Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix,
+          Float, ComplexI, Descript, Atools, Simplify, Poly, Rational, PolyMinus,
+          Equation, LinEq, Root, RootEq, RatEq, RootRat, RootRatEq, PolyEq, Vect,
+          Calculus, Trig, LogExp, Diff, DiffApp, Integrate, EqSystem, Biegelinie,
+          AlgEin, Test, Isac} : Theory.theory
+\end{verbatim}
+Die, die ein Mal enth\"alt ist groups.thy. Suchen Sie nach '*' unter der Adresse:
+
+http://www.cl.cam.ac.uk/research/hvg/Isabelle/dist/library/HOL/Groups.html
+Hier wird Ihnen erkl\"art, wie das Mal vom Computer gelesen wird.
+{\footnotesize\begin{verbatim}
+  > Group.thy
+      fixes f :: "'a => 'a => 'a" (infixl "*" 70)
+      assumes assoc [ac_simps]: "a * b * c = a * (b * c)"
+\end{verbatim}
+Der ''infix`` ist der Operator, der zwischen zwei Argumenten steht. 70 bedeutet, dass Mal eine hohe Priorit\"at hat (bei einem Plus liegt der Wert bei 50 oder 60). 
+
+Parsing entsteht durch einen string und eine theory. Es verwendet Informationen, die in der theory von Isabelle enthalten sind.
+{\footnotesize\begin{verbatim}
+  > parse;
+       val it = fn : Theory.theory -> string -> Thm.cterm Library.option
+\end{verbatim}
+Dieser term kann wieder in seine einzelnen Teile zerlegt werden.
+{\footnotesize\begin{verbatim}
+   > val it = (term_of o the) it;
+        val it =
+           Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
+               Free ("a", "RealDef.real") $
+           (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
+               ...) : Term.term
+\end{verbatim}
+
+\paragraph{Versuchen Sie es!} Das mathematische Wissen w\"achst, indem man zu den Urspr\"ungen schaut. In den folgenden Beispielen werden verschiedene Meldungen genauer erkl\"art.
+
+{\footnotesize\begin{verbatim}
+   > (*-1-*);
+   > parse HOL.thy "2^^^3";
+      *** Inner lexical error at: "^^^3"
+      val it = None : Thm.cterm Library.option         
+\end{verbatim}
+''Inner lexical error`` bedeutet, dass ein Fehler aufgetreten ist, vermutlich hat man sich vertippt.
+
+{\footnotesize\begin{verbatim}
+   > (*-2-*);
+   > parse HOL.thy "d_d x (a + x)";
+      val it = None : Thm.cterm Library.option               
+\end{verbatim}
+Fehlt ''Inner lexical error`` wurde der Parse nicht gefunden.
+
+{\footnotesize\begin{verbatim}
+   > (*-3-*);
+   > parse Rational.thy "2^^^3";
+      val it = Some "2 ^^^ 3" : Thm.cterm Library.option               
+\end{verbatim}
+
+{\footnotesize\begin{verbatim}
+   > (*-4-*);
+   > val Some t4 = parse Rational.thy "d_d x (a + x)";
+      val t4 = "d_d x (a + x)" : Thm.cterm              
+\end{verbatim}
+
+{\footnotesize\begin{verbatim}
+   > (*-5-*);
+   > val Some t5 = parse Diff.thy  "d_d x (a + x)";
+      val t5 = "d_d x (a + x)" : Thm.cterm             
+\end{verbatim}
+
+Der Pase liefert hier einen ''zu sch\"onen`` Ausdruck in Form eines cterms, der wie ein string aussieht. Am verl\"asslichsten sind terme, die sich selbst erzeugen lassen.
+
+\section{Details von Termen}
+Mit Hilfe der darunterliegenden Darstellung sieht man, dass ein cterm in einen term umgewandelt werden kann.
+{\footnotesize\begin{verbatim}
+   > term_of;
+      val it = fn : Thm.cterm -> Term.term
+\end{verbatim}
+Durch die Umwandlung eines cterms in einen term sieht man die einzelnen Teile des Terms. ''Free`` bedeutet, dass man die Variable \"andern kann.
+{\footnotesize\begin{verbatim}
+   > term_of t4;
+      val it =
+         Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
+         ...: Term.term
+
+\end{verbatim}
+In diesem Fall sagt uns das ''Const``, dass die Variable eine Konstante ist, also ein Fixwert ist und immer die selbe Funktion hat.
+{\footnotesize\begin{verbatim}
+   > term_of t5;
+      val it =
+         Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
+         ... : Term.term
+\end{verbatim}
+Sollten verschiedene Teile des Output nicht sichtbar sein, kann die Schriftgr\"osse ge\"andert werden.
+{\footnotesize\begin{verbatim}
+   > print_depth;
+      val it = fn : int -> unit
+ \end{verbatim}
+Zuerst gibt man die Schriftgr\"osse ein, danach den term, der gr\"osser werden soll.
+{\footnotesize\begin{verbatim}
+   > print_depth 10;
+      val it = () : unit
+   > term_of t4;
+         val it =
+            Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $
+                Free ("x", "RealDef.real") $
+            (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
+                Free ("a", "RealDef.real") $ Free ("x", "RealDef.real"))
+         : Term.term
+
+   > print_depth 10;
+         val it = () : unit
+   > term_of t5;
+         val it =
+            Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $
+                Free ("x", "RealDef.real") $
+            (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
+                Free ("a", "RealDef.real") $ Free ("x", "RealDef.real"))
+         : Term.term
+\end{verbatim}
+
+Eine andere Variante um den Unterschied der beiden Terme zu sehen ist folgende: 
+{\footnotesize\begin{verbatim}
+   > (*-4-*) val thy = Rational.thy;
+      val thy =
+         {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp,
+         Sum_Type, Relation, Record, Inductive, Transitive_Closure,
+         Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power,
+         SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe,
+         Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv,
+         IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map,
+         Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd,
+         RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow,
+         Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix,
+         Float, ComplexI, Descript, Atools, Simplify, Poly, Rational}
+     : Theory.theory
+   > ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)";
+ 
+      ***
+      *** Free (d_d, [real, real] => real)
+      *** . Free (x, real)
+      *** . Const (op +, [real, real] => real)
+      *** . . Free (a, real)
+      *** . . Free (x, real)
+      ***
+ 
+      val it = () : unit
+
+
+   > (*-5-*) val thy = Diff.thy;
+      val thy =
+         {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp,
+         Sum_Type, Relation, Record, Inductive, Transitive_Closure,
+         Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power,
+         SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe,
+         Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv,
+         IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map,
+         Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd,
+         RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow,
+         Ring_and_Field, Complex_Numbers, Real, Calculus, Trig, ListG, Tools,
+         Script, Typefix, Float, ComplexI, Descript, Atools, Simplify, Poly,
+         Equation, LinEq, Root, RootEq, Rational, RatEq, RootRat, RootRatEq,
+         PolyEq, LogExp, Diff} : Theory.theory
+ 
+   > ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)";
+ 
+      ***
+      *** Const (Diff.d_d, [real, real] => real)
+      *** . Free (x, real)
+      *** . Const (op +, [real, real] => real)
+      *** . . Free (a, real)
+      *** . . Free (x, real)
+      ***
+ 
+      val it = () : unit
+\end{verbatim}
+
+
+{\chapter{''Rewriting``}}
+{\section{}}
+Bei Rewriting handelt es sich um die Vereinfachung eines Terms in vielen kleinen Schritten und nach bestimmten Regeln. Der Computer wendet dabei hintereinander verschiedene Rechengesetze an, weil er den Term ansonsten nicht l\"osen kann.
+
+{\footnotesize\begin{verbatim}
+> rewrite_;
+val it = fn
+:
+   Theory.theory ->
+   ((Term.term * Term.term) list -> Term.term * Term.term -> bool) ->
+   rls ->
+   bool ->
+   Thm.thm -> Term.term -> (Term.term * Term.term list) Library.option
+
+> rewrite;
+val it = fn
+:
+   theory' ->
+   rew_ord' ->
+   rls' -> bool -> thm' -> cterm' -> (string * string list) Library.option
+
+\end{verbatim}
+\textbf{Versuchen Sie es!} Um zu sehen, wie der Computer vorgeht und welche Rechengesetze er anwendet, zeigen wir Ihnen durch Differenzieren von (a + a * (2 + b)), die einzelnen Schritte. Sie k\"onnen nat\"urlichauch selbst einige Beispiele ausprobieren!
+
+Zuerst legt man fest, dass es sich um eine Differenzierung handelt.
+{\footnotesize\begin{verbatim}
+   > val thy' = "Diff.thy";
+      val thy' = "Diff.thy" : string
+\end{verbatim}
+Dann gibt man die zu l\"osende Rechnung ein.
+{\footnotesize\begin{verbatim}
+   > val ct = "d_d x (a + a * (2 + b))";
+      val ct = "d_d x (a + a * (2 + b))" : string
+\end{verbatim}
+Anschließend gibt man bekannt, dass die Summenregel angewandt werden soll.
+{\footnotesize\begin{verbatim}
+   > val thm = ("diff_sum","");
+      val thm = ("diff_sum", "") : string * string
+\end{verbatim}
+Schliesslich wird die erste Ableitung angezeigt.
+{\footnotesize\begin{verbatim}
+   > val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true
+                        [("bdv","x::real")] thm ct;#
+      val ct = "d_d x a + d_d x (a * (2 + b))" : cterm'
+\end{verbatim}
+Will man auch die zweite Ableitung sehen, geht man so vor:
+{\footnotesize\begin{verbatim}
+   > val thm = ("diff_prod_const","");
+      val thm = ("diff_prod_const", "") : string * string
+\end{verbatim} 
+Auch die zweite Ableitung wird sichtbar.
+{\footnotesize\begin{verbatim}
+   > val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true
+                        [("bdv","x::real")] thm ct;#
+      val ct = "d_d x a + a * d_d x (2 + b)" : cterm'
+\end{verbatim}
+
+
+
+
+
+
+
+
+
+
+
+\newpage
+------------------------------- ALTER TEXT -------------------------------
+
+Ein Term ist eine Zeichenfolge. Das heisst Es gibt zwei Arten von Termen in Isabelle, 'raw terms' und 'certified terms'. \isac{} arbeitet mit raw terms, die effizient sind. 
+{\footnotesize\begin{verbatim}
+   datatype term = 
+       Const of string * typ
+     | Free  of string * typ 
+     | Var   of indexname * typ
+     | Bound of int
+     | Abs   of string * typ * term
+     | op $  of term * term;
+
+   datatype typ = Type  of string * typ list
+                | TFree of string * sort
+                | TVar  of indexname * sort;
+\end{verbatim}}%size % $
+Die Definition und der Indexname sind in diesem Zusammenhang nicht relevant. Der {\tt typ}e wird w\"ahrend der Parse angedeutet. Diese ist der Hauptbestandteil f\"ur andere Terms, {\tt cterm}. Sie {\tt cterm}s sind zusammengefasste Aufzeichnungen, die ohne die jeweiligen Isabelle-Funktionen nicht zusammengesetzt werden k\"onnen (type--Richtigkeit \"Uberpr\"ufen), aber dann g\"unstig als string dargestellt werden (Verwendung von SML Compiler Internals -- siehe unten).
+
+\section{Theorien und Terme}
+Die Parse verwendet Informationen, die in der Theorie von Isabelle $\sim${\tt /src/HOL}enthalten sind. Die derzeitige Theorie wird international als {\tt thy} gekennzeichnet; auf diese kann unterschiedlich zugegriffen werden.
+{\footnotesize\begin{verbatim}
+   ML> thy;
+   val it =
+   {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp,
+     Sum_Type, Relation, Record, Inductive, Transitive_Closure,
+     Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power,
+     SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe,
+     Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv,
+     IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map,
+     Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd,
+     RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow,
+     Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix,
+     Float, ComplexI, Descript, Atools, Simplify, Poly, Rational, PolyMinus,
+     Equation, LinEq, Root, RootEq, RatEq, RootRat, RootRatEq, PolyEq, Vect,
+     Calculus, Trig, LogExp, Diff, DiffApp, Integrate, EqSystem, Biegelinie,
+     AlgEin, Test, Isac} : Theory.theory                                           
+   ML> HOL.thy;
+   val it = {ProtoPure, CPure, HOL} : Theory.theory 
+   ML>
+   ML> parse;
+   val it = fn : Theory.theory -> string -> Thm.cterm Library.option
+   ML> parse thy "a + b * 3";
+   val it = Some "a + b * 3" : Thm.cterm Library.option
+   ML>
+   ML> val t = (term_of o the) it;
+  val t =
+   Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
+         Free ("a", "RealDef.real") $
+      (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
+         ...) : Term.term
+
+\end{verbatim}}%size
+Die Ausdr\"ucke {\tt term\_of} und {\tt the} werden weiter unten erkl\"art. Den Syntax aus der Liste der Funktionen kann man aus den Theorien von Isabelle \cite{Isa-obj} {\tt [isabelle]/src/HOL/}\footnote{Oder Sie schauen ins Internet unter {\tt [isabelle]/browser\_info}.} und aus den entwickelten Theorien von \isac{} unter {\tt [isac-src]/knowledge/} herauslesen. Beachten Sie, dass der Syntax von diesem Ausdruck anders ist, als jene die bei \isac vom Vorrechner nach der Umrechnung zu MathML angezeigt werden.
+
+
+\section{Anzeigen von Termen}
+Die Drucktiefe auf der höchsten Ebene des SML kann in Ordnung gebracht werden, um den output in der Menge des gewünschten Details zu erzeugen:
+{\footnotesize\begin{verbatim}
+   ML> Compiler.Control.Print.printDepth;
+   val it = ref 4 : int ref
+   ML>
+   ML> Compiler.Control.Print.printDepth:= 2;
+   val it = () : unit
+   ML> t;
+   val it =
+   Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
+         Free ("a", "RealDef.real") $
+      (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
+         ...) : Term.term
+   ML>
+   ML> Compiler.Control.Print.printDepth:= 6;
+   val it = () : unit
+   ML> t;
+   val it =
+     Const ("op +","[RealDef.real, RealDef.real] => RealDef.real") $
+     Free ("a","RealDef.real") $
+     (Const ("op *","[RealDef.real, RealDef.real] => RealDef.real") $
+      Free ("b","RealDef.real") $ Free ("#3","RealDef.real")) : term
+\end{verbatim}}%size % $
+Ein n\"aherer Blick zum letzten output zeigt, dass {\tt typ} wie der string {\tt cterm} ausgegeben worden ist. Andere n\"utzliche Einstellungen für den output sind:
+{\footnotesize\begin{verbatim}
+   ML> Compiler.Control.Print.printLength;
+   val it = ref 8 : int ref
+   ML> Compiler.Control.Print.stringDepth;
+   val it = ref 250 : int ref
+\end{verbatim}}%size
+Die SML der Terme ist nicht lesbar; es gibt Funktionen im KE, um sie zu zeigen:
+{\footnotesize\begin{verbatim}
+   ML> atomt;
+   val it = fn : Term.term -> string
+   ML> atomt t; 
+  "*** -------------"
+  "*** Const (op +)"
+  "*** . Free (a, )"
+  "*** . Const (op *)"
+  "*** . . Free (b, )"
+  "*** . . Free (3, )"
+  "\n"
+val it = "\n" : string
+   ML>
+   ML> atomty;
+  val it = fn : Term.term -> unit
+   ML> atomty thy t;
+   *** -------------
+   *** Const ( op +, [real, real] => real)
+   *** . Free ( a, real)
+   *** . Const ( op *, [real, real] => real)
+   *** . . Free ( b, real)
+   *** . . Free ( #3, real)
+   val it = () : unit
+\end{verbatim}}%size
+{\tt typ} wird als string wiedergegeben. Diesaml aber durch die Informationen von {\tt thy} in besserer Darstellung.
+
+\paragraph{Versuchen Sie es!} {\bf Das mathematische Wissen w\"achst} wie es in Isabelle schrittweise beschrieben ist. Schauen Sie ins Internet um diese Beschreibungen aufzurufen {\tt [isabelle]/src/HOL/HOL.thy} und zu sehen, ob es Kindern auf Ihrem System zur Verf\"ugung steht. Oder Sie sehen sich die verschiedenen Dateien unter {\tt [isabelle]/browser\_info} an.
+{\footnotesize\begin{verbatim}
+   ML> (*-1-*) parse HOL.thy "#2^^^#3";
+   *** Inner lexical error at: "^^^3"
+   val it = None : Thm.cterm Library.option
+   ML>
+   ML> (*-2-*) parse HOL.thy "d_d x (a + x)";
+   val it = None : Thm.cterm Library.option
+   ML>
+   ML>
+   ML> (*-3-*) parse RatArith.thy "#2^^^#3";
+   val it = Some "#2 ^^^ #3" : cterm option
+   ML>
+   ML> (*-4-*) parse RatArith.thy "d_d x (a + x)";
+   val it = Some "d_d x (a + x)" : cterm option
+   ML>
+   ML>
+   ML> (*-5-*) parse Differentiate.thy "d_d x (a + x)";
+   val it = Some "d_d x (a + x)" : cterm option
+   ML>
+   ML> (*-6-*) parse Differentiate.thy "#2^^^#3";
+   val it = Some "#2 ^^^ #3" : cterm option
+\end{verbatim}}%size
+Vertrauen sie nicht der string Darstellung: Wenn wir {\tt(*-4-*)} und {\tt(*-6-*)} zu folgenden Ausdr\"ucken umwandel:\dots
+{\footnotesize\begin{verbatim}
+   ML> (*-4-*) val thy = RatArith.thy;
+   ML> ((atomty thy) o term_of o the o (parse thy)) "d_d x (a + x)";
+   *** -------------
+   *** Free ( d_d, [real, real] => real)
+   *** . Free ( x, real)
+   *** . Const ( op +, [real, real] => real)
+   *** . . Free ( a, real)
+   *** . . Free ( x, real)
+   val it = () : unit
+   ML>
+   ML> (*-6-*) val thy = Differentiate.thy;
+   ML> ((atomty thy) o term_of o the o (parse thy)) "d_d x (a + x)";
+   *** -------------
+   *** Const ( Differentiate.d_d, [real, real] => real)
+   *** . Free ( x, real)
+   *** . Const ( op +, [real, real] => real)
+   *** . . Free ( a, real)
+   *** . . Free ( x, real)
+   val it = () : unit
+\end{verbatim}}%size
+\dots Wir sehen: Bei {\tt(*-4-*)} handelt es sich um eine willk\"urliche Funktion {\tt Free ( d\_d, \_)} und bei {\tt(*-6-*)} um eine spezielle unver\"anderliche Funktion {\tt Const ( Differentiate.d\_d, \_)} für das Differenzieren, welches in {\tt Differentiate.thy} erkl\"art wird und vermutlich gemeint ist.
+
+
+\section{Terme umwandeln}
+Die Umwandlung von {\tt cterm} zu {\tt term} wurde bereits oberhalb gezeigt:
+{\footnotesize\begin{verbatim}
+   ML> term_of;
+   val it = fn : Thm.cterm -> Term.term
+   ML>
+   ML> the;
+   val it = fn : 'a Library.option -> 'a
+   ML>
+   ML> val t = (term_of o the o (parse thy)) "a + b * 3";
+   val t = Const (#,#) $ Free (#,#) $ (Const # $ Free # $ Free (#,#)) : term
+\end{verbatim}}%size
+{\tt the} wird dabei von {\tt term option} ausgewickelt --- eine hilfreiche Funktion von Larry Paulsons Grundlagen {\tt [isabelle]/src/Pure/library.ML}, die für jeden SML Programmierer sehr wertvoll ist.
+
+Die anderen Umwandlungen sind folgende, wobei einige {\it signature} {\tt sign} als Theorie verwenden:
+{\footnotesize\begin{verbatim}
+   ML> sign_of;
+   val it = fn : theory -> Sign.sg
+   ML>
+   ML> cterm_of;
+   val it = fn : Sign.sg -> term -> cterm
+   ML> val ct = cterm_of (sign_of thy) t;
+   val ct = "a + b * #3" : cterm
+   ML>
+   ML> Sign.string_of_term;
+   val it = fn : Sign.sg -> term -> string
+   ML> Sign.string_of_term (sign_of thy) t;
+   val it = "a + b * #3" : ctem'
+   ML>
+   ML> string_of_cterm;
+   val it = fn : cterm -> string
+   ML> string_of_cterm ct;
+   val it = "a + b * #3" : ctem'
+\end{verbatim}}%size
+
+\section{Lehrs\"atze}
+Theorems sind types, {\tt thm}, gesch\"utzter als {\tt cterms}: Sie sind als axioms beschrieben und haben sich in Isabelle bew\"ahrt. Diese Definitionen und Beweise sind in den Theorien im Verzeichnis {\tt[isac-src]/knowledge/} enthalten, zum Beispiel der Lehrsatz {\tt diff\_sum} in der Theorie {\tt[isac-src]/knowledge/Differentiate.thy}. Zus\"atzlich muss jeder Lehrsatz für \isac{} im zugeh\"origen {\tt *.ML}, wie etwa {\tt diff\_sum} in {\tt[isac-src]/knowledge/Differentiate.ML} aufgenommen werden, wie das Folgende:
+{\footnotesize\begin{verbatim}
+   ML> theorem' := overwritel (!theorem',
+   [("diff_const",num_str diff_const)
+   ]);
+\end{verbatim}}%size
+The additional recording of theorems and other values will disappear in later versions of \isac.
+
+\chapter{Umschreiben}
+\section{Argumente f\"ur Umschreibungen}
+Die Bezeichnung des type der Argumente und Werte der Umschreibfunktionen in \ref{rewrite} unterscheiden sich durch ein Apostroph: Die types mit einem Apostroph sind umbenannte strings um die Lesbarkeit aufrecht zu erhalten.
+{\footnotesize\begin{verbatim}
+   ML> HOL.thy;
+   val it = {ProtoPure, CPure, HOL} : theory
+   ML> "HOL.thy" : theory';
+   val it = "HOL.thy" : theory'
+   ML>
+   ML> sqrt_right;
+   val it = fn : rew_ord (* term * term -> bool *)
+   ML> "sqrt_right" : rew_ord';
+   val it = "sqrt_right" : rew_ord'
+   ML>
+   ML> eval_rls;
+   val it =
+     Rls
+       {preconds=[],rew_ord=("sqrt_right",fn),
+        rules=[Thm #,Thm #,Thm #,Thm #,Thm #,Thm #,Thm #,Thm #,
+               Thm #,Thm #,Thm #,Thm #,Thm #,Calc #,Calc #,...],
+        scr=Script (Free #)} : rls
+   ML> "eval_rls" : rls';
+   val it = "eval_rls" : rls'
+   ML>
+   ML> diff_sum;
+   val it = "d_d ?bdv (?u + ?v) = d_d ?bdv ?u + d_d ?bdv ?v" : thm
+   ML> ("diff_sum", "") : thm';
+   val it = ("diff_sum","") : thm'
+\end{verbatim}}%size
+{\tt thm'} ist ein Teil, eventuell mit strin-Darstellung von dem zugeh\"origen Lehrsatz.
+ 
+\section{Die Funktionen des Umschreibens}\label{rewrite}
+Das Umschreiben wird von zwei equvalenten Funktionen begleitet, wobei die erste im KE verwendet wird und sie zweite n\"utzlich für Tests ist: 
+{\footnotesize\begin{verbatim}
+   ML> rewrite_;
+   val it = fn
+     : theory
+       -> rew_ord
+          -> rls -> bool -> thm -> term -> (term * term list) option
+   ML>
+   ML> rewrite;
+   val it = fn
+     : theory'
+       -> rew_ord'
+          -> rls' -> bool -> thm' -> cterm' -> (cterm' * cterm' list) option
+\end{verbatim}}%size
+The arguments are the following:\\
+\tabcolsep=4mm
+\def\arraystretch{1.5}
+\begin{tabular}{lp{11.0cm}}
+  {\tt theory}  & the Isabelle theory containing the definitions necessary for parsing the {\tt term} \\
+  {\tt rew\_ord}& the rewrite order \cite{nipk:rew-all-that} for ordered rewriting -- see the section \ref{term-order} below. For {\em no} ordered rewriting take {\tt tless\_true}, a dummy order yielding true for all arguments \\
+  {\tt rls}     & the rule set for evaluating the condition within {\tt thm} in case {\tt thm} is a conditional rule \\
+  {\tt bool}    & a flag which triggers the evaluation of the eventual condition in {\tt thm}: if {\tt false} then evaluate the condition and according to the result of the evaluation apply {\tt thm} or not (conditional rewriting \cite{nipk:rew-all-that}), if {\tt true} then don't evaluate the condition, but put it into the set of assumptions \\
+  {\tt thm}     & the theorem used to try to rewrite {\tt term} \\
+  {\tt term}    & the term eventually rewritten by {\tt thm} \\
+\end{tabular}\\
+
+\noindent The respective values of {\tt rewrite\_} and {\tt rewrite} are an {\tt option} of a pair, i.e. {\tt Some(\_,\_)} in case the {\tt term} can be rewritten by {\tt thm} w.r.t. {\tt rew\_ord} and/or {\tt rls}, or {\tt None} if no rewrite is found:\\
+\begin{tabular}{lp{10.4cm}}
+  {\tt term}     & the term rewritten \\
+  {\tt term list}& the assumptions eventually generated if the {\tt bool} flag is set to {\tt true} and {\tt thm} is applicable. \\
+\end{tabular}\\
+
+\paragraph{Give it a try !} {\bf\dots rewriting is fun~!} many examples can be found in {\tt [isac-src]/tests/\dots}. In {\tt [isac-src]/tests/differentiate.sml} the following can be found:
+{\footnotesize\begin{verbatim}
+   ML> val thy' = "Differentiate.thy";
+   val thy' = "Differentiate.thy" : string
+   ML> val ct = "d_d x (x ^^^ #2 + #3 * x + #4)";
+   val ct = "d_d x (x ^^^ #2 + #3 * x + #4)" : cterm'
+   ML>
+   ML> val thm = ("diff_sum","");
+   val thm = ("diff_sum","") : thm'
+   ML> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true
+                     [("bdv","x::real")] thm ct;
+   val ct = "d_d x (x ^^^ #2 + #3 * x) + d_d x #4" : cterm'
+   ML>
+   ML> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true
+                     [("bdv","x::real")] thm ct;
+   val ct = "d_d x (x ^^^ #2) + d_d x (#3 * x) + d_d x #4" : cterm'
+   ML>
+   ML> val thm = ("diff_prod_const","");
+   val thm = ("diff_prod_const","") : thm'
+   ML> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true
+                     [("bdv","x::real")] thm ct;
+   val ct = "d_d x (x ^^^ #2) + #3 * d_d x x + d_d x #4" : cterm'
+\end{verbatim}}%size
+Sie k\"onnen unter {\tt [isac-src]/knowledge/Differentiate.thy} die Lehrs\"atze nachschlagen und versuchen Sie, diese anzuwenden bis Sie die Ergebnisse bekommen.
+\footnote{Hinweis: Am Ende werden Sie {\tt val (ct,\_) = the (rewrite\_set thy' "eval\_rls" false "SqRoot\_simplify" ct);} benötigen.}
+
+\paragraph{Versuchen Sie es!}\label{cond-rew} {\bf Conditional rewriting} ist eine besser Technik als \"ubliche Umschreibungen und \"ahnelt den Programmiersprachen mehr (siehe n\"achstes 'Versuchen Sie es'~!). Das folgende Beispiel liegt im Bereich der ??poynomial form??:
+{\footnotesize\begin{verbatim}
+   ML> val thy' = "Isac.thy";
+   val thy' = "Isac.thy" : string
+   ML> val ct' = "#3 * a + #2 * (a + #1)";
+   val ct' = "#3 * a + #2 * (a + #1)" : cterm'
+   ML>
+   ML> val thm' = ("radd_mult_distrib2","?k * (?m + ?n) = ?k * ?m + ?k * ?n");
+   val thm' = ("radd_mult_distrib2","?k * (?m + ?n) = ?k * ?m + ?k * ?n")
+     : thm'
+   ML> (*1*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct';
+   val ct' = "#3 * a + (#2 * a + #2 * #1)" : cterm'
+   ML>
+   ML> val thm' = ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1");
+   val thm' = ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1")
+     : thm'
+   ML> (*2*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct';
+   val ct' = "#3 * a + #2 * a + #2 * #1" : cterm'
+   ML>
+   ML> val thm' = ("rcollect_right",
+     "[| ?l is_const; ?m is_const |] ==> ?l * ?n + ?m * ?n = (?l + ?m) * ?n");
+   val thm' =
+     ("rcollect_right",
+      "[| ?l is_const; ?m is_const |] ==> ?l * ?n + ?m * ?n = (?l + ?m) * ?n")
+     : thm'
+   ML> (*3*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct';
+   val ct' = "(#3 + #2) * a + #2 * #1" : cterm'
+   ML>
+   ML> (*4*) val Some (ct',_) = calculate' thy' "plus" ct';
+   val ct' = "#5 * a + #2 * #1" : cterm'
+   ML>
+   ML> (*5*) val Some (ct',_) = calculate' thy' "times" ct';
+   val ct' = "#5 * a + #2" : cterm'
+\end{verbatim}}%size
+Beachten Sie, dass es zwei Regeln gibt {\tt radd\_mult\_distrib2} in {\tt(*1*)} und {\tt rcollect\_right} in {\tt(*3*)}, die einander aufheben, (das heißt, eine angesetzte Regel w\"urde es nicht beenden), wenn es diese Bedinung nicht vorhanden ist {\tt is\_const}.
+
+\paragraph{Versuchen Sie es!} {\bf Funktionelle Programmierung} kann, innerhalb einer bestimmten Reihe, durch das Umschreiben bearbeitet werden. In {\tt [isac-src]/\dots/tests/InsSort.thy} k\"onnen die Regeln gefunden werden, mit denen man eine Liste sortieren kann ('insertion sort'):
+{\footnotesize\begin{verbatim}
+   sort_def   "sort ls = foldr ins ls []"
+
+   ins_base   "ins [] a = [a]"
+   ins_rec    "ins (x#xs) a = (if x < a then x#(ins xs a) else a#(x#xs))"  
+
+   foldr_base "foldr f [] a = a"
+   foldr_rec  "foldr f (x#xs) a = foldr f xs (f a x)"
+
+   if_True    "(if True then ?x else ?y) = ?x"
+   if_False   "(if False then ?x else ?y) = ?y"
+\end{verbatim}}%size
+{\tt\#} ist ein Listenersteller, {\tt foldr} ist die bekannte Funktion beim funktionellen Programmieren und {\tt if\_True, if\_False} sind die Hilfsregeln. Dann kann das Sortieren mit den folgenden Umschreibungen durchgef\"uhrt werden.
+{\footnotesize\begin{verbatim}
+   ML>  val thy' = "InsSort.thy";
+   val thy' = "InsSort.thy" : theory'
+   ML>  val ct = "sort [#1,#3,#2]" : cterm';
+   val ct = "sort [#1,#3,#2]" : cterm'
+   ML>
+   ML>  val thm = ("sort_def","");
+   ML>  val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct);
+   val ct = "foldr ins [#1, #3, #2] []" : cterm'
+   ML>
+   ML>  val thm = ("foldr_rec","");
+   ML>  val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct);
+   val ct = "foldr ins [#3, #2] (ins [] #1)" : cterm'
+   ML>
+   ML>  val thm = ("ins_base","");
+   ML>  val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct);
+   val ct = "foldr ins [#3, #2] [#1]" : cterm'
+   ML>
+   ML>  val thm = ("foldr_rec","");
+   ML>  val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct);
+   val ct = "foldr ins [#2] (ins [#1] #3)" : cterm'
+   ML>
+   ML>  val thm = ("ins_rec","");
+   ML>  val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct);
+   val ct = "foldr ins [#2] (if #1 < #3 then #1 # ins [] #3 else [#3, #1])"
+     : cterm'
+   ML>
+   ML>  val (ct,_) = the (calculate' thy' "le" ct);
+   val ct = "foldr ins [#2] (if True then #1 # ins [] #3 else [#3, #1])" : cterm'
+   ML>
+   ML>  val thm = ("if_True","(if True then ?x else ?y) = ?x");
+   ML>  val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct);
+   val ct = "foldr ins [#2] (#1 # ins [] #3)" : cterm'
+   ML> 
+   ...
+   val ct = "sort [#1,#3,#2]" : cterm'
+\end{verbatim}}%size
+
+
+\section{Varianten des Umschreibens}
+Einige der genannten Beispiele verwendeten schon Methoden von {\tt rewrite}, welche den selben Wert haben und sehr \"ahnliche Argumente verwenden:
+{\footnotesize\begin{verbatim}
+   ML> rewrite_inst_;
+   val it = fn
+     : theory
+       -> rew_ord
+          -> rls
+             -> bool
+             -> (cterm' * cterm') list
+                   -> thm -> term -> (term * term list) option
+   ML> rewrite_inst;
+   val it = fn
+     : theory'
+       -> rew_ord'
+          -> rls'
+             -> bool
+                -> (cterm' * cterm') list
+                   -> thm' -> cterm' -> (cterm' * cterm' list) option
+   ML>
+   ML> rewrite_set_;
+   val it = fn 
+     : theory -> rls -> bool -> rls -> term -> (term * term list) option
+   ML> rewrite_set;
+   val it = fn
+     : theory' -> rls' -> bool -> rls' -> cterm' -> (cterm' * cterm' list) option
+   ML>
+   ML> rewrite_set_inst_;
+   val it = fn
+     : theory
+       -> rls
+          -> bool
+             -> (cterm' * cterm') list
+                -> rls -> term -> (term * term list) option
+   ML> rewrite_set_inst;
+   val it = fn
+     : theory'
+       -> rls'
+          -> bool
+             -> (cterm' * cterm') list
+                -> rls' -> cterm' -> (cterm' * cterm' list) option
+\end{verbatim}}%size
+
+\noindent Die Variante {\tt rewrite\_inst} \"andert {\tt (term * term) list} zu {\tt thm} vor dem Umschreiben,\\
+Die Variante {\tt rewrite\_set} umschreibt {\tt rls} mit einem ganzen Regelsatz (anstatt mit {\tt thm}),\\
+Die Variante {\tt rewrite\_set\_inst} ist eine Kombination aus den letzten zwei Varianten. Um zu sehen wie ein Ausdruck umgeschreiben wird, gibt es einen Schalter {\tt trace\_rewrite}:
+{\footnotesize\begin{verbatim}
+   ML> toggle;
+   val it = fn : bool ref -> bool
+   ML>
+   ML> toggle trace_rewrite;
+   val it = true : bool
+   ML> toggle trace_rewrite;
+   val it = false : bool
+\end{verbatim}}%size
+
+\section{Regels\"atze}
+Eine Varianten von {\tt rewrite} oberhalb gelten nicht nur für einen Lehrsatz, sondern für eine Vielzahl von Lehrs\"atzen, die 'Regels\"atze' genannt werden. Ein Regelsatz wird so lange angewendet, bis eines seiner Elemente f\"ur das Umschreiben verwendet werden kann (das kann ewig dauern, zum Beispiel, wenn ein Regelsatz nicht endet).
+
+Ein einfaches Beispiel für einen Regelsatz ist {\tt rearrange\_assoc}, welches in {\tt knowledge/RatArith.ML} beschrieben wird:
+{\footnotesize\begin{verbatim}
+   val rearrange_assoc = 
+     Rls{preconds = [], rew_ord = ("tless_true",tless_true), 
+         rules = 
+         [Thm ("radd_assoc_RS_sym",num_str (radd_assoc RS sym)),
+          Thm ("rmult_assoc_RS_sym",num_str (rmult_assoc RS sym))],
+         scr = Script ((term_of o the o (parse thy)) 
+         "empty_script")
+         }:rls;
+\end{verbatim}}%size
+
+\begin{description}
+\item [\tt preconds] sind Bedinungen, die zutreffen m\"ussen, um den Regelsatz anwendbar zu machen (eine leere Liste berechnet {\tt true}).
+\item [\tt rew\_ord] betrifft die Anordnung der Ausdr\"ucke, dei weiter unten in \ref{term-order} vorgestellt werden.
+\item [\tt rules] sind die angewandten Lehrs\"atze -- grunds\"atzlich in beliebiger Anordnung, weil die Regels\"atze vervollst\"andigt werden sollten \cite{nipk:rew-all-that} (und die Lehrs\"atze werden tats\"achlich in der Reihenfolge, in der sie auf der Liste erscheinen, angewendet). Die Funktion {\tt num\_str}, muss bei den Lehrs\"atzen, die viele Konstanten enthalten, angewendet werden (und demnach ist das bei diesem Beispiel veraltert). {\tt RS} ist eine eingef\"ugte Funktion, die im Lehrsatz {\tt sym} zu {\tt radd\_assoc} vor der Abspeicherung angewendet wird (siehe 'Effekt')
+\item [\tt scr] auch wenn das script den Regelsatz anwendet, wird es in späteren Versionen von \isac verschwinden.
+\end{description}
+Diese Variablen bestimmen folgendes:
+{\footnotesize\begin{verbatim}
+   ML> sym;
+   val it = "?s = ?t ==> ?t = ?s" : thm 
+   ML> rearrange_assoc;
+   val it =
+     Rls
+       {preconds=[],rew_ord=("tless_true",fn),
+        rules=[Thm ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1"),
+               Thm ("rmult_assoc_RS_sym","?m1 * (?n1 * ?k1) = ?m1 * ?n1 * ?k1")],
+        scr=Script (Free ("empty_script","RealDef.real"))} : rls 
+\end{verbatim}}%size
+
+\paragraph{Versuchen Sie es!} Der obengenannte Regel-Satz l\"asst eine beliebige Zahl von Parenthesen verschwinden, die auf Grund von Assoziation auf {\tt +} nicht notwendig sind. 
+{\footnotesize\begin{verbatim}
+   ML> val ct = (string_of_cterm o the o (parse RatArith.thy))
+                "a + (b * (c * d) + e)";
+   val ct = "a + ((b * (c * d) + e) + f)" : cterm'
+   ML> rewrite_set "RatArith.thy" "eval_rls" false "rearrange_assoc" ct;
+   val it = Some ("a + b * c * d + e + f",[]) : (string * string list) option
+\end{verbatim}}%size
+Um dieses Ergebnis zu erreichen muss der Regelsatz \"uberraschend schnell sein:
+{\footnotesize\begin{verbatim}
+   ML> toggle trace_rewrite;
+   val it = true : bool
+   ML> rewrite_set "RatArith.thy" "eval_rls" false "rearrange_assoc" ct;
+   ### trying thm 'radd_assoc_RS_sym'
+   ### rewrite_set_: a + b * (c * d) + e
+   ### trying thm 'radd_assoc_RS_sym'
+   ### trying thm 'rmult_assoc_RS_sym'
+   ### rewrite_set_: a + b * c * d + e
+   ### trying thm 'rmult_assoc_RS_sym'
+   ### trying thm 'radd_assoc_RS_sym'
+   ### trying thm 'rmult_assoc_RS_sym'
+   val it = Some ("a + b * c * d + e",[]) : (string * string list) option
+\end{verbatim}}%size
+ 
+
+\section{Berechnung von numerischen Konstanten}
+Sobald numerische Konstanten in angrenzenden Subfristen sind, können sie durch die Funktion berechnet werden (siehe p.\pageref{cond-rew}):
+{\footnotesize\begin{verbatim}
+   ML> calculate;
+   val it = fn : theory' -> string -> cterm' -> (cterm' * thm') option
+   ML> calculate_;
+   val it = fn : theory -> string -> term -> (term * (string * thm)) option
+\end{verbatim}}%size
+{\tt string} beschreibt in den Angaben die mathematisch zu berechnende Operation. Die Funktion gibt das Ergebnis der Berechnung, und als zweites Element in der Reihe gilt der Lehrsatz. Die folgenden mathematischen Operationen sind verfügbar:
+{\footnotesize\begin{verbatim}
+   ML> calc_list;
+   val it =
+     ref
+       [("plus",("op +",fn)),
+        ("times",("op *",fn)),
+        ("cancel_",("cancel",fn)),
+        ("power",("pow",fn)),
+        ("sqrt",("sqrt",fn)),
+        ("Var",("Var",fn)),
+        ("Length",("Length",fn)),
+        ("Nth",("Nth",fn)),
+        ("power",("pow",fn)),
+        ("le",("op <",fn)),
+        ("leq",("op <=",fn)),
+        ("is_const",("is'_const",fn)),
+        ("is_root_free",("is'_root'_free",fn)),
+        ("contains_root",("contains'_root",fn)),
+        ("ident",("ident",fn))]
+     : (string * (string * (string -> term -> theory -> 
+        (string * term) option))) list ref
+\end{verbatim}}%size
+Diese Vorgänge k\"onnen so verwendet werden:
+{\footnotesize\begin{verbatim}
+   ML> calculate' "Isac.thy" "plus" "#1 + #2";
+   val it = Some ("#3",("#add_#1_#2","\"#1 + #2 = #3\"")) : (string * thm') option
+   ML>
+   ML> calculate' "Isac.thy" "times" "#2 * #3";
+   val it = Some ("#6",("#mult_#2_#3","\"#2 * #3 = #6\""))
+     : (string * thm') option
+   ML>
+   ML> calculate' "Isac.thy" "power" "#2 ^^^ #3";
+   val it = Some ("#8",("#power_#2_#3","\"#2 ^^^ #3 = #8\""))
+     : (string * thm') option
+   ML>
+   ML> calculate' "Isac.thy" "cancel_" "#9 // #12";
+   val it = Some ("#3 // #4",("#cancel_#9_#12","\"#9 // #12 = #3 // #4\""))
+     : (string * thm') option
+   ML>
+   ML> ...
+\end{verbatim}}%size
+          
+
+
+\chapter{Begriff-Ordnung}\label{term-order}
+Die Anordnungen der Terme sind unverzichtbar f\"ur den Gebrauch des Umschreibens von normalen Funktionen in inhaltsorientierten - kommunikativen Breichen, wie \cite{nipk:rew-all-that}, und zum Umschreiben von normalen Formeln, die n\"otig sind um passende Modelle f\"ur Probleme zu finden, siehe \ref{pbt}.
+\section{Beispiel f\"ur Begriff-Ordnungen}
+Es ist nicht unbedeutend, eine Verbindung $<$ zu Termen herzustellen, die wirklich eine Anordnung besitzen, wie eine transitive und antisymmetrische Verbindung. Diese Anordnungen sind 'rekursive Bahnanordnungen' \cite{nipk:rew-all-that}. Einige Anordnungen sind im Basiswissen bei {\tt [isac-src]/knowledge/\dots}, angeführt. %FIXXXmat0201a
+unter anderem
+{\footnotesize\begin{verbatim}
+   ML> sqrt_right;
+   val it = fn : bool -> theory -> term * term -> bool
+   ML> tless_true;
+   val it = fn : 'a -> bool 
+\end{verbatim}}%size
+Das bool Argument ist ein Schalter um die Kontrolle zur\"uck zu den zugeh\"origen Unterordnungen zu verfolgen (diese Theorie ist notwendig um die Unterordnungen als strings, sollten sie 'true' sein, anzuzeigen). Die Anordnung {\tt tless\_true} ist belanglos und tr\"agt immer {\tt true}, und {\tt sqrt\_right} bevorzugt eine Quadratwurzel, die nach rechts im Ausdruck geschoben wird:
+{\footnotesize\begin{verbatim}
+   ML> val t1 = (term_of o the o (parse thy)) "(sqrt a) + b";
+   val t1 = Const # $ (# $ #) $ Free (#,#) : term
+   ML>
+   ML> val t2 = (term_of o the o (parse thy)) "b + (sqrt a)";
+   val t2 = Const # $ Free # $ (Const # $ Free #) : term
+   ML>
+   ML> sqrt_right false SqRoot.thy (t1, t2);
+   val it = false : bool
+   ML> sqrt_right false SqRoot.thy (t2, t1);
+   val it = true : bool
+\end{verbatim}}%size
+Die vielen Kontrollen, die rekursiv durch alle Subbegriffe durchgef\"uhrt werden, können überall im Algorithmus in {\tt [isac-src]/knowledge/SqRoot.ML} verfolgt werden, wenn man die flag auf true setzt:
+{\footnotesize\begin{verbatim}
+   ML> val t1 = (term_of o the o (parse thy)) "a + b*(sqrt c) + d";
+   val t1 = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("d","RealDef.real") : term
+   ML>
+   ML> val t2 = (term_of o the o (parse thy)) "a + (sqrt b)*c + d";
+   val t2 = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("d","RealDef.real") : term
+   ML>
+   ML> sqrt_right true SqRoot.thy (t1, t2);
+   t= f@ts= "op +" @ "[a + b * sqrt c,d]"
+   u= g@us= "op +" @ "[a + sqrt b * c,d]"
+   size_of_term(t,u)= (8, 8)
+   hd_ord(f,g)      = EQUAL
+   terms_ord(ts,us) = LESS
+   -------
+   t= f@ts= "op +" @ "[a,b * sqrt c]"
+   u= g@us= "op +" @ "[a,sqrt b * c]"
+   size_of_term(t,u)= (6, 6)
+   hd_ord(f,g)      = EQUAL
+   terms_ord(ts,us) = LESS
+   -------
+   t= f@ts= "a" @ "[]"
+   u= g@us= "a" @ "[]"
+   size_of_term(t,u)= (1, 1)
+   hd_ord(f,g)      = EQUAL
+   terms_ord(ts,us) = EQUAL
+   -------
+   t= f@ts= "op *" @ "[b,sqrt c]"
+   u= g@us= "op *" @ "[sqrt b,c]"
+   size_of_term(t,u)= (4, 4)
+   hd_ord(f,g)      = EQUAL
+   terms_ord(ts,us) = LESS
+   -------
+   t= f@ts= "b" @ "[]"
+   u= g@us= "sqrt" @ "[b]"
+   size_of_term(t,u)= (1, 2)
+   hd_ord(f,g)      = LESS
+   terms_ord(ts,us) = LESS
+   -------
+   val it = true : bool 
+\end{verbatim}}%size
+
+
+
+\section{Geordnetes Umschreiben}
+Das Umschreiben beinhaltet in fast allen elementaren Bereichen Probleme, die alle assoziieren und ausgewechselt werden k\"onnen, im Bezug auf {\tt +} und {\tt *} --- Das Gesetz der Wandelbarkeit angewendet mit einem Regelsatzes, veranlasst den Satz, nicht zu enden! Ein Weg mit dieser Schwierigkeit umzugehen ist das geordnete Umschreiben, bei dem die Umschreibung erst beendet ist, wenn der Begriff des Ergebnisses kleiner ist, im Bezug auf eine Begriff-Ordnung (mit einigen zus\"atzlichen Eigenschaften, die 'rewrite orders' \cite{nipk:rew-all-that} genannt werden).
+
+Ein solcher Regelsatz {\tt ac\_plus\_times}, der als AC-rewrite system bezeichnet wird, kann in {\tt[isac-src]/knowledge/RathArith.ML} gefunden werden:
+{\footnotesize\begin{verbatim}
+   val ac_plus_times =
+     Rls{preconds = [], rew_ord = ("term_order",term_order),
+         rules =
+         [Thm ("radd_commute",radd_commute),
+          Thm ("radd_left_commute",radd_left_commute),
+          Thm ("radd_assoc",radd_assoc),
+          Thm ("rmult_commute",rmult_commute),
+          Thm ("rmult_left_commute",rmult_left_commute),
+          Thm ("rmult_assoc",rmult_assoc)],
+         scr = Script ((term_of o the o (parse thy))
+         "empty_script")
+         }:rls;
+   val ac_plus_times =
+     Rls
+       {preconds=[],rew_ord=("term_order",fn),
+        rules=[Thm ("radd_commute","?m + ?n = ?n + ?m"),
+               Thm ("radd_left_commute","?x + (?y + ?z) = ?y + (?x + ?z)"),
+               Thm ("radd_assoc","?m + ?n + ?k = ?m + (?n + ?k)"),
+               Thm ("rmult_commute","?m * ?n = ?n * ?m"),
+               Thm ("rmult_left_commute","?x * (?y * ?z) = ?y * (?x * ?z)"),
+               Thm ("rmult_assoc","?m * ?n * ?k = ?m * (?n * ?k)")],
+        scr=Script (Free ("empty_script","RealDef.real"))} : rls 
+\end{verbatim}}%size
+Beachten Sie, dass die Lehrs\"atze {\tt radd\_left\_commute} und {\tt rmult\_left\_commute} notwendig sind, um den Regelsatz 'confluent' zu machen!
+
+
+\paragraph{Versuchen Sie es!} Das geordnete Umschreiben ist eine Technik um ein normales Polynom von willk\"urlich, ganzzahligen Termen zu schafffen.:
+{\footnotesize\begin{verbatim}
+   ML> val ct' = "#3 * a + b + #2 * a";
+   val ct' = "#3 * a + b + #2 * a" : cterm'
+   ML>
+   ML> (*-1-*) radd_commute; val thm' = ("radd_commute","") : thm';
+   val it = "?m + ?n = ?n + ?m" : thm
+   val thm' = ("radd_commute","") : thm'
+   ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct';
+   val ct' = "#2 * a + (#3 * a + b)" : cterm'
+   ML>
+   ML> (*-2-*) rdistr_right_assoc_p; val thm' = ("rdistr_right_assoc_p","") : thm';
+   val it = "?l * ?n + (?m * ?n + ?k) = (?l + ?m) * ?n + ?k" : thm
+   val thm' = ("rdistr_right_assoc_p","") : thm'
+   ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct';
+   val ct' = "(#2 + #3) * a + b" : cterm'
+   ML>
+   ML> (*-3-*)
+   ML> val Some (ct',_) = calculate thy' "plus" ct';
+   val ct' = "#5 * a + b" : cterm'
+\end{verbatim}}%size %FIXXXmat0201b ... calculate !
+Das sieht toll aus, aber wenn {\tt radd\_commute} automatisch angewendet wird {\tt (*-1-*)} ohne zu \"uberpr\"ufen, ob ide daraus entstehenden Terme kleiner werden im Bezug auf die Begriffsordnung, dann geht das Umschreiben endlos weiter. (das heißt, es wird nicht beendet) \dots
+{\footnotesize\begin{verbatim}
+   ML> val ct' = "#3 * a + b + #2 * a" : cterm';
+   val ct' = "#3 * a + b + #2 * a" : cterm'
+   ML> val thm' = ("radd_commute","") : thm';
+   val thm' = ("radd_commute","") : thm'
+   ML>
+   ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct';
+   val ct' = "#2 * a + (#3 * a + b)" : cterm'
+   ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct';
+   val ct' = "#3 * a + b + #2 * a" : cterm'
+   ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct';
+   val ct' = "#2 * a + (#3 * a + b)" : cterm'
+              ..........
+\end{verbatim}}%size
+
+Geordnetes Umschreiben mit dem obrigen AC-rewrite system {\tt ac\_plus\_times} verursacht eine Art Durcheinander, dem man auf die Spur kommen kann:
+{\footnotesize\begin{verbatim}
+   ML> toggle trace_rewrite;
+   val it = true : bool
+   ML>
+   ML> rewrite_set "RatArith.thy" "eval_rls" false "ac_plus_times" ct;
+   ### trying thm 'radd_commute'
+   ### not: "a + (b * (c * d) + e)" > "b * (c * d) + e + a"
+   ### rewrite_set_: a + (e + b * (c * d))
+   ### trying thm 'radd_commute'
+   ### not: "a + (e + b * (c * d))" > "e + b * (c * d) + a"
+   ### not: "e + b * (c * d)" > "b * (c * d) + e"
+   ### trying thm 'radd_left_commute'
+   ### not: "a + (e + b * (c * d))" > "e + (a + b * (c * d))"
+   ### trying thm 'radd_assoc'
+   ### trying thm 'rmult_commute'
+   ### not: "b * (c * d)" > "c * d * b"
+   ### not: "c * d" > "d * c"
+   ### trying thm 'rmult_left_commute'
+   ### not: "b * (c * d)" > "c * (b * d)"
+   ### trying thm 'rmult_assoc'
+   ### trying thm 'radd_commute'
+   ### not: "a + (e + b * (c * d))" > "e + b * (c * d) + a"
+   ### not: "e + b * (c * d)" > "b * (c * d) + e"
+   ### trying thm 'radd_left_commute'
+   ### not: "a + (e + b * (c * d))" > "e + (a + b * (c * d))"
+   ### trying thm 'radd_assoc'
+   ### trying thm 'rmult_commute'
+   ### not: "b * (c * d)" > "c * d * b"
+   ### not: "c * d" > "d * c"
+   ### trying thm 'rmult_left_commute'
+   ### not: "b * (c * d)" > "c * (b * d)"
+   ### trying thm 'rmult_assoc'
+   val it = Some ("a + (e + b * (c * d))",[]) : (string * string list) option     \end{verbatim}}%size
+Beachten Sie, dass {\tt +} nach links ausgerichtet ist, bei dem die Parenthesen f\"ur {\tt (a + b) + c = a + b + c}, aber nicht f\"ur {\tt a + (b + c)} weggelassen werden. Geordnetes Umschreiben endet unbedingt mit Parenthesen, die auf Grund der Assoziation weggelassen werden k\"onnen.
+
+
+\chapter{The hierarchy of problem types}\label{pbt}
+\section{The standard-function for 'matching'}
+Matching \cite{nipk:rew-all-that} is a technique used within rewriting, and used by \isac{} also for (a generalized) 'matching' a problem with a problem type. The function which tests for matching has the following signature:
+{\footnotesize\begin{verbatim}
+   ML> matches;
+   val it = fn : theory -> term -> term -> bool
+\end{verbatim}}%size
+where the first of the two {\tt term} arguments is the particular term to be tested, and the second one is the pattern:
+{\footnotesize\begin{verbatim}
+   ML> val t = (term_of o the o (parse thy)) "#3 * x^^^#2 = #1";
+   val t = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("#1","RealDef.real") : term
+   ML>
+   ML> val p = (term_of o the o (parse thy)) "a * b^^^#2 = c";
+   val p = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("c","RealDef.real") : term
+   ML> atomt p;
+   *** -------------
+   *** Const ( op =)
+   *** . Const ( op *)
+   *** . . Free ( a, )
+   *** . . Const ( RatArith.pow)
+   *** . . . Free ( b, )
+   *** . . . Free ( #2, )
+   *** . Free ( c, )
+   val it = () : unit
+   ML>
+   ML> free2var;
+   val it = fn : term -> term
+   ML>
+   ML> val pat = free2var p;
+   val pat = Const (#,#) $ (# $ # $ (# $ #)) $ Var ((#,#),"RealDef.real") : term
+   ML> Sign.string_of_term (sign_of thy) pat;
+   val it = "?a * ?b ^^^ #2 = ?c" : cterm' 
+   ML> atomt pat;
+   *** -------------
+   *** Const ( op =)
+   *** . Const ( op *)
+   *** . . Var ((a, 0), )
+   *** . . Const ( RatArith.pow)
+   *** . . . Var ((b, 0), )
+   *** . . . Free ( #2, )
+   *** . Var ((c, 0), )
+   val it = () : unit
+\end{verbatim}}%size % $ 
+Note that the pattern {\tt pat} contains so-called {\it scheme variables} decorated with a {\tt ?} (analoguous to theorems). The pattern is generated by the function {\tt free2var}. This format of the pattern is necessary in order to obtain results like these:
+{\footnotesize\begin{verbatim}
+   ML> matches thy t pat;
+   val it = true : bool
+   ML>
+   ML> val t2 = (term_of o the o (parse thy)) "x^^^#2 = #1";
+   val t2 = Const (#,#) $ (# $ # $ Free #) $ Free ("#1","RealDef.real") : term
+   ML> matches thy t2 pat;
+   val it = false : bool    
+   ML>
+   ML> val pat2 = (term_of o the o (parse thy)) "?u^^^#2 = ?v";
+   val pat2 = Const (#,#) $ (# $ # $ Free #) $ Var ((#,#),"RealDef.real") : term
+   ML> matches thy t2 pat2;
+   val it = true : bool 
+\end{verbatim}}%size % $
+
+\section{Accessing the hierarchy}
+The hierarchy of problem types is encapsulated; it can be accessed by the following functions. {\tt show\_ptyps} retrieves all leaves of the hierarchy (here in an early version for testing):
+{\footnotesize\begin{verbatim}
+   ML> show_ptyps;
+   val it = fn : unit -> unit
+   ML> show_ptyps();
+   [
+    ["e_pblID"],
+    ["equation", "univariate", "linear"],
+    ["equation", "univariate", "plain_square"],
+    ["equation", "univariate", "polynomial", "degree_two", "pq_formula"],
+    ["equation", "univariate", "polynomial", "degree_two", "abc_formula"],
+    ["equation", "univariate", "squareroot"],
+    ["equation", "univariate", "normalize"],
+    ["equation", "univariate", "sqroot-test"],
+    ["function", "derivative_of"],
+    ["function", "maximum_of", "on_interval"],
+    ["function", "make"],
+    ["tool", "find_values"],
+    ["functional", "inssort"]
+   ]
+   val it = () : unit
+\end{verbatim}}%size
+The retrieve function for individual problem types is {\tt get\_pbt}
+\footnote{A function providing better readable output is in preparation}. Note that its argument, the 'problem identifier' {\tt pblID}, has the strings listed in reverse order w.r.t. the hierarchy, i.e. from the leave to the root. This order makes the {\tt pblID} closer to a natural description:
+{\footnotesize\begin{verbatim}
+   ML> get_pbt;
+   val it = fn : pblID -> pbt
+   ML> get_pbt ["squareroot", "univariate", "equation"];
+   val it =
+     {met=[("SqRoot.thy","square_equation")],
+      ppc=[("#Given",(Const (#,#),Free (#,#))),
+           ("#Given",(Const (#,#),Free (#,#))),
+           ("#Given",(Const (#,#),Free (#,#))),
+           ("#Find",(Const (#,#),Free (#,#)))],
+      thy={ProtoPure, CPure, HOL, Ord, Set, subset, equalities, mono, Vimage, Fun,
+            Prod, Lfp, Relation, Trancl, WF, NatDef, Gfp, Sum, Inductive, Nat,
+            Arith, Divides, Power, Finite, Equiv, IntDef, Int, Univ, Datatype,
+            Numeral, Bin, IntArith, WF_Rel, Recdef, IntDiv, NatBin, List, Option,
+            Map, Record, RelPow, Sexp, String, Calculation, SVC_Oracle, Main,
+            Zorn, Filter, PNat, PRat, PReal, RealDef, RealOrd, RealInt, RealBin,
+            HyperDef, Descript, ListG, Tools, Script, Typefix, Atools, RatArith,
+            SqRoot},
+      where_=[Const ("SqRoot.contains'_root","bool => bool") $
+              Free ("e_","bool")]} : pbt
+\end{verbatim}}%size %$
+where the records fields hold the following data:
+\begin{description}
+\item [\tt thy]: the theory necessary for parsing the formulas
+\item [\tt ppc]: the items of the problem type, divided into those {\tt Given}, the precondition {\tt Where} and the output item(s) {\tt Find}. The items of {\tt Given} and {\tt Find} are all headed by so-called descriptions, which determine the type. These descriptions are defined in {\tt [isac-src]/Isa99/Descript.thy}.
+\item [\tt met]: the list of methods solving this problem type.\\
+\end{description}
+
+The following function adds or replaces a problem type (after having it prepared using {\tt prep\_pbt})
+{\footnotesize\begin{verbatim}
+   ML> store_pbt;
+   val it = fn : pbt * pblID -> unit
+   ML> store_pbt
+    (prep_pbt SqRoot.thy
+    (["newtype","univariate","equation"],
+     [("#Given" ,["equality e_","solveFor v_","errorBound err_"]),
+      ("#Where" ,["contains_root (e_::bool)"]),
+      ("#Find"  ,["solutions v_i_"])
+     ],
+     [("SqRoot.thy","square_equation")]));
+   val it = () : unit
+\end{verbatim}}%size
+When adding a new type with argument {\tt pblID}, an immediate parent must already exist in the hierarchy (this is the one with the tail of {\tt pblID}).
+
+\section{Internals of the datastructure}
+This subsection only serves for the implementation of the hierarchy browser and can be skipped by the authors of math knowledge.
+
+A problem type is described by the following record type (in the file {\tt [isac-src]/globals.sml}, the respective functions are in {\tt [isac-src]/ME/ptyps.sml}), and held in a global reference variable:
+{\footnotesize\begin{verbatim}
+   type pbt = 
+        {thy   : theory,       (* the nearest to the root,
+                                  which allows to compile that pbt  *)
+         where_: term list,    (* where - predicates                *)
+         ppc   : ((string *    (* fields "#Given","#Find"           *)
+                   (term *     (* description                       *)
+                    term))     (* id                                *)
+                      list),                                        
+         met   : metID list};  (* methods solving the pbt           *)
+   datatype ptyp = 
+            Ptyp of string *   (* key within pblID                  *)
+                    pbt list * (* several pbts with different domIDs*)
+                    ptyp list;
+   val e_Ptyp = Ptyp ("empty",[],[]);
+   
+   type ptyps = ptyp list;
+   val ptyps = ref ([e_Ptyp]:ptyps);
+\end{verbatim}}%size
+The predicates in {\tt where\_} (i.e. the preconditions) usually are defined in the respective theory in {\tt[isac-src]/knowledge}. Most of the predicates are not defined by rewriting, but by SML-code contained in the respective {\tt *.ML} file.
+
+Each item is headed by a so-called description which provides some guidance for interactive input. The descriptions are defined in {\tt[isac-src]/Isa99/Descript.thy}.
+
+
+
+\section{Match a formalization with a problem type}\label{pbl}
+A formalization is {\it match}ed with a problem type which yields a problem. A formal description of this kind of {\it match}ing can be found in \\{\tt ftp://ft.ist.tugraz.at/projects/isac/publ/calculemus01.ps.gz}. A formalization of an equation is e.g.
+{\footnotesize\begin{verbatim}
+   ML> val fmz = ["equality (#1 + #2 * x = #0)",
+                  "solveFor x",
+                  "solutions L"] : fmz;
+   val fmz = ["equality (#1 + #2 * x = #0)","solveFor x","solutions L"] : fmz
+\end{verbatim}}%size
+Given a formalization (and a specification of the problem, i.e. a theory, a problemtype, and a method) \isac{} can solve the respective problem automatically. The formalization must match the problem type for this purpose:
+{\footnotesize\begin{verbatim}
+   ML> match_pbl;
+   val it = fn : fmz -> pbt -> match'
+   ML>
+   ML> match_pbl fmz (get_pbt ["univariate","equation"]);
+   val it =
+     Matches'
+       {Find=[Correct "solutions L"],
+        Given=[Correct "equality (#1 + #2 * x = #0)",Correct "solveFor x"],
+        Relate=[],Where=[Correct "matches (?a = ?b) (#1 + #2 * x = #0)"],With=[]}
+     : match'
+   ML>
+   ML> match_pbl fmz (get_pbt ["linear","univariate","equation"]);
+   val it =
+     Matches'
+       {Find=[Correct "solutions L"],
+        Given=[Correct "equality (#1 + #2 * x = #0)",Correct "solveFor x"],
+        Relate=[],
+        Where=[Correct
+                 "matches (          x = #0) (#1 + #2 * x = #0) |
+                  matches (     ?b * x = #0) (#1 + #2 * x = #0) |
+                  matches (?a      + x = #0) (#1 + #2 * x = #0) |
+                  matches (?a + ?b * x = #0) (#1 + #2 * x = #0)"],
+        With=[]} : match'
+   ML>
+   ML> match_pbl fmz (get_pbt ["squareroot","univariate","equation"]);
+   val it =
+     NoMatch'
+       {Find=[Correct "solutions L"],
+        Given=[Correct "equality (#1 + #2 * x = #0)",Correct "solveFor x",
+               Missing "errorBound err_"],Relate=[],
+        Where=[False "contains_root #1 + #2 * x = #0 "],With=[]} : match'
+\end{verbatim}}%size
+The above formalization does not match the problem type \\{\tt["squareroot","univariate","equation"]} which is explained by the tags:
+\begin{tabbing}
+123\=\kill
+\> {\tt Missing:} the item is missing in the formalization as required by the problem type\\
+\> {\tt Superfl:} the item is not required by the problem type\\
+\> {\tt Correct:} the item is correct, or the precondition ({\tt Where}) is true\\
+\> {\tt False:} the precondition ({\tt Where}) is false\\
+\> {\tt Incompl:} the item is incomlete, or not yet input.\\
+\end{tabbing}
+
+
+
+\section{Refine a problem specification}
+The challenge in constructing the problem hierarchy is, to design the branches in such a way, that problem refinement can be done automatically (as it is done in algebra system e.g. by a internal hierarchy of equations).
+
+For this purpose the hierarchy must be built using the following rules: Let $F$ be a formalization and $P$ and $P_i,\:i=1\cdots n$ problem types, where the $P_i$ are specialized problem types w.r.t. $P$ (i.e. $P$ is a parent node of $P_i$), then
+{\small
+\begin{enumerate}
+\item for all $F$ matching some $P_i$ must follow, that $F$ matches $P$
+\item an $F$ matching $P$ should not have more than {\em one} $P_i,\:i=1\cdots n-1$ with $F$ matching $P_i$ (if there are more than one $P_i$, the first one will be taken)
+\item for all $F$ matching some $P$ must follow, that $F$ matches $P_n$\\
+\end{enumerate}}%small
+\noindent Let us give an example for the point (1.) and (2.) first:
+{\footnotesize\begin{verbatim}
+   ML> refine;
+   val it = fn : fmz -> pblID -> match list
+   ML>
+   ML> val fmz = ["equality (sqrt(#9+#4*x)=sqrt x + sqrt(#5+x))",
+              "solveFor x","errorBound (eps=#0)",
+              "solutions L"];
+   ML>
+   ML> refine fmz ["univariate","equation"];
+   *** pass ["equation","univariate"]
+   *** pass ["equation","univariate","linear"]
+   *** pass ["equation","univariate","plain_square"]
+   *** pass ["equation","univariate","polynomial"]
+   *** pass ["equation","univariate","squareroot"]
+   val it =
+     [Matches
+        (["univariate","equation"],
+         {Find=[Correct "solutions L"],
+          Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))",
+                 Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[],
+          Where=[Correct
+                   "matches (?a = ?b) (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))"],
+          With=[]}),
+      NoMatch
+        (["linear","univariate","equation"],
+         {Find=[Correct "solutions L"],
+          Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))",
+                 Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[],
+          Where=[False "(?a + ?b * x = #0) (sqrt (#9 + #4 * x#"],
+          With=[]}),
+      NoMatch
+        (["plain_square","univariate","equation"],
+         {Find=[Correct "solutions L"],
+          Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))",
+                 Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[],
+          Where=[False
+                   "matches (?a + ?b * x ^^^ #2 = #0)"],
+          With=[]}),
+      NoMatch
+        (["polynomial","univariate","equation"],
+         {Find=[Correct "solutions L"],
+          Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))",
+                 Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[],
+          Where=[False 
+                 "is_polynomial_in sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x) x"],
+          With=[]}),
+      Matches
+        (["squareroot","univariate","equation"],
+         {Find=[Correct "solutions L"],
+          Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))",
+                 Correct "solveFor x",Correct "errorBound (eps = #0)"],Relate=[],
+          Where=[Correct
+                   "contains_root sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x) "],
+          With=[]})] : match list
+\end{verbatim}}%size}%footnotesize\label{refine}
+This example shows, that in order to refine an {\tt["univariate","equation"]}, the formalization must match respective respective problem type (rule (1.)) and one of the descendants which should match selectively (rule (2.)).
+
+If no one of the descendants of {\tt["univariate","equation"]} match, rule (3.) comes into play: The {\em last} problem type on this level ($P_n$) provides for a special 'problem type' {\tt["normalize"]}. This node calls a method transforming the equation to a (or another) normal form, which then may match. Look at this example:
+{\footnotesize\begin{verbatim}
+   ML>  val fmz = ["equality (x+#1=#2)",
+               "solveFor x","errorBound (eps=#0)",
+               "solutions L"];
+   [...]
+   ML>
+   ML>  refine fmz ["univariate","equation"];
+   *** pass ["equation","univariate"]
+   *** pass ["equation","univariate","linear"]
+   *** pass ["equation","univariate","plain_square"]
+   *** pass ["equation","univariate","polynomial"]
+   *** pass ["equation","univariate","squareroot"]
+   *** pass ["equation","univariate","normalize"]
+   val it =
+     [Matches
+        (["univariate","equation"],
+         {Find=[Correct "solutions L"],
+          Given=[Correct "equality (x + #1 = #2)",Correct "solveFor x",
+                 Superfl "errorBound (eps = #0)"],Relate=[],
+          Where=[Correct "matches (?a = ?b) (x + #1 = #2)"],With=[]}),
+      NoMatch
+        (["linear","univariate","equation"],
+   [...]
+          With=[]}),
+      NoMatch
+        (["squareroot","univariate","equation"],
+         {Find=[Correct "solutions L"],
+          Given=[Correct "equality (x + #1 = #2)",Correct "solveFor x",
+                 Correct "errorBound (eps = #0)"],Relate=[],
+          Where=[False "contains_root x + #1 = #2 "],With=[]}),
+      Matches
+        (["normalize","univariate","equation"],
+         {Find=[Correct "solutions L"],
+          Given=[Correct "equality (x + #1 = #2)",Correct "solveFor x",
+                 Superfl "errorBound (eps = #0)"],Relate=[],Where=[],With=[]})]
+     : match list
+\end{verbatim}}%size
+The problem type $P_n$, {\tt["normalize","univariate","equation"]}, will transform the equation {\tt x + \#1 = \#2} to the normal form {\tt \#-1 + x = \#0}, which then will match {\tt["linear","univariate","equation"]}.
+
+This recursive search on the problem hierarchy can be  done within a proof state. This leads to the next section.
+
+
+\chapter{Methods}\label{met}
+A problem type can have one ore more methods solving a respective problem. A method is described by means of another new program language. The language itself looks like a simple functional language, but constructs an imperative proof-state behind the scenes (thus liberating the programer from dealing with technical details and also prohibiting incorrect construction of the proof tree). The interpreter of 'scripts' written in this language evaluates the scriptexpressions, and also delivers certain parts of the script itself for discussion with the user.
+
+\section{The scripts' syntax}
+The syntax of scripts follows the definition given in Backus-normal-form:
+{\it
+\begin{tabbing}
+123\=123\=expr ::=\=$|\;\;$\=\kill
+\>script ::= {\tt Script} id arg$\,^*$ = body\\
+\>\>arg ::= id $\;|\;\;($ ( id :: type ) $)$\\
+\>\>body ::= expr\\
+\>\>expr ::= \>\>{\tt let} id = expr $($ ; id = expr$)^*$ {\tt in} expr\\
+\>\>\>$|\;$\>{\tt if} prop {\tt then} expr {\tt else} expr\\
+\>\>\>$|\;$\>listexpr\\
+\>\>\>$|\;$\>id\\
+\>\>\>$|\;$\>seqex id\\
+\>\>seqex ::= \>\>{\tt While} prop {\tt Do} seqex\\
+\>\>\>$|\;$\>{\tt Repeat} seqex\\
+\>\>\>$|\;$\>{\tt Try} seqex\\
+\>\>\>$|\;$\>seqex {\tt Or} seqex\\
+\>\>\>$|\;$\>seqex {\tt @@} seqex\\
+\>\>\>$|\;$\>tac $($ id $|$ listexpr $)^*$\\
+\>\>type ::= id\\
+\>\>tac ::= id
+\end{tabbing}}
+where {\it id} is an identifier with the usual syntax, {\it prop} is a proposition constructed by Isabelles logical operators (see \cite{Isa-obj} {\tt [isabelle]/src/HOL/HOL.thy}), {\it listexpr} (called {\bf list-expression}) is constructed by Isabelles list functions like {\tt hd, tl, nth} described in {\tt [isabelle]/src/HOL/List.thy}, and {\it type} are (virtually) all types declared in Isabelles version 99.
+
+Expressions containing some of the keywords {\tt let}, {\tt if} etc. are called {\bf script-expressions}.
+
+Tactics {\it tac} are (curried) functions. For clarity and simplicity reasons, {\it listexpr} must not contain a {\it tac}, and {\it tac}s must not be nested,
+
+
+\section{Control the flow of evaluation}
+The flow of control is managed by the following script-expressions called {\it tacticals}.
+\begin{description}
+\item{{\tt while} prop {\tt Do} expr id} 
+\item{{\tt if} prop {\tt then} expr {\tt else} expr}
+\end{description}
+While the the above script-expressions trigger the flow of control by evaluating the current formula, the other expressions depend on the applicability of the tactics within their respective subexpressions (which in turn depends on the proofstate)
+\begin{description}
+\item{{\tt Repeat} expr id}
+\item{{\tt Try} expr id}
+\item{expr {\tt Or} expr id}
+\item{expr {\tt @@} expr id}
+\end{description}
+
+\begin{description}
+\item xxx
+
+\end{description}
+
+\chapter{Do a calculational proof}
+First we list all the tactics available so far (this list may be extended during further development of \isac).
+
+\section{Tactics for doing steps in calculations}
+\input{tactics}
+
+\section{The functionality of the math engine}
+A proof is being started in the math engine {\tt me} by the tactic
+\footnote{In the present version a tactic is of type {\tt mstep}.}
+ {\tt Init\_Proof}, and interactively promoted by other tactics. On input of each tactic the {\tt me} returns the resulting formula and the next tactic applicable. The proof is finished, when the {\tt me} proposes {\tt End\_Proof} as the next tactic.
+
+We show a calculation (calculational proof) concerning equation solving, where the type of equation is refined automatically: The equation is given by the respective formalization ...
+{\footnotesize\begin{verbatim}
+   ML> val fmz = ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x",
+                  "errorBound (eps=#0)","solutions L"];
+   val fmz =
+     ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)",
+      "solutions L"] : string list
+   ML>
+   ML> val spec as (dom, pbt, met) = ("SqRoot.thy",["univariate","equation"],
+                                 ("SqRoot.thy","no_met"));
+   val dom = "SqRoot.thy" : string
+   val pbt = ["univariate","equation"] : string list
+   val met = ("SqRoot.thy","no_met") : string * string
+\end{verbatim}}%size
+... and the specification {\tt spec} of a domain {\tt dom}, a problem type {\tt pbt} and a method {\tt met}. Note that the equation is such, that it is not immediatly clear, what type it is in particular (it could be a polynomial of degree 2; but, for sure, the type is some specialized type of a univariate equation). Thus, no method ({\tt no\_met}) can be specified for solving the problem.
+
+Nevertheless this specification is sufficient for automatically solving the equation --- the appropriate method will be found by refinement within the hierarchy of problem types.
+
+
+\section{Initialize the calculation}
+The start of a new proof requires the following initializations: The proof state is given by a proof tree {\tt ptree} and a position {\tt pos'}; both are empty at the beginning. The tactic {\tt Init\_Proof} is, like all other tactics, paired with an identifier of type {\tt string} for technical reasons.
+{\footnotesize\begin{verbatim}
+   ML>  val (mID,m) = ("Init_Proof",Init_Proof (fmz, (dom,pbt,met)));
+   val mID = "Init_Proof" : string
+   val m =
+     Init_Proof
+       (["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)",
+         "solutions L"],("SqRoot.thy",[#,#],(#,#))) : mstep
+   ML>
+   ML>  val (p,_,f,nxt,_,pt) = me (mID,m) e_pos' c EmptyPtree;
+   val p = ([],Pbl) : pos'
+   val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout
+   val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])
+     : string * mstep
+   val pt =
+     Nd
+       (PblObj
+          {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#,
+           result=#,spec=#},[]) : ptree
+   \end{verbatim}}%size
+The mathematics engine {\tt me} returns the resulting formula {\tt f} of type {\tt mout} (which in this case is a problem), the next tactic {\tt nxt}, and a new proof state ({\tt ptree}, {\tt pos'}).
+
+We can convince ourselves, that the problem is still empty, by increasing {\tt Compiler.Control.Print.printDepth}:
+{\footnotesize\begin{verbatim}
+   ML> Compiler.Control.Print.printDepth:=8; (*4 default*)
+   val it = () : unit
+   ML>
+   ML> f;
+   val it =
+     Form'
+       (PpcKF
+          (0,EdUndef,0,Nundef,
+           (Problem [],
+            {Find=[Incompl "solutions []"],
+             Given=[Incompl "equality",Incompl "solveFor"],Relate=[],
+             Where=[False "matches (?a = ?b) e_"],With=[]}))) : mout
+\end{verbatim}}%size
+Recall, please, the format of a problem as presented in sect.\ref{pbl} on p.\pageref{pbl}; such an 'empty' problem can be found above encapsulated by several constructors containing additional data (necessary for the dialog guide, not relevant here).\\
+
+{\it In the sequel we will omit output of the {\tt me} if it is not important for the respective context}.\\
+
+In general, the dialog guide will hide the following two tactics {\tt Refine\_Tacitly} and {\tt Model\_Problem} from the user.
+{\footnotesize\begin{verbatim}
+   ML>  nxt;
+   val it = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])
+     : string * mstep
+   ML>
+   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val nxt = ("Model_Problem",Model_Problem ["normalize","univariate","equation"])
+     : string * mstep
+   ML>
+   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+\end{verbatim}}%size
+
+
+\section{The phase of modeling} 
+comprises the input of the items of the problem; the {\tt me} can help by use of the formalization tacitly transferred by {\tt Init\_Proof}. In particular, the {\tt me} in general 'knows' the next promising tactic; the first one has been returned by the (hidden) tactic {\tt Model\_Problem}.
+
+{\footnotesize\begin{verbatim}
+   ML>  nxt;
+   val it =
+     ("Add_Given",Add_Given "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)")
+     : string * mstep
+   ML>
+   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val nxt = ("Add_Given",Add_Given "solveFor x") : string * mstep
+   ML>
+   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val nxt = ("Add_Find",Add_Find "solutions L") : string * mstep
+   ML>
+   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt; 
+   val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout
+\end{verbatim}}%size
+\noindent Now the problem is 'modeled', all items are input. We convince ourselves by increasing {\tt Compiler.Control.Print.printDepth} once more.
+{\footnotesize\begin{verbatim}
+   ML>  Compiler.Control.Print.printDepth:=8;
+   ML>  f;
+   val it =
+     Form'
+       (PpcKF
+          (0,EdUndef,0,Nundef,
+           (Problem [],
+            {Find=[Correct "solutions L"],
+             Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
+                    Correct "solveFor x"],Relate=[],Where=[],With=[]}))) : mout
+\end{verbatim}}%size
+%One of the input items is considered {\tt Superfluous} by the {\tt me} consulting the problem type {\tt ["univariate","equation"]}. The {\tt ErrorBound}, however, could become important in case the equation only could be solved by some iteration method.
+
+\section{The phase of specification} 
+This phase provides for explicit determination of the domain, the problem type, and the method to be used. In particular, the search for the appropriate problem type is being supported. There are two tactics for this purpose: {\tt Specify\_Problem} generates feedback on how a candidate of a problem type matches the current problem, and {\tt Refine\_Problem} provides help by the system, if the user gets lost.
+{\footnotesize\begin{verbatim}
+ML> nxt;
+   val it = ("Specify_Domain",Specify_Domain "SqRoot.thy") : string * mstep
+   ML>
+   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val nxt =
+     ("Specify_Problem",Specify_Problem ["normalize","univariate","equation"])
+     : string * mstep
+   val pt =
+     Nd
+       (PblObj
+          {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#,
+              result=#,spec=#},[]) : ptree
+\end{verbatim}}%size
+The {\tt me} is smart enough to know the appropriate problem type (transferred tacitly with {\tt Init\_Proof}). In order to challenge the student, the dialog guide may hide this information; then the {\tt me} works as follows.
+{\footnotesize\begin{verbatim}
+   ML> val nxt = ("Specify_Problem",
+               Specify_Problem ["polynomial","univariate","equation"]);
+   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout
+   val nxt =
+     ("Refine_Problem",Refine_Problem ["normalize","univariate","equation"])
+     : string * mstep
+   ML>
+   ML> val nxt = ("Specify_Problem",
+               Specify_Problem ["linear","univariate","equation"]);
+   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val f =
+     Form'
+       (PpcKF
+          (0,EdUndef,0,Nundef,
+           (Problem ["linear","univariate","equation"],
+            {Find=[Correct "solutions L"],
+             Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
+                    Correct "solveFor x"],Relate=[],
+             Where=[False
+                    "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
+             With=[]}))) : mout 
+\end{verbatim}}%size
+Again assuming that the dialog guide hide the next tactic proposed by the {\tt me}, and the student gets lost, {\tt Refine\_Problem} always 'knows' the way out, if applied to the problem type {\tt["univariate","equation"]}.
+{\footnotesize\begin{verbatim}
+   ML> val nxt = ("Refine_Problem",
+                  Refine_Problem ["linear","univariate","equation
+   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val f = Problems (RefinedKF [NoMatch #]) : mout
+   ML>
+   ML>  Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4;
+   val f =
+     Problems
+       (RefinedKF
+          [NoMatch
+             (["linear","univariate","equation"],
+              {Find=[Correct "solutions L"],
+               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
+                      Correct "solveFor x"],Relate=[],
+               Where=[False
+                     "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
+               With=[]})]) : mout
+   ML>
+   ML> val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation"]);
+   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val f =
+     Problems
+       (RefinedKF [Matches #,NoMatch #,NoMatch #,NoMatch #,NoMatch #,Matches #])
+     : mout
+   ML>
+   ML>
+   ML>  Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4;
+   val f =
+     Problems
+       (RefinedKF
+          [Matches
+             (["univariate","equation"],
+              {Find=[Correct "solutions L"],
+               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
+                      Correct "solveFor x"],Relate=[],
+               Where=[Correct
+               With=[]}),
+           NoMatch
+             (["linear","univariate","equation"],
+              {Find=[Correct "solutions L"],
+               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
+                      Correct "solveFor x"],Relate=[],
+               Where=[False
+                      "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
+                  With=[]}),
+           NoMatch
+             ...
+             ...   
+           Matches
+             (["normalize","univariate","equation"],
+              {Find=[Correct "solutions L"],
+               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
+                      Correct "solveFor x"],Relate=[],Where=[],With=[]})]) : mout
+\end{verbatim}}%size
+The tactic {\tt Refine\_Problem} returns all matches to problem types along the path traced in the problem hierarchy (anlogously to the authoring tool for refinement in sect.\ref{refine} on p.\pageref{refine}) --- a lot of information to be displayed appropriately in the hiearchy browser~!
+
+\section{The phase of solving} 
+This phase starts by invoking a method, which acchieves the normal form within two tactics, {\tt Rewrite rnorm\_equation\_add} and {\tt Rewrite\_Set SqRoot\_simplify}:
+{\footnotesize\begin{verbatim} 
+   ML> nxt;
+   val it = ("Apply_Method",Apply_Method ("SqRoot.thy","norm_univar_equation"))
+     : string * mstep
+   ML>
+   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val f =
+     Form' (FormKF (~1,EdUndef,1,Nundef,"(x + #1) * (x + #2) = x ^^^ #2 + #8"))
+   val nxt =
+     ("Rewrite", Rewrite
+        ("rnorm_equation_add","~ ?b =!= #0 ==> (?a = ?b) = (?a + #-1 * ?b = #0)"))
+   ML>
+   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val f =
+     Form' (FormKF (~1,EdUndef,1,Nundef,
+           "(x + #1) * (x + #2) + #-1 * (x ^^^ #2 + #8) = #0")) : mout
+   val nxt = ("Rewrite_Set",Rewrite_Set "SqRoot_simplify") : string * mstep
+   ML>
+   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val f = Form' (FormKF (~1,EdUndef,1,Nundef,"#-6 + #3 * x = #0")) : mout
+   val nxt = ("Subproblem",Subproblem ("SqRoot.thy",[#,#])) : string * mstep
+\end{verbatim}}%size
+Now the normal form {\tt \#-6 + \#3 * x = \#0} is the input to a subproblem, which again allows for specification of the type of equation, and the respective method:
+{\footnotesize\begin{verbatim}
+   ML> nxt;
+   val it = ("Subproblem",Subproblem ("SqRoot.thy",["univariate","equation"]))
+   ML>   
+   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val f =
+     Form' (FormKF
+          (~1,EdUndef,1,Nundef,"Subproblem (SqRoot.thy, [univariate, equation])"))
+     : mout
+   val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])
+   ML>
+   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val nxt = ("Model_Problem",Model_Problem ["linear","univariate","equation"])
+\end{verbatim}}%size
+As required, the tactic {\tt Refine ["univariate","equation"]} selects the appropriate type of equation from the problem hierarchy, which can be seen by the tactic {\tt Model\_Problem ["linear","univariate","equation"]} prosed by the system.
+
+Again the whole phase of modeling and specification follows; we skip it here, and \isac's dialog guide may decide to do so as well.
+
+
+\section{The final phase: check the post-condition}
+The type of problems solved by \isac{} are so-called 'example construction problems' as shown above. The most characteristic point of such a problem is the post-condition. The handling of the post-condition in the given context is an open research question.
+
+Thus the post-condition is just mentioned, in our example for both, the problem and the subproblem:
+{\footnotesize\begin{verbatim}
+   ML> nxt;
+   val it = ("Check_Postcond",Check_Postcond ["linear","univariate","equation"])
+   ML>
+   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val f = Form' (FormKF (~1,EdUndef,1,Nundef,"[x = #2]")) : mout
+   val nxt =
+     ("Check_Postcond",Check_Postcond ["normalize","univariate","equation"])
+   ML>
+   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
+   val f = Form' (FormKF (~1,EdUndef,0,Nundef,"[x = #2]")) : mout
+   val nxt = ("End_Proof'",End_Proof') : string * mstep
+\end{verbatim}}%size
+The next tactic proposed by the system, {\tt End\_Proof'} indicates that the proof has finished successfully.\\
+
+{\it The tactics proposed by the system need {\em not} be followed by the user; the user is free to choose other tactics, and the system will report, if this is applicable at the respective proof state, or not~! The reader may try out~!}
+
+
+
+\part{Systematic description}
+
+
+\chapter{The structure of the knowledge base}
+
+\section{Tactics and data}
+First we view the ME from outside, i.e. we regard tactics and relate them to the knowledge base (KB). W.r.t. the KB we address the atomic items which have to be implemented in detail by the authors of the KB
+\footnote{Some of these items are fetched by the tactics from intermediate storage within the ME, and not directly from the KB.}
+. The items are listed in alphabetical order in Tab.\ref{kb-items} on p.\pageref{kb-items}.
+{\begin{table}[h]
+\caption{Atomic items of the KB} \label{kb-items}
+%\tabcolsep=0.3mm
+\begin{center}
+\def\arraystretch{1.0}
+\begin{tabular}{lp{9.0cm}}
+abbrevation & description \\
+\hline
+&\\
+{\it calc\_list}
+& associationlist of the evaluation-functions {\it eval\_fn}\\
+{\it eval\_fn}
+& evaluation-function for numerals and for predicates coded in SML\\
+{\it eval\_rls   }
+& ruleset {\it rls} for simplifying expressions with {\it eval\_fn}s\\
+{\it fmz}
+& formalization, i.e. a minimal formula representation of an example \\
+{\it met}
+& a method, i.e. a datastructure holding all informations for the solving phase ({\it rew\_ord}, {\it scr}, etc.)\\
+{\it metID}
+& reference to a {\it met}\\
+{\it op}
+& operator as key to an {\it eval\_fn} in a {\it calc\_list}\\
+{\it pbl}
+& problem, i.e. a node in the problem-hierarchy\\
+{\it pblID}
+& reference to a {\it pbl}\\
+{\it rew\_ord}
+& rewrite-order\\
+{\it rls}
+& ruleset, i.e. a datastructure holding theorems {\it thm} and operators {\it op} for simplification (with a {\it rew\_ord})\\
+{\it Rrls}
+& ruleset for 'reverse rewriting' (an \isac-technique generating stepwise rewriting, e.g. for cancelling fractions)\\
+{\it scr}
+& script describing algorithms by tactics, part of a {\it met} \\
+{\it norm\_rls}
+& special ruleset calculating a normalform, associated with a {\it thy}\\
+{\it spec}
+& specification, i.e. a tripel ({\it thyID, pblID, metID})\\
+{\it subs}
+& substitution, i.e. a list of variable-value-pairs\\
+{\it term}
+& Isabelle term, i.e. a formula\\
+{\it thm}
+& theorem\\     
+{\it thy}
+& theory\\
+{\it thyID}
+& reference to a {\it thy} \\
+\end{tabular}\end{center}\end{table}
+}
+The relations between tactics and data items are shown in Tab.\ref{tac-kb}on p.\pageref{tac-kb}.
+{\def\arraystretch{1.2}
+\begin{table}[h]
+\caption{Which tactic uses which KB's item~?} \label{tac-kb}
+\tabcolsep=0.3mm
+\begin{center}
+\begin{tabular}{|ll||cccc|ccc|cccc|} \hline
+tactic  &input &    &    &    &norm\_&   &rew\_&rls &eval\_&eval\_&calc\_&   \\
+        &      &thy &scr &Rrls&rls  &thm &ord  &Rrls&fn    &rls   &list  &dsc\\
+\hline\hline
+Init\_Proof
+        &fmz   & x  &    &    & x   &    &     &    &      &      &      & x \\
+        &spec  &    &    &    &     &    &     &    &      &      &      &   \\
+\hline
+\multicolumn{13}{|l|}{model phase}\\
+\hline
+Add\_*  &term  & x  &    &    & x   &    &     &    &      &      &      & x \\
+FormFK  &model & x  &    &    & x   &    &     &    &      &      &      & x \\
+\hline
+\multicolumn{13}{|l|}{specify phase}\\
+\hline
+Specify\_Theory 
+        &thyID & x  &    &    & x   &    &     &    & x    & x    &      & x \\
+Specify\_Problem 
+        &pblID & x  &    &    & x   &    &     &    & x    & x    &      & x \\
+Refine\_Problem 
+           &pblID & x  &    &    & x   &    &     &    & x    & x    &      & x \\
+Specify\_Method 
+        &metID & x  &    &    & x   &    &     &    & x    & x    &      & x \\
+Apply\_Method 
+        &metID & x  & x  &    & x   &    &     &    & x    & x    &      & x \\
+\hline
+\multicolumn{13}{|l|}{solve phase}\\
+\hline
+Rewrite,\_Inst 
+        &thm   & x  & x  &    &     & x  &met  &    & x    &met   &      &   \\
+Rewrite, Detail
+        &thm   & x  & x  &    &     & x  &rls  &    & x    &rls   &      &   \\
+Rewrite, Detail
+        &thm   & x  & x  &    &     & x  &Rrls &    & x    &Rrls  &      &   \\
+Rewrite\_Set,\_Inst
+        &rls   & x  & x  &    &     &    &     & x  & x    & x    &      &   \\
+Calculate  
+        &op    & x  & x  &    &     &    &     &    &      &      & x    &   \\
+Substitute 
+        &subs  & x  &    &    & x   &    &     &    &      &      &      &   \\
+        &      &    &    &    &     &    &     &    &      &      &      &   \\
+SubProblem 
+        &spec  & x  & x  &    & x   &    &     &    & x    & x    &      & x \\
+        &fmz   &    &    &    &     &    &     &    &      &      &      &   \\
+\hline
+\end{tabular}\end{center}\end{table}
+}
+
+\section{\isac's theories}
+\isac's theories build upon Isabelles theories for high-order-logic (HOL) up to the respective development of real numbers ({\tt HOL/Real}). Theories have a special format defined in \cite{Isa-ref} and the suffix {\tt *.thy}; usually theories are paired with SML-files having the same filename and the suffix {\tt *.ML}.
+
+\isac's theories represent the deductive part of \isac's knowledge base, the hierarchy of theories is structured accordingly. The {\tt *.ML}-files, however, contain {\em all} data of the other two axes of the knowledge base, the problems and the methods (without presenting their respective structure, which is done by the problem browser and the method browser, see \ref{pbt}).
+
+Tab.\ref{theories} on p.\pageref{theories} lists the basic theories planned to be implemented in version \isac.1. We expext the list to be expanded in the near future, actually, have a look to the theory browser~!
+
+The first three theories in the list do {\em not} belong to \isac's knowledge base; they are concerned with \isac's script-language for methods and listed here for completeness.
+{\begin{table}[h]
+\caption{Theories in \isac-version I} \label{theories}
+%\tabcolsep=0.3mm
+\begin{center}
+\def\arraystretch{1.0}
+\begin{tabular}{lp{9.0cm}}
+theory & description \\
+\hline
+&\\
+ListI.thy
+& assigns identifiers to the functions defined in {\tt Isabelle2002/src/HOL/List.thy} and (intermediatly~?) defines some more list functions\\
+ListI.ML
+& {\tt eval\_fn} for the additional list functions\\
+Tools.thy
+& functions required for the evaluation of scripts\\
+Tools.ML
+& the respective {\tt eval\_fn}s\\
+Script.thy
+& prerequisites for scripts: types, tactics, tacticals,\\
+Script.ML
+& sets of tactics and functions for internal use\\
+& \\
+\hline
+& \\
+Typefix.thy
+& an intermediate hack for escaping type errors\\
+Descript.thy
+& {\it description}s for the formulas in {\it model}s and {\it problem}s\\
+Atools
+& (re-)definition of operators; general predicates and functions for preconditions; theorems for the {\tt eval\_rls}\\
+Float
+& floating point numerals\\
+Equation
+& basic notions for equations and equational systems\\
+Poly
+& polynomials\\
+PolyEq
+& polynomial equations and equational systems \\
+Rational.thy
+& additional theorems for rationals\\
+Rational.ML
+& cancel, add and simplify rationals using (a generalization of) Euclids algorithm; respective reverse rulesets\\
+RatEq
+& equations on rationals\\
+Root
+& radicals; calculate normalform; respective reverse rulesets\\
+RootEq
+& equations on roots\\
+RatRootEq
+& equations on rationals and roots (i.e. on terms containing both operations)\\
+Vect
+& vector analysis\\
+Trig
+& trigonometriy\\
+LogExp
+& logarithms and exponential functions\\
+Calculus
+& nonstandard analysis\\
+Diff
+& differentiation\\
+DiffApp
+& applications of differentiaten (maxima-minima-problems)\\
+Test
+& (old) data for the test suite\\
+Isac
+& collects all \isac-theoris.\\
+\end{tabular}\end{center}\end{table}
+}
+
+
+\section{Data in {\tt *.thy}- and {\tt *.ML}-files}
+As already mentioned, theories come in pairs of {\tt *.thy}- and {\tt *.ML}-files with the same respective filename. How data are distributed between the two files is shown in Tab.\ref{thy-ML} on p.\pageref{thy-ML}.
+{\begin{table}[h]
+\caption{Data in {\tt *.thy}- and {\tt *.ML}-files} \label{thy-ML}
+\tabcolsep=2.0mm
+\begin{center}
+\def\arraystretch{1.0}
+\begin{tabular}{llp{7.7cm}}
+file & data & description \\
+\hline
+& &\\
+{\tt *.thy}
+& consts 
+& operators, predicates, functions, script-names ('{\tt Script} name \dots{\tt arguments}')
+\\
+& rules  
+& theorems: \isac{} uses Isabelles theorems if possible; additional theorems analoguous to such existing in Isabelle get the Isabelle-identifier attached an {\it I}
+\\& &\\
+{\tt *.ML}
+& {\tt theory' :=} 
+& the theory defined by the actual {\tt *.thy}-file is made accessible to \isac
+\\
+& {\tt eval\_fn}
+& evaluation function for operators and predicates, coded on the meta-level (SML); the identifier of such a function is a combination of the keyword {\tt eval\_} with the identifier of the function as defined in {\tt *.thy}
+\\
+& {\tt *\_simplify} 
+& the canonical simplifier for the actual theory, i.e. the identifier for this ruleset is a combination of the theories identifier and the keyword {\tt *\_simplify}
+\\
+& {\tt norm\_rls :=}
+& the canonical simplifier {\tt *\_simplify} is stored such that it is accessible for \isac
+\\
+& {\tt rew\_ord' :=}
+& the same for rewrite orders, if needed outside of one particular ruleset
+\\
+& {\tt ruleset' :=}
+& the same for rulesets (ordinary rulesets, reverse rulesets and {\tt eval\_rls})
+\\
+& {\tt calc\_list :=}
+& the same for {\tt eval\_fn}s, if needed outside of one particular ruleset (e.g. for a tactic {\tt Calculate} in a script)
+\\
+& {\tt store\_pbl}
+& problems defined within this {\tt *.ML}-file are made accessible for \isac
+\\
+& {\tt methods :=}
+& methods defined within this {\tt *.ML}-file are made accessible for \isac
+\\
+\end{tabular}\end{center}\end{table}
+}
+The order of the data-items within the theories should adhere to the order given in this list.
+
+\section{Formal description of the problem-hierarchy}
+%for Richard Lang
+
+\section{Script tactics}
+The tactics actually promote the calculation: they construct the prooftree behind the scenes, and they are the points during evaluation where the script-interpreter transfers control to the user. Here we only describe the sytax of the tactics; the semantics is described on p.\pageref{user-tactics} below in context with the tactics the student uses ('user-tactics'): there is a 1-to-1 correspondence between user-tactics and script-tactics.
+
+
+
+
+
+\part{Authoring on the knowledge}
+
+
+\section{Add a theorem}
+\section{Define and add a problem}
+\section{Define and add a predicate}
+\section{Define and add a method}
+\section{}
+\section{}
+\section{}
+\section{}
+
+
+
+\newpage
+\bibliography{bib/isac,bib/from-theses}
+
+\end{document}




