tuned;
authorwenzelm
Sat Oct 30 20:13:16 1999 +0200 (1999-10-30)
changeset 79815120a2a15d06
parent 7980 fce25292e1b8
child 7982 d534b897ce39
tuned;
doc-src/IsarRef/basics.tex
doc-src/IsarRef/generic.tex
doc-src/IsarRef/intro.tex
doc-src/IsarRef/isar-ref.tex
doc-src/IsarRef/pure.tex
doc-src/IsarRef/refcard.tex
doc-src/IsarRef/syntax.tex
     1.1 --- a/doc-src/IsarRef/basics.tex	Sat Oct 30 20:12:23 1999 +0200
     1.2 +++ b/doc-src/IsarRef/basics.tex	Sat Oct 30 20:13:16 1999 +0200
     1.3 @@ -1,61 +1,7 @@
     1.4  
     1.5 -\chapter{Basic Concepts}\label{ch:basics}
     1.6 -
     1.7 -\section{Isabelle/Isar theories}
     1.8 -
     1.9 -Isabelle/Isar offers two main improvements over classic Isabelle:
    1.10 -\begin{enumerate}
    1.11 -\item A new \emph{theory format}, occasionally referred to as ``new-style
    1.12 -  theories'', supporting interactive development and unlimited undo operation.
    1.13 -\item A \emph{formal proof document language} designed to support intelligible
    1.14 -  semi-automated reasoning.  Instead of putting together unreadable tactic
    1.15 -  scripts, the author is enabled to express the reasoning in way that is close
    1.16 -  to mathematical practice.
    1.17 -\end{enumerate}
    1.18 -
    1.19 -The Isar proof language is embedded into the new theory format as a proper
    1.20 -sub-language.  Proof mode is entered by stating some $\THEOREMNAME$ or
    1.21 -$\LEMMANAME$ at the theory level, and left again with the final conclusion
    1.22 -(e.g.\ via $\QEDNAME$).  A few theory extension mechanisms require proof as
    1.23 -well, such as the HOL $\isarkeyword{typedef}$ which demands non-emptiness of
    1.24 -the representing sets.
    1.25 -
    1.26 -New-style theory files may still be associated with an ML file consisting of
    1.27 -plain old tactic scripts.  There is no longer any ML binding generated for the
    1.28 -theory and theorems, though.  ML functions \texttt{theory}, \texttt{thm}, and
    1.29 -\texttt{thms} retrieve this information \cite{isabelle-ref}.  Nevertheless,
    1.30 -migration between classic Isabelle and Isabelle/Isar is relatively easy.  Thus
    1.31 -users may start to benefit from interactive theory development even before
    1.32 -they have any idea of the Isar proof language.
    1.33 -
    1.34 -\begin{warn}
    1.35 -  Currently Proof~General does \emph{not} support mixed interactive
    1.36 -  development of classic Isabelle theory files and tactic scripts, together
    1.37 -  with Isar documents at the same time.  The ``\texttt{isa}'' and
    1.38 -  ``\texttt{isar}'' versions of Proof~General are handled as two different
    1.39 -  theorem proving systems, only one of these may be active.
    1.40 -\end{warn}
    1.41 -
    1.42 -Porting of existing tactic scripts is best done by running two separate
    1.43 -Proof~General sessions, one for replaying the old script and the other for the
    1.44 -emerging Isabelle/Isar document.
    1.45 -
    1.46 -
    1.47 -\section{The Isar proof language}
    1.48 -
    1.49 -Sorry, this important section has not been written yet!  Refer to
    1.50 -\cite{Wenzel:1999:TPHOL} for the time being.
    1.51 -
    1.52 -\subsection{Commands}
    1.53 -
    1.54 -\subsubsection{Isar primitives}
    1.55 -
    1.56 -\subsubsection{Derived elements}
    1.57 -
    1.58 -
    1.59 -\subsection{Methods}
    1.60 -
    1.61 -\subsection{Attributes}
    1.62 +%FIXME
    1.63 +%\chapter{Basic Concepts}\label{ch:basics}
    1.64 +%\section{The Isar proof language}
    1.65  
    1.66  %%% Local Variables: 
    1.67  %%% mode: latex
     2.1 --- a/doc-src/IsarRef/generic.tex	Sat Oct 30 20:12:23 1999 +0200
     2.2 +++ b/doc-src/IsarRef/generic.tex	Sat Oct 30 20:13:16 1999 +0200
     2.3 @@ -353,7 +353,7 @@
     2.4  \end{descr}
     2.5  
     2.6  
     2.7 -\subsection{Automatic methods}\label{sec:classical-auto}
     2.8 +\subsection{Automated methods}\label{sec:classical-auto}
     2.9  
    2.10  \indexisarmeth{blast}
    2.11  \indexisarmeth{fast}\indexisarmeth{best}\indexisarmeth{slow}\indexisarmeth{slow-best}
    2.12 @@ -391,7 +391,7 @@
    2.13  \S\ref{sec:classical-mod}.
    2.14  
    2.15  
    2.16 -\subsection{Combined automatic methods}
    2.17 +\subsection{Combined automated methods}
    2.18  
    2.19  \indexisarmeth{auto}\indexisarmeth{force}
    2.20  \begin{matharray}{rcl}
    2.21 @@ -437,7 +437,7 @@
    2.22  \item [$intro$, $elim$, $dest$] add introduction, elimination, destruct rules,
    2.23    respectively.  By default, rules are considered as \emph{safe}, while a
    2.24    single ``!'' classifies as \emph{unsafe}, and ``!!'' as \emph{extra} (i.e.\ 
    2.25 -  not applied in the search-oriented automatic methods, but only $rule$).
    2.26 +  not applied in the search-oriented automated methods, but only $rule$).
    2.27    
    2.28  \item [$iff$] declares equations both as rewrite rules for the simplifier and
    2.29    classical reasoning rules.
     3.1 --- a/doc-src/IsarRef/intro.tex	Sat Oct 30 20:12:23 1999 +0200
     3.2 +++ b/doc-src/IsarRef/intro.tex	Sat Oct 30 20:13:16 1999 +0200
     3.3 @@ -16,19 +16,18 @@
     3.4  end
     3.5  \end{ttbox}
     3.6  Note that any Isabelle/Isar command may be retracted by \texttt{undo}; the
     3.7 -\texttt{help} command prints the list of available language elements.
     3.8 +\texttt{help} command prints a list of available language elements.
     3.9  
    3.10  Plain TTY-based interaction like this used to be quite feasible with
    3.11  traditional tactic based theorem proving, but developing Isar documents
    3.12  demands some better user-interface support.  \emph{Proof~General}\index{Proof
    3.13    General} of LFCS Edinburgh \cite{proofgeneral} offers a generic Emacs-based
    3.14  environment for interactive theorem provers that does all the cut-and-paste
    3.15 -and forward-backward walk through the document in a very neat way.  Note that
    3.16 -in Isabelle/Isar, the current position within a partial proof document is
    3.17 -equally important than the actual proof state.  Thus Proof~General provides
    3.18 -the canonical working environment for Isabelle/Isar, both for getting
    3.19 -acquainted (e.g.\ by replaying existing Isar documents) and real production
    3.20 -work.
    3.21 +and forward-backward walk through the text in a very neat way.  Note that in
    3.22 +Isabelle/Isar, the current position within a partial proof document is equally
    3.23 +important than the actual proof state.  Thus Proof~General provides the
    3.24 +canonical working environment for Isabelle/Isar, both for getting acquainted
    3.25 +(e.g.\ by replaying existing Isar documents) and real production work.
    3.26  
    3.27  \medskip
    3.28  
    3.29 @@ -42,7 +41,8 @@
    3.30  You may have to change \texttt{\$ISABELLE_HOME/contrib/ProofGeneral} to the
    3.31  actual installation directory of Proof~General.  From now on, the capital
    3.32  \texttt{Isabelle} executable refers to the \texttt{ProofGeneral/isar}
    3.33 -interface.  Its usage is as follows:
    3.34 +interface.\footnote{There is also a \texttt{ProofGeneral/isa} interface, for
    3.35 +  classic Isabelle tactic scripts.}  Its usage is as follows:
    3.36  \begin{ttbox}
    3.37  Usage: interface [OPTIONS] [FILES ...]
    3.38  
    3.39 @@ -61,9 +61,19 @@
    3.40  via the \texttt{PROOFGENERAL_OPTIONS} setting as well.  For example, plain GNU
    3.41  Emacs may be configured as follows:
    3.42  \begin{ttbox}
    3.43 -PROOFGENERAL_OPTIONS="-p emacs"
    3.44 +PROOFGENERAL_OPTIONS="-u false -p emacs"
    3.45  \end{ttbox}
    3.46  
    3.47 +Occasionally, a user's \texttt{.emacs} file contains material that is
    3.48 +incompatible with the version of (X)Emacs that Proof~General prefers.  Then
    3.49 +proper startup may be still achieved by using the \texttt{-u false}
    3.50 +option.\footnote{Any Emacs lisp file \texttt{proofgeneral-settings.el}
    3.51 +  occurring in \texttt{\$ISABELLE_HOME/etc} or
    3.52 +  \texttt{\$ISABELLE_HOME_USER/etc} is automatically loaded by the
    3.53 +  Proof~General interface script as well.}
    3.54 +
    3.55 +\medskip
    3.56 +
    3.57  With the proper Isabelle interface setup, Isar documents may now be edited by
    3.58  visiting appropriate theory files, e.g.\ 
    3.59  \begin{ttbox}
    3.60 @@ -71,18 +81,49 @@
    3.61  \end{ttbox}
    3.62  Users of XEmacs may note the tool bar for navigating forward and backward
    3.63  through the text.  Consult the Proof~General documentation \cite{proofgeneral}
    3.64 -for further basic command sequences, like ``\texttt{c-c return}'' or
    3.65 +for further basic command sequences, such as ``\texttt{c-c return}'' or
    3.66  ``\texttt{c-c u}''.
    3.67  
    3.68 -\medskip
    3.69 +
    3.70 +\section{Isabelle/Isar theories}
    3.71 +
    3.72 +Isabelle/Isar offers two main improvements over classic Isabelle:
    3.73 +\begin{enumerate}
    3.74 +\item A new \emph{theory format}, occasionally referred to as ``new-style
    3.75 +  theories'', supporting interactive development and unlimited undo operation.
    3.76 +\item A \emph{formal proof document language} designed to support intelligible
    3.77 +  semi-automated reasoning.  Instead of putting together unreadable tactic
    3.78 +  scripts, the author is enabled to express the reasoning in way that is close
    3.79 +  to mathematical practice.
    3.80 +\end{enumerate}
    3.81 +
    3.82 +The Isar proof language is embedded into the new theory format as a proper
    3.83 +sub-language.  Proof mode is entered by stating some $\THEOREMNAME$ or
    3.84 +$\LEMMANAME$ at the theory level, and left again with the final conclusion
    3.85 +(e.g.\ via $\QEDNAME$).  A few theory extension mechanisms require proof as
    3.86 +well, such as the HOL $\isarkeyword{typedef}$ which demands non-emptiness of
    3.87 +the representing sets.
    3.88  
    3.89 -Occasionally, a user's \texttt{.emacs} file contains material that is
    3.90 -incompatible with the version of (X)Emacs that Proof~General prefers.  Then
    3.91 -proper startup may be still achieved by using the \texttt{-u false}
    3.92 -option.\footnote{Any Emacs lisp file \texttt{proofgeneral-settings.el}
    3.93 -  occurring in \texttt{\$ISABELLE_HOME/etc} or
    3.94 -  \texttt{\$ISABELLE_HOME_USER/etc} is automatically loaded by the
    3.95 -  Proof~General interface script as well.}
    3.96 +New-style theory files may still be associated with separate ML files
    3.97 +consisting of plain old tactic scripts.  There is no longer any ML binding
    3.98 +generated for the theory and theorems, though.  ML functions \texttt{theory},
    3.99 +\texttt{thm}, and \texttt{thms} retrieve this information \cite{isabelle-ref}.
   3.100 +Nevertheless, migration between classic Isabelle and Isabelle/Isar is
   3.101 +relatively easy.  Thus users may start to benefit from interactive theory
   3.102 +development even before they have any idea of the Isar proof language at all.
   3.103 +
   3.104 +\begin{warn}
   3.105 +  Currently Proof~General does \emph{not} support mixed interactive
   3.106 +  development of classic Isabelle theory files or tactic scripts, together
   3.107 +  with Isar documents.  The ``\texttt{isa}'' and ``\texttt{isar}'' versions of
   3.108 +  Proof~General are handled as two different theorem proving systems, only one
   3.109 +  of these may be active at the same time.
   3.110 +\end{warn}
   3.111 +
   3.112 +Porting of existing tactic scripts is best done by running two separate
   3.113 +Proof~General sessions, one for replaying the old script and the other for the
   3.114 +emerging Isabelle/Isar document.
   3.115 +
   3.116  
   3.117  \section{How to write Isar proofs anyway?}
   3.118  
   3.119 @@ -93,17 +134,14 @@
   3.120  other hand, Isabelle/Isar comes much closer to existing mathematical practice
   3.121  of formal proof, so users with less experience in old-style tactical proving,
   3.122  but a good understanding of mathematical proof, might cope with Isar even
   3.123 -better.
   3.124 +better.  See also \cite{Wenzel:1999:TPHOL} for further background information
   3.125 +on Isar.
   3.126  
   3.127 -This document really is a \emph{reference manual}.  Nevertheless, we will give
   3.128 -some discussions of the general principles underlying Isar in
   3.129 -chapter~\ref{ch:basics}, and provide some clues of how these may be put into
   3.130 -practice.  Some more background information on Isar is given in
   3.131 -\cite{Wenzel:1999:TPHOL}.  While there is no proper tutorial on Isabelle/Isar
   3.132 -available yet, there are several examples distributed with Isabelle.  See
   3.133 -\texttt{HOL/Isar_examples} and \texttt{HOL/HOL-Real/HahnBanach} in the
   3.134 -Isabelle library:
   3.135 -
   3.136 +\medskip This really is a \emph{reference manual}.  Nevertheless, we will also
   3.137 +give some clues of how the concepts introduced here may be put into practice.
   3.138 +Appendix~\ref{ap:refcard} provides a quick reference card of the most common
   3.139 +Isabelle/Isar language elements.  There are several examples distributed with
   3.140 +Isabelle, and available via the Isabelle WWW library:
   3.141  \begin{center}\small
   3.142    \begin{tabular}{l}
   3.143      \url{http://www.cl.cam.ac.uk/Research/HVG/Isabelle/library/} \\
   3.144 @@ -111,8 +149,9 @@
   3.145    \end{tabular}
   3.146  \end{center}
   3.147  
   3.148 -Apart from browsable HTML sources, both Isabelle/Isar sessions also provide
   3.149 -actual documents (in PDF).
   3.150 +See \texttt{HOL/Isar_examples} for a collection of introductory examples.
   3.151 +\texttt{HOL/HOL-Real/HahnBanach} is a big mathematics application.  Apart from
   3.152 +browsable HTML sources, both sessions provide actual documents (in PDF).
   3.153  
   3.154  %%% Local Variables: 
   3.155  %%% mode: latex
     4.1 --- a/doc-src/IsarRef/isar-ref.tex	Sat Oct 30 20:12:23 1999 +0200
     4.2 +++ b/doc-src/IsarRef/isar-ref.tex	Sat Oct 30 20:13:16 1999 +0200
     4.3 @@ -54,14 +54,13 @@
     4.4    
     4.5    The current version of Isabelle offers Isar as an alternative proof language
     4.6    interface layer.  The Isabelle/Isar system provides an interpreter for the
     4.7 -  Isar formal proof document language.  The input may consist either of
     4.8 -  \emph{proper document constructors}, or \emph{improper auxiliary commands}
     4.9 -  (for diagnostics, exploration etc.).  Proof texts consisting of proper
    4.10 -  document constructors only, admit a purely static reading, thus being
    4.11 -  intelligible later without requiring dynamic replay that is so typical for
    4.12 -  traditional proof scripts.  Any of the Isabelle/Isar commands may be
    4.13 -  executed in single-steps, so basically the interpreter has a proof text
    4.14 -  debugger already built-in.
    4.15 +  Isar formal proof document language.  The input may consist either of proper
    4.16 +  document constructors, or improper auxiliary commands (for diagnostics,
    4.17 +  exploration etc.).  Proof texts consisting of proper document constructors
    4.18 +  only, admit a purely static reading, thus being intelligible later without
    4.19 +  requiring dynamic replay that is so typical for traditional proof scripts.
    4.20 +  Any of the Isabelle/Isar commands may be executed in single-steps, so
    4.21 +  basically the interpreter has a proof text debugger already built-in.
    4.22    
    4.23    Employing the Isar instantiation of \emph{Proof~General}, the generic Emacs
    4.24    interface for interactive proof assistants of LFCS Edinburgh, we arrive at a
     5.1 --- a/doc-src/IsarRef/pure.tex	Sat Oct 30 20:12:23 1999 +0200
     5.2 +++ b/doc-src/IsarRef/pure.tex	Sat Oct 30 20:13:16 1999 +0200
     5.3 @@ -14,10 +14,10 @@
     5.4  \emph{improper commands}.  Some proof methods and attributes introduced later
     5.5  are classified as improper as well.  Improper Isar language elements, which
     5.6  are subsequently marked by $^*$, are often helpful when developing proof
     5.7 -documents, while their use is usually discouraged for the final outcome.
     5.8 -Typical examples are diagnostic commands that print terms or theorems
     5.9 -according to the current context; other commands even emulate old-style
    5.10 -tactical theorem proving, which facilitates porting of legacy proof scripts.
    5.11 +documents, while their use is discouraged for the final outcome.  Typical
    5.12 +examples are diagnostic commands that print terms or theorems according to the
    5.13 +current context; other commands even emulate old-style tactical theorem
    5.14 +proving, which facilitates porting of legacy proof scripts.
    5.15  
    5.16  
    5.17  \section{Theory commands}
    5.18 @@ -33,7 +33,7 @@
    5.19  \end{matharray}
    5.20  
    5.21  Isabelle/Isar ``new-style'' theories are either defined via theory files or
    5.22 -interactively.  Both actual theory specifications and proofs are handled
    5.23 +interactively.  Both theory-level specifications and proofs are handled
    5.24  uniformly --- occasionally definitional mechanisms even require some explicit
    5.25  proof as well.  In contrast, ``old-style'' Isabelle theories support batch
    5.26  processing only, with the proof scripts collected in separate ML files.
    5.27 @@ -67,23 +67,24 @@
    5.28    produce chapter or section headings.  See also \S\ref{sec:markup-thy} and
    5.29    \S\ref{sec:markup-prf} for further markup commands.
    5.30    
    5.31 -\item [$\THEORY~A = B@1 + \cdots + B@n$] commences a new theory $A$ based on
    5.32 -  existing ones $B@1 + \cdots + B@n$.  Isabelle's theory loader system ensures
    5.33 -  that any of the base theories are properly loaded (and fully up-to-date when
    5.34 -  $\THEORY$ is executed interactively).  The optional $\isarkeyword{files}$
    5.35 -  specification declares additional dependencies on ML files.  Unless put in
    5.36 -  parentheses, any file will be loaded immediately via $\isarcmd{use}$ (see
    5.37 -  also \S\ref{sec:ML}).  The optional ML file \texttt{$A$.ML} that may be
    5.38 -  associated with any theory should \emph{not} be included in
    5.39 -  $\isarkeyword{files}$.
    5.40 +\item [$\THEORY~A = B@1 + \cdots + B@n\colon$] commences a new theory $A$
    5.41 +  based on existing ones $B@1 + \cdots + B@n$.  Isabelle's theory loader
    5.42 +  system ensures that any of the base theories are properly loaded (and fully
    5.43 +  up-to-date when $\THEORY$ is executed interactively).  The optional
    5.44 +  $\isarkeyword{files}$ specification declares additional dependencies on ML
    5.45 +  files.  Unless put in parentheses, any file will be loaded immediately via
    5.46 +  $\isarcmd{use}$ (see also \S\ref{sec:ML}).  The optional ML file
    5.47 +  \texttt{$A$.ML} that may be associated with any theory should \emph{not} be
    5.48 +  included in $\isarkeyword{files}$, though.
    5.49    
    5.50  \item [$\CONTEXT~B$] enters an existing theory context, basically in read-only
    5.51 -  mode, so only a limited set of commands may be performed.  Just as for
    5.52 -  $\THEORY$, the theory loader ensures that $B$ is loaded and up-to-date.
    5.53 +  mode, so only a limited set of commands may be performed without destroying
    5.54 +  the theory.  Just as for $\THEORY$, the theory loader ensures that $B$ is
    5.55 +  loaded and up-to-date.
    5.56    
    5.57  \item [$\END$] concludes the current theory definition or context switch.
    5.58 -  Note that this command cannot be undone, instead the whole theory definition
    5.59 -  has to be retracted.
    5.60 +Note that this command cannot be undone, but the whole theory definition has
    5.61 +to be retracted.
    5.62  \end{descr}
    5.63  
    5.64  
    5.65 @@ -101,7 +102,7 @@
    5.66  \end{matharray}
    5.67  
    5.68  Apart from formal comments (see \S\ref{sec:comments}), markup commands provide
    5.69 -another way to insert text into the document generated from a theory (see
    5.70 +a structured way to insert text into the document generated from a theory (see
    5.71  \cite{isabelle-sys} for more information on Isabelle's document preparation
    5.72  tools).
    5.73  
    5.74 @@ -127,16 +128,16 @@
    5.75    becomes available.  A typical application would be to emit
    5.76    \verb,\begin{comment}, and \verb,\end{comment}, commands to exclude certain
    5.77    parts from the final document.\footnote{This requires the \texttt{comment}
    5.78 -    {\LaTeX} package to be included}
    5.79 +    package to be included in {\LaTeX}.}
    5.80  \end{descr}
    5.81  
    5.82  Any markup command (except $\isarkeyword{text_raw}$) corresponds to a {\LaTeX}
    5.83 -macro with the name derived from \verb,\isamarkup, (e.g.\ 
    5.84 +macro with the name prefixed by \verb,\isamarkup, (e.g.\ 
    5.85  \verb,\isamarkupchapter, for $\isarkeyword{chapter}$). The \railqtoken{text}
    5.86 -argument is passed to that macro unchanged, i.e.\ any {\LaTeX} commands may be
    5.87 -included here.
    5.88 +argument is passed to that macro unchanged, i.e.\ further {\LaTeX} commands
    5.89 +may be included here as well.
    5.90  
    5.91 -\medskip Further markup commands are available for proofs (see
    5.92 +\medskip Additional markup commands are available for proofs (see
    5.93  \S\ref{sec:markup-prf}).  Also note that the $\isarkeyword{header}$
    5.94  declaration (see \S\ref{sec:begin-thy}) admits to insert document markup
    5.95  elements just preceding the actual theory definition.
    5.96 @@ -199,8 +200,7 @@
    5.97    $(\vec\alpha)t$ for existing type $\tau$.  Unlike actual type definitions,
    5.98    as are available in Isabelle/HOL for example, type synonyms are just purely
    5.99    syntactic abbreviations without any logical significance.  Internally, type
   5.100 -  synonyms are fully expanded, as may be observed when printing terms or
   5.101 -  theorems.
   5.102 +  synonyms are fully expanded.
   5.103  \item [$\isarkeyword{typedecl}~(\vec\alpha)t$] declares a new type constructor
   5.104    $t$, intended as an actual logical type.  Note that object-logics such as
   5.105    Isabelle/HOL override $\isarkeyword{typedecl}$ by their own version.
   5.106 @@ -214,7 +214,7 @@
   5.107  \end{descr}
   5.108  
   5.109  
   5.110 -\subsection{Constants and simple definitions}
   5.111 +\subsection{Constants and simple definitions}\label{sec:consts}
   5.112  
   5.113  \indexisarcmd{consts}\indexisarcmd{defs}\indexisarcmd{constdefs}\indexoutertoken{constdecl}
   5.114  \begin{matharray}{rcl}
   5.115 @@ -248,7 +248,7 @@
   5.116  \end{descr}
   5.117  
   5.118  
   5.119 -\subsection{Syntax and translations}
   5.120 +\subsection{Syntax and translations}\label{sec:syn-trans}
   5.121  
   5.122  \indexisarcmd{syntax}\indexisarcmd{translations}
   5.123  \begin{matharray}{rcl}
   5.124 @@ -274,7 +274,7 @@
   5.125    \texttt{output} flag given, all productions are added both to the input and
   5.126    output grammar.
   5.127  \item [$\isarkeyword{translations}~rules$] specifies syntactic translation
   5.128 -  rules (i.e.\ \emph{macros}): parse/print rules (\texttt{==}), parse rules
   5.129 +  rules (i.e.\ \emph{macros}): parse~/ print rules (\texttt{==}), parse rules
   5.130    (\texttt{=>}), or print rules (\texttt{<=}).  Translation patterns may be
   5.131    prefixed by the syntactic category to be used for parsing; the default is
   5.132    \texttt{logic}.
   5.133 @@ -306,7 +306,7 @@
   5.134    Everyday work is typically done the hard way, with proper definitions and
   5.135    actual theorems.
   5.136  \item [$\isarkeyword{theorems}~a = \vec b$] stores lists of existing theorems.
   5.137 -  Typical applications would also involve attributes, to augment the default
   5.138 +  Typical applications would also involve attributes, to augment the
   5.139    Simplifier context, for example.
   5.140  \item [$\isarkeyword{lemmas}$] is similar to $\isarkeyword{theorems}$, but
   5.141    tags the results as ``lemma''.
   5.142 @@ -358,7 +358,7 @@
   5.143  \begin{descr}
   5.144  \item [$\isarkeyword{use}~file$] reads and executes ML commands from $file$.
   5.145    The current theory context (if present) is passed down to the ML session,
   5.146 -  but must not be modified.  Furthermore, the file name is checked with the
   5.147 +  but may not be modified.  Furthermore, the file name is checked with the
   5.148    $\isarkeyword{files}$ dependency declaration given in the theory header (see
   5.149    also \S\ref{sec:begin-thy}).
   5.150    
   5.151 @@ -370,32 +370,33 @@
   5.152    afterwards.  Thus $text$ may actually change the theory as a side effect.
   5.153    
   5.154  \item [$\isarkeyword{setup}~text$] changes the current theory context by
   5.155 -  applying setup functions from $text$, which has to refer to an ML expression
   5.156 -  of type $(theory \to theory)~list$.  The $\isarkeyword{setup}$ command is
   5.157 -  the canonical way to initialize object-logic specific tools and packages
   5.158 -  written in ML.
   5.159 +  applying setup functions from $text$, which refers to an ML expression of
   5.160 +  type $(theory \to theory)~list$.  The $\isarkeyword{setup}$ command is the
   5.161 +  canonical way to initialize object-logic specific tools and packages written
   5.162 +  in ML.
   5.163  \end{descr}
   5.164  
   5.165  
   5.166 -\subsection{Syntax translation functions}
   5.167 +%FIXME remove!?
   5.168 +%\subsection{Syntax translation functions}
   5.169  
   5.170 -\indexisarcmd{parse-ast-translation}\indexisarcmd{parse-translation}
   5.171 -\indexisarcmd{print-translation}\indexisarcmd{typed-print-translation}
   5.172 -\indexisarcmd{print-ast-translation}\indexisarcmd{token-translation}
   5.173 -\begin{matharray}{rcl}
   5.174 -  \isarcmd{parse_ast_translation} & : & \isartrans{theory}{theory} \\
   5.175 -  \isarcmd{parse_translation} & : & \isartrans{theory}{theory} \\
   5.176 -  \isarcmd{print_translation} & : & \isartrans{theory}{theory} \\
   5.177 -  \isarcmd{typed_print_translation} & : & \isartrans{theory}{theory} \\
   5.178 -  \isarcmd{print_ast_translation} & : & \isartrans{theory}{theory} \\
   5.179 -  \isarcmd{token_translation} & : & \isartrans{theory}{theory} \\
   5.180 -\end{matharray}
   5.181 +%\indexisarcmd{parse-ast-translation}\indexisarcmd{parse-translation}
   5.182 +%\indexisarcmd{print-translation}\indexisarcmd{typed-print-translation}
   5.183 +%\indexisarcmd{print-ast-translation}\indexisarcmd{token-translation}
   5.184 +%\begin{matharray}{rcl}
   5.185 +%  \isarcmd{parse_ast_translation} & : & \isartrans{theory}{theory} \\
   5.186 +%  \isarcmd{parse_translation} & : & \isartrans{theory}{theory} \\
   5.187 +%  \isarcmd{print_translation} & : & \isartrans{theory}{theory} \\
   5.188 +%  \isarcmd{typed_print_translation} & : & \isartrans{theory}{theory} \\
   5.189 +%  \isarcmd{print_ast_translation} & : & \isartrans{theory}{theory} \\
   5.190 +%  \isarcmd{token_translation} & : & \isartrans{theory}{theory} \\
   5.191 +%\end{matharray}
   5.192  
   5.193 -Syntax translation functions written in ML admit almost arbitrary
   5.194 -manipulations of Isabelle's inner syntax.  Any of the above commands have a
   5.195 -single \railqtoken{text} argument that refers to an ML expression of
   5.196 -appropriate type.  See \cite[\S8]{isabelle-ref} for more information on syntax
   5.197 -transformations.
   5.198 +%Syntax translation functions written in ML admit almost arbitrary
   5.199 +%manipulations of Isabelle's inner syntax.  Any of the above commands have a
   5.200 +%single \railqtoken{text} argument that refers to an ML expression of
   5.201 +%appropriate type.  See \cite[\S8]{isabelle-ref} for more information on syntax
   5.202 +%transformations.
   5.203  
   5.204  
   5.205  \subsection{Oracles}
     6.1 --- a/doc-src/IsarRef/refcard.tex	Sat Oct 30 20:12:23 1999 +0200
     6.2 +++ b/doc-src/IsarRef/refcard.tex	Sat Oct 30 20:13:16 1999 +0200
     6.3 @@ -1,5 +1,5 @@
     6.4  
     6.5 -\chapter{Isabelle/Isar Quick Reference}
     6.6 +\chapter{Isabelle/Isar Quick Reference}\label{ap:refcard}
     6.7  
     6.8  \section{Proof commands}
     6.9  
    6.10 @@ -87,7 +87,8 @@
    6.11    \multicolumn{2}{l}{\textbf{Repeated steps (inserting facts)}} \\[0.5ex]
    6.12    $-$ & \text{no rules} \\
    6.13    $intro~a@1~\dots~a@n$ & \text{introduction rules} \\
    6.14 -  $elim~a@1~\dots~a@n$ & \text{elimination rules} \\[2ex]
    6.15 +  $elim~a@1~\dots~a@n$ & \text{elimination rules} \\
    6.16 +  $unfold~a@1~\dots~a@n$ & \text{definitions} \\[2ex]
    6.17  
    6.18    \multicolumn{2}{l}{\textbf{Automated proof tools (inserting facts, or even prems!)}} \\[0.5ex]
    6.19    $simp$ & Simplifier \\
     7.1 --- a/doc-src/IsarRef/syntax.tex	Sat Oct 30 20:12:23 1999 +0200
     7.2 +++ b/doc-src/IsarRef/syntax.tex	Sat Oct 30 20:13:16 1999 +0200
     7.3 @@ -18,9 +18,9 @@
     7.4  
     7.5  \begin{warn}
     7.6    Note that classic Isabelle theories used to fake parts of the inner type
     7.7 -  syntax, with complicated rules when quotes may be omitted.  Despite the
     7.8 -  minor drawback of requiring quotes more often, the syntax of Isabelle/Isar
     7.9 -  is simpler and more robust in that respect.
    7.10 +  syntax, with rather complicated rules when quotes may be omitted.  Despite
    7.11 +  the minor drawback of requiring quotes more often, the syntax of
    7.12 +  Isabelle/Isar is simpler and more robust in that respect.
    7.13  \end{warn}
    7.14  
    7.15  \medskip
    7.16 @@ -28,10 +28,9 @@
    7.17  Another notable point is proper input termination.  Proof~General demands any
    7.18  command to be terminated by ``\texttt{;}''
    7.19  (semicolon)\index{semicolon}\index{*;}.  As far as plain Isabelle/Isar is
    7.20 -concerned, commands may be directly run together, though.  Thus we usually
    7.21 -omit semicolons when presenting Isar proof text here, in order to gain
    7.22 -readability.  Note that the documents which automatically generated from
    7.23 -new-style theories also omit semicolons.
    7.24 +concerned, commands may be directly run together, though.  In the presentation
    7.25 +of Isabelle/Isar documents, semicolons are omitted in order to gain
    7.26 +readability.
    7.27  
    7.28  
    7.29  \section{Lexical matters}\label{sec:lex-syntax}
    7.30 @@ -65,15 +64,15 @@
    7.31  
    7.32  The syntax of \texttt{string} admits any characters, including newlines;
    7.33  ``\verb|"|'' (double-quote) and ``\verb|\|'' (backslash) have to be escaped by
    7.34 -a backslash, though.  Note that ML-style control character notation is
    7.35 -\emph{not} supported.  The body of \texttt{verbatim} may consist of any text
    7.36 -not containing \verb|*}|.
    7.37 +a backslash.  Note that ML-style control characters are \emph{not} supported.
    7.38 +The body of \texttt{verbatim} may consist of any text not containing
    7.39 +``\verb|*}|''.
    7.40  
    7.41  Comments take the form \texttt{(*~\dots~*)} and may be
    7.42 -nested\footnote{Proof~General may get confused by nested comments, though.},
    7.43 -just as in ML. Note that these are \emph{source} comments only, which are
    7.44 -stripped after lexical analysis of the input.  The Isar document syntax also
    7.45 -provides of \emph{formal comments} that are actually part of the text (see
    7.46 +nested\footnote{Proof~General may get confused by nested comments.}, just as
    7.47 +in ML. Note that these are \emph{source} comments only, which are stripped
    7.48 +after lexical analysis of the input.  The Isar document syntax also provides
    7.49 +\emph{formal comments} that are actually part of the text (see
    7.50  \S\ref{sec:comments}).
    7.51  
    7.52  
    7.53 @@ -83,7 +82,7 @@
    7.54  terms, and theorem specifications, which have been factored out of the actual
    7.55  Isar language elements to be described later.
    7.56  
    7.57 -Note that some of the basic syntactic entities introduced below (such as
    7.58 +Note that some of the basic syntactic entities introduced below (e.g.\ 
    7.59  \railqtoken{name}) act much like tokens rather than plain nonterminals (e.g.\ 
    7.60  \railnonterm{sort}), especially for the sake of error messages.  E.g.\ syntax
    7.61  elements such as $\CONSTS$ referring to \railqtoken{name} or \railqtoken{type}
    7.62 @@ -161,12 +160,12 @@
    7.63  The actual inner Isabelle syntax, that of types and terms of the logic, is far
    7.64  too sophisticated in order to be modelled explicitly at the outer theory
    7.65  level.  Basically, any such entity has to be quoted here to turn it into a
    7.66 -single token (the parsing and type-checking is performed later).  For
    7.67 -convenience, a slightly more liberal convention is adopted: quotes may be
    7.68 +single token (the parsing and type-checking is performed internally later).
    7.69 +For convenience, a slightly more liberal convention is adopted: quotes may be
    7.70  omitted for any type or term that is already \emph{atomic} at the outer level.
    7.71  For example, one may write just \texttt{x} instead of \texttt{"x"}.  Note that
    7.72 -symbolic identifiers such as \texttt{++} are available as well, provided these
    7.73 -are not superseded by commands or keywords (like \texttt{+}).
    7.74 +symbolic identifiers (e.g.\ \texttt{++}) are available as well, provided these
    7.75 +are not superseded by commands or keywords (e.g.\ \texttt{+}).
    7.76  
    7.77  \indexoutertoken{type}\indexoutertoken{term}\indexoutertoken{prop}
    7.78  \begin{rail}
    7.79 @@ -193,7 +192,7 @@
    7.80  \subsection{Term patterns}\label{sec:term-pats}
    7.81  
    7.82  Assumptions and goal statements usually admit casual binding of schematic term
    7.83 -variables by giving (optional) patterns of the form $\ISS{p@1 \dots}{p@n}$.
    7.84 +variables by giving (optional) patterns of the form $\ISS{p@1\;\dots}{p@n}$.
    7.85  There are separate versions available for \railqtoken{term}s and
    7.86  \railqtoken{prop}s.  The latter provides a $\CONCLNAME$ part with patterns
    7.87  referring the (atomic) conclusion of a rule.
    7.88 @@ -210,8 +209,10 @@
    7.89  \subsection{Mixfix annotations}
    7.90  
    7.91  Mixfix annotations specify concrete \emph{inner} syntax of Isabelle types and
    7.92 -terms.  Some commands such as $\TYPES$ admit infixes only, while $\CONSTS$ and
    7.93 -$\isarkeyword{syntax}$ support the full range of general mixfixes and binders.
    7.94 +terms.  Some commands such as $\TYPES$ (see \S\ref{sec:types-pure}) admit
    7.95 +infixes only, while $\CONSTS$ (see \S\ref{sec:consts}) and
    7.96 +$\isarkeyword{syntax}$ (see \S\ref{sec:syn-trans}) support the full range of
    7.97 +general mixfixes and binders.
    7.98  
    7.99  \indexouternonterm{infix}\indexouternonterm{mixfix}
   7.100  \begin{rail}
   7.101 @@ -232,8 +233,8 @@
   7.102  \railnonterm{args} below is parsed by the attribute a second time.  The
   7.103  attribute argument specifications may be any sequence of atomic entities
   7.104  (identifiers, strings etc.), or properly bracketed argument lists.  Below
   7.105 -\railqtoken{atom} refers to any atomic entity, including \railtoken{keyword}s
   7.106 -conforming to \railtoken{symident}.
   7.107 +\railqtoken{atom} refers to any atomic entity, including any
   7.108 +\railtoken{keyword} conforming to \railtoken{symident}.
   7.109  
   7.110  \indexoutertoken{atom}\indexouternonterm{args}\indexouternonterm{attributes}
   7.111  \begin{rail}
   7.112 @@ -249,13 +250,13 @@
   7.113  
   7.114  Theorem specifications come in several flavors: \railnonterm{axmdecl} and
   7.115  \railnonterm{thmdecl} usually refer to axioms, assumptions or results of goal
   7.116 -statements, \railnonterm{thmdef} collects lists of existing theorems.
   7.117 -Existing theorems are given by \railnonterm{thmref} and \railnonterm{thmrefs}
   7.118 -(the former requires an actual singleton result).  Any of these theorem
   7.119 +statements, while \railnonterm{thmdef} collects lists of existing theorems.
   7.120 +Existing theorems are given by \railnonterm{thmref} and \railnonterm{thmrefs},
   7.121 +the former requires an actual singleton result.  Any of these theorem
   7.122  specifications may include lists of attributes both on the left and right hand
   7.123  sides; attributes are applied to any immediately preceding theorem.  If names
   7.124 -are omitted, the theorems are not stored within the theory's theorem database;
   7.125 -any given attributes are still applied, though.
   7.126 +are omitted, the theorems are not stored within the theorem database of the
   7.127 +theory or proof context; any given attributes are still applied, though.
   7.128  
   7.129  \indexouternonterm{thmdecl}\indexouternonterm{axmdecl}
   7.130  \indexouternonterm{thmdef}\indexouternonterm{thmrefs}
   7.131 @@ -280,12 +281,10 @@
   7.132  
   7.133  Proof methods are either basic ones, or expressions composed of methods via
   7.134  ``\texttt{,}'' (sequential composition), ``\texttt{|}'' (alternative choices),
   7.135 -``\texttt{?}'' (try once), ``\texttt{+}'' (repeat at least once).  In
   7.136 -practice, proof methods are usually just a comma separated list of
   7.137 -\railqtoken{nameref}~\railnonterm{args} specifications.  Thus the syntax is
   7.138 -similar to that of attributes, with plain parentheses instead of square
   7.139 -brackets.  Note that parentheses may be dropped for single method
   7.140 -specifications (with no arguments).
   7.141 +``\texttt{?}'' (try), ``\texttt{+}'' (repeat at least once).  In practice,
   7.142 +proof methods are usually just a comma separated list of
   7.143 +\railqtoken{nameref}~\railnonterm{args} specifications.  Note that parentheses
   7.144 +may be dropped for single method specifications (with no arguments).
   7.145  
   7.146  \indexouternonterm{method}
   7.147  \begin{rail}