src/Doc/Tutorial/Documents/Documents.thy
changeset 58620 7435b6a3f72e
parent 54936 30e2503f1aa2
child 58842 22b87ab47d3b
equal deleted inserted replaced
58619:4b41df5fef81 58620:7435b6a3f72e
     9   of \bfindex{mixfix annotations}.  Associated with any kind of
     9   of \bfindex{mixfix annotations}.  Associated with any kind of
    10   constant declaration, mixfixes affect both the grammar productions
    10   constant declaration, mixfixes affect both the grammar productions
    11   for the parser and output templates for the pretty printer.
    11   for the parser and output templates for the pretty printer.
    12 
    12 
    13   In full generality, parser and pretty printer configuration is a
    13   In full generality, parser and pretty printer configuration is a
    14   subtle affair~\cite{isabelle-isar-ref}.  Your syntax specifications need
    14   subtle affair~@{cite "isabelle-isar-ref"}.  Your syntax specifications need
    15   to interact properly with the existing setup of Isabelle/Pure and
    15   to interact properly with the existing setup of Isabelle/Pure and
    16   Isabelle/HOL\@.  To avoid creating ambiguities with existing
    16   Isabelle/HOL\@.  To avoid creating ambiguities with existing
    17   elements, it is particularly important to give new syntactic
    17   elements, it is particularly important to give new syntactic
    18   constructs the right precedence.
    18   constructs the right precedence.
    19 
    19 
   105   user-interface of Proof~General + X-Symbol and the Isabelle document
   105   user-interface of Proof~General + X-Symbol and the Isabelle document
   106   processor (see \S\ref{sec:document-preparation}) display the
   106   processor (see \S\ref{sec:document-preparation}) display the
   107   \verb,\,\verb,<forall>, symbol as~@{text \<forall>}.
   107   \verb,\,\verb,<forall>, symbol as~@{text \<forall>}.
   108 
   108 
   109   A list of standard Isabelle symbols is given in
   109   A list of standard Isabelle symbols is given in
   110   \cite{isabelle-isar-ref}.  You may introduce your own
   110   @{cite "isabelle-isar-ref"}.  You may introduce your own
   111   interpretation of further symbols by configuring the appropriate
   111   interpretation of further symbols by configuring the appropriate
   112   front-end tool accordingly, e.g.\ by defining certain {\LaTeX}
   112   front-end tool accordingly, e.g.\ by defining certain {\LaTeX}
   113   macros (see also \S\ref{sec:doc-prep-symbols}).  There are also a
   113   macros (see also \S\ref{sec:doc-prep-symbols}).  There are also a
   114   few predefined control symbols, such as \verb,\,\verb,<^sub>, and
   114   few predefined control symbols, such as \verb,\,\verb,<^sub>, and
   115   \verb,\,\verb,<^sup>, for sub- and superscript of the subsequent
   115   \verb,\,\verb,<^sup>, for sub- and superscript of the subsequent
   151   @{text \<oplus>} in the text.  If all fails one may just type a named
   151   @{text \<oplus>} in the text.  If all fails one may just type a named
   152   entity \verb,\,\verb,<oplus>, by hand; the corresponding symbol will
   152   entity \verb,\,\verb,<oplus>, by hand; the corresponding symbol will
   153   be displayed after further input.
   153   be displayed after further input.
   154 
   154 
   155   More flexible is to provide alternative syntax forms
   155   More flexible is to provide alternative syntax forms
   156   through the \bfindex{print mode} concept~\cite{isabelle-isar-ref}.  By
   156   through the \bfindex{print mode} concept~@{cite "isabelle-isar-ref"}.  By
   157   convention, the mode of ``$xsymbols$'' is enabled whenever
   157   convention, the mode of ``$xsymbols$'' is enabled whenever
   158   Proof~General's X-Symbol mode or {\LaTeX} output is active.  Now
   158   Proof~General's X-Symbol mode or {\LaTeX} output is active.  Now
   159   consider the following hybrid declaration of @{text xor}:
   159   consider the following hybrid declaration of @{text xor}:
   160 *}
   160 *}
   161 
   161 
   185 
   185 
   186 subsection {* Prefix Annotations *}
   186 subsection {* Prefix Annotations *}
   187 
   187 
   188 text {*
   188 text {*
   189   Prefix syntax annotations\index{prefix annotation} are another form
   189   Prefix syntax annotations\index{prefix annotation} are another form
   190   of mixfixes \cite{isabelle-isar-ref}, without any template arguments or
   190   of mixfixes @{cite "isabelle-isar-ref"}, without any template arguments or
   191   priorities --- just some literal syntax.  The following example
   191   priorities --- just some literal syntax.  The following example
   192   associates common symbols with the constructors of a datatype.
   192   associates common symbols with the constructors of a datatype.
   193 *}
   193 *}
   194 
   194 
   195 datatype currency =
   195 datatype currency =
   260 large hierarchies of concepts. Abbreviations do not replace
   260 large hierarchies of concepts. Abbreviations do not replace
   261 definitions.
   261 definitions.
   262 
   262 
   263 Abbreviations are a simplified form of the general concept of
   263 Abbreviations are a simplified form of the general concept of
   264 \emph{syntax translations}; even heavier transformations may be
   264 \emph{syntax translations}; even heavier transformations may be
   265 written in ML \cite{isabelle-isar-ref}.
   265 written in ML @{cite "isabelle-isar-ref"}.
   266 *}
   266 *}
   267 
   267 
   268 
   268 
   269 section {* Document Preparation \label{sec:document-preparation} *}
   269 section {* Document Preparation \label{sec:document-preparation} *}
   270 
   270 
   349   \medskip The easiest way to manage Isabelle sessions is via
   349   \medskip The easiest way to manage Isabelle sessions is via
   350   \texttt{isabelle mkroot} (to generate an initial session source
   350   \texttt{isabelle mkroot} (to generate an initial session source
   351   setup) and \texttt{isabelle build} (to run sessions as specified in
   351   setup) and \texttt{isabelle build} (to run sessions as specified in
   352   the corresponding \texttt{ROOT} file).  These Isabelle tools are
   352   the corresponding \texttt{ROOT} file).  These Isabelle tools are
   353   described in further detail in the \emph{Isabelle System Manual}
   353   described in further detail in the \emph{Isabelle System Manual}
   354   \cite{isabelle-sys}.
   354   @{cite "isabelle-sys"}.
   355 
   355 
   356   For example, a new session \texttt{MySession} (with document
   356   For example, a new session \texttt{MySession} (with document
   357   preparation) may be produced as follows:
   357   preparation) may be produced as follows:
   358 
   358 
   359 \begin{verbatim}
   359 \begin{verbatim}
   410 
   410 
   411   \medskip Any additional files for the {\LaTeX} stage go into the
   411   \medskip Any additional files for the {\LaTeX} stage go into the
   412   \texttt{MySession/document} directory as well.  In particular,
   412   \texttt{MySession/document} directory as well.  In particular,
   413   adding a file named \texttt{root.bib} causes an automatic run of
   413   adding a file named \texttt{root.bib} causes an automatic run of
   414   \texttt{bibtex} to process a bibliographic database; see also
   414   \texttt{bibtex} to process a bibliographic database; see also
   415   \texttt{isabelle document} \cite{isabelle-sys}.
   415   \texttt{isabelle document} @{cite "isabelle-sys"}.
   416 
   416 
   417   \medskip Any failure of the document preparation phase in an
   417   \medskip Any failure of the document preparation phase in an
   418   Isabelle batch session leaves the generated sources in their target
   418   Isabelle batch session leaves the generated sources in their target
   419   location, identified by the accompanying error message.  This lets
   419   location, identified by the accompanying error message.  This lets
   420   you trace {\LaTeX} problems with the generated files at hand.
   420   you trace {\LaTeX} problems with the generated files at hand.
   524   text that are associated with formal Isabelle/Isar commands
   524   text that are associated with formal Isabelle/Isar commands
   525   (\bfindex{marginal comments}), or as standalone paragraphs within a
   525   (\bfindex{marginal comments}), or as standalone paragraphs within a
   526   theory or proof context (\bfindex{text blocks}).
   526   theory or proof context (\bfindex{text blocks}).
   527 
   527 
   528   \medskip Marginal comments are part of each command's concrete
   528   \medskip Marginal comments are part of each command's concrete
   529   syntax \cite{isabelle-isar-ref}; the common form is ``\verb,--,~$text$''
   529   syntax @{cite "isabelle-isar-ref"}; the common form is ``\verb,--,~$text$''
   530   where $text$ is delimited by \verb,",@{text \<dots>}\verb,", or
   530   where $text$ is delimited by \verb,",@{text \<dots>}\verb,", or
   531   \verb,{,\verb,*,~@{text \<dots>}~\verb,*,\verb,}, as before.  Multiple
   531   \verb,{,\verb,*,~@{text \<dots>}~\verb,*,\verb,}, as before.  Multiple
   532   marginal comments may be given at the same time.  Here is a simple
   532   marginal comments may be given at the same time.  Here is a simple
   533   example:
   533   example:
   534 *}
   534 *}
   610   may acquire different typings due to constraints imposed by their
   610   may acquire different typings due to constraints imposed by their
   611   environment; within a proof, for example, variables are given the
   611   environment; within a proof, for example, variables are given the
   612   same types as they have in the main goal statement.
   612   same types as they have in the main goal statement.
   613 
   613 
   614   \medskip Several further kinds of antiquotations and options are
   614   \medskip Several further kinds of antiquotations and options are
   615   available \cite{isabelle-isar-ref}.  Here are a few commonly used
   615   available @{cite "isabelle-isar-ref"}.  Here are a few commonly used
   616   combinations:
   616   combinations:
   617 
   617 
   618   \medskip
   618   \medskip
   619 
   619 
   620   \begin{tabular}{ll}
   620   \begin{tabular}{ll}
   659   As has been pointed out before (\S\ref{sec:syntax-symbols}),
   659   As has been pointed out before (\S\ref{sec:syntax-symbols}),
   660   Isabelle symbols are the smallest syntactic entities --- a
   660   Isabelle symbols are the smallest syntactic entities --- a
   661   straightforward generalization of ASCII characters.  While Isabelle
   661   straightforward generalization of ASCII characters.  While Isabelle
   662   does not impose any interpretation of the infinite collection of
   662   does not impose any interpretation of the infinite collection of
   663   named symbols, {\LaTeX} documents use canonical glyphs for certain
   663   named symbols, {\LaTeX} documents use canonical glyphs for certain
   664   standard symbols \cite{isabelle-isar-ref}.
   664   standard symbols @{cite "isabelle-isar-ref"}.
   665 
   665 
   666   The {\LaTeX} code produced from Isabelle text follows a simple
   666   The {\LaTeX} code produced from Isabelle text follows a simple
   667   scheme.  You can tune the final appearance by redefining certain
   667   scheme.  You can tune the final appearance by redefining certain
   668   macros, say in \texttt{root.tex} of the document.
   668   macros, say in \texttt{root.tex} of the document.
   669 
   669 
   749   Tags observe the structure of proofs; adjacent commands with the
   749   Tags observe the structure of proofs; adjacent commands with the
   750   same tag are joined into a single region.  The Isabelle document
   750   same tag are joined into a single region.  The Isabelle document
   751   preparation system allows the user to specify how to interpret a
   751   preparation system allows the user to specify how to interpret a
   752   tagged region, in order to keep, drop, or fold the corresponding
   752   tagged region, in order to keep, drop, or fold the corresponding
   753   parts of the document.  See the \emph{Isabelle System Manual}
   753   parts of the document.  See the \emph{Isabelle System Manual}
   754   \cite{isabelle-sys} for further details, especially on
   754   @{cite "isabelle-sys"} for further details, especially on
   755   \texttt{isabelle build} and \texttt{isabelle document}.
   755   \texttt{isabelle build} and \texttt{isabelle document}.
   756 
   756 
   757   Ignored material is specified by delimiting the original formal
   757   Ignored material is specified by delimiting the original formal
   758   source with special source comments
   758   source with special source comments
   759   \verb,(,\verb,*,\verb,<,\verb,*,\verb,), and
   759   \verb,(,\verb,*,\verb,<,\verb,*,\verb,), and