updated generated files;
authorwenzelm
Thu Nov 13 22:45:12 2008 +0100 (2008-11-13)
changeset 28788ff9d8a8932e4
parent 28787 8ea7403147c5
child 28789 5a404273ea8f
updated generated files;
doc-src/IsarRef/Thy/document/Document_Preparation.tex
doc-src/IsarRef/Thy/document/Generic.tex
doc-src/IsarRef/Thy/document/HOLCF_Specific.tex
doc-src/IsarRef/Thy/document/HOL_Specific.tex
doc-src/IsarRef/Thy/document/Misc.tex
doc-src/IsarRef/Thy/document/Outer_Syntax.tex
doc-src/IsarRef/Thy/document/Proof.tex
doc-src/IsarRef/Thy/document/Spec.tex
doc-src/IsarRef/Thy/document/ZF_Specific.tex
     1.1 --- a/doc-src/IsarRef/Thy/document/Document_Preparation.tex	Thu Nov 13 22:44:40 2008 +0100
     1.2 +++ b/doc-src/IsarRef/Thy/document/Document_Preparation.tex	Thu Nov 13 22:45:12 2008 +0100
     1.3 @@ -25,12 +25,12 @@
     1.4  \isamarkuptrue%
     1.5  %
     1.6  \begin{isamarkuptext}%
     1.7 -Isabelle/Isar provides a simple document preparation system based on
     1.8 -  existing {PDF-\LaTeX} technology, with full support of hyper-links
     1.9 -  (both local references and URLs) and bookmarks.  Thus the results
    1.10 -  are equally well suited for WWW browsing and as printed copies.
    1.11 +Isabelle/Isar provides a simple document preparation system
    1.12 +  based on regular {PDF-\LaTeX} technology, with full support for
    1.13 +  hyper-links and bookmarks.  Thus the results are well suited for WWW
    1.14 +  browsing and as printed copies.
    1.15  
    1.16 -  \medskip Isabelle generates {\LaTeX} output as part of the run of a
    1.17 +  \medskip Isabelle generates {\LaTeX} output while running a
    1.18    \emph{logic session} (see also \cite{isabelle-sys}).  Getting
    1.19    started with a working configuration for common situations is quite
    1.20    easy by using the Isabelle \verb|mkdir| and \verb|make|
    1.21 @@ -38,9 +38,9 @@
    1.22  \begin{ttbox}
    1.23    isabelle mkdir Foo
    1.24  \end{ttbox}
    1.25 -  to initialize a separate directory for session \verb|Foo| ---
    1.26 -  it is safe to experiment, since \verb|isabelle mkdir| never
    1.27 -  overwrites existing files.  Ensure that \verb|Foo/ROOT.ML|
    1.28 +  to initialize a separate directory for session \verb|Foo| (it
    1.29 +  is safe to experiment, since \verb|isabelle mkdir| never
    1.30 +  overwrites existing files).  Ensure that \verb|Foo/ROOT.ML|
    1.31    holds ML commands to load all theories required for this session;
    1.32    furthermore \verb|Foo/document/root.tex| should include any
    1.33    special {\LaTeX} macro packages required for your document (the
    1.34 @@ -56,19 +56,20 @@
    1.35    to run the \verb|Foo| session, with browser information and
    1.36    document preparation enabled.  Unless any errors are reported by
    1.37    Isabelle or {\LaTeX}, the output will appear inside the directory
    1.38 -  \verb|ISABELLE_BROWSER_INFO|, as reported by the batch job in
    1.39 -  verbose mode.
    1.40 +  defined by the \verb|ISABELLE_BROWSER_INFO| setting (as
    1.41 +  reported by the batch job in verbose mode).
    1.42  
    1.43    \medskip You may also consider to tune the \verb|usedir|
    1.44 -  options in \verb|IsaMakefile|, for example to change the output
    1.45 -  format from \verb|pdf| to \verb|dvi|, or activate the
    1.46 +  options in \verb|IsaMakefile|, for example to switch the output
    1.47 +  format between \verb|pdf| and \verb|dvi|, or activate the
    1.48    \verb|-D| option to retain a second copy of the generated
    1.49 -  {\LaTeX} sources.
    1.50 +  {\LaTeX} sources (for manual inspection or separate runs of
    1.51 +  \hyperlink{executable.latex}{\mbox{\isa{\isatt{latex}}}}).
    1.52  
    1.53    \medskip See \emph{The Isabelle System Manual} \cite{isabelle-sys}
    1.54    for further details on Isabelle logic sessions and theory
    1.55    presentation.  The Isabelle/HOL tutorial \cite{isabelle-hol-book}
    1.56 -  also covers theory presentation issues.%
    1.57 +  also covers theory presentation to some extent.%
    1.58  \end{isamarkuptext}%
    1.59  \isamarkuptrue%
    1.60  %
    1.61 @@ -78,24 +79,30 @@
    1.62  %
    1.63  \begin{isamarkuptext}%
    1.64  \begin{matharray}{rcl}
    1.65 -    \indexdef{}{command}{header}\hypertarget{command.header}{\hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}}} & : & \isarkeep{toplevel} \\[0.5ex]
    1.66 -    \indexdef{}{command}{chapter}\hypertarget{command.chapter}{\hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}} & : & \isarkeep{local{\dsh}theory} \\
    1.67 -    \indexdef{}{command}{section}\hypertarget{command.section}{\hyperlink{command.section}{\mbox{\isa{\isacommand{section}}}}} & : & \isarkeep{local{\dsh}theory} \\
    1.68 -    \indexdef{}{command}{subsection}\hypertarget{command.subsection}{\hyperlink{command.subsection}{\mbox{\isa{\isacommand{subsection}}}}} & : & \isarkeep{local{\dsh}theory} \\
    1.69 -    \indexdef{}{command}{subsubsection}\hypertarget{command.subsubsection}{\hyperlink{command.subsubsection}{\mbox{\isa{\isacommand{subsubsection}}}}} & : & \isarkeep{local{\dsh}theory} \\
    1.70 -    \indexdef{}{command}{text}\hypertarget{command.text}{\hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}}} & : & \isarkeep{local{\dsh}theory} \\
    1.71 -    \indexdef{}{command}{text\_raw}\hypertarget{command.text-raw}{\hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}} & : & \isarkeep{local{\dsh}theory} \\[0.5ex]
    1.72 -    \indexdef{}{command}{sect}\hypertarget{command.sect}{\hyperlink{command.sect}{\mbox{\isa{\isacommand{sect}}}}} & : & \isartrans{proof}{proof} \\
    1.73 -    \indexdef{}{command}{subsect}\hypertarget{command.subsect}{\hyperlink{command.subsect}{\mbox{\isa{\isacommand{subsect}}}}} & : & \isartrans{proof}{proof} \\
    1.74 -    \indexdef{}{command}{subsubsect}\hypertarget{command.subsubsect}{\hyperlink{command.subsubsect}{\mbox{\isa{\isacommand{subsubsect}}}}} & : & \isartrans{proof}{proof} \\
    1.75 -    \indexdef{}{command}{txt}\hypertarget{command.txt}{\hyperlink{command.txt}{\mbox{\isa{\isacommand{txt}}}}} & : & \isartrans{proof}{proof} \\
    1.76 -    \indexdef{}{command}{txt\_raw}\hypertarget{command.txt-raw}{\hyperlink{command.txt-raw}{\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}}}} & : & \isartrans{proof}{proof} \\
    1.77 +    \indexdef{}{command}{header}\hypertarget{command.header}{\hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}}} & : & \isa{{\isachardoublequote}toplevel\ {\isasymrightarrow}\ toplevel{\isachardoublequote}} \\[0.5ex]
    1.78 +    \indexdef{}{command}{chapter}\hypertarget{command.chapter}{\hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
    1.79 +    \indexdef{}{command}{section}\hypertarget{command.section}{\hyperlink{command.section}{\mbox{\isa{\isacommand{section}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
    1.80 +    \indexdef{}{command}{subsection}\hypertarget{command.subsection}{\hyperlink{command.subsection}{\mbox{\isa{\isacommand{subsection}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
    1.81 +    \indexdef{}{command}{subsubsection}\hypertarget{command.subsubsection}{\hyperlink{command.subsubsection}{\mbox{\isa{\isacommand{subsubsection}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
    1.82 +    \indexdef{}{command}{text}\hypertarget{command.text}{\hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
    1.83 +    \indexdef{}{command}{text\_raw}\hypertarget{command.text-raw}{\hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\[0.5ex]
    1.84 +    \indexdef{}{command}{sect}\hypertarget{command.sect}{\hyperlink{command.sect}{\mbox{\isa{\isacommand{sect}}}}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}\ proof{\isachardoublequote}} \\
    1.85 +    \indexdef{}{command}{subsect}\hypertarget{command.subsect}{\hyperlink{command.subsect}{\mbox{\isa{\isacommand{subsect}}}}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}\ proof{\isachardoublequote}} \\
    1.86 +    \indexdef{}{command}{subsubsect}\hypertarget{command.subsubsect}{\hyperlink{command.subsubsect}{\mbox{\isa{\isacommand{subsubsect}}}}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}\ proof{\isachardoublequote}} \\
    1.87 +    \indexdef{}{command}{txt}\hypertarget{command.txt}{\hyperlink{command.txt}{\mbox{\isa{\isacommand{txt}}}}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}\ proof{\isachardoublequote}} \\
    1.88 +    \indexdef{}{command}{txt\_raw}\hypertarget{command.txt-raw}{\hyperlink{command.txt-raw}{\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}}}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}\ proof{\isachardoublequote}} \\
    1.89    \end{matharray}
    1.90  
    1.91 -  Apart from formal comments (see \secref{sec:comments}), markup
    1.92 -  commands provide a structured way to insert text into the document
    1.93 -  generated from a theory (see \cite{isabelle-sys} for more
    1.94 -  information on Isabelle's document preparation tools).
    1.95 +  Markup commands provide a structured way to insert text into the
    1.96 +  document generated from a theory.  Each markup command takes a
    1.97 +  single \hyperlink{syntax.text}{\mbox{\isa{text}}} argument, which is passed as argument to a
    1.98 +  corresponding {\LaTeX} macro.  The default macros provided by
    1.99 +  \hyperlink{file.~~/lib/texinputs/isabelle.sty}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}lib{\isacharslash}texinputs{\isacharslash}isabelle{\isachardot}sty}}}} can be redefined according
   1.100 +  to the needs of the underlying document and {\LaTeX} styles.
   1.101 +
   1.102 +  Note that formal comments (\secref{sec:comments}) are similar to
   1.103 +  markup commands, but have a different status within Isabelle/Isar
   1.104 +  syntax.
   1.105  
   1.106    \begin{rail}
   1.107      ('chapter' | 'section' | 'subsection' | 'subsubsection' | 'text') target? text
   1.108 @@ -104,84 +111,90 @@
   1.109      ;
   1.110    \end{rail}
   1.111  
   1.112 -  \begin{descr}
   1.113 +  \begin{description}
   1.114  
   1.115 -  \item [\hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] provides plain text
   1.116 -  markup just preceding the formal beginning of a theory.  In actual
   1.117 -  document preparation the corresponding {\LaTeX} macro \verb|\isamarkupheader| may be redefined to produce chapter or section
   1.118 -  headings.
   1.119 +  \item \hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}} provides plain text markup just preceding
   1.120 +  the formal beginning of a theory.  The corresponding {\LaTeX} macro
   1.121 +  is \verb|\isamarkupheader|, which acts like \hyperlink{command.section}{\mbox{\isa{\isacommand{section}}}} by default.
   1.122    
   1.123 -  \item [\hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}, \hyperlink{command.section}{\mbox{\isa{\isacommand{section}}}}, \hyperlink{command.subsection}{\mbox{\isa{\isacommand{subsection}}}}, and \hyperlink{command.subsubsection}{\mbox{\isa{\isacommand{subsubsection}}}}] mark chapter and
   1.124 -  section headings.  The corresponding {\LaTeX} macros are \verb|\isamarkupchapter|, \verb|\isamarkupsection| etc.
   1.125 +  \item \hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}, \hyperlink{command.section}{\mbox{\isa{\isacommand{section}}}}, \hyperlink{command.subsection}{\mbox{\isa{\isacommand{subsection}}}},
   1.126 +  and \hyperlink{command.subsubsection}{\mbox{\isa{\isacommand{subsubsection}}}} mark chapter and section headings
   1.127 +  within the main theory body or local theory targets.  The
   1.128 +  corresponding {\LaTeX} macros are \verb|\isamarkupchapter|,
   1.129 +  \verb|\isamarkupsection|, \verb|\isamarkupsubsection| etc.
   1.130  
   1.131 -  \item [\hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}} and \hyperlink{command.txt}{\mbox{\isa{\isacommand{txt}}}}] specify paragraphs of
   1.132 -  plain text.
   1.133 +  \item \hyperlink{command.sect}{\mbox{\isa{\isacommand{sect}}}}, \hyperlink{command.subsect}{\mbox{\isa{\isacommand{subsect}}}}, and \hyperlink{command.subsubsect}{\mbox{\isa{\isacommand{subsubsect}}}}
   1.134 +  mark section headings within proofs.  The corresponding {\LaTeX}
   1.135 +  macros are \verb|\isamarkupsect|, \verb|\isamarkupsubsect| etc.
   1.136  
   1.137 -  \item [\hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}} and \hyperlink{command.txt-raw}{\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}}}] insert
   1.138 -  {\LaTeX} source into the output, without additional markup.  Thus
   1.139 -  the full range of document manipulations becomes available.
   1.140 +  \item \hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}} and \hyperlink{command.txt}{\mbox{\isa{\isacommand{txt}}}} specify paragraphs of plain
   1.141 +  text.  This corresponds to a {\LaTeX} environment \verb|\begin{isamarkuptext}| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|\end{isamarkuptext}| etc.
   1.142  
   1.143 -  \end{descr}
   1.144 +  \item \hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}} and \hyperlink{command.txt-raw}{\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}}} insert {\LaTeX}
   1.145 +  source into the output, without additional markup.  Thus the full
   1.146 +  range of document manipulations becomes available, at the risk of
   1.147 +  messing up document output.
   1.148  
   1.149 -  The \isa{{\isachardoublequote}text{\isachardoublequote}} argument of these markup commands (except for
   1.150 -  \hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}) may contain references to formal entities
   1.151 -  (``antiquotations'', see also \secref{sec:antiq}).  These are
   1.152 -  interpreted in the present theory context, or the named \isa{{\isachardoublequote}target{\isachardoublequote}}.
   1.153 +  \end{description}
   1.154  
   1.155 -  Any of these markup elements corresponds to a {\LaTeX} command with
   1.156 -  the name prefixed by \verb|\isamarkup|.  For the sectioning
   1.157 -  commands this is a plain macro with a single argument, e.g.\
   1.158 -  \verb|\isamarkupchapter{|\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}\verb|}| for
   1.159 -  \hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}.  The \hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}} markup results in a
   1.160 -  {\LaTeX} environment \verb|\begin{isamarkuptext}| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|\end{isamarkuptext}|, while \hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}
   1.161 -  causes the text to be inserted directly into the {\LaTeX} source.
   1.162 +  Except for \hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}} and \hyperlink{command.txt-raw}{\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}}}, the text
   1.163 +  passed to any of the above markup commands may refer to formal
   1.164 +  entities via \emph{document antiquotations}, see also
   1.165 +  \secref{sec:antiq}.  These are interpreted in the present theory or
   1.166 +  proof context, or the named \isa{{\isachardoublequote}target{\isachardoublequote}}.
   1.167  
   1.168    \medskip The proof markup commands closely resemble those for theory
   1.169    specifications, but have a different formal status and produce
   1.170 -  different {\LaTeX} macros.  Also note that the \indexref{}{command}{header}\hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}} declaration (see \secref{sec:begin-thy}) admits to insert
   1.171 -  section markup just preceding the actual theory definition.%
   1.172 +  different {\LaTeX} macros.  The default definitions coincide for
   1.173 +  analogous commands such as \hyperlink{command.section}{\mbox{\isa{\isacommand{section}}}} and \hyperlink{command.sect}{\mbox{\isa{\isacommand{sect}}}}.%
   1.174  \end{isamarkuptext}%
   1.175  \isamarkuptrue%
   1.176  %
   1.177 -\isamarkupsection{Antiquotations \label{sec:antiq}%
   1.178 +\isamarkupsection{Document Antiquotations \label{sec:antiq}%
   1.179  }
   1.180  \isamarkuptrue%
   1.181  %
   1.182  \begin{isamarkuptext}%
   1.183  \begin{matharray}{rcl}
   1.184 -    \indexdef{}{antiquotation}{theory}\hypertarget{antiquotation.theory}{\hyperlink{antiquotation.theory}{\mbox{\isa{theory}}}} & : & \isarantiq \\
   1.185 -    \indexdef{}{antiquotation}{thm}\hypertarget{antiquotation.thm}{\hyperlink{antiquotation.thm}{\mbox{\isa{thm}}}} & : & \isarantiq \\
   1.186 -    \indexdef{}{antiquotation}{lemma}\hypertarget{antiquotation.lemma}{\hyperlink{antiquotation.lemma}{\mbox{\isa{lemma}}}} & : & \isarantiq \\
   1.187 -    \indexdef{}{antiquotation}{prop}\hypertarget{antiquotation.prop}{\hyperlink{antiquotation.prop}{\mbox{\isa{prop}}}} & : & \isarantiq \\
   1.188 -    \indexdef{}{antiquotation}{term}\hypertarget{antiquotation.term}{\hyperlink{antiquotation.term}{\mbox{\isa{term}}}} & : & \isarantiq \\
   1.189 -    \indexdef{}{antiquotation}{const}\hypertarget{antiquotation.const}{\hyperlink{antiquotation.const}{\mbox{\isa{const}}}} & : & \isarantiq \\
   1.190 -    \indexdef{}{antiquotation}{abbrev}\hypertarget{antiquotation.abbrev}{\hyperlink{antiquotation.abbrev}{\mbox{\isa{abbrev}}}} & : & \isarantiq \\
   1.191 -    \indexdef{}{antiquotation}{typeof}\hypertarget{antiquotation.typeof}{\hyperlink{antiquotation.typeof}{\mbox{\isa{typeof}}}} & : & \isarantiq \\
   1.192 -    \indexdef{}{antiquotation}{typ}\hypertarget{antiquotation.typ}{\hyperlink{antiquotation.typ}{\mbox{\isa{typ}}}} & : & \isarantiq \\
   1.193 -    \indexdef{}{antiquotation}{thm\_style}\hypertarget{antiquotation.thm-style}{\hyperlink{antiquotation.thm-style}{\mbox{\isa{thm{\isacharunderscore}style}}}} & : & \isarantiq \\
   1.194 -    \indexdef{}{antiquotation}{term\_style}\hypertarget{antiquotation.term-style}{\hyperlink{antiquotation.term-style}{\mbox{\isa{term{\isacharunderscore}style}}}} & : & \isarantiq \\
   1.195 -    \indexdef{}{antiquotation}{text}\hypertarget{antiquotation.text}{\hyperlink{antiquotation.text}{\mbox{\isa{text}}}} & : & \isarantiq \\
   1.196 -    \indexdef{}{antiquotation}{goals}\hypertarget{antiquotation.goals}{\hyperlink{antiquotation.goals}{\mbox{\isa{goals}}}} & : & \isarantiq \\
   1.197 -    \indexdef{}{antiquotation}{subgoals}\hypertarget{antiquotation.subgoals}{\hyperlink{antiquotation.subgoals}{\mbox{\isa{subgoals}}}} & : & \isarantiq \\
   1.198 -    \indexdef{}{antiquotation}{prf}\hypertarget{antiquotation.prf}{\hyperlink{antiquotation.prf}{\mbox{\isa{prf}}}} & : & \isarantiq \\
   1.199 -    \indexdef{}{antiquotation}{full\_prf}\hypertarget{antiquotation.full-prf}{\hyperlink{antiquotation.full-prf}{\mbox{\isa{full{\isacharunderscore}prf}}}} & : & \isarantiq \\
   1.200 -    \indexdef{}{antiquotation}{ML}\hypertarget{antiquotation.ML}{\hyperlink{antiquotation.ML}{\mbox{\isa{ML}}}} & : & \isarantiq \\
   1.201 -    \indexdef{}{antiquotation}{ML\_type}\hypertarget{antiquotation.ML-type}{\hyperlink{antiquotation.ML-type}{\mbox{\isa{ML{\isacharunderscore}type}}}} & : & \isarantiq \\
   1.202 -    \indexdef{}{antiquotation}{ML\_struct}\hypertarget{antiquotation.ML-struct}{\hyperlink{antiquotation.ML-struct}{\mbox{\isa{ML{\isacharunderscore}struct}}}} & : & \isarantiq \\
   1.203 +    \indexdef{}{antiquotation}{theory}\hypertarget{antiquotation.theory}{\hyperlink{antiquotation.theory}{\mbox{\isa{theory}}}} & : & \isa{antiquotation} \\
   1.204 +    \indexdef{}{antiquotation}{thm}\hypertarget{antiquotation.thm}{\hyperlink{antiquotation.thm}{\mbox{\isa{thm}}}} & : & \isa{antiquotation} \\
   1.205 +    \indexdef{}{antiquotation}{lemma}\hypertarget{antiquotation.lemma}{\hyperlink{antiquotation.lemma}{\mbox{\isa{lemma}}}} & : & \isa{antiquotation} \\
   1.206 +    \indexdef{}{antiquotation}{prop}\hypertarget{antiquotation.prop}{\hyperlink{antiquotation.prop}{\mbox{\isa{prop}}}} & : & \isa{antiquotation} \\
   1.207 +    \indexdef{}{antiquotation}{term}\hypertarget{antiquotation.term}{\hyperlink{antiquotation.term}{\mbox{\isa{term}}}} & : & \isa{antiquotation} \\
   1.208 +    \indexdef{}{antiquotation}{const}\hypertarget{antiquotation.const}{\hyperlink{antiquotation.const}{\mbox{\isa{const}}}} & : & \isa{antiquotation} \\
   1.209 +    \indexdef{}{antiquotation}{abbrev}\hypertarget{antiquotation.abbrev}{\hyperlink{antiquotation.abbrev}{\mbox{\isa{abbrev}}}} & : & \isa{antiquotation} \\
   1.210 +    \indexdef{}{antiquotation}{typeof}\hypertarget{antiquotation.typeof}{\hyperlink{antiquotation.typeof}{\mbox{\isa{typeof}}}} & : & \isa{antiquotation} \\
   1.211 +    \indexdef{}{antiquotation}{typ}\hypertarget{antiquotation.typ}{\hyperlink{antiquotation.typ}{\mbox{\isa{typ}}}} & : & \isa{antiquotation} \\
   1.212 +    \indexdef{}{antiquotation}{thm\_style}\hypertarget{antiquotation.thm-style}{\hyperlink{antiquotation.thm-style}{\mbox{\isa{thm{\isacharunderscore}style}}}} & : & \isa{antiquotation} \\
   1.213 +    \indexdef{}{antiquotation}{term\_style}\hypertarget{antiquotation.term-style}{\hyperlink{antiquotation.term-style}{\mbox{\isa{term{\isacharunderscore}style}}}} & : & \isa{antiquotation} \\
   1.214 +    \indexdef{}{antiquotation}{text}\hypertarget{antiquotation.text}{\hyperlink{antiquotation.text}{\mbox{\isa{text}}}} & : & \isa{antiquotation} \\
   1.215 +    \indexdef{}{antiquotation}{goals}\hypertarget{antiquotation.goals}{\hyperlink{antiquotation.goals}{\mbox{\isa{goals}}}} & : & \isa{antiquotation} \\
   1.216 +    \indexdef{}{antiquotation}{subgoals}\hypertarget{antiquotation.subgoals}{\hyperlink{antiquotation.subgoals}{\mbox{\isa{subgoals}}}} & : & \isa{antiquotation} \\
   1.217 +    \indexdef{}{antiquotation}{prf}\hypertarget{antiquotation.prf}{\hyperlink{antiquotation.prf}{\mbox{\isa{prf}}}} & : & \isa{antiquotation} \\
   1.218 +    \indexdef{}{antiquotation}{full\_prf}\hypertarget{antiquotation.full-prf}{\hyperlink{antiquotation.full-prf}{\mbox{\isa{full{\isacharunderscore}prf}}}} & : & \isa{antiquotation} \\
   1.219 +    \indexdef{}{antiquotation}{ML}\hypertarget{antiquotation.ML}{\hyperlink{antiquotation.ML}{\mbox{\isa{ML}}}} & : & \isa{antiquotation} \\
   1.220 +    \indexdef{}{antiquotation}{ML\_type}\hypertarget{antiquotation.ML-type}{\hyperlink{antiquotation.ML-type}{\mbox{\isa{ML{\isacharunderscore}type}}}} & : & \isa{antiquotation} \\
   1.221 +    \indexdef{}{antiquotation}{ML\_struct}\hypertarget{antiquotation.ML-struct}{\hyperlink{antiquotation.ML-struct}{\mbox{\isa{ML{\isacharunderscore}struct}}}} & : & \isa{antiquotation} \\
   1.222    \end{matharray}
   1.223  
   1.224 -  The text body of formal comments (see also \secref{sec:comments})
   1.225 -  may contain antiquotations of logical entities, such as theorems,
   1.226 -  terms and types, which are to be presented in the final output
   1.227 -  produced by the Isabelle document preparation system.
   1.228 +  The overall content of an Isabelle/Isar theory may alternate between
   1.229 +  formal and informal text.  The main body consists of formal
   1.230 +  specification and proof commands, interspersed with markup commands
   1.231 +  (\secref{sec:markup}) or document comments (\secref{sec:comments}).
   1.232 +  The argument of markup commands quotes informal text to be printed
   1.233 +  in the resulting document, but may again refer to formal entities
   1.234 +  via \emph{document antiquotations}.
   1.235  
   1.236 -  Thus embedding of ``\isa{{\isacharat}{\isacharbraceleft}term\ {\isacharbrackleft}show{\isacharunderscore}types{\isacharbrackright}\ {\isachardoublequote}f\ x\ {\isacharequal}\ a\ {\isacharplus}\ x{\isachardoublequote}{\isacharbraceright}}''
   1.237 -  within a text block would cause
   1.238 -  \isa{{\isacharparenleft}f{\isasymColon}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a{\isacharparenright}\ {\isacharparenleft}x{\isasymColon}{\isacharprime}a{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}a{\isasymColon}{\isacharprime}a{\isacharparenright}\ {\isacharplus}\ x} to appear in the final {\LaTeX} document.  Also note that theorem
   1.239 -  antiquotations may involve attributes as well.  For example,
   1.240 -  \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}thm\ sym\ {\isacharbrackleft}no{\isacharunderscore}vars{\isacharbrackright}{\isacharbraceright}{\isachardoublequote}} would print the theorem's
   1.241 -  statement where all schematic variables have been replaced by fixed
   1.242 -  ones, which are easier to read.
   1.243 +  For example, embedding of ``\isa{{\isacharat}{\isacharbraceleft}term\ {\isacharbrackleft}show{\isacharunderscore}types{\isacharbrackright}\ {\isachardoublequote}f\ x\ {\isacharequal}\ a\ {\isacharplus}\ x{\isachardoublequote}{\isacharbraceright}}''
   1.244 +  within a text block makes
   1.245 +  \isa{{\isacharparenleft}f{\isasymColon}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a{\isacharparenright}\ {\isacharparenleft}x{\isasymColon}{\isacharprime}a{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}a{\isasymColon}{\isacharprime}a{\isacharparenright}\ {\isacharplus}\ x} appear in the final {\LaTeX} document.
   1.246 +
   1.247 +  Antiquotations usually spare the author tedious typing of logical
   1.248 +  entities in full detail.  Even more importantly, some degree of
   1.249 +  consistency-checking between the main body of formal text and its
   1.250 +  informal explanation is achieved, since terms and types appearing in
   1.251 +  antiquotations are checked within the current theory or proof
   1.252 +  context.
   1.253  
   1.254    \begin{rail}
   1.255      atsign lbrace antiquotation rbrace
   1.256 @@ -215,170 +228,196 @@
   1.257    \end{rail}
   1.258  
   1.259    Note that the syntax of antiquotations may \emph{not} include source
   1.260 -  comments \verb|(*|~\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}~\verb|*)| or verbatim
   1.261 +  comments \verb|(*|~\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}~\verb|*)| nor verbatim
   1.262    text \verb|{|\verb|*|~\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}~\verb|*|\verb|}|.
   1.263  
   1.264 -  \begin{descr}
   1.265 +  \begin{description}
   1.266    
   1.267 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}theory\ A{\isacharbraceright}{\isachardoublequote}}] prints the name \isa{{\isachardoublequote}A{\isachardoublequote}}, which is
   1.268 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}theory\ A{\isacharbraceright}{\isachardoublequote}} prints the name \isa{{\isachardoublequote}A{\isachardoublequote}}, which is
   1.269    guaranteed to refer to a valid ancestor theory in the current
   1.270    context.
   1.271  
   1.272 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}thm\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}}] prints theorems
   1.273 -  \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}.  Note that attribute specifications
   1.274 -  may be included as well (see also \secref{sec:syn-att}); the
   1.275 -  \indexref{}{attribute}{no\_vars}\hyperlink{attribute.no-vars}{\mbox{\isa{no{\isacharunderscore}vars}}} rule (see \secref{sec:misc-meth-att}) would
   1.276 -  be particularly useful to suppress printing of schematic variables.
   1.277 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}thm\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}} prints theorems \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}.
   1.278 +  Full fact expressions are allowed here, including attributes
   1.279 +  (\secref{sec:syn-att}).
   1.280 +
   1.281 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}prop\ {\isasymphi}{\isacharbraceright}{\isachardoublequote}} prints a well-typed proposition \isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}}.
   1.282  
   1.283 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}prop\ {\isasymphi}{\isacharbraceright}{\isachardoublequote}}] prints a well-typed proposition \isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}}.
   1.284 -
   1.285 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}lemma\ {\isasymphi}\ by\ m{\isacharbraceright}{\isachardoublequote}}] asserts a well-typed proposition \isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}} to be provable by method \isa{m} and prints \isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}}.
   1.286 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}lemma\ {\isasymphi}\ by\ m{\isacharbraceright}{\isachardoublequote}} proves a well-typed proposition
   1.287 +  \isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}} by method \isa{m} and prints the original \isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}}.
   1.288  
   1.289 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}term\ t{\isacharbraceright}{\isachardoublequote}}] prints a well-typed term \isa{{\isachardoublequote}t{\isachardoublequote}}.
   1.290 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}term\ t{\isacharbraceright}{\isachardoublequote}} prints a well-typed term \isa{{\isachardoublequote}t{\isachardoublequote}}.
   1.291  
   1.292 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}const\ c{\isacharbraceright}{\isachardoublequote}}] prints a logical or syntactic constant
   1.293 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}const\ c{\isacharbraceright}{\isachardoublequote}} prints a logical or syntactic constant
   1.294    \isa{{\isachardoublequote}c{\isachardoublequote}}.
   1.295    
   1.296 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}abbrev\ c\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub n{\isacharbraceright}{\isachardoublequote}}] prints a constant
   1.297 -  abbreviation \isa{{\isachardoublequote}c\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub n\ {\isasymequiv}\ rhs{\isachardoublequote}} as defined in
   1.298 -  the current context.
   1.299 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}abbrev\ c\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub n{\isacharbraceright}{\isachardoublequote}} prints a constant abbreviation
   1.300 +  \isa{{\isachardoublequote}c\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub n\ {\isasymequiv}\ rhs{\isachardoublequote}} as defined in the current context.
   1.301  
   1.302 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}typeof\ t{\isacharbraceright}{\isachardoublequote}}] prints the type of a well-typed term
   1.303 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}typeof\ t{\isacharbraceright}{\isachardoublequote}} prints the type of a well-typed term
   1.304    \isa{{\isachardoublequote}t{\isachardoublequote}}.
   1.305  
   1.306 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}typ\ {\isasymtau}{\isacharbraceright}{\isachardoublequote}}] prints a well-formed type \isa{{\isachardoublequote}{\isasymtau}{\isachardoublequote}}.
   1.307 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}typ\ {\isasymtau}{\isacharbraceright}{\isachardoublequote}} prints a well-formed type \isa{{\isachardoublequote}{\isasymtau}{\isachardoublequote}}.
   1.308    
   1.309 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}thm{\isacharunderscore}style\ s\ a{\isacharbraceright}{\isachardoublequote}}] prints theorem \isa{a},
   1.310 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}thm{\isacharunderscore}style\ s\ a{\isacharbraceright}{\isachardoublequote}} prints theorem \isa{a},
   1.311    previously applying a style \isa{s} to it (see below).
   1.312    
   1.313 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}term{\isacharunderscore}style\ s\ t{\isacharbraceright}{\isachardoublequote}}] prints a well-typed term \isa{t} after applying a style \isa{s} to it (see below).
   1.314 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}term{\isacharunderscore}style\ s\ t{\isacharbraceright}{\isachardoublequote}} prints a well-typed term \isa{t}
   1.315 +  after applying a style \isa{s} to it (see below).
   1.316  
   1.317 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}text\ s{\isacharbraceright}{\isachardoublequote}}] prints uninterpreted source text \isa{s}.  This is particularly useful to print portions of text according
   1.318 -  to the Isabelle {\LaTeX} output style, without demanding
   1.319 -  well-formedness (e.g.\ small pieces of terms that should not be
   1.320 -  parsed or type-checked yet).
   1.321 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}text\ s{\isacharbraceright}{\isachardoublequote}} prints uninterpreted source text \isa{s}.  This is particularly useful to print portions of text according
   1.322 +  to the Isabelle document style, without demanding well-formedness,
   1.323 +  e.g.\ small pieces of terms that should not be parsed or
   1.324 +  type-checked yet.
   1.325  
   1.326 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}goals{\isacharbraceright}{\isachardoublequote}}] prints the current \emph{dynamic} goal
   1.327 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}goals{\isacharbraceright}{\isachardoublequote}} prints the current \emph{dynamic} goal
   1.328    state.  This is mainly for support of tactic-emulation scripts
   1.329 -  within Isar --- presentation of goal states does not conform to
   1.330 -  actual human-readable proof documents.
   1.331 +  within Isar.  Presentation of goal states does not conform to the
   1.332 +  idea of human-readable proof documents!
   1.333  
   1.334 -  Please do not include goal states into document output unless you
   1.335 -  really know what you are doing!
   1.336 +  When explaining proofs in detail it is usually better to spell out
   1.337 +  the reasoning via proper Isar proof commands, instead of peeking at
   1.338 +  the internal machine configuration.
   1.339    
   1.340 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}subgoals{\isacharbraceright}{\isachardoublequote}}] is similar to \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}goals{\isacharbraceright}{\isachardoublequote}}, but
   1.341 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}subgoals{\isacharbraceright}{\isachardoublequote}} is similar to \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}goals{\isacharbraceright}{\isachardoublequote}}, but
   1.342    does not print the main goal.
   1.343    
   1.344 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}prf\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}}] prints the (compact)
   1.345 -  proof terms corresponding to the theorems \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}. Note that this requires proof terms to be switched on
   1.346 -  for the current object logic (see the ``Proof terms'' section of the
   1.347 -  Isabelle reference manual for information on how to do this).
   1.348 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}prf\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}} prints the (compact) proof terms
   1.349 +  corresponding to the theorems \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}. Note that this
   1.350 +  requires proof terms to be switched on for the current logic
   1.351 +  session.
   1.352    
   1.353 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}full{\isacharunderscore}prf\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}}] is like \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}prf\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}}, but displays the full proof terms,
   1.354 -  i.e.\ also displays information omitted in the compact proof term,
   1.355 -  which is denoted by ``\isa{{\isacharunderscore}}'' placeholders there.
   1.356 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}full{\isacharunderscore}prf\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}} is like \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}prf\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}}, but prints the full proof terms, i.e.\ also displays
   1.357 +  information omitted in the compact proof term, which is denoted by
   1.358 +  ``\isa{{\isacharunderscore}}'' placeholders there.
   1.359    
   1.360 -  \item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}ML\ s{\isacharbraceright}{\isachardoublequote}}, \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}ML{\isacharunderscore}type\ s{\isacharbraceright}{\isachardoublequote}}, and \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}ML{\isacharunderscore}struct\ s{\isacharbraceright}{\isachardoublequote}}] check text \isa{s} as ML value, type, and
   1.361 -  structure, respectively.  The source is displayed verbatim.
   1.362 -
   1.363 -  \end{descr}
   1.364 +  \item \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}ML\ s{\isacharbraceright}{\isachardoublequote}}, \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}ML{\isacharunderscore}type\ s{\isacharbraceright}{\isachardoublequote}}, and \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}ML{\isacharunderscore}struct\ s{\isacharbraceright}{\isachardoublequote}} check text \isa{s} as ML value, type, and
   1.365 +  structure, respectively.  The source is printed verbatim.
   1.366  
   1.367 -  \medskip The following standard styles for use with \isa{thm{\isacharunderscore}style} and \isa{term{\isacharunderscore}style} are available:
   1.368 +  \end{description}%
   1.369 +\end{isamarkuptext}%
   1.370 +\isamarkuptrue%
   1.371 +%
   1.372 +\isamarkupsubsubsection{Styled antiquotations%
   1.373 +}
   1.374 +\isamarkuptrue%
   1.375 +%
   1.376 +\begin{isamarkuptext}%
   1.377 +Some antiquotations like \isa{thm{\isacharunderscore}style} and \isa{term{\isacharunderscore}style} admit an extra \emph{style} specification to modify the
   1.378 +  printed result.  The following standard styles are available:
   1.379  
   1.380 -  \begin{descr}
   1.381 +  \begin{description}
   1.382    
   1.383 -  \item [\isa{lhs}] extracts the first argument of any application
   1.384 -  form with at least two arguments -- typically meta-level or
   1.385 +  \item \isa{lhs} extracts the first argument of any application
   1.386 +  form with at least two arguments --- typically meta-level or
   1.387    object-level equality, or any other binary relation.
   1.388    
   1.389 -  \item [\isa{rhs}] is like \isa{lhs}, but extracts the second
   1.390 +  \item \isa{rhs} is like \isa{lhs}, but extracts the second
   1.391    argument.
   1.392    
   1.393 -  \item [\isa{{\isachardoublequote}concl{\isachardoublequote}}] extracts the conclusion \isa{C} from a rule
   1.394 +  \item \isa{{\isachardoublequote}concl{\isachardoublequote}} extracts the conclusion \isa{C} from a rule
   1.395    in Horn-clause normal form \isa{{\isachardoublequote}A\isactrlsub {\isadigit{1}}\ {\isasymLongrightarrow}\ {\isasymdots}\ A\isactrlsub n\ {\isasymLongrightarrow}\ C{\isachardoublequote}}.
   1.396    
   1.397 -  \item [\isa{{\isachardoublequote}prem{\isadigit{1}}{\isachardoublequote}}, \dots, \isa{{\isachardoublequote}prem{\isadigit{9}}{\isachardoublequote}}] extract premise
   1.398 -  number \isa{{\isachardoublequote}{\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isadigit{9}}{\isachardoublequote}}, respectively, from from a rule in
   1.399 -  Horn-clause normal form \isa{{\isachardoublequote}A\isactrlsub {\isadigit{1}}\ {\isasymLongrightarrow}\ {\isasymdots}\ A\isactrlsub n\ {\isasymLongrightarrow}\ C{\isachardoublequote}}
   1.400 -
   1.401 -  \end{descr}
   1.402 +  \item \isa{{\isachardoublequote}prem{\isadigit{1}}{\isachardoublequote}}, \dots, \isa{{\isachardoublequote}prem{\isadigit{9}}{\isachardoublequote}} extract premise number
   1.403 +  \isa{{\isachardoublequote}{\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isadigit{9}}{\isachardoublequote}}, respectively, from from a rule in Horn-clause
   1.404 +  normal form \isa{{\isachardoublequote}A\isactrlsub {\isadigit{1}}\ {\isasymLongrightarrow}\ {\isasymdots}\ A\isactrlsub n\ {\isasymLongrightarrow}\ C{\isachardoublequote}}
   1.405  
   1.406 -  \medskip
   1.407 -  The following options are available to tune the output.  Note that most of
   1.408 -  these coincide with ML flags of the same names (see also \cite{isabelle-ref}).
   1.409 +  \end{description}%
   1.410 +\end{isamarkuptext}%
   1.411 +\isamarkuptrue%
   1.412 +%
   1.413 +\isamarkupsubsubsection{General options%
   1.414 +}
   1.415 +\isamarkuptrue%
   1.416 +%
   1.417 +\begin{isamarkuptext}%
   1.418 +The following options are available to tune the printed output
   1.419 +  of antiquotations.  Note that many of these coincide with global ML
   1.420 +  flags of the same names.
   1.421  
   1.422 -  \begin{descr}
   1.423 +  \begin{description}
   1.424  
   1.425 -  \item[\isa{{\isachardoublequote}show{\isacharunderscore}types\ {\isacharequal}\ bool{\isachardoublequote}} and \isa{{\isachardoublequote}show{\isacharunderscore}sorts\ {\isacharequal}\ bool{\isachardoublequote}}]
   1.426 +  \item \isa{{\isachardoublequote}show{\isacharunderscore}types\ {\isacharequal}\ bool{\isachardoublequote}} and \isa{{\isachardoublequote}show{\isacharunderscore}sorts\ {\isacharequal}\ bool{\isachardoublequote}}
   1.427    control printing of explicit type and sort constraints.
   1.428  
   1.429 -  \item[\isa{{\isachardoublequote}show{\isacharunderscore}structs\ {\isacharequal}\ bool{\isachardoublequote}}] controls printing of implicit
   1.430 +  \item \isa{{\isachardoublequote}show{\isacharunderscore}structs\ {\isacharequal}\ bool{\isachardoublequote}} controls printing of implicit
   1.431    structures.
   1.432  
   1.433 -  \item[\isa{{\isachardoublequote}long{\isacharunderscore}names\ {\isacharequal}\ bool{\isachardoublequote}}] forces names of types and
   1.434 +  \item \isa{{\isachardoublequote}long{\isacharunderscore}names\ {\isacharequal}\ bool{\isachardoublequote}} forces names of types and
   1.435    constants etc.\ to be printed in their fully qualified internal
   1.436    form.
   1.437  
   1.438 -  \item[\isa{{\isachardoublequote}short{\isacharunderscore}names\ {\isacharequal}\ bool{\isachardoublequote}}] forces names of types and
   1.439 +  \item \isa{{\isachardoublequote}short{\isacharunderscore}names\ {\isacharequal}\ bool{\isachardoublequote}} forces names of types and
   1.440    constants etc.\ to be printed unqualified.  Note that internalizing
   1.441    the output again in the current context may well yield a different
   1.442    result.
   1.443  
   1.444 -  \item[\isa{{\isachardoublequote}unique{\isacharunderscore}names\ {\isacharequal}\ bool{\isachardoublequote}}] determines whether the printed
   1.445 +  \item \isa{{\isachardoublequote}unique{\isacharunderscore}names\ {\isacharequal}\ bool{\isachardoublequote}} determines whether the printed
   1.446    version of qualified names should be made sufficiently long to avoid
   1.447    overlap with names declared further back.  Set to \isa{false} for
   1.448    more concise output.
   1.449  
   1.450 -  \item[\isa{{\isachardoublequote}eta{\isacharunderscore}contract\ {\isacharequal}\ bool{\isachardoublequote}}] prints terms in \isa{{\isasymeta}}-contracted form.
   1.451 +  \item \isa{{\isachardoublequote}eta{\isacharunderscore}contract\ {\isacharequal}\ bool{\isachardoublequote}} prints terms in \isa{{\isasymeta}}-contracted form.
   1.452  
   1.453 -  \item[\isa{{\isachardoublequote}display\ {\isacharequal}\ bool{\isachardoublequote}}] indicates if the text is to be
   1.454 -  output as multi-line ``display material'', rather than a small piece
   1.455 -  of text without line breaks (which is the default).
   1.456 +  \item \isa{{\isachardoublequote}display\ {\isacharequal}\ bool{\isachardoublequote}} indicates if the text is to be output
   1.457 +  as multi-line ``display material'', rather than a small piece of
   1.458 +  text without line breaks (which is the default).
   1.459  
   1.460 -  \item[\isa{{\isachardoublequote}break\ {\isacharequal}\ bool{\isachardoublequote}}] controls line breaks in non-display
   1.461 +  In this mode the embedded entities are printed in the same style as
   1.462 +  the main theory text.
   1.463 +
   1.464 +  \item \isa{{\isachardoublequote}break\ {\isacharequal}\ bool{\isachardoublequote}} controls line breaks in non-display
   1.465    material.
   1.466  
   1.467 -  \item[\isa{{\isachardoublequote}quotes\ {\isacharequal}\ bool{\isachardoublequote}}] indicates if the output should be
   1.468 +  \item \isa{{\isachardoublequote}quotes\ {\isacharequal}\ bool{\isachardoublequote}} indicates if the output should be
   1.469    enclosed in double quotes.
   1.470  
   1.471 -  \item[\isa{{\isachardoublequote}mode\ {\isacharequal}\ name{\isachardoublequote}}] adds \isa{name} to the print mode to
   1.472 +  \item \isa{{\isachardoublequote}mode\ {\isacharequal}\ name{\isachardoublequote}} adds \isa{name} to the print mode to
   1.473    be used for presentation (see also \cite{isabelle-ref}).  Note that
   1.474    the standard setup for {\LaTeX} output is already present by
   1.475    default, including the modes \isa{latex} and \isa{xsymbols}.
   1.476  
   1.477 -  \item[\isa{{\isachardoublequote}margin\ {\isacharequal}\ nat{\isachardoublequote}} and \isa{{\isachardoublequote}indent\ {\isacharequal}\ nat{\isachardoublequote}}] change the
   1.478 +  \item \isa{{\isachardoublequote}margin\ {\isacharequal}\ nat{\isachardoublequote}} and \isa{{\isachardoublequote}indent\ {\isacharequal}\ nat{\isachardoublequote}} change the
   1.479    margin or indentation for pretty printing of display material.
   1.480  
   1.481 -  \item[\isa{{\isachardoublequote}source\ {\isacharequal}\ bool{\isachardoublequote}}] prints the source text of the
   1.482 -  antiquotation arguments, rather than the actual value.  Note that
   1.483 -  this does not affect well-formedness checks of \hyperlink{antiquotation.thm}{\mbox{\isa{thm}}}, \hyperlink{antiquotation.term}{\mbox{\isa{term}}}, etc. (only the \hyperlink{antiquotation.text}{\mbox{\isa{text}}} antiquotation admits arbitrary output).
   1.484 +  \item \isa{{\isachardoublequote}goals{\isacharunderscore}limit\ {\isacharequal}\ nat{\isachardoublequote}} determines the maximum number of
   1.485 +  goals to be printed (for goal-based antiquotation).
   1.486  
   1.487 -  \item[\isa{{\isachardoublequote}goals{\isacharunderscore}limit\ {\isacharequal}\ nat{\isachardoublequote}}] determines the maximum number of
   1.488 -  goals to be printed.
   1.489 -
   1.490 -  \item[\isa{{\isachardoublequote}locale\ {\isacharequal}\ name{\isachardoublequote}}] specifies an alternative locale
   1.491 +  \item \isa{{\isachardoublequote}locale\ {\isacharequal}\ name{\isachardoublequote}} specifies an alternative locale
   1.492    context used for evaluating and printing the subsequent argument.
   1.493  
   1.494 -  \end{descr}
   1.495 +  \item \isa{{\isachardoublequote}source\ {\isacharequal}\ bool{\isachardoublequote}} prints the original source text of the
   1.496 +  antiquotation arguments, rather than its internal representation.
   1.497 +  Note that formal checking of \hyperlink{antiquotation.thm}{\mbox{\isa{thm}}}, \hyperlink{antiquotation.term}{\mbox{\isa{term}}}, etc. is still enabled; use the \hyperlink{antiquotation.text}{\mbox{\isa{text}}}
   1.498 +  antiquotation for unchecked output.
   1.499 +
   1.500 +  Regular \isa{{\isachardoublequote}term{\isachardoublequote}} and \isa{{\isachardoublequote}typ{\isachardoublequote}} antiquotations with \isa{{\isachardoublequote}source\ {\isacharequal}\ false{\isachardoublequote}} involve a full round-trip from the original source
   1.501 +  to an internalized logical entity back to a source form, according
   1.502 +  to the syntax of the current context.  Thus the printed output is
   1.503 +  not under direct control of the author, it may even fluctuate a bit
   1.504 +  as the underlying theory is changed later on.
   1.505 +
   1.506 +  In contrast, \isa{{\isachardoublequote}source\ {\isacharequal}\ true{\isachardoublequote}} admits direct printing of the
   1.507 +  given source text, with the desirable well-formedness check in the
   1.508 +  background, but without modification of the printed text.
   1.509 +
   1.510 +  \end{description}
   1.511  
   1.512    For boolean flags, ``\isa{{\isachardoublequote}name\ {\isacharequal}\ true{\isachardoublequote}}'' may be abbreviated as
   1.513    ``\isa{name}''.  All of the above flags are disabled by default,
   1.514 -  unless changed from ML.
   1.515 -
   1.516 -  \medskip Note that antiquotations do not only spare the author from
   1.517 -  tedious typing of logical entities, but also achieve some degree of
   1.518 -  consistency-checking of informal explanations with formal
   1.519 -  developments: well-formedness of terms and types with respect to the
   1.520 -  current theory or proof context is ensured here.%
   1.521 +  unless changed from ML, say in the \verb|ROOT.ML| of the
   1.522 +  logic session.%
   1.523  \end{isamarkuptext}%
   1.524  \isamarkuptrue%
   1.525  %
   1.526 -\isamarkupsection{Tagged commands \label{sec:tags}%
   1.527 +\isamarkupsection{Markup via command tags \label{sec:tags}%
   1.528  }
   1.529  \isamarkuptrue%
   1.530  %
   1.531  \begin{isamarkuptext}%
   1.532 -Each Isabelle/Isar command may be decorated by presentation tags:
   1.533 +Each Isabelle/Isar command may be decorated by additional
   1.534 +  presentation tags, to indicate some modification in the way it is
   1.535 +  printed in the document.
   1.536  
   1.537    \indexouternonterm{tags}
   1.538    \begin{rail}
   1.539 @@ -387,32 +426,41 @@
   1.540      tag: '\%' (ident | string)
   1.541    \end{rail}
   1.542  
   1.543 -  The tags \isa{{\isachardoublequote}theory{\isachardoublequote}}, \isa{{\isachardoublequote}proof{\isachardoublequote}}, \isa{{\isachardoublequote}ML{\isachardoublequote}} are already
   1.544 -  pre-declared for certain classes of commands:
   1.545 +  Some tags are pre-declared for certain classes of commands, serving
   1.546 +  as default markup if no tags are given in the text:
   1.547  
   1.548 - \medskip
   1.549 -
   1.550 +  \medskip
   1.551    \begin{tabular}{ll}
   1.552      \isa{{\isachardoublequote}theory{\isachardoublequote}} & theory begin/end \\
   1.553      \isa{{\isachardoublequote}proof{\isachardoublequote}} & all proof commands \\
   1.554      \isa{{\isachardoublequote}ML{\isachardoublequote}} & all commands involving ML code \\
   1.555    \end{tabular}
   1.556  
   1.557 -  \medskip The Isabelle document preparation system (see also
   1.558 -  \cite{isabelle-sys}) allows tagged command regions to be presented
   1.559 +  \medskip The Isabelle document preparation system
   1.560 +  \cite{isabelle-sys} allows tagged command regions to be presented
   1.561    specifically, e.g.\ to fold proof texts, or drop parts of the text
   1.562    completely.
   1.563  
   1.564 -  For example ``\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}{\isacharpercent}invisible\ auto{\isachardoublequote}}'' would
   1.565 -  cause that piece of proof to be treated as \isa{invisible} instead
   1.566 -  of \isa{{\isachardoublequote}proof{\isachardoublequote}} (the default), which may be either show or hidden
   1.567 -  depending on the document setup.  In contrast, ``\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}{\isacharpercent}visible\ auto{\isachardoublequote}}'' would force this text to be shown
   1.568 +  For example ``\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}{\isacharpercent}invisible\ auto{\isachardoublequote}}'' causes
   1.569 +  that piece of proof to be treated as \isa{invisible} instead of
   1.570 +  \isa{{\isachardoublequote}proof{\isachardoublequote}} (the default), which may be shown or hidden
   1.571 +  depending on the document setup.  In contrast, ``\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}{\isacharpercent}visible\ auto{\isachardoublequote}}'' forces this text to be shown
   1.572    invariably.
   1.573  
   1.574    Explicit tag specifications within a proof apply to all subsequent
   1.575 -  commands of the same level of nesting.  For example, ``\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}{\isacharpercent}visible\ {\isasymdots}{\isachardoublequote}}~\hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}'' would force the
   1.576 -  whole sub-proof to be typeset as \isa{visible} (unless some of its
   1.577 -  parts are tagged differently).%
   1.578 +  commands of the same level of nesting.  For example, ``\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}{\isacharpercent}visible\ {\isasymdots}{\isachardoublequote}}~\hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}'' forces the whole
   1.579 +  sub-proof to be typeset as \isa{visible} (unless some of its parts
   1.580 +  are tagged differently).
   1.581 +
   1.582 +  \medskip Command tags merely produce certain markup environments for
   1.583 +  type-setting.  The meaning of these is determined by {\LaTeX}
   1.584 +  macros, as defined in \hyperlink{file.~~/lib/texinputs/isabelle.sty}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}lib{\isacharslash}texinputs{\isacharslash}isabelle{\isachardot}sty}}}} or
   1.585 +  by the document author.  The Isabelle document preparation tools
   1.586 +  also provide some high-level options to specify the meaning of
   1.587 +  arbitrary tags to ``keep'', ``drop'', or ``fold'' the corresponding
   1.588 +  parts of the text.  Logic sessions may also specify ``document
   1.589 +  versions'', where given tags are interpreted in some particular way.
   1.590 +  Again see \cite{isabelle-sys} for further details.%
   1.591  \end{isamarkuptext}%
   1.592  \isamarkuptrue%
   1.593  %
   1.594 @@ -422,8 +470,8 @@
   1.595  %
   1.596  \begin{isamarkuptext}%
   1.597  \begin{matharray}{rcl}
   1.598 -    \indexdef{}{command}{display\_drafts}\hypertarget{command.display-drafts}{\hyperlink{command.display-drafts}{\mbox{\isa{\isacommand{display{\isacharunderscore}drafts}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   1.599 -    \indexdef{}{command}{print\_drafts}\hypertarget{command.print-drafts}{\hyperlink{command.print-drafts}{\mbox{\isa{\isacommand{print{\isacharunderscore}drafts}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   1.600 +    \indexdef{}{command}{display\_drafts}\hypertarget{command.display-drafts}{\hyperlink{command.display-drafts}{\mbox{\isa{\isacommand{display{\isacharunderscore}drafts}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
   1.601 +    \indexdef{}{command}{print\_drafts}\hypertarget{command.print-drafts}{\hyperlink{command.print-drafts}{\mbox{\isa{\isacommand{print{\isacharunderscore}drafts}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
   1.602    \end{matharray}
   1.603  
   1.604    \begin{rail}
   1.605 @@ -431,14 +479,14 @@
   1.606      ;
   1.607    \end{rail}
   1.608  
   1.609 -  \begin{descr}
   1.610 +  \begin{description}
   1.611  
   1.612 -  \item [\hyperlink{command.display-drafts}{\mbox{\isa{\isacommand{display{\isacharunderscore}drafts}}}}~\isa{paths} and \hyperlink{command.print-drafts}{\mbox{\isa{\isacommand{print{\isacharunderscore}drafts}}}}~\isa{paths}] perform simple output of a given list
   1.613 +  \item \hyperlink{command.display-drafts}{\mbox{\isa{\isacommand{display{\isacharunderscore}drafts}}}}~\isa{paths} and \hyperlink{command.print-drafts}{\mbox{\isa{\isacommand{print{\isacharunderscore}drafts}}}}~\isa{paths} perform simple output of a given list
   1.614    of raw source files.  Only those symbols that do not require
   1.615    additional {\LaTeX} packages are displayed properly, everything else
   1.616    is left verbatim.
   1.617  
   1.618 -  \end{descr}%
   1.619 +  \end{description}%
   1.620  \end{isamarkuptext}%
   1.621  \isamarkuptrue%
   1.622  %
     2.1 --- a/doc-src/IsarRef/Thy/document/Generic.tex	Thu Nov 13 22:44:40 2008 +0100
     2.2 +++ b/doc-src/IsarRef/Thy/document/Generic.tex	Thu Nov 13 22:45:12 2008 +0100
     2.3 @@ -43,24 +43,24 @@
     2.4    ``global'', which may not be changed within a local context.
     2.5  
     2.6    \begin{matharray}{rcll}
     2.7 -    \indexdef{}{command}{print\_configs}\hypertarget{command.print-configs}{\hyperlink{command.print-configs}{\mbox{\isa{\isacommand{print{\isacharunderscore}configs}}}}} & : & \isarkeep{theory~|~proof} \\
     2.8 +    \indexdef{}{command}{print\_configs}\hypertarget{command.print-configs}{\hyperlink{command.print-configs}{\mbox{\isa{\isacommand{print{\isacharunderscore}configs}}}}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
     2.9    \end{matharray}
    2.10  
    2.11    \begin{rail}
    2.12      name ('=' ('true' | 'false' | int | name))?
    2.13    \end{rail}
    2.14  
    2.15 -  \begin{descr}
    2.16 +  \begin{description}
    2.17    
    2.18 -  \item [\hyperlink{command.print-configs}{\mbox{\isa{\isacommand{print{\isacharunderscore}configs}}}}] prints the available
    2.19 -  configuration options, with names, types, and current values.
    2.20 +  \item \hyperlink{command.print-configs}{\mbox{\isa{\isacommand{print{\isacharunderscore}configs}}}} prints the available configuration
    2.21 +  options, with names, types, and current values.
    2.22    
    2.23 -  \item [\isa{{\isachardoublequote}name\ {\isacharequal}\ value{\isachardoublequote}}] as an attribute expression modifies
    2.24 -  the named option, with the syntax of the value depending on the
    2.25 -  option's type.  For \verb|bool| the default value is \isa{true}.  Any attempt to change a global option in a local context is
    2.26 -  ignored.
    2.27 +  \item \isa{{\isachardoublequote}name\ {\isacharequal}\ value{\isachardoublequote}} as an attribute expression modifies the
    2.28 +  named option, with the syntax of the value depending on the option's
    2.29 +  type.  For \verb|bool| the default value is \isa{true}.  Any
    2.30 +  attempt to change a global option in a local context is ignored.
    2.31  
    2.32 -  \end{descr}%
    2.33 +  \end{description}%
    2.34  \end{isamarkuptext}%
    2.35  \isamarkuptrue%
    2.36  %
    2.37 @@ -74,14 +74,14 @@
    2.38  %
    2.39  \begin{isamarkuptext}%
    2.40  \begin{matharray}{rcl}
    2.41 -    \indexdef{}{method}{unfold}\hypertarget{method.unfold}{\hyperlink{method.unfold}{\mbox{\isa{unfold}}}} & : & \isarmeth \\
    2.42 -    \indexdef{}{method}{fold}\hypertarget{method.fold}{\hyperlink{method.fold}{\mbox{\isa{fold}}}} & : & \isarmeth \\
    2.43 -    \indexdef{}{method}{insert}\hypertarget{method.insert}{\hyperlink{method.insert}{\mbox{\isa{insert}}}} & : & \isarmeth \\[0.5ex]
    2.44 -    \indexdef{}{method}{erule}\hypertarget{method.erule}{\hyperlink{method.erule}{\mbox{\isa{erule}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
    2.45 -    \indexdef{}{method}{drule}\hypertarget{method.drule}{\hyperlink{method.drule}{\mbox{\isa{drule}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
    2.46 -    \indexdef{}{method}{frule}\hypertarget{method.frule}{\hyperlink{method.frule}{\mbox{\isa{frule}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
    2.47 -    \indexdef{}{method}{succeed}\hypertarget{method.succeed}{\hyperlink{method.succeed}{\mbox{\isa{succeed}}}} & : & \isarmeth \\
    2.48 -    \indexdef{}{method}{fail}\hypertarget{method.fail}{\hyperlink{method.fail}{\mbox{\isa{fail}}}} & : & \isarmeth \\
    2.49 +    \indexdef{}{method}{unfold}\hypertarget{method.unfold}{\hyperlink{method.unfold}{\mbox{\isa{unfold}}}} & : & \isa{method} \\
    2.50 +    \indexdef{}{method}{fold}\hypertarget{method.fold}{\hyperlink{method.fold}{\mbox{\isa{fold}}}} & : & \isa{method} \\
    2.51 +    \indexdef{}{method}{insert}\hypertarget{method.insert}{\hyperlink{method.insert}{\mbox{\isa{insert}}}} & : & \isa{method} \\[0.5ex]
    2.52 +    \indexdef{}{method}{erule}\hypertarget{method.erule}{\hyperlink{method.erule}{\mbox{\isa{erule}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
    2.53 +    \indexdef{}{method}{drule}\hypertarget{method.drule}{\hyperlink{method.drule}{\mbox{\isa{drule}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
    2.54 +    \indexdef{}{method}{frule}\hypertarget{method.frule}{\hyperlink{method.frule}{\mbox{\isa{frule}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
    2.55 +    \indexdef{}{method}{succeed}\hypertarget{method.succeed}{\hyperlink{method.succeed}{\mbox{\isa{succeed}}}} & : & \isa{method} \\
    2.56 +    \indexdef{}{method}{fail}\hypertarget{method.fail}{\hyperlink{method.fail}{\mbox{\isa{fail}}}} & : & \isa{method} \\
    2.57    \end{matharray}
    2.58  
    2.59    \begin{rail}
    2.60 @@ -91,22 +91,22 @@
    2.61      ;
    2.62    \end{rail}
    2.63  
    2.64 -  \begin{descr}
    2.65 +  \begin{description}
    2.66    
    2.67 -  \item [\hyperlink{method.unfold}{\mbox{\isa{unfold}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} and \hyperlink{method.fold}{\mbox{\isa{fold}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] expand (or fold back) the
    2.68 -  given definitions throughout all goals; any chained facts provided
    2.69 -  are inserted into the goal and subject to rewriting as well.
    2.70 +  \item \hyperlink{method.unfold}{\mbox{\isa{unfold}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} and \hyperlink{method.fold}{\mbox{\isa{fold}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} expand (or fold back) the given definitions throughout
    2.71 +  all goals; any chained facts provided are inserted into the goal and
    2.72 +  subject to rewriting as well.
    2.73  
    2.74 -  \item [\hyperlink{method.insert}{\mbox{\isa{insert}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] inserts
    2.75 -  theorems as facts into all goals of the proof state.  Note that
    2.76 -  current facts indicated for forward chaining are ignored.
    2.77 +  \item \hyperlink{method.insert}{\mbox{\isa{insert}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} inserts theorems as facts
    2.78 +  into all goals of the proof state.  Note that current facts
    2.79 +  indicated for forward chaining are ignored.
    2.80  
    2.81 -  \item [\hyperlink{method.erule}{\mbox{\isa{erule}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}, \hyperlink{method.drule}{\mbox{\isa{drule}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}, and \hyperlink{method.frule}{\mbox{\isa{frule}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] are similar to the basic \hyperlink{method.rule}{\mbox{\isa{rule}}}
    2.82 -  method (see \secref{sec:pure-meth-att}), but apply rules by
    2.83 -  elim-resolution, destruct-resolution, and forward-resolution,
    2.84 -  respectively \cite{isabelle-ref}.  The optional natural number
    2.85 -  argument (default 0) specifies additional assumption steps to be
    2.86 -  performed here.
    2.87 +  \item \hyperlink{method.erule}{\mbox{\isa{erule}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}, \hyperlink{method.drule}{\mbox{\isa{drule}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}, and \hyperlink{method.frule}{\mbox{\isa{frule}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} are similar to the
    2.88 +  basic \hyperlink{method.rule}{\mbox{\isa{rule}}} method (see \secref{sec:pure-meth-att}), but
    2.89 +  apply rules by elim-resolution, destruct-resolution, and
    2.90 +  forward-resolution, respectively \cite{isabelle-ref}.  The optional
    2.91 +  natural number argument (default 0) specifies additional assumption
    2.92 +  steps to be performed here.
    2.93  
    2.94    Note that these methods are improper ones, mainly serving for
    2.95    experimentation and tactic script emulation.  Different modes of
    2.96 @@ -116,31 +116,31 @@
    2.97    the plain \hyperlink{method.rule}{\mbox{\isa{rule}}} method, with forward chaining of current
    2.98    facts.
    2.99  
   2.100 -  \item [\hyperlink{method.succeed}{\mbox{\isa{succeed}}}] yields a single (unchanged) result; it is
   2.101 +  \item \hyperlink{method.succeed}{\mbox{\isa{succeed}}} yields a single (unchanged) result; it is
   2.102    the identity of the ``\isa{{\isachardoublequote}{\isacharcomma}{\isachardoublequote}}'' method combinator (cf.\
   2.103 -  \secref{sec:syn-meth}).
   2.104 +  \secref{sec:proof-meth}).
   2.105  
   2.106 -  \item [\hyperlink{method.fail}{\mbox{\isa{fail}}}] yields an empty result sequence; it is the
   2.107 +  \item \hyperlink{method.fail}{\mbox{\isa{fail}}} yields an empty result sequence; it is the
   2.108    identity of the ``\isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}}'' method combinator (cf.\
   2.109 -  \secref{sec:syn-meth}).
   2.110 +  \secref{sec:proof-meth}).
   2.111  
   2.112 -  \end{descr}
   2.113 +  \end{description}
   2.114  
   2.115    \begin{matharray}{rcl}
   2.116 -    \indexdef{}{attribute}{tagged}\hypertarget{attribute.tagged}{\hyperlink{attribute.tagged}{\mbox{\isa{tagged}}}} & : & \isaratt \\
   2.117 -    \indexdef{}{attribute}{untagged}\hypertarget{attribute.untagged}{\hyperlink{attribute.untagged}{\mbox{\isa{untagged}}}} & : & \isaratt \\[0.5ex]
   2.118 -    \indexdef{}{attribute}{THEN}\hypertarget{attribute.THEN}{\hyperlink{attribute.THEN}{\mbox{\isa{THEN}}}} & : & \isaratt \\
   2.119 -    \indexdef{}{attribute}{COMP}\hypertarget{attribute.COMP}{\hyperlink{attribute.COMP}{\mbox{\isa{COMP}}}} & : & \isaratt \\[0.5ex]
   2.120 -    \indexdef{}{attribute}{unfolded}\hypertarget{attribute.unfolded}{\hyperlink{attribute.unfolded}{\mbox{\isa{unfolded}}}} & : & \isaratt \\
   2.121 -    \indexdef{}{attribute}{folded}\hypertarget{attribute.folded}{\hyperlink{attribute.folded}{\mbox{\isa{folded}}}} & : & \isaratt \\[0.5ex]
   2.122 -    \indexdef{}{attribute}{rotated}\hypertarget{attribute.rotated}{\hyperlink{attribute.rotated}{\mbox{\isa{rotated}}}} & : & \isaratt \\
   2.123 -    \indexdef{Pure}{attribute}{elim\_format}\hypertarget{attribute.Pure.elim-format}{\hyperlink{attribute.Pure.elim-format}{\mbox{\isa{elim{\isacharunderscore}format}}}} & : & \isaratt \\
   2.124 -    \indexdef{}{attribute}{standard}\hypertarget{attribute.standard}{\hyperlink{attribute.standard}{\mbox{\isa{standard}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isaratt \\
   2.125 -    \indexdef{}{attribute}{no\_vars}\hypertarget{attribute.no-vars}{\hyperlink{attribute.no-vars}{\mbox{\isa{no{\isacharunderscore}vars}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isaratt \\
   2.126 +    \indexdef{}{attribute}{tagged}\hypertarget{attribute.tagged}{\hyperlink{attribute.tagged}{\mbox{\isa{tagged}}}} & : & \isa{attribute} \\
   2.127 +    \indexdef{}{attribute}{untagged}\hypertarget{attribute.untagged}{\hyperlink{attribute.untagged}{\mbox{\isa{untagged}}}} & : & \isa{attribute} \\[0.5ex]
   2.128 +    \indexdef{}{attribute}{THEN}\hypertarget{attribute.THEN}{\hyperlink{attribute.THEN}{\mbox{\isa{THEN}}}} & : & \isa{attribute} \\
   2.129 +    \indexdef{}{attribute}{COMP}\hypertarget{attribute.COMP}{\hyperlink{attribute.COMP}{\mbox{\isa{COMP}}}} & : & \isa{attribute} \\[0.5ex]
   2.130 +    \indexdef{}{attribute}{unfolded}\hypertarget{attribute.unfolded}{\hyperlink{attribute.unfolded}{\mbox{\isa{unfolded}}}} & : & \isa{attribute} \\
   2.131 +    \indexdef{}{attribute}{folded}\hypertarget{attribute.folded}{\hyperlink{attribute.folded}{\mbox{\isa{folded}}}} & : & \isa{attribute} \\[0.5ex]
   2.132 +    \indexdef{}{attribute}{rotated}\hypertarget{attribute.rotated}{\hyperlink{attribute.rotated}{\mbox{\isa{rotated}}}} & : & \isa{attribute} \\
   2.133 +    \indexdef{Pure}{attribute}{elim\_format}\hypertarget{attribute.Pure.elim-format}{\hyperlink{attribute.Pure.elim-format}{\mbox{\isa{elim{\isacharunderscore}format}}}} & : & \isa{attribute} \\
   2.134 +    \indexdef{}{attribute}{standard}\hypertarget{attribute.standard}{\hyperlink{attribute.standard}{\mbox{\isa{standard}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{attribute} \\
   2.135 +    \indexdef{}{attribute}{no\_vars}\hypertarget{attribute.no-vars}{\hyperlink{attribute.no-vars}{\mbox{\isa{no{\isacharunderscore}vars}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{attribute} \\
   2.136    \end{matharray}
   2.137  
   2.138    \begin{rail}
   2.139 -    'tagged' nameref
   2.140 +    'tagged' name name
   2.141      ;
   2.142      'untagged' name
   2.143      ;
   2.144 @@ -151,43 +151,41 @@
   2.145      'rotated' ( int )?
   2.146    \end{rail}
   2.147  
   2.148 -  \begin{descr}
   2.149 +  \begin{description}
   2.150  
   2.151 -  \item [\hyperlink{attribute.tagged}{\mbox{\isa{tagged}}}~\isa{{\isachardoublequote}name\ arg{\isachardoublequote}} and \hyperlink{attribute.untagged}{\mbox{\isa{untagged}}}~\isa{name}] add and remove \emph{tags} of some theorem.
   2.152 +  \item \hyperlink{attribute.tagged}{\mbox{\isa{tagged}}}~\isa{{\isachardoublequote}name\ value{\isachardoublequote}} and \hyperlink{attribute.untagged}{\mbox{\isa{untagged}}}~\isa{name} add and remove \emph{tags} of some theorem.
   2.153    Tags may be any list of string pairs that serve as formal comment.
   2.154 -  The first string is considered the tag name, the second its
   2.155 -  argument.  Note that \hyperlink{attribute.untagged}{\mbox{\isa{untagged}}} removes any tags of the
   2.156 -  same name.
   2.157 +  The first string is considered the tag name, the second its value.
   2.158 +  Note that \hyperlink{attribute.untagged}{\mbox{\isa{untagged}}} removes any tags of the same name.
   2.159  
   2.160 -  \item [\hyperlink{attribute.THEN}{\mbox{\isa{THEN}}}~\isa{a} and \hyperlink{attribute.COMP}{\mbox{\isa{COMP}}}~\isa{a}]
   2.161 +  \item \hyperlink{attribute.THEN}{\mbox{\isa{THEN}}}~\isa{a} and \hyperlink{attribute.COMP}{\mbox{\isa{COMP}}}~\isa{a}
   2.162    compose rules by resolution.  \hyperlink{attribute.THEN}{\mbox{\isa{THEN}}} resolves with the
   2.163    first premise of \isa{a} (an alternative position may be also
   2.164    specified); the \hyperlink{attribute.COMP}{\mbox{\isa{COMP}}} version skips the automatic
   2.165 -  lifting process that is normally intended (cf.\ \verb|"op RS"| and
   2.166 -  \verb|"op COMP"| in \cite[\S5]{isabelle-ref}).
   2.167 +  lifting process that is normally intended (cf.\ \verb|op RS| and \verb|op COMP| in
   2.168 +  \cite[\S5]{isabelle-ref}).
   2.169    
   2.170 -  \item [\hyperlink{attribute.unfolded}{\mbox{\isa{unfolded}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} and
   2.171 -  \hyperlink{attribute.folded}{\mbox{\isa{folded}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] expand and fold
   2.172 -  back again the given definitions throughout a rule.
   2.173 +  \item \hyperlink{attribute.unfolded}{\mbox{\isa{unfolded}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} and \hyperlink{attribute.folded}{\mbox{\isa{folded}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} expand and fold back again the given
   2.174 +  definitions throughout a rule.
   2.175  
   2.176 -  \item [\hyperlink{attribute.rotated}{\mbox{\isa{rotated}}}~\isa{n}] rotate the premises of a
   2.177 +  \item \hyperlink{attribute.rotated}{\mbox{\isa{rotated}}}~\isa{n} rotate the premises of a
   2.178    theorem by \isa{n} (default 1).
   2.179  
   2.180 -  \item [\hyperlink{attribute.Pure.elim-format}{\mbox{\isa{elim{\isacharunderscore}format}}}] turns a destruction rule
   2.181 -  into elimination rule format, by resolving with the rule \isa{{\isachardoublequote}PROP\ A\ {\isasymLongrightarrow}\ {\isacharparenleft}PROP\ A\ {\isasymLongrightarrow}\ PROP\ B{\isacharparenright}\ {\isasymLongrightarrow}\ PROP\ B{\isachardoublequote}}.
   2.182 +  \item \hyperlink{attribute.Pure.elim-format}{\mbox{\isa{elim{\isacharunderscore}format}}} turns a destruction rule into
   2.183 +  elimination rule format, by resolving with the rule \isa{{\isachardoublequote}PROP\ A\ {\isasymLongrightarrow}\ {\isacharparenleft}PROP\ A\ {\isasymLongrightarrow}\ PROP\ B{\isacharparenright}\ {\isasymLongrightarrow}\ PROP\ B{\isachardoublequote}}.
   2.184    
   2.185    Note that the Classical Reasoner (\secref{sec:classical}) provides
   2.186    its own version of this operation.
   2.187  
   2.188 -  \item [\hyperlink{attribute.standard}{\mbox{\isa{standard}}}] puts a theorem into the standard form
   2.189 -  of object-rules at the outermost theory level.  Note that this
   2.190 +  \item \hyperlink{attribute.standard}{\mbox{\isa{standard}}} puts a theorem into the standard form of
   2.191 +  object-rules at the outermost theory level.  Note that this
   2.192    operation violates the local proof context (including active
   2.193    locales).
   2.194  
   2.195 -  \item [\hyperlink{attribute.no-vars}{\mbox{\isa{no{\isacharunderscore}vars}}}] replaces schematic variables by free
   2.196 +  \item \hyperlink{attribute.no-vars}{\mbox{\isa{no{\isacharunderscore}vars}}} replaces schematic variables by free
   2.197    ones; this is mainly for tuning output of pretty printed theorems.
   2.198  
   2.199 -  \end{descr}%
   2.200 +  \end{description}%
   2.201  \end{isamarkuptext}%
   2.202  \isamarkuptrue%
   2.203  %
   2.204 @@ -197,9 +195,9 @@
   2.205  %
   2.206  \begin{isamarkuptext}%
   2.207  \begin{matharray}{rcl}
   2.208 -    \indexdef{}{method}{subst}\hypertarget{method.subst}{\hyperlink{method.subst}{\mbox{\isa{subst}}}} & : & \isarmeth \\
   2.209 -    \indexdef{}{method}{hypsubst}\hypertarget{method.hypsubst}{\hyperlink{method.hypsubst}{\mbox{\isa{hypsubst}}}} & : & \isarmeth \\
   2.210 -    \indexdef{}{method}{split}\hypertarget{method.split}{\hyperlink{method.split}{\mbox{\isa{split}}}} & : & \isarmeth \\
   2.211 +    \indexdef{}{method}{subst}\hypertarget{method.subst}{\hyperlink{method.subst}{\mbox{\isa{subst}}}} & : & \isa{method} \\
   2.212 +    \indexdef{}{method}{hypsubst}\hypertarget{method.hypsubst}{\hyperlink{method.hypsubst}{\mbox{\isa{hypsubst}}}} & : & \isa{method} \\
   2.213 +    \indexdef{}{method}{split}\hypertarget{method.split}{\hyperlink{method.split}{\mbox{\isa{split}}}} & : & \isa{method} \\
   2.214    \end{matharray}
   2.215  
   2.216    \begin{rail}
   2.217 @@ -216,46 +214,46 @@
   2.218    provide the canonical way for automated normalization (see
   2.219    \secref{sec:simplifier}).
   2.220  
   2.221 -  \begin{descr}
   2.222 +  \begin{description}
   2.223  
   2.224 -  \item [\hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{eq}] performs a single substitution
   2.225 -  step using rule \isa{eq}, which may be either a meta or object
   2.226 +  \item \hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{eq} performs a single substitution step
   2.227 +  using rule \isa{eq}, which may be either a meta or object
   2.228    equality.
   2.229  
   2.230 -  \item [\hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{{\isachardoublequote}{\isacharparenleft}asm{\isacharparenright}\ eq{\isachardoublequote}}] substitutes in an
   2.231 +  \item \hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{{\isachardoublequote}{\isacharparenleft}asm{\isacharparenright}\ eq{\isachardoublequote}} substitutes in an
   2.232    assumption.
   2.233  
   2.234 -  \item [\hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{{\isachardoublequote}{\isacharparenleft}i\ {\isasymdots}\ j{\isacharparenright}\ eq{\isachardoublequote}}] performs several
   2.235 +  \item \hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{{\isachardoublequote}{\isacharparenleft}i\ {\isasymdots}\ j{\isacharparenright}\ eq{\isachardoublequote}} performs several
   2.236    substitutions in the conclusion. The numbers \isa{i} to \isa{j}
   2.237    indicate the positions to substitute at.  Positions are ordered from
   2.238    the top of the term tree moving down from left to right. For
   2.239    example, in \isa{{\isachardoublequote}{\isacharparenleft}a\ {\isacharplus}\ b{\isacharparenright}\ {\isacharplus}\ {\isacharparenleft}c\ {\isacharplus}\ d{\isacharparenright}{\isachardoublequote}} there are three positions
   2.240 -  where commutativity of \isa{{\isachardoublequote}{\isacharplus}{\isachardoublequote}} is applicable: 1 refers to
   2.241 -  \isa{{\isachardoublequote}a\ {\isacharplus}\ b{\isachardoublequote}}, 2 to the whole term, and 3 to \isa{{\isachardoublequote}c\ {\isacharplus}\ d{\isachardoublequote}}.
   2.242 +  where commutativity of \isa{{\isachardoublequote}{\isacharplus}{\isachardoublequote}} is applicable: 1 refers to \isa{{\isachardoublequote}a\ {\isacharplus}\ b{\isachardoublequote}}, 2 to the whole term, and 3 to \isa{{\isachardoublequote}c\ {\isacharplus}\ d{\isachardoublequote}}.
   2.243  
   2.244    If the positions in the list \isa{{\isachardoublequote}{\isacharparenleft}i\ {\isasymdots}\ j{\isacharparenright}{\isachardoublequote}} are non-overlapping
   2.245    (e.g.\ \isa{{\isachardoublequote}{\isacharparenleft}{\isadigit{2}}\ {\isadigit{3}}{\isacharparenright}{\isachardoublequote}} in \isa{{\isachardoublequote}{\isacharparenleft}a\ {\isacharplus}\ b{\isacharparenright}\ {\isacharplus}\ {\isacharparenleft}c\ {\isacharplus}\ d{\isacharparenright}{\isachardoublequote}}) you may
   2.246    assume all substitutions are performed simultaneously.  Otherwise
   2.247    the behaviour of \isa{subst} is not specified.
   2.248  
   2.249 -  \item [\hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{{\isachardoublequote}{\isacharparenleft}asm{\isacharparenright}\ {\isacharparenleft}i\ {\isasymdots}\ j{\isacharparenright}\ eq{\isachardoublequote}}] performs the
   2.250 +  \item \hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{{\isachardoublequote}{\isacharparenleft}asm{\isacharparenright}\ {\isacharparenleft}i\ {\isasymdots}\ j{\isacharparenright}\ eq{\isachardoublequote}} performs the
   2.251    substitutions in the assumptions. The positions refer to the
   2.252    assumptions in order from left to right.  For example, given in a
   2.253    goal of the form \isa{{\isachardoublequote}P\ {\isacharparenleft}a\ {\isacharplus}\ b{\isacharparenright}\ {\isasymLongrightarrow}\ P\ {\isacharparenleft}c\ {\isacharplus}\ d{\isacharparenright}\ {\isasymLongrightarrow}\ {\isasymdots}{\isachardoublequote}}, position 1 of
   2.254    commutativity of \isa{{\isachardoublequote}{\isacharplus}{\isachardoublequote}} is the subterm \isa{{\isachardoublequote}a\ {\isacharplus}\ b{\isachardoublequote}} and
   2.255    position 2 is the subterm \isa{{\isachardoublequote}c\ {\isacharplus}\ d{\isachardoublequote}}.
   2.256  
   2.257 -  \item [\hyperlink{method.hypsubst}{\mbox{\isa{hypsubst}}}] performs substitution using some
   2.258 +  \item \hyperlink{method.hypsubst}{\mbox{\isa{hypsubst}}} performs substitution using some
   2.259    assumption; this only works for equations of the form \isa{{\isachardoublequote}x\ {\isacharequal}\ t{\isachardoublequote}} where \isa{x} is a free or bound variable.
   2.260  
   2.261 -  \item [\hyperlink{method.split}{\mbox{\isa{split}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] performs
   2.262 -  single-step case splitting using the given rules.  By default,
   2.263 -  splitting is performed in the conclusion of a goal; the \isa{{\isachardoublequote}{\isacharparenleft}asm{\isacharparenright}{\isachardoublequote}} option indicates to operate on assumptions instead.
   2.264 +  \item \hyperlink{method.split}{\mbox{\isa{split}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} performs single-step case
   2.265 +  splitting using the given rules.  By default, splitting is performed
   2.266 +  in the conclusion of a goal; the \isa{{\isachardoublequote}{\isacharparenleft}asm{\isacharparenright}{\isachardoublequote}} option indicates to
   2.267 +  operate on assumptions instead.
   2.268    
   2.269    Note that the \hyperlink{method.simp}{\mbox{\isa{simp}}} method already involves repeated
   2.270    application of split rules as declared in the current context.
   2.271  
   2.272 -  \end{descr}%
   2.273 +  \end{description}%
   2.274  \end{isamarkuptext}%
   2.275  \isamarkuptrue%
   2.276  %
   2.277 @@ -292,17 +290,17 @@
   2.278    \secref{sec:pure-meth-att}).
   2.279  
   2.280    \begin{matharray}{rcl}
   2.281 -    \indexdef{}{method}{rule\_tac}\hypertarget{method.rule-tac}{\hyperlink{method.rule-tac}{\mbox{\isa{rule{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.282 -    \indexdef{}{method}{erule\_tac}\hypertarget{method.erule-tac}{\hyperlink{method.erule-tac}{\mbox{\isa{erule{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.283 -    \indexdef{}{method}{drule\_tac}\hypertarget{method.drule-tac}{\hyperlink{method.drule-tac}{\mbox{\isa{drule{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.284 -    \indexdef{}{method}{frule\_tac}\hypertarget{method.frule-tac}{\hyperlink{method.frule-tac}{\mbox{\isa{frule{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.285 -    \indexdef{}{method}{cut\_tac}\hypertarget{method.cut-tac}{\hyperlink{method.cut-tac}{\mbox{\isa{cut{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.286 -    \indexdef{}{method}{thin\_tac}\hypertarget{method.thin-tac}{\hyperlink{method.thin-tac}{\mbox{\isa{thin{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.287 -    \indexdef{}{method}{subgoal\_tac}\hypertarget{method.subgoal-tac}{\hyperlink{method.subgoal-tac}{\mbox{\isa{subgoal{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.288 -    \indexdef{}{method}{rename\_tac}\hypertarget{method.rename-tac}{\hyperlink{method.rename-tac}{\mbox{\isa{rename{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.289 -    \indexdef{}{method}{rotate\_tac}\hypertarget{method.rotate-tac}{\hyperlink{method.rotate-tac}{\mbox{\isa{rotate{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.290 -    \indexdef{}{method}{tactic}\hypertarget{method.tactic}{\hyperlink{method.tactic}{\mbox{\isa{tactic}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.291 -    \indexdef{}{method}{raw\_tactic}\hypertarget{method.raw-tactic}{\hyperlink{method.raw-tactic}{\mbox{\isa{raw{\isacharunderscore}tactic}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   2.292 +    \indexdef{}{method}{rule\_tac}\hypertarget{method.rule-tac}{\hyperlink{method.rule-tac}{\mbox{\isa{rule{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.293 +    \indexdef{}{method}{erule\_tac}\hypertarget{method.erule-tac}{\hyperlink{method.erule-tac}{\mbox{\isa{erule{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.294 +    \indexdef{}{method}{drule\_tac}\hypertarget{method.drule-tac}{\hyperlink{method.drule-tac}{\mbox{\isa{drule{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.295 +    \indexdef{}{method}{frule\_tac}\hypertarget{method.frule-tac}{\hyperlink{method.frule-tac}{\mbox{\isa{frule{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.296 +    \indexdef{}{method}{cut\_tac}\hypertarget{method.cut-tac}{\hyperlink{method.cut-tac}{\mbox{\isa{cut{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.297 +    \indexdef{}{method}{thin\_tac}\hypertarget{method.thin-tac}{\hyperlink{method.thin-tac}{\mbox{\isa{thin{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.298 +    \indexdef{}{method}{subgoal\_tac}\hypertarget{method.subgoal-tac}{\hyperlink{method.subgoal-tac}{\mbox{\isa{subgoal{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.299 +    \indexdef{}{method}{rename\_tac}\hypertarget{method.rename-tac}{\hyperlink{method.rename-tac}{\mbox{\isa{rename{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.300 +    \indexdef{}{method}{rotate\_tac}\hypertarget{method.rotate-tac}{\hyperlink{method.rotate-tac}{\mbox{\isa{rotate{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.301 +    \indexdef{}{method}{tactic}\hypertarget{method.tactic}{\hyperlink{method.tactic}{\mbox{\isa{tactic}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.302 +    \indexdef{}{method}{raw\_tactic}\hypertarget{method.raw-tactic}{\hyperlink{method.raw-tactic}{\mbox{\isa{raw{\isacharunderscore}tactic}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   2.303    \end{matharray}
   2.304  
   2.305    \begin{rail}
   2.306 @@ -322,53 +320,53 @@
   2.307      ;
   2.308    \end{rail}
   2.309  
   2.310 -\begin{descr}
   2.311 +\begin{description}
   2.312  
   2.313 -  \item [\hyperlink{method.rule-tac}{\mbox{\isa{rule{\isacharunderscore}tac}}} etc.] do resolution of rules with explicit
   2.314 +  \item \hyperlink{method.rule-tac}{\mbox{\isa{rule{\isacharunderscore}tac}}} etc. do resolution of rules with explicit
   2.315    instantiation.  This works the same way as the ML tactics \verb|res_inst_tac| etc. (see \cite[\S3]{isabelle-ref})
   2.316  
   2.317    Multiple rules may be only given if there is no instantiation; then
   2.318    \hyperlink{method.rule-tac}{\mbox{\isa{rule{\isacharunderscore}tac}}} is the same as \verb|resolve_tac| in ML (see
   2.319    \cite[\S3]{isabelle-ref}).
   2.320  
   2.321 -  \item [\hyperlink{method.cut-tac}{\mbox{\isa{cut{\isacharunderscore}tac}}}] inserts facts into the proof state as
   2.322 +  \item \hyperlink{method.cut-tac}{\mbox{\isa{cut{\isacharunderscore}tac}}} inserts facts into the proof state as
   2.323    assumption of a subgoal, see also \verb|Tactic.cut_facts_tac| in
   2.324    \cite[\S3]{isabelle-ref}.  Note that the scope of schematic
   2.325    variables is spread over the main goal statement.  Instantiations
   2.326 -  may be given as well, see also ML tactic \verb|cut_inst_tac|
   2.327 -  in \cite[\S3]{isabelle-ref}.
   2.328 -
   2.329 -  \item [\hyperlink{method.thin-tac}{\mbox{\isa{thin{\isacharunderscore}tac}}}~\isa{{\isasymphi}}] deletes the specified
   2.330 -  assumption from a subgoal; note that \isa{{\isasymphi}} may contain schematic
   2.331 -  variables.  See also \verb|thin_tac| in
   2.332 +  may be given as well, see also ML tactic \verb|cut_inst_tac| in
   2.333    \cite[\S3]{isabelle-ref}.
   2.334  
   2.335 -  \item [\hyperlink{method.subgoal-tac}{\mbox{\isa{subgoal{\isacharunderscore}tac}}}~\isa{{\isasymphi}}] adds \isa{{\isasymphi}} as an
   2.336 +  \item \hyperlink{method.thin-tac}{\mbox{\isa{thin{\isacharunderscore}tac}}}~\isa{{\isasymphi}} deletes the specified assumption
   2.337 +  from a subgoal; note that \isa{{\isasymphi}} may contain schematic variables.
   2.338 +  See also \verb|thin_tac| in \cite[\S3]{isabelle-ref}.
   2.339 +
   2.340 +  \item \hyperlink{method.subgoal-tac}{\mbox{\isa{subgoal{\isacharunderscore}tac}}}~\isa{{\isasymphi}} adds \isa{{\isasymphi}} as an
   2.341    assumption to a subgoal.  See also \verb|subgoal_tac| and \verb|subgoals_tac| in \cite[\S3]{isabelle-ref}.
   2.342  
   2.343 -  \item [\hyperlink{method.rename-tac}{\mbox{\isa{rename{\isacharunderscore}tac}}}~\isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub n{\isachardoublequote}}] renames
   2.344 -  parameters of a goal according to the list \isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ x\isactrlsub n{\isachardoublequote}}, which refers to the \emph{suffix} of variables.
   2.345 +  \item \hyperlink{method.rename-tac}{\mbox{\isa{rename{\isacharunderscore}tac}}}~\isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub n{\isachardoublequote}} renames parameters of a
   2.346 +  goal according to the list \isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ x\isactrlsub n{\isachardoublequote}}, which refers to the
   2.347 +  \emph{suffix} of variables.
   2.348  
   2.349 -  \item [\hyperlink{method.rotate-tac}{\mbox{\isa{rotate{\isacharunderscore}tac}}}~\isa{n}] rotates the assumptions of a
   2.350 +  \item \hyperlink{method.rotate-tac}{\mbox{\isa{rotate{\isacharunderscore}tac}}}~\isa{n} rotates the assumptions of a
   2.351    goal by \isa{n} positions: from right to left if \isa{n} is
   2.352    positive, and from left to right if \isa{n} is negative; the
   2.353    default value is 1.  See also \verb|rotate_tac| in
   2.354    \cite[\S3]{isabelle-ref}.
   2.355  
   2.356 -  \item [\hyperlink{method.tactic}{\mbox{\isa{tactic}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] produces a proof method from
   2.357 +  \item \hyperlink{method.tactic}{\mbox{\isa{tactic}}}~\isa{{\isachardoublequote}text{\isachardoublequote}} produces a proof method from
   2.358    any ML text of type \verb|tactic|.  Apart from the usual ML
   2.359    environment and the current proof context, the ML code may refer to
   2.360    the locally bound values \verb|facts|, which indicates any
   2.361    current facts used for forward-chaining.
   2.362  
   2.363 -  \item [\hyperlink{method.raw-tactic}{\mbox{\isa{raw{\isacharunderscore}tactic}}}] is similar to \hyperlink{method.tactic}{\mbox{\isa{tactic}}}, but
   2.364 +  \item \hyperlink{method.raw-tactic}{\mbox{\isa{raw{\isacharunderscore}tactic}}} is similar to \hyperlink{method.tactic}{\mbox{\isa{tactic}}}, but
   2.365    presents the goal state in its raw internal form, where simultaneous
   2.366    subgoals appear as conjunction of the logical framework instead of
   2.367    the usual split into several subgoals.  While feature this is useful
   2.368    for debugging of complex method definitions, it should not never
   2.369    appear in production theories.
   2.370  
   2.371 -  \end{descr}%
   2.372 +  \end{description}%
   2.373  \end{isamarkuptext}%
   2.374  \isamarkuptrue%
   2.375  %
   2.376 @@ -382,8 +380,8 @@
   2.377  %
   2.378  \begin{isamarkuptext}%
   2.379  \begin{matharray}{rcl}
   2.380 -    \indexdef{}{method}{simp}\hypertarget{method.simp}{\hyperlink{method.simp}{\mbox{\isa{simp}}}} & : & \isarmeth \\
   2.381 -    \indexdef{}{method}{simp\_all}\hypertarget{method.simp-all}{\hyperlink{method.simp-all}{\mbox{\isa{simp{\isacharunderscore}all}}}} & : & \isarmeth \\
   2.382 +    \indexdef{}{method}{simp}\hypertarget{method.simp}{\hyperlink{method.simp}{\mbox{\isa{simp}}}} & : & \isa{method} \\
   2.383 +    \indexdef{}{method}{simp\_all}\hypertarget{method.simp-all}{\hyperlink{method.simp-all}{\mbox{\isa{simp{\isacharunderscore}all}}}} & : & \isa{method} \\
   2.384    \end{matharray}
   2.385  
   2.386    \indexouternonterm{simpmod}
   2.387 @@ -398,9 +396,9 @@
   2.388      ;
   2.389    \end{rail}
   2.390  
   2.391 -  \begin{descr}
   2.392 +  \begin{description}
   2.393  
   2.394 -  \item [\hyperlink{method.simp}{\mbox{\isa{simp}}}] invokes the Simplifier, after declaring
   2.395 +  \item \hyperlink{method.simp}{\mbox{\isa{simp}}} invokes the Simplifier, after declaring
   2.396    additional rules according to the arguments given.  Note that the
   2.397    \railtterm{only} modifier first removes all other rewrite rules,
   2.398    congruences, and looper tactics (including splits), and then behaves
   2.399 @@ -416,10 +414,10 @@
   2.400    include the Splitter (all major object logics such HOL, HOLCF, FOL,
   2.401    ZF do this already).
   2.402  
   2.403 -  \item [\hyperlink{method.simp-all}{\mbox{\isa{simp{\isacharunderscore}all}}}] is similar to \hyperlink{method.simp}{\mbox{\isa{simp}}}, but acts on
   2.404 +  \item \hyperlink{method.simp-all}{\mbox{\isa{simp{\isacharunderscore}all}}} is similar to \hyperlink{method.simp}{\mbox{\isa{simp}}}, but acts on
   2.405    all goals (backwards from the last to the first one).
   2.406  
   2.407 -  \end{descr}
   2.408 +  \end{description}
   2.409  
   2.410    By default the Simplifier methods take local assumptions fully into
   2.411    account, using equational assumptions in the subsequent
   2.412 @@ -457,10 +455,10 @@
   2.413  %
   2.414  \begin{isamarkuptext}%
   2.415  \begin{matharray}{rcl}
   2.416 -    \indexdef{}{command}{print\_simpset}\hypertarget{command.print-simpset}{\hyperlink{command.print-simpset}{\mbox{\isa{\isacommand{print{\isacharunderscore}simpset}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   2.417 -    \indexdef{}{attribute}{simp}\hypertarget{attribute.simp}{\hyperlink{attribute.simp}{\mbox{\isa{simp}}}} & : & \isaratt \\
   2.418 -    \indexdef{}{attribute}{cong}\hypertarget{attribute.cong}{\hyperlink{attribute.cong}{\mbox{\isa{cong}}}} & : & \isaratt \\
   2.419 -    \indexdef{}{attribute}{split}\hypertarget{attribute.split}{\hyperlink{attribute.split}{\mbox{\isa{split}}}} & : & \isaratt \\
   2.420 +    \indexdef{}{command}{print\_simpset}\hypertarget{command.print-simpset}{\hyperlink{command.print-simpset}{\mbox{\isa{\isacommand{print{\isacharunderscore}simpset}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   2.421 +    \indexdef{}{attribute}{simp}\hypertarget{attribute.simp}{\hyperlink{attribute.simp}{\mbox{\isa{simp}}}} & : & \isa{attribute} \\
   2.422 +    \indexdef{}{attribute}{cong}\hypertarget{attribute.cong}{\hyperlink{attribute.cong}{\mbox{\isa{cong}}}} & : & \isa{attribute} \\
   2.423 +    \indexdef{}{attribute}{split}\hypertarget{attribute.split}{\hyperlink{attribute.split}{\mbox{\isa{split}}}} & : & \isa{attribute} \\
   2.424    \end{matharray}
   2.425  
   2.426    \begin{rail}
   2.427 @@ -468,19 +466,19 @@
   2.428      ;
   2.429    \end{rail}
   2.430  
   2.431 -  \begin{descr}
   2.432 +  \begin{description}
   2.433  
   2.434 -  \item [\hyperlink{command.print-simpset}{\mbox{\isa{\isacommand{print{\isacharunderscore}simpset}}}}] prints the collection of rules
   2.435 +  \item \hyperlink{command.print-simpset}{\mbox{\isa{\isacommand{print{\isacharunderscore}simpset}}}} prints the collection of rules
   2.436    declared to the Simplifier, which is also known as ``simpset''
   2.437    internally \cite{isabelle-ref}.
   2.438  
   2.439 -  \item [\hyperlink{attribute.simp}{\mbox{\isa{simp}}}] declares simplification rules.
   2.440 +  \item \hyperlink{attribute.simp}{\mbox{\isa{simp}}} declares simplification rules.
   2.441  
   2.442 -  \item [\hyperlink{attribute.cong}{\mbox{\isa{cong}}}] declares congruence rules.
   2.443 +  \item \hyperlink{attribute.cong}{\mbox{\isa{cong}}} declares congruence rules.
   2.444  
   2.445 -  \item [\hyperlink{attribute.split}{\mbox{\isa{split}}}] declares case split rules.
   2.446 +  \item \hyperlink{attribute.split}{\mbox{\isa{split}}} declares case split rules.
   2.447  
   2.448 -  \end{descr}%
   2.449 +  \end{description}%
   2.450  \end{isamarkuptext}%
   2.451  \isamarkuptrue%
   2.452  %
   2.453 @@ -490,8 +488,8 @@
   2.454  %
   2.455  \begin{isamarkuptext}%
   2.456  \begin{matharray}{rcl}
   2.457 -    \indexdef{}{command}{simproc\_setup}\hypertarget{command.simproc-setup}{\hyperlink{command.simproc-setup}{\mbox{\isa{\isacommand{simproc{\isacharunderscore}setup}}}}} & : & \isarkeep{local{\dsh}theory} \\
   2.458 -    simproc & : & \isaratt \\
   2.459 +    \indexdef{}{command}{simproc\_setup}\hypertarget{command.simproc-setup}{\hyperlink{command.simproc-setup}{\mbox{\isa{\isacommand{simproc{\isacharunderscore}setup}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   2.460 +    simproc & : & \isa{attribute} \\
   2.461    \end{matharray}
   2.462  
   2.463    \begin{rail}
   2.464 @@ -502,9 +500,9 @@
   2.465      ;
   2.466    \end{rail}
   2.467  
   2.468 -  \begin{descr}
   2.469 +  \begin{description}
   2.470  
   2.471 -  \item [\hyperlink{command.simproc-setup}{\mbox{\isa{\isacommand{simproc{\isacharunderscore}setup}}}}] defines a named simplification
   2.472 +  \item \hyperlink{command.simproc-setup}{\mbox{\isa{\isacommand{simproc{\isacharunderscore}setup}}}} defines a named simplification
   2.473    procedure that is invoked by the Simplifier whenever any of the
   2.474    given term patterns match the current redex.  The implementation,
   2.475    which is provided as ML source text, needs to be of type \verb|"morphism -> simpset -> cterm -> thm option"|, where the \verb|cterm| represents the current redex \isa{r} and the result is
   2.476 @@ -521,12 +519,12 @@
   2.477    Morphisms and identifiers are only relevant for simprocs that are
   2.478    defined within a local target context, e.g.\ in a locale.
   2.479  
   2.480 -  \item [\isa{{\isachardoublequote}simproc\ add{\isacharcolon}\ name{\isachardoublequote}} and \isa{{\isachardoublequote}simproc\ del{\isacharcolon}\ name{\isachardoublequote}}]
   2.481 +  \item \isa{{\isachardoublequote}simproc\ add{\isacharcolon}\ name{\isachardoublequote}} and \isa{{\isachardoublequote}simproc\ del{\isacharcolon}\ name{\isachardoublequote}}
   2.482    add or delete named simprocs to the current Simplifier context.  The
   2.483    default is to add a simproc.  Note that \hyperlink{command.simproc-setup}{\mbox{\isa{\isacommand{simproc{\isacharunderscore}setup}}}}
   2.484    already adds the new simproc to the subsequent context.
   2.485  
   2.486 -  \end{descr}%
   2.487 +  \end{description}%
   2.488  \end{isamarkuptext}%
   2.489  \isamarkuptrue%
   2.490  %
   2.491 @@ -536,7 +534,7 @@
   2.492  %
   2.493  \begin{isamarkuptext}%
   2.494  \begin{matharray}{rcl}
   2.495 -    \indexdef{}{attribute}{simplified}\hypertarget{attribute.simplified}{\hyperlink{attribute.simplified}{\mbox{\isa{simplified}}}} & : & \isaratt \\
   2.496 +    \indexdef{}{attribute}{simplified}\hypertarget{attribute.simplified}{\hyperlink{attribute.simplified}{\mbox{\isa{simplified}}}} & : & \isa{attribute} \\
   2.497    \end{matharray}
   2.498  
   2.499    \begin{rail}
   2.500 @@ -547,21 +545,20 @@
   2.501      ;
   2.502    \end{rail}
   2.503  
   2.504 -  \begin{descr}
   2.505 +  \begin{description}
   2.506    
   2.507 -  \item [\hyperlink{attribute.simplified}{\mbox{\isa{simplified}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}]
   2.508 -  causes a theorem to be simplified, either by exactly the specified
   2.509 -  rules \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ a\isactrlsub n{\isachardoublequote}}, or the implicit Simplifier
   2.510 -  context if no arguments are given.  The result is fully simplified
   2.511 -  by default, including assumptions and conclusion; the options \isa{no{\isacharunderscore}asm} etc.\ tune the Simplifier in the same way as the for the
   2.512 -  \isa{simp} method.
   2.513 +  \item \hyperlink{attribute.simplified}{\mbox{\isa{simplified}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} causes a theorem to
   2.514 +  be simplified, either by exactly the specified rules \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ a\isactrlsub n{\isachardoublequote}}, or the implicit Simplifier context if no arguments are given.
   2.515 +  The result is fully simplified by default, including assumptions and
   2.516 +  conclusion; the options \isa{no{\isacharunderscore}asm} etc.\ tune the Simplifier in
   2.517 +  the same way as the for the \isa{simp} method.
   2.518  
   2.519    Note that forward simplification restricts the simplifier to its
   2.520    most basic operation of term rewriting; solver and looper tactics
   2.521    \cite{isabelle-ref} are \emph{not} involved here.  The \isa{simplified} attribute should be only rarely required under normal
   2.522    circumstances.
   2.523  
   2.524 -  \end{descr}%
   2.525 +  \end{description}%
   2.526  \end{isamarkuptext}%
   2.527  \isamarkuptrue%
   2.528  %
   2.529 @@ -575,10 +572,10 @@
   2.530  %
   2.531  \begin{isamarkuptext}%
   2.532  \begin{matharray}{rcl}
   2.533 -    \indexdef{}{method}{rule}\hypertarget{method.rule}{\hyperlink{method.rule}{\mbox{\isa{rule}}}} & : & \isarmeth \\
   2.534 -    \indexdef{}{method}{contradiction}\hypertarget{method.contradiction}{\hyperlink{method.contradiction}{\mbox{\isa{contradiction}}}} & : & \isarmeth \\
   2.535 -    \indexdef{}{method}{intro}\hypertarget{method.intro}{\hyperlink{method.intro}{\mbox{\isa{intro}}}} & : & \isarmeth \\
   2.536 -    \indexdef{}{method}{elim}\hypertarget{method.elim}{\hyperlink{method.elim}{\mbox{\isa{elim}}}} & : & \isarmeth \\
   2.537 +    \indexdef{}{method}{rule}\hypertarget{method.rule}{\hyperlink{method.rule}{\mbox{\isa{rule}}}} & : & \isa{method} \\
   2.538 +    \indexdef{}{method}{contradiction}\hypertarget{method.contradiction}{\hyperlink{method.contradiction}{\mbox{\isa{contradiction}}}} & : & \isa{method} \\
   2.539 +    \indexdef{}{method}{intro}\hypertarget{method.intro}{\hyperlink{method.intro}{\mbox{\isa{intro}}}} & : & \isa{method} \\
   2.540 +    \indexdef{}{method}{elim}\hypertarget{method.elim}{\hyperlink{method.elim}{\mbox{\isa{elim}}}} & : & \isa{method} \\
   2.541    \end{matharray}
   2.542  
   2.543    \begin{rail}
   2.544 @@ -586,9 +583,9 @@
   2.545      ;
   2.546    \end{rail}
   2.547  
   2.548 -  \begin{descr}
   2.549 +  \begin{description}
   2.550  
   2.551 -  \item [\hyperlink{method.rule}{\mbox{\isa{rule}}}] as offered by the Classical Reasoner is a
   2.552 +  \item \hyperlink{method.rule}{\mbox{\isa{rule}}} as offered by the Classical Reasoner is a
   2.553    refinement over the primitive one (see \secref{sec:pure-meth-att}).
   2.554    Both versions essentially work the same, but the classical version
   2.555    observes the classical rule context in addition to that of
   2.556 @@ -599,18 +596,18 @@
   2.557    ones), but only few declarations to the rule context of
   2.558    Isabelle/Pure (\secref{sec:pure-meth-att}).
   2.559  
   2.560 -  \item [\hyperlink{method.contradiction}{\mbox{\isa{contradiction}}}] solves some goal by contradiction,
   2.561 +  \item \hyperlink{method.contradiction}{\mbox{\isa{contradiction}}} solves some goal by contradiction,
   2.562    deriving any result from both \isa{{\isachardoublequote}{\isasymnot}\ A{\isachardoublequote}} and \isa{A}.  Chained
   2.563    facts, which are guaranteed to participate, may appear in either
   2.564    order.
   2.565  
   2.566 -  \item [\hyperlink{method.intro}{\mbox{\isa{intro}}} and \hyperlink{method.elim}{\mbox{\isa{elim}}}] repeatedly refine some
   2.567 -  goal by intro- or elim-resolution, after having inserted any chained
   2.568 +  \item \hyperlink{method.intro}{\mbox{\isa{intro}}} and \hyperlink{method.elim}{\mbox{\isa{elim}}} repeatedly refine some goal
   2.569 +  by intro- or elim-resolution, after having inserted any chained
   2.570    facts.  Exactly the rules given as arguments are taken into account;
   2.571    this allows fine-tuned decomposition of a proof problem, in contrast
   2.572    to common automated tools.
   2.573  
   2.574 -  \end{descr}%
   2.575 +  \end{description}%
   2.576  \end{isamarkuptext}%
   2.577  \isamarkuptrue%
   2.578  %
   2.579 @@ -620,12 +617,12 @@
   2.580  %
   2.581  \begin{isamarkuptext}%
   2.582  \begin{matharray}{rcl}
   2.583 -    \indexdef{}{method}{blast}\hypertarget{method.blast}{\hyperlink{method.blast}{\mbox{\isa{blast}}}} & : & \isarmeth \\
   2.584 -    \indexdef{}{method}{fast}\hypertarget{method.fast}{\hyperlink{method.fast}{\mbox{\isa{fast}}}} & : & \isarmeth \\
   2.585 -    \indexdef{}{method}{slow}\hypertarget{method.slow}{\hyperlink{method.slow}{\mbox{\isa{slow}}}} & : & \isarmeth \\
   2.586 -    \indexdef{}{method}{best}\hypertarget{method.best}{\hyperlink{method.best}{\mbox{\isa{best}}}} & : & \isarmeth \\
   2.587 -    \indexdef{}{method}{safe}\hypertarget{method.safe}{\hyperlink{method.safe}{\mbox{\isa{safe}}}} & : & \isarmeth \\
   2.588 -    \indexdef{}{method}{clarify}\hypertarget{method.clarify}{\hyperlink{method.clarify}{\mbox{\isa{clarify}}}} & : & \isarmeth \\
   2.589 +    \indexdef{}{method}{blast}\hypertarget{method.blast}{\hyperlink{method.blast}{\mbox{\isa{blast}}}} & : & \isa{method} \\
   2.590 +    \indexdef{}{method}{fast}\hypertarget{method.fast}{\hyperlink{method.fast}{\mbox{\isa{fast}}}} & : & \isa{method} \\
   2.591 +    \indexdef{}{method}{slow}\hypertarget{method.slow}{\hyperlink{method.slow}{\mbox{\isa{slow}}}} & : & \isa{method} \\
   2.592 +    \indexdef{}{method}{best}\hypertarget{method.best}{\hyperlink{method.best}{\mbox{\isa{best}}}} & : & \isa{method} \\
   2.593 +    \indexdef{}{method}{safe}\hypertarget{method.safe}{\hyperlink{method.safe}{\mbox{\isa{safe}}}} & : & \isa{method} \\
   2.594 +    \indexdef{}{method}{clarify}\hypertarget{method.clarify}{\hyperlink{method.clarify}{\mbox{\isa{clarify}}}} & : & \isa{method} \\
   2.595    \end{matharray}
   2.596  
   2.597    \indexouternonterm{clamod}
   2.598 @@ -639,17 +636,17 @@
   2.599      ;
   2.600    \end{rail}
   2.601  
   2.602 -  \begin{descr}
   2.603 +  \begin{description}
   2.604  
   2.605 -  \item [\hyperlink{method.blast}{\mbox{\isa{blast}}}] refers to the classical tableau prover (see
   2.606 +  \item \hyperlink{method.blast}{\mbox{\isa{blast}}} refers to the classical tableau prover (see
   2.607    \verb|blast_tac| in \cite[\S11]{isabelle-ref}).  The optional
   2.608    argument specifies a user-supplied search bound (default 20).
   2.609  
   2.610 -  \item [\hyperlink{method.fast}{\mbox{\isa{fast}}}, \hyperlink{method.slow}{\mbox{\isa{slow}}}, \hyperlink{method.best}{\mbox{\isa{best}}}, \hyperlink{method.safe}{\mbox{\isa{safe}}}, and \hyperlink{method.clarify}{\mbox{\isa{clarify}}}] refer to the generic classical
   2.611 +  \item \hyperlink{method.fast}{\mbox{\isa{fast}}}, \hyperlink{method.slow}{\mbox{\isa{slow}}}, \hyperlink{method.best}{\mbox{\isa{best}}}, \hyperlink{method.safe}{\mbox{\isa{safe}}}, and \hyperlink{method.clarify}{\mbox{\isa{clarify}}} refer to the generic classical
   2.612    reasoner.  See \verb|fast_tac|, \verb|slow_tac|, \verb|best_tac|, \verb|safe_tac|, and \verb|clarify_tac| in \cite[\S11]{isabelle-ref} for
   2.613    more information.
   2.614  
   2.615 -  \end{descr}
   2.616 +  \end{description}
   2.617  
   2.618    Any of the above methods support additional modifiers of the context
   2.619    of classical rules.  Their semantics is analogous to the attributes
   2.620 @@ -665,12 +662,12 @@
   2.621  %
   2.622  \begin{isamarkuptext}%
   2.623  \begin{matharray}{rcl}
   2.624 -    \indexdef{}{method}{auto}\hypertarget{method.auto}{\hyperlink{method.auto}{\mbox{\isa{auto}}}} & : & \isarmeth \\
   2.625 -    \indexdef{}{method}{force}\hypertarget{method.force}{\hyperlink{method.force}{\mbox{\isa{force}}}} & : & \isarmeth \\
   2.626 -    \indexdef{}{method}{clarsimp}\hypertarget{method.clarsimp}{\hyperlink{method.clarsimp}{\mbox{\isa{clarsimp}}}} & : & \isarmeth \\
   2.627 -    \indexdef{}{method}{fastsimp}\hypertarget{method.fastsimp}{\hyperlink{method.fastsimp}{\mbox{\isa{fastsimp}}}} & : & \isarmeth \\
   2.628 -    \indexdef{}{method}{slowsimp}\hypertarget{method.slowsimp}{\hyperlink{method.slowsimp}{\mbox{\isa{slowsimp}}}} & : & \isarmeth \\
   2.629 -    \indexdef{}{method}{bestsimp}\hypertarget{method.bestsimp}{\hyperlink{method.bestsimp}{\mbox{\isa{bestsimp}}}} & : & \isarmeth \\
   2.630 +    \indexdef{}{method}{auto}\hypertarget{method.auto}{\hyperlink{method.auto}{\mbox{\isa{auto}}}} & : & \isa{method} \\
   2.631 +    \indexdef{}{method}{force}\hypertarget{method.force}{\hyperlink{method.force}{\mbox{\isa{force}}}} & : & \isa{method} \\
   2.632 +    \indexdef{}{method}{clarsimp}\hypertarget{method.clarsimp}{\hyperlink{method.clarsimp}{\mbox{\isa{clarsimp}}}} & : & \isa{method} \\
   2.633 +    \indexdef{}{method}{fastsimp}\hypertarget{method.fastsimp}{\hyperlink{method.fastsimp}{\mbox{\isa{fastsimp}}}} & : & \isa{method} \\
   2.634 +    \indexdef{}{method}{slowsimp}\hypertarget{method.slowsimp}{\hyperlink{method.slowsimp}{\mbox{\isa{slowsimp}}}} & : & \isa{method} \\
   2.635 +    \indexdef{}{method}{bestsimp}\hypertarget{method.bestsimp}{\hyperlink{method.bestsimp}{\mbox{\isa{bestsimp}}}} & : & \isa{method} \\
   2.636    \end{matharray}
   2.637  
   2.638    \indexouternonterm{clasimpmod}
   2.639 @@ -686,10 +683,10 @@
   2.640        (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del')) ':' thmrefs
   2.641    \end{rail}
   2.642  
   2.643 -  \begin{descr}
   2.644 +  \begin{description}
   2.645  
   2.646 -  \item [\hyperlink{method.auto}{\mbox{\isa{auto}}}, \hyperlink{method.force}{\mbox{\isa{force}}}, \hyperlink{method.clarsimp}{\mbox{\isa{clarsimp}}}, \hyperlink{method.fastsimp}{\mbox{\isa{fastsimp}}}, \hyperlink{method.slowsimp}{\mbox{\isa{slowsimp}}}, and \hyperlink{method.bestsimp}{\mbox{\isa{bestsimp}}}] provide
   2.647 -  access to Isabelle's combined simplification and classical reasoning
   2.648 +  \item \hyperlink{method.auto}{\mbox{\isa{auto}}}, \hyperlink{method.force}{\mbox{\isa{force}}}, \hyperlink{method.clarsimp}{\mbox{\isa{clarsimp}}}, \hyperlink{method.fastsimp}{\mbox{\isa{fastsimp}}}, \hyperlink{method.slowsimp}{\mbox{\isa{slowsimp}}}, and \hyperlink{method.bestsimp}{\mbox{\isa{bestsimp}}} provide access
   2.649 +  to Isabelle's combined simplification and classical reasoning
   2.650    tactics.  These correspond to \verb|auto_tac|, \verb|force_tac|, \verb|clarsimp_tac|, and Classical Reasoner tactics with the Simplifier
   2.651    added as wrapper, see \cite[\S11]{isabelle-ref} for more
   2.652    information.  The modifier arguments correspond to those given in
   2.653 @@ -701,7 +698,7 @@
   2.654    doing the search.  The ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' argument causes the full
   2.655    context of assumptions to be included as well.
   2.656  
   2.657 -  \end{descr}%
   2.658 +  \end{description}%
   2.659  \end{isamarkuptext}%
   2.660  \isamarkuptrue%
   2.661  %
   2.662 @@ -711,12 +708,12 @@
   2.663  %
   2.664  \begin{isamarkuptext}%
   2.665  \begin{matharray}{rcl}
   2.666 -    \indexdef{}{command}{print\_claset}\hypertarget{command.print-claset}{\hyperlink{command.print-claset}{\mbox{\isa{\isacommand{print{\isacharunderscore}claset}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   2.667 -    \indexdef{}{attribute}{intro}\hypertarget{attribute.intro}{\hyperlink{attribute.intro}{\mbox{\isa{intro}}}} & : & \isaratt \\
   2.668 -    \indexdef{}{attribute}{elim}\hypertarget{attribute.elim}{\hyperlink{attribute.elim}{\mbox{\isa{elim}}}} & : & \isaratt \\
   2.669 -    \indexdef{}{attribute}{dest}\hypertarget{attribute.dest}{\hyperlink{attribute.dest}{\mbox{\isa{dest}}}} & : & \isaratt \\
   2.670 -    \indexdef{}{attribute}{rule}\hypertarget{attribute.rule}{\hyperlink{attribute.rule}{\mbox{\isa{rule}}}} & : & \isaratt \\
   2.671 -    \indexdef{}{attribute}{iff}\hypertarget{attribute.iff}{\hyperlink{attribute.iff}{\mbox{\isa{iff}}}} & : & \isaratt \\
   2.672 +    \indexdef{}{command}{print\_claset}\hypertarget{command.print-claset}{\hyperlink{command.print-claset}{\mbox{\isa{\isacommand{print{\isacharunderscore}claset}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   2.673 +    \indexdef{}{attribute}{intro}\hypertarget{attribute.intro}{\hyperlink{attribute.intro}{\mbox{\isa{intro}}}} & : & \isa{attribute} \\
   2.674 +    \indexdef{}{attribute}{elim}\hypertarget{attribute.elim}{\hyperlink{attribute.elim}{\mbox{\isa{elim}}}} & : & \isa{attribute} \\
   2.675 +    \indexdef{}{attribute}{dest}\hypertarget{attribute.dest}{\hyperlink{attribute.dest}{\mbox{\isa{dest}}}} & : & \isa{attribute} \\
   2.676 +    \indexdef{}{attribute}{rule}\hypertarget{attribute.rule}{\hyperlink{attribute.rule}{\mbox{\isa{rule}}}} & : & \isa{attribute} \\
   2.677 +    \indexdef{}{attribute}{iff}\hypertarget{attribute.iff}{\hyperlink{attribute.iff}{\mbox{\isa{iff}}}} & : & \isa{attribute} \\
   2.678    \end{matharray}
   2.679  
   2.680    \begin{rail}
   2.681 @@ -728,13 +725,13 @@
   2.682      ;
   2.683    \end{rail}
   2.684  
   2.685 -  \begin{descr}
   2.686 +  \begin{description}
   2.687  
   2.688 -  \item [\hyperlink{command.print-claset}{\mbox{\isa{\isacommand{print{\isacharunderscore}claset}}}}] prints the collection of rules
   2.689 +  \item \hyperlink{command.print-claset}{\mbox{\isa{\isacommand{print{\isacharunderscore}claset}}}} prints the collection of rules
   2.690    declared to the Classical Reasoner, which is also known as
   2.691    ``claset'' internally \cite{isabelle-ref}.
   2.692    
   2.693 -  \item [\hyperlink{attribute.intro}{\mbox{\isa{intro}}}, \hyperlink{attribute.elim}{\mbox{\isa{elim}}}, and \hyperlink{attribute.dest}{\mbox{\isa{dest}}}]
   2.694 +  \item \hyperlink{attribute.intro}{\mbox{\isa{intro}}}, \hyperlink{attribute.elim}{\mbox{\isa{elim}}}, and \hyperlink{attribute.dest}{\mbox{\isa{dest}}}
   2.695    declare introduction, elimination, and destruction rules,
   2.696    respectively.  By default, rules are considered as \emph{unsafe}
   2.697    (i.e.\ not applied blindly without backtracking), while ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' classifies as \emph{safe}.  Rule declarations marked by
   2.698 @@ -744,10 +741,10 @@
   2.699    specifies an explicit weight argument, which is ignored by automated
   2.700    tools, but determines the search order of single rule steps.
   2.701  
   2.702 -  \item [\hyperlink{attribute.rule}{\mbox{\isa{rule}}}~\isa{del}] deletes introduction,
   2.703 +  \item \hyperlink{attribute.rule}{\mbox{\isa{rule}}}~\isa{del} deletes introduction,
   2.704    elimination, or destruction rules from the context.
   2.705  
   2.706 -  \item [\hyperlink{attribute.iff}{\mbox{\isa{iff}}}] declares logical equivalences to the
   2.707 +  \item \hyperlink{attribute.iff}{\mbox{\isa{iff}}} declares logical equivalences to the
   2.708    Simplifier and the Classical reasoner at the same time.
   2.709    Non-conditional rules result in a ``safe'' introduction and
   2.710    elimination pair; conditional ones are considered ``unsafe''.  Rules
   2.711 @@ -757,7 +754,7 @@
   2.712    the Isabelle/Pure context only, and omits the Simplifier
   2.713    declaration.
   2.714  
   2.715 -  \end{descr}%
   2.716 +  \end{description}%
   2.717  \end{isamarkuptext}%
   2.718  \isamarkuptrue%
   2.719  %
   2.720 @@ -767,15 +764,15 @@
   2.721  %
   2.722  \begin{isamarkuptext}%
   2.723  \begin{matharray}{rcl}
   2.724 -    \indexdef{}{attribute}{swapped}\hypertarget{attribute.swapped}{\hyperlink{attribute.swapped}{\mbox{\isa{swapped}}}} & : & \isaratt \\
   2.725 +    \indexdef{}{attribute}{swapped}\hypertarget{attribute.swapped}{\hyperlink{attribute.swapped}{\mbox{\isa{swapped}}}} & : & \isa{attribute} \\
   2.726    \end{matharray}
   2.727  
   2.728 -  \begin{descr}
   2.729 +  \begin{description}
   2.730  
   2.731 -  \item [\hyperlink{attribute.swapped}{\mbox{\isa{swapped}}}] turns an introduction rule into an
   2.732 +  \item \hyperlink{attribute.swapped}{\mbox{\isa{swapped}}} turns an introduction rule into an
   2.733    elimination, by resolving with the classical swap principle \isa{{\isachardoublequote}{\isacharparenleft}{\isasymnot}\ B\ {\isasymLongrightarrow}\ A{\isacharparenright}\ {\isasymLongrightarrow}\ {\isacharparenleft}{\isasymnot}\ A\ {\isasymLongrightarrow}\ B{\isacharparenright}{\isachardoublequote}}.
   2.734  
   2.735 -  \end{descr}%
   2.736 +  \end{description}%
   2.737  \end{isamarkuptext}%
   2.738  \isamarkuptrue%
   2.739  %
   2.740 @@ -785,11 +782,11 @@
   2.741  %
   2.742  \begin{isamarkuptext}%
   2.743  \begin{matharray}{rcl}
   2.744 -    \indexdef{}{command}{judgment}\hypertarget{command.judgment}{\hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}}} & : & \isartrans{theory}{theory} \\
   2.745 -    \indexdef{}{method}{atomize}\hypertarget{method.atomize}{\hyperlink{method.atomize}{\mbox{\isa{atomize}}}} & : & \isarmeth \\
   2.746 -    \indexdef{}{attribute}{atomize}\hypertarget{attribute.atomize}{\hyperlink{attribute.atomize}{\mbox{\isa{atomize}}}} & : & \isaratt \\
   2.747 -    \indexdef{}{attribute}{rule\_format}\hypertarget{attribute.rule-format}{\hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isacharunderscore}format}}}} & : & \isaratt \\
   2.748 -    \indexdef{}{attribute}{rulify}\hypertarget{attribute.rulify}{\hyperlink{attribute.rulify}{\mbox{\isa{rulify}}}} & : & \isaratt \\
   2.749 +    \indexdef{}{command}{judgment}\hypertarget{command.judgment}{\hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   2.750 +    \indexdef{}{method}{atomize}\hypertarget{method.atomize}{\hyperlink{method.atomize}{\mbox{\isa{atomize}}}} & : & \isa{method} \\
   2.751 +    \indexdef{}{attribute}{atomize}\hypertarget{attribute.atomize}{\hyperlink{attribute.atomize}{\mbox{\isa{atomize}}}} & : & \isa{attribute} \\
   2.752 +    \indexdef{}{attribute}{rule\_format}\hypertarget{attribute.rule-format}{\hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isacharunderscore}format}}}} & : & \isa{attribute} \\
   2.753 +    \indexdef{}{attribute}{rulify}\hypertarget{attribute.rulify}{\hyperlink{attribute.rulify}{\mbox{\isa{rulify}}}} & : & \isa{attribute} \\
   2.754    \end{matharray}
   2.755  
   2.756    The very starting point for any Isabelle object-logic is a ``truth
   2.757 @@ -821,17 +818,18 @@
   2.758      ;
   2.759    \end{rail}
   2.760  
   2.761 -  \begin{descr}
   2.762 +  \begin{description}
   2.763    
   2.764 -  \item [\hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}}~\isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\ {\isacharparenleft}mx{\isacharparenright}{\isachardoublequote}}] declares
   2.765 -  constant \isa{c} as the truth judgment of the current
   2.766 -  object-logic.  Its type \isa{{\isasymsigma}} should specify a coercion of the
   2.767 -  category of object-level propositions to \isa{prop} of the Pure
   2.768 -  meta-logic; the mixfix annotation \isa{{\isachardoublequote}{\isacharparenleft}mx{\isacharparenright}{\isachardoublequote}} would typically
   2.769 -  just link the object language (internally of syntactic category
   2.770 -  \isa{logic}) with that of \isa{prop}.  Only one \hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}} declaration may be given in any theory development.
   2.771 +  \item \hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}}~\isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\ {\isacharparenleft}mx{\isacharparenright}{\isachardoublequote}} declares constant
   2.772 +  \isa{c} as the truth judgment of the current object-logic.  Its
   2.773 +  type \isa{{\isasymsigma}} should specify a coercion of the category of
   2.774 +  object-level propositions to \isa{prop} of the Pure meta-logic;
   2.775 +  the mixfix annotation \isa{{\isachardoublequote}{\isacharparenleft}mx{\isacharparenright}{\isachardoublequote}} would typically just link the
   2.776 +  object language (internally of syntactic category \isa{logic})
   2.777 +  with that of \isa{prop}.  Only one \hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}}
   2.778 +  declaration may be given in any theory development.
   2.779    
   2.780 -  \item [\hyperlink{method.atomize}{\mbox{\isa{atomize}}} (as a method)] rewrites any non-atomic
   2.781 +  \item \hyperlink{method.atomize}{\mbox{\isa{atomize}}} (as a method) rewrites any non-atomic
   2.782    premises of a sub-goal, using the meta-level equations declared via
   2.783    \hyperlink{attribute.atomize}{\mbox{\isa{atomize}}} (as an attribute) beforehand.  As a result,
   2.784    heavily nested goals become amenable to fundamental operations such
   2.785 @@ -845,17 +843,17 @@
   2.786    Meta-level conjunction should be covered as well (this is
   2.787    particularly important for locales, see \secref{sec:locale}).
   2.788  
   2.789 -  \item [\hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isacharunderscore}format}}}] rewrites a theorem by the
   2.790 -  equalities declared as \hyperlink{attribute.rulify}{\mbox{\isa{rulify}}} rules in the current
   2.791 -  object-logic.  By default, the result is fully normalized, including
   2.792 -  assumptions and conclusions at any depth.  The \isa{{\isachardoublequote}{\isacharparenleft}no{\isacharunderscore}asm{\isacharparenright}{\isachardoublequote}}
   2.793 -  option restricts the transformation to the conclusion of a rule.
   2.794 +  \item \hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isacharunderscore}format}}} rewrites a theorem by the equalities
   2.795 +  declared as \hyperlink{attribute.rulify}{\mbox{\isa{rulify}}} rules in the current object-logic.
   2.796 +  By default, the result is fully normalized, including assumptions
   2.797 +  and conclusions at any depth.  The \isa{{\isachardoublequote}{\isacharparenleft}no{\isacharunderscore}asm{\isacharparenright}{\isachardoublequote}} option
   2.798 +  restricts the transformation to the conclusion of a rule.
   2.799  
   2.800    In common object-logics (HOL, FOL, ZF), the effect of \hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isacharunderscore}format}}} is to replace (bounded) universal quantification
   2.801    (\isa{{\isachardoublequote}{\isasymforall}{\isachardoublequote}}) and implication (\isa{{\isachardoublequote}{\isasymlongrightarrow}{\isachardoublequote}}) by the corresponding
   2.802    rule statements over \isa{{\isachardoublequote}{\isasymAnd}{\isachardoublequote}} and \isa{{\isachardoublequote}{\isasymLongrightarrow}{\isachardoublequote}}.
   2.803  
   2.804 -  \end{descr}%
   2.805 +  \end{description}%
   2.806  \end{isamarkuptext}%
   2.807  \isamarkuptrue%
   2.808  %
     3.1 --- a/doc-src/IsarRef/Thy/document/HOLCF_Specific.tex	Thu Nov 13 22:44:40 2008 +0100
     3.2 +++ b/doc-src/IsarRef/Thy/document/HOLCF_Specific.tex	Thu Nov 13 22:45:12 2008 +0100
     3.3 @@ -30,7 +30,7 @@
     3.4  %
     3.5  \begin{isamarkuptext}%
     3.6  \begin{matharray}{rcl}
     3.7 -    \indexdef{HOLCF}{command}{consts}\hypertarget{command.HOLCF.consts}{\hyperlink{command.HOLCF.consts}{\mbox{\isa{\isacommand{consts}}}}} & : & \isartrans{theory}{theory} \\
     3.8 +    \indexdef{HOLCF}{command}{consts}\hypertarget{command.HOLCF.consts}{\hyperlink{command.HOLCF.consts}{\mbox{\isa{\isacommand{consts}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
     3.9    \end{matharray}
    3.10  
    3.11    HOLCF provides a separate type for continuous functions \isa{{\isachardoublequote}{\isasymalpha}\ {\isasymrightarrow}\ {\isasymbeta}{\isachardoublequote}}, with an explicit application operator \isa{{\isachardoublequote}f\ {\isasymcdot}\ x{\isachardoublequote}}.
    3.12 @@ -53,7 +53,7 @@
    3.13  %
    3.14  \begin{isamarkuptext}%
    3.15  \begin{matharray}{rcl}
    3.16 -    \indexdef{HOLCF}{command}{domain}\hypertarget{command.HOLCF.domain}{\hyperlink{command.HOLCF.domain}{\mbox{\isa{\isacommand{domain}}}}} & : & \isartrans{theory}{theory} \\
    3.17 +    \indexdef{HOLCF}{command}{domain}\hypertarget{command.HOLCF.domain}{\hyperlink{command.HOLCF.domain}{\mbox{\isa{\isacommand{domain}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
    3.18    \end{matharray}
    3.19  
    3.20    \begin{rail}
     4.1 --- a/doc-src/IsarRef/Thy/document/HOL_Specific.tex	Thu Nov 13 22:44:40 2008 +0100
     4.2 +++ b/doc-src/IsarRef/Thy/document/HOL_Specific.tex	Thu Nov 13 22:45:12 2008 +0100
     4.3 @@ -30,8 +30,8 @@
     4.4  %
     4.5  \begin{isamarkuptext}%
     4.6  \begin{matharray}{rcl}
     4.7 -    \indexdef{HOL}{command}{typedecl}\hypertarget{command.HOL.typedecl}{\hyperlink{command.HOL.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}} & : & \isartrans{theory}{theory} \\
     4.8 -    \indexdef{HOL}{command}{typedef}\hypertarget{command.HOL.typedef}{\hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}}} & : & \isartrans{theory}{proof(prove)} \\
     4.9 +    \indexdef{HOL}{command}{typedecl}\hypertarget{command.HOL.typedecl}{\hyperlink{command.HOL.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
    4.10 +    \indexdef{HOL}{command}{typedef}\hypertarget{command.HOL.typedef}{\hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
    4.11    \end{matharray}
    4.12  
    4.13    \begin{rail}
    4.14 @@ -48,17 +48,18 @@
    4.15      ;
    4.16    \end{rail}
    4.17  
    4.18 -  \begin{descr}
    4.19 +  \begin{description}
    4.20    
    4.21 -  \item [\hyperlink{command.HOL.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}] is similar to the original \hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}} of
    4.22 -  Isabelle/Pure (see \secref{sec:types-pure}), but also declares type
    4.23 -  arity \isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}type{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ type{\isacharparenright}\ type{\isachardoublequote}}, making \isa{t} an
    4.24 -  actual HOL type constructor.   %FIXME check, update
    4.25 +  \item \hyperlink{command.HOL.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}} is similar
    4.26 +  to the original \hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}} of Isabelle/Pure (see
    4.27 +  \secref{sec:types-pure}), but also declares type arity \isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}type{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ type{\isacharparenright}\ type{\isachardoublequote}}, making \isa{t} an actual HOL type
    4.28 +  constructor.  %FIXME check, update
    4.29    
    4.30 -  \item [\hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t\ {\isacharequal}\ A{\isachardoublequote}}] sets up a goal stating non-emptiness of the set \isa{A}.
    4.31 -  After finishing the proof, the theory will be augmented by a
    4.32 -  Gordon/HOL-style type definition, which establishes a bijection
    4.33 -  between the representing set \isa{A} and the new type \isa{t}.
    4.34 +  \item \hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t\ {\isacharequal}\ A{\isachardoublequote}} sets up
    4.35 +  a goal stating non-emptiness of the set \isa{A}.  After finishing
    4.36 +  the proof, the theory will be augmented by a Gordon/HOL-style type
    4.37 +  definition, which establishes a bijection between the representing
    4.38 +  set \isa{A} and the new type \isa{t}.
    4.39    
    4.40    Technically, \hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}} defines both a type \isa{t} and a set (term constant) of the same name (an alternative base
    4.41    name may be given in parentheses).  The injection from type to set
    4.42 @@ -80,7 +81,7 @@
    4.43    declaration suppresses a separate constant definition for the
    4.44    representing set.
    4.45  
    4.46 -  \end{descr}
    4.47 +  \end{description}
    4.48  
    4.49    Note that raw type declarations are rarely used in practice; the
    4.50    main application is with experimental (or even axiomatic!) theory
    4.51 @@ -95,7 +96,7 @@
    4.52  %
    4.53  \begin{isamarkuptext}%
    4.54  \begin{matharray}{rcl}
    4.55 -    \hyperlink{attribute.HOL.split-format}{\mbox{\isa{split{\isacharunderscore}format}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isaratt \\
    4.56 +    \hyperlink{attribute.HOL.split-format}{\mbox{\isa{split{\isacharunderscore}format}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{attribute} \\
    4.57    \end{matharray}
    4.58  
    4.59    \begin{rail}
    4.60 @@ -103,19 +104,19 @@
    4.61      ;
    4.62    \end{rail}
    4.63  
    4.64 -  \begin{descr}
    4.65 +  \begin{description}
    4.66    
    4.67 -  \item [\hyperlink{attribute.HOL.split-format}{\mbox{\isa{split{\isacharunderscore}format}}}~\isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub m\ {\isasymAND}\ {\isasymdots}\ {\isasymAND}\ q\isactrlsub {\isadigit{1}}\ {\isasymdots}\ q\isactrlsub n{\isachardoublequote}}] puts expressions of
    4.68 -  low-level tuple types into canonical form as specified by the
    4.69 -  arguments given; the \isa{i}-th collection of arguments refers to
    4.70 -  occurrences in premise \isa{i} of the rule.  The ``\isa{{\isachardoublequote}{\isacharparenleft}complete{\isacharparenright}{\isachardoublequote}}'' option causes \emph{all} arguments in function
    4.71 -  applications to be represented canonically according to their tuple
    4.72 -  type structure.
    4.73 +  \item \hyperlink{attribute.HOL.split-format}{\mbox{\isa{split{\isacharunderscore}format}}}~\isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub m\ {\isasymAND}\ {\isasymdots}\ {\isasymAND}\ q\isactrlsub {\isadigit{1}}\ {\isasymdots}\ q\isactrlsub n{\isachardoublequote}} puts expressions of low-level tuple types into
    4.74 +  canonical form as specified by the arguments given; the \isa{i}-th
    4.75 +  collection of arguments refers to occurrences in premise \isa{i}
    4.76 +  of the rule.  The ``\isa{{\isachardoublequote}{\isacharparenleft}complete{\isacharparenright}{\isachardoublequote}}'' option causes \emph{all}
    4.77 +  arguments in function applications to be represented canonically
    4.78 +  according to their tuple type structure.
    4.79  
    4.80    Note that these operations tend to invent funny names for new local
    4.81    parameters to be introduced.
    4.82  
    4.83 -  \end{descr}%
    4.84 +  \end{description}%
    4.85  \end{isamarkuptext}%
    4.86  \isamarkuptrue%
    4.87  %
    4.88 @@ -204,7 +205,7 @@
    4.89  %
    4.90  \begin{isamarkuptext}%
    4.91  \begin{matharray}{rcl}
    4.92 -    \indexdef{HOL}{command}{record}\hypertarget{command.HOL.record}{\hyperlink{command.HOL.record}{\mbox{\isa{\isacommand{record}}}}} & : & \isartrans{theory}{theory} \\
    4.93 +    \indexdef{HOL}{command}{record}\hypertarget{command.HOL.record}{\hyperlink{command.HOL.record}{\mbox{\isa{\isacommand{record}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
    4.94    \end{matharray}
    4.95  
    4.96    \begin{rail}
    4.97 @@ -212,10 +213,9 @@
    4.98      ;
    4.99    \end{rail}
   4.100  
   4.101 -  \begin{descr}
   4.102 +  \begin{description}
   4.103  
   4.104 -  \item [\hyperlink{command.HOL.record}{\mbox{\isa{\isacommand{record}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub m{\isacharparenright}\ t\ {\isacharequal}\ {\isasymtau}\ {\isacharplus}\ c\isactrlsub {\isadigit{1}}\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\isactrlsub {\isadigit{1}}\ {\isasymdots}\ c\isactrlsub n\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\isactrlsub n{\isachardoublequote}}] defines
   4.105 -  extensible record type \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub m{\isacharparenright}\ t{\isachardoublequote}},
   4.106 +  \item \hyperlink{command.HOL.record}{\mbox{\isa{\isacommand{record}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub m{\isacharparenright}\ t\ {\isacharequal}\ {\isasymtau}\ {\isacharplus}\ c\isactrlsub {\isadigit{1}}\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\isactrlsub {\isadigit{1}}\ {\isasymdots}\ c\isactrlsub n\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\isactrlsub n{\isachardoublequote}} defines extensible record type \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub m{\isacharparenright}\ t{\isachardoublequote}},
   4.107    derived from the optional parent record \isa{{\isachardoublequote}{\isasymtau}{\isachardoublequote}} by adding new
   4.108    field components \isa{{\isachardoublequote}c\isactrlsub i\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\isactrlsub i{\isachardoublequote}} etc.
   4.109  
   4.110 @@ -236,7 +236,7 @@
   4.111    type abbreviation for the fixed record type \isa{{\isachardoublequote}{\isasymlparr}c\isactrlsub {\isadigit{1}}\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\isactrlsub n{\isasymrparr}{\isachardoublequote}}, likewise is \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub m{\isacharcomma}\ {\isasymzeta}{\isacharparenright}\ t{\isacharunderscore}scheme{\isachardoublequote}} made an abbreviation for
   4.112    \isa{{\isachardoublequote}{\isasymlparr}c\isactrlsub {\isadigit{1}}\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\isactrlsub n{\isacharcomma}\ {\isasymdots}\ {\isacharcolon}{\isacharcolon}\ {\isasymzeta}{\isasymrparr}{\isachardoublequote}}.
   4.113  
   4.114 -  \end{descr}%
   4.115 +  \end{description}%
   4.116  \end{isamarkuptext}%
   4.117  \isamarkuptrue%
   4.118  %
   4.119 @@ -364,8 +364,8 @@
   4.120  %
   4.121  \begin{isamarkuptext}%
   4.122  \begin{matharray}{rcl}
   4.123 -    \indexdef{HOL}{command}{datatype}\hypertarget{command.HOL.datatype}{\hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}}} & : & \isartrans{theory}{theory} \\
   4.124 -  \indexdef{HOL}{command}{rep\_datatype}\hypertarget{command.HOL.rep-datatype}{\hyperlink{command.HOL.rep-datatype}{\mbox{\isa{\isacommand{rep{\isacharunderscore}datatype}}}}} & : & \isartrans{theory}{proof} \\
   4.125 +    \indexdef{HOL}{command}{datatype}\hypertarget{command.HOL.datatype}{\hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.126 +  \indexdef{HOL}{command}{rep\_datatype}\hypertarget{command.HOL.rep-datatype}{\hyperlink{command.HOL.rep-datatype}{\mbox{\isa{\isacommand{rep{\isacharunderscore}datatype}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   4.127    \end{matharray}
   4.128  
   4.129    \begin{rail}
   4.130 @@ -379,16 +379,16 @@
   4.131      cons: name (type *) mixfix?
   4.132    \end{rail}
   4.133  
   4.134 -  \begin{descr}
   4.135 +  \begin{description}
   4.136  
   4.137 -  \item [\hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}}] defines inductive datatypes in
   4.138 +  \item \hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}} defines inductive datatypes in
   4.139    HOL.
   4.140  
   4.141 -  \item [\hyperlink{command.HOL.rep-datatype}{\mbox{\isa{\isacommand{rep{\isacharunderscore}datatype}}}}] represents existing types as
   4.142 +  \item \hyperlink{command.HOL.rep-datatype}{\mbox{\isa{\isacommand{rep{\isacharunderscore}datatype}}}} represents existing types as
   4.143    inductive ones, generating the standard infrastructure of derived
   4.144    concepts (primitive recursion etc.).
   4.145  
   4.146 -  \end{descr}
   4.147 +  \end{description}
   4.148  
   4.149    The induction and exhaustion theorems generated provide case names
   4.150    according to the constructors involved, while parameters are named
   4.151 @@ -409,10 +409,10 @@
   4.152  %
   4.153  \begin{isamarkuptext}%
   4.154  \begin{matharray}{rcl}
   4.155 -    \indexdef{HOL}{command}{primrec}\hypertarget{command.HOL.primrec}{\hyperlink{command.HOL.primrec}{\mbox{\isa{\isacommand{primrec}}}}} & : & \isarkeep{local{\dsh}theory} \\
   4.156 -    \indexdef{HOL}{command}{fun}\hypertarget{command.HOL.fun}{\hyperlink{command.HOL.fun}{\mbox{\isa{\isacommand{fun}}}}} & : & \isarkeep{local{\dsh}theory} \\
   4.157 -    \indexdef{HOL}{command}{function}\hypertarget{command.HOL.function}{\hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}}} & : & \isartrans{local{\dsh}theory}{proof(prove)} \\
   4.158 -    \indexdef{HOL}{command}{termination}\hypertarget{command.HOL.termination}{\hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}} & : & \isartrans{local{\dsh}theory}{proof(prove)} \\
   4.159 +    \indexdef{HOL}{command}{primrec}\hypertarget{command.HOL.primrec}{\hyperlink{command.HOL.primrec}{\mbox{\isa{\isacommand{primrec}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   4.160 +    \indexdef{HOL}{command}{fun}\hypertarget{command.HOL.fun}{\hyperlink{command.HOL.fun}{\mbox{\isa{\isacommand{fun}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   4.161 +    \indexdef{HOL}{command}{function}\hypertarget{command.HOL.function}{\hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   4.162 +    \indexdef{HOL}{command}{termination}\hypertarget{command.HOL.termination}{\hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   4.163    \end{matharray}
   4.164  
   4.165    \begin{rail}
   4.166 @@ -429,12 +429,12 @@
   4.167      'termination' ( term )?
   4.168    \end{rail}
   4.169  
   4.170 -  \begin{descr}
   4.171 +  \begin{description}
   4.172  
   4.173 -  \item [\hyperlink{command.HOL.primrec}{\mbox{\isa{\isacommand{primrec}}}}] defines primitive recursive
   4.174 +  \item \hyperlink{command.HOL.primrec}{\mbox{\isa{\isacommand{primrec}}}} defines primitive recursive
   4.175    functions over datatypes, see also \cite{isabelle-HOL}.
   4.176  
   4.177 -  \item [\hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}}] defines functions by general
   4.178 +  \item \hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}} defines functions by general
   4.179    wellfounded recursion. A detailed description with examples can be
   4.180    found in \cite{isabelle-function}. The function is specified by a
   4.181    set of (possibly conditional) recursive equations with arbitrary
   4.182 @@ -447,18 +447,17 @@
   4.183    predicate \isa{{\isachardoublequote}f{\isacharunderscore}dom{\isachardoublequote}}. The \hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}
   4.184    command can then be used to establish that the function is total.
   4.185  
   4.186 -  \item [\hyperlink{command.HOL.fun}{\mbox{\isa{\isacommand{fun}}}}] is a shorthand notation for
   4.187 -  ``\hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}}~\isa{{\isachardoublequote}{\isacharparenleft}sequential{\isacharparenright}{\isachardoublequote}}, followed by
   4.188 -  automated proof attempts regarding pattern matching and termination.
   4.189 -  See \cite{isabelle-function} for further details.
   4.190 +  \item \hyperlink{command.HOL.fun}{\mbox{\isa{\isacommand{fun}}}} is a shorthand notation for ``\hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}}~\isa{{\isachardoublequote}{\isacharparenleft}sequential{\isacharparenright}{\isachardoublequote}}, followed by automated
   4.191 +  proof attempts regarding pattern matching and termination.  See
   4.192 +  \cite{isabelle-function} for further details.
   4.193  
   4.194 -  \item [\hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}~\isa{f}] commences a
   4.195 +  \item \hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}~\isa{f} commences a
   4.196    termination proof for the previously defined function \isa{f}.  If
   4.197    this is omitted, the command refers to the most recent function
   4.198    definition.  After the proof is closed, the recursive equations and
   4.199    the induction principle is established.
   4.200  
   4.201 -  \end{descr}
   4.202 +  \end{description}
   4.203  
   4.204    %FIXME check
   4.205  
   4.206 @@ -481,31 +480,31 @@
   4.207    The \hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}} command accepts the following
   4.208    options.
   4.209  
   4.210 -  \begin{descr}
   4.211 +  \begin{description}
   4.212  
   4.213 -  \item [\isa{sequential}] enables a preprocessor which
   4.214 -  disambiguates overlapping patterns by making them mutually disjoint.
   4.215 -  Earlier equations take precedence over later ones.  This allows to
   4.216 -  give the specification in a format very similar to functional
   4.217 -  programming.  Note that the resulting simplification and induction
   4.218 -  rules correspond to the transformed specification, not the one given
   4.219 +  \item \isa{sequential} enables a preprocessor which disambiguates
   4.220 +  overlapping patterns by making them mutually disjoint.  Earlier
   4.221 +  equations take precedence over later ones.  This allows to give the
   4.222 +  specification in a format very similar to functional programming.
   4.223 +  Note that the resulting simplification and induction rules
   4.224 +  correspond to the transformed specification, not the one given
   4.225    originally. This usually means that each equation given by the user
   4.226    may result in several theroems.  Also note that this automatic
   4.227    transformation only works for ML-style datatype patterns.
   4.228  
   4.229 -  \item [\isa{domintros}] enables the automated generation of
   4.230 +  \item \isa{domintros} enables the automated generation of
   4.231    introduction rules for the domain predicate. While mostly not
   4.232    needed, they can be helpful in some proofs about partial functions.
   4.233  
   4.234 -  \item [\isa{tailrec}] generates the unconstrained recursive
   4.235 +  \item \isa{tailrec} generates the unconstrained recursive
   4.236    equations even without a termination proof, provided that the
   4.237    function is tail-recursive. This currently only works
   4.238  
   4.239 -  \item [\isa{{\isachardoublequote}default\ d{\isachardoublequote}}] allows to specify a default value for a
   4.240 +  \item \isa{{\isachardoublequote}default\ d{\isachardoublequote}} allows to specify a default value for a
   4.241    (partial) function, which will ensure that \isa{{\isachardoublequote}f\ x\ {\isacharequal}\ d\ x{\isachardoublequote}}
   4.242    whenever \isa{{\isachardoublequote}x\ {\isasymnotin}\ f{\isacharunderscore}dom{\isachardoublequote}}.
   4.243  
   4.244 -  \end{descr}%
   4.245 +  \end{description}%
   4.246  \end{isamarkuptext}%
   4.247  \isamarkuptrue%
   4.248  %
   4.249 @@ -515,9 +514,9 @@
   4.250  %
   4.251  \begin{isamarkuptext}%
   4.252  \begin{matharray}{rcl}
   4.253 -    \indexdef{HOL}{method}{pat\_completeness}\hypertarget{method.HOL.pat-completeness}{\hyperlink{method.HOL.pat-completeness}{\mbox{\isa{pat{\isacharunderscore}completeness}}}} & : & \isarmeth \\
   4.254 -    \indexdef{HOL}{method}{relation}\hypertarget{method.HOL.relation}{\hyperlink{method.HOL.relation}{\mbox{\isa{relation}}}} & : & \isarmeth \\
   4.255 -    \indexdef{HOL}{method}{lexicographic\_order}\hypertarget{method.HOL.lexicographic-order}{\hyperlink{method.HOL.lexicographic-order}{\mbox{\isa{lexicographic{\isacharunderscore}order}}}} & : & \isarmeth \\
   4.256 +    \indexdef{HOL}{method}{pat\_completeness}\hypertarget{method.HOL.pat-completeness}{\hyperlink{method.HOL.pat-completeness}{\mbox{\isa{pat{\isacharunderscore}completeness}}}} & : & \isa{method} \\
   4.257 +    \indexdef{HOL}{method}{relation}\hypertarget{method.HOL.relation}{\hyperlink{method.HOL.relation}{\mbox{\isa{relation}}}} & : & \isa{method} \\
   4.258 +    \indexdef{HOL}{method}{lexicographic\_order}\hypertarget{method.HOL.lexicographic-order}{\hyperlink{method.HOL.lexicographic-order}{\mbox{\isa{lexicographic{\isacharunderscore}order}}}} & : & \isa{method} \\
   4.259    \end{matharray}
   4.260  
   4.261    \begin{rail}
   4.262 @@ -527,21 +526,21 @@
   4.263      ;
   4.264    \end{rail}
   4.265  
   4.266 -  \begin{descr}
   4.267 +  \begin{description}
   4.268  
   4.269 -  \item [\hyperlink{method.HOL.pat-completeness}{\mbox{\isa{pat{\isacharunderscore}completeness}}}] is a specialized method to
   4.270 +  \item \hyperlink{method.HOL.pat-completeness}{\mbox{\isa{pat{\isacharunderscore}completeness}}} is a specialized method to
   4.271    solve goals regarding the completeness of pattern matching, as
   4.272    required by the \hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}} package (cf.\
   4.273    \cite{isabelle-function}).
   4.274  
   4.275 -  \item [\hyperlink{method.HOL.relation}{\mbox{\isa{relation}}}~\isa{R}] introduces a termination
   4.276 +  \item \hyperlink{method.HOL.relation}{\mbox{\isa{relation}}}~\isa{R} introduces a termination
   4.277    proof using the relation \isa{R}.  The resulting proof state will
   4.278    contain goals expressing that \isa{R} is wellfounded, and that the
   4.279    arguments of recursive calls decrease with respect to \isa{R}.
   4.280    Usually, this method is used as the initial proof step of manual
   4.281    termination proofs.
   4.282  
   4.283 -  \item [\hyperlink{method.HOL.lexicographic-order}{\mbox{\isa{lexicographic{\isacharunderscore}order}}}] attempts a fully
   4.284 +  \item \hyperlink{method.HOL.lexicographic-order}{\mbox{\isa{lexicographic{\isacharunderscore}order}}} attempts a fully
   4.285    automated termination proof by searching for a lexicographic
   4.286    combination of size measures on the arguments of the function. The
   4.287    method accepts the same arguments as the \hyperlink{method.auto}{\mbox{\isa{auto}}} method,
   4.288 @@ -552,7 +551,7 @@
   4.289    In case of failure, extensive information is printed, which can help
   4.290    to analyse the situation (cf.\ \cite{isabelle-function}).
   4.291  
   4.292 -  \end{descr}%
   4.293 +  \end{description}%
   4.294  \end{isamarkuptext}%
   4.295  \isamarkuptrue%
   4.296  %
   4.297 @@ -564,8 +563,8 @@
   4.298  The old TFL commands \hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}} and \hyperlink{command.HOL.recdef-tc}{\mbox{\isa{\isacommand{recdef{\isacharunderscore}tc}}}} for defining recursive are mostly obsolete; \hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}} or \hyperlink{command.HOL.fun}{\mbox{\isa{\isacommand{fun}}}} should be used instead.
   4.299  
   4.300    \begin{matharray}{rcl}
   4.301 -    \indexdef{HOL}{command}{recdef}\hypertarget{command.HOL.recdef}{\hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}}} & : & \isartrans{theory}{theory} \\
   4.302 -    \indexdef{HOL}{command}{recdef\_tc}\hypertarget{command.HOL.recdef-tc}{\hyperlink{command.HOL.recdef-tc}{\mbox{\isa{\isacommand{recdef{\isacharunderscore}tc}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{theory}{proof(prove)} \\
   4.303 +    \indexdef{HOL}{command}{recdef}\hypertarget{command.HOL.recdef}{\hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isacharparenright}{\isachardoublequote}} \\
   4.304 +    \indexdef{HOL}{command}{recdef\_tc}\hypertarget{command.HOL.recdef-tc}{\hyperlink{command.HOL.recdef-tc}{\mbox{\isa{\isacommand{recdef{\isacharunderscore}tc}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   4.305    \end{matharray}
   4.306  
   4.307    \begin{rail}
   4.308 @@ -581,9 +580,9 @@
   4.309      ;
   4.310    \end{rail}
   4.311  
   4.312 -  \begin{descr}
   4.313 +  \begin{description}
   4.314    
   4.315 -  \item [\hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}}] defines general well-founded
   4.316 +  \item \hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}} defines general well-founded
   4.317    recursive functions (using the TFL package), see also
   4.318    \cite{isabelle-HOL}.  The ``\isa{{\isachardoublequote}{\isacharparenleft}permissive{\isacharparenright}{\isachardoublequote}}'' option tells
   4.319    TFL to recover from failed proof attempts, returning unfinished
   4.320 @@ -593,7 +592,7 @@
   4.321    context of the Simplifier (cf.\ \secref{sec:simplifier}) and
   4.322    Classical reasoner (cf.\ \secref{sec:classical}).
   4.323    
   4.324 -  \item [\hyperlink{command.HOL.recdef-tc}{\mbox{\isa{\isacommand{recdef{\isacharunderscore}tc}}}}~\isa{{\isachardoublequote}c\ {\isacharparenleft}i{\isacharparenright}{\isachardoublequote}}] recommences the
   4.325 +  \item \hyperlink{command.HOL.recdef-tc}{\mbox{\isa{\isacommand{recdef{\isacharunderscore}tc}}}}~\isa{{\isachardoublequote}c\ {\isacharparenleft}i{\isacharparenright}{\isachardoublequote}} recommences the
   4.326    proof for leftover termination condition number \isa{i} (default
   4.327    1) as generated by a \hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}} definition of
   4.328    constant \isa{c}.
   4.329 @@ -601,15 +600,15 @@
   4.330    Note that in most cases, \hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}} is able to finish
   4.331    its internal proofs without manual intervention.
   4.332  
   4.333 -  \end{descr}
   4.334 +  \end{description}
   4.335  
   4.336    \medskip Hints for \hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}} may be also declared
   4.337    globally, using the following attributes.
   4.338  
   4.339    \begin{matharray}{rcl}
   4.340 -    \indexdef{HOL}{attribute}{recdef\_simp}\hypertarget{attribute.HOL.recdef-simp}{\hyperlink{attribute.HOL.recdef-simp}{\mbox{\isa{recdef{\isacharunderscore}simp}}}} & : & \isaratt \\
   4.341 -    \indexdef{HOL}{attribute}{recdef\_cong}\hypertarget{attribute.HOL.recdef-cong}{\hyperlink{attribute.HOL.recdef-cong}{\mbox{\isa{recdef{\isacharunderscore}cong}}}} & : & \isaratt \\
   4.342 -    \indexdef{HOL}{attribute}{recdef\_wf}\hypertarget{attribute.HOL.recdef-wf}{\hyperlink{attribute.HOL.recdef-wf}{\mbox{\isa{recdef{\isacharunderscore}wf}}}} & : & \isaratt \\
   4.343 +    \indexdef{HOL}{attribute}{recdef\_simp}\hypertarget{attribute.HOL.recdef-simp}{\hyperlink{attribute.HOL.recdef-simp}{\mbox{\isa{recdef{\isacharunderscore}simp}}}} & : & \isa{attribute} \\
   4.344 +    \indexdef{HOL}{attribute}{recdef\_cong}\hypertarget{attribute.HOL.recdef-cong}{\hyperlink{attribute.HOL.recdef-cong}{\mbox{\isa{recdef{\isacharunderscore}cong}}}} & : & \isa{attribute} \\
   4.345 +    \indexdef{HOL}{attribute}{recdef\_wf}\hypertarget{attribute.HOL.recdef-wf}{\hyperlink{attribute.HOL.recdef-wf}{\mbox{\isa{recdef{\isacharunderscore}wf}}}} & : & \isa{attribute} \\
   4.346    \end{matharray}
   4.347  
   4.348    \begin{rail}
   4.349 @@ -647,11 +646,11 @@
   4.350    to use inference rules for type-checking.
   4.351  
   4.352    \begin{matharray}{rcl}
   4.353 -    \indexdef{HOL}{command}{inductive}\hypertarget{command.HOL.inductive}{\hyperlink{command.HOL.inductive}{\mbox{\isa{\isacommand{inductive}}}}} & : & \isarkeep{local{\dsh}theory} \\
   4.354 -    \indexdef{HOL}{command}{inductive\_set}\hypertarget{command.HOL.inductive-set}{\hyperlink{command.HOL.inductive-set}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}set}}}}} & : & \isarkeep{local{\dsh}theory} \\
   4.355 -    \indexdef{HOL}{command}{coinductive}\hypertarget{command.HOL.coinductive}{\hyperlink{command.HOL.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}} & : & \isarkeep{local{\dsh}theory} \\
   4.356 -    \indexdef{HOL}{command}{coinductive\_set}\hypertarget{command.HOL.coinductive-set}{\hyperlink{command.HOL.coinductive-set}{\mbox{\isa{\isacommand{coinductive{\isacharunderscore}set}}}}} & : & \isarkeep{local{\dsh}theory} \\
   4.357 -    \indexdef{HOL}{attribute}{mono}\hypertarget{attribute.HOL.mono}{\hyperlink{attribute.HOL.mono}{\mbox{\isa{mono}}}} & : & \isaratt \\
   4.358 +    \indexdef{HOL}{command}{inductive}\hypertarget{command.HOL.inductive}{\hyperlink{command.HOL.inductive}{\mbox{\isa{\isacommand{inductive}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   4.359 +    \indexdef{HOL}{command}{inductive\_set}\hypertarget{command.HOL.inductive-set}{\hyperlink{command.HOL.inductive-set}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}set}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   4.360 +    \indexdef{HOL}{command}{coinductive}\hypertarget{command.HOL.coinductive}{\hyperlink{command.HOL.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   4.361 +    \indexdef{HOL}{command}{coinductive\_set}\hypertarget{command.HOL.coinductive-set}{\hyperlink{command.HOL.coinductive-set}{\mbox{\isa{\isacommand{coinductive{\isacharunderscore}set}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   4.362 +    \indexdef{HOL}{attribute}{mono}\hypertarget{attribute.HOL.mono}{\hyperlink{attribute.HOL.mono}{\mbox{\isa{mono}}}} & : & \isa{attribute} \\
   4.363    \end{matharray}
   4.364  
   4.365    \begin{rail}
   4.366 @@ -664,9 +663,9 @@
   4.367      ;
   4.368    \end{rail}
   4.369  
   4.370 -  \begin{descr}
   4.371 +  \begin{description}
   4.372  
   4.373 -  \item [\hyperlink{command.HOL.inductive}{\mbox{\isa{\isacommand{inductive}}}} and \hyperlink{command.HOL.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}] define (co)inductive predicates from the
   4.374 +  \item \hyperlink{command.HOL.inductive}{\mbox{\isa{\isacommand{inductive}}}} and \hyperlink{command.HOL.coinductive}{\mbox{\isa{\isacommand{coinductive}}}} define (co)inductive predicates from the
   4.375    introduction rules given in the \hyperlink{keyword.where}{\mbox{\isa{\isakeyword{where}}}} part.  The
   4.376    optional \hyperlink{keyword.for}{\mbox{\isa{\isakeyword{for}}}} part contains a list of parameters of the
   4.377    (co)inductive predicates that remain fixed throughout the
   4.378 @@ -676,13 +675,13 @@
   4.379    \emph{must} be a theorem of the form \isa{{\isachardoublequote}A\ {\isasymle}\ B\ {\isasymLongrightarrow}\ M\ A\ {\isasymle}\ M\ B{\isachardoublequote}},
   4.380    for each premise \isa{{\isachardoublequote}M\ R\isactrlsub i\ t{\isachardoublequote}} in an introduction rule!
   4.381  
   4.382 -  \item [\hyperlink{command.HOL.inductive-set}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}set}}}} and \hyperlink{command.HOL.coinductive-set}{\mbox{\isa{\isacommand{coinductive{\isacharunderscore}set}}}}] are wrappers for to the previous commands,
   4.383 +  \item \hyperlink{command.HOL.inductive-set}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}set}}}} and \hyperlink{command.HOL.coinductive-set}{\mbox{\isa{\isacommand{coinductive{\isacharunderscore}set}}}} are wrappers for to the previous commands,
   4.384    allowing the definition of (co)inductive sets.
   4.385  
   4.386 -  \item [\hyperlink{attribute.HOL.mono}{\mbox{\isa{mono}}}] declares monotonicity rules.  These
   4.387 +  \item \hyperlink{attribute.HOL.mono}{\mbox{\isa{mono}}} declares monotonicity rules.  These
   4.388    rule are involved in the automated monotonicity proof of \hyperlink{command.HOL.inductive}{\mbox{\isa{\isacommand{inductive}}}}.
   4.389  
   4.390 -  \end{descr}%
   4.391 +  \end{description}%
   4.392  \end{isamarkuptext}%
   4.393  \isamarkuptrue%
   4.394  %
   4.395 @@ -696,14 +695,14 @@
   4.396  
   4.397    \begin{description}
   4.398  
   4.399 -  \item [\isa{R{\isachardot}intros}] is the list of introduction rules as proven
   4.400 +  \item \isa{R{\isachardot}intros} is the list of introduction rules as proven
   4.401    theorems, for the recursive predicates (or sets).  The rules are
   4.402    also available individually, using the names given them in the
   4.403    theory file;
   4.404  
   4.405 -  \item [\isa{R{\isachardot}cases}] is the case analysis (or elimination) rule;
   4.406 +  \item \isa{R{\isachardot}cases} is the case analysis (or elimination) rule;
   4.407  
   4.408 -  \item [\isa{R{\isachardot}induct} or \isa{R{\isachardot}coinduct}] is the (co)induction
   4.409 +  \item \isa{R{\isachardot}induct} or \isa{R{\isachardot}coinduct} is the (co)induction
   4.410    rule.
   4.411  
   4.412    \end{description}
   4.413 @@ -766,8 +765,8 @@
   4.414  %
   4.415  \begin{isamarkuptext}%
   4.416  \begin{matharray}{rcl}
   4.417 -    \indexdef{HOL}{method}{arith}\hypertarget{method.HOL.arith}{\hyperlink{method.HOL.arith}{\mbox{\isa{arith}}}} & : & \isarmeth \\
   4.418 -    \indexdef{HOL}{attribute}{arith\_split}\hypertarget{attribute.HOL.arith-split}{\hyperlink{attribute.HOL.arith-split}{\mbox{\isa{arith{\isacharunderscore}split}}}} & : & \isaratt \\
   4.419 +    \indexdef{HOL}{method}{arith}\hypertarget{method.HOL.arith}{\hyperlink{method.HOL.arith}{\mbox{\isa{arith}}}} & : & \isa{method} \\
   4.420 +    \indexdef{HOL}{attribute}{arith\_split}\hypertarget{attribute.HOL.arith-split}{\hyperlink{attribute.HOL.arith-split}{\mbox{\isa{arith{\isacharunderscore}split}}}} & : & \isa{attribute} \\
   4.421    \end{matharray}
   4.422  
   4.423    The \hyperlink{method.HOL.arith}{\mbox{\isa{arith}}} method decides linear arithmetic problems
   4.424 @@ -811,11 +810,11 @@
   4.425    search over and over again.
   4.426  
   4.427    \begin{matharray}{rcl}
   4.428 -    \indexdef{HOL}{command}{sledgehammer}\hypertarget{command.HOL.sledgehammer}{\hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{proof} \\
   4.429 -    \indexdef{HOL}{command}{print\_atps}\hypertarget{command.HOL.print-atps}{\hyperlink{command.HOL.print-atps}{\mbox{\isa{\isacommand{print{\isacharunderscore}atps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   4.430 -    \indexdef{HOL}{command}{atp\_info}\hypertarget{command.HOL.atp-info}{\hyperlink{command.HOL.atp-info}{\mbox{\isa{\isacommand{atp{\isacharunderscore}info}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   4.431 -    \indexdef{HOL}{command}{atp\_kill}\hypertarget{command.HOL.atp-kill}{\hyperlink{command.HOL.atp-kill}{\mbox{\isa{\isacommand{atp{\isacharunderscore}kill}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   4.432 -    \indexdef{HOL}{method}{metis}\hypertarget{method.HOL.metis}{\hyperlink{method.HOL.metis}{\mbox{\isa{metis}}}} & : & \isarmeth \\
   4.433 +    \indexdef{HOL}{command}{sledgehammer}\hypertarget{command.HOL.sledgehammer}{\hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}{\isachardoublequote}} \\
   4.434 +    \indexdef{HOL}{command}{print\_atps}\hypertarget{command.HOL.print-atps}{\hyperlink{command.HOL.print-atps}{\mbox{\isa{\isacommand{print{\isacharunderscore}atps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   4.435 +    \indexdef{HOL}{command}{atp\_info}\hypertarget{command.HOL.atp-info}{\hyperlink{command.HOL.atp-info}{\mbox{\isa{\isacommand{atp{\isacharunderscore}info}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
   4.436 +    \indexdef{HOL}{command}{atp\_kill}\hypertarget{command.HOL.atp-kill}{\hyperlink{command.HOL.atp-kill}{\mbox{\isa{\isacommand{atp{\isacharunderscore}kill}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
   4.437 +    \indexdef{HOL}{method}{metis}\hypertarget{method.HOL.metis}{\hyperlink{method.HOL.metis}{\mbox{\isa{metis}}}} & : & \isa{method} \\
   4.438    \end{matharray}
   4.439  
   4.440    \begin{rail}
   4.441 @@ -826,12 +825,12 @@
   4.442    ;
   4.443    \end{rail}
   4.444  
   4.445 -  \begin{descr}
   4.446 +  \begin{description}
   4.447  
   4.448 -  \item [\hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}}~\isa{{\isachardoublequote}prover\isactrlsub {\isadigit{1}}\ {\isasymdots}\ prover\isactrlsub n{\isachardoublequote}}] invokes the specified automated theorem provers on
   4.449 -  the first subgoal.  Provers are run in parallel, the first
   4.450 -  successful result is displayed, and the other attempts are
   4.451 -  terminated.
   4.452 +  \item \hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}}~\isa{{\isachardoublequote}prover\isactrlsub {\isadigit{1}}\ {\isasymdots}\ prover\isactrlsub n{\isachardoublequote}}
   4.453 +  invokes the specified automated theorem provers on the first
   4.454 +  subgoal.  Provers are run in parallel, the first successful result
   4.455 +  is displayed, and the other attempts are terminated.
   4.456  
   4.457    Provers are defined in the theory context, see also \hyperlink{command.HOL.print-atps}{\mbox{\isa{\isacommand{print{\isacharunderscore}atps}}}}.  If no provers are given as arguments to \hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}}, the system refers to the default defined as
   4.458    ``ATP provers'' preference by the user interface.
   4.459 @@ -840,32 +839,32 @@
   4.460    and the maximum number of independent prover processes (default: 5);
   4.461    excessive provers are automatically terminated.
   4.462  
   4.463 -  \item [\hyperlink{command.HOL.print-atps}{\mbox{\isa{\isacommand{print{\isacharunderscore}atps}}}}] prints the list of automated
   4.464 +  \item \hyperlink{command.HOL.print-atps}{\mbox{\isa{\isacommand{print{\isacharunderscore}atps}}}} prints the list of automated
   4.465    theorem provers available to the \hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}}
   4.466    command.
   4.467  
   4.468 -  \item [\hyperlink{command.HOL.atp-info}{\mbox{\isa{\isacommand{atp{\isacharunderscore}info}}}}] prints information about presently
   4.469 +  \item \hyperlink{command.HOL.atp-info}{\mbox{\isa{\isacommand{atp{\isacharunderscore}info}}}} prints information about presently
   4.470    running provers, including elapsed runtime, and the remaining time
   4.471    until timeout.
   4.472  
   4.473 -  \item [\hyperlink{command.HOL.atp-kill}{\mbox{\isa{\isacommand{atp{\isacharunderscore}kill}}}}] terminates all presently running
   4.474 +  \item \hyperlink{command.HOL.atp-kill}{\mbox{\isa{\isacommand{atp{\isacharunderscore}kill}}}} terminates all presently running
   4.475    provers.
   4.476  
   4.477 -  \item [\hyperlink{method.HOL.metis}{\mbox{\isa{metis}}}~\isa{{\isachardoublequote}facts{\isachardoublequote}}] invokes the Metis
   4.478 -  prover with the given facts.  Metis is an automated proof tool of
   4.479 -  medium strength, but is fully integrated into Isabelle/HOL, with
   4.480 -  explicit inferences going through the kernel.  Thus its results are
   4.481 +  \item \hyperlink{method.HOL.metis}{\mbox{\isa{metis}}}~\isa{{\isachardoublequote}facts{\isachardoublequote}} invokes the Metis prover
   4.482 +  with the given facts.  Metis is an automated proof tool of medium
   4.483 +  strength, but is fully integrated into Isabelle/HOL, with explicit
   4.484 +  inferences going through the kernel.  Thus its results are
   4.485    guaranteed to be ``correct by construction''.
   4.486  
   4.487    Note that all facts used with Metis need to be specified as explicit
   4.488    arguments.  There are no rule declarations as for other Isabelle
   4.489    provers, like \hyperlink{method.blast}{\mbox{\isa{blast}}} or \hyperlink{method.fast}{\mbox{\isa{fast}}}.
   4.490  
   4.491 -  \end{descr}%
   4.492 +  \end{description}%
   4.493  \end{isamarkuptext}%
   4.494  \isamarkuptrue%
   4.495  %
   4.496 -\isamarkupsection{Unstructured cases analysis and induction \label{sec:hol-induct-tac}%
   4.497 +\isamarkupsection{Unstructured case analysis and induction \label{sec:hol-induct-tac}%
   4.498  }
   4.499  \isamarkuptrue%
   4.500  %
   4.501 @@ -875,10 +874,10 @@
   4.502    \secref{sec:cases-induct} for proper Isar versions of similar ideas.
   4.503  
   4.504    \begin{matharray}{rcl}
   4.505 -    \indexdef{HOL}{method}{case\_tac}\hypertarget{method.HOL.case-tac}{\hyperlink{method.HOL.case-tac}{\mbox{\isa{case{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   4.506 -    \indexdef{HOL}{method}{induct\_tac}\hypertarget{method.HOL.induct-tac}{\hyperlink{method.HOL.induct-tac}{\mbox{\isa{induct{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   4.507 -    \indexdef{HOL}{method}{ind\_cases}\hypertarget{method.HOL.ind-cases}{\hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isacharunderscore}cases}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
   4.508 -    \indexdef{HOL}{command}{inductive\_cases}\hypertarget{command.HOL.inductive-cases}{\hyperlink{command.HOL.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}cases}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{theory}{theory} \\
   4.509 +    \indexdef{HOL}{method}{case\_tac}\hypertarget{method.HOL.case-tac}{\hyperlink{method.HOL.case-tac}{\mbox{\isa{case{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   4.510 +    \indexdef{HOL}{method}{induct\_tac}\hypertarget{method.HOL.induct-tac}{\hyperlink{method.HOL.induct-tac}{\mbox{\isa{induct{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   4.511 +    \indexdef{HOL}{method}{ind\_cases}\hypertarget{method.HOL.ind-cases}{\hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isacharunderscore}cases}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
   4.512 +    \indexdef{HOL}{command}{inductive\_cases}\hypertarget{command.HOL.inductive-cases}{\hyperlink{command.HOL.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}cases}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   4.513    \end{matharray}
   4.514  
   4.515    \begin{rail}
   4.516 @@ -895,11 +894,12 @@
   4.517      ;
   4.518    \end{rail}
   4.519  
   4.520 -  \begin{descr}
   4.521 +  \begin{description}
   4.522  
   4.523 -  \item [\hyperlink{method.HOL.case-tac}{\mbox{\isa{case{\isacharunderscore}tac}}} and \hyperlink{method.HOL.induct-tac}{\mbox{\isa{induct{\isacharunderscore}tac}}}]
   4.524 -  admit to reason about inductive types.  Rules are selected according
   4.525 -  to the declarations by the \hyperlink{attribute.cases}{\mbox{\isa{cases}}} and \hyperlink{attribute.induct}{\mbox{\isa{induct}}} attributes, cf.\ \secref{sec:cases-induct}.  The \hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}} package already takes care of this.
   4.526 +  \item \hyperlink{method.HOL.case-tac}{\mbox{\isa{case{\isacharunderscore}tac}}} and \hyperlink{method.HOL.induct-tac}{\mbox{\isa{induct{\isacharunderscore}tac}}} admit
   4.527 +  to reason about inductive types.  Rules are selected according to
   4.528 +  the declarations by the \hyperlink{attribute.cases}{\mbox{\isa{cases}}} and \hyperlink{attribute.induct}{\mbox{\isa{induct}}}
   4.529 +  attributes, cf.\ \secref{sec:cases-induct}.  The \hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}} package already takes care of this.
   4.530  
   4.531    These unstructured tactics feature both goal addressing and dynamic
   4.532    instantiation.  Note that named rule cases are \emph{not} provided
   4.533 @@ -908,7 +908,7 @@
   4.534    statements, only the compact object-logic conclusion of the subgoal
   4.535    being addressed.
   4.536    
   4.537 -  \item [\hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isacharunderscore}cases}}} and \hyperlink{command.HOL.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}cases}}}}] provide an interface to the internal \verb|mk_cases| operation.  Rules are simplified in an unrestricted
   4.538 +  \item \hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isacharunderscore}cases}}} and \hyperlink{command.HOL.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}cases}}}} provide an interface to the internal \verb|mk_cases| operation.  Rules are simplified in an unrestricted
   4.539    forward manner.
   4.540  
   4.541    While \hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isacharunderscore}cases}}} is a proof method to apply the
   4.542 @@ -916,7 +916,7 @@
   4.543    for later use.  The \hyperlink{keyword.for}{\mbox{\isa{\isakeyword{for}}}} argument of the \hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isacharunderscore}cases}}} method allows to specify a list of variables that should
   4.544    be generalized before applying the resulting rule.
   4.545  
   4.546 -  \end{descr}%
   4.547 +  \end{description}%
   4.548  \end{isamarkuptext}%
   4.549  \isamarkuptrue%
   4.550  %
   4.551 @@ -935,12 +935,12 @@
   4.552    (this actually covers the new-style theory format as well).
   4.553  
   4.554    \begin{matharray}{rcl}
   4.555 -    \indexdef{HOL}{command}{value}\hypertarget{command.HOL.value}{\hyperlink{command.HOL.value}{\mbox{\isa{\isacommand{value}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   4.556 -    \indexdef{HOL}{command}{code\_module}\hypertarget{command.HOL.code-module}{\hyperlink{command.HOL.code-module}{\mbox{\isa{\isacommand{code{\isacharunderscore}module}}}}} & : & \isartrans{theory}{theory} \\
   4.557 -    \indexdef{HOL}{command}{code\_library}\hypertarget{command.HOL.code-library}{\hyperlink{command.HOL.code-library}{\mbox{\isa{\isacommand{code{\isacharunderscore}library}}}}} & : & \isartrans{theory}{theory} \\
   4.558 -    \indexdef{HOL}{command}{consts\_code}\hypertarget{command.HOL.consts-code}{\hyperlink{command.HOL.consts-code}{\mbox{\isa{\isacommand{consts{\isacharunderscore}code}}}}} & : & \isartrans{theory}{theory} \\
   4.559 -    \indexdef{HOL}{command}{types\_code}\hypertarget{command.HOL.types-code}{\hyperlink{command.HOL.types-code}{\mbox{\isa{\isacommand{types{\isacharunderscore}code}}}}} & : & \isartrans{theory}{theory} \\  
   4.560 -    \indexdef{HOL}{attribute}{code}\hypertarget{attribute.HOL.code}{\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}} & : & \isaratt \\
   4.561 +    \indexdef{HOL}{command}{value}\hypertarget{command.HOL.value}{\hyperlink{command.HOL.value}{\mbox{\isa{\isacommand{value}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   4.562 +    \indexdef{HOL}{command}{code\_module}\hypertarget{command.HOL.code-module}{\hyperlink{command.HOL.code-module}{\mbox{\isa{\isacommand{code{\isacharunderscore}module}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.563 +    \indexdef{HOL}{command}{code\_library}\hypertarget{command.HOL.code-library}{\hyperlink{command.HOL.code-library}{\mbox{\isa{\isacommand{code{\isacharunderscore}library}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.564 +    \indexdef{HOL}{command}{consts\_code}\hypertarget{command.HOL.consts-code}{\hyperlink{command.HOL.consts-code}{\mbox{\isa{\isacommand{consts{\isacharunderscore}code}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.565 +    \indexdef{HOL}{command}{types\_code}\hypertarget{command.HOL.types-code}{\hyperlink{command.HOL.types-code}{\mbox{\isa{\isacommand{types{\isacharunderscore}code}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\  
   4.566 +    \indexdef{HOL}{attribute}{code}\hypertarget{attribute.HOL.code}{\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}} & : & \isa{attribute} \\
   4.567    \end{matharray}
   4.568  
   4.569    \begin{rail}
   4.570 @@ -980,12 +980,12 @@
   4.571    ;
   4.572    \end{rail}
   4.573  
   4.574 -  \begin{descr}
   4.575 +  \begin{description}
   4.576  
   4.577 -  \item [\hyperlink{command.HOL.value}{\mbox{\isa{\isacommand{value}}}}~\isa{t}] evaluates and prints a
   4.578 -  term using the code generator.
   4.579 +  \item \hyperlink{command.HOL.value}{\mbox{\isa{\isacommand{value}}}}~\isa{t} evaluates and prints a term
   4.580 +  using the code generator.
   4.581  
   4.582 -  \end{descr}
   4.583 +  \end{description}
   4.584  
   4.585    \medskip The other framework generates code from functional programs
   4.586    (including overloading using type classes) to SML \cite{SML}, OCaml
   4.587 @@ -997,21 +997,21 @@
   4.588    introduction on how to use it.
   4.589  
   4.590    \begin{matharray}{rcl}
   4.591 -    \indexdef{HOL}{command}{export\_code}\hypertarget{command.HOL.export-code}{\hyperlink{command.HOL.export-code}{\mbox{\isa{\isacommand{export{\isacharunderscore}code}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   4.592 -    \indexdef{HOL}{command}{code\_thms}\hypertarget{command.HOL.code-thms}{\hyperlink{command.HOL.code-thms}{\mbox{\isa{\isacommand{code{\isacharunderscore}thms}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   4.593 -    \indexdef{HOL}{command}{code\_deps}\hypertarget{command.HOL.code-deps}{\hyperlink{command.HOL.code-deps}{\mbox{\isa{\isacommand{code{\isacharunderscore}deps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   4.594 -    \indexdef{HOL}{command}{code\_datatype}\hypertarget{command.HOL.code-datatype}{\hyperlink{command.HOL.code-datatype}{\mbox{\isa{\isacommand{code{\isacharunderscore}datatype}}}}} & : & \isartrans{theory}{theory} \\
   4.595 -    \indexdef{HOL}{command}{code\_const}\hypertarget{command.HOL.code-const}{\hyperlink{command.HOL.code-const}{\mbox{\isa{\isacommand{code{\isacharunderscore}const}}}}} & : & \isartrans{theory}{theory} \\
   4.596 -    \indexdef{HOL}{command}{code\_type}\hypertarget{command.HOL.code-type}{\hyperlink{command.HOL.code-type}{\mbox{\isa{\isacommand{code{\isacharunderscore}type}}}}} & : & \isartrans{theory}{theory} \\
   4.597 -    \indexdef{HOL}{command}{code\_class}\hypertarget{command.HOL.code-class}{\hyperlink{command.HOL.code-class}{\mbox{\isa{\isacommand{code{\isacharunderscore}class}}}}} & : & \isartrans{theory}{theory} \\
   4.598 -    \indexdef{HOL}{command}{code\_instance}\hypertarget{command.HOL.code-instance}{\hyperlink{command.HOL.code-instance}{\mbox{\isa{\isacommand{code{\isacharunderscore}instance}}}}} & : & \isartrans{theory}{theory} \\
   4.599 -    \indexdef{HOL}{command}{code\_monad}\hypertarget{command.HOL.code-monad}{\hyperlink{command.HOL.code-monad}{\mbox{\isa{\isacommand{code{\isacharunderscore}monad}}}}} & : & \isartrans{theory}{theory} \\
   4.600 -    \indexdef{HOL}{command}{code\_reserved}\hypertarget{command.HOL.code-reserved}{\hyperlink{command.HOL.code-reserved}{\mbox{\isa{\isacommand{code{\isacharunderscore}reserved}}}}} & : & \isartrans{theory}{theory} \\
   4.601 -    \indexdef{HOL}{command}{code\_include}\hypertarget{command.HOL.code-include}{\hyperlink{command.HOL.code-include}{\mbox{\isa{\isacommand{code{\isacharunderscore}include}}}}} & : & \isartrans{theory}{theory} \\
   4.602 -    \indexdef{HOL}{command}{code\_modulename}\hypertarget{command.HOL.code-modulename}{\hyperlink{command.HOL.code-modulename}{\mbox{\isa{\isacommand{code{\isacharunderscore}modulename}}}}} & : & \isartrans{theory}{theory} \\
   4.603 -    \indexdef{HOL}{command}{code\_abort}\hypertarget{command.HOL.code-abort}{\hyperlink{command.HOL.code-abort}{\mbox{\isa{\isacommand{code{\isacharunderscore}abort}}}}} & : & \isartrans{theory}{theory} \\
   4.604 -    \indexdef{HOL}{command}{print\_codesetup}\hypertarget{command.HOL.print-codesetup}{\hyperlink{command.HOL.print-codesetup}{\mbox{\isa{\isacommand{print{\isacharunderscore}codesetup}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   4.605 -    \indexdef{HOL}{attribute}{code}\hypertarget{attribute.HOL.code}{\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}} & : & \isaratt \\
   4.606 +    \indexdef{HOL}{command}{export\_code}\hypertarget{command.HOL.export-code}{\hyperlink{command.HOL.export-code}{\mbox{\isa{\isacommand{export{\isacharunderscore}code}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   4.607 +    \indexdef{HOL}{command}{code\_thms}\hypertarget{command.HOL.code-thms}{\hyperlink{command.HOL.code-thms}{\mbox{\isa{\isacommand{code{\isacharunderscore}thms}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   4.608 +    \indexdef{HOL}{command}{code\_deps}\hypertarget{command.HOL.code-deps}{\hyperlink{command.HOL.code-deps}{\mbox{\isa{\isacommand{code{\isacharunderscore}deps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   4.609 +    \indexdef{HOL}{command}{code\_datatype}\hypertarget{command.HOL.code-datatype}{\hyperlink{command.HOL.code-datatype}{\mbox{\isa{\isacommand{code{\isacharunderscore}datatype}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.610 +    \indexdef{HOL}{command}{code\_const}\hypertarget{command.HOL.code-const}{\hyperlink{command.HOL.code-const}{\mbox{\isa{\isacommand{code{\isacharunderscore}const}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.611 +    \indexdef{HOL}{command}{code\_type}\hypertarget{command.HOL.code-type}{\hyperlink{command.HOL.code-type}{\mbox{\isa{\isacommand{code{\isacharunderscore}type}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.612 +    \indexdef{HOL}{command}{code\_class}\hypertarget{command.HOL.code-class}{\hyperlink{command.HOL.code-class}{\mbox{\isa{\isacommand{code{\isacharunderscore}class}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.613 +    \indexdef{HOL}{command}{code\_instance}\hypertarget{command.HOL.code-instance}{\hyperlink{command.HOL.code-instance}{\mbox{\isa{\isacommand{code{\isacharunderscore}instance}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.614 +    \indexdef{HOL}{command}{code\_monad}\hypertarget{command.HOL.code-monad}{\hyperlink{command.HOL.code-monad}{\mbox{\isa{\isacommand{code{\isacharunderscore}monad}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.615 +    \indexdef{HOL}{command}{code\_reserved}\hypertarget{command.HOL.code-reserved}{\hyperlink{command.HOL.code-reserved}{\mbox{\isa{\isacommand{code{\isacharunderscore}reserved}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.616 +    \indexdef{HOL}{command}{code\_include}\hypertarget{command.HOL.code-include}{\hyperlink{command.HOL.code-include}{\mbox{\isa{\isacommand{code{\isacharunderscore}include}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.617 +    \indexdef{HOL}{command}{code\_modulename}\hypertarget{command.HOL.code-modulename}{\hyperlink{command.HOL.code-modulename}{\mbox{\isa{\isacommand{code{\isacharunderscore}modulename}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.618 +    \indexdef{HOL}{command}{code\_abort}\hypertarget{command.HOL.code-abort}{\hyperlink{command.HOL.code-abort}{\mbox{\isa{\isacommand{code{\isacharunderscore}abort}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   4.619 +    \indexdef{HOL}{command}{print\_codesetup}\hypertarget{command.HOL.print-codesetup}{\hyperlink{command.HOL.print-codesetup}{\mbox{\isa{\isacommand{print{\isacharunderscore}codesetup}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   4.620 +    \indexdef{HOL}{attribute}{code}\hypertarget{attribute.HOL.code}{\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}} & : & \isa{attribute} \\
   4.621    \end{matharray}
   4.622  
   4.623    \begin{rail}
   4.624 @@ -1082,14 +1082,14 @@
   4.625      ;
   4.626    \end{rail}
   4.627  
   4.628 -  \begin{descr}
   4.629 +  \begin{description}
   4.630  
   4.631 -  \item [\hyperlink{command.HOL.export-code}{\mbox{\isa{\isacommand{export{\isacharunderscore}code}}}}] is the canonical interface
   4.632 -  for generating and serializing code: for a given list of constants,
   4.633 -  code is generated for the specified target languages.  Abstract code
   4.634 -  is cached incrementally.  If no constant is given, the currently
   4.635 -  cached code is serialized.  If no serialization instruction is
   4.636 -  given, only abstract code is cached.
   4.637 +  \item \hyperlink{command.HOL.export-code}{\mbox{\isa{\isacommand{export{\isacharunderscore}code}}}} is the canonical interface for
   4.638 +  generating and serializing code: for a given list of constants, code
   4.639 +  is generated for the specified target languages.  Abstract code is
   4.640 +  cached incrementally.  If no constant is given, the currently cached
   4.641 +  code is serialized.  If no serialization instruction is given, only
   4.642 +  abstract code is cached.
   4.643  
   4.644    Constants may be specified by giving them literally, referring to
   4.645    all executable contants within a certain theory by giving \isa{{\isachardoublequote}name{\isachardot}{\isacharasterisk}{\isachardoublequote}}, or referring to \emph{all} executable constants currently
   4.646 @@ -1111,71 +1111,70 @@
   4.647    \emph{Haskell} a module name prefix may be given using the ``\isa{{\isachardoublequote}root{\isacharcolon}{\isachardoublequote}}'' argument; ``\isa{string{\isacharunderscore}classes}'' adds a ``\verb|deriving (Read, Show)|'' clause to each appropriate datatype
   4.648    declaration.
   4.649  
   4.650 -  \item [\hyperlink{command.HOL.code-thms}{\mbox{\isa{\isacommand{code{\isacharunderscore}thms}}}}] prints a list of theorems
   4.651 +  \item \hyperlink{command.HOL.code-thms}{\mbox{\isa{\isacommand{code{\isacharunderscore}thms}}}} prints a list of theorems
   4.652    representing the corresponding program containing all given
   4.653    constants; if no constants are given, the currently cached code
   4.654    theorems are printed.
   4.655  
   4.656 -  \item [\hyperlink{command.HOL.code-deps}{\mbox{\isa{\isacommand{code{\isacharunderscore}deps}}}}] visualizes dependencies of
   4.657 +  \item \hyperlink{command.HOL.code-deps}{\mbox{\isa{\isacommand{code{\isacharunderscore}deps}}}} visualizes dependencies of
   4.658    theorems representing the corresponding program containing all given
   4.659    constants; if no constants are given, the currently cached code
   4.660    theorems are visualized.
   4.661  
   4.662 -  \item [\hyperlink{command.HOL.code-datatype}{\mbox{\isa{\isacommand{code{\isacharunderscore}datatype}}}}] specifies a constructor set
   4.663 +  \item \hyperlink{command.HOL.code-datatype}{\mbox{\isa{\isacommand{code{\isacharunderscore}datatype}}}} specifies a constructor set
   4.664    for a logical type.
   4.665  
   4.666 -  \item [\hyperlink{command.HOL.code-const}{\mbox{\isa{\isacommand{code{\isacharunderscore}const}}}}] associates a list of constants
   4.667 +  \item \hyperlink{command.HOL.code-const}{\mbox{\isa{\isacommand{code{\isacharunderscore}const}}}} associates a list of constants
   4.668    with target-specific serializations; omitting a serialization
   4.669    deletes an existing serialization.
   4.670  
   4.671 -  \item [\hyperlink{command.HOL.code-type}{\mbox{\isa{\isacommand{code{\isacharunderscore}type}}}}] associates a list of type
   4.672 +  \item \hyperlink{command.HOL.code-type}{\mbox{\isa{\isacommand{code{\isacharunderscore}type}}}} associates a list of type
   4.673    constructors with target-specific serializations; omitting a
   4.674    serialization deletes an existing serialization.
   4.675  
   4.676 -  \item [\hyperlink{command.HOL.code-class}{\mbox{\isa{\isacommand{code{\isacharunderscore}class}}}}] associates a list of classes
   4.677 -  with target-specific class names; omitting a
   4.678 -  serialization deletes an existing serialization.
   4.679 -  This applies only to \emph{Haskell}.
   4.680 +  \item \hyperlink{command.HOL.code-class}{\mbox{\isa{\isacommand{code{\isacharunderscore}class}}}} associates a list of classes
   4.681 +  with target-specific class names; omitting a serialization deletes
   4.682 +  an existing serialization.  This applies only to \emph{Haskell}.
   4.683  
   4.684 -  \item [\hyperlink{command.HOL.code-instance}{\mbox{\isa{\isacommand{code{\isacharunderscore}instance}}}}] declares a list of type
   4.685 +  \item \hyperlink{command.HOL.code-instance}{\mbox{\isa{\isacommand{code{\isacharunderscore}instance}}}} declares a list of type
   4.686    constructor / class instance relations as ``already present'' for a
   4.687    given target.  Omitting a ``\isa{{\isachardoublequote}{\isacharminus}{\isachardoublequote}}'' deletes an existing
   4.688    ``already present'' declaration.  This applies only to
   4.689    \emph{Haskell}.
   4.690  
   4.691 -  \item [\hyperlink{command.HOL.code-monad}{\mbox{\isa{\isacommand{code{\isacharunderscore}monad}}}}] provides an auxiliary
   4.692 -  mechanism to generate monadic code for Haskell.
   4.693 +  \item \hyperlink{command.HOL.code-monad}{\mbox{\isa{\isacommand{code{\isacharunderscore}monad}}}} provides an auxiliary mechanism
   4.694 +  to generate monadic code for Haskell.
   4.695  
   4.696 -  \item [\hyperlink{command.HOL.code-reserved}{\mbox{\isa{\isacommand{code{\isacharunderscore}reserved}}}}] declares a list of names as
   4.697 +  \item \hyperlink{command.HOL.code-reserved}{\mbox{\isa{\isacommand{code{\isacharunderscore}reserved}}}} declares a list of names as
   4.698    reserved for a given target, preventing it to be shadowed by any
   4.699    generated code.
   4.700  
   4.701 -  \item [\hyperlink{command.HOL.code-include}{\mbox{\isa{\isacommand{code{\isacharunderscore}include}}}}] adds arbitrary named content
   4.702 +  \item \hyperlink{command.HOL.code-include}{\mbox{\isa{\isacommand{code{\isacharunderscore}include}}}} adds arbitrary named content
   4.703    (``include'') to generated code.  A ``\isa{{\isachardoublequote}{\isacharminus}{\isachardoublequote}}'' as last argument
   4.704    will remove an already added ``include''.
   4.705  
   4.706 -  \item [\hyperlink{command.HOL.code-modulename}{\mbox{\isa{\isacommand{code{\isacharunderscore}modulename}}}}] declares aliasings from
   4.707 -  one module name onto another.
   4.708 +  \item \hyperlink{command.HOL.code-modulename}{\mbox{\isa{\isacommand{code{\isacharunderscore}modulename}}}} declares aliasings from one
   4.709 +  module name onto another.
   4.710  
   4.711 -  \item [\hyperlink{command.HOL.code-abort}{\mbox{\isa{\isacommand{code{\isacharunderscore}abort}}}}] declares constants which
   4.712 -  are not required to have a definition by means of defining equations;
   4.713 -  if needed these are implemented by program abort instead.
   4.714 +  \item \hyperlink{command.HOL.code-abort}{\mbox{\isa{\isacommand{code{\isacharunderscore}abort}}}} declares constants which are not
   4.715 +  required to have a definition by means of defining equations; if
   4.716 +  needed these are implemented by program abort instead.
   4.717  
   4.718 -  \item [\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}] explicitly selects (or
   4.719 -  with option ``\isa{{\isachardoublequote}del{\isachardoublequote}}'' deselects) a defining equation for
   4.720 -  code generation.  Usually packages introducing defining equations
   4.721 -  provide a reasonable default setup for selection.
   4.722 +  \item \hyperlink{attribute.HOL.code}{\mbox{\isa{code}}} explicitly selects (or with option
   4.723 +  ``\isa{{\isachardoublequote}del{\isachardoublequote}}'' deselects) a defining equation for code
   4.724 +  generation.  Usually packages introducing defining equations provide
   4.725 +  a reasonable default setup for selection.
   4.726  
   4.727 -  \item [\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}\isa{inline}] declares (or with
   4.728 +  \item \hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}~\isa{inline} declares (or with
   4.729    option ``\isa{{\isachardoublequote}del{\isachardoublequote}}'' removes) inlining theorems which are
   4.730    applied as rewrite rules to any defining equation during
   4.731    preprocessing.
   4.732  
   4.733 -  \item [\hyperlink{command.HOL.print-codesetup}{\mbox{\isa{\isacommand{print{\isacharunderscore}codesetup}}}}] gives an overview on
   4.734 +  \item \hyperlink{command.HOL.print-codesetup}{\mbox{\isa{\isacommand{print{\isacharunderscore}codesetup}}}} gives an overview on
   4.735    selected defining equations, code generator datatypes and
   4.736    preprocessor setup.
   4.737  
   4.738 -  \end{descr}%
   4.739 +  \end{description}%
   4.740  \end{isamarkuptext}%
   4.741  \isamarkuptrue%
   4.742  %
   4.743 @@ -1185,8 +1184,8 @@
   4.744  %
   4.745  \begin{isamarkuptext}%
   4.746  \begin{matharray}{rcl}
   4.747 -    \indexdef{HOL}{command}{specification}\hypertarget{command.HOL.specification}{\hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}}} & : & \isartrans{theory}{proof(prove)} \\
   4.748 -    \indexdef{HOL}{command}{ax\_specification}\hypertarget{command.HOL.ax-specification}{\hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isacharunderscore}specification}}}}} & : & \isartrans{theory}{proof(prove)} \\
   4.749 +    \indexdef{HOL}{command}{specification}\hypertarget{command.HOL.specification}{\hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   4.750 +    \indexdef{HOL}{command}{ax\_specification}\hypertarget{command.HOL.ax-specification}{\hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isacharunderscore}specification}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   4.751    \end{matharray}
   4.752  
   4.753    \begin{rail}
   4.754 @@ -1195,27 +1194,27 @@
   4.755    decl: ((name ':')? term '(' 'overloaded' ')'?)
   4.756    \end{rail}
   4.757  
   4.758 -  \begin{descr}
   4.759 +  \begin{description}
   4.760  
   4.761 -  \item [\hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}}~\isa{{\isachardoublequote}decls\ {\isasymphi}{\isachardoublequote}}] sets up a
   4.762 +  \item \hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}}~\isa{{\isachardoublequote}decls\ {\isasymphi}{\isachardoublequote}} sets up a
   4.763    goal stating the existence of terms with the properties specified to
   4.764    hold for the constants given in \isa{decls}.  After finishing the
   4.765    proof, the theory will be augmented with definitions for the given
   4.766    constants, as well as with theorems stating the properties for these
   4.767    constants.
   4.768  
   4.769 -  \item [\hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isacharunderscore}specification}}}}~\isa{{\isachardoublequote}decls\ {\isasymphi}{\isachardoublequote}}] sets
   4.770 -  up a goal stating the existence of terms with the properties
   4.771 -  specified to hold for the constants given in \isa{decls}.  After
   4.772 -  finishing the proof, the theory will be augmented with axioms
   4.773 -  expressing the properties given in the first place.
   4.774 +  \item \hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isacharunderscore}specification}}}}~\isa{{\isachardoublequote}decls\ {\isasymphi}{\isachardoublequote}} sets up
   4.775 +  a goal stating the existence of terms with the properties specified
   4.776 +  to hold for the constants given in \isa{decls}.  After finishing
   4.777 +  the proof, the theory will be augmented with axioms expressing the
   4.778 +  properties given in the first place.
   4.779  
   4.780 -  \item [\isa{decl}] declares a constant to be defined by the
   4.781 +  \item \isa{decl} declares a constant to be defined by the
   4.782    specification given.  The definition for the constant \isa{c} is
   4.783    bound to the name \isa{c{\isacharunderscore}def} unless a theorem name is given in
   4.784    the declaration.  Overloaded constants should be declared as such.
   4.785  
   4.786 -  \end{descr}
   4.787 +  \end{description}
   4.788  
   4.789    Whether to use \hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}} or \hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isacharunderscore}specification}}}} is to some extent a matter of style.  \hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}} introduces no new axioms, and so by
   4.790    construction cannot introduce inconsistencies, whereas \hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isacharunderscore}specification}}}} does introduce axioms, but only after the
     5.1 --- a/doc-src/IsarRef/Thy/document/Misc.tex	Thu Nov 13 22:44:40 2008 +0100
     5.2 +++ b/doc-src/IsarRef/Thy/document/Misc.tex	Thu Nov 13 22:45:12 2008 +0100
     5.3 @@ -20,115 +20,25 @@
     5.4  %
     5.5  \endisadelimtheory
     5.6  %
     5.7 -\isamarkupchapter{Other commands \label{ch:pure-syntax}%
     5.8 -}
     5.9 -\isamarkuptrue%
    5.10 -%
    5.11 -\isamarkupsection{Diagnostics%
    5.12 +\isamarkupchapter{Other commands%
    5.13  }
    5.14  \isamarkuptrue%
    5.15  %
    5.16 -\begin{isamarkuptext}%
    5.17 -\begin{matharray}{rcl}
    5.18 -    \indexdef{}{command}{pr}\hypertarget{command.pr}{\hyperlink{command.pr}{\mbox{\isa{\isacommand{pr}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
    5.19 -    \indexdef{}{command}{thm}\hypertarget{command.thm}{\hyperlink{command.thm}{\mbox{\isa{\isacommand{thm}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
    5.20 -    \indexdef{}{command}{term}\hypertarget{command.term}{\hyperlink{command.term}{\mbox{\isa{\isacommand{term}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
    5.21 -    \indexdef{}{command}{prop}\hypertarget{command.prop}{\hyperlink{command.prop}{\mbox{\isa{\isacommand{prop}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
    5.22 -    \indexdef{}{command}{typ}\hypertarget{command.typ}{\hyperlink{command.typ}{\mbox{\isa{\isacommand{typ}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
    5.23 -    \indexdef{}{command}{prf}\hypertarget{command.prf}{\hyperlink{command.prf}{\mbox{\isa{\isacommand{prf}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
    5.24 -    \indexdef{}{command}{full\_prf}\hypertarget{command.full-prf}{\hyperlink{command.full-prf}{\mbox{\isa{\isacommand{full{\isacharunderscore}prf}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
    5.25 -  \end{matharray}
    5.26 -
    5.27 -  These diagnostic commands assist interactive development.  Note that
    5.28 -  \hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}} does not apply here, the theory or proof
    5.29 -  configuration is not changed.
    5.30 -
    5.31 -  \begin{rail}
    5.32 -    'pr' modes? nat? (',' nat)?
    5.33 -    ;
    5.34 -    'thm' modes? thmrefs
    5.35 -    ;
    5.36 -    'term' modes? term
    5.37 -    ;
    5.38 -    'prop' modes? prop
    5.39 -    ;
    5.40 -    'typ' modes? type
    5.41 -    ;
    5.42 -    'prf' modes? thmrefs?
    5.43 -    ;
    5.44 -    'full\_prf' modes? thmrefs?
    5.45 -    ;
    5.46 -
    5.47 -    modes: '(' (name + ) ')'
    5.48 -    ;
    5.49 -  \end{rail}
    5.50 -
    5.51 -  \begin{descr}
    5.52 -
    5.53 -  \item [\hyperlink{command.pr}{\mbox{\isa{\isacommand{pr}}}}~\isa{{\isachardoublequote}goals{\isacharcomma}\ prems{\isachardoublequote}}] prints the current
    5.54 -  proof state (if present), including the proof context, current facts
    5.55 -  and goals.  The optional limit arguments affect the number of goals
    5.56 -  and premises to be displayed, which is initially 10 for both.
    5.57 -  Omitting limit values leaves the current setting unchanged.
    5.58 -
    5.59 -  \item [\hyperlink{command.thm}{\mbox{\isa{\isacommand{thm}}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] retrieves
    5.60 -  theorems from the current theory or proof context.  Note that any
    5.61 -  attributes included in the theorem specifications are applied to a
    5.62 -  temporary context derived from the current theory or proof; the
    5.63 -  result is discarded, i.e.\ attributes involved in \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ a\isactrlsub n{\isachardoublequote}} do not have any permanent effect.
    5.64 -
    5.65 -  \item [\hyperlink{command.term}{\mbox{\isa{\isacommand{term}}}}~\isa{t} and \hyperlink{command.prop}{\mbox{\isa{\isacommand{prop}}}}~\isa{{\isasymphi}}]
    5.66 -  read, type-check and print terms or propositions according to the
    5.67 -  current theory or proof context; the inferred type of \isa{t} is
    5.68 -  output as well.  Note that these commands are also useful in
    5.69 -  inspecting the current environment of term abbreviations.
    5.70 -
    5.71 -  \item [\hyperlink{command.typ}{\mbox{\isa{\isacommand{typ}}}}~\isa{{\isasymtau}}] reads and prints types of the
    5.72 -  meta-logic according to the current theory or proof context.
    5.73 -
    5.74 -  \item [\hyperlink{command.prf}{\mbox{\isa{\isacommand{prf}}}}] displays the (compact) proof term of the
    5.75 -  current proof state (if present), or of the given theorems. Note
    5.76 -  that this requires proof terms to be switched on for the current
    5.77 -  object logic (see the ``Proof terms'' section of the Isabelle
    5.78 -  reference manual for information on how to do this).
    5.79 -
    5.80 -  \item [\hyperlink{command.full-prf}{\mbox{\isa{\isacommand{full{\isacharunderscore}prf}}}}] is like \hyperlink{command.prf}{\mbox{\isa{\isacommand{prf}}}}, but displays
    5.81 -  the full proof term, i.e.\ also displays information omitted in the
    5.82 -  compact proof term, which is denoted by ``\isa{{\isacharunderscore}}'' placeholders
    5.83 -  there.
    5.84 -
    5.85 -  \end{descr}
    5.86 -
    5.87 -  All of the diagnostic commands above admit a list of \isa{modes}
    5.88 -  to be specified, which is appended to the current print mode (see
    5.89 -  also \cite{isabelle-ref}).  Thus the output behavior may be modified
    5.90 -  according particular print mode features.  For example, \hyperlink{command.pr}{\mbox{\isa{\isacommand{pr}}}}~\isa{{\isachardoublequote}{\isacharparenleft}latex\ xsymbols\ symbols{\isacharparenright}{\isachardoublequote}} would print the current
    5.91 -  proof state with mathematical symbols and special characters
    5.92 -  represented in {\LaTeX} source, according to the Isabelle style
    5.93 -  \cite{isabelle-sys}.
    5.94 -
    5.95 -  Note that antiquotations (cf.\ \secref{sec:antiq}) provide a more
    5.96 -  systematic way to include formal items into the printed text
    5.97 -  document.%
    5.98 -\end{isamarkuptext}%
    5.99 -\isamarkuptrue%
   5.100 -%
   5.101  \isamarkupsection{Inspecting the context%
   5.102  }
   5.103  \isamarkuptrue%
   5.104  %
   5.105  \begin{isamarkuptext}%
   5.106  \begin{matharray}{rcl}
   5.107 -    \indexdef{}{command}{print\_commands}\hypertarget{command.print-commands}{\hyperlink{command.print-commands}{\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   5.108 -    \indexdef{}{command}{print\_theory}\hypertarget{command.print-theory}{\hyperlink{command.print-theory}{\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   5.109 -    \indexdef{}{command}{print\_syntax}\hypertarget{command.print-syntax}{\hyperlink{command.print-syntax}{\mbox{\isa{\isacommand{print{\isacharunderscore}syntax}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   5.110 -    \indexdef{}{command}{print\_methods}\hypertarget{command.print-methods}{\hyperlink{command.print-methods}{\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   5.111 -    \indexdef{}{command}{print\_attributes}\hypertarget{command.print-attributes}{\hyperlink{command.print-attributes}{\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   5.112 -    \indexdef{}{command}{print\_theorems}\hypertarget{command.print-theorems}{\hyperlink{command.print-theorems}{\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   5.113 -    \indexdef{}{command}{find\_theorems}\hypertarget{command.find-theorems}{\hyperlink{command.find-theorems}{\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   5.114 -    \indexdef{}{command}{thm\_deps}\hypertarget{command.thm-deps}{\hyperlink{command.thm-deps}{\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   5.115 -    \indexdef{}{command}{print\_facts}\hypertarget{command.print-facts}{\hyperlink{command.print-facts}{\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{proof} \\
   5.116 -    \indexdef{}{command}{print\_binds}\hypertarget{command.print-binds}{\hyperlink{command.print-binds}{\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{proof} \\
   5.117 +    \indexdef{}{command}{print\_commands}\hypertarget{command.print-commands}{\hyperlink{command.print-commands}{\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.118 +    \indexdef{}{command}{print\_theory}\hypertarget{command.print-theory}{\hyperlink{command.print-theory}{\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.119 +    \indexdef{}{command}{print\_methods}\hypertarget{command.print-methods}{\hyperlink{command.print-methods}{\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.120 +    \indexdef{}{command}{print\_attributes}\hypertarget{command.print-attributes}{\hyperlink{command.print-attributes}{\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.121 +    \indexdef{}{command}{print\_theorems}\hypertarget{command.print-theorems}{\hyperlink{command.print-theorems}{\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.122 +    \indexdef{}{command}{find\_theorems}\hypertarget{command.find-theorems}{\hyperlink{command.find-theorems}{\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.123 +    \indexdef{}{command}{thm\_deps}\hypertarget{command.thm-deps}{\hyperlink{command.thm-deps}{\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.124 +    \indexdef{}{command}{print\_facts}\hypertarget{command.print-facts}{\hyperlink{command.print-facts}{\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.125 +    \indexdef{}{command}{print\_binds}\hypertarget{command.print-binds}{\hyperlink{command.print-binds}{\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.126    \end{matharray}
   5.127  
   5.128    \begin{rail}
   5.129 @@ -148,31 +58,25 @@
   5.130    Note that there are some further ones available, such as for the set
   5.131    of rules declared for simplifications.
   5.132  
   5.133 -  \begin{descr}
   5.134 +  \begin{description}
   5.135    
   5.136 -  \item [\hyperlink{command.print-commands}{\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}}] prints Isabelle's outer theory
   5.137 +  \item \hyperlink{command.print-commands}{\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}} prints Isabelle's outer theory
   5.138    syntax, including keywords and command.
   5.139    
   5.140 -  \item [\hyperlink{command.print-theory}{\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}}] prints the main logical content of
   5.141 +  \item \hyperlink{command.print-theory}{\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}} prints the main logical content of
   5.142    the theory context; the ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' option indicates extra
   5.143    verbosity.
   5.144  
   5.145 -  \item [\hyperlink{command.print-syntax}{\mbox{\isa{\isacommand{print{\isacharunderscore}syntax}}}}] prints the inner syntax of types
   5.146 -  and terms, depending on the current context.  The output can be very
   5.147 -  verbose, including grammar tables and syntax translation rules.  See
   5.148 -  \cite[\S7, \S8]{isabelle-ref} for further information on Isabelle's
   5.149 -  inner syntax.
   5.150 -  
   5.151 -  \item [\hyperlink{command.print-methods}{\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}}] prints all proof methods
   5.152 +  \item \hyperlink{command.print-methods}{\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}} prints all proof methods
   5.153    available in the current theory context.
   5.154    
   5.155 -  \item [\hyperlink{command.print-attributes}{\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}}] prints all attributes
   5.156 +  \item \hyperlink{command.print-attributes}{\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}} prints all attributes
   5.157    available in the current theory context.
   5.158    
   5.159 -  \item [\hyperlink{command.print-theorems}{\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}}] prints theorems resulting from
   5.160 +  \item \hyperlink{command.print-theorems}{\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}} prints theorems resulting from
   5.161    the last command.
   5.162    
   5.163 -  \item [\hyperlink{command.find-theorems}{\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}}~\isa{criteria}] retrieves facts
   5.164 +  \item \hyperlink{command.find-theorems}{\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}}~\isa{criteria} retrieves facts
   5.165    from the theory or proof context matching all of given search
   5.166    criteria.  The criterion \isa{{\isachardoublequote}name{\isacharcolon}\ p{\isachardoublequote}} selects all theorems
   5.167    whose fully qualified name matches pattern \isa{p}, which may
   5.168 @@ -191,17 +95,17 @@
   5.169    default, duplicates are removed from the search result. Use
   5.170    \isa{with{\isacharunderscore}dups} to display duplicates.
   5.171    
   5.172 -  \item [\hyperlink{command.thm-deps}{\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}]
   5.173 +  \item \hyperlink{command.thm-deps}{\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}
   5.174    visualizes dependencies of facts, using Isabelle's graph browser
   5.175    tool (see also \cite{isabelle-sys}).
   5.176    
   5.177 -  \item [\hyperlink{command.print-facts}{\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}}] prints all local facts of the
   5.178 +  \item \hyperlink{command.print-facts}{\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}} prints all local facts of the
   5.179    current context, both named and unnamed ones.
   5.180    
   5.181 -  \item [\hyperlink{command.print-binds}{\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}}] prints all term abbreviations
   5.182 +  \item \hyperlink{command.print-binds}{\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}} prints all term abbreviations
   5.183    present in the context.
   5.184  
   5.185 -  \end{descr}%
   5.186 +  \end{description}%
   5.187  \end{isamarkuptext}%
   5.188  \isamarkuptrue%
   5.189  %
   5.190 @@ -211,9 +115,9 @@
   5.191  %
   5.192  \begin{isamarkuptext}%
   5.193  \begin{matharray}{rcl}
   5.194 -    \indexdef{}{command}{undo}\hypertarget{command.undo}{\hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
   5.195 -    \indexdef{}{command}{linear\_undo}\hypertarget{command.linear-undo}{\hyperlink{command.linear-undo}{\mbox{\isa{\isacommand{linear{\isacharunderscore}undo}}}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
   5.196 -    \indexdef{}{command}{kill}\hypertarget{command.kill}{\hyperlink{command.kill}{\mbox{\isa{\isacommand{kill}}}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
   5.197 +    \indexdef{}{command}{undo}\hypertarget{command.undo}{\hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}}}^{{ * }{ * }} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}\ any{\isachardoublequote}} \\
   5.198 +    \indexdef{}{command}{linear\_undo}\hypertarget{command.linear-undo}{\hyperlink{command.linear-undo}{\mbox{\isa{\isacommand{linear{\isacharunderscore}undo}}}}}^{{ * }{ * }} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}\ any{\isachardoublequote}} \\
   5.199 +    \indexdef{}{command}{kill}\hypertarget{command.kill}{\hyperlink{command.kill}{\mbox{\isa{\isacommand{kill}}}}}^{{ * }{ * }} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}\ any{\isachardoublequote}} \\
   5.200    \end{matharray}
   5.201  
   5.202    The Isabelle/Isar top-level maintains a two-stage history, for
   5.203 @@ -241,9 +145,9 @@
   5.204  %
   5.205  \begin{isamarkuptext}%
   5.206  \begin{matharray}{rcl}
   5.207 -    \indexdef{}{command}{cd}\hypertarget{command.cd}{\hyperlink{command.cd}{\mbox{\isa{\isacommand{cd}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   5.208 -    \indexdef{}{command}{pwd}\hypertarget{command.pwd}{\hyperlink{command.pwd}{\mbox{\isa{\isacommand{pwd}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   5.209 -    \indexdef{}{command}{use\_thy}\hypertarget{command.use-thy}{\hyperlink{command.use-thy}{\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   5.210 +    \indexdef{}{command}{cd}\hypertarget{command.cd}{\hyperlink{command.cd}{\mbox{\isa{\isacommand{cd}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.211 +    \indexdef{}{command}{pwd}\hypertarget{command.pwd}{\hyperlink{command.pwd}{\mbox{\isa{\isacommand{pwd}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.212 +    \indexdef{}{command}{use\_thy}\hypertarget{command.use-thy}{\hyperlink{command.use-thy}{\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
   5.213    \end{matharray}
   5.214  
   5.215    \begin{rail}
   5.216 @@ -251,18 +155,18 @@
   5.217      ;
   5.218    \end{rail}
   5.219  
   5.220 -  \begin{descr}
   5.221 +  \begin{description}
   5.222  
   5.223 -  \item [\hyperlink{command.cd}{\mbox{\isa{\isacommand{cd}}}}~\isa{path}] changes the current directory
   5.224 +  \item \hyperlink{command.cd}{\mbox{\isa{\isacommand{cd}}}}~\isa{path} changes the current directory
   5.225    of the Isabelle process.
   5.226  
   5.227 -  \item [\hyperlink{command.pwd}{\mbox{\isa{\isacommand{pwd}}}}] prints the current working directory.
   5.228 +  \item \hyperlink{command.pwd}{\mbox{\isa{\isacommand{pwd}}}} prints the current working directory.
   5.229  
   5.230 -  \item [\hyperlink{command.use-thy}{\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}}~\isa{A}] preload theory \isa{A}.
   5.231 +  \item \hyperlink{command.use-thy}{\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}}~\isa{A} preload theory \isa{A}.
   5.232    These system commands are scarcely used when working interactively,
   5.233    since loading of theories is done automatically as required.
   5.234  
   5.235 -  \end{descr}%
   5.236 +  \end{description}%
   5.237  \end{isamarkuptext}%
   5.238  \isamarkuptrue%
   5.239  %
     6.1 --- a/doc-src/IsarRef/Thy/document/Outer_Syntax.tex	Thu Nov 13 22:44:40 2008 +0100
     6.2 +++ b/doc-src/IsarRef/Thy/document/Outer_Syntax.tex	Thu Nov 13 22:45:12 2008 +0100
     6.3 @@ -83,69 +83,111 @@
     6.4  \end{isamarkuptext}%
     6.5  \isamarkuptrue%
     6.6  %
     6.7 -\isamarkupsection{Lexical matters \label{sec:lex-syntax}%
     6.8 +\isamarkupsection{Lexical matters \label{sec:outer-lex}%
     6.9  }
    6.10  \isamarkuptrue%
    6.11  %
    6.12  \begin{isamarkuptext}%
    6.13 -The Isabelle/Isar outer syntax provides token classes as presented
    6.14 -  below; most of these coincide with the inner lexical syntax as
    6.15 -  presented in \cite{isabelle-ref}.
    6.16 +The outer lexical syntax consists of three main categories of
    6.17 +  syntax tokens:
    6.18 +
    6.19 +  \begin{enumerate}
    6.20 +
    6.21 +  \item \emph{major keywords} --- the command names that are available
    6.22 +  in the present logic session;
    6.23 +
    6.24 +  \item \emph{minor keywords} --- additional literal tokens required
    6.25 +  by the syntax of commands;
    6.26 +
    6.27 +  \item \emph{named tokens} --- various categories of identifiers etc.
    6.28 +
    6.29 +  \end{enumerate}
    6.30  
    6.31 -  \begin{matharray}{rcl}
    6.32 -    \indexdef{}{syntax}{ident}\hypertarget{syntax.ident}{\hyperlink{syntax.ident}{\mbox{\isa{ident}}}} & = & letter\,quasiletter^* \\
    6.33 -    \indexdef{}{syntax}{longident}\hypertarget{syntax.longident}{\hyperlink{syntax.longident}{\mbox{\isa{longident}}}} & = & ident (\verb,.,ident)^+ \\
    6.34 -    \indexdef{}{syntax}{symident}\hypertarget{syntax.symident}{\hyperlink{syntax.symident}{\mbox{\isa{symident}}}} & = & sym^+ ~|~ \verb,\,\verb,<,ident\verb,>, \\
    6.35 -    \indexdef{}{syntax}{nat}\hypertarget{syntax.nat}{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}} & = & digit^+ \\
    6.36 -    \indexdef{}{syntax}{var}\hypertarget{syntax.var}{\hyperlink{syntax.var}{\mbox{\isa{var}}}} & = & ident ~|~ \verb,?,ident ~|~ \verb,?,ident\verb,.,nat \\
    6.37 -    \indexdef{}{syntax}{typefree}\hypertarget{syntax.typefree}{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}} & = & \verb,',ident \\
    6.38 -    \indexdef{}{syntax}{typevar}\hypertarget{syntax.typevar}{\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}}} & = & typefree ~|~ \verb,?,typefree ~|~ \verb,?,typefree\verb,.,nat \\
    6.39 -    \indexdef{}{syntax}{string}\hypertarget{syntax.string}{\hyperlink{syntax.string}{\mbox{\isa{string}}}} & = & \verb,", ~\dots~ \verb,", \\
    6.40 -    \indexdef{}{syntax}{altstring}\hypertarget{syntax.altstring}{\hyperlink{syntax.altstring}{\mbox{\isa{altstring}}}} & = & \backquote ~\dots~ \backquote \\
    6.41 -    \indexdef{}{syntax}{verbatim}\hypertarget{syntax.verbatim}{\hyperlink{syntax.verbatim}{\mbox{\isa{verbatim}}}} & = & \verb,{*, ~\dots~ \verb,*,\verb,}, \\[1ex]
    6.42 +  Major keywords and minor keywords are guaranteed to be disjoint.
    6.43 +  This helps user-interfaces to determine the overall structure of a
    6.44 +  theory text, without knowing the full details of command syntax.
    6.45 +  Internally, there is some additional information about the kind of
    6.46 +  major keywords, which approximates the command type (theory command,
    6.47 +  proof command etc.).
    6.48 +
    6.49 +  Keywords override named tokens.  For example, the presence of a
    6.50 +  command called \verb|term| inhibits the identifier \verb|term|, but the string \verb|"term"| can be used instead.
    6.51 +  By convention, the outer syntax always allows quoted strings in
    6.52 +  addition to identifiers, wherever a named entity is expected.
    6.53 +
    6.54 +  When tokenizing a given input sequence, the lexer repeatedly takes
    6.55 +  the longest prefix of the input that forms a valid token.  Spaces,
    6.56 +  tabs, newlines and formfeeds between tokens serve as explicit
    6.57 +  separators.
    6.58 +
    6.59 +  \medskip The categories for named tokens are defined once and for
    6.60 +  all as follows.
    6.61  
    6.62 -    letter & = & latin ~|~ \verb,\,\verb,<,latin\verb,>, ~|~ \verb,\,\verb,<,latin\,latin\verb,>, ~|~ greek ~|~ \\
    6.63 -           &   & \verb,\<^isub>, ~|~ \verb,\<^isup>, \\
    6.64 -    quasiletter & = & letter ~|~ digit ~|~ \verb,_, ~|~ \verb,', \\
    6.65 -    latin & = & \verb,a, ~|~ \dots ~|~ \verb,z, ~|~ \verb,A, ~|~ \dots ~|~ \verb,Z, \\
    6.66 -    digit & = & \verb,0, ~|~ \dots ~|~ \verb,9, \\
    6.67 -    sym & = & \verb,!, ~|~ \verb,#, ~|~ \verb,$, ~|~ \verb,%, ~|~ \verb,&, ~|~
    6.68 -     \verb,*, ~|~ \verb,+, ~|~ \verb,-, ~|~ \verb,/, ~|~ \\
    6.69 -    & & \verb,<, ~|~ \verb,=, ~|~ \verb,>, ~|~ \verb,?, ~|~ \texttt{\at} ~|~
    6.70 -    \verb,^, ~|~ \verb,_, ~|~ \verb,|, ~|~ \verb,~, \\
    6.71 -    greek & = & \verb,\<alpha>, ~|~ \verb,\<beta>, ~|~ \verb,\<gamma>, ~|~ \verb,\<delta>, ~| \\
    6.72 -          &   & \verb,\<epsilon>, ~|~ \verb,\<zeta>, ~|~ \verb,\<eta>, ~|~ \verb,\<theta>, ~| \\
    6.73 -          &   & \verb,\<iota>, ~|~ \verb,\<kappa>, ~|~ \verb,\<mu>, ~|~ \verb,\<nu>, ~| \\
    6.74 -          &   & \verb,\<xi>, ~|~ \verb,\<pi>, ~|~ \verb,\<rho>, ~|~ \verb,\<sigma>, ~|~ \verb,\<tau>, ~| \\
    6.75 -          &   & \verb,\<upsilon>, ~|~ \verb,\<phi>, ~|~ \verb,\<chi>, ~|~ \verb,\<psi>, ~| \\
    6.76 -          &   & \verb,\<omega>, ~|~ \verb,\<Gamma>, ~|~ \verb,\<Delta>, ~|~ \verb,\<Theta>, ~| \\
    6.77 -          &   & \verb,\<Lambda>, ~|~ \verb,\<Xi>, ~|~ \verb,\<Pi>, ~|~ \verb,\<Sigma>, ~| \\
    6.78 -          &   & \verb,\<Upsilon>, ~|~ \verb,\<Phi>, ~|~ \verb,\<Psi>, ~|~ \verb,\<Omega>, \\
    6.79 -  \end{matharray}
    6.80 +  \begin{center}
    6.81 +  \begin{supertabular}{rcl}
    6.82 +    \indexdef{}{syntax}{ident}\hypertarget{syntax.ident}{\hyperlink{syntax.ident}{\mbox{\isa{ident}}}} & = & \isa{{\isachardoublequote}letter\ quasiletter\isactrlsup {\isacharasterisk}{\isachardoublequote}} \\
    6.83 +    \indexdef{}{syntax}{longident}\hypertarget{syntax.longident}{\hyperlink{syntax.longident}{\mbox{\isa{longident}}}} & = & \isa{{\isachardoublequote}ident{\isacharparenleft}{\isachardoublequote}}\verb|.|\isa{{\isachardoublequote}ident{\isacharparenright}\isactrlsup {\isacharplus}{\isachardoublequote}} \\
    6.84 +    \indexdef{}{syntax}{symident}\hypertarget{syntax.symident}{\hyperlink{syntax.symident}{\mbox{\isa{symident}}}} & = & \isa{{\isachardoublequote}sym\isactrlsup {\isacharplus}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\|\verb|<|\isa{ident}\verb|>| \\
    6.85 +    \indexdef{}{syntax}{nat}\hypertarget{syntax.nat}{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}} & = & \isa{{\isachardoublequote}digit\isactrlsup {\isacharplus}{\isachardoublequote}} \\
    6.86 +    \indexdef{}{syntax}{var}\hypertarget{syntax.var}{\hyperlink{syntax.var}{\mbox{\isa{var}}}} & = & \verb|?|\isa{{\isachardoublequote}ident\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|?|\isa{ident}\verb|.|\isa{nat} \\
    6.87 +    \indexdef{}{syntax}{typefree}\hypertarget{syntax.typefree}{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}} & = & \verb|'|\isa{ident} \\
    6.88 +    \indexdef{}{syntax}{typevar}\hypertarget{syntax.typevar}{\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}}} & = & \verb|?|\isa{{\isachardoublequote}typefree\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|?|\isa{typefree}\verb|.|\isa{nat} \\
    6.89 +    \indexdef{}{syntax}{string}\hypertarget{syntax.string}{\hyperlink{syntax.string}{\mbox{\isa{string}}}} & = & \verb|"| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|"| \\
    6.90 +    \indexdef{}{syntax}{altstring}\hypertarget{syntax.altstring}{\hyperlink{syntax.altstring}{\mbox{\isa{altstring}}}} & = & \verb|`| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|`| \\
    6.91 +    \indexdef{}{syntax}{verbatim}\hypertarget{syntax.verbatim}{\hyperlink{syntax.verbatim}{\mbox{\isa{verbatim}}}} & = & \verb|{*| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|*|\verb|}| \\[1ex]
    6.92  
    6.93 -  The syntax of \hyperlink{syntax.string}{\mbox{\isa{string}}} admits any characters, including
    6.94 +    \isa{letter} & = & \isa{{\isachardoublequote}latin\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\|\verb|<|\isa{latin}\verb|>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\|\verb|<|\isa{{\isachardoublequote}latin\ latin{\isachardoublequote}}\verb|>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ greek\ \ {\isacharbar}{\isachardoublequote}} \\
    6.95 +          &   & \verb|\<^isub>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<^isup>| \\
    6.96 +    \isa{quasiletter} & = & \isa{{\isachardoublequote}letter\ \ {\isacharbar}\ \ digit\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|_|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|'| \\
    6.97 +    \isa{latin} & = & \verb|a|\isa{{\isachardoublequote}\ \ {\isacharbar}\ {\isasymdots}\ {\isacharbar}\ \ {\isachardoublequote}}\verb|z|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|A|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isasymdots}\ {\isacharbar}\ \ {\isachardoublequote}}\verb|Z| \\
    6.98 +    \isa{digit} & = & \verb|0|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isasymdots}\ {\isacharbar}\ \ {\isachardoublequote}}\verb|9| \\
    6.99 +    \isa{sym} & = & \verb|!|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|#|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|$|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|%|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|&|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|*|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|+|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|-|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|/|\isa{{\isachardoublequote}\ \ {\isacharbar}{\isachardoublequote}} \\
   6.100 +    & & \verb|<|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|=|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|?|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|@|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|^|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|_|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb||\verb,|,\verb||\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|~| \\
   6.101 +    \isa{greek} & = & \verb|\<alpha>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<beta>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<gamma>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<delta>|\isa{{\isachardoublequote}\ \ {\isacharbar}{\isachardoublequote}} \\
   6.102 +          &   & \verb|\<epsilon>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<zeta>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<eta>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<theta>|\isa{{\isachardoublequote}\ \ {\isacharbar}{\isachardoublequote}} \\
   6.103 +          &   & \verb|\<iota>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<kappa>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<mu>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<nu>|\isa{{\isachardoublequote}\ \ {\isacharbar}{\isachardoublequote}} \\
   6.104 +          &   & \verb|\<xi>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<pi>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<rho>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<sigma>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<tau>|\isa{{\isachardoublequote}\ \ {\isacharbar}{\isachardoublequote}} \\
   6.105 +          &   & \verb|\<upsilon>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<phi>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<chi>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<psi>|\isa{{\isachardoublequote}\ \ {\isacharbar}{\isachardoublequote}} \\
   6.106 +          &   & \verb|\<omega>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<Gamma>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<Delta>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<Theta>|\isa{{\isachardoublequote}\ \ {\isacharbar}{\isachardoublequote}} \\
   6.107 +          &   & \verb|\<Lambda>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<Xi>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<Pi>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<Sigma>|\isa{{\isachardoublequote}\ \ {\isacharbar}{\isachardoublequote}} \\
   6.108 +          &   & \verb|\<Upsilon>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<Phi>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<Psi>|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|\<Omega>| \\
   6.109 +  \end{supertabular}
   6.110 +  \end{center}
   6.111 +
   6.112 +  A \indexref{}{syntax}{var}\hyperlink{syntax.var}{\mbox{\isa{var}}} or \indexref{}{syntax}{typevar}\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}} describes an unknown,
   6.113 +  which is internally a pair of base name and index (ML type \verb|indexname|).  These components are either separated by a dot as in
   6.114 +  \isa{{\isachardoublequote}{\isacharquery}x{\isachardot}{\isadigit{1}}{\isachardoublequote}} or \isa{{\isachardoublequote}{\isacharquery}x{\isadigit{7}}{\isachardot}{\isadigit{3}}{\isachardoublequote}} or run together as in \isa{{\isachardoublequote}{\isacharquery}x{\isadigit{1}}{\isachardoublequote}}.  The latter form is possible if the base name does not end
   6.115 +  with digits.  If the index is 0, it may be dropped altogether:
   6.116 +  \isa{{\isachardoublequote}{\isacharquery}x{\isachardoublequote}} and \isa{{\isachardoublequote}{\isacharquery}x{\isadigit{0}}{\isachardoublequote}} and \isa{{\isachardoublequote}{\isacharquery}x{\isachardot}{\isadigit{0}}{\isachardoublequote}} all refer to the
   6.117 +  same unknown, with basename \isa{{\isachardoublequote}x{\isachardoublequote}} and index 0.
   6.118 +
   6.119 +  The syntax of \indexref{}{syntax}{string}\hyperlink{syntax.string}{\mbox{\isa{string}}} admits any characters, including
   6.120    newlines; ``\verb|"|'' (double-quote) and ``\verb|\|'' (backslash) need to be escaped by a backslash; arbitrary
   6.121    character codes may be specified as ``\verb|\|\isa{ddd}'',
   6.122    with three decimal digits.  Alternative strings according to
   6.123 -  \hyperlink{syntax.altstring}{\mbox{\isa{altstring}}} are analogous, using single back-quotes instead.
   6.124 -  The body of \hyperlink{syntax.verbatim}{\mbox{\isa{verbatim}}} may consist of any text not
   6.125 +  \indexref{}{syntax}{altstring}\hyperlink{syntax.altstring}{\mbox{\isa{altstring}}} are analogous, using single back-quotes
   6.126 +  instead.
   6.127 +
   6.128 +  The body of \indexref{}{syntax}{verbatim}\hyperlink{syntax.verbatim}{\mbox{\isa{verbatim}}} may consist of any text not
   6.129    containing ``\verb|*|\verb|}|''; this allows
   6.130 -  convenient inclusion of quotes without further escapes.  The greek
   6.131 -  letters do \emph{not} include \verb|\<lambda>|, which is already used
   6.132 -  differently in the meta-logic.
   6.133 +  convenient inclusion of quotes without further escapes.  There is no
   6.134 +  way to escape ``\verb|*|\verb|}|''.  If the quoted
   6.135 +  text is {\LaTeX} source, one may usually add some blank or comment
   6.136 +  to avoid the critical character sequence.
   6.137 +
   6.138 +  Source comments take the form \verb|(*|~\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}~\verb|*)| and may be nested, although the user-interface
   6.139 +  might prevent this.  Note that this form indicates source comments
   6.140 +  only, which are stripped after lexical analysis of the input.  The
   6.141 +  Isar syntax also provides proper \emph{document comments} that are
   6.142 +  considered as part of the text (see \secref{sec:comments}).
   6.143  
   6.144    Common mathematical symbols such as \isa{{\isasymforall}} are represented in
   6.145    Isabelle as \verb|\<forall>|.  There are infinitely many Isabelle
   6.146    symbols like this, although proper presentation is left to front-end
   6.147    tools such as {\LaTeX} or Proof~General with the X-Symbol package.
   6.148    A list of standard Isabelle symbols that work well with these tools
   6.149 -  is given in \cite[appendix~A]{isabelle-sys}.
   6.150 -  
   6.151 -  Source comments take the form \verb|(*|~\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}~\verb|*)| and may be nested, although user-interface
   6.152 -  tools might prevent this.  Note that this form indicates source
   6.153 -  comments only, which are stripped after lexical analysis of the
   6.154 -  input.  The Isar document syntax also provides formal comments that
   6.155 -  are considered as part of the text (see \secref{sec:comments}).%
   6.156 +  is given in \cite[appendix~A]{isabelle-sys}.  Note that \verb|\<lambda>| does not belong to the \isa{letter} category, since it is
   6.157 +  already used differently in the Pure term language.%
   6.158  \end{isamarkuptext}%
   6.159  \isamarkuptrue%
   6.160  %
   6.161 @@ -286,171 +328,6 @@
   6.162  \end{isamarkuptext}%
   6.163  \isamarkuptrue%
   6.164  %
   6.165 -\isamarkupsubsection{Mixfix annotations%
   6.166 -}
   6.167 -\isamarkuptrue%
   6.168 -%
   6.169 -\begin{isamarkuptext}%
   6.170 -Mixfix annotations specify concrete \emph{inner} syntax of Isabelle
   6.171 -  types and terms.  Some commands such as \hyperlink{command.types}{\mbox{\isa{\isacommand{types}}}} (see
   6.172 -  \secref{sec:types-pure}) admit infixes only, while \hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}} (see \secref{sec:consts}) and \hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}} (see
   6.173 -  \secref{sec:syn-trans}) support the full range of general mixfixes
   6.174 -  and binders.
   6.175 -
   6.176 -  \indexouternonterm{infix}\indexouternonterm{mixfix}\indexouternonterm{structmixfix}
   6.177 -  \begin{rail}
   6.178 -    infix: '(' ('infix' | 'infixl' | 'infixr') string? nat ')'
   6.179 -    ;
   6.180 -    mixfix: infix | '(' string prios? nat? ')' | '(' 'binder' string prios? nat ')'
   6.181 -    ;
   6.182 -    structmixfix: mixfix | '(' 'structure' ')'
   6.183 -    ;
   6.184 -
   6.185 -    prios: '[' (nat + ',') ']'
   6.186 -    ;
   6.187 -  \end{rail}
   6.188 -
   6.189 -  Here the \railtok{string} specifications refer to the actual mixfix
   6.190 -  template (see also \cite{isabelle-ref}), which may include literal
   6.191 -  text, spacing, blocks, and arguments (denoted by ``\isa{{\isacharunderscore}}''); the
   6.192 -  special symbol ``\verb|\<index>|'' (printed as ``\isa{{\isachardoublequote}{\isasymindex}{\isachardoublequote}}'')
   6.193 -  represents an index argument that specifies an implicit structure
   6.194 -  reference (see also \secref{sec:locale}).  Infix and binder
   6.195 -  declarations provide common abbreviations for particular mixfix
   6.196 -  declarations.  So in practice, mixfix templates mostly degenerate to
   6.197 -  literal text for concrete syntax, such as ``\verb|++|'' for
   6.198 -  an infix symbol, or ``\verb|++|\isa{{\isachardoublequote}{\isasymindex}{\isachardoublequote}}'' for an infix of
   6.199 -  an implicit structure.%
   6.200 -\end{isamarkuptext}%
   6.201 -\isamarkuptrue%
   6.202 -%
   6.203 -\isamarkupsubsection{Proof methods \label{sec:syn-meth}%
   6.204 -}
   6.205 -\isamarkuptrue%
   6.206 -%
   6.207 -\begin{isamarkuptext}%
   6.208 -Proof methods are either basic ones, or expressions composed of
   6.209 -  methods via ``\verb|,|'' (sequential composition),
   6.210 -  ``\verb||\verb,|,\verb||'' (alternative choices), ``\verb|?|'' 
   6.211 -  (try), ``\verb|+|'' (repeat at least once), ``\verb|[|\isa{n}\verb|]|'' (restriction to first \isa{n}
   6.212 -  sub-goals, with default \isa{{\isachardoublequote}n\ {\isacharequal}\ {\isadigit{1}}{\isachardoublequote}}).  In practice, proof
   6.213 -  methods are usually just a comma separated list of
   6.214 -  \railqtok{nameref}~\railnonterm{args} specifications.  Note that
   6.215 -  parentheses may be dropped for single method specifications (with no
   6.216 -  arguments).
   6.217 -
   6.218 -  \indexouternonterm{method}
   6.219 -  \begin{rail}
   6.220 -    method: (nameref | '(' methods ')') (() | '?' | '+' | '[' nat? ']')
   6.221 -    ;
   6.222 -    methods: (nameref args | method) + (',' | '|')
   6.223 -    ;
   6.224 -  \end{rail}
   6.225 -
   6.226 -  Proper Isar proof methods do \emph{not} admit arbitrary goal
   6.227 -  addressing, but refer either to the first sub-goal or all sub-goals
   6.228 -  uniformly.  The goal restriction operator ``\isa{{\isachardoublequote}{\isacharbrackleft}n{\isacharbrackright}{\isachardoublequote}}''
   6.229 -  evaluates a method expression within a sandbox consisting of the
   6.230 -  first \isa{n} sub-goals (which need to exist).  For example, the
   6.231 -  method ``\isa{{\isachardoublequote}simp{\isacharunderscore}all{\isacharbrackleft}{\isadigit{3}}{\isacharbrackright}{\isachardoublequote}}'' simplifies the first three
   6.232 -  sub-goals, while ``\isa{{\isachardoublequote}{\isacharparenleft}rule\ foo{\isacharcomma}\ simp{\isacharunderscore}all{\isacharparenright}{\isacharbrackleft}{\isacharbrackright}{\isachardoublequote}}'' simplifies all
   6.233 -  new goals that emerge from applying rule \isa{{\isachardoublequote}foo{\isachardoublequote}} to the
   6.234 -  originally first one.
   6.235 -
   6.236 -  Improper methods, notably tactic emulations, offer a separate
   6.237 -  low-level goal addressing scheme as explicit argument to the
   6.238 -  individual tactic being involved.  Here ``\isa{{\isachardoublequote}{\isacharbrackleft}{\isacharbang}{\isacharbrackright}{\isachardoublequote}}'' refers to
   6.239 -  all goals, and ``\isa{{\isachardoublequote}{\isacharbrackleft}n{\isacharminus}{\isacharbrackright}{\isachardoublequote}}'' to all goals starting from \isa{{\isachardoublequote}n{\isachardoublequote}}.
   6.240 -
   6.241 -  \indexouternonterm{goalspec}
   6.242 -  \begin{rail}
   6.243 -    goalspec: '[' (nat '-' nat | nat '-' | nat | '!' ) ']'
   6.244 -    ;
   6.245 -  \end{rail}%
   6.246 -\end{isamarkuptext}%
   6.247 -\isamarkuptrue%
   6.248 -%
   6.249 -\isamarkupsubsection{Attributes and theorems \label{sec:syn-att}%
   6.250 -}
   6.251 -\isamarkuptrue%
   6.252 -%
   6.253 -\begin{isamarkuptext}%
   6.254 -Attributes (and proof methods, see \secref{sec:syn-meth}) have their
   6.255 -  own ``semi-inner'' syntax, in the sense that input conforming to
   6.256 -  \railnonterm{args} below is parsed by the attribute a second time.
   6.257 -  The attribute argument specifications may be any sequence of atomic
   6.258 -  entities (identifiers, strings etc.), or properly bracketed argument
   6.259 -  lists.  Below \railqtok{atom} refers to any atomic entity, including
   6.260 -  any \railtok{keyword} conforming to \railtok{symident}.
   6.261 -
   6.262 -  \indexoutertoken{atom}\indexouternonterm{args}\indexouternonterm{attributes}
   6.263 -  \begin{rail}
   6.264 -    atom: nameref | typefree | typevar | var | nat | keyword
   6.265 -    ;
   6.266 -    arg: atom | '(' args ')' | '[' args ']'
   6.267 -    ;
   6.268 -    args: arg *
   6.269 -    ;
   6.270 -    attributes: '[' (nameref args * ',') ']'
   6.271 -    ;
   6.272 -  \end{rail}
   6.273 -
   6.274 -  Theorem specifications come in several flavors:
   6.275 -  \railnonterm{axmdecl} and \railnonterm{thmdecl} usually refer to
   6.276 -  axioms, assumptions or results of goal statements, while
   6.277 -  \railnonterm{thmdef} collects lists of existing theorems.  Existing
   6.278 -  theorems are given by \railnonterm{thmref} and
   6.279 -  \railnonterm{thmrefs}, the former requires an actual singleton
   6.280 -  result.
   6.281 -
   6.282 -  There are three forms of theorem references:
   6.283 -  \begin{enumerate}
   6.284 -  
   6.285 -  \item named facts \isa{{\isachardoublequote}a{\isachardoublequote}},
   6.286 -
   6.287 -  \item selections from named facts \isa{{\isachardoublequote}a{\isacharparenleft}i{\isacharparenright}{\isachardoublequote}} or \isa{{\isachardoublequote}a{\isacharparenleft}j\ {\isacharminus}\ k{\isacharparenright}{\isachardoublequote}},
   6.288 -
   6.289 -  \item literal fact propositions using \indexref{}{syntax}{altstring}\hyperlink{syntax.altstring}{\mbox{\isa{altstring}}} syntax
   6.290 -  \verb|`|\isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}}\verb|`| (see also method
   6.291 -  \indexref{}{method}{fact}\hyperlink{method.fact}{\mbox{\isa{fact}}} in \secref{sec:pure-meth-att}).
   6.292 -
   6.293 -  \end{enumerate}
   6.294 -
   6.295 -  Any kind of theorem specification may include lists of attributes
   6.296 -  both on the left and right hand sides; attributes are applied to any
   6.297 -  immediately preceding fact.  If names are omitted, the theorems are
   6.298 -  not stored within the theorem database of the theory or proof
   6.299 -  context, but any given attributes are applied nonetheless.
   6.300 -
   6.301 -  An extra pair of brackets around attributes (like ``\isa{{\isachardoublequote}{\isacharbrackleft}{\isacharbrackleft}simproc\ a{\isacharbrackright}{\isacharbrackright}{\isachardoublequote}}'') abbreviates a theorem reference involving an
   6.302 -  internal dummy fact, which will be ignored later on.  So only the
   6.303 -  effect of the attribute on the background context will persist.
   6.304 -  This form of in-place declarations is particularly useful with
   6.305 -  commands like \hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}} and \hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}.
   6.306 -
   6.307 -  \indexouternonterm{axmdecl}\indexouternonterm{thmdecl}
   6.308 -  \indexouternonterm{thmdef}\indexouternonterm{thmref}
   6.309 -  \indexouternonterm{thmrefs}\indexouternonterm{selection}
   6.310 -  \begin{rail}
   6.311 -    axmdecl: name attributes? ':'
   6.312 -    ;
   6.313 -    thmdecl: thmbind ':'
   6.314 -    ;
   6.315 -    thmdef: thmbind '='
   6.316 -    ;
   6.317 -    thmref: (nameref selection? | altstring) attributes? | '[' attributes ']'
   6.318 -    ;
   6.319 -    thmrefs: thmref +
   6.320 -    ;
   6.321 -
   6.322 -    thmbind: name attributes | name | attributes
   6.323 -    ;
   6.324 -    selection: '(' ((nat | nat '-' nat?) + ',') ')'
   6.325 -    ;
   6.326 -  \end{rail}%
   6.327 -\end{isamarkuptext}%
   6.328 -\isamarkuptrue%
   6.329 -%
   6.330  \isamarkupsubsection{Term patterns and declarations \label{sec:term-decls}%
   6.331  }
   6.332  \isamarkuptrue%
   6.333 @@ -496,6 +373,87 @@
   6.334  \end{isamarkuptext}%
   6.335  \isamarkuptrue%
   6.336  %
   6.337 +\isamarkupsubsection{Attributes and theorems \label{sec:syn-att}%
   6.338 +}
   6.339 +\isamarkuptrue%
   6.340 +%
   6.341 +\begin{isamarkuptext}%
   6.342 +Attributes have their own ``semi-inner'' syntax, in the sense
   6.343 +  that input conforming to \railnonterm{args} below is parsed by the
   6.344 +  attribute a second time.  The attribute argument specifications may
   6.345 +  be any sequence of atomic entities (identifiers, strings etc.), or
   6.346 +  properly bracketed argument lists.  Below \railqtok{atom} refers to
   6.347 +  any atomic entity, including any \railtok{keyword} conforming to
   6.348 +  \railtok{symident}.
   6.349 +
   6.350 +  \indexoutertoken{atom}\indexouternonterm{args}\indexouternonterm{attributes}
   6.351 +  \begin{rail}
   6.352 +    atom: nameref | typefree | typevar | var | nat | keyword
   6.353 +    ;
   6.354 +    arg: atom | '(' args ')' | '[' args ']'
   6.355 +    ;
   6.356 +    args: arg *
   6.357 +    ;
   6.358 +    attributes: '[' (nameref args * ',') ']'
   6.359 +    ;
   6.360 +  \end{rail}
   6.361 +
   6.362 +  Theorem specifications come in several flavors:
   6.363 +  \railnonterm{axmdecl} and \railnonterm{thmdecl} usually refer to
   6.364 +  axioms, assumptions or results of goal statements, while
   6.365 +  \railnonterm{thmdef} collects lists of existing theorems.  Existing
   6.366 +  theorems are given by \railnonterm{thmref} and
   6.367 +  \railnonterm{thmrefs}, the former requires an actual singleton
   6.368 +  result.
   6.369 +
   6.370 +  There are three forms of theorem references:
   6.371 +  \begin{enumerate}
   6.372 +  
   6.373 +  \item named facts \isa{{\isachardoublequote}a{\isachardoublequote}},
   6.374 +
   6.375 +  \item selections from named facts \isa{{\isachardoublequote}a{\isacharparenleft}i{\isacharparenright}{\isachardoublequote}} or \isa{{\isachardoublequote}a{\isacharparenleft}j\ {\isacharminus}\ k{\isacharparenright}{\isachardoublequote}},
   6.376 +
   6.377 +  \item literal fact propositions using \indexref{}{syntax}{altstring}\hyperlink{syntax.altstring}{\mbox{\isa{altstring}}} syntax
   6.378 +  \verb|`|\isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}}\verb|`| (see also method
   6.379 +  \indexref{}{method}{fact}\hyperlink{method.fact}{\mbox{\isa{fact}}}).
   6.380 +
   6.381 +  \end{enumerate}
   6.382 +
   6.383 +  Any kind of theorem specification may include lists of attributes
   6.384 +  both on the left and right hand sides; attributes are applied to any
   6.385 +  immediately preceding fact.  If names are omitted, the theorems are
   6.386 +  not stored within the theorem database of the theory or proof
   6.387 +  context, but any given attributes are applied nonetheless.
   6.388 +
   6.389 +  An extra pair of brackets around attributes (like ``\isa{{\isachardoublequote}{\isacharbrackleft}{\isacharbrackleft}simproc\ a{\isacharbrackright}{\isacharbrackright}{\isachardoublequote}}'') abbreviates a theorem reference involving an
   6.390 +  internal dummy fact, which will be ignored later on.  So only the
   6.391 +  effect of the attribute on the background context will persist.
   6.392 +  This form of in-place declarations is particularly useful with
   6.393 +  commands like \hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}} and \hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}.
   6.394 +
   6.395 +  \indexouternonterm{axmdecl}\indexouternonterm{thmdecl}
   6.396 +  \indexouternonterm{thmdef}\indexouternonterm{thmref}
   6.397 +  \indexouternonterm{thmrefs}\indexouternonterm{selection}
   6.398 +  \begin{rail}
   6.399 +    axmdecl: name attributes? ':'
   6.400 +    ;
   6.401 +    thmdecl: thmbind ':'
   6.402 +    ;
   6.403 +    thmdef: thmbind '='
   6.404 +    ;
   6.405 +    thmref: (nameref selection? | altstring) attributes? | '[' attributes ']'
   6.406 +    ;
   6.407 +    thmrefs: thmref +
   6.408 +    ;
   6.409 +
   6.410 +    thmbind: name attributes | name | attributes
   6.411 +    ;
   6.412 +    selection: '(' ((nat | nat '-' nat?) + ',') ')'
   6.413 +    ;
   6.414 +  \end{rail}%
   6.415 +\end{isamarkuptext}%
   6.416 +\isamarkuptrue%
   6.417 +%
   6.418  \isadelimtheory
   6.419  %
   6.420  \endisadelimtheory
     7.1 --- a/doc-src/IsarRef/Thy/document/Proof.tex	Thu Nov 13 22:44:40 2008 +0100
     7.2 +++ b/doc-src/IsarRef/Thy/document/Proof.tex	Thu Nov 13 22:45:12 2008 +0100
     7.3 @@ -31,23 +31,23 @@
     7.4    facts, and open goals.  Isar/VM transitions are \emph{typed}
     7.5    according to the following three different modes of operation:
     7.6  
     7.7 -  \begin{descr}
     7.8 +  \begin{description}
     7.9  
    7.10 -  \item [\isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}}] means that a new goal has just been
    7.11 +  \item \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} means that a new goal has just been
    7.12    stated that is now to be \emph{proven}; the next command may refine
    7.13    it by some proof method, and enter a sub-proof to establish the
    7.14    actual result.
    7.15  
    7.16 -  \item [\isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}}] is like a nested theory mode: the
    7.17 +  \item \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} is like a nested theory mode: the
    7.18    context may be augmented by \emph{stating} additional assumptions,
    7.19    intermediate results etc.
    7.20  
    7.21 -  \item [\isa{{\isachardoublequote}proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}}] is intermediate between \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} and \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}}: existing facts (i.e.\
    7.22 +  \item \isa{{\isachardoublequote}proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} is intermediate between \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} and \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}}: existing facts (i.e.\
    7.23    the contents of the special ``\indexref{}{fact}{this}\hyperlink{fact.this}{\mbox{\isa{this}}}'' register) have been
    7.24    just picked up in order to be used when refining the goal claimed
    7.25    next.
    7.26  
    7.27 -  \end{descr}
    7.28 +  \end{description}
    7.29  
    7.30    The proof mode indicator may be read as a verb telling the writer
    7.31    what kind of operation may be performed next.  The corresponding
    7.32 @@ -59,16 +59,101 @@
    7.33  \end{isamarkuptext}%
    7.34  \isamarkuptrue%
    7.35  %
    7.36 -\isamarkupsection{Context elements \label{sec:proof-context}%
    7.37 +\isamarkupsection{Proof structure%
    7.38 +}
    7.39 +\isamarkuptrue%
    7.40 +%
    7.41 +\isamarkupsubsection{Blocks%
    7.42  }
    7.43  \isamarkuptrue%
    7.44  %
    7.45  \begin{isamarkuptext}%
    7.46  \begin{matharray}{rcl}
    7.47 -    \indexdef{}{command}{fix}\hypertarget{command.fix}{\hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
    7.48 -    \indexdef{}{command}{assume}\hypertarget{command.assume}{\hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
    7.49 -    \indexdef{}{command}{presume}\hypertarget{command.presume}{\hyperlink{command.presume}{\mbox{\isa{\isacommand{presume}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
    7.50 -    \indexdef{}{command}{def}\hypertarget{command.def}{\hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
    7.51 +    \indexdef{}{command}{next}\hypertarget{command.next}{\hyperlink{command.next}{\mbox{\isa{\isacommand{next}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
    7.52 +    \indexdef{}{command}{\{}\hypertarget{command.braceleft}{\hyperlink{command.braceleft}{\mbox{\isa{\isacommand{{\isacharbraceleft}}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
    7.53 +    \indexdef{}{command}{\}}\hypertarget{command.braceright}{\hyperlink{command.braceright}{\mbox{\isa{\isacommand{{\isacharbraceright}}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
    7.54 +  \end{matharray}
    7.55 +
    7.56 +  While Isar is inherently block-structured, opening and closing
    7.57 +  blocks is mostly handled rather casually, with little explicit
    7.58 +  user-intervention.  Any local goal statement automatically opens
    7.59 +  \emph{two} internal blocks, which are closed again when concluding
    7.60 +  the sub-proof (by \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}} etc.).  Sections of different
    7.61 +  context within a sub-proof may be switched via \hyperlink{command.next}{\mbox{\isa{\isacommand{next}}}},
    7.62 +  which is just a single block-close followed by block-open again.
    7.63 +  The effect of \hyperlink{command.next}{\mbox{\isa{\isacommand{next}}}} is to reset the local proof context;
    7.64 +  there is no goal focus involved here!
    7.65 +
    7.66 +  For slightly more advanced applications, there are explicit block
    7.67 +  parentheses as well.  These typically achieve a stronger forward
    7.68 +  style of reasoning.
    7.69 +
    7.70 +  \begin{description}
    7.71 +
    7.72 +  \item \hyperlink{command.next}{\mbox{\isa{\isacommand{next}}}} switches to a fresh block within a
    7.73 +  sub-proof, resetting the local context to the initial one.
    7.74 +
    7.75 +  \item \hyperlink{command.braceleft}{\mbox{\isa{\isacommand{{\isacharbraceleft}}}}} and \hyperlink{command.braceright}{\mbox{\isa{\isacommand{{\isacharbraceright}}}}} explicitly open and close
    7.76 +  blocks.  Any current facts pass through ``\hyperlink{command.braceleft}{\mbox{\isa{\isacommand{{\isacharbraceleft}}}}}''
    7.77 +  unchanged, while ``\hyperlink{command.braceright}{\mbox{\isa{\isacommand{{\isacharbraceright}}}}}'' causes any result to be
    7.78 +  \emph{exported} into the enclosing context.  Thus fixed variables
    7.79 +  are generalized, assumptions discharged, and local definitions
    7.80 +  unfolded (cf.\ \secref{sec:proof-context}).  There is no difference
    7.81 +  of \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}} and \hyperlink{command.presume}{\mbox{\isa{\isacommand{presume}}}} in this mode of
    7.82 +  forward reasoning --- in contrast to plain backward reasoning with
    7.83 +  the result exported at \hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}} time.
    7.84 +
    7.85 +  \end{description}%
    7.86 +\end{isamarkuptext}%
    7.87 +\isamarkuptrue%
    7.88 +%
    7.89 +\isamarkupsubsection{Omitting proofs%
    7.90 +}
    7.91 +\isamarkuptrue%
    7.92 +%
    7.93 +\begin{isamarkuptext}%
    7.94 +\begin{matharray}{rcl}
    7.95 +    \indexdef{}{command}{oops}\hypertarget{command.oops}{\hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}\ local{\isacharunderscore}theory\ {\isacharbar}\ theory{\isachardoublequote}} \\
    7.96 +  \end{matharray}
    7.97 +
    7.98 +  The \hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}} command discontinues the current proof
    7.99 +  attempt, while considering the partial proof text as properly
   7.100 +  processed.  This is conceptually quite different from ``faking''
   7.101 +  actual proofs via \indexref{}{command}{sorry}\hyperlink{command.sorry}{\mbox{\isa{\isacommand{sorry}}}} (see
   7.102 +  \secref{sec:proof-steps}): \hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}} does not observe the
   7.103 +  proof structure at all, but goes back right to the theory level.
   7.104 +  Furthermore, \hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}} does not produce any result theorem
   7.105 +  --- there is no intended claim to be able to complete the proof
   7.106 +  anyhow.
   7.107 +
   7.108 +  A typical application of \hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}} is to explain Isar proofs
   7.109 +  \emph{within} the system itself, in conjunction with the document
   7.110 +  preparation tools of Isabelle described in \cite{isabelle-sys}.
   7.111 +  Thus partial or even wrong proof attempts can be discussed in a
   7.112 +  logically sound manner.  Note that the Isabelle {\LaTeX} macros can
   7.113 +  be easily adapted to print something like ``\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}'' instead of
   7.114 +  the keyword ``\hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}}''.
   7.115 +
   7.116 +  \medskip The \hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}} command is undo-able, unlike
   7.117 +  \indexref{}{command}{kill}\hyperlink{command.kill}{\mbox{\isa{\isacommand{kill}}}} (see \secref{sec:history}).  The effect is to
   7.118 +  get back to the theory just before the opening of the proof.%
   7.119 +\end{isamarkuptext}%
   7.120 +\isamarkuptrue%
   7.121 +%
   7.122 +\isamarkupsection{Statements%
   7.123 +}
   7.124 +\isamarkuptrue%
   7.125 +%
   7.126 +\isamarkupsubsection{Context elements \label{sec:proof-context}%
   7.127 +}
   7.128 +\isamarkuptrue%
   7.129 +%
   7.130 +\begin{isamarkuptext}%
   7.131 +\begin{matharray}{rcl}
   7.132 +    \indexdef{}{command}{fix}\hypertarget{command.fix}{\hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
   7.133 +    \indexdef{}{command}{assume}\hypertarget{command.assume}{\hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
   7.134 +    \indexdef{}{command}{presume}\hypertarget{command.presume}{\hyperlink{command.presume}{\mbox{\isa{\isacommand{presume}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
   7.135 +    \indexdef{}{command}{def}\hypertarget{command.def}{\hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
   7.136    \end{matharray}
   7.137  
   7.138    The logical proof context consists of fixed variables and
   7.139 @@ -110,12 +195,11 @@
   7.140      ;
   7.141    \end{rail}
   7.142  
   7.143 -  \begin{descr}
   7.144 +  \begin{description}
   7.145    
   7.146 -  \item [\hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}}~\isa{x}] introduces a local variable
   7.147 -  \isa{x} that is \emph{arbitrary, but fixed.}
   7.148 +  \item \hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}}~\isa{x} introduces a local variable \isa{x} that is \emph{arbitrary, but fixed.}
   7.149    
   7.150 -  \item [\hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} and \hyperlink{command.presume}{\mbox{\isa{\isacommand{presume}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] introduce a local fact \isa{{\isachardoublequote}{\isasymphi}\ {\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} by
   7.151 +  \item \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} and \hyperlink{command.presume}{\mbox{\isa{\isacommand{presume}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} introduce a local fact \isa{{\isachardoublequote}{\isasymphi}\ {\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} by
   7.152    assumption.  Subsequent results applied to an enclosing goal (e.g.\
   7.153    by \indexref{}{command}{show}\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}) are handled as follows: \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}} expects to be able to unify with existing premises in the
   7.154    goal, while \hyperlink{command.presume}{\mbox{\isa{\isacommand{presume}}}} leaves \isa{{\isasymphi}} as new subgoals.
   7.155 @@ -124,7 +208,7 @@
   7.156    \indexref{}{keyword}{and}\hyperlink{keyword.and}{\mbox{\isa{\isakeyword{and}}}}; the resulting list of current facts consists
   7.157    of all of these concatenated.
   7.158    
   7.159 -  \item [\hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}}~\isa{{\isachardoublequote}x\ {\isasymequiv}\ t{\isachardoublequote}}] introduces a local
   7.160 +  \item \hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}}~\isa{{\isachardoublequote}x\ {\isasymequiv}\ t{\isachardoublequote}} introduces a local
   7.161    (non-polymorphic) definition.  In results exported from the context,
   7.162    \isa{x} is replaced by \isa{t}.  Basically, ``\hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}}~\isa{{\isachardoublequote}x\ {\isasymequiv}\ t{\isachardoublequote}}'' abbreviates ``\hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}}~\isa{x}~\hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}~\isa{{\isachardoublequote}x\ {\isasymequiv}\ t{\isachardoublequote}}'', with the resulting
   7.163    hypothetical equation solved by reflexivity.
   7.164 @@ -132,7 +216,7 @@
   7.165    The default name for the definitional equation is \isa{x{\isacharunderscore}def}.
   7.166    Several simultaneous definitions may be given at the same time.
   7.167  
   7.168 -  \end{descr}
   7.169 +  \end{description}
   7.170  
   7.171    The special name \indexref{}{fact}{prems}\hyperlink{fact.prems}{\mbox{\isa{prems}}} refers to all assumptions of the
   7.172    current context as a list of theorems.  This feature should be used
   7.173 @@ -140,18 +224,84 @@
   7.174  \end{isamarkuptext}%
   7.175  \isamarkuptrue%
   7.176  %
   7.177 -\isamarkupsection{Facts and forward chaining%
   7.178 +\isamarkupsubsection{Term abbreviations \label{sec:term-abbrev}%
   7.179  }
   7.180  \isamarkuptrue%
   7.181  %
   7.182  \begin{isamarkuptext}%
   7.183  \begin{matharray}{rcl}
   7.184 -    \indexdef{}{command}{note}\hypertarget{command.note}{\hyperlink{command.note}{\mbox{\isa{\isacommand{note}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
   7.185 -    \indexdef{}{command}{then}\hypertarget{command.then}{\hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}} & : & \isartrans{proof(state)}{proof(chain)} \\
   7.186 -    \indexdef{}{command}{from}\hypertarget{command.from}{\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}} & : & \isartrans{proof(state)}{proof(chain)} \\
   7.187 -    \indexdef{}{command}{with}\hypertarget{command.with}{\hyperlink{command.with}{\mbox{\isa{\isacommand{with}}}}} & : & \isartrans{proof(state)}{proof(chain)} \\
   7.188 -    \indexdef{}{command}{using}\hypertarget{command.using}{\hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}} & : & \isartrans{proof(prove)}{proof(prove)} \\
   7.189 -    \indexdef{}{command}{unfolding}\hypertarget{command.unfolding}{\hyperlink{command.unfolding}{\mbox{\isa{\isacommand{unfolding}}}}} & : & \isartrans{proof(prove)}{proof(prove)} \\
   7.190 +    \indexdef{}{command}{let}\hypertarget{command.let}{\hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
   7.191 +    \indexdef{}{keyword}{is}\hypertarget{keyword.is}{\hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}}} & : & syntax \\
   7.192 +  \end{matharray}
   7.193 +
   7.194 +  Abbreviations may be either bound by explicit \hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}~\isa{{\isachardoublequote}p\ {\isasymequiv}\ t{\isachardoublequote}} statements, or by annotating assumptions or
   7.195 +  goal statements with a list of patterns ``\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIS}\ p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub n{\isacharparenright}{\isachardoublequote}}''.  In both cases, higher-order matching is invoked to
   7.196 +  bind extra-logical term variables, which may be either named
   7.197 +  schematic variables of the form \isa{{\isacharquery}x}, or nameless dummies
   7.198 +  ``\hyperlink{variable.underscore}{\mbox{\isa{{\isacharunderscore}}}}'' (underscore). Note that in the \hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}
   7.199 +  form the patterns occur on the left-hand side, while the \hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}} patterns are in postfix position.
   7.200 +
   7.201 +  Polymorphism of term bindings is handled in Hindley-Milner style,
   7.202 +  similar to ML.  Type variables referring to local assumptions or
   7.203 +  open goal statements are \emph{fixed}, while those of finished
   7.204 +  results or bound by \hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}} may occur in \emph{arbitrary}
   7.205 +  instances later.  Even though actual polymorphism should be rarely
   7.206 +  used in practice, this mechanism is essential to achieve proper
   7.207 +  incremental type-inference, as the user proceeds to build up the
   7.208 +  Isar proof text from left to right.
   7.209 +
   7.210 +  \medskip Term abbreviations are quite different from local
   7.211 +  definitions as introduced via \hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}} (see
   7.212 +  \secref{sec:proof-context}).  The latter are visible within the
   7.213 +  logic as actual equations, while abbreviations disappear during the
   7.214 +  input process just after type checking.  Also note that \hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}} does not support polymorphism.
   7.215 +
   7.216 +  \begin{rail}
   7.217 +    'let' ((term + 'and') '=' term + 'and')
   7.218 +    ;  
   7.219 +  \end{rail}
   7.220 +
   7.221 +  The syntax of \hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}} patterns follows \railnonterm{termpat}
   7.222 +  or \railnonterm{proppat} (see \secref{sec:term-decls}).
   7.223 +
   7.224 +  \begin{description}
   7.225 +
   7.226 +  \item \hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}~\isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}\ {\isacharequal}\ t\isactrlsub {\isadigit{1}}\ {\isasymAND}\ {\isasymdots}\ p\isactrlsub n\ {\isacharequal}\ t\isactrlsub n{\isachardoublequote}} binds any
   7.227 +  text variables in patterns \isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ p\isactrlsub n{\isachardoublequote}} by simultaneous
   7.228 +  higher-order matching against terms \isa{{\isachardoublequote}t\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ t\isactrlsub n{\isachardoublequote}}.
   7.229 +
   7.230 +  \item \isa{{\isachardoublequote}{\isacharparenleft}{\isasymIS}\ p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub n{\isacharparenright}{\isachardoublequote}} resembles \hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}, but
   7.231 +  matches \isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ p\isactrlsub n{\isachardoublequote}} against the preceding statement.  Also
   7.232 +  note that \hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}} is not a separate command, but part of
   7.233 +  others (such as \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}, \hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}} etc.).
   7.234 +
   7.235 +  \end{description}
   7.236 +
   7.237 +  Some \emph{implicit} term abbreviations\index{term abbreviations}
   7.238 +  for goals and facts are available as well.  For any open goal,
   7.239 +  \indexref{}{variable}{thesis}\hyperlink{variable.thesis}{\mbox{\isa{thesis}}} refers to its object-level statement,
   7.240 +  abstracted over any meta-level parameters (if present).  Likewise,
   7.241 +  \indexref{}{variable}{this}\hyperlink{variable.this}{\mbox{\isa{this}}} is bound for fact statements resulting from
   7.242 +  assumptions or finished goals.  In case \hyperlink{variable.this}{\mbox{\isa{this}}} refers to
   7.243 +  an object-logic statement that is an application \isa{{\isachardoublequote}f\ t{\isachardoublequote}}, then
   7.244 +  \isa{t} is bound to the special text variable ``\hyperlink{variable.dots}{\mbox{\isa{{\isasymdots}}}}''
   7.245 +  (three dots).  The canonical application of this convenience are
   7.246 +  calculational proofs (see \secref{sec:calculation}).%
   7.247 +\end{isamarkuptext}%
   7.248 +\isamarkuptrue%
   7.249 +%
   7.250 +\isamarkupsubsection{Facts and forward chaining%
   7.251 +}
   7.252 +\isamarkuptrue%
   7.253 +%
   7.254 +\begin{isamarkuptext}%
   7.255 +\begin{matharray}{rcl}
   7.256 +    \indexdef{}{command}{note}\hypertarget{command.note}{\hyperlink{command.note}{\mbox{\isa{\isacommand{note}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
   7.257 +    \indexdef{}{command}{then}\hypertarget{command.then}{\hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} \\
   7.258 +    \indexdef{}{command}{from}\hypertarget{command.from}{\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} \\
   7.259 +    \indexdef{}{command}{with}\hypertarget{command.with}{\hyperlink{command.with}{\mbox{\isa{\isacommand{with}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} \\
   7.260 +    \indexdef{}{command}{using}\hypertarget{command.using}{\hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.261 +    \indexdef{}{command}{unfolding}\hypertarget{command.unfolding}{\hyperlink{command.unfolding}{\mbox{\isa{\isacommand{unfolding}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.262    \end{matharray}
   7.263  
   7.264    New facts are established either by assumption or proof of local
   7.265 @@ -172,14 +322,14 @@
   7.266      ;
   7.267    \end{rail}
   7.268  
   7.269 -  \begin{descr}
   7.270 +  \begin{description}
   7.271  
   7.272 -  \item [\hyperlink{command.note}{\mbox{\isa{\isacommand{note}}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}]
   7.273 -  recalls existing facts \isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ b\isactrlsub n{\isachardoublequote}}, binding
   7.274 -  the result as \isa{a}.  Note that attributes may be involved as
   7.275 -  well, both on the left and right hand sides.
   7.276 +  \item \hyperlink{command.note}{\mbox{\isa{\isacommand{note}}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}} recalls existing facts
   7.277 +  \isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ b\isactrlsub n{\isachardoublequote}}, binding the result as \isa{a}.  Note that
   7.278 +  attributes may be involved as well, both on the left and right hand
   7.279 +  sides.
   7.280  
   7.281 -  \item [\hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}] indicates forward chaining by the current
   7.282 +  \item \hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}} indicates forward chaining by the current
   7.283    facts in order to establish the goal to be claimed next.  The
   7.284    initial proof method invoked to refine that will be offered the
   7.285    facts to do ``anything appropriate'' (see also
   7.286 @@ -189,23 +339,21 @@
   7.287    facts into the goal state before operation.  This provides a simple
   7.288    scheme to control relevance of facts in automated proof search.
   7.289    
   7.290 -  \item [\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\isa{b}] abbreviates ``\hyperlink{command.note}{\mbox{\isa{\isacommand{note}}}}~\isa{b}~\hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}''; thus \hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}} is
   7.291 +  \item \hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\isa{b} abbreviates ``\hyperlink{command.note}{\mbox{\isa{\isacommand{note}}}}~\isa{b}~\hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}''; thus \hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}} is
   7.292    equivalent to ``\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\isa{this}''.
   7.293    
   7.294 -  \item [\hyperlink{command.with}{\mbox{\isa{\isacommand{with}}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}]
   7.295 -  abbreviates ``\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n\ {\isasymAND}\ this{\isachardoublequote}}''; thus the forward chaining is from earlier facts together
   7.296 -  with the current ones.
   7.297 +  \item \hyperlink{command.with}{\mbox{\isa{\isacommand{with}}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}} abbreviates ``\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n\ {\isasymAND}\ this{\isachardoublequote}}''; thus the forward chaining
   7.298 +  is from earlier facts together with the current ones.
   7.299    
   7.300 -  \item [\hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}] augments
   7.301 -  the facts being currently indicated for use by a subsequent
   7.302 -  refinement step (such as \indexref{}{command}{apply}\hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}} or \indexref{}{command}{proof}\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}).
   7.303 +  \item \hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}} augments the facts being
   7.304 +  currently indicated for use by a subsequent refinement step (such as
   7.305 +  \indexref{}{command}{apply}\hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}} or \indexref{}{command}{proof}\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}).
   7.306    
   7.307 -  \item [\hyperlink{command.unfolding}{\mbox{\isa{\isacommand{unfolding}}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}] is
   7.308 -  structurally similar to \hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}, but unfolds definitional
   7.309 -  equations \isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}} throughout the goal state
   7.310 -  and facts.
   7.311 +  \item \hyperlink{command.unfolding}{\mbox{\isa{\isacommand{unfolding}}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}} is structurally
   7.312 +  similar to \hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}, but unfolds definitional equations
   7.313 +  \isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}} throughout the goal state and facts.
   7.314  
   7.315 -  \end{descr}
   7.316 +  \end{description}
   7.317  
   7.318    Forward chaining with an empty list of theorems is the same as not
   7.319    chaining at all.  Thus ``\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\isa{nothing}'' has no
   7.320 @@ -226,20 +374,20 @@
   7.321  \end{isamarkuptext}%
   7.322  \isamarkuptrue%
   7.323  %
   7.324 -\isamarkupsection{Goal statements \label{sec:goals}%
   7.325 +\isamarkupsubsection{Goals \label{sec:goals}%
   7.326  }
   7.327  \isamarkuptrue%
   7.328  %
   7.329  \begin{isamarkuptext}%
   7.330  \begin{matharray}{rcl}
   7.331 -    \indexdef{}{command}{lemma}\hypertarget{command.lemma}{\hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}}} & : & \isartrans{local{\dsh}theory}{proof(prove)} \\
   7.332 -    \indexdef{}{command}{theorem}\hypertarget{command.theorem}{\hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}} & : & \isartrans{local{\dsh}theory}{proof(prove)} \\
   7.333 -    \indexdef{}{command}{corollary}\hypertarget{command.corollary}{\hyperlink{command.corollary}{\mbox{\isa{\isacommand{corollary}}}}} & : & \isartrans{local{\dsh}theory}{proof(prove)} \\
   7.334 -    \indexdef{}{command}{have}\hypertarget{command.have}{\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}} & : & \isartrans{proof(state) ~|~ proof(chain)}{proof(prove)} \\
   7.335 -    \indexdef{}{command}{show}\hypertarget{command.show}{\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}} & : & \isartrans{proof(state) ~|~ proof(chain)}{proof(prove)} \\
   7.336 -    \indexdef{}{command}{hence}\hypertarget{command.hence}{\hyperlink{command.hence}{\mbox{\isa{\isacommand{hence}}}}} & : & \isartrans{proof(state)}{proof(prove)} \\
   7.337 -    \indexdef{}{command}{thus}\hypertarget{command.thus}{\hyperlink{command.thus}{\mbox{\isa{\isacommand{thus}}}}} & : & \isartrans{proof(state)}{proof(prove)} \\
   7.338 -    \indexdef{}{command}{print\_statement}\hypertarget{command.print-statement}{\hyperlink{command.print-statement}{\mbox{\isa{\isacommand{print{\isacharunderscore}statement}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   7.339 +    \indexdef{}{command}{lemma}\hypertarget{command.lemma}{\hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.340 +    \indexdef{}{command}{theorem}\hypertarget{command.theorem}{\hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.341 +    \indexdef{}{command}{corollary}\hypertarget{command.corollary}{\hyperlink{command.corollary}{\mbox{\isa{\isacommand{corollary}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.342 +    \indexdef{}{command}{have}\hypertarget{command.have}{\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ proof{\isacharparenleft}chain{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.343 +    \indexdef{}{command}{show}\hypertarget{command.show}{\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ proof{\isacharparenleft}chain{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.344 +    \indexdef{}{command}{hence}\hypertarget{command.hence}{\hyperlink{command.hence}{\mbox{\isa{\isacommand{hence}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.345 +    \indexdef{}{command}{thus}\hypertarget{command.thus}{\hyperlink{command.thus}{\mbox{\isa{\isacommand{thus}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.346 +    \indexdef{}{command}{print\_statement}\hypertarget{command.print-statement}{\hyperlink{command.print-statement}{\mbox{\isa{\isacommand{print{\isacharunderscore}statement}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   7.347    \end{matharray}
   7.348  
   7.349    From a theory context, proof mode is entered by an initial goal
   7.350 @@ -292,27 +440,27 @@
   7.351      ;
   7.352    \end{rail}
   7.353  
   7.354 -  \begin{descr}
   7.355 +  \begin{description}
   7.356    
   7.357 -  \item [\hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] enters proof mode with
   7.358 +  \item \hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} enters proof mode with
   7.359    \isa{{\isasymphi}} as main goal, eventually resulting in some fact \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} to be put back into the target context.  An additional
   7.360    \railnonterm{context} specification may build up an initial proof
   7.361    context for the subsequent claim; this includes local definitions
   7.362    and syntax as well, see the definition of \hyperlink{syntax.contextelem}{\mbox{\isa{contextelem}}} in
   7.363    \secref{sec:locale}.
   7.364    
   7.365 -  \item [\hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} and \hyperlink{command.corollary}{\mbox{\isa{\isacommand{corollary}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] are essentially the same as \hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}, but the facts are internally marked as
   7.366 +  \item \hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} and \hyperlink{command.corollary}{\mbox{\isa{\isacommand{corollary}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} are essentially the same as \hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}, but the facts are internally marked as
   7.367    being of a different kind.  This discrimination acts like a formal
   7.368    comment.
   7.369    
   7.370 -  \item [\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] claims a local goal,
   7.371 +  \item \hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} claims a local goal,
   7.372    eventually resulting in a fact within the current logical context.
   7.373    This operation is completely independent of any pending sub-goals of
   7.374    an enclosing goal statements, so \hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}} may be freely
   7.375    used for experimental exploration of potential results within a
   7.376    proof body.
   7.377    
   7.378 -  \item [\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] is like \hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} plus a second stage to refine some pending
   7.379 +  \item \hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} is like \hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} plus a second stage to refine some pending
   7.380    sub-goal for each one of the finished result, after having been
   7.381    exported into the corresponding context (at the head of the
   7.382    sub-proof of this \hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}} command).
   7.383 @@ -328,18 +476,18 @@
   7.384    Problem! Local statement will fail to solve any pending goal
   7.385    \end{ttbox}
   7.386    
   7.387 -  \item [\hyperlink{command.hence}{\mbox{\isa{\isacommand{hence}}}}] abbreviates ``\hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}~\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}'', i.e.\ claims a local goal to be proven by forward
   7.388 +  \item \hyperlink{command.hence}{\mbox{\isa{\isacommand{hence}}}} abbreviates ``\hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}~\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}'', i.e.\ claims a local goal to be proven by forward
   7.389    chaining the current facts.  Note that \hyperlink{command.hence}{\mbox{\isa{\isacommand{hence}}}} is also
   7.390    equivalent to ``\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\isa{this}~\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}''.
   7.391    
   7.392 -  \item [\hyperlink{command.thus}{\mbox{\isa{\isacommand{thus}}}}] abbreviates ``\hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}~\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}''.  Note that \hyperlink{command.thus}{\mbox{\isa{\isacommand{thus}}}} is also equivalent to
   7.393 +  \item \hyperlink{command.thus}{\mbox{\isa{\isacommand{thus}}}} abbreviates ``\hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}~\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}''.  Note that \hyperlink{command.thus}{\mbox{\isa{\isacommand{thus}}}} is also equivalent to
   7.394    ``\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\isa{this}~\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}''.
   7.395    
   7.396 -  \item [\hyperlink{command.print-statement}{\mbox{\isa{\isacommand{print{\isacharunderscore}statement}}}}~\isa{a}] prints facts from the
   7.397 +  \item \hyperlink{command.print-statement}{\mbox{\isa{\isacommand{print{\isacharunderscore}statement}}}}~\isa{a} prints facts from the
   7.398    current theory or proof context in long statement form, according to
   7.399    the syntax for \hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}} given above.
   7.400  
   7.401 -  \end{descr}
   7.402 +  \end{description}
   7.403  
   7.404    Any goal statement causes some term abbreviations (such as
   7.405    \indexref{}{variable}{?thesis}\hyperlink{variable.?thesis}{\mbox{\isa{{\isacharquery}thesis}}}) to be bound automatically, see also
   7.406 @@ -373,18 +521,68 @@
   7.407  \end{isamarkuptext}%
   7.408  \isamarkuptrue%
   7.409  %
   7.410 -\isamarkupsection{Initial and terminal proof steps \label{sec:proof-steps}%
   7.411 +\isamarkupsection{Refinement steps%
   7.412 +}
   7.413 +\isamarkuptrue%
   7.414 +%
   7.415 +\isamarkupsubsection{Proof method expressions \label{sec:proof-meth}%
   7.416 +}
   7.417 +\isamarkuptrue%
   7.418 +%
   7.419 +\begin{isamarkuptext}%
   7.420 +Proof methods are either basic ones, or expressions composed of
   7.421 +  methods via ``\verb|,|'' (sequential composition),
   7.422 +  ``\verb||\verb,|,\verb||'' (alternative choices), ``\verb|?|'' 
   7.423 +  (try), ``\verb|+|'' (repeat at least once), ``\verb|[|\isa{n}\verb|]|'' (restriction to first \isa{n}
   7.424 +  sub-goals, with default \isa{{\isachardoublequote}n\ {\isacharequal}\ {\isadigit{1}}{\isachardoublequote}}).  In practice, proof
   7.425 +  methods are usually just a comma separated list of
   7.426 +  \railqtok{nameref}~\railnonterm{args} specifications.  Note that
   7.427 +  parentheses may be dropped for single method specifications (with no
   7.428 +  arguments).
   7.429 +
   7.430 +  \indexouternonterm{method}
   7.431 +  \begin{rail}
   7.432 +    method: (nameref | '(' methods ')') (() | '?' | '+' | '[' nat? ']')
   7.433 +    ;
   7.434 +    methods: (nameref args | method) + (',' | '|')
   7.435 +    ;
   7.436 +  \end{rail}
   7.437 +
   7.438 +  Proper Isar proof methods do \emph{not} admit arbitrary goal
   7.439 +  addressing, but refer either to the first sub-goal or all sub-goals
   7.440 +  uniformly.  The goal restriction operator ``\isa{{\isachardoublequote}{\isacharbrackleft}n{\isacharbrackright}{\isachardoublequote}}''
   7.441 +  evaluates a method expression within a sandbox consisting of the
   7.442 +  first \isa{n} sub-goals (which need to exist).  For example, the
   7.443 +  method ``\isa{{\isachardoublequote}simp{\isacharunderscore}all{\isacharbrackleft}{\isadigit{3}}{\isacharbrackright}{\isachardoublequote}}'' simplifies the first three
   7.444 +  sub-goals, while ``\isa{{\isachardoublequote}{\isacharparenleft}rule\ foo{\isacharcomma}\ simp{\isacharunderscore}all{\isacharparenright}{\isacharbrackleft}{\isacharbrackright}{\isachardoublequote}}'' simplifies all
   7.445 +  new goals that emerge from applying rule \isa{{\isachardoublequote}foo{\isachardoublequote}} to the
   7.446 +  originally first one.
   7.447 +
   7.448 +  Improper methods, notably tactic emulations, offer a separate
   7.449 +  low-level goal addressing scheme as explicit argument to the
   7.450 +  individual tactic being involved.  Here ``\isa{{\isachardoublequote}{\isacharbrackleft}{\isacharbang}{\isacharbrackright}{\isachardoublequote}}'' refers to
   7.451 +  all goals, and ``\isa{{\isachardoublequote}{\isacharbrackleft}n{\isacharminus}{\isacharbrackright}{\isachardoublequote}}'' to all goals starting from \isa{{\isachardoublequote}n{\isachardoublequote}}.
   7.452 +
   7.453 +  \indexouternonterm{goalspec}
   7.454 +  \begin{rail}
   7.455 +    goalspec: '[' (nat '-' nat | nat '-' | nat | '!' ) ']'
   7.456 +    ;
   7.457 +  \end{rail}%
   7.458 +\end{isamarkuptext}%
   7.459 +\isamarkuptrue%
   7.460 +%
   7.461 +\isamarkupsubsection{Initial and terminal proof steps \label{sec:proof-steps}%
   7.462  }
   7.463  \isamarkuptrue%
   7.464  %
   7.465  \begin{isamarkuptext}%
   7.466  \begin{matharray}{rcl}
   7.467 -    \indexdef{}{command}{proof}\hypertarget{command.proof}{\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}} & : & \isartrans{proof(prove)}{proof(state)} \\
   7.468 -    \indexdef{}{command}{qed}\hypertarget{command.qed}{\hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}} & : & \isartrans{proof(state)}{proof(state) ~|~ theory} \\
   7.469 -    \indexdef{}{command}{by}\hypertarget{command.by}{\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}} & : & \isartrans{proof(prove)}{proof(state) ~|~ theory} \\
   7.470 -    \indexdef{}{command}{..}\hypertarget{command.ddot}{\hyperlink{command.ddot}{\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}}}} & : & \isartrans{proof(prove)}{proof(state) ~|~ theory} \\
   7.471 -    \indexdef{}{command}{.}\hypertarget{command.dot}{\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isachardot}}}}}} & : & \isartrans{proof(prove)}{proof(state) ~|~ theory} \\
   7.472 -    \indexdef{}{command}{sorry}\hypertarget{command.sorry}{\hyperlink{command.sorry}{\mbox{\isa{\isacommand{sorry}}}}} & : & \isartrans{proof(prove)}{proof(state) ~|~ theory} \\
   7.473 +    \indexdef{}{command}{proof}\hypertarget{command.proof}{\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
   7.474 +    \indexdef{}{command}{qed}\hypertarget{command.qed}{\hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ local{\isacharunderscore}theory\ {\isacharbar}\ theory{\isachardoublequote}} \\
   7.475 +    \indexdef{}{command}{by}\hypertarget{command.by}{\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ local{\isacharunderscore}theory\ {\isacharbar}\ theory{\isachardoublequote}} \\
   7.476 +    \indexdef{}{command}{..}\hypertarget{command.ddot}{\hyperlink{command.ddot}{\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ local{\isacharunderscore}theory\ {\isacharbar}\ theory{\isachardoublequote}} \\
   7.477 +    \indexdef{}{command}{.}\hypertarget{command.dot}{\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isachardot}}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ local{\isacharunderscore}theory\ {\isacharbar}\ theory{\isachardoublequote}} \\
   7.478 +    \indexdef{}{command}{sorry}\hypertarget{command.sorry}{\hyperlink{command.sorry}{\mbox{\isa{\isacommand{sorry}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ local{\isacharunderscore}theory\ {\isacharbar}\ theory{\isachardoublequote}} \\
   7.479    \end{matharray}
   7.480  
   7.481    Arbitrary goal refinement via tactics is considered harmful.
   7.482 @@ -432,40 +630,39 @@
   7.483      ;
   7.484    \end{rail}
   7.485  
   7.486 -  \begin{descr}
   7.487 +  \begin{description}
   7.488    
   7.489 -  \item [\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}] refines the goal by
   7.490 -  proof method \isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}; facts for forward chaining are
   7.491 -  passed if so indicated by \isa{{\isachardoublequote}proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} mode.
   7.492 +  \item \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}} refines the goal by proof
   7.493 +  method \isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}; facts for forward chaining are passed if so
   7.494 +  indicated by \isa{{\isachardoublequote}proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} mode.
   7.495    
   7.496 -  \item [\hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}}] refines any remaining
   7.497 -  goals by proof method \isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}} and concludes the
   7.498 -  sub-proof by assumption.  If the goal had been \isa{{\isachardoublequote}show{\isachardoublequote}} (or
   7.499 -  \isa{{\isachardoublequote}thus{\isachardoublequote}}), some pending sub-goal is solved as well by the rule
   7.500 -  resulting from the result \emph{exported} into the enclosing goal
   7.501 -  context.  Thus \isa{{\isachardoublequote}qed{\isachardoublequote}} may fail for two reasons: either \isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}} fails, or the resulting rule does not fit to any
   7.502 -  pending goal\footnote{This includes any additional ``strong''
   7.503 -  assumptions as introduced by \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}.} of the enclosing
   7.504 -  context.  Debugging such a situation might involve temporarily
   7.505 -  changing \hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}} into \hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}, or weakening the
   7.506 -  local context by replacing occurrences of \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}} by
   7.507 -  \hyperlink{command.presume}{\mbox{\isa{\isacommand{presume}}}}.
   7.508 +  \item \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}} refines any remaining goals by
   7.509 +  proof method \isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}} and concludes the sub-proof by assumption.
   7.510 +  If the goal had been \isa{{\isachardoublequote}show{\isachardoublequote}} (or \isa{{\isachardoublequote}thus{\isachardoublequote}}), some
   7.511 +  pending sub-goal is solved as well by the rule resulting from the
   7.512 +  result \emph{exported} into the enclosing goal context.  Thus \isa{{\isachardoublequote}qed{\isachardoublequote}} may fail for two reasons: either \isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}} fails, or the
   7.513 +  resulting rule does not fit to any pending goal\footnote{This
   7.514 +  includes any additional ``strong'' assumptions as introduced by
   7.515 +  \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}.} of the enclosing context.  Debugging such a
   7.516 +  situation might involve temporarily changing \hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}} into
   7.517 +  \hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}, or weakening the local context by replacing
   7.518 +  occurrences of \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}} by \hyperlink{command.presume}{\mbox{\isa{\isacommand{presume}}}}.
   7.519    
   7.520 -  \item [\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}\ m\isactrlsub {\isadigit{2}}{\isachardoublequote}}] is a
   7.521 -  \emph{terminal proof}\index{proof!terminal}; it abbreviates
   7.522 -  \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}~\isa{{\isachardoublequote}qed{\isachardoublequote}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}}, but with backtracking across both methods.  Debugging
   7.523 -  an unsuccessful \hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}\ m\isactrlsub {\isadigit{2}}{\isachardoublequote}}
   7.524 -  command can be done by expanding its definition; in many cases
   7.525 -  \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}} (or even \isa{{\isachardoublequote}apply{\isachardoublequote}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}) is already sufficient to see the
   7.526 +  \item \hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}\ m\isactrlsub {\isadigit{2}}{\isachardoublequote}} is a \emph{terminal
   7.527 +  proof}\index{proof!terminal}; it abbreviates \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}~\isa{{\isachardoublequote}qed{\isachardoublequote}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}}, but with
   7.528 +  backtracking across both methods.  Debugging an unsuccessful
   7.529 +  \hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}\ m\isactrlsub {\isadigit{2}}{\isachardoublequote}} command can be done by expanding its
   7.530 +  definition; in many cases \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}} (or even
   7.531 +  \isa{{\isachardoublequote}apply{\isachardoublequote}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}) is already sufficient to see the
   7.532    problem.
   7.533  
   7.534 -  \item [``\hyperlink{command.ddot}{\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}}}''] is a \emph{default
   7.535 +  \item ``\hyperlink{command.ddot}{\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}}}'' is a \emph{default
   7.536    proof}\index{proof!default}; it abbreviates \hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}rule{\isachardoublequote}}.
   7.537  
   7.538 -  \item [``\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isachardot}}}}}''] is a \emph{trivial
   7.539 +  \item ``\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isachardot}}}}}'' is a \emph{trivial
   7.540    proof}\index{proof!trivial}; it abbreviates \hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}this{\isachardoublequote}}.
   7.541    
   7.542 -  \item [\hyperlink{command.sorry}{\mbox{\isa{\isacommand{sorry}}}}] is a \emph{fake proof}\index{proof!fake}
   7.543 +  \item \hyperlink{command.sorry}{\mbox{\isa{\isacommand{sorry}}}} is a \emph{fake proof}\index{proof!fake}
   7.544    pretending to solve the pending claim without further ado.  This
   7.545    only works in interactive development, or if the \verb|quick_and_dirty| flag is enabled (in ML).  Facts emerging from fake
   7.546    proofs are not the real thing.  Internally, each theorem container
   7.547 @@ -474,11 +671,11 @@
   7.548    The most important application of \hyperlink{command.sorry}{\mbox{\isa{\isacommand{sorry}}}} is to support
   7.549    experimentation and top-down proof development.
   7.550  
   7.551 -  \end{descr}%
   7.552 +  \end{description}%
   7.553  \end{isamarkuptext}%
   7.554  \isamarkuptrue%
   7.555  %
   7.556 -\isamarkupsection{Fundamental methods and attributes \label{sec:pure-meth-att}%
   7.557 +\isamarkupsubsection{Fundamental methods and attributes \label{sec:pure-meth-att}%
   7.558  }
   7.559  \isamarkuptrue%
   7.560  %
   7.561 @@ -489,19 +686,19 @@
   7.562    \chref{ch:gen-tools} and \chref{ch:hol}).
   7.563  
   7.564    \begin{matharray}{rcl}
   7.565 -    \indexdef{}{method}{-}\hypertarget{method.-}{\hyperlink{method.-}{\mbox{\isa{{\isacharminus}}}}} & : & \isarmeth \\
   7.566 -    \indexdef{}{method}{fact}\hypertarget{method.fact}{\hyperlink{method.fact}{\mbox{\isa{fact}}}} & : & \isarmeth \\
   7.567 -    \indexdef{}{method}{assumption}\hypertarget{method.assumption}{\hyperlink{method.assumption}{\mbox{\isa{assumption}}}} & : & \isarmeth \\
   7.568 -    \indexdef{}{method}{this}\hypertarget{method.this}{\hyperlink{method.this}{\mbox{\isa{this}}}} & : & \isarmeth \\
   7.569 -    \indexdef{}{method}{rule}\hypertarget{method.rule}{\hyperlink{method.rule}{\mbox{\isa{rule}}}} & : & \isarmeth \\
   7.570 -    \indexdef{}{method}{iprover}\hypertarget{method.iprover}{\hyperlink{method.iprover}{\mbox{\isa{iprover}}}} & : & \isarmeth \\[0.5ex]
   7.571 -    \indexdef{Pure}{attribute}{intro}\hypertarget{attribute.Pure.intro}{\hyperlink{attribute.Pure.intro}{\mbox{\isa{intro}}}} & : & \isaratt \\
   7.572 -    \indexdef{Pure}{attribute}{elim}\hypertarget{attribute.Pure.elim}{\hyperlink{attribute.Pure.elim}{\mbox{\isa{elim}}}} & : & \isaratt \\
   7.573 -    \indexdef{Pure}{attribute}{dest}\hypertarget{attribute.Pure.dest}{\hyperlink{attribute.Pure.dest}{\mbox{\isa{dest}}}} & : & \isaratt \\
   7.574 -    \indexdef{}{attribute}{rule}\hypertarget{attribute.rule}{\hyperlink{attribute.rule}{\mbox{\isa{rule}}}} & : & \isaratt \\[0.5ex]
   7.575 -    \indexdef{}{attribute}{OF}\hypertarget{attribute.OF}{\hyperlink{attribute.OF}{\mbox{\isa{OF}}}} & : & \isaratt \\
   7.576 -    \indexdef{}{attribute}{of}\hypertarget{attribute.of}{\hyperlink{attribute.of}{\mbox{\isa{of}}}} & : & \isaratt \\
   7.577 -    \indexdef{}{attribute}{where}\hypertarget{attribute.where}{\hyperlink{attribute.where}{\mbox{\isa{where}}}} & : & \isaratt \\
   7.578 +    \indexdef{}{method}{-}\hypertarget{method.-}{\hyperlink{method.-}{\mbox{\isa{{\isacharminus}}}}} & : & \isa{method} \\
   7.579 +    \indexdef{}{method}{fact}\hypertarget{method.fact}{\hyperlink{method.fact}{\mbox{\isa{fact}}}} & : & \isa{method} \\
   7.580 +    \indexdef{}{method}{assumption}\hypertarget{method.assumption}{\hyperlink{method.assumption}{\mbox{\isa{assumption}}}} & : & \isa{method} \\
   7.581 +    \indexdef{}{method}{this}\hypertarget{method.this}{\hyperlink{method.this}{\mbox{\isa{this}}}} & : & \isa{method} \\
   7.582 +    \indexdef{}{method}{rule}\hypertarget{method.rule}{\hyperlink{method.rule}{\mbox{\isa{rule}}}} & : & \isa{method} \\
   7.583 +    \indexdef{}{method}{iprover}\hypertarget{method.iprover}{\hyperlink{method.iprover}{\mbox{\isa{iprover}}}} & : & \isa{method} \\[0.5ex]
   7.584 +    \indexdef{Pure}{attribute}{intro}\hypertarget{attribute.Pure.intro}{\hyperlink{attribute.Pure.intro}{\mbox{\isa{intro}}}} & : & \isa{attribute} \\
   7.585 +    \indexdef{Pure}{attribute}{elim}\hypertarget{attribute.Pure.elim}{\hyperlink{attribute.Pure.elim}{\mbox{\isa{elim}}}} & : & \isa{attribute} \\
   7.586 +    \indexdef{Pure}{attribute}{dest}\hypertarget{attribute.Pure.dest}{\hyperlink{attribute.Pure.dest}{\mbox{\isa{dest}}}} & : & \isa{attribute} \\
   7.587 +    \indexdef{}{attribute}{rule}\hypertarget{attribute.rule}{\hyperlink{attribute.rule}{\mbox{\isa{rule}}}} & : & \isa{attribute} \\[0.5ex]
   7.588 +    \indexdef{}{attribute}{OF}\hypertarget{attribute.OF}{\hyperlink{attribute.OF}{\mbox{\isa{OF}}}} & : & \isa{attribute} \\
   7.589 +    \indexdef{}{attribute}{of}\hypertarget{attribute.of}{\hyperlink{attribute.of}{\mbox{\isa{of}}}} & : & \isa{attribute} \\
   7.590 +    \indexdef{}{attribute}{where}\hypertarget{attribute.where}{\hyperlink{attribute.where}{\mbox{\isa{where}}}} & : & \isa{attribute} \\
   7.591    \end{matharray}
   7.592  
   7.593    \begin{rail}
   7.594 @@ -525,25 +722,24 @@
   7.595      ;
   7.596    \end{rail}
   7.597  
   7.598 -  \begin{descr}
   7.599 +  \begin{description}
   7.600    
   7.601 -  \item [``\hyperlink{method.-}{\mbox{\isa{{\isacharminus}}}}'' (minus)] does nothing but insert the
   7.602 -  forward chaining facts as premises into the goal.  Note that command
   7.603 +  \item ``\hyperlink{method.-}{\mbox{\isa{{\isacharminus}}}}'' (minus) does nothing but insert the forward
   7.604 +  chaining facts as premises into the goal.  Note that command
   7.605    \indexref{}{command}{proof}\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}} without any method actually performs a single
   7.606    reduction step using the \indexref{}{method}{rule}\hyperlink{method.rule}{\mbox{\isa{rule}}} method; thus a plain
   7.607    \emph{do-nothing} proof step would be ``\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}{\isacharminus}{\isachardoublequote}}'' rather than \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}} alone.
   7.608    
   7.609 -  \item [\hyperlink{method.fact}{\mbox{\isa{fact}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] composes
   7.610 -  some fact from \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ a\isactrlsub n{\isachardoublequote}} (or implicitly from
   7.611 -  the current proof context) modulo unification of schematic type and
   7.612 -  term variables.  The rule structure is not taken into account, i.e.\
   7.613 -  meta-level implication is considered atomic.  This is the same
   7.614 -  principle underlying literal facts (cf.\ \secref{sec:syn-att}):
   7.615 -  ``\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}}~\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{fact}'' is
   7.616 -  equivalent to ``\hyperlink{command.note}{\mbox{\isa{\isacommand{note}}}}~\verb|`|\isa{{\isasymphi}}\verb|`|'' provided that \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} is an instance of some known
   7.617 -  \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} in the proof context.
   7.618 +  \item \hyperlink{method.fact}{\mbox{\isa{fact}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} composes some fact from
   7.619 +  \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ a\isactrlsub n{\isachardoublequote}} (or implicitly from the current proof context)
   7.620 +  modulo unification of schematic type and term variables.  The rule
   7.621 +  structure is not taken into account, i.e.\ meta-level implication is
   7.622 +  considered atomic.  This is the same principle underlying literal
   7.623 +  facts (cf.\ \secref{sec:syn-att}): ``\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}}~\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{fact}'' is equivalent to ``\hyperlink{command.note}{\mbox{\isa{\isacommand{note}}}}~\verb|`|\isa{{\isasymphi}}\verb|`|'' provided that
   7.624 +  \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} is an instance of some known \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} in the
   7.625 +  proof context.
   7.626    
   7.627 -  \item [\hyperlink{method.assumption}{\mbox{\isa{assumption}}}] solves some goal by a single assumption
   7.628 +  \item \hyperlink{method.assumption}{\mbox{\isa{assumption}}} solves some goal by a single assumption
   7.629    step.  All given facts are guaranteed to participate in the
   7.630    refinement; this means there may be only 0 or 1 in the first place.
   7.631    Recall that \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}} (\secref{sec:proof-steps}) already
   7.632 @@ -551,14 +747,13 @@
   7.633    proofs usually need not quote the \hyperlink{method.assumption}{\mbox{\isa{assumption}}} method at
   7.634    all.
   7.635    
   7.636 -  \item [\hyperlink{method.this}{\mbox{\isa{this}}}] applies all of the current facts directly as
   7.637 +  \item \hyperlink{method.this}{\mbox{\isa{this}}} applies all of the current facts directly as
   7.638    rules.  Recall that ``\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isachardot}}}}}'' (dot) abbreviates ``\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{this}''.
   7.639    
   7.640 -  \item [\hyperlink{method.rule}{\mbox{\isa{rule}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] applies some
   7.641 -  rule given as argument in backward manner; facts are used to reduce
   7.642 -  the rule before applying it to the goal.  Thus \hyperlink{method.rule}{\mbox{\isa{rule}}}
   7.643 -  without facts is plain introduction, while with facts it becomes
   7.644 -  elimination.
   7.645 +  \item \hyperlink{method.rule}{\mbox{\isa{rule}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} applies some rule given as
   7.646 +  argument in backward manner; facts are used to reduce the rule
   7.647 +  before applying it to the goal.  Thus \hyperlink{method.rule}{\mbox{\isa{rule}}} without facts
   7.648 +  is plain introduction, while with facts it becomes elimination.
   7.649    
   7.650    When no arguments are given, the \hyperlink{method.rule}{\mbox{\isa{rule}}} method tries to pick
   7.651    appropriate rules automatically, as declared in the current context
   7.652 @@ -567,10 +762,10 @@
   7.653    default behavior of \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}} and ``\hyperlink{command.ddot}{\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}}}'' 
   7.654    (double-dot) steps (see \secref{sec:proof-steps}).
   7.655    
   7.656 -  \item [\hyperlink{method.iprover}{\mbox{\isa{iprover}}}] performs intuitionistic proof search,
   7.657 +  \item \hyperlink{method.iprover}{\mbox{\isa{iprover}}} performs intuitionistic proof search,
   7.658    depending on specifically declared rules from the context, or given
   7.659    as explicit arguments.  Chained facts are inserted into the goal
   7.660 -  before commencing proof search; ``\hyperlink{method.iprover}{\mbox{\isa{iprover}}}\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' 
   7.661 +  before commencing proof search; ``\hyperlink{method.iprover}{\mbox{\isa{iprover}}}\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}''
   7.662    means to include the current \hyperlink{fact.prems}{\mbox{\isa{prems}}} as well.
   7.663    
   7.664    Rules need to be classified as \hyperlink{attribute.Pure.intro}{\mbox{\isa{intro}}},
   7.665 @@ -582,8 +777,8 @@
   7.666    explicit weight annotation may be given as well; otherwise the
   7.667    number of rule premises will be taken into account here.
   7.668    
   7.669 -  \item [\hyperlink{attribute.Pure.intro}{\mbox{\isa{intro}}}, \hyperlink{attribute.Pure.elim}{\mbox{\isa{elim}}}, and
   7.670 -  \hyperlink{attribute.Pure.dest}{\mbox{\isa{dest}}}] declare introduction, elimination, and
   7.671 +  \item \hyperlink{attribute.Pure.intro}{\mbox{\isa{intro}}}, \hyperlink{attribute.Pure.elim}{\mbox{\isa{elim}}}, and
   7.672 +  \hyperlink{attribute.Pure.dest}{\mbox{\isa{dest}}} declare introduction, elimination, and
   7.673    destruct rules, to be used with the \hyperlink{method.rule}{\mbox{\isa{rule}}} and \hyperlink{method.iprover}{\mbox{\isa{iprover}}} methods.  Note that the latter will ignore rules declared
   7.674    with ``\isa{{\isachardoublequote}{\isacharquery}{\isachardoublequote}}'', while ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}''  are used most
   7.675    aggressively.
   7.676 @@ -592,144 +787,35 @@
   7.677    own variants of these attributes; use qualified names to access the
   7.678    present versions of Isabelle/Pure, i.e.\ \hyperlink{attribute.Pure.Pure.intro}{\mbox{\isa{Pure{\isachardot}intro}}}.
   7.679    
   7.680 -  \item [\hyperlink{attribute.rule}{\mbox{\isa{rule}}}~\isa{del}] undeclares introduction,
   7.681 +  \item \hyperlink{attribute.rule}{\mbox{\isa{rule}}}~\isa{del} undeclares introduction,
   7.682    elimination, or destruct rules.
   7.683    
   7.684 -  \item [\hyperlink{attribute.OF}{\mbox{\isa{OF}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] applies some
   7.685 -  theorem to all of the given rules \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ a\isactrlsub n{\isachardoublequote}}
   7.686 -  (in parallel).  This corresponds to the \verb|"op MRS"| operation in
   7.687 -  ML, but note the reversed order.  Positions may be effectively
   7.688 -  skipped by including ``\isa{{\isacharunderscore}}'' (underscore) as argument.
   7.689 +  \item \hyperlink{attribute.OF}{\mbox{\isa{OF}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}} applies some theorem to all
   7.690 +  of the given rules \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ a\isactrlsub n{\isachardoublequote}} (in parallel).  This
   7.691 +  corresponds to the \verb|op MRS| operation in ML,
   7.692 +  but note the reversed order.  Positions may be effectively skipped
   7.693 +  by including ``\isa{{\isacharunderscore}}'' (underscore) as argument.
   7.694    
   7.695 -  \item [\hyperlink{attribute.of}{\mbox{\isa{of}}}~\isa{{\isachardoublequote}t\isactrlsub {\isadigit{1}}\ {\isasymdots}\ t\isactrlsub n{\isachardoublequote}}] performs
   7.696 -  positional instantiation of term variables.  The terms \isa{{\isachardoublequote}t\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ t\isactrlsub n{\isachardoublequote}} are substituted for any schematic
   7.697 -  variables occurring in a theorem from left to right; ``\isa{{\isacharunderscore}}''
   7.698 -  (underscore) indicates to skip a position.  Arguments following a
   7.699 -  ``\isa{{\isachardoublequote}concl{\isacharcolon}{\isachardoublequote}}'' specification refer to positions of the
   7.700 -  conclusion of a rule.
   7.701 +  \item \hyperlink{attribute.of}{\mbox{\isa{of}}}~\isa{{\isachardoublequote}t\isactrlsub {\isadigit{1}}\ {\isasymdots}\ t\isactrlsub n{\isachardoublequote}} performs positional
   7.702 +  instantiation of term variables.  The terms \isa{{\isachardoublequote}t\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ t\isactrlsub n{\isachardoublequote}} are
   7.703 +  substituted for any schematic variables occurring in a theorem from
   7.704 +  left to right; ``\isa{{\isacharunderscore}}'' (underscore) indicates to skip a
   7.705 +  position.  Arguments following a ``\isa{{\isachardoublequote}concl{\isacharcolon}{\isachardoublequote}}'' specification
   7.706 +  refer to positions of the conclusion of a rule.
   7.707    
   7.708 -  \item [\hyperlink{attribute.where}{\mbox{\isa{where}}}~\isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}\ {\isacharequal}\ t\isactrlsub {\isadigit{1}}\ {\isasymAND}\ {\isasymdots}\ x\isactrlsub n\ {\isacharequal}\ t\isactrlsub n{\isachardoublequote}}] performs named instantiation of schematic
   7.709 -  type and term variables occurring in a theorem.  Schematic variables
   7.710 -  have to be specified on the left-hand side (e.g.\ \isa{{\isachardoublequote}{\isacharquery}x{\isadigit{1}}{\isachardot}{\isadigit{3}}{\isachardoublequote}}).
   7.711 -  The question mark may be omitted if the variable name is a plain
   7.712 -  identifier without index.  As type instantiations are inferred from
   7.713 -  term instantiations, explicit type instantiations are seldom
   7.714 -  necessary.
   7.715 +  \item \hyperlink{attribute.where}{\mbox{\isa{where}}}~\isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}\ {\isacharequal}\ t\isactrlsub {\isadigit{1}}\ {\isasymAND}\ {\isasymdots}\ x\isactrlsub n\ {\isacharequal}\ t\isactrlsub n{\isachardoublequote}}
   7.716 +  performs named instantiation of schematic type and term variables
   7.717 +  occurring in a theorem.  Schematic variables have to be specified on
   7.718 +  the left-hand side (e.g.\ \isa{{\isachardoublequote}{\isacharquery}x{\isadigit{1}}{\isachardot}{\isadigit{3}}{\isachardoublequote}}).  The question mark may
   7.719 +  be omitted if the variable name is a plain identifier without index.
   7.720 +  As type instantiations are inferred from term instantiations,
   7.721 +  explicit type instantiations are seldom necessary.
   7.722  
   7.723 -  \end{descr}%
   7.724 +  \end{description}%
   7.725  \end{isamarkuptext}%
   7.726  \isamarkuptrue%
   7.727  %
   7.728 -\isamarkupsection{Term abbreviations \label{sec:term-abbrev}%
   7.729 -}
   7.730 -\isamarkuptrue%
   7.731 -%
   7.732 -\begin{isamarkuptext}%
   7.733 -\begin{matharray}{rcl}
   7.734 -    \indexdef{}{command}{let}\hypertarget{command.let}{\hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
   7.735 -    \indexdef{}{keyword}{is}\hypertarget{keyword.is}{\hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}}} & : & syntax \\
   7.736 -  \end{matharray}
   7.737 -
   7.738 -  Abbreviations may be either bound by explicit \hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}~\isa{{\isachardoublequote}p\ {\isasymequiv}\ t{\isachardoublequote}} statements, or by annotating assumptions or
   7.739 -  goal statements with a list of patterns ``\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIS}\ p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub n{\isacharparenright}{\isachardoublequote}}''.  In both cases, higher-order matching is invoked to
   7.740 -  bind extra-logical term variables, which may be either named
   7.741 -  schematic variables of the form \isa{{\isacharquery}x}, or nameless dummies
   7.742 -  ``\hyperlink{variable.underscore}{\mbox{\isa{{\isacharunderscore}}}}'' (underscore). Note that in the \hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}
   7.743 -  form the patterns occur on the left-hand side, while the \hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}} patterns are in postfix position.
   7.744 -
   7.745 -  Polymorphism of term bindings is handled in Hindley-Milner style,
   7.746 -  similar to ML.  Type variables referring to local assumptions or
   7.747 -  open goal statements are \emph{fixed}, while those of finished
   7.748 -  results or bound by \hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}} may occur in \emph{arbitrary}
   7.749 -  instances later.  Even though actual polymorphism should be rarely
   7.750 -  used in practice, this mechanism is essential to achieve proper
   7.751 -  incremental type-inference, as the user proceeds to build up the
   7.752 -  Isar proof text from left to right.
   7.753 -
   7.754 -  \medskip Term abbreviations are quite different from local
   7.755 -  definitions as introduced via \hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}} (see
   7.756 -  \secref{sec:proof-context}).  The latter are visible within the
   7.757 -  logic as actual equations, while abbreviations disappear during the
   7.758 -  input process just after type checking.  Also note that \hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}} does not support polymorphism.
   7.759 -
   7.760 -  \begin{rail}
   7.761 -    'let' ((term + 'and') '=' term + 'and')
   7.762 -    ;  
   7.763 -  \end{rail}
   7.764 -
   7.765 -  The syntax of \hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}} patterns follows \railnonterm{termpat}
   7.766 -  or \railnonterm{proppat} (see \secref{sec:term-decls}).
   7.767 -
   7.768 -  \begin{descr}
   7.769 -
   7.770 -  \item [\hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}~\isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}\ {\isacharequal}\ t\isactrlsub {\isadigit{1}}\ {\isasymAND}\ {\isasymdots}\ p\isactrlsub n\ {\isacharequal}\ t\isactrlsub n{\isachardoublequote}}] binds any text variables in patterns \isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ p\isactrlsub n{\isachardoublequote}} by simultaneous higher-order matching
   7.771 -  against terms \isa{{\isachardoublequote}t\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ t\isactrlsub n{\isachardoublequote}}.
   7.772 -
   7.773 -  \item [\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIS}\ p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub n{\isacharparenright}{\isachardoublequote}}] resembles \hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}, but matches \isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ p\isactrlsub n{\isachardoublequote}} against the
   7.774 -  preceding statement.  Also note that \hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}} is not a
   7.775 -  separate command, but part of others (such as \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}},
   7.776 -  \hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}} etc.).
   7.777 -
   7.778 -  \end{descr}
   7.779 -
   7.780 -  Some \emph{implicit} term abbreviations\index{term abbreviations}
   7.781 -  for goals and facts are available as well.  For any open goal,
   7.782 -  \indexref{}{variable}{thesis}\hyperlink{variable.thesis}{\mbox{\isa{thesis}}} refers to its object-level statement,
   7.783 -  abstracted over any meta-level parameters (if present).  Likewise,
   7.784 -  \indexref{}{variable}{this}\hyperlink{variable.this}{\mbox{\isa{this}}} is bound for fact statements resulting from
   7.785 -  assumptions or finished goals.  In case \hyperlink{variable.this}{\mbox{\isa{this}}} refers to
   7.786 -  an object-logic statement that is an application \isa{{\isachardoublequote}f\ t{\isachardoublequote}}, then
   7.787 -  \isa{t} is bound to the special text variable ``\hyperlink{variable.dots}{\mbox{\isa{{\isasymdots}}}}''
   7.788 -  (three dots).  The canonical application of this convenience are
   7.789 -  calculational proofs (see \secref{sec:calculation}).%
   7.790 -\end{isamarkuptext}%
   7.791 -\isamarkuptrue%
   7.792 -%
   7.793 -\isamarkupsection{Block structure%
   7.794 -}
   7.795 -\isamarkuptrue%
   7.796 -%
   7.797 -\begin{isamarkuptext}%
   7.798 -\begin{matharray}{rcl}
   7.799 -    \indexdef{}{command}{next}\hypertarget{command.next}{\hyperlink{command.next}{\mbox{\isa{\isacommand{next}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
   7.800 -    \indexdef{}{command}{\{}\hypertarget{command.braceleft}{\hyperlink{command.braceleft}{\mbox{\isa{\isacommand{{\isacharbraceleft}}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
   7.801 -    \indexdef{}{command}{\}}\hypertarget{command.braceright}{\hyperlink{command.braceright}{\mbox{\isa{\isacommand{{\isacharbraceright}}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
   7.802 -  \end{matharray}
   7.803 -
   7.804 -  While Isar is inherently block-structured, opening and closing
   7.805 -  blocks is mostly handled rather casually, with little explicit
   7.806 -  user-intervention.  Any local goal statement automatically opens
   7.807 -  \emph{two} internal blocks, which are closed again when concluding
   7.808 -  the sub-proof (by \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}} etc.).  Sections of different
   7.809 -  context within a sub-proof may be switched via \hyperlink{command.next}{\mbox{\isa{\isacommand{next}}}},
   7.810 -  which is just a single block-close followed by block-open again.
   7.811 -  The effect of \hyperlink{command.next}{\mbox{\isa{\isacommand{next}}}} is to reset the local proof context;
   7.812 -  there is no goal focus involved here!
   7.813 -
   7.814 -  For slightly more advanced applications, there are explicit block
   7.815 -  parentheses as well.  These typically achieve a stronger forward
   7.816 -  style of reasoning.
   7.817 -
   7.818 -  \begin{descr}
   7.819 -
   7.820 -  \item [\hyperlink{command.next}{\mbox{\isa{\isacommand{next}}}}] switches to a fresh block within a
   7.821 -  sub-proof, resetting the local context to the initial one.
   7.822 -
   7.823 -  \item [\hyperlink{command.braceleft}{\mbox{\isa{\isacommand{{\isacharbraceleft}}}}} and \hyperlink{command.braceright}{\mbox{\isa{\isacommand{{\isacharbraceright}}}}}] explicitly open and close
   7.824 -  blocks.  Any current facts pass through ``\hyperlink{command.braceleft}{\mbox{\isa{\isacommand{{\isacharbraceleft}}}}}''
   7.825 -  unchanged, while ``\hyperlink{command.braceright}{\mbox{\isa{\isacommand{{\isacharbraceright}}}}}'' causes any result to be
   7.826 -  \emph{exported} into the enclosing context.  Thus fixed variables
   7.827 -  are generalized, assumptions discharged, and local definitions
   7.828 -  unfolded (cf.\ \secref{sec:proof-context}).  There is no difference
   7.829 -  of \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}} and \hyperlink{command.presume}{\mbox{\isa{\isacommand{presume}}}} in this mode of
   7.830 -  forward reasoning --- in contrast to plain backward reasoning with
   7.831 -  the result exported at \hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}} time.
   7.832 -
   7.833 -  \end{descr}%
   7.834 -\end{isamarkuptext}%
   7.835 -\isamarkuptrue%
   7.836 -%
   7.837 -\isamarkupsection{Emulating tactic scripts \label{sec:tactic-commands}%
   7.838 +\isamarkupsubsection{Emulating tactic scripts \label{sec:tactic-commands}%
   7.839  }
   7.840  \isamarkuptrue%
   7.841  %
   7.842 @@ -744,12 +830,12 @@
   7.843    be used in scripts, too.
   7.844  
   7.845    \begin{matharray}{rcl}
   7.846 -    \indexdef{}{command}{apply}\hypertarget{command.apply}{\hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof(prove)}{proof(prove)} \\
   7.847 -    \indexdef{}{command}{apply\_end}\hypertarget{command.apply-end}{\hyperlink{command.apply-end}{\mbox{\isa{\isacommand{apply{\isacharunderscore}end}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof(state)}{proof(state)} \\
   7.848 -    \indexdef{}{command}{done}\hypertarget{command.done}{\hyperlink{command.done}{\mbox{\isa{\isacommand{done}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof(prove)}{proof(state)} \\
   7.849 -    \indexdef{}{command}{defer}\hypertarget{command.defer}{\hyperlink{command.defer}{\mbox{\isa{\isacommand{defer}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof}{proof} \\
   7.850 -    \indexdef{}{command}{prefer}\hypertarget{command.prefer}{\hyperlink{command.prefer}{\mbox{\isa{\isacommand{prefer}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof}{proof} \\
   7.851 -    \indexdef{}{command}{back}\hypertarget{command.back}{\hyperlink{command.back}{\mbox{\isa{\isacommand{back}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof}{proof} \\
   7.852 +    \indexdef{}{command}{apply}\hypertarget{command.apply}{\hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.853 +    \indexdef{}{command}{apply\_end}\hypertarget{command.apply-end}{\hyperlink{command.apply-end}{\mbox{\isa{\isacommand{apply{\isacharunderscore}end}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
   7.854 +    \indexdef{}{command}{done}\hypertarget{command.done}{\hyperlink{command.done}{\mbox{\isa{\isacommand{done}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ local{\isacharunderscore}theory\ {\isacharbar}\ theory{\isachardoublequote}} \\
   7.855 +    \indexdef{}{command}{defer}\hypertarget{command.defer}{\hyperlink{command.defer}{\mbox{\isa{\isacommand{defer}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}\ proof{\isachardoublequote}} \\
   7.856 +    \indexdef{}{command}{prefer}\hypertarget{command.prefer}{\hyperlink{command.prefer}{\mbox{\isa{\isacommand{prefer}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}\ proof{\isachardoublequote}} \\
   7.857 +    \indexdef{}{command}{back}\hypertarget{command.back}{\hyperlink{command.back}{\mbox{\isa{\isacommand{back}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}\ proof{\isachardoublequote}} \\
   7.858    \end{matharray}
   7.859  
   7.860    \begin{rail}
   7.861 @@ -761,20 +847,18 @@
   7.862      ;
   7.863    \end{rail}
   7.864  
   7.865 -  \begin{descr}
   7.866 +  \begin{description}
   7.867  
   7.868 -  \item [\hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}~\isa{m}] applies proof method \isa{m}
   7.869 -  in initial position, but unlike \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}} it retains
   7.870 -  ``\isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}}'' mode.  Thus consecutive method
   7.871 -  applications may be given just as in tactic scripts.
   7.872 +  \item \hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}~\isa{m} applies proof method \isa{m} in
   7.873 +  initial position, but unlike \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}} it retains ``\isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}}'' mode.  Thus consecutive method applications may be
   7.874 +  given just as in tactic scripts.
   7.875    
   7.876    Facts are passed to \isa{m} as indicated by the goal's
   7.877    forward-chain mode, and are \emph{consumed} afterwards.  Thus any
   7.878    further \hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}} command would always work in a purely
   7.879    backward manner.
   7.880    
   7.881 -  \item [\hyperlink{command.apply-end}{\mbox{\isa{\isacommand{apply{\isacharunderscore}end}}}}~\isa{{\isachardoublequote}m{\isachardoublequote}}] applies proof method
   7.882 -  \isa{m} as if in terminal position.  Basically, this simulates a
   7.883 +  \item \hyperlink{command.apply-end}{\mbox{\isa{\isacommand{apply{\isacharunderscore}end}}}}~\isa{{\isachardoublequote}m{\isachardoublequote}} applies proof method \isa{m} as if in terminal position.  Basically, this simulates a
   7.884    multi-step tactic script for \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}, but may be given
   7.885    anywhere within the proof body.
   7.886    
   7.887 @@ -782,20 +866,21 @@
   7.888    context is that of the enclosing goal (as for actual \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}).  Thus the proof method may not refer to any assumptions
   7.889    introduced in the current body, for example.
   7.890    
   7.891 -  \item [\hyperlink{command.done}{\mbox{\isa{\isacommand{done}}}}] completes a proof script, provided that
   7.892 -  the current goal state is solved completely.  Note that actual
   7.893 +  \item \hyperlink{command.done}{\mbox{\isa{\isacommand{done}}}} completes a proof script, provided that the
   7.894 +  current goal state is solved completely.  Note that actual
   7.895    structured proof commands (e.g.\ ``\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isachardot}}}}}'' or \hyperlink{command.sorry}{\mbox{\isa{\isacommand{sorry}}}}) may be used to conclude proof scripts as well.
   7.896  
   7.897 -  \item [\hyperlink{command.defer}{\mbox{\isa{\isacommand{defer}}}}~\isa{n} and \hyperlink{command.prefer}{\mbox{\isa{\isacommand{prefer}}}}~\isa{n}] shuffle the list of pending goals: \hyperlink{command.defer}{\mbox{\isa{\isacommand{defer}}}} puts off
   7.898 +  \item \hyperlink{command.defer}{\mbox{\isa{\isacommand{defer}}}}~\isa{n} and \hyperlink{command.prefer}{\mbox{\isa{\isacommand{prefer}}}}~\isa{n}
   7.899 +  shuffle the list of pending goals: \hyperlink{command.defer}{\mbox{\isa{\isacommand{defer}}}} puts off
   7.900    sub-goal \isa{n} to the end of the list (\isa{{\isachardoublequote}n\ {\isacharequal}\ {\isadigit{1}}{\isachardoublequote}} by
   7.901    default), while \hyperlink{command.prefer}{\mbox{\isa{\isacommand{prefer}}}} brings sub-goal \isa{n} to the
   7.902    front.
   7.903    
   7.904 -  \item [\hyperlink{command.back}{\mbox{\isa{\isacommand{back}}}}] does back-tracking over the result
   7.905 -  sequence of the latest proof command.  Basically, any proof command
   7.906 -  may return multiple results.
   7.907 +  \item \hyperlink{command.back}{\mbox{\isa{\isacommand{back}}}} does back-tracking over the result sequence
   7.908 +  of the latest proof command.  Basically, any proof command may
   7.909 +  return multiple results.
   7.910    
   7.911 -  \end{descr}
   7.912 +  \end{description}
   7.913  
   7.914    Any proper Isar proof method may be used with tactic script commands
   7.915    such as \hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}.  A few additional emulations of actual
   7.916 @@ -804,36 +889,46 @@
   7.917  \end{isamarkuptext}%
   7.918  \isamarkuptrue%
   7.919  %
   7.920 -\isamarkupsection{Omitting proofs%
   7.921 +\isamarkupsubsection{Defining proof methods%
   7.922  }
   7.923  \isamarkuptrue%
   7.924  %
   7.925  \begin{isamarkuptext}%
   7.926  \begin{matharray}{rcl}
   7.927 -    \indexdef{}{command}{oops}\hypertarget{command.oops}{\hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}}} & : & \isartrans{proof}{theory} \\
   7.928 +    \indexdef{}{command}{method\_setup}\hypertarget{command.method-setup}{\hyperlink{command.method-setup}{\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   7.929    \end{matharray}
   7.930  
   7.931 -  The \hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}} command discontinues the current proof
   7.932 -  attempt, while considering the partial proof text as properly
   7.933 -  processed.  This is conceptually quite different from ``faking''
   7.934 -  actual proofs via \indexref{}{command}{sorry}\hyperlink{command.sorry}{\mbox{\isa{\isacommand{sorry}}}} (see
   7.935 -  \secref{sec:proof-steps}): \hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}} does not observe the
   7.936 -  proof structure at all, but goes back right to the theory level.
   7.937 -  Furthermore, \hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}} does not produce any result theorem
   7.938 -  --- there is no intended claim to be able to complete the proof
   7.939 -  anyhow.
   7.940 +  \begin{rail}
   7.941 +    'method\_setup' name '=' text text
   7.942 +    ;
   7.943 +  \end{rail}
   7.944 +
   7.945 +  \begin{description}
   7.946 +
   7.947 +  \item \hyperlink{command.method-setup}{\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}}}~\isa{{\isachardoublequote}name\ {\isacharequal}\ text\ description{\isachardoublequote}}
   7.948 +  defines a proof method in the current theory.  The given \isa{{\isachardoublequote}text{\isachardoublequote}} has to be an ML expression of type \verb|Args.src -> Proof.context -> Proof.method|.  Parsing concrete
   7.949 +  method syntax from \verb|Args.src| input can be quite tedious in
   7.950 +  general.  The following simple examples are for methods without any
   7.951 +  explicit arguments, or a list of theorems, respectively.
   7.952  
   7.953 -  A typical application of \hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}} is to explain Isar proofs
   7.954 -  \emph{within} the system itself, in conjunction with the document
   7.955 -  preparation tools of Isabelle described in \cite{isabelle-sys}.
   7.956 -  Thus partial or even wrong proof attempts can be discussed in a
   7.957 -  logically sound manner.  Note that the Isabelle {\LaTeX} macros can
   7.958 -  be easily adapted to print something like ``\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}'' instead of
   7.959 -  the keyword ``\hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}}''.
   7.960 +%FIXME proper antiquotations
   7.961 +{\footnotesize
   7.962 +\begin{verbatim}
   7.963 + Method.no_args (Method.METHOD (fn facts => foobar_tac))
   7.964 + Method.thms_args (fn thms => Method.METHOD (fn facts => foobar_tac))
   7.965 + Method.ctxt_args (fn ctxt => Method.METHOD (fn facts => foobar_tac))
   7.966 + Method.thms_ctxt_args (fn thms => fn ctxt =>
   7.967 +    Method.METHOD (fn facts => foobar_tac))
   7.968 +\end{verbatim}
   7.969 +}
   7.970  
   7.971 -  \medskip The \hyperlink{command.oops}{\mbox{\isa{\isacommand{oops}}}} command is undo-able, unlike
   7.972 -  \indexref{}{command}{kill}\hyperlink{command.kill}{\mbox{\isa{\isacommand{kill}}}} (see \secref{sec:history}).  The effect is to
   7.973 -  get back to the theory just before the opening of the proof.%
   7.974 +  Note that mere tactic emulations may ignore the \isa{facts}
   7.975 +  parameter above.  Proper proof methods would do something
   7.976 +  appropriate with the list of current facts, though.  Single-rule
   7.977 +  methods usually do strict forward-chaining (e.g.\ by using \verb|Drule.multi_resolves|), while automatic ones just insert the facts
   7.978 +  using \verb|Method.insert_tac| before applying the main tactic.
   7.979 +
   7.980 +  \end{description}%
   7.981  \end{isamarkuptext}%
   7.982  \isamarkuptrue%
   7.983  %
   7.984 @@ -843,8 +938,8 @@
   7.985  %
   7.986  \begin{isamarkuptext}%
   7.987  \begin{matharray}{rcl}
   7.988 -    \indexdef{}{command}{obtain}\hypertarget{command.obtain}{\hyperlink{command.obtain}{\mbox{\isa{\isacommand{obtain}}}}} & : & \isartrans{proof(state)}{proof(prove)} \\
   7.989 -    \indexdef{}{command}{guess}\hypertarget{command.guess}{\hyperlink{command.guess}{\mbox{\isa{\isacommand{guess}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof(state)}{proof(prove)} \\
   7.990 +    \indexdef{}{command}{obtain}\hypertarget{command.obtain}{\hyperlink{command.obtain}{\mbox{\isa{\isacommand{obtain}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ proof{\isacharparenleft}chain{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.991 +    \indexdef{}{command}{guess}\hypertarget{command.guess}{\hyperlink{command.guess}{\mbox{\isa{\isacommand{guess}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ proof{\isacharparenleft}chain{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   7.992    \end{matharray}
   7.993  
   7.994    Generalized elimination means that additional elements with certain
   7.995 @@ -920,14 +1015,14 @@
   7.996  %
   7.997  \begin{isamarkuptext}%
   7.998  \begin{matharray}{rcl}
   7.999 -    \indexdef{}{command}{also}\hypertarget{command.also}{\hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
  7.1000 -    \indexdef{}{command}{finally}\hypertarget{command.finally}{\hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}} & : & \isartrans{proof(state)}{proof(chain)} \\
  7.1001 -    \indexdef{}{command}{moreover}\hypertarget{command.moreover}{\hyperlink{command.moreover}{\mbox{\isa{\isacommand{moreover}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
  7.1002 -    \indexdef{}{command}{ultimately}\hypertarget{command.ultimately}{\hyperlink{command.ultimately}{\mbox{\isa{\isacommand{ultimately}}}}} & : & \isartrans{proof(state)}{proof(chain)} \\
  7.1003 -    \indexdef{}{command}{print\_trans\_rules}\hypertarget{command.print-trans-rules}{\hyperlink{command.print-trans-rules}{\mbox{\isa{\isacommand{print{\isacharunderscore}trans{\isacharunderscore}rules}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
  7.1004 -    \hyperlink{attribute.trans}{\mbox{\isa{trans}}} & : & \isaratt \\
  7.1005 -    \hyperlink{attribute.sym}{\mbox{\isa{sym}}} & : & \isaratt \\
  7.1006 -    \hyperlink{attribute.symmetric}{\mbox{\isa{symmetric}}} & : & \isaratt \\
  7.1007 +    \indexdef{}{command}{also}\hypertarget{command.also}{\hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
  7.1008 +    \indexdef{}{command}{finally}\hypertarget{command.finally}{\hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} \\
  7.1009 +    \indexdef{}{command}{moreover}\hypertarget{command.moreover}{\hyperlink{command.moreover}{\mbox{\isa{\isacommand{moreover}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
  7.1010 +    \indexdef{}{command}{ultimately}\hypertarget{command.ultimately}{\hyperlink{command.ultimately}{\mbox{\isa{\isacommand{ultimately}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} \\
  7.1011 +    \indexdef{}{command}{print\_trans\_rules}\hypertarget{command.print-trans-rules}{\hyperlink{command.print-trans-rules}{\mbox{\isa{\isacommand{print{\isacharunderscore}trans{\isacharunderscore}rules}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
  7.1012 +    \hyperlink{attribute.trans}{\mbox{\isa{trans}}} & : & \isa{attribute} \\
  7.1013 +    \hyperlink{attribute.sym}{\mbox{\isa{sym}}} & : & \isa{attribute} \\
  7.1014 +    \hyperlink{attribute.symmetric}{\mbox{\isa{symmetric}}} & : & \isa{attribute} \\
  7.1015    \end{matharray}
  7.1016  
  7.1017    Calculational proof is forward reasoning with implicit application
  7.1018 @@ -974,39 +1069,36 @@
  7.1019      ;
  7.1020    \end{rail}
  7.1021  
  7.1022 -  \begin{descr}
  7.1023 +  \begin{description}
  7.1024  
  7.1025 -  \item [\hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}}~\isa{{\isachardoublequote}{\isacharparenleft}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharparenright}{\isachardoublequote}}]
  7.1026 -  maintains the auxiliary \hyperlink{fact.calculation}{\mbox{\isa{calculation}}} register as follows.
  7.1027 -  The first occurrence of \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}} in some calculational
  7.1028 -  thread initializes \hyperlink{fact.calculation}{\mbox{\isa{calculation}}} by \hyperlink{fact.this}{\mbox{\isa{this}}}. Any
  7.1029 -  subsequent \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}} on the same level of block-structure
  7.1030 -  updates \hyperlink{fact.calculation}{\mbox{\isa{calculation}}} by some transitivity rule applied to
  7.1031 -  \hyperlink{fact.calculation}{\mbox{\isa{calculation}}} and \hyperlink{fact.this}{\mbox{\isa{this}}} (in that order).  Transitivity
  7.1032 -  rules are picked from the current context, unless alternative rules
  7.1033 -  are given as explicit arguments.
  7.1034 +  \item \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}}~\isa{{\isachardoublequote}{\isacharparenleft}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharparenright}{\isachardoublequote}} maintains the auxiliary
  7.1035 +  \hyperlink{fact.calculation}{\mbox{\isa{calculation}}} register as follows.  The first occurrence of
  7.1036 +  \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}} in some calculational thread initializes \hyperlink{fact.calculation}{\mbox{\isa{calculation}}} by \hyperlink{fact.this}{\mbox{\isa{this}}}. Any subsequent \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}} on
  7.1037 +  the same level of block-structure updates \hyperlink{fact.calculation}{\mbox{\isa{calculation}}} by
  7.1038 +  some transitivity rule applied to \hyperlink{fact.calculation}{\mbox{\isa{calculation}}} and \hyperlink{fact.this}{\mbox{\isa{this}}} (in that order).  Transitivity rules are picked from the
  7.1039 +  current context, unless alternative rules are given as explicit
  7.1040 +  arguments.
  7.1041  
  7.1042 -  \item [\hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}~\isa{{\isachardoublequote}{\isacharparenleft}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharparenright}{\isachardoublequote}}]
  7.1043 -  maintaining \hyperlink{fact.calculation}{\mbox{\isa{calculation}}} in the same way as \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}}, and concludes the current calculational thread.  The final
  7.1044 -  result is exhibited as fact for forward chaining towards the next
  7.1045 -  goal. Basically, \hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}} just abbreviates \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}}~\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\hyperlink{fact.calculation}{\mbox{\isa{calculation}}}.  Typical idioms for
  7.1046 -  concluding calculational proofs are ``\hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}~\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}~\isa{{\isacharquery}thesis}~\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isachardot}}}}}'' and ``\hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}~\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{{\isasymphi}}~\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isachardot}}}}}''.
  7.1047 +  \item \hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}~\isa{{\isachardoublequote}{\isacharparenleft}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharparenright}{\isachardoublequote}} maintaining \hyperlink{fact.calculation}{\mbox{\isa{calculation}}} in the same way as \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}}, and concludes the
  7.1048 +  current calculational thread.  The final result is exhibited as fact
  7.1049 +  for forward chaining towards the next goal. Basically, \hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}} just abbreviates \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}}~\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\hyperlink{fact.calculation}{\mbox{\isa{calculation}}}.  Typical idioms for concluding
  7.1050 +  calculational proofs are ``\hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}~\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}~\isa{{\isacharquery}thesis}~\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isachardot}}}}}'' and ``\hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}~\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{{\isasymphi}}~\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isachardot}}}}}''.
  7.1051  
  7.1052 -  \item [\hyperlink{command.moreover}{\mbox{\isa{\isacommand{moreover}}}} and \hyperlink{command.ultimately}{\mbox{\isa{\isacommand{ultimately}}}}] are
  7.1053 +  \item \hyperlink{command.moreover}{\mbox{\isa{\isacommand{moreover}}}} and \hyperlink{command.ultimately}{\mbox{\isa{\isacommand{ultimately}}}} are
  7.1054    analogous to \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}} and \hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}, but collect
  7.1055    results only, without applying rules.
  7.1056  
  7.1057 -  \item [\hyperlink{command.print-trans-rules}{\mbox{\isa{\isacommand{print{\isacharunderscore}trans{\isacharunderscore}rules}}}}] prints the list of
  7.1058 -  transitivity rules (for calculational commands \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}} and
  7.1059 -  \hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}) and symmetry rules (for the \hyperlink{attribute.symmetric}{\mbox{\isa{symmetric}}} operation and single step elimination patters) of the
  7.1060 -  current context.
  7.1061 +  \item \hyperlink{command.print-trans-rules}{\mbox{\isa{\isacommand{print{\isacharunderscore}trans{\isacharunderscore}rules}}}} prints the list of transitivity
  7.1062 +  rules (for calculational commands \hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}} and \hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}) and symmetry rules (for the \hyperlink{attribute.symmetric}{\mbox{\isa{symmetric}}}
  7.1063 +  operation and single step elimination patters) of the current
  7.1064 +  context.
  7.1065  
  7.1066 -  \item [\hyperlink{attribute.trans}{\mbox{\isa{trans}}}] declares theorems as transitivity rules.
  7.1067 +  \item \hyperlink{attribute.trans}{\mbox{\isa{trans}}} declares theorems as transitivity rules.
  7.1068  
  7.1069 -  \item [\hyperlink{attribute.sym}{\mbox{\isa{sym}}}] declares symmetry rules, as well as
  7.1070 +  \item \hyperlink{attribute.sym}{\mbox{\isa{sym}}} declares symmetry rules, as well as
  7.1071    \hyperlink{attribute.Pure.elim}{\mbox{\isa{Pure{\isachardot}elim}}}\isa{{\isachardoublequote}{\isacharquery}{\isachardoublequote}} rules.
  7.1072  
  7.1073 -  \item [\hyperlink{attribute.symmetric}{\mbox{\isa{symmetric}}}] resolves a theorem with some rule
  7.1074 +  \item \hyperlink{attribute.symmetric}{\mbox{\isa{symmetric}}} resolves a theorem with some rule
  7.1075    declared as \hyperlink{attribute.sym}{\mbox{\isa{sym}}} in the current context.  For example,
  7.1076    ``\hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}~\isa{{\isachardoublequote}{\isacharbrackleft}symmetric{\isacharbrackright}{\isacharcolon}\ x\ {\isacharequal}\ y{\isachardoublequote}}'' produces a
  7.1077    swapped fact derived from that assumption.
  7.1078 @@ -1014,7 +1106,7 @@
  7.1079    In structured proof texts it is often more appropriate to use an
  7.1080    explicit single-step elimination proof, such as ``\hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}~\isa{{\isachardoublequote}x\ {\isacharequal}\ y{\isachardoublequote}}~\hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}~\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{{\isachardoublequote}y\ {\isacharequal}\ x{\isachardoublequote}}~\hyperlink{command.ddot}{\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}}}''.
  7.1081  
  7.1082 -  \end{descr}%
  7.1083 +  \end{description}%
  7.1084  \end{isamarkuptext}%
  7.1085  \isamarkuptrue%
  7.1086  %
  7.1087 @@ -1028,12 +1120,12 @@
  7.1088  %
  7.1089  \begin{isamarkuptext}%
  7.1090  \begin{matharray}{rcl}
  7.1091 -    \indexdef{}{command}{case}\hypertarget{command.case}{\hyperlink{command.case}{\mbox{\isa{\isacommand{case}}}}} & : & \isartrans{proof(state)}{proof(state)} \\
  7.1092 -    \indexdef{}{command}{print\_cases}\hypertarget{command.print-cases}{\hyperlink{command.print-cases}{\mbox{\isa{\isacommand{print{\isacharunderscore}cases}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{proof} \\
  7.1093 -    \indexdef{}{attribute}{case\_names}\hypertarget{attribute.case-names}{\hyperlink{attribute.case-names}{\mbox{\isa{case{\isacharunderscore}names}}}} & : & \isaratt \\
  7.1094 -    \indexdef{}{attribute}{case\_conclusion}\hypertarget{attribute.case-conclusion}{\hyperlink{attribute.case-conclusion}{\mbox{\isa{case{\isacharunderscore}conclusion}}}} & : & \isaratt \\
  7.1095 -    \indexdef{}{attribute}{params}\hypertarget{attribute.params}{\hyperlink{attribute.params}{\mbox{\isa{params}}}} & : & \isaratt \\
  7.1096 -    \indexdef{}{attribute}{consumes}\hypertarget{attribute.consumes}{\hyperlink{attribute.consumes}{\mbox{\isa{consumes}}}} & : & \isaratt \\
  7.1097 +    \indexdef{}{command}{case}\hypertarget{command.case}{\hyperlink{command.case}{\mbox{\isa{\isacommand{case}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isasymrightarrow}\ proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} \\
  7.1098 +    \indexdef{}{command}{print\_cases}\hypertarget{command.print-cases}{\hyperlink{command.print-cases}{\mbox{\isa{\isacommand{print{\isacharunderscore}cases}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
  7.1099 +    \indexdef{}{attribute}{case\_names}\hypertarget{attribute.case-names}{\hyperlink{attribute.case-names}{\mbox{\isa{case{\isacharunderscore}names}}}} & : & \isa{attribute} \\
  7.1100 +    \indexdef{}{attribute}{case\_conclusion}\hypertarget{attribute.case-conclusion}{\hyperlink{attribute.case-conclusion}{\mbox{\isa{case{\isacharunderscore}conclusion}}}} & : & \isa{attribute} \\
  7.1101 +    \indexdef{}{attribute}{params}\hypertarget{attribute.params}{\hyperlink{attribute.params}{\mbox{\isa{params}}}} & : & \isa{attribute} \\
  7.1102 +    \indexdef{}{attribute}{consumes}\hypertarget{attribute.consumes}{\hyperlink{attribute.consumes}{\mbox{\isa{consumes}}}} & : & \isa{attribute} \\
  7.1103    \end{matharray}
  7.1104  
  7.1105    The puristic way to build up Isar proof contexts is by explicit
  7.1106 @@ -1092,53 +1184,49 @@
  7.1107      ;
  7.1108    \end{rail}
  7.1109  
  7.1110 -  \begin{descr}
  7.1111 +  \begin{description}
  7.1112    
  7.1113 -  \item [\hyperlink{command.case}{\mbox{\isa{\isacommand{case}}}}~\isa{{\isachardoublequote}{\isacharparenleft}c\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub m{\isacharparenright}{\isachardoublequote}}]
  7.1114 -  invokes a named local context \isa{{\isachardoublequote}c{\isacharcolon}\ x\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ x\isactrlsub m{\isacharcomma}\ {\isasymphi}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymphi}\isactrlsub m{\isachardoublequote}}, as provided by an appropriate
  7.1115 -  proof method (such as \indexref{}{method}{cases}\hyperlink{method.cases}{\mbox{\isa{cases}}} and \indexref{}{method}{induct}\hyperlink{method.induct}{\mbox{\isa{induct}}}).
  7.1116 -  The command ``\hyperlink{command.case}{\mbox{\isa{\isacommand{case}}}}~\isa{{\isachardoublequote}{\isacharparenleft}c\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub m{\isacharparenright}{\isachardoublequote}}'' abbreviates ``\hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}}~\isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub m{\isachardoublequote}}~\hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}~\isa{{\isachardoublequote}c{\isacharcolon}\ {\isasymphi}\isactrlsub {\isadigit{1}}\ {\isasymdots}\ {\isasymphi}\isactrlsub n{\isachardoublequote}}''.
  7.1117 +  \item \hyperlink{command.case}{\mbox{\isa{\isacommand{case}}}}~\isa{{\isachardoublequote}{\isacharparenleft}c\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub m{\isacharparenright}{\isachardoublequote}} invokes a named local
  7.1118 +  context \isa{{\isachardoublequote}c{\isacharcolon}\ x\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ x\isactrlsub m{\isacharcomma}\ {\isasymphi}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymphi}\isactrlsub m{\isachardoublequote}}, as provided by an
  7.1119 +  appropriate proof method (such as \indexref{}{method}{cases}\hyperlink{method.cases}{\mbox{\isa{cases}}} and
  7.1120 +  \indexref{}{method}{induct}\hyperlink{method.induct}{\mbox{\isa{induct}}}).  The command ``\hyperlink{command.case}{\mbox{\isa{\isacommand{case}}}}~\isa{{\isachardoublequote}{\isacharparenleft}c\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub m{\isacharparenright}{\isachardoublequote}}'' abbreviates ``\hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}}~\isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub m{\isachardoublequote}}~\hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}~\isa{{\isachardoublequote}c{\isacharcolon}\ {\isasymphi}\isactrlsub {\isadigit{1}}\ {\isasymdots}\ {\isasymphi}\isactrlsub n{\isachardoublequote}}''.
  7.1121  
  7.1122 -  \item [\hyperlink{command.print-cases}{\mbox{\isa{\isacommand{print{\isacharunderscore}cases}}}}] prints all local contexts of the
  7.1123 +  \item \hyperlink{command.print-cases}{\mbox{\isa{\isacommand{print{\isacharunderscore}cases}}}} prints all local contexts of the
  7.1124    current state, using Isar proof language notation.
  7.1125    
  7.1126 -  \item [\hyperlink{attribute.case-names}{\mbox{\isa{case{\isacharunderscore}names}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymdots}\ c\isactrlsub k{\isachardoublequote}}]
  7.1127 -  declares names for the local contexts of premises of a theorem;
  7.1128 -  \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub k{\isachardoublequote}} refers to the \emph{suffix} of the
  7.1129 -  list of premises.
  7.1130 +  \item \hyperlink{attribute.case-names}{\mbox{\isa{case{\isacharunderscore}names}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymdots}\ c\isactrlsub k{\isachardoublequote}} declares names for
  7.1131 +  the local contexts of premises of a theorem; \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub k{\isachardoublequote}}
  7.1132 +  refers to the \emph{suffix} of the list of premises.
  7.1133    
  7.1134 -  \item [\hyperlink{attribute.case-conclusion}{\mbox{\isa{case{\isacharunderscore}conclusion}}}~\isa{{\isachardoublequote}c\ d\isactrlsub {\isadigit{1}}\ {\isasymdots}\ d\isactrlsub k{\isachardoublequote}}] declares names for the conclusions of a named premise
  7.1135 -  \isa{c}; here \isa{{\isachardoublequote}d\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ d\isactrlsub k{\isachardoublequote}} refers to the
  7.1136 -  prefix of arguments of a logical formula built by nesting a binary
  7.1137 -  connective (e.g.\ \isa{{\isachardoublequote}{\isasymor}{\isachardoublequote}}).
  7.1138 +  \item \hyperlink{attribute.case-conclusion}{\mbox{\isa{case{\isacharunderscore}conclusion}}}~\isa{{\isachardoublequote}c\ d\isactrlsub {\isadigit{1}}\ {\isasymdots}\ d\isactrlsub k{\isachardoublequote}} declares
  7.1139 +  names for the conclusions of a named premise \isa{c}; here \isa{{\isachardoublequote}d\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ d\isactrlsub k{\isachardoublequote}} refers to the prefix of arguments of a logical formula
  7.1140 +  built by nesting a binary connective (e.g.\ \isa{{\isachardoublequote}{\isasymor}{\isachardoublequote}}).
  7.1141    
  7.1142    Note that proof methods such as \hyperlink{method.induct}{\mbox{\isa{induct}}} and \hyperlink{method.coinduct}{\mbox{\isa{coinduct}}} already provide a default name for the conclusion as a
  7.1143    whole.  The need to name subformulas only arises with cases that
  7.1144    split into several sub-cases, as in common co-induction rules.
  7.1145  
  7.1146 -  \item [\hyperlink{attribute.params}{\mbox{\isa{params}}}~\isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub m\ {\isasymAND}\ {\isasymdots}\ q\isactrlsub {\isadigit{1}}\ {\isasymdots}\ q\isactrlsub n{\isachardoublequote}}] renames the innermost parameters of
  7.1147 -  premises \isa{{\isachardoublequote}{\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ n{\isachardoublequote}} of some theorem.  An empty list of names
  7.1148 -  may be given to skip positions, leaving the present parameters
  7.1149 -  unchanged.
  7.1150 +  \item \hyperlink{attribute.params}{\mbox{\isa{params}}}~\isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub m\ {\isasymAND}\ {\isasymdots}\ q\isactrlsub {\isadigit{1}}\ {\isasymdots}\ q\isactrlsub n{\isachardoublequote}} renames
  7.1151 +  the innermost parameters of premises \isa{{\isachardoublequote}{\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ n{\isachardoublequote}} of some
  7.1152 +  theorem.  An empty list of names may be given to skip positions,
  7.1153 +  leaving the present parameters unchanged.
  7.1154    
  7.1155    Note that the default usage of case rules does \emph{not} directly
  7.1156    expose parameters to the proof context.
  7.1157    
  7.1158 -  \item [\hyperlink{attribute.consumes}{\mbox{\isa{consumes}}}~\isa{n}] declares the number of
  7.1159 -  ``major premises'' of a rule, i.e.\ the number of facts to be
  7.1160 -  consumed when it is applied by an appropriate proof method.  The
  7.1161 -  default value of \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}} is \isa{{\isachardoublequote}n\ {\isacharequal}\ {\isadigit{1}}{\isachardoublequote}}, which is
  7.1162 -  appropriate for the usual kind of cases and induction rules for
  7.1163 -  inductive sets (cf.\ \secref{sec:hol-inductive}).  Rules without any
  7.1164 -  \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}} declaration given are treated as if
  7.1165 -  \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}}~\isa{{\isadigit{0}}} had been specified.
  7.1166 +  \item \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}}~\isa{n} declares the number of ``major
  7.1167 +  premises'' of a rule, i.e.\ the number of facts to be consumed when
  7.1168 +  it is applied by an appropriate proof method.  The default value of
  7.1169 +  \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}} is \isa{{\isachardoublequote}n\ {\isacharequal}\ {\isadigit{1}}{\isachardoublequote}}, which is appropriate for
  7.1170 +  the usual kind of cases and induction rules for inductive sets (cf.\
  7.1171 +  \secref{sec:hol-inductive}).  Rules without any \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}} declaration given are treated as if \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}}~\isa{{\isadigit{0}}} had been specified.
  7.1172    
  7.1173    Note that explicit \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}} declarations are only
  7.1174    rarely needed; this is already taken care of automatically by the
  7.1175    higher-level \hyperlink{attribute.cases}{\mbox{\isa{cases}}}, \hyperlink{attribute.induct}{\mbox{\isa{induct}}}, and
  7.1176    \hyperlink{attribute.coinduct}{\mbox{\isa{coinduct}}} declarations.
  7.1177  
  7.1178 -  \end{descr}%
  7.1179 +  \end{description}%
  7.1180  \end{isamarkuptext}%
  7.1181  \isamarkuptrue%
  7.1182  %
  7.1183 @@ -1148,9 +1236,9 @@
  7.1184  %
  7.1185  \begin{isamarkuptext}%
  7.1186  \begin{matharray}{rcl}
  7.1187 -    \indexdef{}{method}{cases}\hypertarget{method.cases}{\hyperlink{method.cases}{\mbox{\isa{cases}}}} & : & \isarmeth \\
  7.1188 -    \indexdef{}{method}{induct}\hypertarget{method.induct}{\hyperlink{method.induct}{\mbox{\isa{induct}}}} & : & \isarmeth \\
  7.1189 -    \indexdef{}{method}{coinduct}\hypertarget{method.coinduct}{\hyperlink{method.coinduct}{\mbox{\isa{coinduct}}}} & : & \isarmeth \\
  7.1190 +    \indexdef{}{method}{cases}\hypertarget{method.cases}{\hyperlink{method.cases}{\mbox{\isa{cases}}}} & : & \isa{method} \\
  7.1191 +    \indexdef{}{method}{induct}\hypertarget{method.induct}{\hyperlink{method.induct}{\mbox{\isa{induct}}}} & : & \isa{method} \\
  7.1192 +    \indexdef{}{method}{coinduct}\hypertarget{method.coinduct}{\hyperlink{method.coinduct}{\mbox{\isa{coinduct}}}} & : & \isa{method} \\
  7.1193    \end{matharray}
  7.1194  
  7.1195    The \hyperlink{method.cases}{\mbox{\isa{cases}}}, \hyperlink{method.induct}{\mbox{\isa{induct}}}, and \hyperlink{method.coinduct}{\mbox{\isa{coinduct}}}
  7.1196 @@ -1188,9 +1276,9 @@
  7.1197      ;
  7.1198    \end{rail}
  7.1199  
  7.1200 -  \begin{descr}
  7.1201 +  \begin{description}
  7.1202  
  7.1203 -  \item [\hyperlink{method.cases}{\mbox{\isa{cases}}}~\isa{{\isachardoublequote}insts\ R{\isachardoublequote}}] applies method \hyperlink{method.rule}{\mbox{\isa{rule}}} with an appropriate case distinction theorem, instantiated to
  7.1204 +  \item \hyperlink{method.cases}{\mbox{\isa{cases}}}~\isa{{\isachardoublequote}insts\ R{\isachardoublequote}} applies method \hyperlink{method.rule}{\mbox{\isa{rule}}} with an appropriate case distinction theorem, instantiated to
  7.1205    the subjects \isa{insts}.  Symbolic case names are bound according
  7.1206    to the rule's local contexts.
  7.1207  
  7.1208 @@ -1213,7 +1301,7 @@
  7.1209    term needs to be specified; this refers to the first variable of the
  7.1210    last premise (it is usually the same for all cases).
  7.1211  
  7.1212 -  \item [\hyperlink{method.induct}{\mbox{\isa{induct}}}~\isa{{\isachardoublequote}insts\ R{\isachardoublequote}}] is analogous to the
  7.1213 +  \item \hyperlink{method.induct}{\mbox{\isa{induct}}}~\isa{{\isachardoublequote}insts\ R{\isachardoublequote}} is analogous to the
  7.1214    \hyperlink{method.cases}{\mbox{\isa{cases}}} method, but refers to induction rules, which are
  7.1215    determined as follows:
  7.1216  
  7.1217 @@ -1254,7 +1342,7 @@
  7.1218    pending variables in the rule.  Such schematic induction rules
  7.1219    rarely occur in practice, though.
  7.1220  
  7.1221 -  \item [\hyperlink{method.coinduct}{\mbox{\isa{coinduct}}}~\isa{{\isachardoublequote}inst\ R{\isachardoublequote}}] is analogous to the
  7.1222 +  \item \hyperlink{method.coinduct}{\mbox{\isa{coinduct}}}~\isa{{\isachardoublequote}inst\ R{\isachardoublequote}} is analogous to the
  7.1223    \hyperlink{method.induct}{\mbox{\isa{induct}}} method, but refers to coinduction rules, which are
  7.1224    determined as follows:
  7.1225  
  7.1226 @@ -1279,7 +1367,7 @@
  7.1227    specification may be required in order to specify the bisimulation
  7.1228    to be used in the coinduction step.
  7.1229  
  7.1230 -  \end{descr}
  7.1231 +  \end{description}
  7.1232  
  7.1233    Above methods produce named local contexts, as determined by the
  7.1234    instantiated rule as given in the text.  Beyond that, the \hyperlink{method.induct}{\mbox{\isa{induct}}} and \hyperlink{method.coinduct}{\mbox{\isa{coinduct}}} methods guess further instantiations
  7.1235 @@ -1329,10 +1417,10 @@
  7.1236  %
  7.1237  \begin{isamarkuptext}%
  7.1238  \begin{matharray}{rcl}
  7.1239 -    \indexdef{}{command}{print\_induct\_rules}\hypertarget{command.print-induct-rules}{\hyperlink{command.print-induct-rules}{\mbox{\isa{\isacommand{print{\isacharunderscore}induct{\isacharunderscore}rules}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
  7.1240 -    \indexdef{}{attribute}{cases}\hypertarget{attribute.cases}{\hyperlink{attribute.cases}{\mbox{\isa{cases}}}} & : & \isaratt \\
  7.1241 -    \indexdef{}{attribute}{induct}\hypertarget{attribute.induct}{\hyperlink{attribute.induct}{\mbox{\isa{induct}}}} & : & \isaratt \\
  7.1242 -    \indexdef{}{attribute}{coinduct}\hypertarget{attribute.coinduct}{\hyperlink{attribute.coinduct}{\mbox{\isa{coinduct}}}} & : & \isaratt \\
  7.1243 +    \indexdef{}{command}{print\_induct\_rules}\hypertarget{command.print-induct-rules}{\hyperlink{command.print-induct-rules}{\mbox{\isa{\isacommand{print{\isacharunderscore}induct{\isacharunderscore}rules}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
  7.1244 +    \indexdef{}{attribute}{cases}\hypertarget{attribute.cases}{\hyperlink{attribute.cases}{\mbox{\isa{cases}}}} & : & \isa{attribute} \\
  7.1245 +    \indexdef{}{attribute}{induct}\hypertarget{attribute.induct}{\hyperlink{attribute.induct}{\mbox{\isa{induct}}}} & : & \isa{attribute} \\
  7.1246 +    \indexdef{}{attribute}{coinduct}\hypertarget{attribute.coinduct}{\hyperlink{attribute.coinduct}{\mbox{\isa{coinduct}}}} & : & \isa{attribute} \\
  7.1247    \end{matharray}
  7.1248  
  7.1249    \begin{rail}
  7.1250 @@ -1347,12 +1435,12 @@
  7.1251      ;
  7.1252    \end{rail}
  7.1253  
  7.1254 -  \begin{descr}
  7.1255 +  \begin{description}
  7.1256  
  7.1257 -  \item [\hyperlink{command.print-induct-rules}{\mbox{\isa{\isacommand{print{\isacharunderscore}induct{\isacharunderscore}rules}}}}] prints cases and induct
  7.1258 -  rules for predicates (or sets) and types of the current context.
  7.1259 +  \item \hyperlink{command.print-induct-rules}{\mbox{\isa{\isacommand{print{\isacharunderscore}induct{\isacharunderscore}rules}}}} prints cases and induct rules
  7.1260 +  for predicates (or sets) and types of the current context.
  7.1261    
  7.1262 -  \item [\hyperlink{attribute.cases}{\mbox{\isa{cases}}}, \hyperlink{attribute.induct}{\mbox{\isa{induct}}}, and \hyperlink{attribute.coinduct}{\mbox{\isa{coinduct}}}] (as attributes) declare rules for reasoning about
  7.1263 +  \item \hyperlink{attribute.cases}{\mbox{\isa{cases}}}, \hyperlink{attribute.induct}{\mbox{\isa{induct}}}, and \hyperlink{attribute.coinduct}{\mbox{\isa{coinduct}}} (as attributes) declare rules for reasoning about
  7.1264    (co)inductive predicates (or sets) and types, using the
  7.1265    corresponding methods of the same name.  Certain definitional
  7.1266    packages of object-logics usually declare emerging cases and
  7.1267 @@ -1367,7 +1455,7 @@
  7.1268    cases and parameters of a rule; the \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}}
  7.1269    declaration is taken care of automatically: \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}}~\isa{{\isadigit{0}}} is specified for ``type'' rules and \hyperlink{attribute.consumes}{\mbox{\isa{consumes}}}~\isa{{\isadigit{1}}} for ``predicate'' / ``set'' rules.
  7.1270  
  7.1271 -  \end{descr}%
  7.1272 +  \end{description}%
  7.1273  \end{isamarkuptext}%
  7.1274  \isamarkuptrue%
  7.1275  %
     8.1 --- a/doc-src/IsarRef/Thy/document/Spec.tex	Thu Nov 13 22:44:40 2008 +0100
     8.2 +++ b/doc-src/IsarRef/Thy/document/Spec.tex	Thu Nov 13 22:45:12 2008 +0100
     8.3 @@ -30,22 +30,28 @@
     8.4  %
     8.5  \begin{isamarkuptext}%
     8.6  \begin{matharray}{rcl}
     8.7 -    \indexdef{}{command}{theory}\hypertarget{command.theory}{\hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}} & : & \isartrans{toplevel}{theory} \\
     8.8 -    \indexdef{global}{command}{end}\hypertarget{command.global.end}{\hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}}} & : & \isartrans{theory}{toplevel} \\
     8.9 +    \indexdef{}{command}{theory}\hypertarget{command.theory}{\hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}} & : & \isa{{\isachardoublequote}toplevel\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
    8.10 +    \indexdef{global}{command}{end}\hypertarget{command.global.end}{\hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ toplevel{\isachardoublequote}} \\
    8.11    \end{matharray}
    8.12  
    8.13 -  Isabelle/Isar theories are defined via theory file, which contain
    8.14 -  both specifications and proofs; occasionally definitional mechanisms
    8.15 -  also require some explicit proof.  The theory body may be
    8.16 -  sub-structered by means of \emph{local theory} target mechanisms,
    8.17 -  notably \hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}} and \hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}}.
    8.18 +  Isabelle/Isar theories are defined via theory files, which may
    8.19 +  contain both specifications and proofs; occasionally definitional
    8.20 +  mechanisms also require some explicit proof.  The theory body may be
    8.21 +  sub-structured by means of \emph{local theory targets}, such as
    8.22 +  \hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}} and \hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}}.
    8.23  
    8.24 -  The first ``real'' command of any theory has to be \hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}, which starts a new theory based on the merge of existing
    8.25 -  ones.  Just preceding the \hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}} keyword, there may be
    8.26 -  an optional \hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}} declaration, which is relevant to
    8.27 -  document preparation only; it acts very much like a special
    8.28 -  pre-theory markup command (cf.\ \secref{sec:markup}).  The \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} command concludes a theory development; it has to be
    8.29 -  the very last command of any theory file loaded in batch-mode.
    8.30 +  The first proper command of a theory is \hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}, which
    8.31 +  indicates imports of previous theories and optional dependencies on
    8.32 +  other source files (usually in ML).  Just preceding the initial
    8.33 +  \hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}} command there may be an optional \hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}} declaration, which is only relevant to document
    8.34 +  preparation: see also the other section markup commands in
    8.35 +  \secref{sec:markup}.
    8.36 +
    8.37 +  A theory is concluded by a final \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} command,
    8.38 +  one that does not belong to a local theory target.  No further
    8.39 +  commands may follow such a global \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}},
    8.40 +  although some user-interfaces might pretend that trailing input is
    8.41 +  admissible.
    8.42  
    8.43    \begin{rail}
    8.44      'theory' name 'imports' (name +) uses? 'begin'
    8.45 @@ -54,29 +60,32 @@
    8.46      uses: 'uses' ((name | parname) +);
    8.47    \end{rail}
    8.48  
    8.49 -  \begin{descr}
    8.50 +  \begin{description}
    8.51  
    8.52 -  \item [\hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}~\isa{{\isachardoublequote}A\ {\isasymIMPORTS}\ B\isactrlsub {\isadigit{1}}\ {\isasymdots}\ B\isactrlsub n\ {\isasymBEGIN}{\isachardoublequote}}] starts a new theory \isa{A} based on the
    8.53 -  merge of existing theories \isa{{\isachardoublequote}B\isactrlsub {\isadigit{1}}\ {\isasymdots}\ B\isactrlsub n{\isachardoublequote}}.
    8.54 +  \item \hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}~\isa{{\isachardoublequote}A\ {\isasymIMPORTS}\ B\isactrlsub {\isadigit{1}}\ {\isasymdots}\ B\isactrlsub n\ {\isasymBEGIN}{\isachardoublequote}}
    8.55 +  starts a new theory \isa{A} based on the merge of existing
    8.56 +  theories \isa{{\isachardoublequote}B\isactrlsub {\isadigit{1}}\ {\isasymdots}\ B\isactrlsub n{\isachardoublequote}}.
    8.57    
    8.58 -  Due to inclusion of several ancestors, the overall theory structure
    8.59 -  emerging in an Isabelle session forms a directed acyclic graph
    8.60 -  (DAG).  Isabelle's theory loader ensures that the sources
    8.61 -  contributing to the development graph are always up-to-date.
    8.62 -  Changed files are automatically reloaded when processing theory
    8.63 -  headers.
    8.64 +  Due to the possibility to import more than one ancestor, the
    8.65 +  resulting theory structure of an Isabelle session forms a directed
    8.66 +  acyclic graph (DAG).  Isabelle's theory loader ensures that the
    8.67 +  sources contributing to the development graph are always up-to-date:
    8.68 +  changed files are automatically reloaded whenever a theory header
    8.69 +  specification is processed.
    8.70    
    8.71    The optional \indexdef{}{keyword}{uses}\hypertarget{keyword.uses}{\hyperlink{keyword.uses}{\mbox{\isa{\isakeyword{uses}}}}} specification declares additional
    8.72    dependencies on extra files (usually ML sources).  Files will be
    8.73 -  loaded immediately (as ML), unless the name is put in parentheses,
    8.74 -  which merely documents the dependency to be resolved later in the
    8.75 -  text (typically via explicit \indexref{}{command}{use}\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}} in the body text,
    8.76 -  see \secref{sec:ML}).
    8.77 +  loaded immediately (as ML), unless the name is parenthesized.  The
    8.78 +  latter case records a dependency that needs to be resolved later in
    8.79 +  the text, usually via explicit \indexref{}{command}{use}\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}} for ML files;
    8.80 +  other file formats require specific load commands defined by the
    8.81 +  corresponding tools or packages.
    8.82    
    8.83 -  \item [\hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}}] concludes the current theory
    8.84 -  definition.
    8.85 +  \item \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} concludes the current theory
    8.86 +  definition.  Note that local theory targets involve a local
    8.87 +  \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}, which is clear from the nesting.
    8.88  
    8.89 -  \end{descr}%
    8.90 +  \end{description}%
    8.91  \end{isamarkuptext}%
    8.92  \isamarkuptrue%
    8.93  %
    8.94 @@ -94,8 +103,8 @@
    8.95    global theory context.
    8.96  
    8.97    \begin{matharray}{rcll}
    8.98 -    \indexdef{}{command}{context}\hypertarget{command.context}{\hyperlink{command.context}{\mbox{\isa{\isacommand{context}}}}} & : & \isartrans{theory}{local{\dsh}theory} \\
    8.99 -    \indexdef{local}{command}{end}\hypertarget{command.local.end}{\hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}} & : & \isartrans{local{\dsh}theory}{theory} \\
   8.100 +    \indexdef{}{command}{context}\hypertarget{command.context}{\hyperlink{command.context}{\mbox{\isa{\isacommand{context}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.101 +    \indexdef{local}{command}{end}\hypertarget{command.local.end}{\hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   8.102    \end{matharray}
   8.103  
   8.104    \indexouternonterm{target}
   8.105 @@ -107,27 +116,27 @@
   8.106      ;
   8.107    \end{rail}
   8.108  
   8.109 -  \begin{descr}
   8.110 +  \begin{description}
   8.111    
   8.112 -  \item [\hyperlink{command.context}{\mbox{\isa{\isacommand{context}}}}~\isa{{\isachardoublequote}c\ {\isasymBEGIN}{\isachardoublequote}}] recommences an
   8.113 +  \item \hyperlink{command.context}{\mbox{\isa{\isacommand{context}}}}~\isa{{\isachardoublequote}c\ {\isasymBEGIN}{\isachardoublequote}} recommences an
   8.114    existing locale or class context \isa{c}.  Note that locale and
   8.115    class definitions allow to include the \hyperlink{keyword.begin}{\mbox{\isa{\isakeyword{begin}}}} keyword as
   8.116    well, in order to continue the local theory immediately after the
   8.117    initial specification.
   8.118    
   8.119 -  \item [\hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}] concludes the current local theory
   8.120 +  \item \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}} concludes the current local theory
   8.121    and continues the enclosing global theory.  Note that a global
   8.122    \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} has a different meaning: it concludes the
   8.123    theory itself (\secref{sec:begin-thy}).
   8.124    
   8.125 -  \item [\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}{\isachardoublequote}}] given after any local theory command
   8.126 +  \item \isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}{\isachardoublequote}} given after any local theory command
   8.127    specifies an immediate target, e.g.\ ``\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}\ {\isasymdots}{\isachardoublequote}}'' or ``\hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}\ {\isasymdots}{\isachardoublequote}}''.  This works both in a local or
   8.128    global theory context; the current target context will be suspended
   8.129    for this command only.  Note that ``\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ {\isacharminus}{\isacharparenright}{\isachardoublequote}}'' will
   8.130    always produce a global result independently of the current target
   8.131    context.
   8.132  
   8.133 -  \end{descr}
   8.134 +  \end{description}
   8.135  
   8.136    The exact meaning of results produced within a local theory context
   8.137    depends on the underlying target infrastructure (locale, type class
   8.138 @@ -154,13 +163,11 @@
   8.139  %
   8.140  \begin{isamarkuptext}%
   8.141  \begin{matharray}{rcll}
   8.142 -    \indexdef{}{command}{axiomatization}\hypertarget{command.axiomatization}{\hyperlink{command.axiomatization}{\mbox{\isa{\isacommand{axiomatization}}}}} & : & \isarkeep{theory} & (axiomatic!)\\
   8.143 -    \indexdef{}{command}{definition}\hypertarget{command.definition}{\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}} & : & \isarkeep{local{\dsh}theory} \\
   8.144 -    \indexdef{}{attribute}{defn}\hypertarget{attribute.defn}{\hyperlink{attribute.defn}{\mbox{\isa{defn}}}} & : & \isaratt \\
   8.145 -    \indexdef{}{command}{abbreviation}\hypertarget{command.abbreviation}{\hyperlink{command.abbreviation}{\mbox{\isa{\isacommand{abbreviation}}}}} & : & \isarkeep{local{\dsh}theory} \\
   8.146 -    \indexdef{}{command}{print\_abbrevs}\hypertarget{command.print-abbrevs}{\hyperlink{command.print-abbrevs}{\mbox{\isa{\isacommand{print{\isacharunderscore}abbrevs}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   8.147 -    \indexdef{}{command}{notation}\hypertarget{command.notation}{\hyperlink{command.notation}{\mbox{\isa{\isacommand{notation}}}}} & : & \isarkeep{local{\dsh}theory} \\
   8.148 -    \indexdef{}{command}{no\_notation}\hypertarget{command.no-notation}{\hyperlink{command.no-notation}{\mbox{\isa{\isacommand{no{\isacharunderscore}notation}}}}} & : & \isarkeep{local{\dsh}theory} \\
   8.149 +    \indexdef{}{command}{axiomatization}\hypertarget{command.axiomatization}{\hyperlink{command.axiomatization}{\mbox{\isa{\isacommand{axiomatization}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} & (axiomatic!)\\
   8.150 +    \indexdef{}{command}{definition}\hypertarget{command.definition}{\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.151 +    \indexdef{}{attribute}{defn}\hypertarget{attribute.defn}{\hyperlink{attribute.defn}{\mbox{\isa{defn}}}} & : & \isa{attribute} \\
   8.152 +    \indexdef{}{command}{abbreviation}\hypertarget{command.abbreviation}{\hyperlink{command.abbreviation}{\mbox{\isa{\isacommand{abbreviation}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.153 +    \indexdef{}{command}{print\_abbrevs}\hypertarget{command.print-abbrevs}{\hyperlink{command.print-abbrevs}{\mbox{\isa{\isacommand{print{\isacharunderscore}abbrevs}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}\ {\isachardoublequote}} \\
   8.154    \end{matharray}
   8.155  
   8.156    These specification mechanisms provide a slightly more abstract view
   8.157 @@ -175,8 +182,6 @@
   8.158      ;
   8.159      'abbreviation' target? mode? (decl 'where')? prop
   8.160      ;
   8.161 -    ('notation' | 'no\_notation') target? mode? (nameref structmixfix + 'and')
   8.162 -    ;
   8.163  
   8.164      fixes: ((name ('::' type)? mixfix? | vars) + 'and')
   8.165      ;
   8.166 @@ -186,19 +191,20 @@
   8.167      ;
   8.168    \end{rail}
   8.169  
   8.170 -  \begin{descr}
   8.171 +  \begin{description}
   8.172    
   8.173 -  \item [\hyperlink{command.axiomatization}{\mbox{\isa{\isacommand{axiomatization}}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymdots}\ c\isactrlsub m\ {\isasymWHERE}\ {\isasymphi}\isactrlsub {\isadigit{1}}\ {\isasymdots}\ {\isasymphi}\isactrlsub n{\isachardoublequote}}] introduces several constants
   8.174 -  simultaneously and states axiomatic properties for these.  The
   8.175 -  constants are marked as being specified once and for all, which
   8.176 -  prevents additional specifications being issued later on.
   8.177 +  \item \hyperlink{command.axiomatization}{\mbox{\isa{\isacommand{axiomatization}}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymdots}\ c\isactrlsub m\ {\isasymWHERE}\ {\isasymphi}\isactrlsub {\isadigit{1}}\ {\isasymdots}\ {\isasymphi}\isactrlsub n{\isachardoublequote}}
   8.178 +  introduces several constants simultaneously and states axiomatic
   8.179 +  properties for these.  The constants are marked as being specified
   8.180 +  once and for all, which prevents additional specifications being
   8.181 +  issued later on.
   8.182    
   8.183    Note that axiomatic specifications are only appropriate when
   8.184    declaring a new logical system; axiomatic specifications are
   8.185    restricted to global theory contexts.  Normal applications should
   8.186    only use definitional mechanisms!
   8.187  
   8.188 -  \item [\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}~\isa{{\isachardoublequote}c\ {\isasymWHERE}\ eq{\isachardoublequote}}] produces an
   8.189 +  \item \hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}~\isa{{\isachardoublequote}c\ {\isasymWHERE}\ eq{\isachardoublequote}} produces an
   8.190    internal definition \isa{{\isachardoublequote}c\ {\isasymequiv}\ t{\isachardoublequote}} according to the specification
   8.191    given as \isa{eq}, which is then turned into a proven fact.  The
   8.192    given proposition may deviate from internal meta-level equality
   8.193 @@ -211,9 +217,9 @@
   8.194    \isa{{\isachardoublequote}f\ {\isasymequiv}\ {\isasymlambda}x\ y{\isachardot}\ t{\isachardoublequote}} and \isa{{\isachardoublequote}y\ {\isasymnoteq}\ {\isadigit{0}}\ {\isasymLongrightarrow}\ g\ x\ y\ {\isacharequal}\ u{\isachardoublequote}} instead of an
   8.195    unrestricted \isa{{\isachardoublequote}g\ {\isasymequiv}\ {\isasymlambda}x\ y{\isachardot}\ u{\isachardoublequote}}.
   8.196    
   8.197 -  \item [\hyperlink{command.abbreviation}{\mbox{\isa{\isacommand{abbreviation}}}}~\isa{{\isachardoublequote}c\ {\isasymWHERE}\ eq{\isachardoublequote}}] introduces
   8.198 -  a syntactic constant which is associated with a certain term
   8.199 -  according to the meta-level equality \isa{eq}.
   8.200 +  \item \hyperlink{command.abbreviation}{\mbox{\isa{\isacommand{abbreviation}}}}~\isa{{\isachardoublequote}c\ {\isasymWHERE}\ eq{\isachardoublequote}} introduces a
   8.201 +  syntactic constant which is associated with a certain term according
   8.202 +  to the meta-level equality \isa{eq}.
   8.203    
   8.204    Abbreviations participate in the usual type-inference process, but
   8.205    are expanded before the logic ever sees them.  Pretty printing of
   8.206 @@ -228,22 +234,10 @@
   8.207    declared for abbreviations, cf.\ \hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}} in
   8.208    \secref{sec:syn-trans}.
   8.209    
   8.210 -  \item [\hyperlink{command.print-abbrevs}{\mbox{\isa{\isacommand{print{\isacharunderscore}abbrevs}}}}] prints all constant abbreviations
   8.211 +  \item \hyperlink{command.print-abbrevs}{\mbox{\isa{\isacommand{print{\isacharunderscore}abbrevs}}}} prints all constant abbreviations
   8.212    of the current context.
   8.213    
   8.214 -  \item [\hyperlink{command.notation}{\mbox{\isa{\isacommand{notation}}}}~\isa{{\isachardoublequote}c\ {\isacharparenleft}mx{\isacharparenright}{\isachardoublequote}}] associates mixfix
   8.215 -  syntax with an existing constant or fixed variable.  This is a
   8.216 -  robust interface to the underlying \hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}} primitive
   8.217 -  (\secref{sec:syn-trans}).  Type declaration and internal syntactic
   8.218 -  representation of the given entity is retrieved from the context.
   8.219 -  
   8.220 -  \item [\hyperlink{command.no-notation}{\mbox{\isa{\isacommand{no{\isacharunderscore}notation}}}}] is similar to \hyperlink{command.notation}{\mbox{\isa{\isacommand{notation}}}}, but removes the specified syntax annotation from the
   8.221 -  present context.
   8.222 -
   8.223 -  \end{descr}
   8.224 -
   8.225 -  All of these specifications support local theory targets (cf.\
   8.226 -  \secref{sec:target}).%
   8.227 +  \end{description}%
   8.228  \end{isamarkuptext}%
   8.229  \isamarkuptrue%
   8.230  %
   8.231 @@ -262,8 +256,8 @@
   8.232    means of an attribute.
   8.233  
   8.234    \begin{matharray}{rcl}
   8.235 -    \indexdef{}{command}{declaration}\hypertarget{command.declaration}{\hyperlink{command.declaration}{\mbox{\isa{\isacommand{declaration}}}}} & : & \isarkeep{local{\dsh}theory} \\
   8.236 -    \indexdef{}{command}{declare}\hypertarget{command.declare}{\hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}}} & : & \isarkeep{local{\dsh}theory} \\
   8.237 +    \indexdef{}{command}{declaration}\hypertarget{command.declaration}{\hyperlink{command.declaration}{\mbox{\isa{\isacommand{declaration}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.238 +    \indexdef{}{command}{declare}\hypertarget{command.declare}{\hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.239    \end{matharray}
   8.240  
   8.241    \begin{rail}
   8.242 @@ -273,21 +267,21 @@
   8.243      ;
   8.244    \end{rail}
   8.245  
   8.246 -  \begin{descr}
   8.247 +  \begin{description}
   8.248  
   8.249 -  \item [\hyperlink{command.declaration}{\mbox{\isa{\isacommand{declaration}}}}~\isa{d}] adds the declaration
   8.250 +  \item \hyperlink{command.declaration}{\mbox{\isa{\isacommand{declaration}}}}~\isa{d} adds the declaration
   8.251    function \isa{d} of ML type \verb|declaration|, to the current
   8.252    local theory under construction.  In later application contexts, the
   8.253    function is transformed according to the morphisms being involved in
   8.254    the interpretation hierarchy.
   8.255  
   8.256 -  \item [\hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}}~\isa{thms}] declares theorems to the
   8.257 +  \item \hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}}~\isa{thms} declares theorems to the
   8.258    current local theory context.  No theorem binding is involved here,
   8.259    unlike \hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}} or \hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}} (cf.\
   8.260    \secref{sec:axms-thms}), so \hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}} only has the effect
   8.261    of applying attributes as included in the theorem specification.
   8.262  
   8.263 -  \end{descr}%
   8.264 +  \end{description}%
   8.265  \end{isamarkuptext}%
   8.266  \isamarkuptrue%
   8.267  %
   8.268 @@ -308,16 +302,16 @@
   8.269  %
   8.270  \begin{isamarkuptext}%
   8.271  \begin{matharray}{rcl}
   8.272 -    \indexdef{}{command}{locale}\hypertarget{command.locale}{\hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}}} & : & \isartrans{theory}{local{\dsh}theory} \\
   8.273 -    \indexdef{}{command}{print\_locale}\hypertarget{command.print-locale}{\hyperlink{command.print-locale}{\mbox{\isa{\isacommand{print{\isacharunderscore}locale}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   8.274 -    \indexdef{}{command}{print\_locales}\hypertarget{command.print-locales}{\hyperlink{command.print-locales}{\mbox{\isa{\isacommand{print{\isacharunderscore}locales}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   8.275 -    \indexdef{}{method}{intro\_locales}\hypertarget{method.intro-locales}{\hyperlink{method.intro-locales}{\mbox{\isa{intro{\isacharunderscore}locales}}}} & : & \isarmeth \\
   8.276 -    \indexdef{}{method}{unfold\_locales}\hypertarget{method.unfold-locales}{\hyperlink{method.unfold-locales}{\mbox{\isa{unfold{\isacharunderscore}locales}}}} & : & \isarmeth \\
   8.277 +    \indexdef{}{command}{locale}\hypertarget{command.locale}{\hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.278 +    \indexdef{}{command}{print\_locale}\hypertarget{command.print-locale}{\hyperlink{command.print-locale}{\mbox{\isa{\isacommand{print{\isacharunderscore}locale}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   8.279 +    \indexdef{}{command}{print\_locales}\hypertarget{command.print-locales}{\hyperlink{command.print-locales}{\mbox{\isa{\isacommand{print{\isacharunderscore}locales}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   8.280 +    \indexdef{}{method}{intro\_locales}\hypertarget{method.intro-locales}{\hyperlink{method.intro-locales}{\mbox{\isa{intro{\isacharunderscore}locales}}}} & : & \isa{method} \\
   8.281 +    \indexdef{}{method}{unfold\_locales}\hypertarget{method.unfold-locales}{\hyperlink{method.unfold-locales}{\mbox{\isa{unfold{\isacharunderscore}locales}}}} & : & \isa{method} \\
   8.282    \end{matharray}
   8.283  
   8.284    \indexouternonterm{contextexpr}\indexouternonterm{contextelem}
   8.285    \indexisarelem{fixes}\indexisarelem{constrains}\indexisarelem{assumes}
   8.286 -  \indexisarelem{defines}\indexisarelem{notes}\indexisarelem{includes}
   8.287 +  \indexisarelem{defines}\indexisarelem{notes}
   8.288    \begin{rail}
   8.289      'locale' name ('=' localeexpr)? 'begin'?
   8.290      ;
   8.291 @@ -341,13 +335,11 @@
   8.292      ;
   8.293      notes: 'notes' (thmdef? thmrefs + 'and')
   8.294      ;
   8.295 -    includes: 'includes' contextexpr
   8.296 -    ;
   8.297    \end{rail}
   8.298  
   8.299 -  \begin{descr}
   8.300 +  \begin{description}
   8.301    
   8.302 -  \item [\hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}}~\isa{{\isachardoublequote}loc\ {\isacharequal}\ import\ {\isacharplus}\ body{\isachardoublequote}}] defines a
   8.303 +  \item \hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}}~\isa{{\isachardoublequote}loc\ {\isacharequal}\ import\ {\isacharplus}\ body{\isachardoublequote}} defines a
   8.304    new locale \isa{loc} as a context consisting of a certain view of
   8.305    existing locales (\isa{import}) plus some additional elements
   8.306    (\isa{body}).  Both \isa{import} and \isa{body} are optional;
   8.307 @@ -371,38 +363,37 @@
   8.308    The \isa{body} consists of basic context elements, further context
   8.309    expressions may be included as well.
   8.310  
   8.311 -  \begin{descr}
   8.312 +  \begin{description}
   8.313  
   8.314 -  \item [\hyperlink{element.fixes}{\mbox{\isa{\isakeyword{fixes}}}}~\isa{{\isachardoublequote}x\ {\isacharcolon}{\isacharcolon}\ {\isasymtau}\ {\isacharparenleft}mx{\isacharparenright}{\isachardoublequote}}] declares a local
   8.315 +  \item \hyperlink{element.fixes}{\mbox{\isa{\isakeyword{fixes}}}}~\isa{{\isachardoublequote}x\ {\isacharcolon}{\isacharcolon}\ {\isasymtau}\ {\isacharparenleft}mx{\isacharparenright}{\isachardoublequote}} declares a local
   8.316    parameter of type \isa{{\isasymtau}} and mixfix annotation \isa{mx} (both
   8.317    are optional).  The special syntax declaration ``\isa{{\isachardoublequote}{\isacharparenleft}{\isasymSTRUCTURE}{\isacharparenright}{\isachardoublequote}}'' means that \isa{x} may be referenced
   8.318    implicitly in this context.
   8.319  
   8.320 -  \item [\hyperlink{element.constrains}{\mbox{\isa{\isakeyword{constrains}}}}~\isa{{\isachardoublequote}x\ {\isacharcolon}{\isacharcolon}\ {\isasymtau}{\isachardoublequote}}] introduces a type
   8.321 +  \item \hyperlink{element.constrains}{\mbox{\isa{\isakeyword{constrains}}}}~\isa{{\isachardoublequote}x\ {\isacharcolon}{\isacharcolon}\ {\isasymtau}{\isachardoublequote}} introduces a type
   8.322    constraint \isa{{\isasymtau}} on the local parameter \isa{x}.
   8.323  
   8.324 -  \item [\hyperlink{element.assumes}{\mbox{\isa{\isakeyword{assumes}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}\isactrlsub {\isadigit{1}}\ {\isasymdots}\ {\isasymphi}\isactrlsub n{\isachardoublequote}}]
   8.325 +  \item \hyperlink{element.assumes}{\mbox{\isa{\isakeyword{assumes}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}\isactrlsub {\isadigit{1}}\ {\isasymdots}\ {\isasymphi}\isactrlsub n{\isachardoublequote}}
   8.326    introduces local premises, similar to \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}} within a
   8.327    proof (cf.\ \secref{sec:proof-context}).
   8.328  
   8.329 -  \item [\hyperlink{element.defines}{\mbox{\isa{\isakeyword{defines}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ x\ {\isasymequiv}\ t{\isachardoublequote}}] defines a previously
   8.330 +  \item \hyperlink{element.defines}{\mbox{\isa{\isakeyword{defines}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ x\ {\isasymequiv}\ t{\isachardoublequote}} defines a previously
   8.331    declared parameter.  This is similar to \hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}} within a
   8.332    proof (cf.\ \secref{sec:proof-context}), but \hyperlink{element.defines}{\mbox{\isa{\isakeyword{defines}}}}
   8.333    takes an equational proposition instead of variable-term pair.  The
   8.334    left-hand side of the equation may have additional arguments, e.g.\
   8.335    ``\hyperlink{element.defines}{\mbox{\isa{\isakeyword{defines}}}}~\isa{{\isachardoublequote}f\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub n\ {\isasymequiv}\ t{\isachardoublequote}}''.
   8.336  
   8.337 -  \item [\hyperlink{element.notes}{\mbox{\isa{\isakeyword{notes}}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}]
   8.338 +  \item \hyperlink{element.notes}{\mbox{\isa{\isakeyword{notes}}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}
   8.339    reconsiders facts within a local context.  Most notably, this may
   8.340    include arbitrary declarations in any attribute specifications
   8.341    included here, e.g.\ a local \hyperlink{attribute.simp}{\mbox{\isa{simp}}} rule.
   8.342  
   8.343 -  The initial \isa{import} specification of a locale
   8.344 -  expression maintains a dynamic relation to the locales being
   8.345 -  referenced (benefiting from any later fact declarations in the
   8.346 -  obvious manner).
   8.347 +  The initial \isa{import} specification of a locale expression
   8.348 +  maintains a dynamic relation to the locales being referenced
   8.349 +  (benefiting from any later fact declarations in the obvious manner).
   8.350  
   8.351 -  \end{descr}
   8.352 +  \end{description}
   8.353    
   8.354    Note that ``\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIS}\ p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub n{\isacharparenright}{\isachardoublequote}}'' patterns given
   8.355    in the syntax of \hyperlink{element.assumes}{\mbox{\isa{\isakeyword{assumes}}}} and \hyperlink{element.defines}{\mbox{\isa{\isakeyword{defines}}}} above
   8.356 @@ -426,7 +417,7 @@
   8.357    \isa{{\isachardoublequote}{\isasymLongrightarrow}{\isachardoublequote}} by \isa{{\isachardoublequote}{\isasymlongrightarrow}{\isachardoublequote}} in HOL; see also
   8.358    \secref{sec:object-logic}).  Separate introduction rules \isa{loc{\isacharunderscore}axioms{\isachardot}intro} and \isa{loc{\isachardot}intro} are provided as well.
   8.359    
   8.360 -  \item [\hyperlink{command.print-locale}{\mbox{\isa{\isacommand{print{\isacharunderscore}locale}}}}~\isa{{\isachardoublequote}import\ {\isacharplus}\ body{\isachardoublequote}}] prints the
   8.361 +  \item \hyperlink{command.print-locale}{\mbox{\isa{\isacommand{print{\isacharunderscore}locale}}}}~\isa{{\isachardoublequote}import\ {\isacharplus}\ body{\isachardoublequote}} prints the
   8.362    specified locale expression in a flattened form.  The notable
   8.363    special case \hyperlink{command.print-locale}{\mbox{\isa{\isacommand{print{\isacharunderscore}locale}}}}~\isa{loc} just prints the
   8.364    contents of the named locale, but keep in mind that type-inference
   8.365 @@ -434,10 +425,10 @@
   8.366    order.  The command omits \hyperlink{element.notes}{\mbox{\isa{\isakeyword{notes}}}} elements by default.
   8.367    Use \hyperlink{command.print-locale}{\mbox{\isa{\isacommand{print{\isacharunderscore}locale}}}}\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}} to get them included.
   8.368  
   8.369 -  \item [\hyperlink{command.print-locales}{\mbox{\isa{\isacommand{print{\isacharunderscore}locales}}}}] prints the names of all locales
   8.370 +  \item \hyperlink{command.print-locales}{\mbox{\isa{\isacommand{print{\isacharunderscore}locales}}}} prints the names of all locales
   8.371    of the current theory.
   8.372  
   8.373 -  \item [\hyperlink{method.intro-locales}{\mbox{\isa{intro{\isacharunderscore}locales}}} and \hyperlink{method.unfold-locales}{\mbox{\isa{unfold{\isacharunderscore}locales}}}]
   8.374 +  \item \hyperlink{method.intro-locales}{\mbox{\isa{intro{\isacharunderscore}locales}}} and \hyperlink{method.unfold-locales}{\mbox{\isa{unfold{\isacharunderscore}locales}}}
   8.375    repeatedly expand all introduction rules of locale predicates of the
   8.376    theory.  While \hyperlink{method.intro-locales}{\mbox{\isa{intro{\isacharunderscore}locales}}} only applies the \isa{loc{\isachardot}intro} introduction rules and therefore does not decend to
   8.377    assumptions, \hyperlink{method.unfold-locales}{\mbox{\isa{unfold{\isacharunderscore}locales}}} is more aggressive and applies
   8.378 @@ -446,7 +437,7 @@
   8.379    and from interpretations (see below).  New goals that are entailed
   8.380    by the current context are discharged automatically.
   8.381  
   8.382 -  \end{descr}%
   8.383 +  \end{description}%
   8.384  \end{isamarkuptext}%
   8.385  \isamarkuptrue%
   8.386  %
   8.387 @@ -462,9 +453,9 @@
   8.388    possible in theories and locales (command \hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}) and also within a proof body (command \hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}}).
   8.389  
   8.390    \begin{matharray}{rcl}
   8.391 -    \indexdef{}{command}{interpretation}\hypertarget{command.interpretation}{\hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}} & : & \isartrans{theory}{proof(prove)} \\
   8.392 -    \indexdef{}{command}{interpret}\hypertarget{command.interpret}{\hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}}} & : & \isartrans{proof(state) ~|~ proof(chain)}{proof(prove)} \\
   8.393 -    \indexdef{}{command}{print\_interps}\hypertarget{command.print-interps}{\hyperlink{command.print-interps}{\mbox{\isa{\isacommand{print{\isacharunderscore}interps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : &  \isarkeep{theory~|~proof} \\
   8.394 +    \indexdef{}{command}{interpretation}\hypertarget{command.interpretation}{\hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   8.395 +    \indexdef{}{command}{interpret}\hypertarget{command.interpret}{\hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}}} & : & \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}\ {\isacharbar}\ proof{\isacharparenleft}chain\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   8.396 +    \indexdef{}{command}{print\_interps}\hypertarget{command.print-interps}{\hyperlink{command.print-interps}{\mbox{\isa{\isacommand{print{\isacharunderscore}interps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : &  \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   8.397    \end{matharray}
   8.398  
   8.399    \indexouternonterm{interp}
   8.400 @@ -482,9 +473,9 @@
   8.401      ;
   8.402    \end{rail}
   8.403  
   8.404 -  \begin{descr}
   8.405 +  \begin{description}
   8.406  
   8.407 -  \item [\hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}~\isa{{\isachardoublequote}expr\ insts\ {\isasymWHERE}\ eqns{\isachardoublequote}}]
   8.408 +  \item \hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}~\isa{{\isachardoublequote}expr\ insts\ {\isasymWHERE}\ eqns{\isachardoublequote}}
   8.409  
   8.410    The first form of \hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}} interprets \isa{expr} in the theory.  The instantiation is given as a list of terms
   8.411    \isa{insts} and is positional.  All parameters must receive an
   8.412 @@ -523,7 +514,7 @@
   8.413    interpretations dynamically participate in any facts added to
   8.414    locales.
   8.415  
   8.416 -  \item [\hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}~\isa{{\isachardoublequote}name\ {\isasymsubseteq}\ expr{\isachardoublequote}}]
   8.417 +  \item \hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}~\isa{{\isachardoublequote}name\ {\isasymsubseteq}\ expr{\isachardoublequote}}
   8.418  
   8.419    This form of the command interprets \isa{expr} in the locale
   8.420    \isa{name}.  It requires a proof that the specification of \isa{name} implies the specification of \isa{expr}.  As in the
   8.421 @@ -550,18 +541,18 @@
   8.422    prefix and attributes, although only for fragments of \isa{expr}
   8.423    that are not interpreted in the theory already.
   8.424  
   8.425 -  \item [\hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}}~\isa{{\isachardoublequote}expr\ insts\ {\isasymWHERE}\ eqns{\isachardoublequote}}]
   8.426 +  \item \hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}}~\isa{{\isachardoublequote}expr\ insts\ {\isasymWHERE}\ eqns{\isachardoublequote}}
   8.427    interprets \isa{expr} in the proof context and is otherwise
   8.428    similar to interpretation in theories.
   8.429  
   8.430 -  \item [\hyperlink{command.print-interps}{\mbox{\isa{\isacommand{print{\isacharunderscore}interps}}}}~\isa{loc}] prints the
   8.431 +  \item \hyperlink{command.print-interps}{\mbox{\isa{\isacommand{print{\isacharunderscore}interps}}}}~\isa{loc} prints the
   8.432    interpretations of a particular locale \isa{loc} that are active
   8.433    in the current context, either theory or proof context.  The
   8.434    exclamation point argument triggers printing of \emph{witness}
   8.435    theorems justifying interpretations.  These are normally omitted
   8.436    from the output.
   8.437    
   8.438 -  \end{descr}
   8.439 +  \end{description}
   8.440  
   8.441    \begin{warn}
   8.442      Since attributes are applied to interpreted theorems,
   8.443 @@ -599,12 +590,12 @@
   8.444    tutorial.
   8.445  
   8.446    \begin{matharray}{rcl}
   8.447 -    \indexdef{}{command}{class}\hypertarget{command.class}{\hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}}} & : & \isartrans{theory}{local{\dsh}theory} \\
   8.448 -    \indexdef{}{command}{instantiation}\hypertarget{command.instantiation}{\hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}}} & : & \isartrans{theory}{local{\dsh}theory} \\
   8.449 -    \indexdef{}{command}{instance}\hypertarget{command.instance}{\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}} & : & \isartrans{local{\dsh}theory}{local{\dsh}theory} \\
   8.450 -    \indexdef{}{command}{subclass}\hypertarget{command.subclass}{\hyperlink{command.subclass}{\mbox{\isa{\isacommand{subclass}}}}} & : & \isartrans{local{\dsh}theory}{local{\dsh}theory} \\
   8.451 -    \indexdef{}{command}{print\_classes}\hypertarget{command.print-classes}{\hyperlink{command.print-classes}{\mbox{\isa{\isacommand{print{\isacharunderscore}classes}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   8.452 -    \indexdef{}{method}{intro\_classes}\hypertarget{method.intro-classes}{\hyperlink{method.intro-classes}{\mbox{\isa{intro{\isacharunderscore}classes}}}} & : & \isarmeth \\
   8.453 +    \indexdef{}{command}{class}\hypertarget{command.class}{\hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.454 +    \indexdef{}{command}{instantiation}\hypertarget{command.instantiation}{\hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.455 +    \indexdef{}{command}{instance}\hypertarget{command.instance}{\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.456 +    \indexdef{}{command}{subclass}\hypertarget{command.subclass}{\hyperlink{command.subclass}{\mbox{\isa{\isacommand{subclass}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.457 +    \indexdef{}{command}{print\_classes}\hypertarget{command.print-classes}{\hyperlink{command.print-classes}{\mbox{\isa{\isacommand{print{\isacharunderscore}classes}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   8.458 +    \indexdef{}{method}{intro\_classes}\hypertarget{method.intro-classes}{\hyperlink{method.intro-classes}{\mbox{\isa{intro{\isacharunderscore}classes}}}} & : & \isa{method} \\
   8.459    \end{matharray}
   8.460  
   8.461    \begin{rail}
   8.462 @@ -624,9 +615,9 @@
   8.463      ;
   8.464    \end{rail}
   8.465  
   8.466 -  \begin{descr}
   8.467 +  \begin{description}
   8.468  
   8.469 -  \item [\hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}}~\isa{{\isachardoublequote}c\ {\isacharequal}\ superclasses\ {\isacharplus}\ body{\isachardoublequote}}] defines
   8.470 +  \item \hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}}~\isa{{\isachardoublequote}c\ {\isacharequal}\ superclasses\ {\isacharplus}\ body{\isachardoublequote}} defines
   8.471    a new class \isa{c}, inheriting from \isa{superclasses}.  This
   8.472    introduces a locale \isa{c} with import of all locales \isa{superclasses}.
   8.473  
   8.474 @@ -641,37 +632,37 @@
   8.475    --- the \hyperlink{method.intro-classes}{\mbox{\isa{intro{\isacharunderscore}classes}}} method takes care of the details of
   8.476    class membership proofs.
   8.477  
   8.478 -  \item [\hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}}~\isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}s\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ s\isactrlsub n{\isacharparenright}\ s\ {\isasymBEGIN}{\isachardoublequote}}] opens a theory target (cf.\
   8.479 -  \secref{sec:target}) which allows to specify class operations \isa{{\isachardoublequote}f\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ f\isactrlsub n{\isachardoublequote}} corresponding to sort \isa{s} at the
   8.480 -  particular type instance \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}\ {\isacharcolon}{\isacharcolon}\ s\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n\ {\isacharcolon}{\isacharcolon}\ s\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}.  A plain \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}} command
   8.481 -  in the target body poses a goal stating these type arities.  The
   8.482 -  target is concluded by an \indexref{local}{command}{end}\hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}} command.
   8.483 +  \item \hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}}~\isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}s\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ s\isactrlsub n{\isacharparenright}s\ {\isasymBEGIN}{\isachardoublequote}} opens a theory target (cf.\ \secref{sec:target}) which
   8.484 +  allows to specify class operations \isa{{\isachardoublequote}f\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ f\isactrlsub n{\isachardoublequote}} corresponding
   8.485 +  to sort \isa{s} at the particular type instance \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}\ {\isacharcolon}{\isacharcolon}\ s\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n\ {\isacharcolon}{\isacharcolon}\ s\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}.  A plain \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}} command in the
   8.486 +  target body poses a goal stating these type arities.  The target is
   8.487 +  concluded by an \indexref{local}{command}{end}\hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}} command.
   8.488  
   8.489    Note that a list of simultaneous type constructors may be given;
   8.490    this corresponds nicely to mutual recursive type definitions, e.g.\
   8.491    in Isabelle/HOL.
   8.492  
   8.493 -  \item [\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}] in an instantiation target body sets
   8.494 +  \item \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}} in an instantiation target body sets
   8.495    up a goal stating the type arities claimed at the opening \hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}}.  The proof would usually proceed by \hyperlink{method.intro-classes}{\mbox{\isa{intro{\isacharunderscore}classes}}}, and then establish the characteristic theorems of
   8.496    the type classes involved.  After finishing the proof, the
   8.497    background theory will be augmented by the proven type arities.
   8.498  
   8.499 -  \item [\hyperlink{command.subclass}{\mbox{\isa{\isacommand{subclass}}}}~\isa{c}] in a class context for class
   8.500 +  \item \hyperlink{command.subclass}{\mbox{\isa{\isacommand{subclass}}}}~\isa{c} in a class context for class
   8.501    \isa{d} sets up a goal stating that class \isa{c} is logically
   8.502    contained in class \isa{d}.  After finishing the proof, class
   8.503    \isa{d} is proven to be subclass \isa{c} and the locale \isa{c} is interpreted into \isa{d} simultaneously.
   8.504  
   8.505 -  \item [\hyperlink{command.print-classes}{\mbox{\isa{\isacommand{print{\isacharunderscore}classes}}}}] prints all classes in the current
   8.506 +  \item \hyperlink{command.print-classes}{\mbox{\isa{\isacommand{print{\isacharunderscore}classes}}}} prints all classes in the current
   8.507    theory.
   8.508  
   8.509 -  \item [\hyperlink{method.intro-classes}{\mbox{\isa{intro{\isacharunderscore}classes}}}] repeatedly expands all class
   8.510 +  \item \hyperlink{method.intro-classes}{\mbox{\isa{intro{\isacharunderscore}classes}}} repeatedly expands all class
   8.511    introduction rules of this theory.  Note that this method usually
   8.512    needs not be named explicitly, as it is already included in the
   8.513    default proof step (e.g.\ of \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}).  In particular,
   8.514    instantiation of trivial (syntactic) classes may be performed by a
   8.515    single ``\hyperlink{command.ddot}{\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}}}'' proof step.
   8.516  
   8.517 -  \end{descr}%
   8.518 +  \end{description}%
   8.519  \end{isamarkuptext}%
   8.520  \isamarkuptrue%
   8.521  %
   8.522 @@ -710,8 +701,8 @@
   8.523  %
   8.524  \begin{isamarkuptext}%
   8.525  \begin{matharray}{rcl}
   8.526 -    \indexdef{}{command}{axclass}\hypertarget{command.axclass}{\hyperlink{command.axclass}{\mbox{\isa{\isacommand{axclass}}}}} & : & \isartrans{theory}{theory} \\
   8.527 -    \indexdef{}{command}{instance}\hypertarget{command.instance}{\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}} & : & \isartrans{theory}{proof(prove)} \\
   8.528 +    \indexdef{}{command}{axclass}\hypertarget{command.axclass}{\hyperlink{command.axclass}{\mbox{\isa{\isacommand{axclass}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   8.529 +    \indexdef{}{command}{instance}\hypertarget{command.instance}{\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}} \\
   8.530    \end{matharray}
   8.531  
   8.532    Axiomatic type classes are Isabelle/Pure's primitive
   8.533 @@ -726,28 +717,27 @@
   8.534      ;
   8.535    \end{rail}
   8.536  
   8.537 -  \begin{descr}
   8.538 +  \begin{description}
   8.539    
   8.540 -  \item [\hyperlink{command.axclass}{\mbox{\isa{\isacommand{axclass}}}}~\isa{{\isachardoublequote}c\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n\ axms{\isachardoublequote}}] defines an axiomatic type class as the intersection of
   8.541 -  existing classes, with additional axioms holding.  Class axioms may
   8.542 -  not contain more than one type variable.  The class axioms (with
   8.543 -  implicit sort constraints added) are bound to the given names.
   8.544 -  Furthermore a class introduction rule is generated (being bound as
   8.545 -  \isa{c{\isacharunderscore}class{\isachardot}intro}); this rule is employed by method \hyperlink{method.intro-classes}{\mbox{\isa{intro{\isacharunderscore}classes}}} to support instantiation proofs of this class.
   8.546 +  \item \hyperlink{command.axclass}{\mbox{\isa{\isacommand{axclass}}}}~\isa{{\isachardoublequote}c\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n\ axms{\isachardoublequote}} defines an
   8.547 +  axiomatic type class as the intersection of existing classes, with
   8.548 +  additional axioms holding.  Class axioms may not contain more than
   8.549 +  one type variable.  The class axioms (with implicit sort constraints
   8.550 +  added) are bound to the given names.  Furthermore a class
   8.551 +  introduction rule is generated (being bound as \isa{c{\isacharunderscore}class{\isachardot}intro}); this rule is employed by method \hyperlink{method.intro-classes}{\mbox{\isa{intro{\isacharunderscore}classes}}} to support instantiation proofs of this class.
   8.552    
   8.553 -  The ``class axioms'' are stored as theorems according to the given
   8.554 -  name specifications, adding \isa{{\isachardoublequote}c{\isacharunderscore}class{\isachardoublequote}} as name space prefix;
   8.555 -  the same facts are also stored collectively as \isa{c{\isacharunderscore}class{\isachardot}axioms}.
   8.556 +  The ``class axioms'' (which are derived from the internal class
   8.557 +  definition) are stored as theorems according to the given name
   8.558 +  specifications; the name space prefix \isa{{\isachardoublequote}c{\isacharunderscore}class{\isachardoublequote}} is added
   8.559 +  here.  The full collection of these facts is also stored as \isa{c{\isacharunderscore}class{\isachardot}axioms}.
   8.560    
   8.561 -  \item [\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}{\isachardoublequote}} and
   8.562 -  \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}~\isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}s\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ s\isactrlsub n{\isacharparenright}\ s{\isachardoublequote}}]
   8.563 -  setup a goal stating a class relation or type arity.  The proof
   8.564 -  would usually proceed by \hyperlink{method.intro-classes}{\mbox{\isa{intro{\isacharunderscore}classes}}}, and then establish
   8.565 -  the characteristic theorems of the type classes involved.  After
   8.566 -  finishing the proof, the theory will be augmented by a type
   8.567 -  signature declaration corresponding to the resulting theorem.
   8.568 +  \item \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}{\isachardoublequote}} and \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}~\isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}s\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ s\isactrlsub n{\isacharparenright}s{\isachardoublequote}} setup a goal stating a class
   8.569 +  relation or type arity.  The proof would usually proceed by \hyperlink{method.intro-classes}{\mbox{\isa{intro{\isacharunderscore}classes}}}, and then establish the characteristic theorems of
   8.570 +  the type classes involved.  After finishing the proof, the theory
   8.571 +  will be augmented by a type signature declaration corresponding to
   8.572 +  the resulting theorem.
   8.573  
   8.574 -  \end{descr}%
   8.575 +  \end{description}%
   8.576  \end{isamarkuptext}%
   8.577  \isamarkuptrue%
   8.578  %
   8.579 @@ -765,7 +755,7 @@
   8.580    end-users.
   8.581  
   8.582    \begin{matharray}{rcl}
   8.583 -    \indexdef{}{command}{overloading}\hypertarget{command.overloading}{\hyperlink{command.overloading}{\mbox{\isa{\isacommand{overloading}}}}} & : & \isartrans{theory}{local{\dsh}theory} \\
   8.584 +    \indexdef{}{command}{overloading}\hypertarget{command.overloading}{\hyperlink{command.overloading}{\mbox{\isa{\isacommand{overloading}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.585    \end{matharray}
   8.586  
   8.587    \begin{rail}
   8.588 @@ -773,23 +763,23 @@
   8.589      ( string ( '==' | equiv ) term ( '(' 'unchecked' ')' )? + ) 'begin'
   8.590    \end{rail}
   8.591  
   8.592 -  \begin{descr}
   8.593 +  \begin{description}
   8.594  
   8.595 -  \item [\hyperlink{command.overloading}{\mbox{\isa{\isacommand{overloading}}}}~\isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}\ {\isasymequiv}\ c\isactrlsub {\isadigit{1}}\ {\isacharcolon}{\isacharcolon}\ {\isasymtau}\isactrlsub {\isadigit{1}}\ {\isasymAND}\ {\isasymdots}\ x\isactrlsub n\ {\isasymequiv}\ c\isactrlsub n\ {\isacharcolon}{\isacharcolon}\ {\isasymtau}\isactrlsub n\ {\isasymBEGIN}{\isachardoublequote}}]
   8.596 +  \item \hyperlink{command.overloading}{\mbox{\isa{\isacommand{overloading}}}}~\isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}\ {\isasymequiv}\ c\isactrlsub {\isadigit{1}}\ {\isacharcolon}{\isacharcolon}\ {\isasymtau}\isactrlsub {\isadigit{1}}\ {\isasymAND}\ {\isasymdots}\ x\isactrlsub n\ {\isasymequiv}\ c\isactrlsub n\ {\isacharcolon}{\isacharcolon}\ {\isasymtau}\isactrlsub n\ {\isasymBEGIN}{\isachardoublequote}}
   8.597    opens a theory target (cf.\ \secref{sec:target}) which allows to
   8.598    specify constants with overloaded definitions.  These are identified
   8.599 -  by an explicitly given mapping from variable names \isa{{\isachardoublequote}x\isactrlsub i{\isachardoublequote}} to constants \isa{{\isachardoublequote}c\isactrlsub i{\isachardoublequote}} at particular type
   8.600 -  instances.  The definitions themselves are established using common
   8.601 -  specification tools, using the names \isa{{\isachardoublequote}x\isactrlsub i{\isachardoublequote}} as
   8.602 -  reference to the corresponding constants.  The target is concluded
   8.603 -  by \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}.
   8.604 +  by an explicitly given mapping from variable names \isa{{\isachardoublequote}x\isactrlsub i{\isachardoublequote}} to
   8.605 +  constants \isa{{\isachardoublequote}c\isactrlsub i{\isachardoublequote}} at particular type instances.  The
   8.606 +  definitions themselves are established using common specification
   8.607 +  tools, using the names \isa{{\isachardoublequote}x\isactrlsub i{\isachardoublequote}} as reference to the
   8.608 +  corresponding constants.  The target is concluded by \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}.
   8.609  
   8.610    A \isa{{\isachardoublequote}{\isacharparenleft}unchecked{\isacharparenright}{\isachardoublequote}} option disables global dependency checks for
   8.611    the corresponding definition, which is occasionally useful for
   8.612    exotic overloading.  It is at the discretion of the user to avoid
   8.613    malformed theory specifications!
   8.614  
   8.615 -  \end{descr}%
   8.616 +  \end{description}%
   8.617  \end{isamarkuptext}%
   8.618  \isamarkuptrue%
   8.619  %
   8.620 @@ -799,82 +789,70 @@
   8.621  %
   8.622  \begin{isamarkuptext}%
   8.623  \begin{matharray}{rcl}
   8.624 -    \indexdef{}{command}{use}\hypertarget{command.use}{\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}}} & : & \isarkeep{theory~|~local{\dsh}theory} \\
   8.625 -    \indexdef{}{command}{ML}\hypertarget{command.ML}{\hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}} & : & \isarkeep{theory~|~local{\dsh}theory} \\
   8.626 -    \indexdef{}{command}{ML\_prf}\hypertarget{command.ML-prf}{\hyperlink{command.ML-prf}{\mbox{\isa{\isacommand{ML{\isacharunderscore}prf}}}}} & : & \isarkeep{proof} \\
   8.627 -    \indexdef{}{command}{ML\_val}\hypertarget{command.ML-val}{\hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}}}} & : & \isartrans{\cdot}{\cdot} \\
   8.628 -    \indexdef{}{command}{ML\_command}\hypertarget{command.ML-command}{\hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}}} & : & \isartrans{\cdot}{\cdot} \\
   8.629 -    \indexdef{}{command}{setup}\hypertarget{command.setup}{\hyperlink{command.setup}{\mbox{\isa{\isacommand{setup}}}}} & : & \isartrans{theory}{theory} \\
   8.630 -    \indexdef{}{command}{method\_setup}\hypertarget{command.method-setup}{\hyperlink{command.method-setup}{\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}}}} & : & \isartrans{theory}{theory} \\
   8.631 +    \indexdef{}{command}{use}\hypertarget{command.use}{\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.632 +    \indexdef{}{command}{ML}\hypertarget{command.ML}{\hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.633 +    \indexdef{}{command}{ML\_prf}\hypertarget{command.ML-prf}{\hyperlink{command.ML-prf}{\mbox{\isa{\isacommand{ML{\isacharunderscore}prf}}}}} & : & \isa{{\isachardoublequote}proof\ {\isasymrightarrow}\ proof{\isachardoublequote}} \\
   8.634 +    \indexdef{}{command}{ML\_val}\hypertarget{command.ML-val}{\hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}}}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
   8.635 +    \indexdef{}{command}{ML\_command}\hypertarget{command.ML-command}{\hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
   8.636 +    \indexdef{}{command}{setup}\hypertarget{command.setup}{\hyperlink{command.setup}{\mbox{\isa{\isacommand{setup}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   8.637    \end{matharray}
   8.638  
   8.639 +  \begin{mldecls}
   8.640 +    \indexml{bind\_thms}\verb|bind_thms: string * thm list -> unit| \\
   8.641 +    \indexml{bind\_thm}\verb|bind_thm: string * thm -> unit| \\
   8.642 +  \end{mldecls}
   8.643 +
   8.644    \begin{rail}
   8.645      'use' name
   8.646      ;
   8.647 -    ('ML' | 'ML\_val' | 'ML\_command' | 'setup') text
   8.648 -    ;
   8.649 -    'method\_setup' name '=' text text
   8.650 +    ('ML' | 'ML\_prf' | 'ML\_val' | 'ML\_command' | 'setup') text
   8.651      ;
   8.652    \end{rail}
   8.653  
   8.654 -  \begin{descr}
   8.655 +  \begin{description}
   8.656  
   8.657 -  \item [\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}}~\isa{{\isachardoublequote}file{\isachardoublequote}}] reads and executes ML
   8.658 +  \item \hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}}~\isa{{\isachardoublequote}file{\isachardoublequote}} reads and executes ML
   8.659    commands from \isa{{\isachardoublequote}file{\isachardoublequote}}.  The current theory context is passed
   8.660 -  down to the ML toplevel and may be modified, using \verb|"Context.>>"| or derived ML commands.  The file name is checked with
   8.661 +  down to the ML toplevel and may be modified, using \verb|Context.>>| or derived ML commands.  The file name is checked with
   8.662    the \indexref{}{keyword}{uses}\hyperlink{keyword.uses}{\mbox{\isa{\isakeyword{uses}}}} dependency declaration given in the theory
   8.663    header (see also \secref{sec:begin-thy}).
   8.664  
   8.665    Top-level ML bindings are stored within the (global or local) theory
   8.666    context.
   8.667    
   8.668 -  \item [\hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] is similar to \hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}}, but executes ML commands directly from the given \isa{{\isachardoublequote}text{\isachardoublequote}}.  Top-level ML bindings are stored within the (global or
   8.669 -  local) theory context.
   8.670 +  \item \hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}~\isa{{\isachardoublequote}text{\isachardoublequote}} is similar to \hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}},
   8.671 +  but executes ML commands directly from the given \isa{{\isachardoublequote}text{\isachardoublequote}}.
   8.672 +  Top-level ML bindings are stored within the (global or local) theory
   8.673 +  context.
   8.674  
   8.675 -  \item [\hyperlink{command.ML-prf}{\mbox{\isa{\isacommand{ML{\isacharunderscore}prf}}}}] is analogous to \hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}} but
   8.676 -  works within a proof context.
   8.677 +  \item \hyperlink{command.ML-prf}{\mbox{\isa{\isacommand{ML{\isacharunderscore}prf}}}} is analogous to \hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}} but works
   8.678 +  within a proof context.
   8.679  
   8.680    Top-level ML bindings are stored within the proof context in a
   8.681    purely sequential fashion, disregarding the nested proof structure.
   8.682    ML bindings introduced by \hyperlink{command.ML-prf}{\mbox{\isa{\isacommand{ML{\isacharunderscore}prf}}}} are discarded at the
   8.683    end of the proof.
   8.684  
   8.685 -  \item [\hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}}} and \hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}}] are
   8.686 -  diagnostic versions of \hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}, which means that the context
   8.687 -  may not be updated.  \hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}}} echos the bindings produced
   8.688 -  at the ML toplevel, but \hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}} is silent.
   8.689 +  \item \hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}}} and \hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}} are diagnostic
   8.690 +  versions of \hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}, which means that the context may not be
   8.691 +  updated.  \hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}}} echos the bindings produced at the ML
   8.692 +  toplevel, but \hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}} is silent.
   8.693    
   8.694 -  \item [\hyperlink{command.setup}{\mbox{\isa{\isacommand{setup}}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] changes the current theory
   8.695 +  \item \hyperlink{command.setup}{\mbox{\isa{\isacommand{setup}}}}~\isa{{\isachardoublequote}text{\isachardoublequote}} changes the current theory
   8.696    context by applying \isa{{\isachardoublequote}text{\isachardoublequote}}, which refers to an ML expression
   8.697 -  of type \verb|"theory -> theory"|.  This enables to initialize
   8.698 -  any object-logic specific tools and packages written in ML, for
   8.699 -  example.
   8.700 -  
   8.701 -  \item [\hyperlink{command.method-setup}{\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}}}~\isa{{\isachardoublequote}name\ {\isacharequal}\ text\ description{\isachardoublequote}}]
   8.702 -  defines a proof method in the current theory.  The given \isa{{\isachardoublequote}text{\isachardoublequote}} has to be an ML expression of type \verb|"Args.src ->|\isasep\isanewline%
   8.703 -\verb|  Proof.context -> Proof.method"|.  Parsing concrete method syntax
   8.704 -  from \verb|Args.src| input can be quite tedious in general.  The
   8.705 -  following simple examples are for methods without any explicit
   8.706 -  arguments, or a list of theorems, respectively.
   8.707 +  of type \verb|theory -> theory|.  This enables
   8.708 +  to initialize any object-logic specific tools and packages written
   8.709 +  in ML, for example.
   8.710  
   8.711 -%FIXME proper antiquotations
   8.712 -{\footnotesize
   8.713 -\begin{verbatim}
   8.714 - Method.no_args (Method.METHOD (fn facts => foobar_tac))
   8.715 - Method.thms_args (fn thms => Method.METHOD (fn facts => foobar_tac))
   8.716 - Method.ctxt_args (fn ctxt => Method.METHOD (fn facts => foobar_tac))
   8.717 - Method.thms_ctxt_args (fn thms => fn ctxt =>
   8.718 -    Method.METHOD (fn facts => foobar_tac))
   8.719 -\end{verbatim}
   8.720 -}
   8.721 +  \item \verb|bind_thms|~\isa{{\isachardoublequote}{\isacharparenleft}name{\isacharcomma}\ thms{\isacharparenright}{\isachardoublequote}} stores a list of
   8.722 +  theorems produced in ML both in the theory context and the ML
   8.723 +  toplevel, associating it with the provided name.  Theorems are put
   8.724 +  into a global ``standard'' format before being stored.
   8.725  
   8.726 -  Note that mere tactic emulations may ignore the \isa{facts}
   8.727 -  parameter above.  Proper proof methods would do something
   8.728 -  appropriate with the list of current facts, though.  Single-rule
   8.729 -  methods usually do strict forward-chaining (e.g.\ by using \verb|Drule.multi_resolves|), while automatic ones just insert the facts
   8.730 -  using \verb|Method.insert_tac| before applying the main tactic.
   8.731 -
   8.732 -  \end{descr}%
   8.733 +  \item \verb|bind_thm| is similar to \verb|bind_thms| but refers to a
   8.734 +  singleton theorem.
   8.735 +  
   8.736 +  \end{description}%
   8.737  \end{isamarkuptext}%
   8.738  \isamarkuptrue%
   8.739  %
   8.740 @@ -888,10 +866,10 @@
   8.741  %
   8.742  \begin{isamarkuptext}%
   8.743  \begin{matharray}{rcll}
   8.744 -    \indexdef{}{command}{classes}\hypertarget{command.classes}{\hyperlink{command.classes}{\mbox{\isa{\isacommand{classes}}}}} & : & \isartrans{theory}{theory} \\
   8.745 -    \indexdef{}{command}{classrel}\hypertarget{command.classrel}{\hyperlink{command.classrel}{\mbox{\isa{\isacommand{classrel}}}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
   8.746 -    \indexdef{}{command}{defaultsort}\hypertarget{command.defaultsort}{\hyperlink{command.defaultsort}{\mbox{\isa{\isacommand{defaultsort}}}}} & : & \isartrans{theory}{theory} \\
   8.747 -    \indexdef{}{command}{class\_deps}\hypertarget{command.class-deps}{\hyperlink{command.class-deps}{\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   8.748 +    \indexdef{}{command}{classes}\hypertarget{command.classes}{\hyperlink{command.classes}{\mbox{\isa{\isacommand{classes}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   8.749 +    \indexdef{}{command}{classrel}\hypertarget{command.classrel}{\hyperlink{command.classrel}{\mbox{\isa{\isacommand{classrel}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} & (axiomatic!) \\
   8.750 +    \indexdef{}{command}{defaultsort}\hypertarget{command.defaultsort}{\hyperlink{command.defaultsort}{\mbox{\isa{\isacommand{defaultsort}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   8.751 +    \indexdef{}{command}{class\_deps}\hypertarget{command.class-deps}{\hyperlink{command.class-deps}{\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
   8.752    \end{matharray}
   8.753  
   8.754    \begin{rail}
   8.755 @@ -903,25 +881,36 @@
   8.756      ;
   8.757    \end{rail}
   8.758  
   8.759 -  \begin{descr}
   8.760 +  \begin{description}
   8.761  
   8.762 -  \item [\hyperlink{command.classes}{\mbox{\isa{\isacommand{classes}}}}~\isa{{\isachardoublequote}c\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n{\isachardoublequote}}]
   8.763 -  declares class \isa{c} to be a subclass of existing classes \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n{\isachardoublequote}}.  Cyclic class structures are not permitted.
   8.764 +  \item \hyperlink{command.classes}{\mbox{\isa{\isacommand{classes}}}}~\isa{{\isachardoublequote}c\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n{\isachardoublequote}} declares class
   8.765 +  \isa{c} to be a subclass of existing classes \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n{\isachardoublequote}}.
   8.766 +  Isabelle implicitly maintains the transitive closure of the class
   8.767 +  hierarchy.  Cyclic class structures are not permitted.
   8.768 +
   8.769 +  \item \hyperlink{command.classrel}{\mbox{\isa{\isacommand{classrel}}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}{\isachardoublequote}} states subclass
   8.770 +  relations between existing classes \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}{\isachardoublequote}} and \isa{{\isachardoublequote}c\isactrlsub {\isadigit{2}}{\isachardoublequote}}.
   8.771 +  This is done axiomatically!  The \indexref{}{command}{instance}\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}} command
   8.772 +  (see \secref{sec:axclass}) provides a way to introduce proven class
   8.773 +  relations.
   8.774  
   8.775 -  \item [\hyperlink{command.classrel}{\mbox{\isa{\isacommand{classrel}}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}{\isachardoublequote}}] states
   8.776 -  subclass relations between existing classes \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}{\isachardoublequote}} and
   8.777 -  \isa{{\isachardoublequote}c\isactrlsub {\isadigit{2}}{\isachardoublequote}}.  This is done axiomatically!  The \indexref{}{command}{instance}\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}} command (see \secref{sec:axclass}) provides a way to
   8.778 -  introduce proven class relations.
   8.779 +  \item \hyperlink{command.defaultsort}{\mbox{\isa{\isacommand{defaultsort}}}}~\isa{s} makes sort \isa{s} the
   8.780 +  new default sort for any type variable that is given explicitly in
   8.781 +  the text, but lacks a sort constraint (wrt.\ the current context).
   8.782 +  Type variables generated by type inference are not affected.
   8.783  
   8.784 -  \item [\hyperlink{command.defaultsort}{\mbox{\isa{\isacommand{defaultsort}}}}~\isa{s}] makes sort \isa{s} the
   8.785 -  new default sort for any type variables given without sort
   8.786 -  constraints.  Usually, the default sort would be only changed when
   8.787 -  defining a new object-logic.
   8.788 +  Usually the default sort is only changed when defining a new
   8.789 +  object-logic.  For example, the default sort in Isabelle/HOL is
   8.790 +  \isa{type}, the class of all HOL types.  %FIXME sort antiq?
   8.791  
   8.792 -  \item [\hyperlink{command.class-deps}{\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}}}] visualizes the subclass relation,
   8.793 +  When merging theories, the default sorts of the parents are
   8.794 +  logically intersected, i.e.\ the representations as lists of classes
   8.795 +  are joined.
   8.796 +
   8.797 +  \item \hyperlink{command.class-deps}{\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}}} visualizes the subclass relation,
   8.798    using Isabelle's graph browser tool (see also \cite{isabelle-sys}).
   8.799  
   8.800 -  \end{descr}%
   8.801 +  \end{description}%
   8.802  \end{isamarkuptext}%
   8.803  \isamarkuptrue%
   8.804  %
   8.805 @@ -931,10 +920,9 @@
   8.806  %
   8.807  \begin{isamarkuptext}%
   8.808  \begin{matharray}{rcll}
   8.809 -    \indexdef{}{command}{types}\hypertarget{command.types}{\hyperlink{command.types}{\mbox{\isa{\isacommand{types}}}}} & : & \isartrans{theory}{theory} \\
   8.810 -    \indexdef{}{command}{typedecl}\hypertarget{command.typedecl}{\hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}} & : & \isartrans{theory}{theory} \\
   8.811 -    \indexdef{}{command}{nonterminals}\hypertarget{command.nonterminals}{\hyperlink{command.nonterminals}{\mbox{\isa{\isacommand{nonterminals}}}}} & : & \isartrans{theory}{theory} \\
   8.812 -    \indexdef{}{command}{arities}\hypertarget{command.arities}{\hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
   8.813 +    \indexdef{}{command}{types}\hypertarget{command.types}{\hyperlink{command.types}{\mbox{\isa{\isacommand{types}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   8.814 +    \indexdef{}{command}{typedecl}\hypertarget{command.typedecl}{\hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   8.815 +    \indexdef{}{command}{arities}\hypertarget{command.arities}{\hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} & (axiomatic!) \\
   8.816    \end{matharray}
   8.817  
   8.818    \begin{rail}
   8.819 @@ -942,35 +930,71 @@
   8.820      ;
   8.821      'typedecl' typespec infix?
   8.822      ;
   8.823 -    'nonterminals' (name +)
   8.824 -    ;
   8.825      'arities' (nameref '::' arity +)
   8.826      ;
   8.827    \end{rail}
   8.828  
   8.829 -  \begin{descr}
   8.830 +  \begin{description}
   8.831  
   8.832 -  \item [\hyperlink{command.types}{\mbox{\isa{\isacommand{types}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t\ {\isacharequal}\ {\isasymtau}{\isachardoublequote}}]
   8.833 -  introduces \emph{type synonym} \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}
   8.834 -  for existing type \isa{{\isachardoublequote}{\isasymtau}{\isachardoublequote}}.  Unlike actual type definitions, as
   8.835 -  are available in Isabelle/HOL for example, type synonyms are just
   8.836 -  purely syntactic abbreviations without any logical significance.
   8.837 -  Internally, type synonyms are fully expanded.
   8.838 +  \item \hyperlink{command.types}{\mbox{\isa{\isacommand{types}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t\ {\isacharequal}\ {\isasymtau}{\isachardoublequote}} introduces a
   8.839 +  \emph{type synonym} \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}} for the existing type
   8.840 +  \isa{{\isachardoublequote}{\isasymtau}{\isachardoublequote}}.  Unlike actual type definitions, as are available in
   8.841 +  Isabelle/HOL for example, type synonyms are merely syntactic
   8.842 +  abbreviations without any logical significance.  Internally, type
   8.843 +  synonyms are fully expanded.
   8.844    
   8.845 -  \item [\hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}]
   8.846 -  declares a new type constructor \isa{t}, intended as an actual
   8.847 -  logical type (of the object-logic, if available).
   8.848 +  \item \hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}} declares a new
   8.849 +  type constructor \isa{t}.  If the object-logic defines a base sort
   8.850 +  \isa{s}, then the constructor is declared to operate on that, via
   8.851 +  the axiomatic specification \hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}~\isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}s{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ s{\isacharparenright}s{\isachardoublequote}}.
   8.852 +
   8.853 +  \item \hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}~\isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}s\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ s\isactrlsub n{\isacharparenright}s{\isachardoublequote}} augments
   8.854 +  Isabelle's order-sorted signature of types by new type constructor
   8.855 +  arities.  This is done axiomatically!  The \indexref{}{command}{instance}\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}
   8.856 +  command (see \secref{sec:axclass}) provides a way to introduce
   8.857 +  proven type arities.
   8.858 +
   8.859 +  \end{description}%
   8.860 +\end{isamarkuptext}%
   8.861 +\isamarkuptrue%
   8.862 +%
   8.863 +\isamarkupsubsection{Co-regularity of type classes and arities%
   8.864 +}
   8.865 +\isamarkuptrue%
   8.866 +%
   8.867 +\begin{isamarkuptext}%
   8.868 +The class relation together with the collection of
   8.869 +  type-constructor arities must obey the principle of
   8.870 +  \emph{co-regularity} as defined below.
   8.871  
   8.872 -  \item [\hyperlink{command.nonterminals}{\mbox{\isa{\isacommand{nonterminals}}}}~\isa{c}] declares type
   8.873 -  constructors \isa{c} (without arguments) to act as purely
   8.874 -  syntactic types, i.e.\ nonterminal symbols of Isabelle's inner
   8.875 -  syntax of terms or types.
   8.876 +  \medskip For the subsequent formulation of co-regularity we assume
   8.877 +  that the class relation is closed by transitivity and reflexivity.
   8.878 +  Moreover the collection of arities \isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s{\isacharparenright}c{\isachardoublequote}} is
   8.879 +  completed such that \isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s{\isacharparenright}c{\isachardoublequote}} and \isa{{\isachardoublequote}c\ {\isasymsubseteq}\ c{\isacharprime}{\isachardoublequote}}
   8.880 +  implies \isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s{\isacharparenright}c{\isacharprime}{\isachardoublequote}} for all such declarations.
   8.881 +
   8.882 +  Treating sorts as finite sets of classes (meaning the intersection),
   8.883 +  the class relation \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}{\isachardoublequote}} is extended to sorts as
   8.884 +  follows:
   8.885 +  \[
   8.886 +    \isa{{\isachardoublequote}s\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ s\isactrlsub {\isadigit{2}}\ {\isasymequiv}\ {\isasymforall}c\isactrlsub {\isadigit{2}}\ {\isasymin}\ s\isactrlsub {\isadigit{2}}{\isachardot}\ {\isasymexists}c\isactrlsub {\isadigit{1}}\ {\isasymin}\ s\isactrlsub {\isadigit{1}}{\isachardot}\ c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}{\isachardoublequote}}
   8.887 +  \]
   8.888  
   8.889 -  \item [\hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}~\isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}s\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ s\isactrlsub n{\isacharparenright}\ s{\isachardoublequote}}] augments Isabelle's order-sorted signature of types by new type
   8.890 -  constructor arities.  This is done axiomatically!  The \indexref{}{command}{instance}\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}} command (see \S\ref{sec:axclass}) provides a way to
   8.891 -  introduce proven type arities.
   8.892 +  This relation on sorts is further extended to tuples of sorts (of
   8.893 +  the same length) in the component-wise way.
   8.894  
   8.895 -  \end{descr}%
   8.896 +  \smallskip Co-regularity of the class relation together with the
   8.897 +  arities relation means:
   8.898 +  \[
   8.899 +    \isa{{\isachardoublequote}t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s\isactrlsub {\isadigit{1}}{\isacharparenright}c\isactrlsub {\isadigit{1}}\ {\isasymLongrightarrow}\ t\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s\isactrlsub {\isadigit{2}}{\isacharparenright}c\isactrlsub {\isadigit{2}}\ {\isasymLongrightarrow}\ c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}\ {\isasymLongrightarrow}\ \isactrlvec s\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ \isactrlvec s\isactrlsub {\isadigit{2}}{\isachardoublequote}}
   8.900 +  \]
   8.901 +  \noindent for all such arities.  In other words, whenever the result
   8.902 +  classes of some type-constructor arities are related, then the
   8.903 +  argument sorts need to be related in the same way.
   8.904 +
   8.905 +  \medskip Co-regularity is a very fundamental property of the
   8.906 +  order-sorted algebra of types.  For example, it entails principle
   8.907 +  types and most general unifiers, e.g.\ see \cite{nipkow-prehofer}.%
   8.908  \end{isamarkuptext}%
   8.909  \isamarkuptrue%
   8.910  %
   8.911 @@ -1015,9 +1039,9 @@
   8.912    instance of this, general \isa{{\isachardoublequote}d\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ {\isasymtimes}\ {\isasymbeta}{\isachardoublequote}} will be disallowed.
   8.913  
   8.914    \begin{matharray}{rcl}
   8.915 -    \indexdef{}{command}{consts}\hypertarget{command.consts}{\hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}} & : & \isartrans{theory}{theory} \\
   8.916 -    \indexdef{}{command}{defs}\hypertarget{command.defs}{\hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}}} & : & \isartrans{theory}{theory} \\
   8.917 -    \indexdef{}{command}{constdefs}\hypertarget{command.constdefs}{\hyperlink{command.constdefs}{\mbox{\isa{\isacommand{constdefs}}}}} & : & \isartrans{theory}{theory} \\
   8.918 +    \indexdef{}{command}{consts}\hypertarget{command.consts}{\hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   8.919 +    \indexdef{}{command}{defs}\hypertarget{command.defs}{\hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   8.920 +    \indexdef{}{command}{constdefs}\hypertarget{command.constdefs}{\hyperlink{command.constdefs}{\mbox{\isa{\isacommand{constdefs}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
   8.921    \end{matharray}
   8.922  
   8.923    \begin{rail}
   8.924 @@ -1039,14 +1063,13 @@
   8.925      ;
   8.926    \end{rail}
   8.927  
   8.928 -  \begin{descr}
   8.929 +  \begin{description}
   8.930  
   8.931 -  \item [\hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}~\isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}{\isachardoublequote}}] declares constant
   8.932 -  \isa{c} to have any instance of type scheme \isa{{\isasymsigma}}.  The
   8.933 -  optional mixfix annotations may attach concrete syntax to the
   8.934 -  constants declared.
   8.935 +  \item \hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}~\isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}{\isachardoublequote}} declares constant \isa{c} to have any instance of type scheme \isa{{\isasymsigma}}.  The optional
   8.936 +  mixfix annotations may attach concrete syntax to the constants
   8.937 +  declared.
   8.938    
   8.939 -  \item [\hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}}~\isa{{\isachardoublequote}name{\isacharcolon}\ eqn{\isachardoublequote}}] introduces \isa{eqn}
   8.940 +  \item \hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}}~\isa{{\isachardoublequote}name{\isacharcolon}\ eqn{\isachardoublequote}} introduces \isa{eqn}
   8.941    as a definitional axiom for some existing constant.
   8.942    
   8.943    The \isa{{\isachardoublequote}{\isacharparenleft}unchecked{\isacharparenright}{\isachardoublequote}} option disables global dependency checks
   8.944 @@ -1059,11 +1082,12 @@
   8.945    message would be issued for any definitional equation with a more
   8.946    special type than that of the corresponding constant declaration.
   8.947    
   8.948 -  \item [\hyperlink{command.constdefs}{\mbox{\isa{\isacommand{constdefs}}}}] provides a streamlined combination of
   8.949 -  constants declarations and definitions: type-inference takes care of
   8.950 -  the most general typing of the given specification (the optional
   8.951 -  type constraint may refer to type-inference dummies ``\isa{{\isacharunderscore}}'' as usual).  The resulting type declaration needs to agree with
   8.952 -  that of the specification; overloading is \emph{not} supported here!
   8.953 +  \item \hyperlink{command.constdefs}{\mbox{\isa{\isacommand{constdefs}}}} combines constant declarations and
   8.954 +  definitions, with type-inference taking care of the most general
   8.955 +  typing of the given specification (the optional type constraint may
   8.956 +  refer to type-inference dummies ``\isa{{\isacharunderscore}}'' as usual).  The
   8.957 +  resulting type declaration needs to agree with that of the
   8.958 +  specification; overloading is \emph{not} supported here!
   8.959    
   8.960    The constant name may be omitted altogether, if neither type nor
   8.961    syntax declarations are given.  The canonical name of the
   8.962 @@ -1074,9 +1098,9 @@
   8.963    
   8.964    An optional initial context of \isa{{\isachardoublequote}{\isacharparenleft}structure{\isacharparenright}{\isachardoublequote}} declarations
   8.965    admits use of indexed syntax, using the special symbol \verb|\<index>| (printed as ``\isa{{\isachardoublequote}{\isasymindex}{\isachardoublequote}}'').  The latter concept is
   8.966 -  particularly useful with locales (see also \S\ref{sec:locale}).
   8.967 +  particularly useful with locales (see also \secref{sec:locale}).
   8.968  
   8.969 -  \end{descr}%
   8.970 +  \end{description}%
   8.971  \end{isamarkuptext}%
   8.972  \isamarkuptrue%
   8.973  %
   8.974 @@ -1086,9 +1110,9 @@
   8.975  %
   8.976  \begin{isamarkuptext}%
   8.977  \begin{matharray}{rcll}
   8.978 -    \indexdef{}{command}{axioms}\hypertarget{command.axioms}{\hyperlink{command.axioms}{\mbox{\isa{\isacommand{axioms}}}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
   8.979 -    \indexdef{}{command}{lemmas}\hypertarget{command.lemmas}{\hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}} & : & \isarkeep{local{\dsh}theory} \\
   8.980 -    \indexdef{}{command}{theorems}\hypertarget{command.theorems}{\hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}}} & : & \isarkeep{local{\dsh}theory} \\
   8.981 +    \indexdef{}{command}{axioms}\hypertarget{command.axioms}{\hyperlink{command.axioms}{\mbox{\isa{\isacommand{axioms}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} & (axiomatic!) \\
   8.982 +    \indexdef{}{command}{lemmas}\hypertarget{command.lemmas}{\hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.983 +    \indexdef{}{command}{theorems}\hypertarget{command.theorems}{\hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}}} & : & \isa{{\isachardoublequote}local{\isacharunderscore}theory\ {\isasymrightarrow}\ local{\isacharunderscore}theory{\isachardoublequote}} \\
   8.984    \end{matharray}
   8.985  
   8.986    \begin{rail}
   8.987 @@ -1098,9 +1122,9 @@
   8.988      ;
   8.989    \end{rail}
   8.990  
   8.991 -  \begin{descr}
   8.992 +  \begin{description}
   8.993    
   8.994 -  \item [\hyperlink{command.axioms}{\mbox{\isa{\isacommand{axioms}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] introduces arbitrary
   8.995 +  \item \hyperlink{command.axioms}{\mbox{\isa{\isacommand{axioms}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} introduces arbitrary
   8.996    statements as axioms of the meta-logic.  In fact, axioms are
   8.997    ``axiomatic theorems'', and may be referred later just as any other
   8.998    theorem.
   8.999 @@ -1109,15 +1133,14 @@
  8.1000    systems.  Everyday work is typically done the hard way, with proper
  8.1001    definitions and proven theorems.
  8.1002    
  8.1003 -  \item [\hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}]
  8.1004 -  retrieves and stores existing facts in the theory context, or the
  8.1005 -  specified target context (see also \secref{sec:target}).  Typical
  8.1006 -  applications would also involve attributes, to declare Simplifier
  8.1007 -  rules, for example.
  8.1008 +  \item \hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}} retrieves and stores
  8.1009 +  existing facts in the theory context, or the specified target
  8.1010 +  context (see also \secref{sec:target}).  Typical applications would
  8.1011 +  also involve attributes, to declare Simplifier rules, for example.
  8.1012    
  8.1013 -  \item [\hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}}] is essentially the same as \hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}, but marks the result as a different kind of facts.
  8.1014 +  \item \hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}} is essentially the same as \hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}, but marks the result as a different kind of facts.
  8.1015  
  8.1016 -  \end{descr}%
  8.1017 +  \end{description}%
  8.1018  \end{isamarkuptext}%
  8.1019  \isamarkuptrue%
  8.1020  %
  8.1021 @@ -1126,31 +1149,44 @@
  8.1022  \isamarkuptrue%
  8.1023  %
  8.1024  \begin{isamarkuptext}%
  8.1025 -\begin{matharray}{rcl}
  8.1026 -    \indexdef{}{command}{oracle}\hypertarget{command.oracle}{\hyperlink{command.oracle}{\mbox{\isa{\isacommand{oracle}}}}} & : & \isartrans{theory}{theory} \\
  8.1027 -  \end{matharray}
  8.1028 +Oracles allow Isabelle to take advantage of external reasoners
  8.1029 +  such as arithmetic decision procedures, model checkers, fast
  8.1030 +  tautology checkers or computer algebra systems.  Invoked as an
  8.1031 +  oracle, an external reasoner can create arbitrary Isabelle theorems.
  8.1032  
  8.1033 -  The oracle interface promotes a given ML function \verb|'a -> cterm|
  8.1034 -  to \verb|'a -> thm|.  This acts like an infinitary
  8.1035 -  specification of axioms -- there is no internal check of the
  8.1036 -  correctness of the results!  The inference kernel records oracle
  8.1037 -  invocations within the internal derivation object of theorems, and
  8.1038 -  the pretty printer attaches ``\isa{{\isachardoublequote}{\isacharbrackleft}{\isacharbang}{\isacharbrackright}{\isachardoublequote}}'' to indicate results
  8.1039 -  that are not fully checked by Isabelle inferences.
  8.1040 +  It is the responsibility of the user to ensure that the external
  8.1041 +  reasoner is as trustworthy as the application requires.  Another
  8.1042 +  typical source of errors is the linkup between Isabelle and the
  8.1043 +  external tool, not just its concrete implementation, but also the
  8.1044 +  required translation between two different logical environments.
  8.1045 +
  8.1046 +  Isabelle merely guarantees well-formedness of the propositions being
  8.1047 +  asserted, and records within the internal derivation object how
  8.1048 +  presumed theorems depend on unproven suppositions.
  8.1049 +
  8.1050 +  \begin{matharray}{rcl}
  8.1051 +    \indexdef{}{command}{oracle}\hypertarget{command.oracle}{\hyperlink{command.oracle}{\mbox{\isa{\isacommand{oracle}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
  8.1052 +  \end{matharray}
  8.1053  
  8.1054    \begin{rail}
  8.1055      'oracle' name '=' text
  8.1056      ;
  8.1057    \end{rail}
  8.1058  
  8.1059 -  \begin{descr}
  8.1060 +  \begin{description}
  8.1061  
  8.1062 -  \item [\hyperlink{command.oracle}{\mbox{\isa{\isacommand{oracle}}}}~\isa{{\isachardoublequote}name\ {\isacharequal}\ text{\isachardoublequote}}] turns the given ML
  8.1063 +  \item \hyperlink{command.oracle}{\mbox{\isa{\isacommand{oracle}}}}~\isa{{\isachardoublequote}name\ {\isacharequal}\ text{\isachardoublequote}} turns the given ML
  8.1064    expression \isa{{\isachardoublequote}text{\isachardoublequote}} of type \verb|'a -> cterm| into an
  8.1065    ML function of type \verb|'a -> thm|, which is bound to the
  8.1066 -  global identifier \verb|name|.
  8.1067 +  global identifier \verb|name|.  This acts like an infinitary
  8.1068 +  specification of axioms!  Invoking the oracle only works within the
  8.1069 +  scope of the resulting theory.
  8.1070  
  8.1071 -  \end{descr}%
  8.1072 +  \end{description}
  8.1073 +
  8.1074 +  See \hyperlink{file.~~/src/FOL/ex/IffOracle.thy}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}src{\isacharslash}FOL{\isacharslash}ex{\isacharslash}IffOracle{\isachardot}thy}}}} for a worked example of
  8.1075 +  defining a new primitive rule as oracle, and turning it into a proof
  8.1076 +  method.%
  8.1077  \end{isamarkuptext}%
  8.1078  \isamarkuptrue%
  8.1079  %
  8.1080 @@ -1160,9 +1196,9 @@
  8.1081  %
  8.1082  \begin{isamarkuptext}%
  8.1083  \begin{matharray}{rcl}
  8.1084 -    \indexdef{}{command}{global}\hypertarget{command.global}{\hyperlink{command.global}{\mbox{\isa{\isacommand{global}}}}} & : & \isartrans{theory}{theory} \\
  8.1085 -    \indexdef{}{command}{local}\hypertarget{command.local}{\hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}}} & : & \isartrans{theory}{theory} \\
  8.1086 -    \indexdef{}{command}{hide}\hypertarget{command.hide}{\hyperlink{command.hide}{\mbox{\isa{\isacommand{hide}}}}} & : & \isartrans{theory}{theory} \\
  8.1087 +    \indexdef{}{command}{global}\hypertarget{command.global}{\hyperlink{command.global}{\mbox{\isa{\isacommand{global}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
  8.1088 +    \indexdef{}{command}{local}\hypertarget{command.local}{\hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
  8.1089 +    \indexdef{}{command}{hide}\hypertarget{command.hide}{\hyperlink{command.hide}{\mbox{\isa{\isacommand{hide}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
  8.1090    \end{matharray}
  8.1091  
  8.1092    \begin{rail}
  8.1093 @@ -1176,139 +1212,27 @@
  8.1094    name spaces by hand, yet the following commands provide some way to
  8.1095    do so.
  8.1096  
  8.1097 -  \begin{descr}
  8.1098 +  \begin{description}
  8.1099  
  8.1100 -  \item [\hyperlink{command.global}{\mbox{\isa{\isacommand{global}}}} and \hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}}] change the
  8.1101 -  current name declaration mode.  Initially, theories start in
  8.1102 -  \hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}} mode, causing all names to be automatically
  8.1103 -  qualified by the theory name.  Changing this to \hyperlink{command.global}{\mbox{\isa{\isacommand{global}}}}
  8.1104 -  causes all names to be declared without the theory prefix, until
  8.1105 -  \hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}} is declared again.
  8.1106 +  \item \hyperlink{command.global}{\mbox{\isa{\isacommand{global}}}} and \hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}} change the current
  8.1107 +  name declaration mode.  Initially, theories start in \hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}} mode, causing all names to be automatically qualified by
  8.1108 +  the theory name.  Changing this to \hyperlink{command.global}{\mbox{\isa{\isacommand{global}}}} causes all
  8.1109 +  names to be declared without the theory prefix, until \hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}} is declared again.
  8.1110    
  8.1111    Note that global names are prone to get hidden accidently later,
  8.1112    when qualified names of the same base name are introduced.
  8.1113    
  8.1114 -  \item [\hyperlink{command.hide}{\mbox{\isa{\isacommand{hide}}}}~\isa{{\isachardoublequote}space\ names{\isachardoublequote}}] fully removes
  8.1115 +  \item \hyperlink{command.hide}{\mbox{\isa{\isacommand{hide}}}}~\isa{{\isachardoublequote}space\ names{\isachardoublequote}} fully removes
  8.1116    declarations from a given name space (which may be \isa{{\isachardoublequote}class{\isachardoublequote}},
  8.1117    \isa{{\isachardoublequote}type{\isachardoublequote}}, \isa{{\isachardoublequote}const{\isachardoublequote}}, or \isa{{\isachardoublequote}fact{\isachardoublequote}}); with the \isa{{\isachardoublequote}{\isacharparenleft}open{\isacharparenright}{\isachardoublequote}} option, only the base name is hidden.  Global
  8.1118    (unqualified) names may never be hidden.
  8.1119    
  8.1120    Note that hiding name space accesses has no impact on logical
  8.1121 -  declarations -- they remain valid internally.  Entities that are no
  8.1122 +  declarations --- they remain valid internally.  Entities that are no
  8.1123    longer accessible to the user are printed with the special qualifier
  8.1124    ``\isa{{\isachardoublequote}{\isacharquery}{\isacharquery}{\isachardoublequote}}'' prefixed to the full internal name.
  8.1125  
  8.1126 -  \end{descr}%
  8.1127 -\end{isamarkuptext}%
  8.1128 -\isamarkuptrue%
  8.1129 -%
  8.1130 -\isamarkupsection{Syntax and translations \label{sec:syn-trans}%
  8.1131 -}
  8.1132 -\isamarkuptrue%
  8.1133 -%
  8.1134 -\begin{isamarkuptext}%
  8.1135 -\begin{matharray}{rcl}
  8.1136 -    \indexdef{}{command}{syntax}\hypertarget{command.syntax}{\hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}}} & : & \isartrans{theory}{theory} \\
  8.1137 -    \indexdef{}{command}{no\_syntax}\hypertarget{command.no-syntax}{\hyperlink{command.no-syntax}{\mbox{\isa{\isacommand{no{\isacharunderscore}syntax}}}}} & : & \isartrans{theory}{theory} \\
  8.1138 -    \indexdef{}{command}{translations}\hypertarget{command.translations}{\hyperlink{command.translations}{\mbox{\isa{\isacommand{translations}}}}} & : & \isartrans{theory}{theory} \\
  8.1139 -    \indexdef{}{command}{no\_translations}\hypertarget{command.no-translations}{\hyperlink{command.no-translations}{\mbox{\isa{\isacommand{no{\isacharunderscore}translations}}}}} & : & \isartrans{theory}{theory} \\
  8.1140 -  \end{matharray}
  8.1141 -
  8.1142 -  \begin{rail}
  8.1143 -    ('syntax' | 'no\_syntax') mode? (constdecl +)
  8.1144 -    ;
  8.1145 -    ('translations' | 'no\_translations') (transpat ('==' | '=>' | '<=' | rightleftharpoons | rightharpoonup | leftharpoondown) transpat +)
  8.1146 -    ;
  8.1147 -
  8.1148 -    mode: ('(' ( name | 'output' | name 'output' ) ')')
  8.1149 -    ;
  8.1150 -    transpat: ('(' nameref ')')? string
  8.1151 -    ;
  8.1152 -  \end{rail}
  8.1153 -
  8.1154 -  \begin{descr}
  8.1155 -  
  8.1156 -  \item [\hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}}~\isa{{\isachardoublequote}{\isacharparenleft}mode{\isacharparenright}\ decls{\isachardoublequote}}] is similar to
  8.1157 -  \hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}~\isa{decls}, except that the actual logical
  8.1158 -  signature extension is omitted.  Thus the context free grammar of
  8.1159 -  Isabelle's inner syntax may be augmented in arbitrary ways,
  8.1160 -  independently of the logic.  The \isa{mode} argument refers to the
  8.1161 -  print mode that the grammar rules belong; unless the \indexref{}{keyword}{output}\hyperlink{keyword.output}{\mbox{\isa{\isakeyword{output}}}} indicator is given, all productions are added both to the
  8.1162 -  input and output grammar.
  8.1163 -  
  8.1164 -  \item [\hyperlink{command.no-syntax}{\mbox{\isa{\isacommand{no{\isacharunderscore}syntax}}}}~\isa{{\isachardoublequote}{\isacharparenleft}mode{\isacharparenright}\ decls{\isachardoublequote}}] removes
  8.1165 -  grammar declarations (and translations) resulting from \isa{decls}, which are interpreted in the same manner as for \hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}} above.
  8.1166 -  
  8.1167 -  \item [\hyperlink{command.translations}{\mbox{\isa{\isacommand{translations}}}}~\isa{rules}] specifies syntactic
  8.1168 -  translation rules (i.e.\ macros): parse~/ print rules (\isa{{\isachardoublequote}{\isasymrightleftharpoons}{\isachardoublequote}}),
  8.1169 -  parse rules (\isa{{\isachardoublequote}{\isasymrightharpoonup}{\isachardoublequote}}), or print rules (\isa{{\isachardoublequote}{\isasymleftharpoondown}{\isachardoublequote}}).
  8.1170 -  Translation patterns may be prefixed by the syntactic category to be
  8.1171 -  used for parsing; the default is \isa{logic}.
  8.1172 -  
  8.1173 -  \item [\hyperlink{command.no-translations}{\mbox{\isa{\isacommand{no{\isacharunderscore}translations}}}}~\isa{rules}] removes syntactic
  8.1174 -  translation rules, which are interpreted in the same manner as for
  8.1175 -  \hyperlink{command.translations}{\mbox{\isa{\isacommand{translations}}}} above.
  8.1176 -
  8.1177 -  \end{descr}%
  8.1178 -\end{isamarkuptext}%
  8.1179 -\isamarkuptrue%
  8.1180 -%
  8.1181 -\isamarkupsection{Syntax translation functions%
  8.1182 -}
  8.1183 -\isamarkuptrue%
  8.1184 -%
  8.1185 -\begin{isamarkuptext}%
  8.1186 -\begin{matharray}{rcl}
  8.1187 -    \indexdef{}{command}{parse\_ast\_translation}\hypertarget{command.parse-ast-translation}{\hyperlink{command.parse-ast-translation}{\mbox{\isa{\isacommand{parse{\isacharunderscore}ast{\isacharunderscore}translation}}}}} & : & \isartrans{theory}{theory} \\
  8.1188 -    \indexdef{}{command}{parse\_translation}\hypertarget{command.parse-translation}{\hyperlink{command.parse-translation}{\mbox{\isa{\isacommand{parse{\isacharunderscore}translation}}}}} & : & \isartrans{theory}{theory} \\
  8.1189 -    \indexdef{}{command}{print\_translation}\hypertarget{command.print-translation}{\hyperlink{command.print-translation}{\mbox{\isa{\isacommand{print{\isacharunderscore}translation}}}}} & : & \isartrans{theory}{theory} \\
  8.1190 -    \indexdef{}{command}{typed\_print\_translation}\hypertarget{command.typed-print-translation}{\hyperlink{command.typed-print-translation}{\mbox{\isa{\isacommand{typed{\isacharunderscore}print{\isacharunderscore}translation}}}}} & : & \isartrans{theory}{theory} \\
  8.1191 -    \indexdef{}{command}{print\_ast\_translation}\hypertarget{command.print-ast-translation}{\hyperlink{command.print-ast-translation}{\mbox{\isa{\isacommand{print{\isacharunderscore}ast{\isacharunderscore}translation}}}}} & : & \isartrans{theory}{theory} \\
  8.1192 -  \end{matharray}
  8.1193 -
  8.1194 -  \begin{rail}
  8.1195 -  ( 'parse\_ast\_translation' | 'parse\_translation' | 'print\_translation' |
  8.1196 -    'typed\_print\_translation' | 'print\_ast\_translation' ) ('(advanced)')? text
  8.1197 -  ;
  8.1198 -  \end{rail}
  8.1199 -
  8.1200 -  Syntax translation functions written in ML admit almost arbitrary
  8.1201 -  manipulations of Isabelle's inner syntax.  Any of the above commands
  8.1202 -  have a single \railqtok{text} argument that refers to an ML
  8.1203 -  expression of appropriate type, which are as follows by default:
  8.1204 -
  8.1205 -%FIXME proper antiquotations
  8.1206 -\begin{ttbox}
  8.1207 -val parse_ast_translation   : (string * (ast list -> ast)) list
  8.1208 -val parse_translation       : (string * (term list -> term)) list
  8.1209 -val print_translation       : (string * (term list -> term)) list
  8.1210 -val typed_print_translation :
  8.1211 -  (string * (bool -> typ -> term list -> term)) list
  8.1212 -val print_ast_translation   : (string * (ast list -> ast)) list
  8.1213 -\end{ttbox}
  8.1214 -
  8.1215 -  If the \isa{{\isachardoublequote}{\isacharparenleft}advanced{\isacharparenright}{\isachardoublequote}} option is given, the corresponding
  8.1216 -  translation functions may depend on the current theory or proof
  8.1217 -  context.  This allows to implement advanced syntax mechanisms, as
  8.1218 -  translations functions may refer to specific theory declarations or
  8.1219 -  auxiliary proof data.
  8.1220 -
  8.1221 -  See also \cite[\S8]{isabelle-ref} for more information on the
  8.1222 -  general concept of syntax transformations in Isabelle.
  8.1223 -
  8.1224 -%FIXME proper antiquotations
  8.1225 -\begin{ttbox}
  8.1226 -val parse_ast_translation:
  8.1227 -  (string * (Proof.context -> ast list -> ast)) list
  8.1228 -val parse_translation:
  8.1229 -  (string * (Proof.context -> term list -> term)) list
  8.1230 -val print_translation:
  8.1231 -  (string * (Proof.context -> term list -> term)) list
  8.1232 -val typed_print_translation:
  8.1233 -  (string * (Proof.context -> bool -> typ -> term list -> term)) list
  8.1234 -val print_ast_translation:
  8.1235 -  (string * (Proof.context -> ast list -> ast)) list
  8.1236 -\end{ttbox}%
  8.1237 +  \end{description}%
  8.1238  \end{isamarkuptext}%
  8.1239  \isamarkuptrue%
  8.1240  %
     9.1 --- a/doc-src/IsarRef/Thy/document/ZF_Specific.tex	Thu Nov 13 22:44:40 2008 +0100
     9.2 +++ b/doc-src/IsarRef/Thy/document/ZF_Specific.tex	Thu Nov 13 22:45:12 2008 +0100
     9.3 @@ -36,9 +36,9 @@
     9.4    Simplifier setup.
     9.5  
     9.6    \begin{matharray}{rcl}
     9.7 -    \indexdef{ZF}{command}{print\_tcset}\hypertarget{command.ZF.print-tcset}{\hyperlink{command.ZF.print-tcset}{\mbox{\isa{\isacommand{print{\isacharunderscore}tcset}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
     9.8 -    \indexdef{ZF}{method}{typecheck}\hypertarget{method.ZF.typecheck}{\hyperlink{method.ZF.typecheck}{\mbox{\isa{typecheck}}}} & : & \isarmeth \\
     9.9 -    \indexdef{ZF}{attribute}{TC}\hypertarget{attribute.ZF.TC}{\hyperlink{attribute.ZF.TC}{\mbox{\isa{TC}}}} & : & \isaratt \\
    9.10 +    \indexdef{ZF}{command}{print\_tcset}\hypertarget{command.ZF.print-tcset}{\hyperlink{command.ZF.print-tcset}{\mbox{\isa{\isacommand{print{\isacharunderscore}tcset}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
    9.11 +    \indexdef{ZF}{method}{typecheck}\hypertarget{method.ZF.typecheck}{\hyperlink{method.ZF.typecheck}{\mbox{\isa{typecheck}}}} & : & \isa{method} \\
    9.12 +    \indexdef{ZF}{attribute}{TC}\hypertarget{attribute.ZF.TC}{\hyperlink{attribute.ZF.TC}{\mbox{\isa{TC}}}} & : & \isa{attribute} \\
    9.13    \end{matharray}
    9.14  
    9.15    \begin{rail}
    9.16 @@ -46,18 +46,18 @@
    9.17      ;
    9.18    \end{rail}
    9.19  
    9.20 -  \begin{descr}
    9.21 +  \begin{description}
    9.22    
    9.23 -  \item [\hyperlink{command.ZF.print-tcset}{\mbox{\isa{\isacommand{print{\isacharunderscore}tcset}}}}] prints the collection of
    9.24 +  \item \hyperlink{command.ZF.print-tcset}{\mbox{\isa{\isacommand{print{\isacharunderscore}tcset}}}} prints the collection of
    9.25    typechecking rules of the current context.
    9.26    
    9.27 -  \item [\hyperlink{method.ZF.typecheck}{\mbox{\isa{typecheck}}}] attempts to solve any pending
    9.28 +  \item \hyperlink{method.ZF.typecheck}{\mbox{\isa{typecheck}}} attempts to solve any pending
    9.29    type-checking problems in subgoals.
    9.30    
    9.31 -  \item [\hyperlink{attribute.ZF.TC}{\mbox{\isa{TC}}}] adds or deletes type-checking rules
    9.32 -  from the context.
    9.33 +  \item \hyperlink{attribute.ZF.TC}{\mbox{\isa{TC}}} adds or deletes type-checking rules from
    9.34 +  the context.
    9.35  
    9.36 -  \end{descr}%
    9.37 +  \end{description}%
    9.38  \end{isamarkuptext}%
    9.39  \isamarkuptrue%
    9.40  %
    9.41 @@ -75,10 +75,10 @@
    9.42    Coinductive definitions are available in both cases, too.
    9.43  
    9.44    \begin{matharray}{rcl}
    9.45 -    \indexdef{ZF}{command}{inductive}\hypertarget{command.ZF.inductive}{\hyperlink{command.ZF.inductive}{\mbox{\isa{\isacommand{inductive}}}}} & : & \isartrans{theory}{theory} \\
    9.46 -    \indexdef{ZF}{command}{coinductive}\hypertarget{command.ZF.coinductive}{\hyperlink{command.ZF.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}} & : & \isartrans{theory}{theory} \\
    9.47 -    \indexdef{ZF}{command}{datatype}\hypertarget{command.ZF.datatype}{\hyperlink{command.ZF.datatype}{\mbox{\isa{\isacommand{datatype}}}}} & : & \isartrans{theory}{theory} \\
    9.48 -    \indexdef{ZF}{command}{codatatype}\hypertarget{command.ZF.codatatype}{\hyperlink{command.ZF.codatatype}{\mbox{\isa{\isacommand{codatatype}}}}} & : & \isartrans{theory}{theory} \\
    9.49 +    \indexdef{ZF}{command}{inductive}\hypertarget{command.ZF.inductive}{\hyperlink{command.ZF.inductive}{\mbox{\isa{\isacommand{inductive}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
    9.50 +    \indexdef{ZF}{command}{coinductive}\hypertarget{command.ZF.coinductive}{\hyperlink{command.ZF.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
    9.51 +    \indexdef{ZF}{command}{datatype}\hypertarget{command.ZF.datatype}{\hyperlink{command.ZF.datatype}{\mbox{\isa{\isacommand{datatype}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
    9.52 +    \indexdef{ZF}{command}{codatatype}\hypertarget{command.ZF.codatatype}{\hyperlink{command.ZF.codatatype}{\mbox{\isa{\isacommand{codatatype}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
    9.53    \end{matharray}
    9.54  
    9.55    \begin{rail}
    9.56 @@ -129,7 +129,7 @@
    9.57  %
    9.58  \begin{isamarkuptext}%
    9.59  \begin{matharray}{rcl}
    9.60 -    \indexdef{ZF}{command}{primrec}\hypertarget{command.ZF.primrec}{\hyperlink{command.ZF.primrec}{\mbox{\isa{\isacommand{primrec}}}}} & : & \isartrans{theory}{theory} \\
    9.61 +    \indexdef{ZF}{command}{primrec}\hypertarget{command.ZF.primrec}{\hyperlink{command.ZF.primrec}{\mbox{\isa{\isacommand{primrec}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
    9.62    \end{matharray}
    9.63  
    9.64    \begin{rail}
    9.65 @@ -148,10 +148,10 @@
    9.66    ported to Isar.  These should not be used in proper proof texts.
    9.67  
    9.68    \begin{matharray}{rcl}
    9.69 -    \indexdef{ZF}{method}{case\_tac}\hypertarget{method.ZF.case-tac}{\hyperlink{method.ZF.case-tac}{\mbox{\isa{case{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
    9.70 -    \indexdef{ZF}{method}{induct\_tac}\hypertarget{method.ZF.induct-tac}{\hyperlink{method.ZF.induct-tac}{\mbox{\isa{induct{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
    9.71 -    \indexdef{ZF}{method}{ind\_cases}\hypertarget{method.ZF.ind-cases}{\hyperlink{method.ZF.ind-cases}{\mbox{\isa{ind{\isacharunderscore}cases}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarmeth \\
    9.72 -    \indexdef{ZF}{command}{inductive\_cases}\hypertarget{command.ZF.inductive-cases}{\hyperlink{command.ZF.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}cases}}}}} & : & \isartrans{theory}{theory} \\
    9.73 +    \indexdef{ZF}{method}{case\_tac}\hypertarget{method.ZF.case-tac}{\hyperlink{method.ZF.case-tac}{\mbox{\isa{case{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
    9.74 +    \indexdef{ZF}{method}{induct\_tac}\hypertarget{method.ZF.induct-tac}{\hyperlink{method.ZF.induct-tac}{\mbox{\isa{induct{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
    9.75 +    \indexdef{ZF}{method}{ind\_cases}\hypertarget{method.ZF.ind-cases}{\hyperlink{method.ZF.ind-cases}{\mbox{\isa{ind{\isacharunderscore}cases}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
    9.76 +    \indexdef{ZF}{command}{inductive\_cases}\hypertarget{command.ZF.inductive-cases}{\hyperlink{command.ZF.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}cases}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
    9.77    \end{matharray}
    9.78  
    9.79    \begin{rail}