test/Tools/isac/ADDTESTS/course/phst11/T1_Basics.thy
author Walther Neuper <neuper@ist.tugraz.at>
Mon, 02 Sep 2013 16:16:08 +0200
changeset 52101 c3f399ce32af
parent 42090 908dfde7cf75
child 59111 c730b643bc0e
permissions -rw-r--r--
Test_Isac works again, almost ..

4 files raise errors:
# Interpret/solve.sml: "solve.sml: interSteps on norm_Rational 2"
# Interpret/inform.sml: "inform.sml: [rational,simplification] 2"
# Knowledge/partial_fractions.sml: "autoCalculate for met_partial_fraction changed: final result"
# Knowledge/eqsystem.sml: "eqsystem.sml: exp 7.70 normalize 4x4 by rewrite changed"

The chunk of changes is due to the fact, that Isac's code still is unstable.
The changes are accumulated since e8f46493af82.
     1 (*
     2 /usr/local/Isabelle/bin/isabelle jedit -l Isac T1_Basics.thy &
     3 ####.####.####.####.####.####.####.####.####.####.####.####.####.####.####.####.
     4 0         1         2         3         4         5         6         7         8
     5 *)
     6 
     7 theory T1_Basics imports Isac begin
     8 
     9 chapter {* Basics on Linux, Isabelle and ISAC *}
    10 
    11 text {*This is an Isabelle/Isar theory, that means: in between the text there 
    12   are parts which can be evaluated by the theorem prover Isabelle, if installed 
    13   properly.
    14 
    15   The goal of the course beginning with this theory is to give a quick 
    16   introduction to authoring the mathematics knowledge for the math assistant 
    17   ISAC www.ist.tugraz.at/projects/isac.
    18 
    19   The course is self-contained for mathematics teachers, and probably for 
    20   interested students.
    21 *}
    22 
    23 section {* Linux *}
    24 text {* Isabelle is a computer theorem prover (CTP) under ongoing development. 
    25   This development is done using Linux. However, now Isabelle supports cygwin 
    26   and thus also can be run on Microsoft Windows.
    27 
    28   ISAC uses Isabelle as 'logical operating system'. You get both, ISAC and 
    29   Isabelle installed into cygwin on an USB-stick at the beginning of the course.
    30 
    31   Authoring mathematics knowledge for ISAC (for instance, extending) requires 
    32   basics in handling Linux (cygwin is Linux-like). Please note that ISAC is an 
    33   experimental system and as such usability in authoring has not yet been considered.
    34 
    35   Having started cygwin you see a prompt '$' at the beginning of a line where 
    36   you can input commands ('#' is the begin of a comment not interpreted by 
    37   cygwin), for instance:
    38   \begin{itemize}
    39   \item $ cd /usr/local/Isabelle             # changes to directory of Isabelle
    40   \item $ ls -l                              # lists all files and subdirectories
    41   \item $ cd test/Tools/isac/ADDTESTS/course # go on to start the course
    42   \item $ /usr/local/Isabelle/bin/isabelle jedit -l Isac T1_Basics.thy &
    43   \item $                                    # starts the first exercise
    44   \end{itemize}
    45 
    46   The arguments required for starting the first exercise tell about the 
    47   underlying technology:
    48   \begin{itemize}
    49   \item $ \emph{jedit} is the editor to be used. jEdit www.jedit.org will be introduced to 
    50           Isabelle-users within the next few years (so we are front-of-the-wave ;-).
    51   \item $ \emph{-l Isac} loads all functionality and knowledge of ISAC
    52   \item $ \emph{T1_Basics.thy} is the file name of the first exercise
    53   \item $ \emph{&} allows to use the same command line for further commands.
    54   \end{itemize}
    55 
    56   Since paths are long, we abbreviate '/usr/local/Isabelle/' to '~~' below.
    57 *}
    58 
    59 section {* Isabelle terms *}
    60 text {* The most basic kind of data required for mathematics are terms. 
    61   ISAC uses Isabelle's terms.
    62   In order to allow for 'symbolic computation' terms require representation in 
    63   an  appropriate data structure, which is defined at ~~/src/Pure/term.ML
    64   ().
    65 
    66   Let us give an example:
    67 *}
    68 ML {* @{term "a + b * 9"}*}
    69 
    70 text {* In the 'Output' window below you see what the above command produces, 
    71   the internal representation of "a + b * 3". The '...' indicate that some 
    72   details are still hidden; further details are received this way:
    73 *}
    74 ML {* print_depth 99; @{term "a + b * 9"}; print_depth 5;
    75 *}
    76 text {* The internal representation is too comprehensive for several kinds of 
    77   inspection. Thus ISAC provides additional features, as we see below. First 
    78   let us store the term in a variable 't':
    79 *}
    80 ML {* 
    81   val t = @{term "a + b * 9"};
    82   atomwy t;
    83 *}
    84 text {* Please, observe that in this case (whenever 'writeln' is involved, even 
    85   invisibly) the output of 'atomwy t' is placed on top of the 'Output' window.
    86 
    87   Presently, ISAC uses a slightly different representation for terms (which soon
    88   will disappear), which does not encode numerals as binary numbers:
    89 *}
    90 ML {* val SOME t = parse @{theory "Isac"} "a + b * 3";
    91   atomwy (term_of t);
    92 *}
    93 text {* From the above we see: the internal representation of a term contains 
    94   all the knowledge it is built from, see
    95   http://isabelle.in.tum.de/dist/library/HOL/Groups.html for the definitions
    96   \begin{itemize}
    97   \item plus  :: "'a => 'a => 'a"  (infixl "+" 65)
    98   \item times :: "'a => 'a => 'a"  (infixl "*" 70)
    99   \end{itemize}
   100   together with relevant theorems about + and *.
   101   
   102   In the near future you will just click in order to get the requested knowledge.
   103   (The present experimental state of Isabelle/jEdit already shows the signature 
   104   of the function under the cursor, if kept on place for a second.)
   105 *}
   106 
   107 section {* Isabelle theories *}
   108 text {* As just mentioned, (almost) all the math knowledge used in a theorem 
   109   prover is explicitly defined (and not built into the code like in a CAS). The 
   110   knowledge is organised in \emph{theories}.
   111 
   112   Without these theories Isabelle cannot do any thing, it even does not understand '+' or '*'.
   113   For instance, in the theory 'HOL' (short for high order logic) even more basic knowledge is 
   114   defined ('=' etc), but not yet '+' and '*', so you get 'NONE':
   115 *}
   116 ML {*  parse @{theory "HOL"} "a + b * 3";
   117 *}
   118 text {* ISAC uses comparatively few definitions and theorems from Isabelle, see 
   119   \begin{itemize}
   120   \item http://www.ist.tugraz.at/projects/isac/www/kbase/thy/index_thy.html
   121   \end{itemize}
   122   We call this the dimension of 'deductive knowledge'.
   123 
   124   \bigskip However, ISAC provides two additional dimensions of knowledge, 'application
   125   oriented knowledge' (simply called \emph{problems}) and 'algorithmic knowledge' 
   126   (simply called \emph{methods}); See
   127   \begin{itemize}
   128   \item problems http://www.ist.tugraz.at/projects/isac/www/kbase/pbl/index_pbl.html
   129   \item methods http://www.ist.tugraz.at/projects/isac/www/kbase/met/index_met.html
   130   \end{itemize}
   131 
   132   \bigskip The three dimensions of knowledge together provide all what a 
   133   \emph{mechanized math assistant} like ISAC requires for autonomously solving problems.
   134   So, in ISAC too, is (almost) nothing built into the program code, rather, all
   135   is up to authoring.
   136 
   137   This coures intends to provide basic knowledge for authoring new examples in ISAC.
   138 *}
   139 end