doc-src/isac/mat-eng-de.tex
author Alexandra Hirn <alexandra.hirn@hotmail.com>
Thu, 05 Aug 2010 11:03:47 +0200
branchlatex-isac-doc
changeset 37892 99c8ed9d3c99
parent 37891 6a55c9954896
child 37896 3e1e43aa9043
permissions -rw-r--r--
result of trainee summer work
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]}
alexandra@37889
    17
\author{Alexandra Hirn und Eva Rott\\
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''}
alexandra@37891
    31
\paragraph{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
alexandra@37891
    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
alexandra@37891
    38
Das Dokument ist eigenst\"andig; Basiswissen \"uber SML (f\"ur 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}
alexandra@37891
    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}
alexandra@37891
    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 Problemen, f\"ur L\"osungsmethoden etc. Wir beginnen mit mathematischen Formeln.
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}
alexandra@37891
    65
   > "a + b * 3";
alexandra@37891
    66
      val it = "a + b * 3" : string
ahirn@37877
    67
\end{verbatim}}
alexandra@37892
    68
\noindent ``a + b * 3'' ist also ein string (eine Zeichenfolge). In dieser Form weiss der Computer nicht, dass z.B. eine Multiplikation {\em vor} einer Addition zu rechnen ist. Isabelle braucht dazu eine andere Darstellung f\"ur Formeln. In diese kann man mit der Funktion {\tt str2term} (string to term) umrechnen:
ahirn@37877
    69
{\footnotesize\begin{verbatim}
alexandra@37891
    70
   > str2term "a + b * 3";
alexandra@37891
    71
      val it =
alexandra@37891
    72
         Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37891
    73
               Free ("a", "RealDef.real") $
alexandra@37891
    74
            (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
alexandra@37891
    75
               ...) : Term.term
ahirn@37877
    76
\end{verbatim}}
alexandra@37892
    77
\noindent Diese Form heisst {\tt term} und ist nicht f\"ur den Menschen zum lesen gedacht. Isabelle braucht sie aber intern zum Rechnen. Wir wollen sie mit Hilfe von {\tt val} (value) auf der Variable {\tt t} speichern:
ahirn@37877
    78
{\footnotesize\begin{verbatim}
alexandra@37891
    79
   > val t = str2term "a + b * 3";
alexandra@37891
    80
      val t =  
alexandra@37891
    81
         Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37891
    82
               Free ("a", "RealDef.real") $
alexandra@37891
    83
            (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
alexandra@37891
    84
               ...) : Term.term
ahirn@37877
    85
\end{verbatim}
alexandra@37892
    86
Von dieser Variable {\tt t} kann man den Wert jederzeit abrufen:
alexandra@37891
    87
\footnotesize\begin{verbatim}
alexandra@37891
    88
   > t;
alexandra@37891
    89
      val it =
alexandra@37891
    90
         Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37891
    91
               Free ("a", "RealDef.real") $
alexandra@37891
    92
            (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
alexandra@37891
    93
               ...) : Term.term
alexandra@37891
    94
\end{verbatim}
alexandra@37892
    95
Der auf {\tt t} gespeicherte Term kann einer Funktion {\tt atomty} \"ubergeben werden, die diesen in einer dritten Form zeigt:
ahirn@37877
    96
{\footnotesize\begin{verbatim}
alexandra@37891
    97
   > atomty term;
ahirn@37877
    98
 
alexandra@37891
    99
   ***
alexandra@37891
   100
   *** Const (op +, [real, real] => real)
alexandra@37891
   101
   *** . Free (a, real)
alexandra@37891
   102
   *** . Const (op *, [real, real] => real)
alexandra@37891
   103
   *** . . Free (b, real)
alexandra@37891
   104
   *** . . Free (3, real)
alexandra@37891
   105
   ***
ahirn@37877
   106
 
alexandra@37891
   107
   val it = () : unit
alexandra@37892
   108
\end{verbatim}
alexandra@37891
   109
Diese Darstellung nennt man ``abstract syntax'' und macht unmittelbar klar, dass man a und b nicht addieren kann, weil ein Mal vorhanden ist.
alexandra@37892
   110
\newline Es gibt noch eine vierte Art von Term, den cterm. Er wird weiter unten verwendet, weil er sich als string lesbar darstellt.
ahirn@37877
   111
ahirn@37877
   112
\section{``Theory'' und ``Parsing``}
alexandra@37892
   113
Der Unterschied zwischen \isac{} und bisheriger Mathematiksoftware (GeoGebra, Mathematica, Maple, Derive etc.) ist, dass das mathematische Wissen nicht im Programmcode steht, sondern in sogenannten theories (Theorien).
alexandra@37892
   114
Dort wird das Mathematikwissen in einer f\"ur nicht Programmierer lesbaren Form geschrieben. Das Wissen von \isac{} ist in folgenden Theorien entahlten:
ahirn@37877
   115
{\footnotesize\begin{verbatim}
alexandra@37891
   116
   > Isac.thy;
alexandra@37891
   117
      val it =
alexandra@37891
   118
         {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp,
alexandra@37891
   119
         Sum_Type, Relation, Record, Inductive, Transitive_Closure,
alexandra@37891
   120
         Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power,
alexandra@37891
   121
         SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe,
alexandra@37891
   122
         Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv,
alexandra@37891
   123
         IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map,
alexandra@37891
   124
         Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd,
alexandra@37891
   125
         RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow,
alexandra@37891
   126
         Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix,
alexandra@37891
   127
         Float, ComplexI, Descript, Atools, Simplify, Poly, Rational, PolyMinus,
alexandra@37891
   128
         Equation, LinEq, Root, RootEq, RatEq, RootRat, RootRatEq, PolyEq, Vect,
alexandra@37891
   129
         Calculus, Trig, LogExp, Diff, DiffApp, Integrate, EqSystem, Biegelinie,
alexandra@37891
   130
         AlgEin, Test, Isac} : Theory.theory
ahirn@37877
   131
\end{verbatim}
alexandra@37892
   132
{\tt ProtoPure} und {\tt CPure} enthalten diese logischen Grundlagen, die in {\tt HOL} und den nachfolgenden Theorien erweitert werden. \isac{} als letzte Theorie beinhaltet das gesamte Wissen.
alexandra@37891
   133
Dass das Mal vor dem Plus berechnet wird, ist so festgelegt:
alexandra@37892
   134
\footnotesize\begin{verbatim}
alexandra@37892
   135
   class plus =
alexandra@37892
   136
   fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "+" 65)
alexandra@37892
   137
alexandra@37892
   138
   class minus =
alexandra@37892
   139
   fixes minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "-" 65)
alexandra@37892
   140
alexandra@37892
   141
   class uminus =
alexandra@37892
   142
   fixes uminus :: "'a \<Rightarrow> 'a" ("- _" [81] 80)
alexandra@37892
   143
alexandra@37892
   144
   class times =
alexandra@37892
   145
   fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "*" 70) 
ahirn@37877
   146
\end{verbatim}
alexandra@37892
   147
{\tt infix} gibt an, dass der Operator zwischen den Zahlen steht und nicht, wie in ''abstract syntax``, vorne oben.
alexandra@37892
   148
Die Zahlen rechts davon legen die Priorit\"at fest. 70 f\"ur Mal ist gr\"osser als 65 f\"ur Plus und wird daher zuerst berechnet.
ahirn@37877
   149
alexandra@37892
   150
Wollen Sie wissen, wie die einzelnen Rechengesetze aussehen, k\"onnen Sie im Internet folgenden Link ansehen: http://isabelle.in.tum.de/dist/library/HOL/Groups.html
alexandra@37892
   151
alexandra@37892
   152
\paragraph{} Der Vorgang, bei dem aus einem {\tt string} ein Term entsteht, nennt man Parsing. Dazu wird Wissen aus der Theorie ben\"otigt, denn {\tt str2term} nimmt intern eine parse-Funktion, bei der immer das gesamte \isac{}-Wissen verwendet wird. Bei dieser Funktion wird weiters festgelegt, aus welcher Theorie das Wissen genommen werden soll.
alexandra@37892
   153
\footnotesize\begin{verbatim}
alexandra@37892
   154
   > parse Isac.thy "a + b";
alexandra@37892
   155
      val it = Some "a + b" : Thm.cterm Library.option
ahirn@37877
   156
\end{verbatim}
alexandra@37892
   157
Um sich das Weiterrechnen zu erleichtern, kann das Ergebnis vom Parsing auf eine Variable, wie zum Beispiel {\tt t} gespeichert werden:
alexandra@37892
   158
\footnotesize\begin{verbatim}
alexandra@37892
   159
   > val t = parse Isac.thy "a + b";
alexandra@37892
   160
      val t = Some "a + b" : Thm.cterm Library.option
alexandra@37892
   161
\end{verbatim}
alexandra@37892
   162
{\tt Some} bedeutet, dass das n\"otige Wissen vorhanden ist, um die Rechnung durchzuf\"uhren. {\tt None} zeigt uns, dass das Wissen fehlt oder ein Fehler aufgetreten ist. Daher sieht man im folgenden Beispiel, dass {\tt HOL.thy} nicht ausreichend Wissen enth\"alt:
alexandra@37892
   163
\footnotesize\begin{verbatim}
alexandra@37892
   164
   > parse HOL.thy "a + b";
alexandra@37892
   165
      val it = None : Thm.cterm Library.option
alexandra@37892
   166
\end{verbatim}
alexandra@37892
   167
Anschliessend zeigen wir Ihnen noch ein zweites Beispiel, bei dem sowohl ein Fehler aufgetreten ist, als auch das Wissen fehlt:
alexandra@37892
   168
\footnotesize\begin{verbatim}
alexandra@37892
   169
   > parse Isac.thy "a + ";
alexandra@37892
   170
      *** Inner syntax error: unexpected end of input
alexandra@37892
   171
      *** Expected tokens: "contains_root" "is_root_free" "q_" "M_b" "M_b'"
alexandra@37892
   172
      *** "Integral" "differentiate" "E_" "some_of" "||" "|||" "argument_in"
alexandra@37892
   173
      *** "filter_sameFunId" "I__" "letpar" "Rewrite_Inst" "Rewrite_Set"
alexandra@37892
   174
      *** "Rewrite_Set_Inst" "Check_elementwise" "Or_to_List" "While" "Script"
alexandra@37892
   175
      *** "\\" "\\" "\\" "CHR" "xstr" "SOME" "\\" "@"
alexandra@37892
   176
      *** "GREATEST" "[" "[]" "num" "\\" "{)" "{.." "\\" "(|"
alexandra@37892
   177
      *** "\\" "SIGMA" "()" "\\" "PI" "\\" "\\" "{" "INT"
alexandra@37892
   178
      *** "UN" "{}" "LEAST" "\\" "0" "1" "-" "!" "?" "?!" "\\"
alexandra@37892
   179
      *** "\\" "\\" "\\!" "THE" "let" "case" "~" "if" "ALL"
alexandra@37892
   180
      *** "EX" "EX!" "!!" "_" "\\" "\\" "PROP" "[|" "OFCLASS"
alexandra@37892
   181
      *** "\\" "op" "\\" "%" "TYPE" "id" "longid" "var" "..."
alexandra@37892
   182
      *** "\\" "("
alexandra@37892
   183
      val it = None : Thm.cterm Library.option
ahirn@37877
   184
\end{verbatim}
ahirn@37877
   185
alexandra@37892
   186
Das mathematische Wissen w\"achst mit jeder Theorie von ProtoPure bis Isac. In den folgenden Beispielen wird gezeigt, wie das Wissen w\"achst.
ahirn@37877
   187
