doc-src/isac/mat-eng-de.tex
author Alexandra Hirn <alexandra.hirn@hotmail.com>
Wed, 28 Jul 2010 13:26:19 +0200
branchlatex-isac-doc
changeset 37888 97c7a4059d2e
parent 37887 b82d6c1732d5
child 37889 fe4854d9fdda
permissions -rw-r--r--
chapter 1 - 7
ahirn@37877
     1
\documentclass[11pt,a4paper,headline,headcount,towside,nocenter]{report}
ahirn@37877
     2
\usepackage{latexsym} 
alexandra@37882
     3
ahirn@37877
     4
%\usepackage{ngerman}
ahirn@37877
     5
%\grmn@dq@error ...and \dq \string #1 is undefined}
ahirn@37877
     6
%l.989 ...tch the problem type \\{\tt["squareroot",
ahirn@37877
     7
%                                                  "univ
ahirn@37877
     8
\bibliographystyle{alpha}
ahirn@37877
     9
ahirn@37877
    10
\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}
ahirn@37877
    11
ahirn@37877
    12
\title{\isac --- Interface for\\
ahirn@37877
    13
  Developers of Math Knowledge\\[1.0ex]
ahirn@37877
    14
  and\\[1.0ex]
ahirn@37877
    15
  Tools for Experiments in\\
ahirn@37877
    16
  Symbolic Computation\\[1.0ex]}
ahirn@37877
    17
\author{The \isac-Team\\
ahirn@37877
    18
  \tt isac-users@ist.tugraz.at\\[1.0ex]}
ahirn@37877
    19
\date{\today}
ahirn@37877
    20
ahirn@37877
    21
\begin{document}
ahirn@37877
    22
\maketitle
ahirn@37877
    23
\newpage
ahirn@37877
    24
\tableofcontents
ahirn@37877
    25
\newpage
ahirn@37877
    26
\listoftables
ahirn@37877
    27
\newpage
ahirn@37877
    28
alexandra@37887
    29
\chapter{Einleitung}
ahirn@37877
    30
\section{``Authoring'' und ``Tutoring''}
ahirn@37877
    31
{TO DO} Mathematik lernen -- verschiedene Autoren -- Isabelle
ahirn@37877
    32
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.
ahirn@37877
    33
\section{Der Inhalt des Dokuments}
ahirn@37877
    34
\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.
ahirn@37877
    35
ahirn@37877
    36
\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.
ahirn@37877
    37
ahirn@37877
    38
Das Dokument ist eigenst\"andig; Basiswissen \"uber SML (für eine Einf\"uhrung siehe \cite{Paulson:91}), Terme und Umschreibung wird vorrausgesetzt.
ahirn@37877
    39
ahirn@37877
    40
%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.
ahirn@37877
    41
ahirn@37877
    42
Hinweis: SML Code, Verzeichnis, Dateien sind {\tt in 'tt' geschrieben}; besonders in {\tt ML>} ist das Kerngebiet schnell.
ahirn@37877
    43
ahirn@37877
    44
\paragraph{Versuchen Sie es!}  Ein weiteres Anliegen dieses Textes ist, dem Leser Tipps f\"ur Versuche mit den Anwendungen zu geben.
ahirn@37877
    45
ahirn@37877
    46
\section{Gleich am Computer ausprobieren!}\label{get-started}
ahirn@37877
    47
\paragraph{TO DO screenshot} Bevor Sie mit Ihren Versuchen beginnen, m\"ochten wir Ihnen noch einige Hinweise geben.
ahirn@37877
    48
\begin{itemize}
ahirn@37877
    49
 \item System starten
ahirn@37877
    50
 \item Shell aufmachen und die Datei mat-eng-de.sml \"offnen.
ahirn@37877
    51
 \item $>$  :  Hinter diesem Zeichen (``Prompt'') stehen jene, die Sie selbst eingeben bzw. mit Copy und Paste aus der Datei kopieren.
ahirn@37877
    52
 \item Die Eingabe wird mit ``;'' und ``Enter'' abgeschlossen.
ahirn@37877
    53
 \item Zeilen, die nicht mit Prompt beginnen, werden vom Computer ausgegeben.
ahirn@37877
    54
 
ahirn@37877
    55
\end{itemize}
ahirn@37877
    56
ahirn@37877
    57
\part{Experimentelle Ann\"aherung}
ahirn@37877
    58
ahirn@37877
    59
\chapter{Terme und Theorien}
ahirn@37877
    60
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.
ahirn@37877
    61
ahirn@37877
    62
\section{Von der Formel zum Term}
ahirn@37877
    63
Um ein Beispiel zu nennen: Die Formel $a+b\cdot 3$ l\"asst sich in lesbarer Form so eingeben:
ahirn@37877
    64
{\footnotesize\begin{verbatim}
ahirn@37877
    65
  > "a + b * 3";
ahirn@37877
    66
  val it = "a + b * 3" : string
ahirn@37877
    67
\end{verbatim}}
ahirn@37877
    68
\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:
ahirn@37877
    69
{\footnotesize\begin{verbatim}
ahirn@37877
    70
  > str2term "a + b * 3";
ahirn@37877
    71
  val it =
ahirn@37877
    72
     Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
    73
           Free ("a", "RealDef.real") $
ahirn@37877
    74
        (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
ahirn@37877
    75
           ...) : Term.term
ahirn@37877
    76
\end{verbatim}}
ahirn@37877
    77
\noindent Jene Form braucht Isabelle intern zum rechnen. Sie heisst Term und ist nicht lesbar, daf\"ur aber speicherbar mit Hilfe von ``val'' (=value) 
ahirn@37877
    78
{\footnotesize\begin{verbatim}
ahirn@37877
    79
  > val term = str2term "a + b * 3";
ahirn@37877
    80
  val term =  
ahirn@37877
    81
     Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
    82
           Free ("a", "RealDef.real") $
ahirn@37877
    83
        (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
ahirn@37877
    84
           ...) : Term.term
ahirn@37877
    85
\end{verbatim}
ahirn@37877
    86
Der gespeicherte Term kann einer Funktion ``atomty'' \"ubergeben werden, die jenen in einer abstrakten Struktur zeigt:
ahirn@37877
    87
{\footnotesize\begin{verbatim}
ahirn@37877
    88
  > atomty term;
ahirn@37877
    89
 
ahirn@37877
    90
  ***
ahirn@37877
    91
  *** Const (op +, [real, real] => real)
ahirn@37877
    92
  *** . Free (a, real)
ahirn@37877
    93
  *** . Const (op *, [real, real] => real)
ahirn@37877
    94
  *** . . Free (b, real)
ahirn@37877
    95
  *** . . Free (3, real)
ahirn@37877
    96
  ***
ahirn@37877
    97
 
ahirn@37877
    98
  val it = () : unit
ahirn@37877
    99
\end{verbatim}%size
ahirn@37877
   100
ahirn@37877
   101
ahirn@37877
   102
\section{``Theory'' und ``Parsing``}
ahirn@37877
   103
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{}. 
ahirn@37877
   104
ahirn@37877
   105
{\footnotesize\begin{verbatim}
ahirn@37877
   106
  > Isac.thy;
ahirn@37877
   107
       val it =
ahirn@37877
   108
          {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp,
ahirn@37877
   109
          Sum_Type, Relation, Record, Inductive, Transitive_Closure,
ahirn@37877
   110
          Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power,
ahirn@37877
   111
          SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe,
ahirn@37877
   112
          Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv,
ahirn@37877
   113
          IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map,
ahirn@37877
   114
          Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd,
ahirn@37877
   115
          RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow,
ahirn@37877
   116
          Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix,
ahirn@37877
   117
          Float, ComplexI, Descript, Atools, Simplify, Poly, Rational, PolyMinus,
ahirn@37877
   118
          Equation, LinEq, Root, RootEq, RatEq, RootRat, RootRatEq, PolyEq, Vect,
ahirn@37877
   119
          Calculus, Trig, LogExp, Diff, DiffApp, Integrate, EqSystem, Biegelinie,
ahirn@37877
   120
          AlgEin, Test, Isac} : Theory.theory
ahirn@37877
   121
\end{verbatim}
ahirn@37877
   122
Die, die ein Mal enth\"alt ist groups.thy. Suchen Sie nach '*' unter der Adresse:
ahirn@37877
   123
ahirn@37877
   124
http://www.cl.cam.ac.uk/research/hvg/Isabelle/dist/library/HOL/Groups.html
ahirn@37877
   125
Hier wird Ihnen erkl\"art, wie das Mal vom Computer gelesen wird.
ahirn@37877
   126
{\footnotesize\begin{verbatim}
ahirn@37877
   127
  > Group.thy
ahirn@37877
   128
      fixes f :: "'a => 'a => 'a" (infixl "*" 70)
ahirn@37877
   129
      assumes assoc [ac_simps]: "a * b * c = a * (b * c)"
ahirn@37877
   130
\end{verbatim}
ahirn@37877
   131
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). 
ahirn@37877
   132
ahirn@37877
   133
Parsing entsteht durch einen string und eine theory. Es verwendet Informationen, die in der theory von Isabelle enthalten sind.
ahirn@37877
   134
{\footnotesize\begin{verbatim}
ahirn@37877
   135
  > parse;
ahirn@37877
   136
       val it = fn : Theory.theory -> string -> Thm.cterm Library.option
ahirn@37877
   137
\end{verbatim}
ahirn@37877
   138
Dieser term kann wieder in seine einzelnen Teile zerlegt werden.
ahirn@37877
   139
{\footnotesize\begin{verbatim}
ahirn@37877
   140
   > val it = (term_of o the) it;
ahirn@37877
   141
        val it =
ahirn@37877
   142
           Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
   143
               Free ("a", "RealDef.real") $
ahirn@37877
   144
           (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
ahirn@37877
   145
               ...) : Term.term
ahirn@37877
   146
\end{verbatim}
ahirn@37877
   147
ahirn@37877
   148
\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.
ahirn@37877
   149
ahirn@37877
   150
{\footnotesize\begin{verbatim}
ahirn@37877
   151
   > (*-1-*);
ahirn@37877
   152
   > parse HOL.thy "2^^^3";
ahirn@37877
   153
      *** Inner lexical error at: "^^^3"
ahirn@37877
   154
      val it = None : Thm.cterm Library.option         
ahirn@37877
   155
\end{verbatim}
ahirn@37877
   156
''Inner lexical error`` bedeutet, dass ein Fehler aufgetreten ist, vermutlich hat man sich vertippt.
ahirn@37877
   157
ahirn@37877
   158
{\footnotesize\begin{verbatim}
ahirn@37877
   159
   > (*-2-*);
ahirn@37877
   160
   > parse HOL.thy "d_d x (a + x)";
ahirn@37877
   161
      val it = None : Thm.cterm Library.option               
ahirn@37877
   162
\end{verbatim}
ahirn@37877
   163
Fehlt ''Inner lexical error`` wurde der Parse nicht gefunden.
ahirn@37877
   164
ahirn@37877
   165
{\footnotesize\begin{verbatim}
ahirn@37877
   166
   > (*-3-*);
ahirn@37877
   167
   > parse Rational.thy "2^^^3";
ahirn@37877
   168
      val it = Some "2 ^^^ 3" : Thm.cterm Library.option               
ahirn@37877
   169
\end{verbatim}
ahirn@37877
   170
ahirn@37877
   171
{\footnotesize\begin{verbatim}
ahirn@37877
   172
   > (*-4-*);
ahirn@37877
   173
   > val Some t4 = parse Rational.thy "d_d x (a + x)";
ahirn@37877
   174
      val t4 = "d_d x (a + x)" : Thm.cterm              
ahirn@37877
   175
\end{verbatim}
ahirn@37877
   176
ahirn@37877
   177
{\footnotesize\begin{verbatim}
ahirn@37877
   178
   > (*-5-*);
ahirn@37877
   179
   > val Some t5 = parse Diff.thy  "d_d x (a + x)";
ahirn@37877
   180
      val t5 = "d_d x (a + x)" : Thm.cterm             
ahirn@37877
   181
\end{verbatim}
ahirn@37877
   182
ahirn@37877
   183
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.
ahirn@37877
   184
ahirn@37877
   185
\section{Details von Termen}
ahirn@37877
   186
Mit Hilfe der darunterliegenden Darstellung sieht man, dass ein cterm in einen term umgewandelt werden kann.
ahirn@37877
   187
{\footnotesize\begin{verbatim}
ahirn@37877
   188
   > term_of;
ahirn@37877
   189
      val it = fn : Thm.cterm -> Term.term
ahirn@37877
   190
\end{verbatim}
ahirn@37877
   191
Durch die Umwandlung eines cterms in einen term sieht man die einzelnen Teile des Terms. ''Free`` bedeutet, dass man die Variable \"andern kann.
ahirn@37877
   192
{\footnotesize\begin{verbatim}
ahirn@37877
   193
   > term_of t4;
ahirn@37877
   194
      val it =
ahirn@37877
   195
         Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
ahirn@37877
   196
         ...: Term.term
ahirn@37877
   197
ahirn@37877
   198
\end{verbatim}
ahirn@37877
   199
In diesem Fall sagt uns das ''Const``, dass die Variable eine Konstante ist, also ein Fixwert ist und immer die selbe Funktion hat.
ahirn@37877
   200
{\footnotesize\begin{verbatim}
ahirn@37877
   201
   > term_of t5;
ahirn@37877
   202
      val it =
ahirn@37877
   203
         Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
ahirn@37877
   204
         ... : Term.term
ahirn@37877
   205
\end{verbatim}
ahirn@37877
   206
Sollten verschiedene Teile des Output nicht sichtbar sein, kann die Schriftgr\"osse ge\"andert werden.
ahirn@37877
   207
{\footnotesize\begin{verbatim}
ahirn@37877
   208
   > print_depth;
ahirn@37877
   209
      val it = fn : int -> unit
ahirn@37877
   210
 \end{verbatim}
ahirn@37877
   211
Zuerst gibt man die Schriftgr\"osse ein, danach den term, der gr\"osser werden soll.
ahirn@37877
   212
{\footnotesize\begin{verbatim}
ahirn@37877
   213
   > print_depth 10;
ahirn@37877
   214
      val it = () : unit
ahirn@37877
   215
   > term_of t4;
ahirn@37877
   216
         val it =
ahirn@37877
   217
            Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
   218
                Free ("x", "RealDef.real") $
ahirn@37877
   219
            (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
   220
                Free ("a", "RealDef.real") $ Free ("x", "RealDef.real"))
ahirn@37877
   221
         : Term.term
ahirn@37877
   222
ahirn@37877
   223
   > print_depth 10;
ahirn@37877
   224
         val it = () : unit
ahirn@37877
   225
   > term_of t5;
ahirn@37877
   226
         val it =
ahirn@37877
   227
            Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
   228
                Free ("x", "RealDef.real") $
ahirn@37877
   229
            (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
   230
                Free ("a", "RealDef.real") $ Free ("x", "RealDef.real"))
ahirn@37877
   231
         : Term.term
ahirn@37877
   232
\end{verbatim}
ahirn@37877
   233
ahirn@37877
   234
Eine andere Variante um den Unterschied der beiden Terme zu sehen ist folgende: 
ahirn@37877
   235
{\footnotesize\begin{verbatim}
ahirn@37877
   236
   > (*-4-*) val thy = Rational.thy;
ahirn@37877
   237
      val thy =
ahirn@37877
   238
         {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp,
ahirn@37877
   239
         Sum_Type, Relation, Record, Inductive, Transitive_Closure,
ahirn@37877
   240
         Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power,
ahirn@37877
   241
         SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe,
ahirn@37877
   242
         Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv,
ahirn@37877
   243
         IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map,
ahirn@37877
   244
         Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd,
ahirn@37877
   245
         RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow,
ahirn@37877
   246
         Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix,
ahirn@37877
   247
         Float, ComplexI, Descript, Atools, Simplify, Poly, Rational}
ahirn@37877
   248
     : Theory.theory
ahirn@37877
   249
   > ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)";
ahirn@37877
   250
 
ahirn@37877
   251
      ***
ahirn@37877
   252
      *** Free (d_d, [real, real] => real)
ahirn@37877
   253
      *** . Free (x, real)
ahirn@37877
   254
      *** . Const (op +, [real, real] => real)
ahirn@37877
   255
      *** . . Free (a, real)
ahirn@37877
   256
      *** . . Free (x, real)
ahirn@37877
   257
      ***
ahirn@37877
   258
 
ahirn@37877
   259
      val it = () : unit
ahirn@37877
   260
ahirn@37877
   261
ahirn@37877
   262
   > (*-5-*) val thy = Diff.thy;
ahirn@37877
   263
      val thy =
ahirn@37877
   264
         {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp,
ahirn@37877
   265
         Sum_Type, Relation, Record, Inductive, Transitive_Closure,
ahirn@37877
   266
         Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power,
ahirn@37877
   267
         SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe,
ahirn@37877
   268
         Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv,
ahirn@37877
   269
         IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map,
ahirn@37877
   270
         Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd,
ahirn@37877
   271
         RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow,
ahirn@37877
   272
         Ring_and_Field, Complex_Numbers, Real, Calculus, Trig, ListG, Tools,
ahirn@37877
   273
         Script, Typefix, Float, ComplexI, Descript, Atools, Simplify, Poly,
ahirn@37877
   274
         Equation, LinEq, Root, RootEq, Rational, RatEq, RootRat, RootRatEq,
ahirn@37877
   275
         PolyEq, LogExp, Diff} : Theory.theory
ahirn@37877
   276
 
ahirn@37877
   277
   > ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)";
ahirn@37877
   278
 
ahirn@37877
   279
      ***
ahirn@37877
   280
      *** Const (Diff.d_d, [real, real] => real)
ahirn@37877
   281
      *** . Free (x, real)
ahirn@37877
   282
      *** . Const (op +, [real, real] => real)
ahirn@37877
   283
      *** . . Free (a, real)
ahirn@37877
   284
      *** . . Free (x, real)
ahirn@37877
   285
      ***
ahirn@37877
   286
 
ahirn@37877
   287
      val it = () : unit
ahirn@37877
   288
\end{verbatim}
ahirn@37877
   289
ahirn@37877
   290
ahirn@37877
   291
{\chapter{''Rewriting``}}
ahirn@37877
   292
{\section{}}
ahirn@37877
   293
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.
ahirn@37877
   294
ahirn@37877
   295
{\footnotesize\begin{verbatim}
ahirn@37877
   296
> rewrite_;
ahirn@37877
   297
val it = fn
ahirn@37877
   298
:
ahirn@37877
   299
   Theory.theory ->
ahirn@37877
   300
   ((Term.term * Term.term) list -> Term.term * Term.term -> bool) ->
ahirn@37877
   301
   rls ->
ahirn@37877
   302
   bool ->
ahirn@37877
   303
   Thm.thm -> Term.term -> (Term.term * Term.term list) Library.option
ahirn@37877
   304
ahirn@37877
   305
> rewrite;
ahirn@37877
   306
val it = fn
ahirn@37877
   307
:
ahirn@37877
   308
   theory' ->
ahirn@37877
   309
   rew_ord' ->
ahirn@37877
   310
   rls' -> bool -> thm' -> cterm' -> (string * string list) Library.option
ahirn@37877
   311
ahirn@37877
   312
\end{verbatim}
ahirn@37877
   313
\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!
ahirn@37877
   314
ahirn@37877
   315
Zuerst legt man fest, dass es sich um eine Differenzierung handelt.
ahirn@37877
   316
{\footnotesize\begin{verbatim}
ahirn@37877
   317
   > val thy' = "Diff.thy";
ahirn@37877
   318
      val thy' = "Diff.thy" : string
ahirn@37877
   319
\end{verbatim}
ahirn@37877
   320
Dann gibt man die zu l\"osende Rechnung ein.
ahirn@37877
   321
{\footnotesize\begin{verbatim}
ahirn@37877
   322
   > val ct = "d_d x (a + a * (2 + b))";
ahirn@37877
   323
      val ct = "d_d x (a + a * (2 + b))" : string
ahirn@37877
   324
\end{verbatim}
ahirn@37877
   325
Anschließend gibt man bekannt, dass die Summenregel angewandt werden soll.
ahirn@37877
   326
{\footnotesize\begin{verbatim}
ahirn@37877
   327
   > val thm = ("diff_sum","");
ahirn@37877
   328
      val thm = ("diff_sum", "") : string * string
ahirn@37877
   329
\end{verbatim}
ahirn@37877
   330
Schliesslich wird die erste Ableitung angezeigt.
ahirn@37877
   331
{\footnotesize\begin{verbatim}
ahirn@37877
   332
   > val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true
ahirn@37877
   333
                        [("bdv","x::real")] thm ct;#
ahirn@37877
   334
      val ct = "d_d x a + d_d x (a * (2 + b))" : cterm'
ahirn@37877
   335
\end{verbatim}
ahirn@37877
   336
Will man auch die zweite Ableitung sehen, geht man so vor:
ahirn@37877
   337
{\footnotesize\begin{verbatim}
ahirn@37877
   338
   > val thm = ("diff_prod_const","");
ahirn@37877
   339
      val thm = ("diff_prod_const", "") : string * string
ahirn@37877
   340
\end{verbatim} 
ahirn@37877
   341
Auch die zweite Ableitung wird sichtbar.
ahirn@37877
   342
{\footnotesize\begin{verbatim}
ahirn@37877
   343
   > val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true
ahirn@37877
   344
                        [("bdv","x::real")] thm ct;#
ahirn@37877
   345
      val ct = "d_d x a + a * d_d x (2 + b)" : cterm'
ahirn@37877
   346
\end{verbatim}
ahirn@37877
   347
alexandra@37882
   348
{\section{M\"oglichkeiten von Rewriting}
alexandra@37882
   349
Es gibt verscheidene Varianten von Rewriting, die alle eine bestimmte Bedeutung haben.
alexandra@37882
   350
\textit{rewrite\_inst} bedeutet, dass die Liste der Terme vor dem Rewriting durch ein ''Theorem`` (ein mathematischer Begriff f\"ur einen Satz) ersetzt wird.
alexandra@37882
   351
{\footnotesize\begin{verbatim}
alexandra@37882
   352
> rewrite_inst;
alexandra@37882
   353
val it = fn
alexandra@37882
   354
:
alexandra@37882
   355
   theory' ->
alexandra@37882
   356
   rew_ord' ->
alexandra@37882
   357
   rls' ->
alexandra@37882
   358
   bool -> 'a -> thm' -> cterm' -> (cterm' * cterm' list) Library.option
alexandra@37882
   359
\end{verbatim}
alexandra@37882
   360
Mit Hilfe von \textit{rewrite\_set} werden Terme, die normalerweise nur mit einem Thoerem vereinfacht dargestellt werden, mit einem ganzen ''rule set`` (=Regelsatz, weiter unten erkl\"art) umgeschrieben.
alexandra@37882
   361
{\footnotesize\begin{verbatim}
alexandra@37882
   362
   > rewrite_set;
alexandra@37882
   363
      val it = fn
alexandra@37882
   364
      : theory' -> bool -> rls' -> cterm' -> (string * string list) Library.option
alexandra@37882
   365
\end{verbatim}
alexandra@37882
   366
\textit{rewrite\_set\_inst} ist eine Kombination der beiden oben genannten M\"oglichkeiten.
alexandra@37882
   367
{\footnotesize\begin{verbatim}
alexandra@37882
   368
   > rewrite_set_inst;
alexandra@37882
   369
      val it = fn
alexandra@37882
   370
      :
alexandra@37882
   371
         theory' ->
alexandra@37882
   372
         bool -> subs' -> rls' -> cterm' -> (string * string list) Library.option
alexandra@37882
   373
\end{verbatim}
alexandra@37882
   374
Wenn man sehen m\"ochte, wie Rewriting bei den einzelnen Theorems funktioniert, kann man dies mit \textit{trace\_rewrite} versuchen.
alexandra@37882
   375
{\footnotesize\begin{verbatim}
alexandra@37882
   376
   > toggle;
alexandra@37882
   377
      val it = fn : bool ref -> bool
alexandra@37882
   378
   > toggle trace_rewrite;
alexandra@37882
   379
      val it = true : bool
alexandra@37882
   380
   > toggle trace_rewrite;
alexandra@37882
   381
      val it = false : bool
alexandra@37882
   382
\end{verbatim}
alexandra@37882
   383
 
alexandra@37882
   384
\section{Rule sets}
alexandra@37882
   385
Einige der oben genannten Varianten von Rewriting beziehen sich nicht nur auf einen Theorem, sondern auf einen ganzen Block von Theorems, die man als Rule set bezeichnet.
alexandra@37882
   386
Dieser wird so lange angewendet, bis ein Element davon f\"ur Rewriting verwendet werden kann. Sollte der Begriff ''terminate`` fehlen, wird das Rule set nicht beendet und l\"auft weiter.
alexandra@37882
   387
Ein Beispiel f\"ur einen Regelsatz ist folgendes:
alexandra@37882
   388
\footnotesize\begin{verbatim}
alexandra@37882
   389
???????????
alexandra@37882
   390
\end{verbatim}
ahirn@37877
   391
alexandra@37882
   392
\footnotesize\begin{verbatim}
alexandra@37882
   393
   > sym;
alexandra@37882
   394
      val it = "?s = ?t ==> ?t = ?s" : Thm.thm
alexandra@37882
   395
   > rearrange_assoc;
alexandra@37882
   396
      val it =
alexandra@37882
   397
         Rls
alexandra@37882
   398
            {id = "rearrange_assoc",
alexandra@37882
   399
               scr = Script (Free ("empty_script", "RealDef.real")),
alexandra@37882
   400
               calc = [],
alexandra@37882
   401
               erls =
alexandra@37882
   402
               Rls
alexandra@37882
   403
                  {id = "e_rls",
alexandra@37882
   404
                     scr = EmptyScr,
alexandra@37882
   405
                     calc = [],
alexandra@37882
   406
                     erls = Erls,
alexandra@37882
   407
                     srls = Erls,
alexandra@37882
   408
                     rules = [],
alexandra@37882
   409
                     rew_ord = ("dummy_ord", fn),
alexandra@37882
   410
                     preconds = []},
alexandra@37882
   411
               srls =
alexandra@37882
   412
               Rls
alexandra@37882
   413
                  {id = "e_rls",
alexandra@37882
   414
                     scr = EmptyScr,
alexandra@37882
   415
                     calc = [],
alexandra@37882
   416
                     erls = Erls,
alexandra@37882
   417
                     srls = Erls,
alexandra@37882
   418
                     rules = [],
alexandra@37882
   419
                     rew_ord = ("dummy_ord", fn),
alexandra@37882
   420
                     preconds = []},
alexandra@37882
   421
               rules =
alexandra@37882
   422
               [Thm ("sym_radd_assoc", "?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1"  [.]),
alexandra@37882
   423
                  Thm
alexandra@37882
   424
                     ("sym_rmult_assoc",
alexandra@37882
   425
                        "?m1 * (?n1 * ?k1) = ?m1 * ?n1 * ?k1"  [.])],
alexandra@37882
   426
               rew_ord = ("e_rew_ord", fn),
alexandra@37882
   427
               preconds = []} : rls
alexandra@37882
   428
\end{verbatim}
ahirn@37877
   429
ahirn@37877
   430
alexandra@37882
   431
\section{Berechnung von Konstanten}
alexandra@37882
   432
Sobald Konstanten in dem Bereich des Subterms sind, k\"onnen sie von einer Funktion berechnet werden:
alexandra@37882
   433
\footnotesize\begin{verbatim}
alexandra@37882
   434
   > calculate;
alexandra@37882
   435
      val it = fn
alexandra@37882
   436
      :
alexandra@37882
   437
         theory' ->
alexandra@37882
   438
         string *
alexandra@37882
   439
         (
alexandra@37882
   440
         string ->
alexandra@37882
   441
         Term.term -> Theory.theory -> (string * Term.term) Library.option) ->
alexandra@37882
   442
         cterm' -> (string * thm') Library.option
ahirn@37877
   443
alexandra@37882
   444
   > calculate_;
alexandra@37882
   445
      val it = fn
alexandra@37882
   446
      :
alexandra@37882
   447
         Theory.theory ->
alexandra@37882
   448
         string *
alexandra@37882
   449
         (
alexandra@37882
   450
         string ->
alexandra@37882
   451
         Term.term -> Theory.theory -> (string * Term.term) Library.option) ->
alexandra@37882
   452
         Term.term -> (Term.term * (string * Thm.thm)) Library.option
alexandra@37882
   453
\end{verbatim}
alexandra@37882
   454
Man bekommt das Ergebnis und die Theorem bezieht sich darauf. Daher sind die folgenden mathematischen Rechnungen m\"oglich:
alexandra@37882
   455
\footnotesize\begin{verbatim}
alexandra@37882
   456
   > calclist;
alexandra@37882
   457
      val it =
alexandra@37882
   458
         [("Vars", ("Tools.Vars", fn)), ("matches", ("Tools.matches", fn)),
alexandra@37882
   459
            ("lhs", ("Tools.lhs", fn)), ("plus", ("op +", fn)),
alexandra@37882
   460
            ("times", ("op *", fn)), ("divide_", ("HOL.divide", fn)),
alexandra@37882
   461
            ("power_", ("Atools.pow", fn)), ("is_const", ("Atools.is'_const", fn)),
alexandra@37882
   462
            ("le", ("op <", fn)), ("leq", ("op <=", fn)),
alexandra@37882
   463
            ("ident", ("Atools.ident", fn)), ("sqrt", ("Root.sqrt", fn)),
alexandra@37882
   464
            ("Test.is_root_free", ("is'_root'_free", fn)),
alexandra@37882
   465
            ("Test.contains_root", ("contains'_root", fn))]
alexandra@37882
   466
      :
alexandra@37882
   467
         (
alexandra@37882
   468
         string *
alexandra@37882
   469
         (
alexandra@37882
   470
         string *
alexandra@37882
   471
         (
alexandra@37882
   472
         string ->
alexandra@37882
   473
         Term.term -> Theory.theory -> (string * Term.term) Library.option))) list
alexandra@37882
   474
\end{verbatim}
alexandra@37882
   475
Diese werden so angewendet:
alexandra@37882
   476
\footnotesize\begin{verbatim}
alexandra@37882
   477
\end{verbatim}
ahirn@37877
   478
ahirn@37877
   479
ahirn@37877
   480
alexandra@37882
   481
\chapter{Termordnung}
alexandra@37882
   482
Die Anordnungen der Begriffe sind unverzichtbar f\"ur den Gebrauch des Umschreibens von normalen Funktionen und von normalen Formeln, die n\"otig sind um passende Modelle für Probleme zu finden.
alexandra@37882
   483
alexandra@37882
   484
\section{Beispiel f\"ur Termordnungen}
alexandra@37882
   485
Es ist nicht unbedeutend eine Verbindung $<$ zu Termen herzustellen, die wirklich eine Ordnung besitzen, wie eine \"ubergehende und antisymmetrische Verbindung. Diese Ordnungen sind selbstaufrufende Bahnordnungen.
alexandra@37882
   486
Hier ein Beispiel:
alexandra@37882
   487
alexandra@37882
   488
{\footnotesize\begin{verbatim}
alexandra@37882
   489
   > sqrt_right;
alexandra@37882
   490
      val it = fn : bool -> Theory.theory -> subst -> Term.term * Term.term -> b       ool
alexandra@37882
   491
   > tless_true;
alexandra@37882
   492
      val it = fn : subst -> Term.term * Term.term -> bool
alexandra@37882
   493
\end{verbatim}
alexandra@37882
   494
alexandra@37882
   495
Das bool Argument gibt Ihnen die M\"oglichkeit die Kontrolle zu den zugeh\"origen Unterordunungen zur\"uck zu verfolgen, damit sich die Unterordnungen, die 'true' sind als strings anzeigen lassen.
alexandra@37882
   496
alexandra@37888
   497
{\section{Geordnetes Rewriting}}
alexandra@37888
   498
Beim Rewriting entstehen Probleme in den meisten elementaren Bereichen. Es gibt ein ''law of commutativity`` das genau solche Probleme mit '+' und '*' verursacht. Diese Probleme können nur durch geordnetes Rewriting gel\"ost werden, da hier ein Term nur umgeschrieben wird, wenn ein kleinerer dadurch entsteht.
alexandra@37888
   499
\paragraph{Versuchen Sie es!} Das geordnete Rewriting ist eine Technik, um ein normales Polynom aus ganzzahligen Termen zu schaffen.
alexandra@37888
   500
Geordnetes Rewriting endet mit Klammern, aber auf Grund der weggelassenen Verbindung.
alexandra@37888
   501
alexandra@37888
   502
alexandra@37888
   503
\chapter{Die Hirarchie von Problemen}
alexandra@37888
   504
\section{''Matching``}
alexandra@37888
   505
Matching ist eine Technik von Rewriting, die von \isac verwendet wird, um ein Problem und den passenden Problemtyp daf\"ur zu finden. Die folgende Funktion, die \"uberpr\"uft, ob matching möglich ist, hat diese Signatur:
alexandra@37888
   506
{\footnotesize\begin{verbatim}
alexandra@37888
   507
> matches;
alexandra@37888
   508
val it = fn : Theory.theory -> Term.term -> Term.term -> bool
alexandra@37888
   509
\end{verbatim}
alexandra@37888
   510
Die folgende Gleichung wird in Operatoren und freie Variablen zerlegt.
alexandra@37888
   511
{\footnotesize\begin{verbatim}
alexandra@37888
   512
> val t = (term_of o the o (parse thy)) "3 * x^^^2 = 1";
alexandra@37888
   513
val t =
alexandra@37888
   514
Const ("op =", "[RealDef.real, RealDef.real] => bool") $
alexandra@37888
   515
(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   516
Free ("3", "RealDef.real") $
alexandra@37888
   517
(Const
alexandra@37888
   518
("Atools.pow",
alexandra@37888
   519
"[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   520
Free ("x", "RealDef.real") $ Free ("2", " RealDef.real"))) $
alexandra@37888
   521
Free ("1", "RealDef.real") : Term.term
alexandra@37888
   522
\end{verbatim}
alexandra@37888
   523
Nun wird ein Modell erstellt, das sich nicht auf bestimmte Zahlen bezieht, sondern nur eine generelle Zerlegung durchführt.
alexandra@37888
   524
{\footnotesize\begin{verbatim}
alexandra@37888
   525
> val p = (term_of o the o (parse thy)) "a * b^^^2 = c";
alexandra@37888
   526
val p =
alexandra@37888
   527
Const ("op =", "[RealDef.real, RealDef.real] => bool") $
alexandra@37888
   528
(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   529
Free ("a", "RealDef.real") $
alexandra@37888
   530
(Const
alexandra@37888
   531
("Atools.pow",
alexandra@37888
   532
"[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   533
Free ("b", "RealDef.real") $ Free ("2", "RealDef.real"))) $
alexandra@37888
   534
Free ("c", "RealDef.real") : Term.term
alexandra@37888
   535
\end{verbatim}
alexandra@37888
   536
Dieses Modell enth\"allt sogenannte \textit{scheme variables}.
alexandra@37888
   537
{\footnotesize\begin{verbatim}
alexandra@37888
   538
> atomt p;
alexandra@37888
   539
"*** -------------"
alexandra@37888
   540
"*** Const (op =)"
alexandra@37888
   541
"*** . Const (op *)""*** . . Free (a, )"
alexandra@37888
   542
"*** . . Const (Atools.pow)"
alexandra@37888
   543
"*** . . . Free (b, )"
alexandra@37888
   544
"*** . . . Free (2, )"
alexandra@37888
   545
"*** . Free (c, )"
alexandra@37888
   546
"\n"
alexandra@37888
   547
val it = "\n" : string
alexandra@37888
   548
\end{verbatim}
alexandra@37888
   549
Das Modell wird durch den Befehl free2var erstellt.
alexandra@37888
   550
{\footnotesize\begin{verbatim}
alexandra@37888
   551
> free2var;
alexandra@37888
   552
val it = fn : Term.term -> Term.term
alexandra@37888
   553
> val pat = free2var p;
alexandra@37888
   554
val pat =
alexandra@37888
   555
Const ("op =", "[RealDef.real, RealDef.real] => bool") $
alexandra@37888
   556
(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   557
Var (("a", 0), "RealDef.real") $
alexandra@37888
   558
(Const
alexandra@37888
   559
("Atools.pow",
alexandra@37888
   560
"[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   561
Var (("b", 0), "RealDef.real") $
alexandra@37888
   562
Free ("2", "RealDef.real"))) $ Var (("c", 0), "RealDef.real")
alexandra@37888
   563
: Term.term
alexandra@37888
   564
> Sign.string_of_term (sign_of thy) pat;
alexandra@37888
   565
val it = "?a * ?b ^^^ 2 = ?c" : string
alexandra@37888
   566
\end{verbatim}
alexandra@37888
   567
Durch atomt pat wird der Term aufgespalten und so in eine Form gebracht, die f\"ur die weiteren Schritte ben\"otigt werden.
alexandra@37888
   568
{\footnotesize\begin{verbatim}
alexandra@37888
   569
> atomt pat;
alexandra@37888
   570
"*** -------------"
alexandra@37888
   571
"*** Const (op =)"
alexandra@37888
   572
"*** . Const (op *)"
alexandra@37888
   573
"*** . . Var ((a, 0), )"
alexandra@37888
   574
"*** . . Const (Atools.pow)"
alexandra@37888
   575
"*** . . . Var ((b, 0), )"
alexandra@37888
   576
"*** . . . Free (2, )"
alexandra@37888
   577
"*** . Var ((c, 0), )"
alexandra@37888
   578
"\n"
alexandra@37888
   579
val it = "\n" : string
alexandra@37888
   580
\end{verbatim}
alexandra@37888
   581
Jetzt kann das Matching f\"ur die beiden vorigen Terme angewendet werden.
alexandra@37888
   582
{\footnotesize\begin{verbatim}
alexandra@37888
   583
> matches thy t pat;
alexandra@37888
   584
val it = true : bool
alexandra@37888
   585
> val t2 = (term_of o the o (parse thy)) "x^^^2 = 1";
alexandra@37888
   586
val t2 =
alexandra@37888
   587
Const ("op =", "[RealDef.real, RealDef.real] => bool") $
alexandra@37888
   588
(Const
alexandra@37888
   589
("Atools.pow",
alexandra@37888
   590
"[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   591
Free ("x", "RealDef.real") $ Free ("2", "RealDef.real")) $
alexandra@37888
   592
Free ("1", "RealDef.real") : Term.term
alexandra@37888
   593
> matches thy t2 pat;
alexandra@37888
   594
val it = false : bool
alexandra@37888
   595
> val pat2 = (term_of o the o (parse thy)) "?u^^^2 = ?v";
alexandra@37888
   596
val pat2 =
alexandra@37888
   597
Const ("op =", "[RealDef.real, RealDef.real] => bool") $
alexandra@37888
   598
(Const
alexandra@37888
   599
("Atools.pow",
alexandra@37888
   600
"[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   601
Var (("u", 0), "RealDef.real") $ Free ("2", "RealDef.real")) $
alexandra@37888
   602
Var (("v", 0), "RealDef.real") : Term.term
alexandra@37888
   603
> matches thy t2 pat2;
alexandra@37888
   604
val it = true : bool
alexandra@37888
   605
\end{verbatim}
alexandra@37888
   606
alexandra@37888
   607
\section{Zugriff auf die Hierarchie}
alexandra@37888
   608
Man verwendet folgenden Befehl, um sich Zugang zur Hierarchie von Problemtypen zu verschaffen.
alexandra@37888
   609
{\footnotesize\begin{verbatim}
alexandra@37888
   610
> show_ptyps;
alexandra@37888
   611
val it = fn : unit -> unit
alexandra@37888
   612
> show_ptyps();
alexandra@37888
   613
[
alexandra@37888
   614
["e_pblID"],
alexandra@37888
   615
["simplification", "polynomial"],
alexandra@37888
   616
["simplification", "rational"],
alexandra@37888
   617
["vereinfachen", "polynom", "plus_minus"],
alexandra@37888
   618
["vereinfachen", "polynom", "klammer"],
alexandra@37888
   619
["vereinfachen", "polynom", "binom_klammer"],
alexandra@37888
   620
["probe", "polynom"],
alexandra@37888
   621
["probe", "bruch"],
alexandra@37888
   622
["equation", "univariate", "linear"],
alexandra@37888
   623
["equation", "univariate", "root", "sq", "rat"],
alexandra@37888
   624
["equation", "univariate", "root", "normalize"],
alexandra@37888
   625
["equation", "univariate", "rational"],
alexandra@37888
   626
["equation", "univariate", "polynomial", "degree_0"],
alexandra@37888
   627
["equation", "univariate", "polynomial", "degree_1"],
alexandra@37888
   628
["equation", "univariate", "polynomial", "degree_2", "sq_only"],
alexandra@37888
   629
["equation", "univariate", "polynomial", " 
alexandra@37888
   630
 degree_2", "bdv_only"],
alexandra@37888
   631
["equation", "univariate", "polynomial", "degree_2", "pqFormula"],
alexandra@37888
   632
["equation", "univariate", "polynomial", "degree_2", "abcFormula"],
alexandra@37888
   633
["equation", "univariate", "polynomial", "degree_3"],
alexandra@37888
   634
["equation", "univariate", "polynomial", "degree_4"],
alexandra@37888
   635
["equation", "univariate", "polynomial", "normalize"],
alexandra@37888
   636
["equation", "univariate", "expanded", "degree_2"],
alexandra@37888
   637
["equation", "makeFunctionTo"],
alexandra@37888
   638
["function", "derivative_of", "named"],
alexandra@37888
   639
["function", "maximum_of", "on_interval"],
alexandra@37888
   640
["function", "make", "by_explicit"],
alexandra@37888
   641
["function", "make", "by_new_variable"],
alexandra@37888
   642
["function", "integrate", "named"],
alexandra@37888
   643
["tool", "find_values"],
alexandra@37888
   644
["system", "linear", "2x2", "triangular"],
alexandra@37888
   645
["system", "linear", "2x2", "normalize"],
alexandra@37888
   646
["system", "linear", "3x3"],
alexandra@37888
   647
["system", "linear", "4x4", "triangular"],
alexandra@37888
   648
["system", "linear", "4x4", "normalize"],
alexandra@37888
   649
["Biegelinien", "
alexandra@37888
   650
MomentBestimmte"],
alexandra@37888
   651
["Biegelinien", "MomentGegebene"],
alexandra@37888
   652
["Biegelinien", "einfache"],
alexandra@37888
   653
["Biegelinien", "QuerkraftUndMomentBestimmte"],
alexandra@37888
   654
["Biegelinien", "vonBelastungZu"],
alexandra@37888
   655
["Biegelinien", "setzeRandbedingungen"],
alexandra@37888
   656
["Berechnung", "numerischSymbolische"],
alexandra@37888
   657
["test", "equation", "univariate", "linear"],
alexandra@37888
   658
["test", "equation", "univariate", "plain_square"],
alexandra@37888
   659
["test", "equation", "univariate", "polynomial", "degree_two", "pq_formula"],
alexandra@37888
   660
["test", "equation", "univariate", "polynomial", "degree_two", "abc_formula"],
alexandra@37888
   661
["test", "equation", "univariate", "squareroot"],
alexandra@37888
   662
["test", "equation", "univariate", "normalize"],
alexandra@37888
   663
["test", "equation", "univariate", "sqroot-test"]
alexandra@37888
   664
]
alexandra@37888
   665
val it = () : unit
alexandra@37888
   666
\end{verbatim}
alexandra@37888
   667
alexandra@37888
   668
\section{Die passende ''Formalization`` f\"ur den Problemtyp}
alexandra@37888
   669
Eine andere Art des Matching ist es die richtige ''Formalization`` zum jeweiligen Problemtyp zu finden. Wenn es eine ''Formalization`` gibt, dann kann \isac{} selbstst\"andig die Probleme l\"osen.
alexandra@37888
   670
alexandra@37888
   671
\section{Problem - Refinement}
alexandra@37888
   672
Will man die Hierarchie der Probleme aufstellen, so ist darauf zu achten, dass man die verschiedenen Branches so konstruiert, dass das Problem - Refinement automatisch durchgef\"uhrt werden kann. F\"ur diese Anwendung wird die Hierarchie nach folgenden Regeln aufgestellt:
alexandra@37888
   673
$F$ ist eine Formalization und $P$ und $P_i,\:i=1\cdots n$ sind Problemtypen, wobei $P_i$ ein spezieller Problemtyp ist, im Bezug auf $P$, dann gilt:
alexandra@37888
   674
{\small
alexandra@37888
   675
\begin{enumerate}
alexandra@37888
   676
\item wenn für $F$ der Problemtyp $P_i$ passt, dann passt auch $P$
alexandra@37888
   677
\item wenn zu $F$ der Problemtyp P passt, dann sollte es nicht mehr als ein $P_i$ geben, das zu $F$ passt.
alexandra@37888
   678
\item alle $F$ , die zu $P$ passen, m\"ussen auch zu $P_n$ passen
alexandra@37888
   679
\end{enumerate}
alexandra@37888
   680
Zuerst ein Beispiel für die ersten zwei Punkte:
alexandra@37888
   681
{\footnotesize\begin{verbatim}
alexandra@37888
   682
> refine;
alexandra@37888
   683
val it = fn : fmz_ -> pblID -> SpecifyTools.match list
alexandra@37888
   684
> val fmz = ["equality (sqrt(9 + 4 * x)=sqrt x 
alexandra@37888
   685
+ sqrt (5 + x))",
alexandra@37888
   686
# "soleFor x","errorBound (eps=0)",
alexandra@37888
   687
# "solutions L"];
alexandra@37888
   688
val fmz =
alexandra@37888
   689
["equality (sqrt(9 + 4 * x)=sqrt x + sqrt (5 + x))", "soleFor x",
alexandra@37888
   690
"errorBound (eps=0)", ...] : string list
alexandra@37888
   691
> refine fmz ["univariate","equation"];
alexandra@37888
   692
*** pass ["equation","univariate"]
alexandra@37888
   693
*** comp_dts: ??.empty $ soleFor x
alexandra@37888
   694
Exception- ERROR raised
alexandra@37888
   695
\end{verbatim}
alexandra@37888
   696
Wenn die ersten zwei Regeln nicht angewendet werden k\"onnen, wird die dritte verwendet:
alexandra@37888
   697
{\footnotesize\begin{verbatim}
alexandra@37888
   698
> val fmz = ["equality (x + 1 = 2)",
alexandra@37888
   699
# "solveFor x","errorBound (eps=0)",
alexandra@37888
   700
# "solutions L"];
alexandra@37888
   701
val fmz = ["equality (x + 1 = 2)", "solveFor x", "errorBound (eps=0)", ...]
alexandra@37888
   702
: string list
alexandra@37888
   703
> refine fmz ["univariate","equation"];
alexandra@37888
   704
*** pass ["equation","univariate"]
alexandra@37888
   705
*** pass ["equation","univariate","linear"]
alexandra@37888
   706
*** pass ["equation","univariate","root"]
alexandra@37888
   707
*** pass ["equation","univariate","rational"]
alexandra@37888
   708
*** pass ["equation","univariate","polynomial" ]
alexandra@37888
   709
*** pass ["equation","univariate","polynomial","degree_0"]
alexandra@37888
   710
*** pass ["equation","univariate","polynomial","degree_1"]
alexandra@37888
   711
*** pass ["equation","univariate","polynomial","degree_2"]
alexandra@37888
   712
*** pass ["equation","univariate","polynomial","degree_3"]
alexandra@37888
   713
*** pass ["equation","univariate","polynomial","degree_4"]
alexandra@37888
   714
*** pass ["equation","univariate","polynomial","normalize"]
alexandra@37888
   715
val it =
alexandra@37888
   716
[Matches
alexandra@37888
   717
(["univariate", "equation"],
alexandra@37888
   718
{Find = [Correct "solutions L"], With = [...], ...}),
alexandra@37888
   719
NoMatch (["linear", "univariate", ...], {Find = [...], ...}),
alexandra@37888
   720
NoMatch (["root", ...], ...), ...] : SpecifyTools.match list
alexandra@37888
   721
\end{verbatim}
alexandra@37888
   722
Der Problemtyp $P_n$ verwandelt x + 1 = 2 in die normale Form -1 + x = 0. Diese suche nach der jeweiligen Problemhierarchie kann mit Hilfe von einem ''proof state`` durchgeführt werden (siehe nächstes Kapitel).
alexandra@37882
   723
alexandra@37887
   724
alexandra@37882
   725
\chapter{Methods}
alexandra@37882
   726
Methods werden dazu verwendet, Probleme von \texttt{type} zu l\"osen. Sie sind in einer anderen Programmiersprache beschrieben. Die Sprache sieht einfach aus, hat aber im Hintergrund einen enormen Pr\"ufauffwand. So muss sich der Programmierer nicht mit technischen Details befassen, gleichzeitig k\"onnen aber auch keine falschen Anweisungen eingegeben werden.
alexandra@37882
   727
\section{Der ''Syntax`` des Scriptes}
alexandra@37882
   728
Syntax beschreibt den Zusammenhang der einzelnen Zeichen und Zeichenfolgen mit den Theorien.
alexandra@37882
   729
Er kann so definiert werden:
alexandra@37882
   730
\begin{tabbing}
alexandra@37882
   731
123\=123\=expr ::=\=$|\;\;$\=\kill
alexandra@37882
   732
\>script ::= {\tt Script} id arg$\,^*$ = body\\
alexandra@37882
   733
\>\>arg ::= id $\;|\;\;($ ( id :: type ) $)$\\
alexandra@37882
   734
\>\>body ::= expr\\
alexandra@37882
   735
\>\>expr ::= \>\>{\tt let} id = expr $($ ; id = expr$)^*$ {\tt in} expr\\
alexandra@37882
   736
\>\>\>$|\;$\>{\tt if} prop {\tt then} expr {\tt else} expr\\
alexandra@37882
   737
\>\>\>$|\;$\>listexpr\\
alexandra@37882
   738
\>\>\>$|\;$\>id\\
alexandra@37882
   739
\>\>\>$|\;$\>seqex id\\
alexandra@37882
   740
\>\>seqex ::= \>\>{\tt While} prop {\tt Do} seqex\\
alexandra@37882
   741
\>\>\>$|\;$\>{\tt Repeat} seqex\\
alexandra@37882
   742
\>\>\>$|\;$\>{\tt Try} seqex\\
alexandra@37882
   743
\>\>\>$|\;$\>seqex {\tt Or} seqex\\
alexandra@37882
   744
\>\>\>$|\;$\>seqex {\tt @@} seqex\\
alexandra@37882
   745
\>\>\>$|\;$\>tac $($ id $|$ listexpr $)^*$\\
alexandra@37882
   746
\>\>type ::= id\\
alexandra@37882
   747
\>\>tac ::= id
alexandra@37882
   748
\end{tabbing}}
ahirn@37877
   749
alexandra@37887
   750
\section{\"Uberpr\"ufung der Auswertung}
alexandra@37887
   751
Das Kontrollsystem arbeitet mit den folgenden Script-Ausdr\"ucken, die {\it tacticals} genannt werden:
alexandra@37887
   752
\begin{description}
alexandra@37887
   753
\item{{\tt while} prop {\tt Do} expr id} 
alexandra@37887
   754
\item{{\tt if} prop {\tt then} expr {\tt else} expr}
alexandra@37887
   755
\end{description}
alexandra@37887
   756
W\"ahrend die genannten Bezeichnungen das Kontrollsystem durch Auswertung der Formeln ausl\"osen, h\"angen die anderen von der Anwendbarkeit der Formel in den entsprechenden Unterbegriffen ab:
alexandra@37887
   757
\begin{description}
alexandra@37887
   758
\item{{\tt Repeat} expr id}
alexandra@37887
   759
\item{{\tt Try} expr id}
alexandra@37887
   760
\item{expr {\tt Or} expr id}
alexandra@37887
   761
\item{expr {\tt @@} expr id}
alexandra@37887
   762
\item xxx
alexandra@37887
   763
\end{description}
alexandra@37887
   764
alexandra@37887
   765
alexandra@37888
   766
alexandra@37888
   767
\chapter{Befehle von \isac{}}
alexandra@37888
   768
In diesem Kapitel werden alle schon zur Verf\"ugung stehenden Schritte aufgelistet. Diese Liste kann sich auf Grund von weiteren Entwicklungen von \isac{} noch \"andern.
alexandra@37888
   769
\newline \textbf{Init\_Proof\_Hid (dialogmode, formalization, specifictaion} gibt die eingegebenen Befehle weiter an die mathematic engine, wobei die beiden letzten Begriffe die Beispiele automatisch speichern. Es ist nicht vorgesehen, dass der Sch\"uler die Taktik verwendet.
alexandra@37888
   770
\newline \textbf{Init\_Proof} bildet mit einem ''proof tree`` ein leeres Modell.
alexandra@37888
   771
\newline \textbf{Model\_Problem problem} bestimmt ein problemtype, das wom\"oglich in der ''hierachy`` gefunden wurde, und verwendet es f\"u das Umformen.
alexandra@37888
   772
\newline \textbf{Add\_Given, Add\_Find, Add\_Relation formula} f\"ugt eine Formel in ein bestimmtes Feld eines Modells ein. Dies ist notwendig, solange noch kein Objekt f\"ur den Benutzer vorhanden ist, in dem man die Formel eingeben kann, und nicht die gew\"unschte Taktik und Formel von einer Liste w\"ahlen will.
alexandra@37888
   773
\newline \textbf{Specify\_Theorie theory, Specify\_Problem proble, Specify\_Method method} gibt das entsprechende Element des Basiswissens an.
alexandra@37888
   774
\newline \textbf{Refine\_Problem problem} sucht nach einem Problem in der hierachy, das auf das vorhandene zutrifft.
alexandra@37888
   775
\newline \textbf{Apply\_Method method} beendet das Modell und die Beschreibung. Danach wird die L\"osungmeldung ge\"offnet.
alexandra@37888
   776
\newline \textbf{Free\_Solve} beginnt eine L\"osungsmeldung ohne die Hilfe eine method.
alexandra@37888
   777
\newline \textbf{Rewrite theorem} bef\"ordert ein theorem in die aktuelle Formel und wandelt es demenetsprechend um. Wenn dies nicht m\"oglich ist, kommt eine Meldung mit ''error``.
alexandra@37888
   778
\newline \textbf{Rewrite\_Asm theorem} hat die gleiche Funktion wie Rewrite, speichert jedoch eine endg\"ultige Vorraussetzung des Theorems, anstatt diese zu sch\"atzen.
alexandra@37888
   779
\newline \textbf{Rewrite\_Set ruleset} hat \"ahnliche Funktionen wie Rewrite, gilt aber f\"ur einen ganzen Satz von Theorems, dem rule set.
alexandra@37888
   780
\newline \textbf{Rewrite\_Inst (substitution, theorem), Rewrite\_Set\_Inst (substitution, rule set)} ist vergleichbar mit besonderen Taktiken, ersetzt aber Konstanten in der Theorem, bevor es zu einer Anwendung kommt.
alexandra@37888
   781
alexandra@37888
   782
alexandra@37888
   783
alexandra@37887
   784
alexandra@37887
   785
alexandra@37887
   786
alexandra@37887
   787
ahirn@37877
   788
ahirn@37877
   789
ahirn@37877
   790
\newpage
ahirn@37877
   791
------------------------------- ALTER TEXT -------------------------------
ahirn@37877
   792
ahirn@37877
   793
\chapter{Do a calculational proof}
ahirn@37877
   794
First we list all the tactics available so far (this list may be extended during further development of \isac).
ahirn@37877
   795
ahirn@37877
   796
\section{Tactics for doing steps in calculations}
ahirn@37877
   797
\input{tactics}
ahirn@37877
   798
ahirn@37877
   799
\section{The functionality of the math engine}
ahirn@37877
   800
A proof is being started in the math engine {\tt me} by the tactic
ahirn@37877
   801
\footnote{In the present version a tactic is of type {\tt mstep}.}
ahirn@37877
   802
 {\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.
ahirn@37877
   803
ahirn@37877
   804
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 ...
ahirn@37877
   805
{\footnotesize\begin{verbatim}
ahirn@37877
   806
   ML> val fmz = ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x",
ahirn@37877
   807
                  "errorBound (eps=#0)","solutions L"];
ahirn@37877
   808
   val fmz =
ahirn@37877
   809
     ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)",
ahirn@37877
   810
      "solutions L"] : string list
ahirn@37877
   811
   ML>
ahirn@37877
   812
   ML> val spec as (dom, pbt, met) = ("SqRoot.thy",["univariate","equation"],
ahirn@37877
   813
                                 ("SqRoot.thy","no_met"));
ahirn@37877
   814
   val dom = "SqRoot.thy" : string
ahirn@37877
   815
   val pbt = ["univariate","equation"] : string list
ahirn@37877
   816
   val met = ("SqRoot.thy","no_met") : string * string
ahirn@37877
   817
\end{verbatim}}%size
ahirn@37877
   818
... 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.
ahirn@37877
   819
ahirn@37877
   820
Nevertheless this specification is sufficient for automatically solving the equation --- the appropriate method will be found by refinement within the hierarchy of problem types.
ahirn@37877
   821
ahirn@37877
   822
ahirn@37877
   823
\section{Initialize the calculation}
ahirn@37877
   824
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.
ahirn@37877
   825
{\footnotesize\begin{verbatim}
ahirn@37877
   826
   ML>  val (mID,m) = ("Init_Proof",Init_Proof (fmz, (dom,pbt,met)));
ahirn@37877
   827
   val mID = "Init_Proof" : string
ahirn@37877
   828
   val m =
ahirn@37877
   829
     Init_Proof
ahirn@37877
   830
       (["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)",
ahirn@37877
   831
         "solutions L"],("SqRoot.thy",[#,#],(#,#))) : mstep
ahirn@37877
   832
   ML>
ahirn@37877
   833
   ML>  val (p,_,f,nxt,_,pt) = me (mID,m) e_pos' c EmptyPtree;
ahirn@37877
   834
   val p = ([],Pbl) : pos'
ahirn@37877
   835
   val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout
ahirn@37877
   836
   val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])
ahirn@37877
   837
     : string * mstep
ahirn@37877
   838
   val pt =
ahirn@37877
   839
     Nd
ahirn@37877
   840
       (PblObj
ahirn@37877
   841
          {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#,
ahirn@37877
   842
           result=#,spec=#},[]) : ptree
ahirn@37877
   843
   \end{verbatim}}%size
ahirn@37877
   844
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'}).
ahirn@37877
   845
ahirn@37877
   846
We can convince ourselves, that the problem is still empty, by increasing {\tt Compiler.Control.Print.printDepth}:
ahirn@37877
   847
{\footnotesize\begin{verbatim}
ahirn@37877
   848
   ML> Compiler.Control.Print.printDepth:=8; (*4 default*)
ahirn@37877
   849
   val it = () : unit
ahirn@37877
   850
   ML>
ahirn@37877
   851
   ML> f;
ahirn@37877
   852
   val it =
ahirn@37877
   853
     Form'
ahirn@37877
   854
       (PpcKF
ahirn@37877
   855
          (0,EdUndef,0,Nundef,
ahirn@37877
   856
           (Problem [],
ahirn@37877
   857
            {Find=[Incompl "solutions []"],
ahirn@37877
   858
             Given=[Incompl "equality",Incompl "solveFor"],Relate=[],
ahirn@37877
   859
             Where=[False "matches (?a = ?b) e_"],With=[]}))) : mout
ahirn@37877
   860
\end{verbatim}}%size
ahirn@37877
   861
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).\\
ahirn@37877
   862
ahirn@37877
   863
{\it In the sequel we will omit output of the {\tt me} if it is not important for the respective context}.\\
ahirn@37877
   864
ahirn@37877
   865
In general, the dialog guide will hide the following two tactics {\tt Refine\_Tacitly} and {\tt Model\_Problem} from the user.
ahirn@37877
   866
{\footnotesize\begin{verbatim}
ahirn@37877
   867
   ML>  nxt;
ahirn@37877
   868
   val it = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])
ahirn@37877
   869
     : string * mstep
ahirn@37877
   870
   ML>
ahirn@37877
   871
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   872
   val nxt = ("Model_Problem",Model_Problem ["normalize","univariate","equation"])
ahirn@37877
   873
     : string * mstep
ahirn@37877
   874
   ML>
ahirn@37877
   875
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   876
\end{verbatim}}%size
ahirn@37877
   877
ahirn@37877
   878
ahirn@37877
   879
\section{The phase of modeling} 
ahirn@37877
   880
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}.
ahirn@37877
   881
ahirn@37877
   882
{\footnotesize\begin{verbatim}
ahirn@37877
   883
   ML>  nxt;
ahirn@37877
   884
   val it =
ahirn@37877
   885
     ("Add_Given",Add_Given "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)")
ahirn@37877
   886
     : string * mstep
ahirn@37877
   887
   ML>
ahirn@37877
   888
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   889
   val nxt = ("Add_Given",Add_Given "solveFor x") : string * mstep
ahirn@37877
   890
   ML>
ahirn@37877
   891
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   892
   val nxt = ("Add_Find",Add_Find "solutions L") : string * mstep
ahirn@37877
   893
   ML>
ahirn@37877
   894
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt; 
ahirn@37877
   895
   val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout
ahirn@37877
   896
\end{verbatim}}%size
ahirn@37877
   897
\noindent Now the problem is 'modeled', all items are input. We convince ourselves by increasing {\tt Compiler.Control.Print.printDepth} once more.
ahirn@37877
   898
{\footnotesize\begin{verbatim}
ahirn@37877
   899
   ML>  Compiler.Control.Print.printDepth:=8;
ahirn@37877
   900
   ML>  f;
ahirn@37877
   901
   val it =
ahirn@37877
   902
     Form'
ahirn@37877
   903
       (PpcKF
ahirn@37877
   904
          (0,EdUndef,0,Nundef,
ahirn@37877
   905
           (Problem [],
ahirn@37877
   906
            {Find=[Correct "solutions L"],
ahirn@37877
   907
             Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
   908
                    Correct "solveFor x"],Relate=[],Where=[],With=[]}))) : mout
ahirn@37877
   909
\end{verbatim}}%size
ahirn@37877
   910
%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.
ahirn@37877
   911
ahirn@37877
   912
\section{The phase of specification} 
ahirn@37877
   913
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.
ahirn@37877
   914
{\footnotesize\begin{verbatim}
ahirn@37877
   915
ML> nxt;
ahirn@37877
   916
   val it = ("Specify_Domain",Specify_Domain "SqRoot.thy") : string * mstep
ahirn@37877
   917
   ML>
ahirn@37877
   918
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   919
   val nxt =
ahirn@37877
   920
     ("Specify_Problem",Specify_Problem ["normalize","univariate","equation"])
ahirn@37877
   921
     : string * mstep
ahirn@37877
   922
   val pt =
ahirn@37877
   923
     Nd
ahirn@37877
   924
       (PblObj
ahirn@37877
   925
          {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#,
ahirn@37877
   926
              result=#,spec=#},[]) : ptree
ahirn@37877
   927
\end{verbatim}}%size
ahirn@37877
   928
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.
ahirn@37877
   929
{\footnotesize\begin{verbatim}
ahirn@37877
   930
   ML> val nxt = ("Specify_Problem",
ahirn@37877
   931
               Specify_Problem ["polynomial","univariate","equation"]);
ahirn@37877
   932
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   933
   val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout
ahirn@37877
   934
   val nxt =
ahirn@37877
   935
     ("Refine_Problem",Refine_Problem ["normalize","univariate","equation"])
ahirn@37877
   936
     : string * mstep
ahirn@37877
   937
   ML>
ahirn@37877
   938
   ML> val nxt = ("Specify_Problem",
ahirn@37877
   939
               Specify_Problem ["linear","univariate","equation"]);
ahirn@37877
   940
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   941
   val f =
ahirn@37877
   942
     Form'
ahirn@37877
   943
       (PpcKF
ahirn@37877
   944
          (0,EdUndef,0,Nundef,
ahirn@37877
   945
           (Problem ["linear","univariate","equation"],
ahirn@37877
   946
            {Find=[Correct "solutions L"],
ahirn@37877
   947
             Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
   948
                    Correct "solveFor x"],Relate=[],
ahirn@37877
   949
             Where=[False
ahirn@37877
   950
                    "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
ahirn@37877
   951
             With=[]}))) : mout 
ahirn@37877
   952
\end{verbatim}}%size
ahirn@37877
   953
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"]}.
ahirn@37877
   954
{\footnotesize\begin{verbatim}
ahirn@37877
   955
   ML> val nxt = ("Refine_Problem",
ahirn@37877
   956
                  Refine_Problem ["linear","univariate","equation
ahirn@37877
   957
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   958
   val f = Problems (RefinedKF [NoMatch #]) : mout
ahirn@37877
   959
   ML>
ahirn@37877
   960
   ML>  Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4;
ahirn@37877
   961
   val f =
ahirn@37877
   962
     Problems
ahirn@37877
   963
       (RefinedKF
ahirn@37877
   964
          [NoMatch
ahirn@37877
   965
             (["linear","univariate","equation"],
ahirn@37877
   966
              {Find=[Correct "solutions L"],
ahirn@37877
   967
               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
   968
                      Correct "solveFor x"],Relate=[],
ahirn@37877
   969
               Where=[False
ahirn@37877
   970
                     "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
ahirn@37877
   971
               With=[]})]) : mout
ahirn@37877
   972
   ML>
ahirn@37877
   973
   ML> val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation"]);
ahirn@37877
   974
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   975
   val f =
ahirn@37877
   976
     Problems
ahirn@37877
   977
       (RefinedKF [Matches #,NoMatch #,NoMatch #,NoMatch #,NoMatch #,Matches #])
ahirn@37877
   978
     : mout
ahirn@37877
   979
   ML>
ahirn@37877
   980
   ML>
ahirn@37877
   981
   ML>  Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4;
ahirn@37877
   982
   val f =
ahirn@37877
   983
     Problems
ahirn@37877
   984
       (RefinedKF
ahirn@37877
   985
          [Matches
ahirn@37877
   986
             (["univariate","equation"],
ahirn@37877
   987
              {Find=[Correct "solutions L"],
ahirn@37877
   988
               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
   989
                      Correct "solveFor x"],Relate=[],
ahirn@37877
   990
               Where=[Correct
ahirn@37877
   991
               With=[]}),
ahirn@37877
   992
           NoMatch
ahirn@37877
   993
             (["linear","univariate","equation"],
ahirn@37877
   994
              {Find=[Correct "solutions L"],
ahirn@37877
   995
               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
   996
                      Correct "solveFor x"],Relate=[],
ahirn@37877
   997
               Where=[False
ahirn@37877
   998
                      "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
ahirn@37877
   999
                  With=[]}),
ahirn@37877
  1000
           NoMatch
ahirn@37877
  1001
             ...
ahirn@37877
  1002
             ...   
ahirn@37877
  1003
           Matches
ahirn@37877
  1004
             (["normalize","univariate","equation"],
ahirn@37877
  1005
              {Find=[Correct "solutions L"],
ahirn@37877
  1006
               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
  1007
                      Correct "solveFor x"],Relate=[],Where=[],With=[]})]) : mout
ahirn@37877
  1008
\end{verbatim}}%size
ahirn@37877
  1009
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~!
ahirn@37877
  1010
ahirn@37877
  1011
\section{The phase of solving} 
ahirn@37877
  1012
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}:
ahirn@37877
  1013
{\footnotesize\begin{verbatim} 
ahirn@37877
  1014
   ML> nxt;
ahirn@37877
  1015
   val it = ("Apply_Method",Apply_Method ("SqRoot.thy","norm_univar_equation"))
ahirn@37877
  1016
     : string * mstep
ahirn@37877
  1017
   ML>
ahirn@37877
  1018
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1019
   val f =
ahirn@37877
  1020
     Form' (FormKF (~1,EdUndef,1,Nundef,"(x + #1) * (x + #2) = x ^^^ #2 + #8"))
ahirn@37877
  1021
   val nxt =
ahirn@37877
  1022
     ("Rewrite", Rewrite
ahirn@37877
  1023
        ("rnorm_equation_add","~ ?b =!= #0 ==> (?a = ?b) = (?a + #-1 * ?b = #0)"))
ahirn@37877
  1024
   ML>
ahirn@37877
  1025
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1026
   val f =
ahirn@37877
  1027
     Form' (FormKF (~1,EdUndef,1,Nundef,
ahirn@37877
  1028
           "(x + #1) * (x + #2) + #-1 * (x ^^^ #2 + #8) = #0")) : mout
ahirn@37877
  1029
   val nxt = ("Rewrite_Set",Rewrite_Set "SqRoot_simplify") : string * mstep
ahirn@37877
  1030
   ML>
ahirn@37877
  1031
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1032
   val f = Form' (FormKF (~1,EdUndef,1,Nundef,"#-6 + #3 * x = #0")) : mout
ahirn@37877
  1033
   val nxt = ("Subproblem",Subproblem ("SqRoot.thy",[#,#])) : string * mstep
ahirn@37877
  1034
\end{verbatim}}%size
ahirn@37877
  1035
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:
ahirn@37877
  1036
{\footnotesize\begin{verbatim}
ahirn@37877
  1037
   ML> nxt;
ahirn@37877
  1038
   val it = ("Subproblem",Subproblem ("SqRoot.thy",["univariate","equation"]))
ahirn@37877
  1039
   ML>   
ahirn@37877
  1040
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1041
   val f =
ahirn@37877
  1042
     Form' (FormKF
ahirn@37877
  1043
          (~1,EdUndef,1,Nundef,"Subproblem (SqRoot.thy, [univariate, equation])"))
ahirn@37877
  1044
     : mout
ahirn@37877
  1045
   val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])
ahirn@37877
  1046
   ML>
ahirn@37877
  1047
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1048
   val nxt = ("Model_Problem",Model_Problem ["linear","univariate","equation"])
ahirn@37877
  1049
\end{verbatim}}%size
ahirn@37877
  1050
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.
ahirn@37877
  1051
ahirn@37877
  1052
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.
ahirn@37877
  1053
ahirn@37877
  1054
ahirn@37877
  1055
\section{The final phase: check the post-condition}
ahirn@37877
  1056
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.
ahirn@37877
  1057
ahirn@37877
  1058
Thus the post-condition is just mentioned, in our example for both, the problem and the subproblem:
ahirn@37877
  1059
{\footnotesize\begin{verbatim}
ahirn@37877
  1060
   ML> nxt;
ahirn@37877
  1061
   val it = ("Check_Postcond",Check_Postcond ["linear","univariate","equation"])
ahirn@37877
  1062
   ML>
ahirn@37877
  1063
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1064
   val f = Form' (FormKF (~1,EdUndef,1,Nundef,"[x = #2]")) : mout
ahirn@37877
  1065
   val nxt =
ahirn@37877
  1066
     ("Check_Postcond",Check_Postcond ["normalize","univariate","equation"])
ahirn@37877
  1067
   ML>
ahirn@37877
  1068
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1069
   val f = Form' (FormKF (~1,EdUndef,0,Nundef,"[x = #2]")) : mout
ahirn@37877
  1070
   val nxt = ("End_Proof'",End_Proof') : string * mstep
ahirn@37877
  1071
\end{verbatim}}%size
ahirn@37877
  1072
The next tactic proposed by the system, {\tt End\_Proof'} indicates that the proof has finished successfully.\\
ahirn@37877
  1073
ahirn@37877
  1074
{\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~!}
ahirn@37877
  1075
ahirn@37877
  1076
ahirn@37877
  1077
ahirn@37877
  1078
\part{Systematic description}
ahirn@37877
  1079
ahirn@37877
  1080
ahirn@37877
  1081
\chapter{The structure of the knowledge base}
ahirn@37877
  1082
ahirn@37877
  1083
\section{Tactics and data}
ahirn@37877
  1084
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
ahirn@37877
  1085
\footnote{Some of these items are fetched by the tactics from intermediate storage within the ME, and not directly from the KB.}
ahirn@37877
  1086
. The items are listed in alphabetical order in Tab.\ref{kb-items} on p.\pageref{kb-items}.
ahirn@37877
  1087
{\begin{table}[h]
ahirn@37877
  1088
\caption{Atomic items of the KB} \label{kb-items}
ahirn@37877
  1089
%\tabcolsep=0.3mm
ahirn@37877
  1090
\begin{center}
ahirn@37877
  1091
\def\arraystretch{1.0}
ahirn@37877
  1092
\begin{tabular}{lp{9.0cm}}
ahirn@37877
  1093
abbrevation & description \\
ahirn@37877
  1094
\hline
ahirn@37877
  1095
&\\
ahirn@37877
  1096
{\it calc\_list}
ahirn@37877
  1097
& associationlist of the evaluation-functions {\it eval\_fn}\\
ahirn@37877
  1098
{\it eval\_fn}
ahirn@37877
  1099
& evaluation-function for numerals and for predicates coded in SML\\
ahirn@37877
  1100
{\it eval\_rls   }
ahirn@37877
  1101
& ruleset {\it rls} for simplifying expressions with {\it eval\_fn}s\\
ahirn@37877
  1102
{\it fmz}
ahirn@37877
  1103
& formalization, i.e. a minimal formula representation of an example \\
ahirn@37877
  1104
{\it met}
ahirn@37877
  1105
& a method, i.e. a datastructure holding all informations for the solving phase ({\it rew\_ord}, {\it scr}, etc.)\\
ahirn@37877
  1106
{\it metID}
ahirn@37877
  1107
& reference to a {\it met}\\
ahirn@37877
  1108
{\it op}
ahirn@37877
  1109
& operator as key to an {\it eval\_fn} in a {\it calc\_list}\\
ahirn@37877
  1110
{\it pbl}
ahirn@37877
  1111
& problem, i.e. a node in the problem-hierarchy\\
ahirn@37877
  1112
{\it pblID}
ahirn@37877
  1113
& reference to a {\it pbl}\\
ahirn@37877
  1114
{\it rew\_ord}
ahirn@37877
  1115
& rewrite-order\\
ahirn@37877
  1116
{\it rls}
ahirn@37877
  1117
& ruleset, i.e. a datastructure holding theorems {\it thm} and operators {\it op} for simplification (with a {\it rew\_ord})\\
ahirn@37877
  1118
{\it Rrls}
ahirn@37877
  1119
& ruleset for 'reverse rewriting' (an \isac-technique generating stepwise rewriting, e.g. for cancelling fractions)\\
ahirn@37877
  1120
{\it scr}
ahirn@37877
  1121
& script describing algorithms by tactics, part of a {\it met} \\
ahirn@37877
  1122
{\it norm\_rls}
ahirn@37877
  1123
& special ruleset calculating a normalform, associated with a {\it thy}\\
ahirn@37877
  1124
{\it spec}
ahirn@37877
  1125
& specification, i.e. a tripel ({\it thyID, pblID, metID})\\
ahirn@37877
  1126
{\it subs}
ahirn@37877
  1127
& substitution, i.e. a list of variable-value-pairs\\
ahirn@37877
  1128
{\it term}
ahirn@37877
  1129
& Isabelle term, i.e. a formula\\
ahirn@37877
  1130
{\it thm}
ahirn@37877
  1131
& theorem\\     
ahirn@37877
  1132
{\it thy}
ahirn@37877
  1133
& theory\\
ahirn@37877
  1134
{\it thyID}
ahirn@37877
  1135
& reference to a {\it thy} \\
ahirn@37877
  1136
\end{tabular}\end{center}\end{table}
ahirn@37877
  1137
}
ahirn@37877
  1138
The relations between tactics and data items are shown in Tab.\ref{tac-kb}on p.\pageref{tac-kb}.
ahirn@37877
  1139
{\def\arraystretch{1.2}
ahirn@37877
  1140
\begin{table}[h]
ahirn@37877
  1141
\caption{Which tactic uses which KB's item~?} \label{tac-kb}
ahirn@37877
  1142
\tabcolsep=0.3mm
ahirn@37877
  1143
\begin{center}
ahirn@37877
  1144
\begin{tabular}{|ll||cccc|ccc|cccc|} \hline
ahirn@37877
  1145
tactic  &input &    &    &    &norm\_&   &rew\_&rls &eval\_&eval\_&calc\_&   \\
ahirn@37877
  1146
        &      &thy &scr &Rrls&rls  &thm &ord  &Rrls&fn    &rls   &list  &dsc\\
ahirn@37877
  1147
\hline\hline
ahirn@37877
  1148
Init\_Proof
ahirn@37877
  1149
        &fmz   & x  &    &    & x   &    &     &    &      &      &      & x \\
ahirn@37877
  1150
        &spec  &    &    &    &     &    &     &    &      &      &      &   \\
ahirn@37877
  1151
\hline
ahirn@37877
  1152
\multicolumn{13}{|l|}{model phase}\\
ahirn@37877
  1153
\hline
ahirn@37877
  1154
Add\_*  &term  & x  &    &    & x   &    &     &    &      &      &      & x \\
ahirn@37877
  1155
FormFK  &model & x  &    &    & x   &    &     &    &      &      &      & x \\
ahirn@37877
  1156
\hline
ahirn@37877
  1157
\multicolumn{13}{|l|}{specify phase}\\
ahirn@37877
  1158
\hline
ahirn@37877
  1159
Specify\_Theory 
ahirn@37877
  1160
        &thyID & x  &    &    & x   &    &     &    & x    & x    &      & x \\
ahirn@37877
  1161
Specify\_Problem 
ahirn@37877
  1162
        &pblID & x  &    &    & x   &    &     &    & x    & x    &      & x \\
ahirn@37877
  1163
Refine\_Problem 
ahirn@37877
  1164
           &pblID & x  &    &    & x   &    &     &    & x    & x    &      & x \\
ahirn@37877
  1165
Specify\_Method 
ahirn@37877
  1166
        &metID & x  &    &    & x   &    &     &    & x    & x    &      & x \\
ahirn@37877
  1167
Apply\_Method 
ahirn@37877
  1168
        &metID & x  & x  &    & x   &    &     &    & x    & x    &      & x \\
ahirn@37877
  1169
\hline
ahirn@37877
  1170
\multicolumn{13}{|l|}{solve phase}\\
ahirn@37877
  1171
\hline
ahirn@37877
  1172
Rewrite,\_Inst 
ahirn@37877
  1173
        &thm   & x  & x  &    &     & x  &met  &    & x    &met   &      &   \\
ahirn@37877
  1174
Rewrite, Detail
ahirn@37877
  1175
        &thm   & x  & x  &    &     & x  &rls  &    & x    &rls   &      &   \\
ahirn@37877
  1176
Rewrite, Detail
ahirn@37877
  1177
        &thm   & x  & x  &    &     & x  &Rrls &    & x    &Rrls  &      &   \\
ahirn@37877
  1178
Rewrite\_Set,\_Inst
ahirn@37877
  1179
        &rls   & x  & x  &    &     &    &     & x  & x    & x    &      &   \\
ahirn@37877
  1180
Calculate  
ahirn@37877
  1181
        &op    & x  & x  &    &     &    &     &    &      &      & x    &   \\
ahirn@37877
  1182
Substitute 
ahirn@37877
  1183
        &subs  & x  &    &    & x   &    &     &    &      &      &      &   \\
ahirn@37877
  1184
        &      &    &    &    &     &    &     &    &      &      &      &   \\
ahirn@37877
  1185
SubProblem 
ahirn@37877
  1186
        &spec  & x  & x  &    & x   &    &     &    & x    & x    &      & x \\
ahirn@37877
  1187
        &fmz   &    &    &    &     &    &     &    &      &      &      &   \\
ahirn@37877
  1188
\hline
ahirn@37877
  1189
\end{tabular}\end{center}\end{table}
ahirn@37877
  1190
}
ahirn@37877
  1191
ahirn@37877
  1192
\section{\isac's theories}
ahirn@37877
  1193
\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}.
ahirn@37877
  1194
ahirn@37877
  1195
\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}).
ahirn@37877
  1196
ahirn@37877
  1197
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~!
ahirn@37877
  1198
ahirn@37877
  1199
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.
ahirn@37877
  1200
{\begin{table}[h]
ahirn@37877
  1201
\caption{Theories in \isac-version I} \label{theories}
ahirn@37877
  1202
%\tabcolsep=0.3mm
ahirn@37877
  1203
\begin{center}
ahirn@37877
  1204
\def\arraystretch{1.0}
ahirn@37877
  1205
\begin{tabular}{lp{9.0cm}}
ahirn@37877
  1206
theory & description \\
ahirn@37877
  1207
\hline
ahirn@37877
  1208
&\\
ahirn@37877
  1209
ListI.thy
ahirn@37877
  1210
& assigns identifiers to the functions defined in {\tt Isabelle2002/src/HOL/List.thy} and (intermediatly~?) defines some more list functions\\
ahirn@37877
  1211
ListI.ML
ahirn@37877
  1212
& {\tt eval\_fn} for the additional list functions\\
ahirn@37877
  1213
Tools.thy
ahirn@37877
  1214
& functions required for the evaluation of scripts\\
ahirn@37877
  1215
Tools.ML
ahirn@37877
  1216
& the respective {\tt eval\_fn}s\\
ahirn@37877
  1217
Script.thy
ahirn@37877
  1218
& prerequisites for scripts: types, tactics, tacticals,\\
ahirn@37877
  1219
Script.ML
ahirn@37877
  1220
& sets of tactics and functions for internal use\\
ahirn@37877
  1221
& \\
ahirn@37877
  1222
\hline
ahirn@37877
  1223
& \\
ahirn@37877
  1224
Typefix.thy
ahirn@37877
  1225
& an intermediate hack for escaping type errors\\
ahirn@37877
  1226
Descript.thy
ahirn@37877
  1227
& {\it description}s for the formulas in {\it model}s and {\it problem}s\\
ahirn@37877
  1228
Atools
ahirn@37877
  1229
& (re-)definition of operators; general predicates and functions for preconditions; theorems for the {\tt eval\_rls}\\
ahirn@37877
  1230
Float
ahirn@37877
  1231
& floating point numerals\\
ahirn@37877
  1232
Equation
ahirn@37877
  1233
& basic notions for equations and equational systems\\
ahirn@37877
  1234
Poly
ahirn@37877
  1235
& polynomials\\
ahirn@37877
  1236
PolyEq
ahirn@37877
  1237
& polynomial equations and equational systems \\
ahirn@37877
  1238
Rational.thy
ahirn@37877
  1239
& additional theorems for rationals\\
ahirn@37877
  1240
Rational.ML
ahirn@37877
  1241
& cancel, add and simplify rationals using (a generalization of) Euclids algorithm; respective reverse rulesets\\
ahirn@37877
  1242
RatEq
ahirn@37877
  1243
& equations on rationals\\
ahirn@37877
  1244
Root
ahirn@37877
  1245
& radicals; calculate normalform; respective reverse rulesets\\
ahirn@37877
  1246
RootEq
ahirn@37877
  1247
& equations on roots\\
ahirn@37877
  1248
RatRootEq
ahirn@37877
  1249
& equations on rationals and roots (i.e. on terms containing both operations)\\
ahirn@37877
  1250
Vect
ahirn@37877
  1251
& vector analysis\\
ahirn@37877
  1252
Trig
ahirn@37877
  1253
& trigonometriy\\
ahirn@37877
  1254
LogExp
ahirn@37877
  1255
& logarithms and exponential functions\\
ahirn@37877
  1256
Calculus
ahirn@37877
  1257
& nonstandard analysis\\
ahirn@37877
  1258
Diff
ahirn@37877
  1259
& differentiation\\
ahirn@37877
  1260
DiffApp
ahirn@37877
  1261
& applications of differentiaten (maxima-minima-problems)\\
ahirn@37877
  1262
Test
ahirn@37877
  1263
& (old) data for the test suite\\
ahirn@37877
  1264
Isac
ahirn@37877
  1265
& collects all \isac-theoris.\\
ahirn@37877
  1266
\end{tabular}\end{center}\end{table}
ahirn@37877
  1267
}
ahirn@37877
  1268
ahirn@37877
  1269
ahirn@37877
  1270
\section{Data in {\tt *.thy}- and {\tt *.ML}-files}
ahirn@37877
  1271
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}.
ahirn@37877
  1272
{\begin{table}[h]
ahirn@37877
  1273
\caption{Data in {\tt *.thy}- and {\tt *.ML}-files} \label{thy-ML}
ahirn@37877
  1274
\tabcolsep=2.0mm
ahirn@37877
  1275
\begin{center}
ahirn@37877
  1276
\def\arraystretch{1.0}
ahirn@37877
  1277
\begin{tabular}{llp{7.7cm}}
ahirn@37877
  1278
file & data & description \\
ahirn@37877
  1279
\hline
ahirn@37877
  1280
& &\\
ahirn@37877
  1281
{\tt *.thy}
ahirn@37877
  1282
& consts 
ahirn@37877
  1283
& operators, predicates, functions, script-names ('{\tt Script} name \dots{\tt arguments}')
ahirn@37877
  1284
\\
ahirn@37877
  1285
& rules  
ahirn@37877
  1286
& theorems: \isac{} uses Isabelles theorems if possible; additional theorems analoguous to such existing in Isabelle get the Isabelle-identifier attached an {\it I}
ahirn@37877
  1287
\\& &\\
ahirn@37877
  1288
{\tt *.ML}
ahirn@37877
  1289
& {\tt theory' :=} 
ahirn@37877
  1290
& the theory defined by the actual {\tt *.thy}-file is made accessible to \isac
ahirn@37877
  1291
\\
ahirn@37877
  1292
& {\tt eval\_fn}
ahirn@37877
  1293
& 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}
ahirn@37877
  1294
\\
ahirn@37877
  1295
& {\tt *\_simplify} 
ahirn@37877
  1296
& 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}
ahirn@37877
  1297
\\
ahirn@37877
  1298
& {\tt norm\_rls :=}
ahirn@37877
  1299
& the canonical simplifier {\tt *\_simplify} is stored such that it is accessible for \isac
ahirn@37877
  1300
\\
ahirn@37877
  1301
& {\tt rew\_ord' :=}
ahirn@37877
  1302
& the same for rewrite orders, if needed outside of one particular ruleset
ahirn@37877
  1303
\\
ahirn@37877
  1304
& {\tt ruleset' :=}
ahirn@37877
  1305
& the same for rulesets (ordinary rulesets, reverse rulesets and {\tt eval\_rls})
ahirn@37877
  1306
\\
ahirn@37877
  1307
& {\tt calc\_list :=}
ahirn@37877
  1308
& the same for {\tt eval\_fn}s, if needed outside of one particular ruleset (e.g. for a tactic {\tt Calculate} in a script)
ahirn@37877
  1309
\\
ahirn@37877
  1310
& {\tt store\_pbl}
ahirn@37877
  1311
& problems defined within this {\tt *.ML}-file are made accessible for \isac
ahirn@37877
  1312
\\
ahirn@37877
  1313
& {\tt methods :=}
ahirn@37877
  1314
& methods defined within this {\tt *.ML}-file are made accessible for \isac
ahirn@37877
  1315
\\
ahirn@37877
  1316
\end{tabular}\end{center}\end{table}
ahirn@37877
  1317
}
ahirn@37877
  1318
The order of the data-items within the theories should adhere to the order given in this list.
ahirn@37877
  1319
ahirn@37877
  1320
\section{Formal description of the problem-hierarchy}
ahirn@37877
  1321
%for Richard Lang
ahirn@37877
  1322
ahirn@37877
  1323
\section{Script tactics}
ahirn@37877
  1324
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.
ahirn@37877
  1325
ahirn@37877
  1326
ahirn@37877
  1327
ahirn@37877
  1328
ahirn@37877
  1329
ahirn@37877
  1330
\part{Authoring on the knowledge}
ahirn@37877
  1331
ahirn@37877
  1332
ahirn@37877
  1333
\section{Add a theorem}
ahirn@37877
  1334
\section{Define and add a problem}
ahirn@37877
  1335
\section{Define and add a predicate}
ahirn@37877
  1336
\section{Define and add a method}
ahirn@37877
  1337
\section{}
ahirn@37877
  1338
\section{}
ahirn@37877
  1339
\section{}
ahirn@37877
  1340
\section{}
ahirn@37877
  1341
ahirn@37877
  1342
ahirn@37877
  1343
ahirn@37877
  1344
\newpage
ahirn@37877
  1345
\bibliography{bib/isac,bib/from-theses}
ahirn@37877
  1346
ahirn@37877
  1347
\end{document}