doc-src/IsarRef/pure.tex
changeset 7335 abba35b98892
parent 7321 b4dcc32310fb
child 7389 f647f463abeb
     1.1 --- a/doc-src/IsarRef/pure.tex	Tue Aug 24 11:54:13 1999 +0200
     1.2 +++ b/doc-src/IsarRef/pure.tex	Tue Aug 24 15:38:18 1999 +0200
     1.3 @@ -1,19 +1,19 @@
     1.4  
     1.5 -\chapter{Basic Isar elements}\label{ch:pure-syntax}
     1.6 +\chapter{Basic Isar Elements}\label{ch:pure-syntax}
     1.7  
     1.8  Subsequently, we introduce the main part of the basic Isar theory and proof
     1.9  commands as provided by Isabelle/Pure.  Chapter~\ref{ch:gen-tools} describes
    1.10 -further Isar elements as provided by generic tools and packages that are
    1.11 -either part of Pure Isabelle, or pre-loaded by most object logics (such as the
    1.12 -Simplifier).  See chapter~\ref{ch:hol-tools} for actual object-logic specific
    1.13 -elements (for Isabelle/HOL).
    1.14 +further Isar elements as provided by generic tools and packages (such as the
    1.15 +Simplifier) that are either part of Pure Isabelle, or pre-loaded by most
    1.16 +object logics.  See chapter~\ref{ch:hol-tools} for actual object-logic
    1.17 +specific elements (for Isabelle/HOL).
    1.18  
    1.19  \medskip
    1.20  
    1.21  Isar commands may be either \emph{proper} document constructors, or
    1.22  \emph{improper commands} (indicated by $^*$).  Some proof methods and
    1.23 -attributes introduced later may be classified as improper as well.  Improper
    1.24 -Isar language elements might be helpful when developing proof documents, while
    1.25 +attributes introduced later are classified as improper as well.  Improper Isar
    1.26 +language elements might be helpful when developing proof documents, while
    1.27  their use is strongly discouraged for the final version.  Typical examples are
    1.28  diagnostic commands that print terms or theorems according to the current
    1.29  context; other commands even emulate old-style tactical theorem proving, which
    1.30 @@ -33,9 +33,9 @@
    1.31  
    1.32  Isabelle/Isar ``new-style'' theories are either defined via theory files or
    1.33  interactively.  Both actual theory specifications and proofs are handled
    1.34 -uniformly --- occasionally definitional mechanisms even require some manual
    1.35 -proof.  In contrast, ``old-style'' Isabelle theories support batch processing
    1.36 -only, with the proof scripts collected in separate ML files.
    1.37 +uniformly --- occasionally definitional mechanisms even require some explicit
    1.38 +proof as well.  In contrast, ``old-style'' Isabelle theories support batch
    1.39 +processing only, with the proof scripts collected in separate ML files.
    1.40  
    1.41  The first command of any theory has to be $\THEORY$, starting a new theory
    1.42  based on the merge of existing ones.  The theory context may be also changed
    1.43 @@ -61,7 +61,9 @@
    1.44    $\THEORY$ is executed interactively).  The optional $\isarkeyword{files}$
    1.45    specification declares additional dependencies on ML files.  Unless put in
    1.46    parentheses, any file will be loaded immediately via $\isarcmd{use}$ (see
    1.47 -  also \S\ref{sec:ML}).
    1.48 +  also \S\ref{sec:ML}).  The optional ML file \texttt{$A$.ML} that may be
    1.49 +  associated with any theory should \emph{not} be included in
    1.50 +  $\isarkeyword{files}$.
    1.51    
    1.52  \item [$\CONTEXT~B$] enters an existing theory context $B$, basically in
    1.53    read-only mode, so only a limited set of commands may be performed.  Just as
    1.54 @@ -112,14 +114,13 @@
    1.55  \begin{descr}
    1.56  \item [$\isarkeyword{title}~title~author~date$] specifies the document title
    1.57    just as in typical {\LaTeX} documents.
    1.58 -\item [$\isarkeyword{chapter}~text$, $\isarkeyword{section}~text$,
    1.59 -  $\isarkeyword{subsection}~text$, and $\isarkeyword{subsubsection}~text$]
    1.60 -  mark chapter and section headings.
    1.61 -\item [$\TEXT~text$] specifies an actual body of prose text, including
    1.62 -  references to formal entities.\footnote{The latter feature is not yet
    1.63 -    exploited.  Nevertheless, any text of the form
    1.64 -    \texttt{\at\ttlbrace\dots\ttrbrace} should be considered as reserved for
    1.65 -    future use.}
    1.66 +\item [$\isarkeyword{chapter}$, $\isarkeyword{section}$,
    1.67 +  $\isarkeyword{subsection}$, and $\isarkeyword{subsubsection}$] mark chapter
    1.68 +  and section headings.
    1.69 +\item [$\TEXT$] specifies an actual body of prose text, including references
    1.70 +  to formal entities.\footnote{The latter feature is not yet exploited.
    1.71 +    Nevertheless, any text of the form \texttt{\at\ttlbrace\dots\ttrbrace}
    1.72 +    should be considered as reserved for future use.}
    1.73  \end{descr}
    1.74  
    1.75  
    1.76 @@ -142,9 +143,8 @@
    1.77  \end{rail}
    1.78  
    1.79  \begin{descr}
    1.80 -\item [$\isarkeyword{classes}~c<\vec c ~\dots$] declares class $c$ to be a
    1.81 -  subclass of existing classes $\vec c$.  Cyclic class structures are ruled
    1.82 -  out.
    1.83 +\item [$\isarkeyword{classes}~c<\vec c$] declares class $c$ to be a subclass
    1.84 +  of existing classes $\vec c$.  Cyclic class structures are ruled out.
    1.85  \item [$\isarkeyword{classrel}~c@1<c@2$] states a subclass relation between
    1.86    existing classes $c@1$ and $c@2$.  This is done axiomatically!  The
    1.87    $\isarkeyword{instance}$ command (see \S\ref{sec:axclass}) provides a way
    1.88 @@ -177,7 +177,7 @@
    1.89  \end{rail}
    1.90  
    1.91  \begin{descr}
    1.92 -\item [$\TYPES~(\vec\alpha)t = \tau~\dots$] introduces \emph{type synonym}
    1.93 +\item [$\TYPES~(\vec\alpha)t = \tau$] introduces \emph{type synonym}
    1.94    $(\vec\alpha)t$ for existing type $\tau$.  Unlike actual type definitions,
    1.95    as are available in Isabelle/HOL for example, type synonyms are just purely
    1.96    syntactic abbreviations, without any logical significance.  Internally, type
    1.97 @@ -189,9 +189,9 @@
    1.98  \item [$\isarkeyword{nonterminals}~\vec c$] declares $0$-ary type constructors
    1.99    $\vec c$ to act as purely syntactic types, i.e.\ nonterminal symbols of
   1.100    Isabelle's inner syntax of terms or types.
   1.101 -\item [$\isarkeyword{arities}~t::(\vec s)s~\dots$] augments Isabelle's
   1.102 -  order-sorted signature of types by new type constructor arities.  This is
   1.103 -  done axiomatically!  The $\isarkeyword{instance}$ command (see
   1.104 +\item [$\isarkeyword{arities}~t::(\vec s)s$] augments Isabelle's order-sorted
   1.105 +  signature of types by new type constructor arities.  This is done
   1.106 +  axiomatically!  The $\isarkeyword{instance}$ command (see
   1.107    \S\ref{sec:axclass}) provides a way introduce proven type arities.
   1.108  \end{descr}
   1.109  
   1.110 @@ -218,15 +218,15 @@
   1.111  \end{rail}
   1.112  
   1.113  \begin{descr}
   1.114 -\item [$\CONSTS~c::\sigma~\dots$] declares constant $c$ to have any instance
   1.115 -  of type scheme $\sigma$.  The optional mixfix annotations may attach
   1.116 -  concrete syntax constants.
   1.117 -\item [$\DEFS~name: eqn~\dots$] introduces $eqn$ as a definitional axiom for
   1.118 -  some existing constant.  See \cite[\S6]{isabelle-ref} for more details on
   1.119 -  the form of equations admitted as constant definitions.
   1.120 -\item [$\isarkeyword{constdefs}~c::\sigma~eqn~\dots$] combines constant
   1.121 -  declarations and definitions, using canonical name $c_def$ for the
   1.122 -  definitional axiom.
   1.123 +\item [$\CONSTS~c::\sigma$] declares constant $c$ to have any instance of type
   1.124 +  scheme $\sigma$.  The optional mixfix annotations may attach concrete syntax
   1.125 +  constants.
   1.126 +\item [$\DEFS~name: eqn$] introduces $eqn$ as a definitional axiom for some
   1.127 +  existing constant.  See \cite[\S6]{isabelle-ref} for more details on the
   1.128 +  form of equations admitted as constant definitions.
   1.129 +\item [$\isarkeyword{constdefs}~c::\sigma~eqn$] combines declarations and
   1.130 +  definitions of constants, using canonical name $c_def$ for the definitional
   1.131 +  axiom.
   1.132  \end{descr}
   1.133  
   1.134  
   1.135 @@ -251,13 +251,14 @@
   1.136  \item [$\isarkeyword{syntax}~(mode)~decls$] is similar to $\CONSTS~decls$,
   1.137    except that the actual logical signature extension is omitted.  Thus the
   1.138    context free grammar of Isabelle's inner syntax may be augmented in
   1.139 -  arbitrary ways.  The $mode$ argument refers to the print mode that the
   1.140 -  grammar rules belong; unless there is the \texttt{output} flag given, all
   1.141 -  productions are added both to the input and output grammar.
   1.142 +  arbitrary ways, independently of the logic.  The $mode$ argument refers to
   1.143 +  the print mode that the grammar rules belong; unless there is the
   1.144 +  \texttt{output} flag given, all productions are added both to the input and
   1.145 +  output grammar.
   1.146  \item [$\isarkeyword{translations}~rules$] specifies syntactic translation
   1.147    rules (also known as \emph{macros}): parse/print rules (\texttt{==}), parse
   1.148 -  rules (\texttt{=>}), print rules (\texttt{<=}).  Translation patterns may be
   1.149 -  prefixed by the syntactic category to be used for parsing; the default is
   1.150 +  rules (\texttt{=>}), or print rules (\texttt{<=}).  Translation patterns may
   1.151 +  be prefixed by the syntactic category to be used for parsing; the default is
   1.152    \texttt{logic}.
   1.153  \end{descr}
   1.154  
   1.155 @@ -279,16 +280,16 @@
   1.156  \end{rail}
   1.157  
   1.158  \begin{descr}
   1.159 -\item [$\isarkeyword{axioms}~name: \phi~\dots$] introduces arbitrary
   1.160 -  statements as logical axioms.  In fact, axioms are ``axiomatic theorems'',
   1.161 -  and may be referred just as any other theorem later.
   1.162 +\item [$\isarkeyword{axioms}~a: \phi$] introduces arbitrary statements as
   1.163 +  logical axioms.  In fact, axioms are ``axiomatic theorems'', and may be
   1.164 +  referred later just as any other theorem.
   1.165    
   1.166    Axioms are usually only introduced when declaring new logical systems.
   1.167    Everyday work is typically done the hard way, with proper definitions and
   1.168    actual theorems.
   1.169 -\item [$\isarkeyword{theorems}~name = thms$] stores lists of existing theorems
   1.170 -  as $name$.  Typical applications would also involve attributes (to augment
   1.171 -  the default simpset, for example).
   1.172 +\item [$\isarkeyword{theorems}~a = \vec b$] stores lists of existing theorems.
   1.173 +  Typical applications would also involve attributes, to augment the default
   1.174 +  Simplifier context, for example.
   1.175  \item [$\isarkeyword{lemmas}$] is similar to $\isarkeyword{theorems}$, but
   1.176    tags the results as ``lemma''.
   1.177  \end{descr}
   1.178 @@ -302,9 +303,9 @@
   1.179    \isarcmd{local} & : & \isartrans{theory}{theory} \\
   1.180  \end{matharray}
   1.181  
   1.182 -Isabelle organises any kind of names (of types, constants, theorems etc.)  by
   1.183 +Isabelle organizes any kind of names (of types, constants, theorems etc.)  by
   1.184  hierarchically structured name spaces.  Normally the user never has to control
   1.185 -the behaviour of name space entry by hand, yet the following commands provide
   1.186 +the behavior of name space entry by hand, yet the following commands provide
   1.187  some way to do so.
   1.188  
   1.189  \begin{descr}
   1.190 @@ -342,10 +343,11 @@
   1.191    \S\ref{sec:begin-thy}).
   1.192  \item [$\isarkeyword{ML}~text$] reads and executes ML commands from $text$.
   1.193    The theory context is passed just as for $\isarkeyword{use}$.
   1.194 +%FIXME picked up again!?
   1.195  \item [$\isarkeyword{setup}~text$] changes the current theory context by
   1.196    applying setup functions $text$, which has to be an ML expression of type
   1.197    $(theory \to theory)~list$.  The $\isarkeyword{setup}$ command is the usual
   1.198 -  way to initialise object-logic specific tools and packages written in ML.
   1.199 +  way to initialize object-logic specific tools and packages written in ML.
   1.200  \end{descr}
   1.201  
   1.202  
   1.203 @@ -389,7 +391,7 @@
   1.204  \begin{descr}
   1.205  \item [$\isarkeyword{oracle}~name=text$] declares oracle $name$ to be ML
   1.206    function $text$, which has to be of type $Sign\mathord.sg \times
   1.207 -  Object\mathord.T \to term)$.
   1.208 +  Object\mathord.T \to term$.
   1.209  \end{descr}
   1.210  
   1.211  
   1.212 @@ -397,9 +399,9 @@
   1.213  
   1.214  Proof commands provide transitions of Isar/VM machine configurations, which
   1.215  are block-structured, consisting of a stack of nodes with three main
   1.216 -components: logical \emph{proof context}, local \emph{facts}, and open
   1.217 -\emph{goals}.  Isar/VM transitions are \emph{typed} according to the following
   1.218 -three three different modes of operation:
   1.219 +components: logical proof context, current facts, and open goals.  Isar/VM
   1.220 +transitions are \emph{typed} according to the following three three different
   1.221 +modes of operation:
   1.222  \begin{descr}
   1.223  \item [$proof(prove)$] means that a new goal has just been stated that is now
   1.224    to be \emph{proven}; the next command may refine it by some proof method
   1.225 @@ -408,7 +410,7 @@
   1.226    augmented by \emph{stating} additional assumptions, intermediate result etc.
   1.227  \item [$proof(chain)$] is an intermediate mode between $proof(state)$ and
   1.228    $proof(prove)$: existing facts have been just picked up in order to use them
   1.229 -  when refining the goal to be claimed next.
   1.230 +  when refining the goal claimed next.
   1.231  \end{descr}
   1.232  
   1.233  
   1.234 @@ -454,7 +456,7 @@
   1.235  hand, a local theorem is created that may be used as a fact in subsequent
   1.236  proof steps.  On the other hand, any result $\phi$ exported from the context
   1.237  becomes conditional wrt.\ the assumption.  Thus, solving an enclosing goal
   1.238 -using this result would basically introduce a new subgoal stemming from the
   1.239 +using such a result would basically introduce a new subgoal stemming from the
   1.240  assumption.  How this situation is handled depends on the actual version of
   1.241  assumption command used: while $\ASSUMENAME$ solves the subgoal by unifying
   1.242  with some premise of the goal, $\PRESUMENAME$ leaves the subgoal unchanged to
   1.243 @@ -482,20 +484,22 @@
   1.244  \begin{descr}
   1.245  \item [$\FIX{x}$] introduces a local \emph{arbitrary, but fixed} variable $x$.
   1.246  \item [$\ASSUME{a}{\Phi}$ and $\PRESUME{a}{\Phi}$] introduce local theorems
   1.247 -  $\Phi$.  Subsequent results applied to some enclosing goal (e.g.\ via
   1.248 -  $\SHOWNAME$) are handled as follows: $\ASSUMENAME$ expects to be able to
   1.249 -  unify with existing premises in the goal, while $\PRESUMENAME$ leaves $\Phi$
   1.250 -  as new subgoals.  Note that several lists of assumptions may be given
   1.251 -  (separated by $\isarkeyword{and}$); the resulting list of facts consists of
   1.252 -  all of these concatenated.
   1.253 +  $\Phi$ by assumption.  Subsequent results applied to an enclosing goal
   1.254 +  (e.g.\ via $\SHOWNAME$) are handled as follows: $\ASSUMENAME$ expects to be
   1.255 +  able to unify with existing premises in the goal, while $\PRESUMENAME$
   1.256 +  leaves $\Phi$ as new subgoals.
   1.257 +  
   1.258 +  Several lists of assumptions may be given (separated by
   1.259 +  $\isarkeyword{and}$); the resulting list of facts consists of all of these
   1.260 +  concatenated.
   1.261  \item [$\DEF{a}{x \equiv t}$] introduces a local (non-polymorphic) definition.
   1.262    In results exported from the context, $x$ is replaced by $t$.  Basically,
   1.263 -  $\DEF{}{x \equiv t}$ abbreviates $\FIX{x}~\PRESUME{}{x \equiv t}$ (the
   1.264 -  resulting hypothetical equation is solved by reflexivity, though).
   1.265 +  $\DEF{}{x \equiv t}$ abbreviates $\FIX{x}~\PRESUME{}{x \equiv t}$, with the
   1.266 +  resulting hypothetical equation solved by reflexivity.
   1.267  \end{descr}
   1.268  
   1.269 -The internal register $prems$\indexisarreg{prems} refers to the current list
   1.270 -of assumptions.
   1.271 +The special theorem name $prems$\indexisarreg{prems} refers to all current
   1.272 +assumptions.
   1.273  
   1.274  
   1.275  \subsection{Facts and forward chaining}
   1.276 @@ -509,12 +513,10 @@
   1.277  \end{matharray}
   1.278  
   1.279  New facts are established either by assumption or proof of local statements.
   1.280 -Any facts will usually be involved in proofs of further results: either as
   1.281 -explicit arguments of proof methods or when forward chaining towards the next
   1.282 -goal via $\THEN$ (and variants).  Note that the internal register of
   1.283 -\emph{current facts} may be referred as theorem list
   1.284 -$facts$.\indexisarreg{facts}
   1.285 -
   1.286 +Any fact will usually be involved in further proofs, either as explicit
   1.287 +arguments of proof methods or when forward chaining towards the next goal via
   1.288 +$\THEN$ (and variants).  Note that the special theorem name
   1.289 +$facts$.\indexisarreg{facts} refers to the most recently established facts.
   1.290  \begin{rail}
   1.291    'note' thmdef? thmrefs comment?
   1.292    ;
   1.293 @@ -529,12 +531,12 @@
   1.294    as $a$.  Note that attributes may be involved as well, both on the left and
   1.295    right hand sides.
   1.296  \item [$\THEN$] indicates forward chaining by the current facts in order to
   1.297 -  establish the goal to be claimed next.  The initial proof method invoked to
   1.298 -  solve that will be offered these facts to do ``anything appropriate'' (see
   1.299 -  also \S\ref{sec:proof-steps}).  For example, method $rule$ (see
   1.300 +  establish the goal claimed next.  The initial proof method invoked to refine
   1.301 +  that will be offered these facts to do ``anything appropriate'' (see also
   1.302 +  \S\ref{sec:proof-steps}).  For example, method $rule$ (see
   1.303    \S\ref{sec:pure-meth}) would do an elimination rather than an introduction.
   1.304 -\item [$\FROM{\vec b}$] abbreviates $\NOTE{}{\vec b}~\THEN$; also note that
   1.305 -  $\THEN$ is equivalent to $\FROM{facts}$.
   1.306 +\item [$\FROM{\vec b}$] abbreviates $\NOTE{}{\vec b}~\THEN$; thus $\THEN$ is
   1.307 +  equivalent to $\FROM{facts}$.
   1.308  \item [$\WITH{\vec b}$] abbreviates $\FROM{\vec b~facts}$; thus the forward
   1.309    chaining is from earlier facts together with the current ones.
   1.310  \end{descr}
   1.311 @@ -569,18 +571,18 @@
   1.312  \end{rail}
   1.313  
   1.314  \begin{descr}
   1.315 -\item [$\THEOREM{name}{\phi}$] enters proof mode with $\phi$ as main goal,
   1.316 +\item [$\THEOREM{a}{\phi}$] enters proof mode with $\phi$ as main goal,
   1.317    eventually resulting in some theorem $\turn \phi$, which will be stored in
   1.318    the theory.
   1.319  \item [$\LEMMANAME$] is similar to $\THEOREMNAME$, but tags the result as
   1.320    ``lemma''.
   1.321 -\item [$\HAVE{name}{\phi}$] claims a local goal, eventually resulting in a
   1.322 +\item [$\HAVE{a}{\phi}$] claims a local goal, eventually resulting in a
   1.323    theorem with the current assumption context as hypotheses.
   1.324 -\item [$\SHOW{name}{\phi}$] is similar to $\HAVE{name}{\phi}$, but solves some
   1.325 +\item [$\SHOW{a}{\phi}$] is similar to $\HAVE{a}{\phi}$, but solves some
   1.326    pending goal with the result \emph{exported} into the corresponding context.
   1.327 -\item [$\HENCE{name}{\phi}$] abbreviates $\THEN~\HAVE{name}{\phi}$, i.e.\ 
   1.328 -  claims a local goal to be proven by forward chaining the current facts.
   1.329 -\item [$\THUS{name}{\phi}$] abbreviates $\THEN~\SHOW{name}{\phi}$.
   1.330 +\item [$\HENCE{a}{\phi}$] abbreviates $\THEN~\HAVE{a}{\phi}$, i.e.\ claims a
   1.331 +  local goal to be proven by forward chaining the current facts.
   1.332 +\item [$\THUS{a}{\phi}$] abbreviates $\THEN~\SHOW{a}{\phi}$.
   1.333  \end{descr}
   1.334  
   1.335  
   1.336 @@ -597,20 +599,19 @@
   1.337    \isarcmd{sorry} & : & \isartrans{proof(prove)}{proof(state) ~|~ theory} \\
   1.338  \end{matharray}
   1.339  
   1.340 -Arbitrary goal refinements via tactics is considered harmful.  Consequently
   1.341 -the Isar framework admits proof methods to be invoked in two places only.
   1.342 +Arbitrary goal refinement via tactics is considered harmful.  Consequently the
   1.343 +Isar framework admits proof methods to be invoked in two places only.
   1.344  \begin{enumerate}
   1.345  \item An \emph{initial} refinement step $\PROOF{m@1}$ reduces a newly stated
   1.346 -  intermediate goal to a number of sub-goals that are to be solved later.
   1.347 -  Facts are passed to $m@1$ for forward chaining if so indicated by
   1.348 -  $proof(chain)$ mode.
   1.349 +  goal to a number of sub-goals that are to be solved later.  Facts are passed
   1.350 +  to $m@1$ for forward chaining if so indicated by $proof(chain)$ mode.
   1.351    
   1.352 -\item A \emph{terminal} conclusion step $\QED{m@2}$ solves any remaining
   1.353 -  pending goals completely.  No facts are passed to $m@2$.
   1.354 +\item A \emph{terminal} conclusion step $\QED{m@2}$ solves any remaining goals
   1.355 +  completely.  No facts are passed to $m@2$.
   1.356  \end{enumerate}
   1.357  
   1.358 -The only other proper way to affect pending goals is by $\SHOWNAME$, which
   1.359 -involves an explicit statement of what is solved.
   1.360 +The only other proper way to affect pending goals is by $\SHOWNAME$ (or
   1.361 +$\THUSNAME$), which involves an explicit statement of what is to be solved.
   1.362  
   1.363  \medskip
   1.364  
   1.365 @@ -644,27 +645,26 @@
   1.366  \end{rail}
   1.367  
   1.368  \begin{descr}
   1.369 -\item [$\PROOF{m@1}$] refines the pending goal by proof method $m@1$; facts
   1.370 -  for forward chaining are passed if so indicated by $proof(chain)$.
   1.371 -\item [$\QED{m@2}$] refines any remaining goals by proof method $m@1$ and
   1.372 -  concludes the sub-proof.  If the goal had been $\SHOWNAME$, some pending
   1.373 -  sub-goal is solved as well by the rule resulting from the result exported to
   1.374 -  the enclosing goal context.  Thus $\QEDNAME$ may fail for two reasons:
   1.375 -  either $m@2$ fails to solve all remaining goals completely, or the resulting
   1.376 -  rule does not resolve with any enclosing goal.  Debugging such a situation
   1.377 -  might involve temporarily changing $\SHOWNAME$ into $\HAVENAME$, or
   1.378 -  weakening the local context by replacing $\ASSUMENAME$ by $\PRESUMENAME$.
   1.379 +\item [$\PROOF{m@1}$] refines the goal by proof method $m@1$; facts for
   1.380 +  forward chaining are passed if so indicated by $proof(chain)$ mode.
   1.381 +\item [$\QED{m@2}$] refines any remaining goals by proof method $m@2$ and
   1.382 +  concludes the sub-proof.  If the goal had been $\SHOWNAME$ (or $\THUSNAME$),
   1.383 +  some pending sub-goal is solved as well by the rule resulting from the
   1.384 +  result exported to the enclosing goal context.  Thus $\QEDNAME$ may fail for
   1.385 +  two reasons: either $m@2$ fails to solve all remaining goals completely, or
   1.386 +  the resulting rule does not resolve with any enclosing goal.  Debugging such
   1.387 +  a situation might involve temporarily changing $\SHOWNAME$ into $\HAVENAME$,
   1.388 +  or softening the local context by replacing $\ASSUMENAME$ by $\PRESUMENAME$.
   1.389  \item [$\BYY{m@1}{m@2}$] is a \emph{terminal proof}; it abbreviates
   1.390    $\PROOF{m@1}~\QED{m@2}$, with automatic backtracking across both methods.
   1.391    Debugging an unsuccessful $\BYY{m@1}{m@2}$ commands might be done by simply
   1.392    expanding the abbreviation by hand; note that $\PROOF{m@1}$ is usually
   1.393    sufficient to see what is going wrong.
   1.394  \item [``$\DDOT$''] is a \emph{default proof}; it abbreviates $\BY{default}$.
   1.395 -\item [``$\DOT$''] is a \emph{trivial proof}, it abbreviates $\BY{-}$, where
   1.396 -  method ``$-$'' does nothing except inserting any facts into the proof state.
   1.397 +\item [``$\DOT$''] is a \emph{trivial proof}; it abbreviates $\BY{-}$.
   1.398  \item [$\isarkeyword{sorry}$] is a \emph{fake proof}; provided that
   1.399    \texttt{quick_and_dirty} is enabled, $\isarkeyword{sorry}$ pretends to solve
   1.400 -  the goal without much ado.  Of course, the result is a fake theorem only,
   1.401 +  the goal without further ado.  Of course, the result is a fake theorem only,
   1.402    involving some oracle in its internal derivation object (this is indicated
   1.403    as $[!]$ in the printed result).  The main application of
   1.404    $\isarkeyword{sorry}$ is to support top-down proof development.
   1.405 @@ -697,10 +697,10 @@
   1.406  \end{rail}
   1.407  
   1.408  \begin{descr}
   1.409 -\item [$\isarkeyword{apply}~m$] applies proof method $m$ in the
   1.410 +\item [$\isarkeyword{apply}~(m)$] applies proof method $m$ in the
   1.411    plain-old-tactic sense.  Facts for forward chaining are ignored.
   1.412 -\item [$\isarkeyword{then_apply}~m$] is similar to $\isarkeyword{apply}$, but
   1.413 -  observes the goal's facts.
   1.414 +\item [$\isarkeyword{then_apply}~(m)$] is similar to $\isarkeyword{apply}$,
   1.415 +  but observes the goal's facts.
   1.416  \item [$\isarkeyword{back}$] does back-tracking over the result sequence of
   1.417    the last proof command.  Basically, any proof command may return multiple
   1.418    results.
   1.419 @@ -747,15 +747,16 @@
   1.420  \end{descr}
   1.421  
   1.422  A few \emph{automatic} term abbreviations\index{automatic abbreviation} for
   1.423 -goals and facts are available as well.  For any open goal, $\VVar{thesis}$
   1.424 -refers to its object-logical statement, $\VVar{thesis_prop}$ to the full
   1.425 -proposition (which may be a rule), and $\VVar{thesis_concl}$ to its (atomic)
   1.426 -conclusion.
   1.427 +goals and facts are available as well.  For any open goal,
   1.428 +$\VVar{thesis_prop}$ refers to the full proposition (which may be a rule),
   1.429 +$\VVar{thesis_concl}$ to its (atomic) conclusion, and $\VVar{thesis}$ to its
   1.430 +object-logical statement.  The latter two abstract over any meta-level
   1.431 +parameters.
   1.432  
   1.433  Facts (i.e.\ assumptions and finished goals) that have an application $f(x)$
   1.434  as object-logic statement get $x$ bound to the special text variable
   1.435  ``$\dots$'' (three dots).  The canonical application of this feature are
   1.436 -calculational proofs, see \S\ref{sec:calculation}.
   1.437 +calculational proofs (see \S\ref{sec:calculation}).
   1.438  
   1.439  
   1.440  \subsection{Block structure}
   1.441 @@ -786,18 +787,14 @@
   1.442  \item [$\isarkeyword{\{\{}$ and $\isarkeyword{\}\}}$] explicitly open and
   1.443    close blocks.  Any current facts pass through $\isarkeyword{\{\{}$
   1.444    unchanged, while $\isarkeyword{\}\}}$ causes them to be \emph{exported} into
   1.445 -  the enclosing context.  Thus fixed variables are generalised, assumptions
   1.446 -  discharged, and local definitions eliminated.
   1.447 +  the enclosing context.  Thus fixed variables are generalized, assumptions
   1.448 +  discharged, and local definitions eliminated.  There is no difference of
   1.449 +  $\ASSUMENAME$ and $\PRESUMENAME$ here.
   1.450  \end{descr}
   1.451  
   1.452  
   1.453  \section{Other commands}
   1.454  
   1.455 -The following commands are not part of the actual proper or improper
   1.456 -Isabelle/Isar syntax, but assist interactive development, for example.  Also
   1.457 -note that $undo$ does not apply here, since the theory or proof configuration
   1.458 -is not changed.
   1.459 -
   1.460  \subsection{Diagnostics}
   1.461  
   1.462  \indexisarcmd{typ}\indexisarcmd{term}\indexisarcmd{prop}\indexisarcmd{thm}
   1.463 @@ -808,6 +805,10 @@
   1.464    \isarcmd{thm} & : & \isarkeep{theory~|~proof} \\
   1.465  \end{matharray}
   1.466  
   1.467 +These commands are not part of the actual Isabelle/Isar syntax, but assist
   1.468 +interactive development.  Also note that $undo$ does not apply here, since the
   1.469 +theory or proof configuration is not changed.
   1.470 +
   1.471  \begin{rail}
   1.472    'typ' type
   1.473    ;
   1.474 @@ -826,7 +827,8 @@
   1.475  \item [$\isarkeyword{thm}~thms$] retrieves lists of theorems from the current
   1.476    theory or proof context.  Note that any attributes included in the theorem
   1.477    specifications are applied to a temporary context derived from the current
   1.478 -  theory or proof; the result is discarded.
   1.479 +  theory or proof; the result is discarded, i.e.\ attributes involved in
   1.480 +  $thms$ only have a temporary effect.
   1.481  \end{descr}
   1.482  
   1.483  
   1.484 @@ -850,11 +852,14 @@
   1.485  \item [$\isarkeyword{use_thy}$, $\isarkeyword{use_thy_only}$,
   1.486    $\isarkeyword{update_thy}$, and $\isarkeyword{update_thy_only}$] load some
   1.487    theory given as $name$ argument.  These commands are exactly the same as the
   1.488 -  corresponding ML functions (see also \cite[\S1 and \S6]{isabelle-ref}).
   1.489 -  Note that both the ML and Isar versions of these commands may load new- and
   1.490 +  corresponding ML functions (see also \cite[\S1,\S6]{isabelle-ref}).  Note
   1.491 +  that both the ML and Isar versions of these commands may load new- and
   1.492    old-style theories alike.
   1.493  \end{descr}
   1.494  
   1.495 +Note that these system commands are scarcely used when working with
   1.496 +Proof~General, since loading of theories is done fully automatic.
   1.497 +
   1.498  
   1.499  %%% Local Variables: 
   1.500  %%% mode: latex