ahirn@37877
   188
{\footnotesize\begin{verbatim}
ahirn@37877
   189
   > (*-1-*);
ahirn@37877
   190
   > parse HOL.thy "2^^^3";
ahirn@37877
   191
      *** Inner lexical error at: "^^^3"
ahirn@37877
   192
      val it = None : Thm.cterm Library.option         
ahirn@37877
   193
\end{verbatim}
alexandra@37892
   194
''Inner lexical error`` und ''None`` bedeuten, dass ein Fehler aufgetreten ist, denn das Wissen \"uber {\tt *} findet sich erst in der {\tt theorie group}.
ahirn@37877
   195
ahirn@37877
   196
{\footnotesize\begin{verbatim}
ahirn@37877
   197
   > (*-2-*);
ahirn@37877
   198
   > parse HOL.thy "d_d x (a + x)";
ahirn@37877
   199
      val it = None : Thm.cterm Library.option               
ahirn@37877
   200
\end{verbatim}
alexandra@37891
   201
Hier wiederum ist noch kein Wissen \"uber das Differenzieren vorhanden.
ahirn@37877
   202
ahirn@37877
   203
{\footnotesize\begin{verbatim}
ahirn@37877
   204
   > (*-3-*);
ahirn@37877
   205
   > parse Rational.thy "2^^^3";
ahirn@37877
   206
      val it = Some "2 ^^^ 3" : Thm.cterm Library.option               
ahirn@37877
   207
\end{verbatim}
ahirn@37877
   208
ahirn@37877
   209
{\footnotesize\begin{verbatim}
ahirn@37877
   210
   > (*-4-*);
ahirn@37877
   211
   > val Some t4 = parse Rational.thy "d_d x (a + x)";
ahirn@37877
   212
      val t4 = "d_d x (a + x)" : Thm.cterm              
ahirn@37877
   213
\end{verbatim}
ahirn@37877
   214
ahirn@37877
   215
{\footnotesize\begin{verbatim}
ahirn@37877
   216
   > (*-5-*);
ahirn@37877
   217
   > val Some t5 = parse Diff.thy  "d_d x (a + x)";
ahirn@37877
   218
      val t5 = "d_d x (a + x)" : Thm.cterm             
ahirn@37877
   219
\end{verbatim}
alexandra@37892
   220
Die letzen drei Aufgaben k\"onnen schon gel\"ost werden, da {\tt Rational.thy} \"uber das n\"otige Wissen verf\"ugt.
ahirn@37877
   221
ahirn@37877
   222
\section{Details von Termen}
alexandra@37892
   223
Mit Hilfe der darunterliegenden Darstellung sieht man, dass ein cterm in einen Term umgewandelt werden kann.
ahirn@37877
   224
{\footnotesize\begin{verbatim}
ahirn@37877
   225
   > term_of;
ahirn@37877
   226
      val it = fn : Thm.cterm -> Term.term
ahirn@37877
   227
\end{verbatim}
alexandra@37892
   228
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
   229
{\footnotesize\begin{verbatim}
ahirn@37877
   230
   > term_of t4;
ahirn@37877
   231
      val it =
ahirn@37877
   232
         Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
ahirn@37877
   233
         ...: Term.term
ahirn@37877
   234
ahirn@37877
   235
\end{verbatim}
alexandra@37891
   236
In diesem Fall sagt uns das ''Const``, dass die Variable eine Konstante ist, also ein Fixwert, der immer die selbe Funktion hat.
ahirn@37877
   237
{\footnotesize\begin{verbatim}
ahirn@37877
   238
   > term_of t5;
ahirn@37877
   239
      val it =
ahirn@37877
   240
         Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $
ahirn@37877
   241
         ... : Term.term
ahirn@37877
   242
\end{verbatim}
alexandra@37891
   243
Sollten verschiedene Teile des ''output`` (= das vom Computer Ausgegebene) nicht sichtbar sein, kann man mit einem bestimmten Befehl alles angezeigt werden.
ahirn@37877
   244
{\footnotesize\begin{verbatim}
ahirn@37877
   245
   > print_depth;
ahirn@37877
   246
      val it = fn : int -> unit
ahirn@37877
   247
 \end{verbatim}
alexandra@37892
   248
Zuerst gibt man den Befehl ein, danach den Term, der gr\"osser werden soll. Dabei kann man selbst einen Wert f\"ur die L\"ange bestimmen.
ahirn@37877
   249
{\footnotesize\begin{verbatim}
ahirn@37877
   250
   > print_depth 10;
ahirn@37877
   251
      val it = () : unit
ahirn@37877
   252
   > term_of t4;
ahirn@37877
   253
         val it =
ahirn@37877
   254
            Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
   255
                Free ("x", "RealDef.real") $
ahirn@37877
   256
            (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
   257
                Free ("a", "RealDef.real") $ Free ("x", "RealDef.real"))
ahirn@37877
   258
         : Term.term
ahirn@37877
   259
ahirn@37877
   260
   > print_depth 10;
ahirn@37877
   261
         val it = () : unit
ahirn@37877
   262
   > term_of t5;
ahirn@37877
   263
         val it =
ahirn@37877
   264
            Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
   265
                Free ("x", "RealDef.real") $
ahirn@37877
   266
            (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $
ahirn@37877
   267
                Free ("a", "RealDef.real") $ Free ("x", "RealDef.real"))
ahirn@37877
   268
         : Term.term
ahirn@37877
   269
\end{verbatim}
alexandra@37891
   270
\paragraph{Versuchen Sie es!}
ahirn@37877
   271
Eine andere Variante um den Unterschied der beiden Terme zu sehen ist folgende: 
ahirn@37877
   272
{\footnotesize\begin{verbatim}
ahirn@37877
   273
   > (*-4-*) val thy = Rational.thy;
ahirn@37877
   274
      val thy =
ahirn@37877
   275
         {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp,
ahirn@37877
   276
         Sum_Type, Relation, Record, Inductive, Transitive_Closure,
ahirn@37877
   277
         Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power,
ahirn@37877
   278
         SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe,
ahirn@37877
   279
         Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv,
ahirn@37877
   280
         IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map,
ahirn@37877
   281
         Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd,
ahirn@37877
   282
         RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow,
ahirn@37877
   283
         Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix,
ahirn@37877
   284
         Float, ComplexI, Descript, Atools, Simplify, Poly, Rational}
ahirn@37877
   285
     : Theory.theory
ahirn@37877
   286
   > ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)";
ahirn@37877
   287
 
ahirn@37877
   288
      ***
ahirn@37877
   289
      *** Free (d_d, [real, real] => real)
ahirn@37877
   290
      *** . Free (x, real)
ahirn@37877
   291
      *** . Const (op +, [real, real] => real)
ahirn@37877
   292
      *** . . Free (a, real)
ahirn@37877
   293
      *** . . Free (x, real)
ahirn@37877
   294
      ***
ahirn@37877
   295
 
ahirn@37877
   296
      val it = () : unit
ahirn@37877
   297
ahirn@37877
   298
ahirn@37877
   299
   > (*-5-*) val thy = Diff.thy;
ahirn@37877
   300
      val thy =
ahirn@37877
   301
         {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp,
ahirn@37877
   302
         Sum_Type, Relation, Record, Inductive, Transitive_Closure,
ahirn@37877
   303
         Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power,
ahirn@37877
   304
         SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe,
ahirn@37877
   305
         Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv,
ahirn@37877
   306
         IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map,
ahirn@37877
   307
         Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd,
ahirn@37877
   308
         RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow,
ahirn@37877
   309
         Ring_and_Field, Complex_Numbers, Real, Calculus, Trig, ListG, Tools,
ahirn@37877
   310
         Script, Typefix, Float, ComplexI, Descript, Atools, Simplify, Poly,
ahirn@37877
   311
         Equation, LinEq, Root, RootEq, Rational, RatEq, RootRat, RootRatEq,
ahirn@37877
   312
         PolyEq, LogExp, Diff} : Theory.theory
ahirn@37877
   313
 
ahirn@37877
   314
   > ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)";
ahirn@37877
   315
 
ahirn@37877
   316
      ***
ahirn@37877
   317
      *** Const (Diff.d_d, [real, real] => real)
ahirn@37877
   318
      *** . Free (x, real)
ahirn@37877
   319
      *** . Const (op +, [real, real] => real)
ahirn@37877
   320
      *** . . Free (a, real)
ahirn@37877
   321
      *** . . Free (x, real)
ahirn@37877
   322
      ***
ahirn@37877
   323
 
ahirn@37877
   324
      val it = () : unit
ahirn@37877
   325
\end{verbatim}
ahirn@37877
   326
ahirn@37877
   327
alexandra@37891
   328
\chapter{''Rewriting``}
alexandra@37891
   329
\section{Was ist Rewriting?}
alexandra@37891
   330
Bei Rewriting handelt es sich um das Umformen von Termen nach vorgegebenen Regeln. Folgende zwei Funktionen sind notwendig:
alexandra@37891
   331
\footnotesize\begin{verbatim}
alexandra@37892
   332
   > rewrite;
alexandra@37892
   333
      val it = fn
alexandra@37892
   334
      :
alexandra@37892
   335
      theory' ->
alexandra@37892
   336
      rew_ord' ->
alexandra@37892
   337
      rls' -> bool -> thm' -> cterm' -> (string * string list) Library.option
ahirn@37877
   338
\end{verbatim}
alexandra@37892
   339
Die Funktion hat zwei Argumente, die mitgeschickt werden m\"ussen, damit die Funktion arbeiten kann. Das letzte Element {\tt (cterm' * cterm' list) Library.option} im unteren Term ist das Ergebnis, das die Funktionen {\tt rewrite} zur\"uckgeben und die zwei vorhergehenden Argumente, {\tt theorem} und {\tt cterm}, sind die f\"ur uns wichtigen. {\tt Theorem} ist die Rechenregel und {\tt cterm} jene Formel auf die die Rechenregel angewendet wird.
alexandra@37891
   340
\footnotesize\begin{verbatim}
alexandra@37892
   341
   > rewrite_inst;
alexandra@37892
   342
      val it = fn
alexandra@37892
   343
      :
alexandra@37892
   344
      theory' ->
alexandra@37892
   345
      rew_ord' ->
alexandra@37892
   346
      rls' ->bool -> 'a -> thm' -> cterm' -> (cterm' * cterm' list) Library.option
alexandra@37882
   347
\end{verbatim}
alexandra@37892
   348
Die Funktion {\tt rewrite\_inst} wird ben\"otigt, um Gleichungen, Rechnungen zum Differenzieren etc. zu l\"osen. Dabei wird die gebundene Variable (bdv) instanziiert, d.h. es wird die Variable angegeben, nach der man differenzieren will, bzw. f\"ur die ein Wert bei einer Gleichung herauskommen soll.
alexandra@37892
   349
Um zu sehen wie der Computer vorgeht nehmen wir folgendes Beispiel, dessen Ergebnis offenbar 0 ist, was der Computer jedoch erst nach einer Reihe von Schritten herausfindet.
alexandra@37892
   350
Im Beispiel wird differenziert, wobei \isac's Schreibweise jene von Computer Algebra Systemen (CAS) anzugleichen: in CAS wird differenziert mit $\frac{d}{dx}\; x^2 + 3 \cdot x + 4$, in \isac{} mit {\tt d\_d x (x \^{ }\^{ }\^{ } 2 + 3 * x + 4)}.
alexandra@37891
   351
Zuerst werden die einzelnen Werte als Variablen gespeichert:
alexandra@37891
   352
\footnotesize\begin{verbatim}
alexandra@37892
   353
   > val thy' = "Diff.thy";
alexandra@37892
   354
      val thy' = "Diff.thy" : string
alexandra@37892
   355
   > val ro = "tless_true";
alexandra@37892
   356
      val ro = "tless_true" : string
alexandra@37892
   357
   > val er = "eval_rls";
alexandra@37892
   358
      val er = "eval_rls" : string
alexandra@37892
   359
   > val inst = [("bdv","x::real")];
alexandra@37892
   360
      val inst = [("bdv", "x::real")] : (string * string) list
alexandra@37892
   361
   > val ct = "d_d x (a + a * (2 + b))";
alexandra@37892
   362
      val ct = "d_d x (a + a * (2 + b))" : string
alexandra@37882
   363
\end{verbatim}
alexandra@37892
   364
Nun wird die Rechnung nach den Regeln ausgerechnet, wobei am Ende mehrere Dinge zugleich gemacht werden.
alexandra@37892
   365
Folgende Regeln werden ben\"otigt: Summenregel, Produktregel, Multiplikationsregel mit einem konstanten Faktor und zum Schluss die Additionsregel.
alexandra@37891
   366
\footnotesize\begin{verbatim}
alexandra@37892
   367
   > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_sum","") ct;
alexandra@37892
   368
      val ct = "d_d x a + d_d x (a * (2 + b))" : cterm'
alexandra@37892
   369
   > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_prod","") ct;
alexandra@37892
   370
      val ct = "d_d x a + (d_d x a * (2 + b) + a * d_d x (2 + b))" : cterm'
alexandra@37892
   371
   > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_const","") ct;
alexandra@37892
   372
      val ct = "d_d x a + (d_d x a * (2 + b) + a * 0) " : cterm'
alexandra@37892
   373
   > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_const","") ct;
alexandra@37892
   374
      val ct = "d_d x a + (0 * (2 + b) + a * 0)" : cterm'
alexandra@37892
   375
   > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_const","") ct;
alexandra@37892
   376
      val ct = "0 + (0 * (2 + b) + a * 0)" : cterm'
alexandra@37892
   377
   > val Some (ct,_) = rewrite_set thy' true "make_polynomial" ct;
alexandra@37892
   378
      val ct = "0" : string
alexandra@37882
   379
\end{verbatim}
alexandra@37892
   380
Was {\tt rewrite\_set} genau macht, finden Sie im n\"achsten Kapitel.
alexandra@37892
   381
alexandra@37892
   382
Dies w\"are ein etwas ernsthafteres Beispiel zum Differenzieren:
alexandra@37891
   383
\footnotesize\begin{verbatim}
alexandra@37892
   384
   > val ct = "d_d x (x ^^^ 2 + 3 * x + 4)";
alexandra@37892
   385
   > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_sum","") ct;
alexandra@37882
   386
\end{verbatim}
alexandra@37892
   387
Versuchen Sie es, diese Beispiel zu Ende zu f\"uhren! Die Regeln, die \isac{} kennt und zum Umformen verwenden kann, finden Sie auf
alexandra@37892
   388
$ http://www.ist.tugraz.at/projects/isac/www/kbase/thy/thy_isac_Diff.html$.
alexandra@37892
   389
\paragraph{Versuchen Sie es!} wenn Sie sich noch weitere Beispiele ansehen wollen, dann besuchen sie bitte die folgende Site: {\tt [isac-src]/tests/\dots}.
alexandra@37891
   390
alexandra@37891
   391
\section{Was kann Rewriting?}
alexandra@37891
   392
Es gibt verschiedene Varianten von Rewriting, die alle eine bestimmte Bedeutung haben.
alexandra@37892
   393
{\tt rewrite\_ set} wandelt Terme in ein ganzes rule set um, die normalerweise nur mit einem Theorem vereinfacht dargestellt werden.
alexandra@37891
   394
Hierbei werden auch folgende Argumente verwendet:\\
alexandra@37891
   395
\tabcolsep=4mm
alexandra@37891
   396
\def\arraystretch{1.5}
alexandra@37891
   397
\begin{tabular}{lp{11.0cm}}
alexandra@37892
   398
{\tt theory} & Die Theory von Isabelle, die alle n\"otigen Informationen f\"ur das Parsing {\tt term} enth\"alt. \\
alexandra@37892
   399
{\tt rew\_ord}& die Ordnung f\"ur das geordnete Rewriting. F\"ur {\em no} ben\"otigt das geordnete Rewriting {\tt tless\_true}, eine Ordnung, die f\"ur alle nachgiebigen Argumente true ist \\
alexandra@37891
   400
{\tt rls} & Das rule set; zur Auswertung von bestimmten Bedingungen in {\tt thm} falls {\tt thm} eine conditional rule ist \\
alexandra@37892
   401
{\tt bool} & ein Bitschalter, der die Berechnungen der m\"oglichen condition in {\tt thm} ausl\"ost: wenn sie {\tt false} ist, dann wird die condition bewertet und auf Grund des Resultats wendet man {\tt thm} an, oder nicht; wenn {\tt true} dann wird die condition nicht ausgewertet, aber man gibt sie in eine Menge von Hypothesen \\
alexandra@37891
   402
{\tt thm} & das theorem versucht den {\tt term} zu \"uberschreiben \\
alexandra@37891
   403
{\tt term} & {\tt thm} wendet Rewriting m\"oglicherweise auf den Term an \\
alexandra@37891
   404
\end{tabular}\\
alexandra@37891
   405
alexandra@37891
   406
\footnotesize\begin{verbatim}
alexandra@37892
   407
   > rewrite_set;
alexandra@37892
   408
      val it = fn : theory' -> bool -> rls' -> ...
alexandra@37891
   409
\end{verbatim}
alexandra@37891
   410
\footnotesize\begin{verbatim}
alexandra@37892
   411
   > rewrite_set_inst;
alexandra@37892
   412
      val it = fn : theory' -> bool -> subs' -> .
alexandra@37891
   413
\end{verbatim}
alexandra@37892
   414
Wenn man sehen m\"ochte wie Rewriting bei den einzelnen theorems funktioniert kann man dies mit {\tt trace\_rewrite} versuchen.
alexandra@37891
   415
\footnotesize\begin{verbatim}
alexandra@37892
   416
   > trace_rewrite := true;
alexandra@37892
   417
      val it = () : unit
alexandra@37891
   418
\end{verbatim}
alexandra@37891
   419
alexandra@37891
   420
alexandra@37882
   421
\section{Rule sets}
alexandra@37891
   422
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
   423
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@37891
   424
Ein Beispiel f\"ur einen rule set ist folgendes:
alexandra@37882
   425
\footnotesize\begin{verbatim}
alexandra@37882
   426
???????????
alexandra@37882
   427
\end{verbatim}
ahirn@37877
   428
alexandra@37882
   429
\footnotesize\begin{verbatim}
alexandra@37882
   430
   > sym;
alexandra@37882
   431
      val it = "?s = ?t ==> ?t = ?s" : Thm.thm
alexandra@37882
   432
   > rearrange_assoc;
alexandra@37882
   433
      val it =
alexandra@37882
   434
         Rls
alexandra@37882
   435
            {id = "rearrange_assoc",
alexandra@37882
   436
               scr = Script (Free ("empty_script", "RealDef.real")),
alexandra@37882
   437
               calc = [],
alexandra@37882
   438
               erls =
alexandra@37882
   439
               Rls
alexandra@37882
   440
                  {id = "e_rls",
alexandra@37882
   441
                     scr = EmptyScr,
alexandra@37882
   442
                     calc = [],
alexandra@37882
   443
                     erls = Erls,
alexandra@37882
   444
                     srls = Erls,
alexandra@37882
   445
                     rules = [],
alexandra@37882
   446
                     rew_ord = ("dummy_ord", fn),
alexandra@37882
   447
                     preconds = []},
alexandra@37882
   448
               srls =
alexandra@37882
   449
               Rls
alexandra@37882
   450
                  {id = "e_rls",
alexandra@37882
   451
                     scr = EmptyScr,
alexandra@37882
   452
                     calc = [],
alexandra@37882
   453
                     erls = Erls,
alexandra@37882
   454
                     srls = Erls,
alexandra@37882
   455
                     rules = [],
alexandra@37882
   456
                     rew_ord = ("dummy_ord", fn),
alexandra@37882
   457
                     preconds = []},
alexandra@37882
   458
               rules =
alexandra@37882
   459
               [Thm ("sym_radd_assoc", "?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1"  [.]),
alexandra@37882
   460
                  Thm
alexandra@37882
   461
                     ("sym_rmult_assoc",
alexandra@37882
   462
                        "?m1 * (?n1 * ?k1) = ?m1 * ?n1 * ?k1"  [.])],
alexandra@37882
   463
               rew_ord = ("e_rew_ord", fn),
alexandra@37882
   464
               preconds = []} : rls
alexandra@37882
   465
\end{verbatim}
ahirn@37877
   466
ahirn@37877
   467
alexandra@37882
   468
\section{Berechnung von Konstanten}
alexandra@37882
   469
Sobald Konstanten in dem Bereich des Subterms sind, k\"onnen sie von einer Funktion berechnet werden:
alexandra@37882
   470
\footnotesize\begin{verbatim}
alexandra@37882
   471
   > calculate;
alexandra@37882
   472
      val it = fn
alexandra@37882
   473
      :
alexandra@37882
   474
         theory' ->
alexandra@37882
   475
         string *
alexandra@37882
   476
         (
alexandra@37882
   477
         string ->
alexandra@37882
   478
         Term.term -> Theory.theory -> (string * Term.term) Library.option) ->
alexandra@37882
   479
         cterm' -> (string * thm') Library.option
ahirn@37877
   480
alexandra@37882
   481
   > calculate_;
alexandra@37882
   482
      val it = fn
alexandra@37882
   483
      :
alexandra@37882
   484
         Theory.theory ->
alexandra@37882
   485
         string *
alexandra@37882
   486
         (
alexandra@37882
   487
         string ->
alexandra@37882
   488
         Term.term -> Theory.theory -> (string * Term.term) Library.option) ->
alexandra@37882
   489
         Term.term -> (Term.term * (string * Thm.thm)) Library.option
alexandra@37882
   490
\end{verbatim}
alexandra@37891
   491
Man bekommt das Ergebnis und das theorem bezieht sich darauf. Daher sind die folgenden mathematischen Rechnungen m\"oglich:
alexandra@37882
   492
\footnotesize\begin{verbatim}
alexandra@37882
   493
   > calclist;
alexandra@37882
   494
      val it =
alexandra@37882
   495
         [("Vars", ("Tools.Vars", fn)), ("matches", ("Tools.matches", fn)),
alexandra@37882
   496
            ("lhs", ("Tools.lhs", fn)), ("plus", ("op +", fn)),
alexandra@37882
   497
            ("times", ("op *", fn)), ("divide_", ("HOL.divide", fn)),
alexandra@37882
   498
            ("power_", ("Atools.pow", fn)), ("is_const", ("Atools.is'_const", fn)),
alexandra@37882
   499
            ("le", ("op <", fn)), ("leq", ("op <=", fn)),
alexandra@37882
   500
            ("ident", ("Atools.ident", fn)), ("sqrt", ("Root.sqrt", fn)),
alexandra@37882
   501
            ("Test.is_root_free", ("is'_root'_free", fn)),
alexandra@37882
   502
            ("Test.contains_root", ("contains'_root", fn))]
alexandra@37882
   503
      :
alexandra@37882
   504
         (
alexandra@37882
   505
         string *
alexandra@37882
   506
         (
alexandra@37882
   507
         string *
alexandra@37882
   508
         (
alexandra@37882
   509
         string ->
alexandra@37882
   510
         Term.term -> Theory.theory -> (string * Term.term) Library.option))) list
alexandra@37882
   511
\end{verbatim}
alexandra@37891
   512
ahirn@37877
   513
ahirn@37877
   514
ahirn@37877
   515
alexandra@37882
   516
\chapter{Termordnung}
alexandra@37891
   517
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\"ur Probleme zu finden.
alexandra@37882
   518
alexandra@37882
   519
\section{Beispiel f\"ur Termordnungen}
alexandra@37891
   520
Es ist nicht unbedeutend, eine Verbindung zu Termen herzustellen, die wirklich eine Ordnung besitzen. Diese Ordnungen sind selbstaufrufende Bahnordnungen:
alexandra@37882
   521
alexandra@37882
   522
{\footnotesize\begin{verbatim}
alexandra@37882
   523
   > sqrt_right;
alexandra@37882
   524
      val it = fn : bool -> Theory.theory -> subst -> Term.term * Term.term -> b       ool
alexandra@37882
   525
   > tless_true;
alexandra@37882
   526
      val it = fn : subst -> Term.term * Term.term -> bool
alexandra@37882
   527
\end{verbatim}
alexandra@37882
   528
alexandra@37891
   529
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
   530
alexandra@37888
   531
{\section{Geordnetes Rewriting}}
alexandra@37892
   532
Beim Rewriting entstehen Probleme, die vom ''law of commutativity`` (= Kommutativgesetz) durch '+' und '*' verursacht werden. Diese Probleme k\"onnen nur durch geordnetes Rewriting gel\"ost werden, da hier ein Term nur umgeschrieben wird, wenn ein kleinerer dadurch entsteht.
alexandra@37888
   533
alexandra@37888
   534
alexandra@37891
   535
\chapter{Problem hierachy}
alexandra@37888
   536
\section{''Matching``}
alexandra@37891
   537
Matching ist eine Technik von Rewriting, die von \isac{} verwendet wird, um ein Problem und den passenden problem type daf\"ur zu finden. Die folgende Funktion \"uberpr\"uft, ob Matching m\"oglich ist:
alexandra@37888
   538
{\footnotesize\begin{verbatim}
alexandra@37888
   539
> matches;
alexandra@37888
   540
val it = fn : Theory.theory -> Term.term -> Term.term -> bool
alexandra@37888
   541
\end{verbatim}
alexandra@37888
   542
Die folgende Gleichung wird in Operatoren und freie Variablen zerlegt.
alexandra@37888
   543
{\footnotesize\begin{verbatim}
alexandra@37888
   544
> val t = (term_of o the o (parse thy)) "3 * x^^^2 = 1";
alexandra@37888
   545
val t =
alexandra@37888
   546
Const ("op =", "[RealDef.real, RealDef.real] => bool") $
alexandra@37888
   547
(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   548
Free ("3", "RealDef.real") $
alexandra@37888
   549
(Const
alexandra@37888
   550
("Atools.pow",
alexandra@37888
   551
"[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   552
Free ("x", "RealDef.real") $ Free ("2", " RealDef.real"))) $
alexandra@37888
   553
Free ("1", "RealDef.real") : Term.term
alexandra@37888
   554
\end{verbatim}
alexandra@37891
   555
Nun wird ein Modell erstellt, das sich nicht auf bestimmte Zahlen bezieht, sondern nur eine generelle Zerlegung durchf\"uhrt.
alexandra@37888
   556
{\footnotesize\begin{verbatim}
alexandra@37888
   557
> val p = (term_of o the o (parse thy)) "a * b^^^2 = c";
alexandra@37888
   558
val p =
alexandra@37888
   559
Const ("op =", "[RealDef.real, RealDef.real] => bool") $
alexandra@37888
   560
(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   561
Free ("a", "RealDef.real") $
alexandra@37888
   562
(Const
alexandra@37888
   563
("Atools.pow",
alexandra@37888
   564
"[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   565
Free ("b", "RealDef.real") $ Free ("2", "RealDef.real"))) $
alexandra@37888
   566
Free ("c", "RealDef.real") : Term.term
alexandra@37888
   567
\end{verbatim}
alexandra@37891
   568
Dieses Modell enth\"alt sogenannte \textit{scheme variables}.
alexandra@37888
   569
{\footnotesize\begin{verbatim}
alexandra@37888
   570
> atomt p;
alexandra@37888
   571
"*** -------------"
alexandra@37888
   572
"*** Const (op =)"
alexandra@37888
   573
"*** . Const (op *)""*** . . Free (a, )"
alexandra@37888
   574
"*** . . Const (Atools.pow)"
alexandra@37888
   575
"*** . . . Free (b, )"
alexandra@37888
   576
"*** . . . Free (2, )"
alexandra@37888
   577
"*** . Free (c, )"
alexandra@37888
   578
"\n"
alexandra@37888
   579
val it = "\n" : string
alexandra@37888
   580
\end{verbatim}
alexandra@37891
   581
Das Modell wird durch den Befehl \textit{free2var} erstellt.
alexandra@37888
   582
{\footnotesize\begin{verbatim}
alexandra@37888
   583
> free2var;
alexandra@37888
   584
val it = fn : Term.term -> Term.term
alexandra@37888
   585
> val pat = free2var p;
alexandra@37888
   586
val pat =
alexandra@37888
   587
Const ("op =", "[RealDef.real, RealDef.real] => bool") $
alexandra@37888
   588
(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   589
Var (("a", 0), "RealDef.real") $
alexandra@37888
   590
(Const
alexandra@37888
   591
("Atools.pow",
alexandra@37888
   592
"[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   593
Var (("b", 0), "RealDef.real") $
alexandra@37888
   594
Free ("2", "RealDef.real"))) $ Var (("c", 0), "RealDef.real")
alexandra@37888
   595
: Term.term
alexandra@37888
   596
> Sign.string_of_term (sign_of thy) pat;
alexandra@37888
   597
val it = "?a * ?b ^^^ 2 = ?c" : string
alexandra@37888
   598
\end{verbatim}
alexandra@37892
   599
Durch \textit{atomt pat} wird der Term aufgespalten und in eine Form gebracht, die f\"ur die weiteren Schritte ben\"otigt wird.
alexandra@37888
   600
{\footnotesize\begin{verbatim}
alexandra@37888
   601
> atomt pat;
alexandra@37888
   602
"*** -------------"
alexandra@37888
   603
"*** Const (op =)"
alexandra@37888
   604
"*** . Const (op *)"
alexandra@37888
   605
"*** . . Var ((a, 0), )"
alexandra@37888
   606
"*** . . Const (Atools.pow)"
alexandra@37888
   607
"*** . . . Var ((b, 0), )"
alexandra@37888
   608
"*** . . . Free (2, )"
alexandra@37888
   609
"*** . Var ((c, 0), )"
alexandra@37888
   610
"\n"
alexandra@37888
   611
val it = "\n" : string
alexandra@37888
   612
\end{verbatim}
alexandra@37891
   613
Jetzt kann das Matching an den beiden vorigen Terme angewendet werden.
alexandra@37888
   614
{\footnotesize\begin{verbatim}
alexandra@37888
   615
> matches thy t pat;
alexandra@37888
   616
val it = true : bool
alexandra@37888
   617
> val t2 = (term_of o the o (parse thy)) "x^^^2 = 1";
alexandra@37888
   618
val t2 =
alexandra@37888
   619
Const ("op =", "[RealDef.real, RealDef.real] => bool") $
alexandra@37888
   620
(Const
alexandra@37888
   621
("Atools.pow",
alexandra@37888
   622
"[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   623
Free ("x", "RealDef.real") $ Free ("2", "RealDef.real")) $
alexandra@37888
   624
Free ("1", "RealDef.real") : Term.term
alexandra@37888
   625
> matches thy t2 pat;
alexandra@37888
   626
val it = false : bool
alexandra@37888
   627
> val pat2 = (term_of o the o (parse thy)) "?u^^^2 = ?v";
alexandra@37888
   628
val pat2 =
alexandra@37888
   629
Const ("op =", "[RealDef.real, RealDef.real] => bool") $
alexandra@37888
   630
(Const
alexandra@37888
   631
("Atools.pow",
alexandra@37888
   632
"[RealDef.real, RealDef.real] => RealDef.real") $
alexandra@37888
   633
Var (("u", 0), "RealDef.real") $ Free ("2", "RealDef.real")) $
alexandra@37888
   634
Var (("v", 0), "RealDef.real") : Term.term
alexandra@37888
   635
> matches thy t2 pat2;
alexandra@37888
   636
val it = true : bool
alexandra@37888
   637
\end{verbatim}
alexandra@37888
   638
alexandra@37891
   639
\section{Zugriff auf die hierachy}
alexandra@37891
   640
Man verwendet folgenden Befehl, um sich Zugang zur hierachy von problem type zu verschaffen.
alexandra@37888
   641
{\footnotesize\begin{verbatim}
alexandra@37888
   642
> show_ptyps;
alexandra@37888
   643
val it = fn : unit -> unit
alexandra@37888
   644
> show_ptyps();
alexandra@37888
   645
[
alexandra@37888
   646
["e_pblID"],
alexandra@37888
   647
["simplification", "polynomial"],
alexandra@37888
   648
["simplification", "rational"],
alexandra@37888
   649
["vereinfachen", "polynom", "plus_minus"],
alexandra@37888
   650
["vereinfachen", "polynom", "klammer"],
alexandra@37888
   651
["vereinfachen", "polynom", "binom_klammer"],
alexandra@37888
   652
["probe", "polynom"],
alexandra@37888
   653
["probe", "bruch"],
alexandra@37888
   654
["equation", "univariate", "linear"],
alexandra@37888
   655
["equation", "univariate", "root", "sq", "rat"],
alexandra@37888
   656
["equation", "univariate", "root", "normalize"],
alexandra@37888
   657
["equation", "univariate", "rational"],
alexandra@37888
   658
["equation", "univariate", "polynomial", "degree_0"],
alexandra@37888
   659
["equation", "univariate", "polynomial", "degree_1"],
alexandra@37888
   660
["equation", "univariate", "polynomial", "degree_2", "sq_only"],
alexandra@37888
   661
["equation", "univariate", "polynomial", " 
alexandra@37888
   662
 degree_2", "bdv_only"],
alexandra@37888
   663
["equation", "univariate", "polynomial", "degree_2", "pqFormula"],
alexandra@37888
   664
["equation", "univariate", "polynomial", "degree_2", "abcFormula"],
alexandra@37888
   665
["equation", "univariate", "polynomial", "degree_3"],
alexandra@37888
   666
["equation", "univariate", "polynomial", "degree_4"],
alexandra@37888
   667
["equation", "univariate", "polynomial", "normalize"],
alexandra@37888
   668
["equation", "univariate", "expanded", "degree_2"],
alexandra@37888
   669
["equation", "makeFunctionTo"],
alexandra@37888
   670
["function", "derivative_of", "named"],
alexandra@37888
   671
["function", "maximum_of", "on_interval"],
alexandra@37888
   672
["function", "make", "by_explicit"],
alexandra@37888
   673
["function", "make", "by_new_variable"],
alexandra@37888
   674
["function", "integrate", "named"],
alexandra@37888
   675
["tool", "find_values"],
alexandra@37888
   676
["system", "linear", "2x2", "triangular"],
alexandra@37888
   677
["system", "linear", "2x2", "normalize"],
alexandra@37888
   678
["system", "linear", "3x3"],
alexandra@37888
   679
["system", "linear", "4x4", "triangular"],
alexandra@37888
   680
["system", "linear", "4x4", "normalize"],
alexandra@37888
   681
["Biegelinien", "
alexandra@37888
   682
MomentBestimmte"],
alexandra@37888
   683
["Biegelinien", "MomentGegebene"],
alexandra@37888
   684
["Biegelinien", "einfache"],
alexandra@37888
   685
["Biegelinien", "QuerkraftUndMomentBestimmte"],
alexandra@37888
   686
["Biegelinien", "vonBelastungZu"],
alexandra@37888
   687
["Biegelinien", "setzeRandbedingungen"],
alexandra@37888
   688
["Berechnung", "numerischSymbolische"],
alexandra@37888
   689
["test", "equation", "univariate", "linear"],
alexandra@37888
   690
["test", "equation", "univariate", "plain_square"],
alexandra@37888
   691
["test", "equation", "univariate", "polynomial", "degree_two", "pq_formula"],
alexandra@37888
   692
["test", "equation", "univariate", "polynomial", "degree_two", "abc_formula"],
alexandra@37888
   693
["test", "equation", "univariate", "squareroot"],
alexandra@37888
   694
["test", "equation", "univariate", "normalize"],
alexandra@37888
   695
["test", "equation", "univariate", "sqroot-test"]
alexandra@37888
   696
]
alexandra@37888
   697
val it = () : unit
alexandra@37888
   698
\end{verbatim}
alexandra@37888
   699
alexandra@37891
   700
\section{Die passende ''formalization`` f\"ur den problem type}
alexandra@37891
   701
Eine andere Art des Matching ist es die richtige ''formalization`` zum jeweiligen problem type zu finden. Wenn eine solche vorhanden ist, kann \isac{} selbstst\"andig die Probleme l\"osen.
alexandra@37888
   702
alexandra@37891
   703
\section{''problem-refinement``}
alexandra@37891
   704
Will man die problem hierachy (= ) aufstellen, so ist darauf zu achten, dass man die verschiedenen Branches so konstruiert, dass das problem-refinement automatisch durchgef\"uhrt werden kann.
alexandra@37888
   705
{\footnotesize\begin{verbatim}
alexandra@37888
   706
> refine;
alexandra@37888
   707
val it = fn : fmz_ -> pblID -> SpecifyTools.match list
alexandra@37888
   708
> val fmz = ["equality (sqrt(9 + 4 * x)=sqrt x 
alexandra@37888
   709
+ sqrt (5 + x))",
alexandra@37888
   710
# "soleFor x","errorBound (eps=0)",
alexandra@37888
   711
# "solutions L"];
alexandra@37888
   712
val fmz =
alexandra@37888
   713
["equality (sqrt(9 + 4 * x)=sqrt x + sqrt (5 + x))", "soleFor x",
alexandra@37888
   714
"errorBound (eps=0)", ...] : string list
alexandra@37888
   715
> refine fmz ["univariate","equation"];
alexandra@37888
   716
*** pass ["equation","univariate"]
alexandra@37888
   717
*** comp_dts: ??.empty $ soleFor x
alexandra@37888
   718
Exception- ERROR raised
alexandra@37888
   719
\end{verbatim}
alexandra@37891
   720
Wenn die ersten zwei Regeln nicht angewendet werden k\"onnen, kommt die dritte zum Einsatz:
alexandra@37888
   721
{\footnotesize\begin{verbatim}
alexandra@37888
   722
> val fmz = ["equality (x + 1 = 2)",
alexandra@37888
   723
# "solveFor x","errorBound (eps=0)",
alexandra@37888
   724
# "solutions L"];
alexandra@37888
   725
val fmz = ["equality (x + 1 = 2)", "solveFor x", "errorBound (eps=0)", ...]
alexandra@37888
   726
: string list
alexandra@37888
   727
> refine fmz ["univariate","equation"];
alexandra@37888
   728
*** pass ["equation","univariate"]
alexandra@37888
   729
*** pass ["equation","univariate","linear"]
alexandra@37888
   730
*** pass ["equation","univariate","root"]
alexandra@37888
   731
*** pass ["equation","univariate","rational"]
alexandra@37888
   732
*** pass ["equation","univariate","polynomial" ]
alexandra@37888
   733
*** pass ["equation","univariate","polynomial","degree_0"]
alexandra@37888
   734
*** pass ["equation","univariate","polynomial","degree_1"]
alexandra@37888
   735
*** pass ["equation","univariate","polynomial","degree_2"]
alexandra@37888
   736
*** pass ["equation","univariate","polynomial","degree_3"]
alexandra@37888
   737
*** pass ["equation","univariate","polynomial","degree_4"]
alexandra@37888
   738
*** pass ["equation","univariate","polynomial","normalize"]
alexandra@37888
   739
val it =
alexandra@37888
   740
[Matches
alexandra@37888
   741
(["univariate", "equation"],
alexandra@37888
   742
{Find = [Correct "solutions L"], With = [...], ...}),
alexandra@37888
   743
NoMatch (["linear", "univariate", ...], {Find = [...], ...}),
alexandra@37888
   744
NoMatch (["root", ...], ...), ...] : SpecifyTools.match list
alexandra@37888
   745
\end{verbatim}
alexandra@37891
   746
Der problem type wandelt $x + 1 = 2$ in die normale Form $-1 + x = 0$ um. Diese Suche nach der jeweiligen problem hierachy kann mit Hilfe eines ''proof state`` durchgef\"uhrt werden (siehe n\"achstes Kapitel).
alexandra@37882
   747
alexandra@37887
   748
alexandra@37891
   749
\chapter{''Methods``}
alexandra@37891
   750
Methods werden dazu verwendet, Probleme von type zu l\"osen. Sie sind in einer anderen Programmiersprache beschrieben. Die Sprache sieht einfach aus, betreibt aber im Hintergrund einen enormen Pr\"ufaufwand. So muss sich der Programmierer nicht mit technischen Details befassen, gleichzeitig k\"onnen aber auch keine falschen Anweisungen eingegeben werden.
alexandra@37891
   751
\section{Der ''Syntax`` des script}
alexandra@37882
   752
Syntax beschreibt den Zusammenhang der einzelnen Zeichen und Zeichenfolgen mit den Theorien.
alexandra@37882
   753
Er kann so definiert werden:
alexandra@37882
   754
\begin{tabbing}
alexandra@37882
   755
123\=123\=expr ::=\=$|\;\;$\=\kill
alexandra@37882
   756
\>script ::= {\tt Script} id arg$\,^*$ = body\\
alexandra@37882
   757
\>\>arg ::= id $\;|\;\;($ ( id :: type ) $)$\\
alexandra@37882
   758
\>\>body ::= expr\\
alexandra@37882
   759
\>\>expr ::= \>\>{\tt let} id = expr $($ ; id = expr$)^*$ {\tt in} expr\\
alexandra@37882
   760
\>\>\>$|\;$\>{\tt if} prop {\tt then} expr {\tt else} expr\\
alexandra@37882
   761
\>\>\>$|\;$\>listexpr\\
alexandra@37882
   762
\>\>\>$|\;$\>id\\
alexandra@37882
   763
\>\>\>$|\;$\>seqex id\\
alexandra@37882
   764
\>\>seqex ::= \>\>{\tt While} prop {\tt Do} seqex\\
alexandra@37882
   765
\>\>\>$|\;$\>{\tt Repeat} seqex\\
alexandra@37882
   766
\>\>\>$|\;$\>{\tt Try} seqex\\
alexandra@37882
   767
\>\>\>$|\;$\>seqex {\tt Or} seqex\\
alexandra@37882
   768
\>\>\>$|\;$\>seqex {\tt @@} seqex\\
alexandra@37882
   769
\>\>\>$|\;$\>tac $($ id $|$ listexpr $)^*$\\
alexandra@37882
   770
\>\>type ::= id\\
alexandra@37882
   771
\>\>tac ::= id
alexandra@37882
   772
\end{tabbing}}
ahirn@37877
   773
alexandra@37887
   774
\section{\"Uberpr\"ufung der Auswertung}
alexandra@37887
   775
Das Kontrollsystem arbeitet mit den folgenden Script-Ausdr\"ucken, die {\it tacticals} genannt werden:
alexandra@37887
   776
\begin{description}
alexandra@37887
   777
\item{{\tt while} prop {\tt Do} expr id} 
alexandra@37887
   778
\item{{\tt if} prop {\tt then} expr {\tt else} expr}
alexandra@37887
   779
\end{description}
alexandra@37891
   780
W\"ahrend die genannten Befehle das Kontrollsystem durch Auswertung der Formeln ausl\"osen, h\"angen die anderen von der Anwendbarkeit der Formel in den entsprechenden Unterbegriffen ab:
alexandra@37887
   781
\begin{description}
alexandra@37887
   782
\item{{\tt Repeat} expr id}
alexandra@37887
   783
\item{{\tt Try} expr id}
alexandra@37887
   784
\item{expr {\tt Or} expr id}
alexandra@37887
   785
\item{expr {\tt @@} expr id}
alexandra@37887
   786
\item xxx
alexandra@37887
   787
\end{description}
alexandra@37887
   788
alexandra@37887
   789
alexandra@37888
   790
alexandra@37888
   791
\chapter{Befehle von \isac{}}
alexandra@37889
   792
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@37891
   793
\newline\linebreak \textbf{Init\_Proof\_Hid (dialogmode, formalization, specifictaion)} gibt die eingegebenen Befehle an die mathematic engine weiter, wobei die beiden letzten Begriffe die Beispiele automatisch speichern. Es ist nicht vorgesehen, dass der Sch\"uler tactic verwendet.\
alexandra@37891
   794
\newline\linebreak \textbf{Init\_Proof} bildet mit einem ''proof tree`` ein leeres Modell.\
alexandra@37891
   795
\newline\linebreak \textbf{Model\_Problem problem} bestimmt ein problemtype, das wom\"oglich in der ''hierachy`` gefunden wurde, und verwendet es f\"ur das Umformen.\
alexandra@37891
   796
\newline\linebreak \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 tactic und Formel von einer Liste w\"ahlen will.\
alexandra@37891
   797
\newline\linebreak \textbf{Specify\_Theorie theory, Specify\_Problem proble, Specify\_Method method} gibt das entsprechende Element des Basiswissens an.\
alexandra@37891
   798
\newline\linebreak \textbf{Refine\_Problem problem} sucht nach einem Problem in der hierachy, das auf das vorhandene zutrifft.\
alexandra@37891
   799
\newline\linebreak \textbf{Apply\_Method method} beendet das Modell und die Beschreibung. Danach wird die L\"osungmeldung ge\"offnet.\
alexandra@37891
   800
\newline\linebreak \textbf{Free\_Solve} beginnt eine L\"osungsmeldung ohne die Hilfe einer method.\
alexandra@37891
   801
\newline\linebreak \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@37891
   802
\newline\linebreak \textbf{Rewrite\_Asm theorem} hat die gleiche Funktion wie Rewrite, speichert jedoch eine endg\"ultige Vorraussetzung des theorems, anstatt diese zu sch\"atzen.\
alexandra@37891
   803
\newline\linebreak \textbf{Rewrite\_Set ruleset} hat \"ahnliche Funktionen wie Rewrite, gilt aber f\"ur einen ganzen Satz von theorems, dem rule set.\
alexandra@37891
   804
\newline\linebreak \textbf{Rewrite\_Inst (substitution, theorem), Rewrite\_Set\_Inst (substitution, rule set)} ist vergleichbar mit besonderen tactics, ersetzt aber Konstanten im theorem, bevor es zu einer Anwendung kommt.\
alexandra@37891
   805
\newline\linebreak \textbf{Calculate operation} berechnet das Ergebnis der Eingabe mit der aktuellen Formel (plus, minus, times, cancel, pow, sqrt).\
alexandra@37891
   806
\newline\linebreak \textbf{Substitute substitution} f\"ugt der momentanen Formel {\tt substitution} hinzu und wandelt es um.\
alexandra@37891
   807
\newline\linebreak \textbf{Take formula} startet eine neue Reihe von Rechnungen in den Formeln, wo sich schon eine andere Rechnung befindet.\
alexandra@37891
   808
\newline\linebreak \textbf{Subproblem (theory, problem)} beginnt ein subproblem innerhalb einer Rechnung.\
alexandra@37891
   809
\newline\linebreak \textbf{Function formula} ruft eine Funktion auf, in der der Name in der Formel enthalten ist. ???????\
alexandra@37891
   810
\newline\linebreak \textbf{Split\_And, Conclude\_And, Split\_Or, Conclude\_Or, Begin\_Trans, End\_Trans, Begin\_Sequ, End\_Sequ, Split\_Intersect, End\_Intersect} betreffen den Bau einzelner branches des proof trees. Normalerweise werden sie vom dialog guide verdr\"angt.\
alexandra@37891
   811
\newline\linebreak \textbf{Check\_elementwise assumption} wird in Bezug auf die aktuelle Formel verwendet, die Elemente in einer Liste enth\"alt.\
alexandra@37891
   812
\newline\linebreak \textbf{Or\_to\_List} wandelt eine Verbindung von Gleichungen in eine Liste von Gleichungen um.\
alexandra@37891
   813
\newline\linebreak \textbf{Check\_postcond} \"uberpr\"uft die momentane Formel im Bezug auf die Nachbedinung beim Beenden des subproblem.\
alexandra@37891
   814
\newline\linebreak \textbf{End\_Proof} beendet eine \"Uberpr\"ufung und gibt erst dann ein Ergebnis aus, wenn Check\_postcond erfolgreich abgeschlossen wurde.
alexandra@37888
   815
alexandra@37889
   816
\section{Die Funktionsweise der mathematic engine}
alexandra@37891
   817
Ein proof (= Beweis) wird in der mathematic engine me von der tactic {\tt Init\_Proof} gestartet und wird wechselwirkend mit anderen tactics vorangebracht. Auf den input (= das, was eingegeben wurde) einzelner tactics folgt eine Formel, die von der me ausgegeben wird, und die darauf folgende tactic gilt. Der proof ist beendet, sobald die me {\tt End\_Proof} als n\"achste tactic vorschl\"agt.
alexandra@37889
   818
\newline Im Anschluss werden Sie einen Rechenbeweis sehen, der von der L\"osung einer Gleichung (= equation) handelt, bei der diese automatisch differenziert wird. 
alexandra@37889
   819
{\footnotesize\begin{verbatim}
alexandra@37889
   820
??????????????????????????????????????????????????????????????????????????????????   
alexandra@37888
   821
alexandra@37889
   822
ML> val fmz = ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x",
ahirn@37877
   823
                  "errorBound (eps=#0)","solutions L"];
ahirn@37877
   824
   val fmz =
ahirn@37877
   825
     ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)",
ahirn@37877
   826
      "solutions L"] : string list
ahirn@37877
   827
   ML>
ahirn@37877
   828
   ML> val spec as (dom, pbt, met) = ("SqRoot.thy",["univariate","equation"],
ahirn@37877
   829
                                 ("SqRoot.thy","no_met"));
ahirn@37877
   830
   val dom = "SqRoot.thy" : string
ahirn@37877
   831
   val pbt = ["univariate","equation"] : string list
ahirn@37877
   832
   val met = ("SqRoot.thy","no_met") : string * string
alexandra@37889
   833
\end{verbatim}
ahirn@37877
   834
alexandra@37889
   835
\section{Der Beginn einer Rechnung}
alexandra@37891
   836
alexandra@37891
   837
Der proof state wird von einem proof tree und einer position ausgegeben. Beide sind zu Beginn leer. Die tactic {\tt Init\_Proof} ist, wie alle anderen tactics auch, an einen string gekoppelt. Um einen neuen proof beginnen zu k\"onnen, werden folgende Schritte durchgef\"uhrt:
alexandra@37889
   838
\footnotesize\begin{verbatim}
alexandra@37889
   839
???????????????????????????????????????????????????????????????????????????????????????????? 
alexandra@37889
   840
ML>  val (mID,m) = ("Init_Proof",Init_Proof (fmz, (dom,pbt,met)));
ahirn@37877
   841
   val mID = "Init_Proof" : string
ahirn@37877
   842
   val m =
ahirn@37877
   843
     Init_Proof
ahirn@37877
   844
       (["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)",
ahirn@37877
   845
         "solutions L"],("SqRoot.thy",[#,#],(#,#))) : mstep
ahirn@37877
   846
   ML>
ahirn@37877
   847
   ML>  val (p,_,f,nxt,_,pt) = me (mID,m) e_pos' c EmptyPtree;
ahirn@37877
   848
   val p = ([],Pbl) : pos'
ahirn@37877
   849
   val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout
ahirn@37877
   850
   val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])
ahirn@37877
   851
     : string * mstep
ahirn@37877
   852
   val pt =
ahirn@37877
   853
     Nd
ahirn@37877
   854
       (PblObj
ahirn@37877
   855
          {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#,
ahirn@37877
   856
           result=#,spec=#},[]) : ptree
alexandra@37889
   857
\end{verbatim}
alexandra@37891
   858
Die mathematics engine gibt etwas mit dem type {\tt mout} aus, was in unserem Fall ein Problem darstellt. Sobald mehr angezeigt wird, m\"usste dieses jedoch gel\"ost sein.
alexandra@37889
   859
\footnotesize\begin{verbatim}
alexandra@37889
   860
?????????????????????????????????????????????????????????????????????????????????????????????
ahirn@37877
   861
   ML> Compiler.Control.Print.printDepth:=8; (*4 default*)
ahirn@37877
   862
   val it = () : unit
ahirn@37877
   863
   ML>
ahirn@37877
   864
   ML> f;
ahirn@37877
   865
   val it =
ahirn@37877
   866
     Form'
ahirn@37877
   867
       (PpcKF
ahirn@37877
   868
          (0,EdUndef,0,Nundef,
ahirn@37877
   869
           (Problem [],
ahirn@37877
   870
            {Find=[Incompl "solutions []"],
ahirn@37877
   871
             Given=[Incompl "equality",Incompl "solveFor"],Relate=[],
ahirn@37877
   872
             Where=[False "matches (?a = ?b) e_"],With=[]}))) : mout
alexandra@37889
   873
\end{verbatim}
ahirn@37877
   874
{\footnotesize\begin{verbatim}
alexandra@37889
   875
?????????????????????????????????????????????????????????????????????????????????????????????
ahirn@37877
   876
   ML>  nxt;
ahirn@37877
   877
   val it = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])
ahirn@37877
   878
     : string * mstep
ahirn@37877
   879
   ML>
ahirn@37877
   880
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   881
   val nxt = ("Model_Problem",Model_Problem ["normalize","univariate","equation"])
ahirn@37877
   882
     : string * mstep
ahirn@37877
   883
   ML>
ahirn@37877
   884
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
alexandra@37889
   885
\end{verbatim}
ahirn@37877
   886
alexandra@37889
   887
\section{The phase of modeling}
alexandra@37891
   888
Dieses Kapitel besch\"aftigt sich mit dem input der Einzelheiten bei einem Problem. Die me kann dabei helfen, wenn man die formalization durch {\tt Init\_Proof} darauf hinweist. Normalerweise weiss die mathematics engine die n\"achste gute tactic.
ahirn@37877
   889
{\footnotesize\begin{verbatim}
alexandra@37889
   890
?????????????????????????????????????????????????????????????????????????????????????????????
ahirn@37877
   891
   ML>  nxt;
ahirn@37877
   892
   val it =
ahirn@37877
   893
     ("Add_Given",Add_Given "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)")
ahirn@37877
   894
     : string * mstep
ahirn@37877
   895
   ML>
ahirn@37877
   896
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   897
   val nxt = ("Add_Given",Add_Given "solveFor x") : string * mstep
ahirn@37877
   898
   ML>
ahirn@37877
   899
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   900
   val nxt = ("Add_Find",Add_Find "solutions L") : string * mstep
ahirn@37877
   901
   ML>
ahirn@37877
   902
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt; 
ahirn@37877
   903
   val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout
alexandra@37889
   904
\end{verbatim}
ahirn@37877
   905
{\footnotesize\begin{verbatim}
alexandra@37889
   906
?????????????????????????????????????????????????????????????????????????????????????????????
ahirn@37877
   907
   ML>  Compiler.Control.Print.printDepth:=8;
ahirn@37877
   908
   ML>  f;
ahirn@37877
   909
   val it =
ahirn@37877
   910
     Form'
ahirn@37877
   911
       (PpcKF
ahirn@37877
   912
          (0,EdUndef,0,Nundef,
ahirn@37877
   913
           (Problem [],
ahirn@37877
   914
            {Find=[Correct "solutions L"],
ahirn@37877
   915
             Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
   916
                    Correct "solveFor x"],Relate=[],Where=[],With=[]}))) : mout
alexandra@37889
   917
\end{verbatim}
ahirn@37877
   918
alexandra@37889
   919
alexandra@37889
   920
\section{The phase of specification}
alexandra@37891
   921
Diese phase liefert eindeutige Bestimmungen einer domain, den problem type und die method damit man sie verwenden kann. F\"ur gew\"ohnlich wird die Suche nach dem richtigen problem type unterst\"utzt. Dazu sind zwei tactics verwendbar: {\tt Specify\_Problem} entwickelt ein Feedback, wie ein problem type bei dem jetzigen problem zusammenpasst und {\tt Refine\_Problem} stellt Hilfe durch das System bereit, falls der Benutzer die \"Ubersicht verliert.
ahirn@37877
   922
{\footnotesize\begin{verbatim}
alexandra@37889
   923
??????????????????????????????????????????????????????????????????????????????????????????
alexandra@37889
   924
   ML> nxt;
ahirn@37877
   925
   val it = ("Specify_Domain",Specify_Domain "SqRoot.thy") : string * mstep
ahirn@37877
   926
   ML>
ahirn@37877
   927
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   928
   val nxt =
ahirn@37877
   929
     ("Specify_Problem",Specify_Problem ["normalize","univariate","equation"])
ahirn@37877
   930
     : string * mstep
ahirn@37877
   931
   val pt =
ahirn@37877
   932
     Nd
ahirn@37877
   933
       (PblObj
ahirn@37877
   934
          {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#,
ahirn@37877
   935
              result=#,spec=#},[]) : ptree
alexandra@37889
   936
\end{verbatim}
alexandra@37891
   937
Die me erkennt den richtigen Problem type und arbeitet so weiter:
ahirn@37877
   938
{\footnotesize\begin{verbatim}
alexandra@37889
   939
?????????????????????????????????????????????????????????????????????????????????????????
ahirn@37877
   940
   ML> val nxt = ("Specify_Problem",
ahirn@37877
   941
               Specify_Problem ["polynomial","univariate","equation"]);
ahirn@37877
   942
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   943
   val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout
ahirn@37877
   944
   val nxt =
ahirn@37877
   945
     ("Refine_Problem",Refine_Problem ["normalize","univariate","equation"])
ahirn@37877
   946
     : string * mstep
ahirn@37877
   947
   ML>
ahirn@37877
   948
   ML> val nxt = ("Specify_Problem",
ahirn@37877
   949
               Specify_Problem ["linear","univariate","equation"]);
ahirn@37877
   950
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   951
   val f =
ahirn@37877
   952
     Form'
ahirn@37877
   953
       (PpcKF
ahirn@37877
   954
          (0,EdUndef,0,Nundef,
ahirn@37877
   955
           (Problem ["linear","univariate","equation"],
ahirn@37877
   956
            {Find=[Correct "solutions L"],
ahirn@37877
   957
             Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
   958
                    Correct "solveFor x"],Relate=[],
ahirn@37877
   959
             Where=[False
ahirn@37877
   960
                    "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
ahirn@37877
   961
             With=[]}))) : mout 
alexandra@37889
   962
\end{verbatim}
alexandra@37889
   963
Wir nehmen wieder an, dass der dialog guide die n\"achsten tactics, veranlasst von der mathematic engine, versteckt und der Sch\"uler Hilfe ben\"otigt. Dann muss {\tt Refine\_Problem} angewandt werden. Dieser Befehl findet immer den richtigen Weg, wenn man es auf den problem type bezieht [''univariate``, ''equation``].
ahirn@37877
   964
{\footnotesize\begin{verbatim}
alexandra@37889
   965
????????????????????????????????????????????????????????????????????????????????????????????
ahirn@37877
   966
   ML> val nxt = ("Refine_Problem",
ahirn@37877
   967
                  Refine_Problem ["linear","univariate","equation
ahirn@37877
   968
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   969
   val f = Problems (RefinedKF [NoMatch #]) : mout
ahirn@37877
   970
   ML>
ahirn@37877
   971
   ML>  Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4;
ahirn@37877
   972
   val f =
ahirn@37877
   973
     Problems
ahirn@37877
   974
       (RefinedKF
ahirn@37877
   975
          [NoMatch
ahirn@37877
   976
             (["linear","univariate","equation"],
ahirn@37877
   977
              {Find=[Correct "solutions L"],
ahirn@37877
   978
               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
   979
                      Correct "solveFor x"],Relate=[],
ahirn@37877
   980
               Where=[False
ahirn@37877
   981
                     "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
ahirn@37877
   982
               With=[]})]) : mout
ahirn@37877
   983
   ML>
ahirn@37877
   984
   ML> val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation"]);
ahirn@37877
   985
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
   986
   val f =
ahirn@37877
   987
     Problems
ahirn@37877
   988
       (RefinedKF [Matches #,NoMatch #,NoMatch #,NoMatch #,NoMatch #,Matches #])
ahirn@37877
   989
     : mout
ahirn@37877
   990
   ML>
ahirn@37877
   991
   ML>
ahirn@37877
   992
   ML>  Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4;
ahirn@37877
   993
   val f =
ahirn@37877
   994
     Problems
ahirn@37877
   995
       (RefinedKF
ahirn@37877
   996
          [Matches
ahirn@37877
   997
             (["univariate","equation"],
ahirn@37877
   998
              {Find=[Correct "solutions L"],
ahirn@37877
   999
               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
  1000
                      Correct "solveFor x"],Relate=[],
ahirn@37877
  1001
               Where=[Correct
ahirn@37877
  1002
               With=[]}),
ahirn@37877
  1003
           NoMatch
ahirn@37877
  1004
             (["linear","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=[],
ahirn@37877
  1008
               Where=[False
ahirn@37877
  1009
                      "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"],
ahirn@37877
  1010
                  With=[]}),
ahirn@37877
  1011
           NoMatch
ahirn@37877
  1012
             ...
ahirn@37877
  1013
             ...   
ahirn@37877
  1014
           Matches
ahirn@37877
  1015
             (["normalize","univariate","equation"],
ahirn@37877
  1016
              {Find=[Correct "solutions L"],
ahirn@37877
  1017
               Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)",
ahirn@37877
  1018
                      Correct "solveFor x"],Relate=[],Where=[],With=[]})]) : mout
alexandra@37889
  1019
\end{verbatim}
alexandra@37889
  1020
Die tactic {\tt Refine\_Problem} wandelt alle matches wieder in problem types um und sucht in der problem hierachy weiter.
ahirn@37877
  1021
alexandra@37889
  1022
alexandra@37889
  1023
\section{The phase of solving}
alexandra@37891
  1024
Diese phase beginnt mit dem Aufruf einer method, die eine normale form innerhalb einer tactic ausf\"uhrt: {\tt Rewrite rnorm\_equation\_add} und {\tt Rewrite\_Set SqRoot\_simplify}:
ahirn@37877
  1025
{\footnotesize\begin{verbatim} 
ahirn@37877
  1026
   ML> nxt;
ahirn@37877
  1027
   val it = ("Apply_Method",Apply_Method ("SqRoot.thy","norm_univar_equation"))
ahirn@37877
  1028
     : string * mstep
ahirn@37877
  1029
   ML>
ahirn@37877
  1030
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1031
   val f =
ahirn@37877
  1032
     Form' (FormKF (~1,EdUndef,1,Nundef,"(x + #1) * (x + #2) = x ^^^ #2 + #8"))
ahirn@37877
  1033
   val nxt =
ahirn@37877
  1034
     ("Rewrite", Rewrite
ahirn@37877
  1035
        ("rnorm_equation_add","~ ?b =!= #0 ==> (?a = ?b) = (?a + #-1 * ?b = #0)"))
ahirn@37877
  1036
   ML>
ahirn@37877
  1037
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1038
   val f =
ahirn@37877
  1039
     Form' (FormKF (~1,EdUndef,1,Nundef,
ahirn@37877
  1040
           "(x + #1) * (x + #2) + #-1 * (x ^^^ #2 + #8) = #0")) : mout
ahirn@37877
  1041
   val nxt = ("Rewrite_Set",Rewrite_Set "SqRoot_simplify") : string * mstep
ahirn@37877
  1042
   ML>
ahirn@37877
  1043
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1044
   val f = Form' (FormKF (~1,EdUndef,1,Nundef,"#-6 + #3 * x = #0")) : mout
ahirn@37877
  1045
   val nxt = ("Subproblem",Subproblem ("SqRoot.thy",[#,#])) : string * mstep
alexandra@37889
  1046
\end{verbatim}
alexandra@37891
  1047
Die Formel $-6 + 3\cdot x = 0$ ist die Eingabe eine subproblems, das wiederum gebraucht wird, um die Gleichungsart zu erkennen und die entsprechende method auszuf\"uhren:
ahirn@37877
  1048
{\footnotesize\begin{verbatim}
ahirn@37877
  1049
   ML> nxt;
ahirn@37877
  1050
   val it = ("Subproblem",Subproblem ("SqRoot.thy",["univariate","equation"]))
ahirn@37877
  1051
   ML>   
ahirn@37877
  1052
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1053
   val f =
ahirn@37877
  1054
     Form' (FormKF
ahirn@37877
  1055
          (~1,EdUndef,1,Nundef,"Subproblem (SqRoot.thy, [univariate, equation])"))
ahirn@37877
  1056
     : mout
ahirn@37877
  1057
   val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"])
ahirn@37877
  1058
   ML>
ahirn@37877
  1059
   ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1060
   val nxt = ("Model_Problem",Model_Problem ["linear","univariate","equation"])
alexandra@37889
  1061
\end{verbatim}
alexandra@37889
  1062
{\tt Refine [''univariate``, ''equation``]} sucht die passende Gleichungsart aus der problem hierachy heraus, welche man mit {\tt Model\_Problem [''linear``, ''univariate``, ''equation``]} \"uber das System ansehen kann.
alexandra@37889
  1063
Nun folgt erneut die phase of modeling und die phase of specification.
ahirn@37877
  1064
alexandra@37889
  1065
\section{The final phase: \"Uberpr\"ufung der ''post-condition``}
alexandra@37891
  1066
Die gezeigten problems, die durch \isac{} gel\"ost wurden, sind so genannte 'example construction problems'. Das massivste Merkmal solcher problems ist die post-condition. Im Umgang mit dieser gibt es noch offene Fragen.
alexandra@37889
  1067
Dadurch wird die post-condition im folgenden Beispiel als problem und subproblem erw\"ahnt.
ahirn@37877
  1068
{\footnotesize\begin{verbatim}
ahirn@37877
  1069
   ML> nxt;
ahirn@37877
  1070
   val it = ("Check_Postcond",Check_Postcond ["linear","univariate","equation"])
ahirn@37877
  1071
   ML>
ahirn@37877
  1072
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1073
   val f = Form' (FormKF (~1,EdUndef,1,Nundef,"[x = #2]")) : mout
ahirn@37877
  1074
   val nxt =
ahirn@37877
  1075
     ("Check_Postcond",Check_Postcond ["normalize","univariate","equation"])
ahirn@37877
  1076
   ML>
ahirn@37877
  1077
   ML>  val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
ahirn@37877
  1078
   val f = Form' (FormKF (~1,EdUndef,0,Nundef,"[x = #2]")) : mout
ahirn@37877
  1079
   val nxt = ("End_Proof'",End_Proof') : string * mstep
alexandra@37889
  1080
\end{verbatim}
alexandra@37889
  1081
Die tactic {\tt End\_Proof'} bedeutet, dass der proof erflogreich beendet wurde.\\
ahirn@37877
  1082
alexandra@37891
  1083
\paragraph{Versuchen Sie es!} Die tactics, die vom System vorgeschlagen werden, m\"ussen vom Benutzer nicht angewendet werden. Er kann selbstverst\"andlich auch andere tactics verwenden und das System wird melden, ob dieser Befehl zutreffend ist oder nicht.
ahirn@37877
  1084
ahirn@37877
  1085
alexandra@37891
  1086
\part{Handbuch f\"ur Autoren}
ahirn@37877
  1087
alexandra@37889
  1088
\chapter{Die Struktur des Grundlagenwissens}
ahirn@37877
  1089
alexandra@37891
  1090
\section{''tactics`` und Daten}
alexandra@37891
  1091
Zuerst betrachten wir die me von aussen. Wir sehen uns tactics und an und verbinden sie mit unserem Grundwissen (KB). Im Bezug auf das KB befassen wir uns mit den kleinsten Teilchen, die von den Autoren des KB sehr genau durchgef\"uhrt werden m\"ussen.
alexandra@37889
  1092
Diese Teile sind in alphabetischer Anordnung in Tab.\ref{kb-items} auf Seite \pageref{kb-items} aufgelistet.
ahirn@37877
  1093
ahirn@37877
  1094
{\begin{table}[h]
alexandra@37889
  1095
\caption{Kleinste Teilchen des KB} \label{kb-items}
ahirn@37877
  1096
%\tabcolsep=0.3mm
ahirn@37877
  1097
\begin{center}
ahirn@37877
  1098
\def\arraystretch{1.0}
ahirn@37877
  1099
\begin{tabular}{lp{9.0cm}}
alexandra@37889
  1100
Abk\"urzung & Beschreibung \\
ahirn@37877
  1101
\hline
ahirn@37877
  1102
&\\
ahirn@37877
  1103
{\it calc\_list}
alexandra@37891
  1104
& gesammelte Liste von allen ausgewerteten Funktionen\\
ahirn@37877
  1105
{\it eval\_fn}
alexandra@37891
  1106
& ausgewertete Funktionen f\"ur Zahlen und f\"ur Eigenschaften, die in SML kodiert sind\\
alexandra@37889
  1107
{\it eval\_rls }
alexandra@37891
  1108
& rule set {\it rls} f\"ur einfache Ausdr\"ucke mit {\it eval\_fn}s\\
ahirn@37877
  1109
{\it fmz}
alexandra@37889
  1110
& Formalisierung, d.h. eine sehr geringe Darstellung von einem Beispiel \\
ahirn@37877
  1111
{\it met}
alexandra@37891
  1112
& eine method d.h. eine Datenstruktur, die alle Informationen zum L\"osen einer phase enth\"alt ({\it rew\_ord}, {\it scr}, etc.)\\
ahirn@37877
  1113
{\it metID}
alexandra@37889
  1114
& bezieht sich auf {\it met}\\
ahirn@37877
  1115
{\it op}
alexandra@37889
  1116
& ein Operator, der der Schl\"ussel zu {\it eval\_fn} in einer {\it calc\_list} ist \\
ahirn@37877
  1117
{\it pbl}
alexandra@37891
  1118
& Problem d.h. der Knotenpunkt in der problem hierachy\\
ahirn@37877
  1119
{\it pblID}
alexandra@37889
  1120
& bezieht sich auf {\it pbl}\\
ahirn@37877
  1121
{\it rew\_ord}
alexandra@37889
  1122
& Anordnung beim Rewriting\\
ahirn@37877
  1123
{\it rls}
alexandra@37891
  1124
& rule set, d.h. eine Datenstruktur, die theorems {\it thm} und Operatoren {\it op} zur Vereinfachung (mit {\it rew\_ord}) enth\"alt \\
ahirn@37877
  1125
{\it Rrls}
alexandra@37891
  1126
& rule set f\"ur das 'reverse rewriting' (eine \isac-Technik, die schrittweise Rewriting entwickelt, z.B. f\"ur die zur\"uckgenommenen Teile)\\
ahirn@37877
  1127
{\it scr}
alexandra@37891
  1128
& script, das die Algorithmen durch Anwenden von tactics beschreibt und ein Teil von {\it met} ist \\
ahirn@37877
  1129
{\it norm\_rls}
alexandra@37889
  1130
& spezielles Regelwerk zum Berechnen von Normalformen, im Zusammenhang mit {\it thy}\\
ahirn@37877
  1131
{\it spec}
alexandra@37889
  1132
& Spezifikation, z.B, ein Tripel ({\it thyID, pblID, metID})\\
ahirn@37877
  1133
{\it subs}
alexandra@37889
  1134
& Ersatz, z.B. eine Liste von Variablen und ihren jeweiligen Werten\\
alexandra@37892
  1135
{\it Term}
alexandra@37889
  1136
& Term von Isabelle, z.B. eine Formel\\
ahirn@37877
  1137
{\it thm}
alexandra@37889
  1138
& theorem\\
ahirn@37877
  1139
{\it thy}
alexandra@37891
  1140
& theory\\
ahirn@37877
  1141
{\it thyID}
alexandra@37889
  1142
& im Bezug auf {\it thy} \\
alexandra@37889
  1143
\end{tabular}\end{center}\end{table}}
alexandra@37889
  1144
alexandra@37891
  1145
Die Verbindung zwischen tactics und Daten werden in Tab.\ref{tac-kb} auf Seite \pageref{tac-kb} dargestellt.
alexandra@37889
  1146
alexandra@37889
  1147
ahirn@37877
  1148
\begin{table}[h]
alexandra@37891
  1149
\caption{Welche tactics verwenden die Teile des KB~?} \label{tac-kb}
ahirn@37877
  1150
\tabcolsep=0.3mm
ahirn@37877
  1151
\begin{center}
ahirn@37877
  1152
\begin{tabular}{|ll||cccc|ccc|cccc|} \hline
alexandra@37891
  1153
tactic &Eingabe & & & &norm\_& &rew\_&rls &eval\_&eval\_&calc\_& \\
alexandra@37889
  1154
& &thy &scr &Rrls&rls &thm &ord &Rrls&fn &rls &list &dsc\\
ahirn@37877
  1155
\hline\hline
ahirn@37877
  1156
Init\_Proof
alexandra@37889
  1157
&fmz & x & & & x & & & & & & & x \\
alexandra@37889
  1158
&spec & & & & & & & & & & & \\
ahirn@37877
  1159
\hline
ahirn@37877
  1160
\multicolumn{13}{|l|}{model phase}\\
ahirn@37877
  1161
\hline
alexandra@37889
  1162
Add\_*
alexandra@37892
  1163
&Term & x & & & x & & & & & & & x \\
alexandra@37889
  1164
FormFK &model & x & & & x & & & & & & & x \\
ahirn@37877
  1165
\hline
ahirn@37877
  1166
\multicolumn{13}{|l|}{specify phase}\\
ahirn@37877
  1167
\hline
alexandra@37889
  1168
Specify\_Theory
alexandra@37889
  1169
&thyID & x & & & x & & & & x & x & & x \\
alexandra@37889
  1170
Specify\_Problem
alexandra@37889
  1171
&pblID & x & & & x & & & & x & x & & x \\
alexandra@37889
  1172
Refine\_Problem
alexandra@37889
  1173
&pblID & x & & & x & & & & x & x & & x \\
alexandra@37889
  1174
Specify\_Method
alexandra@37889
  1175
&metID & x & & & x & & & & x & x & & x \\
alexandra@37889
  1176
Apply\_Method
alexandra@37889
  1177
&metID & x & x & & x & & & & x & x & & x \\
ahirn@37877
  1178
\hline
ahirn@37877
  1179
\multicolumn{13}{|l|}{solve phase}\\
ahirn@37877
  1180
\hline
alexandra@37889
  1181
Rewrite,\_Inst
alexandra@37889
  1182
&thm & x & x & & & x &met & & x &met & & \\
ahirn@37877
  1183
Rewrite, Detail
alexandra@37889
  1184
&thm & x & x & & & x &rls & & x &rls & & \\
ahirn@37877
  1185
Rewrite, Detail
alexandra@37889
  1186
&thm & x & x & & & x &Rrls & & x &Rrls & & \\
ahirn@37877
  1187
Rewrite\_Set,\_Inst
alexandra@37889
  1188
&rls & x & x & & & & & x & x & x & & \\
alexandra@37889
  1189
Calculate
alexandra@37889
  1190
&op & x & x & & & & & & & & x & \\
alexandra@37889
  1191
Substitute
alexandra@37889
  1192
&subs & x & & & x & & & & & & & \\
alexandra@37889
  1193
& & & & & & & & & & & & \\
alexandra@37889
  1194
SubProblem
alexandra@37889
  1195
&spec & x & x & & x & & & & x & x & & x \\
alexandra@37889
  1196
&fmz & & & & & & & & & & & \\
ahirn@37877
  1197
\hline
alexandra@37889
  1198
\end{tabular}\end{center}\end{table}}
ahirn@37877
  1199
ahirn@37877
  1200
alexandra@37889
  1201
\section{Die theories von \isac{}}
alexandra@37891
  1202
Die theories von \isac{} basieren auf den theories f\"ur HOL und Real von Isabelle. Diese theories haben eine spezielle Form, die durch die Endung {\tt *.thy} gekennzeichnet sind; normalerweise werden diese theories zusammen mit SML verwendet. Dann haben sie den selben Dateinamen, aber die Endung {\tt *.ML}.
alexandra@37891
  1203
Die theories von \isac{} representieren den Teil vom Basiswissen von \isac{}, die hierachy von den zwei theories ist nach diesen strukturiert. Die {\tt *.ML} Dateien beinhalten {\em alle} Daten von den anderen zwei Hauptlinien des Basiswissens, die problems und methods (ohne ihre jeweilige Struktur, die von den problem Browsern und den method Browsern gemacht wird, zu pr\"asentieren.
alexandra@37891
  1204
Die Tab.\ref{theories} auf Seite \pageref{theories} listet die base theories auf, die geplant sind in der Version \isac{} 1 angewendet zu werden. Wir erwarten, dass die Liste erweitert wird in n\"aherer Zukunft, und wir werden uns auch den theorie Browser genauer ansehen.
alexandra@37891
  1205
Die ersten drei theories auf der Liste geh\"oren {\em nicht} zum Grundwissen von \isac{}; sie besch\"aftigen sich mit der Skriptsprache f\"ur methods und ist hier nur zur Vollst\"andigkeit angef\"uhrt.
ahirn@37877
  1206
ahirn@37877
  1207
{\begin{table}[h]
alexandra@37891
  1208
\caption{theory von der ersten Version von \isac} \label{theories}
ahirn@37877
  1209
%\tabcolsep=0.3mm
ahirn@37877
  1210
\begin{center}
ahirn@37877
  1211
\def\arraystretch{1.0}
ahirn@37877
  1212
\begin{tabular}{lp{9.0cm}}
alexandra@37891
  1213
theory & Beschreibung \\
ahirn@37877
  1214
\hline
ahirn@37877
  1215
&\\
ahirn@37877
  1216
ListI.thy
alexandra@37891
  1217
& ordnet die Bezeichnungen den Funktionen, die in {\tt Isabelle2002/src/HOL/List.thy} sind, zu und (intermediatly~?) definiert einige weitere Listen von Funktionen\\
ahirn@37877
  1218
ListI.ML
alexandra@37889
  1219
& {\tt eval\_fn} f\"ur die zus\"atzliche Listen von Funktionen\\
ahirn@37877
  1220
Tools.thy
alexandra@37889
  1221
& Funktion, die f\"ur die Auswertung von Skripten ben\"otigt wird\\
ahirn@37877
  1222
Tools.ML
alexandra@37889
  1223
& bezieht sich auf {\tt eval\_fn}s\\
ahirn@37877
  1224
Script.thy
alexandra@37891
  1225
& Vorraussetzung f\"ur script: types, tactics, tacticals\\
ahirn@37877
  1226
Script.ML
alexandra@37891
  1227
& eine Reihe von tactics und Funktionen f\"ur den internen Gebrauch\\
ahirn@37877
  1228
& \\
ahirn@37877
  1229
\hline
ahirn@37877
  1230
& \\
ahirn@37877
  1231
Typefix.thy
alexandra@37889
  1232
& fortgeschrittener Austritt, um den type Fehlern zu entkommen\\
ahirn@37877
  1233
Descript.thy
alexandra@37889
  1234
& {\it Beschreibungen} f\"ur die Formeln von {\it Modellen} und {\it Problemen}\\
ahirn@37877
  1235
Atools
alexandra@37891
  1236
& Neudefinierung von Operatoren; allgemeine Eigenschaften und Funktionen f\"ur Vorraussetzungen; theorems f\"ur {\tt eval\_rls}\\
ahirn@37877
  1237
Float
alexandra@37889
  1238
& Gleitkommerzahlendarstellung\\
ahirn@37877
  1239
Equation
alexandra@37889
  1240
& grunds\"atzliche Vorstellung f\"ur  Gleichungen und Gleichungssysteme\\
ahirn@37877
  1241
Poly
alexandra@37889
  1242
& Polynome\\
ahirn@37877
  1243
PolyEq
alexandra@37889
  1244
& polynomiale Gleichungen und Gleichungssysteme \\
ahirn@37877
  1245
Rational.thy
alexandra@37891
  1246
& zus\"atzliche theorems f\"ur Rationale Zahlen\\
ahirn@37877
  1247
Rational.ML
alexandra@37889
  1248
& abbrechen, hinzuf\"ugen und vereinfachen von Rationalen Zahlen durch Verwenden von (einer allgemeineren Form von) Euclids Algorithmus; die entsprechenden umgekehrten Regels\"atze\\
ahirn@37877
  1249
RatEq
alexandra@37889
  1250
& Gleichung mit rationalen Zahlen\\
ahirn@37877
  1251
Root
alexandra@37889
  1252
& Radikanten; berechnen der Normalform; das betreffende umgekehrte Regelwerk\\
ahirn@37877
  1253
RootEq
alexandra@37889
  1254
& Gleichungen mit Wurzeln\\
ahirn@37877
  1255
RatRootEq
alexandra@37889
  1256
& Gleichungen mit rationalen Zahlen und Wurzeln (z.B. mit Termen, die beide Vorg\"ange enthalten)\\
ahirn@37877
  1257
Vect
alexandra@37889
  1258
& Vektoren Analysis\\
ahirn@37877
  1259
Trig
alexandra@37889
  1260
& Trigonometrie\\
ahirn@37877
  1261
LogExp
alexandra@37889
  1262
& Logarithmus und Exponentialfunktionen\\
ahirn@37877
  1263
Calculus
alexandra@37889
  1264
& nicht der Norm entsprechende Analysis\\
ahirn@37877
  1265
Diff
alexandra@37889
  1266
& Differenzierung\\
ahirn@37877
  1267
DiffApp
alexandra@37889
  1268
& Anwendungen beim Differenzieren (Maximum-Minimum-Probleme)\\
ahirn@37877
  1269
Test
alexandra@37889
  1270
& (alte) Daten f\"ur Testfolgen\\
ahirn@37877
  1271
Isac
alexandra@37889
  1272
& enth\"alt alle Theorien von\isac{}\\
alexandra@37889
  1273
\end{tabular}\end{center}\end{table}}
ahirn@37877
  1274
ahirn@37877
  1275
alexandra@37889
  1276
\section{Daten in {\tt *.thy} und {\tt *.ML}}
alexandra@37891
  1277
Wie schon zuvor angesprochen, haben die Arbeiten die theories von *.thy und *.ML zusammen und haben deswegen den selben Dateiname. Wie diese Daten zwischen den zwei Dateien verteilt werden wird in der
alexandra@37891
  1278
Tab.\ref{thy-ML} auf Seite \pageref{thy-ML} gezeigt. Die Ordnung von den Datenteilchen in den theories sollte an der Ordnung von der Liste festhalten.
alexandra@37889
  1279
ahirn@37877
  1280
{\begin{table}[h]
alexandra@37889
  1281
\caption{Daten in {\tt *.thy}- und {\tt *.ML}-files} \label{thy-ML}
ahirn@37877
  1282
\tabcolsep=2.0mm
ahirn@37877
  1283
\begin{center}
ahirn@37877
  1284
\def\arraystretch{1.0}
ahirn@37877
  1285
\begin{tabular}{llp{7.7cm}}
alexandra@37889
  1286
Datei & Daten & Beschreibung \\
ahirn@37877
  1287
\hline
ahirn@37877
  1288
& &\\
ahirn@37877
  1289
{\tt *.thy}
alexandra@37889
  1290
& consts
alexandra@37889
  1291
& Operatoren, Eigenschaften, Funktionen und Skriptnamen ('{\tt Skript} Name \dots{\tt Argumente}')
ahirn@37877
  1292
\\
alexandra@37889
  1293
& rules
alexandra@37891
  1294
& theorems: \isac{} verwendet theorems von Isabelle, wenn m\"oglich; zus\"atzliche theorems, die jenen von Isabelle entsprechen, bekommen ein {\it I} angeh\"angt
ahirn@37877
  1295
\\& &\\
ahirn@37877
  1296
{\tt *.ML}
alexandra@37889
  1297
& {\tt theory' :=}
alexandra@37891
  1298
& Die theory, die 
alexandra@37889
  1299
abgegrenzt ist von der {\tt *.thy}-Datei, wird durch \isac{} zug\"anglich gemacht
ahirn@37877
  1300
\\
ahirn@37877
  1301
& {\tt eval\_fn}
alexandra@37891
  1302
& die Auswertungsfunktion f\"ur die Operatoren und Eigenschaften, kodiert im meta-Level (SML); die Bezeichnugn von so einer Funktion ist eine Kombination von Schl\"usselw\"ortern {\tt eval\_} und einer Bezeichnung von der Funktion, die in in {\tt *.thy} erkl\"art ist
alexandra@37891
  1303
\\
alexandra@37889
  1304
& {\tt *\_simplify}
alexandra@37889
  1305
& der automatisierte Vereinfacher f\"ur die tats\"achliche Theorie, z.B. die Bezeichnung von diesem Regelwerk ist eine Kombination aus den Theorienbezeichnungen und dem Schl\"usselwort {\tt *\_simplify}
ahirn@37877
  1306
\\
ahirn@37877
  1307
& {\tt norm\_rls :=}
alexandra@37891
  1308
& der automatisierte Vereinfacher {\tt *\_simplify} wird so aufgehoben, dass er \"uber \isac{}  zug\"anglich ist
ahirn@37877
  1309
\\
ahirn@37877
  1310
& {\tt rew\_ord' :=}
alexandra@37889
  1311
& das Gleiche f\"ur die Anordnung des Rewriting, wenn es ausserhalb eines speziellen Regelwerks gebraucht wird
ahirn@37877
  1312
\\
ahirn@37877
  1313
& {\tt ruleset' :=}
alexandra@37889
  1314
& dasselbe wie f\"ur Regels\"atze (gew\"ohnliche Regels\"atze, umgekehrte Regels\"atze, und {\tt eval\_rls})
ahirn@37877
  1315
\\
ahirn@37877
  1316
& {\tt calc\_list :=}
alexandra@37891
  1317
& dasselbe f\"ur {\tt eval\_fn}s, wenn es ausserhalb eines bestimmten Regelwerks gebraucht wird (wenn es ausserhalb eines bestimmten Regelwerks ben\"otigt wird) (z.B. f\"ur eine tactic {\tt Calculate} in einem Skript)
ahirn@37877
  1318
\\
ahirn@37877
  1319
& {\tt store\_pbl}
alexandra@37891
  1320
& Problems, die in {\tt *.ML}-Dateien definiert sind, werden zug\"anglich f\"ur \isac{}
ahirn@37877
  1321
\\
ahirn@37877
  1322
& {\tt methods :=}
alexandra@37891
  1323
& methods, die in {\tt *.ML}-Dateien definiert sind werden zug\"anglich f\"ur \isac{}
ahirn@37877
  1324
\\
alexandra@37889
  1325
\end{tabular}\end{center}\end{table}}
ahirn@37877
  1326
alexandra@37889
  1327
\section{Formale Beschreibung der Hierarchie von Problemen}
ahirn@37877
  1328
alexandra@37889
  1329
\section{Skripttaktiken}
alexandra@37891
  1330
Tats\"achlich sind es die tactics, die die Berechnungen vorantreiben: im Hintergrund bauen sie den proof tree und sie \"ubernehmen die wichtigsten Aufgaben w\"ahrend der Auswertung bei der der ''script-interpreter`` zur Steuerung des Benutzers transferiert wird. Hier beschreiben wir nur den Syntax von tactics; die Semantik ist beschrieben etwas weiter unten im Kontext mit tactics, die die Benutzer/Innen dieses Programmes verwenden: Es gibt einen Schriftverkehr zwischen den user-tactics und den script tactics.
ahirn@37877
  1331
ahirn@37877
  1332
ahirn@37877
  1333
ahirn@37877
  1334
\part{Authoring on the knowledge}
ahirn@37877
  1335
ahirn@37877
  1336
ahirn@37877
  1337
\section{Add a theorem}
ahirn@37877
  1338
\section{Define and add a problem}
ahirn@37877
  1339
\section{Define and add a predicate}
ahirn@37877
  1340
\section{Define and add a method}
ahirn@37877
  1341
\section{}
ahirn@37877
  1342
\section{}
ahirn@37877
  1343
\section{}
ahirn@37877
  1344
\section{}
ahirn@37877
  1345
ahirn@37877
  1346
ahirn@37877
  1347
ahirn@37877
  1348
\newpage
ahirn@37877
  1349
\bibliography{bib/isac,bib/from-theses}
ahirn@37877
  1350
ahirn@37877
  1351
\end{document}