doc-src/IsarRef/intro.tex
author wenzelm
Sun, 22 Aug 1999 21:13:20 +0200
changeset 7315 76a39a3784b5
parent 7297 c1eeeadbe80a
child 7335 abba35b98892
permissions -rw-r--r--
checkpoint;
     1 
     2 \chapter{Introduction}
     3 
     4 \section{Quick start}
     5 
     6 Isar is already part of Isabelle (as of version Isabelle99, or later).  The
     7 \texttt{isabelle} binary provides option \texttt{-I} to run the Isar
     8 interaction loop at startup, rather than the plain ML top-level.  Thus the
     9 quickest way to do anything with Isabelle/Isar is as follows:
    10 \begin{ttbox}
    11 isabelle -I HOL\medskip
    12 \out{> Welcome to Isabelle/HOL (Isabelle99)}\medskip
    13 theory Foo = Main:
    14 constdefs foo :: nat  "foo == 1";
    15 lemma "0 < foo" by (simp add: foo_def);
    16 end
    17 \end{ttbox}
    18 Note that any Isabelle/Isar command may be retracted by \texttt{undo}.
    19 
    20 Plain TTY-based interaction like this used to be quite feasible with
    21 traditional tactic based theorem proving, but developing Isar documents
    22 demands some better user-interface support.  \emph{Proof~General}\index{Proof
    23   General} of LFCS Edinburgh \cite{proofgeneral} offers a generic Emacs-based
    24 environment for interactive theorem provers that does all the cut-and-paste
    25 and forward-backward walk through the document in a very neat way.  Note that
    26 in Isabelle/Isar, the current position within a partial proof document is more
    27 informative than the actual proof state.  Thus Proof~General provides the
    28 canonical working environment for Isabelle/Isar, both for getting acquainted
    29 (e.g.\ by replaying existing Isar documents) and serious production work.
    30 
    31 \medskip
    32 
    33 The easiest way to use Proof~General is to make it the default Isabelle user
    34 interface.  Just say something like this in your Isabelle settings file (cf.\ 
    35 \cite{isabelle-sys}):
    36 \begin{ttbox}
    37 ISABELLE_INTERFACE=\$ISABELLE_HOME/contrib/ProofGeneral/isar/interface
    38 PROOFGENERAL_OPTIONS=""
    39 \end{ttbox}
    40 You may have to change \texttt{\$ISABELLE_HOME/contrib/ProofGeneral} to the
    41 actual installation directory of Proof~General.  Now the capital
    42 \texttt{Isabelle} executable refers to the \texttt{ProofGeneral/isar}
    43 interface.  It's usage is as follows:
    44 \begin{ttbox}
    45 Usage: interface [OPTIONS] [FILES ...]
    46 
    47 Options are:
    48   -l NAME      logic image name (default $ISABELLE_LOGIC=HOL)
    49   -p NAME      Emacs program name (default xemacs)
    50   -u BOOL      use .emacs file (default false)
    51   -w BOOL      use window system (default true)
    52 
    53 Starts Proof General for Isabelle/Isar with proof documents FILES
    54 (default Scratch.thy).
    55 \end{ttbox}
    56 Note that the defaults for these options may be overridden via the
    57 \texttt{PROOFGENERAL_OPTIONS} setting.  For example, GNU
    58 Emacs\footnote{Version 20.x required.} with loading of the startup file
    59 enabled may be configured as follows:\footnote{The interface disables
    60   \texttt{.emacs} by default to ensure successful startup despite any strange
    61   commands that tend to occur there.}
    62 \begin{ttbox}
    63 PROOFGENERAL_OPTIONS="-p emacs -u true"
    64 \end{ttbox}
    65 
    66 With the proper Isabelle interface setup, Isar documents may now be edited by
    67 visiting appropriate theory files, e.g.\ 
    68 \begin{ttbox}
    69 Isabelle \({\langle}isabellehome{\rangle}\)/src/HOL/Isar_examples/BasicLogic.thy
    70 \end{ttbox}
    71 Users of XEmacs may note the tool bar for navigating forward and backward
    72 through the text.  Consult the Proof~General documentation \cite{proofgeneral}
    73 for further basic commands, such as \texttt{c-c return} or \texttt{c-c u}.
    74 
    75 
    76 \section{How to write Isar proofs anyway?}
    77 
    78 This is one of the key questions, of course.  Isar offers a rather different
    79 approach to formal proof documents than plain old tactic scripts.  Experienced
    80 users of existing interactive theorem proving systems may have to learn
    81 thinking different in order to make effective use of Isabelle/Isar.  On the
    82 other hand, Isabelle/Isar comes much closer to existing mathematical practice
    83 of formal proof, so users with less experience in old-style tactical proving,
    84 but a good understanding of mathematical proof might cope with Isar even
    85 better.
    86 
    87 Unfortunately, there is no tutorial on Isabelle/Isar available yet.  This
    88 document really is a \emph{reference manual}.  Nevertheless, we will give some
    89 discussions of the general principles underlying Isar in
    90 chapter~\ref{ch:basics}, and provide some clues of how these may be put into
    91 practice.  Some more background information on Isar is given in
    92 \cite{Wenzel:1999:TPHOL}.  Furthermore, there are several examples distributed
    93 with Isabelle (see directory \texttt{HOL/Isar_examples}).
    94 
    95 
    96 %%% Local Variables: 
    97 %%% mode: latex
    98 %%% TeX-master: "isar-ref"
    99 %%% End: