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