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