src/Doc/Tutorial/Documents/Documents.thy
changeset 50069 a10fc2bd3182
parent 48985 5386df44a037
child 51057 a22b134f862e
equal deleted inserted replaced
50068:310e9b810bbf 50069:a10fc2bd3182
     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-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 
   152   @{text \<oplus>} in the text.  If all fails one may just type a named
   152   @{text \<oplus>} in the text.  If all fails one may just type a named
   153   entity \verb,\,\verb,<oplus>, by hand; the corresponding symbol will
   153   entity \verb,\,\verb,<oplus>, by hand; the corresponding symbol will
   154   be displayed after further input.
   154   be displayed after further input.
   155 
   155 
   156   More flexible is to provide alternative syntax forms
   156   More flexible is to provide alternative syntax forms
   157   through the \bfindex{print mode} concept~\cite{isabelle-ref}.  By
   157   through the \bfindex{print mode} concept~\cite{isabelle-isar-ref}.  By
   158   convention, the mode of ``$xsymbols$'' is enabled whenever
   158   convention, the mode of ``$xsymbols$'' is enabled whenever
   159   Proof~General's X-Symbol mode or {\LaTeX} output is active.  Now
   159   Proof~General's X-Symbol mode or {\LaTeX} output is active.  Now
   160   consider the following hybrid declaration of @{text xor}:
   160   consider the following hybrid declaration of @{text xor}:
   161 *}
   161 *}
   162 
   162 
   186 
   186 
   187 subsection {* Prefix Annotations *}
   187 subsection {* Prefix Annotations *}
   188 
   188 
   189 text {*
   189 text {*
   190   Prefix syntax annotations\index{prefix annotation} are another form
   190   Prefix syntax annotations\index{prefix annotation} are another form
   191   of mixfixes \cite{isabelle-ref}, without any template arguments or
   191   of mixfixes \cite{isabelle-isar-ref}, without any template arguments or
   192   priorities --- just some literal syntax.  The following example
   192   priorities --- just some literal syntax.  The following example
   193   associates common symbols with the constructors of a datatype.
   193   associates common symbols with the constructors of a datatype.
   194 *}
   194 *}
   195 
   195 
   196 datatype currency =
   196 datatype currency =
   261 large hierarchies of concepts. Abbreviations do not replace
   261 large hierarchies of concepts. Abbreviations do not replace
   262 definitions.
   262 definitions.
   263 
   263 
   264 Abbreviations are a simplified form of the general concept of
   264 Abbreviations are a simplified form of the general concept of
   265 \emph{syntax translations}; even heavier transformations may be
   265 \emph{syntax translations}; even heavier transformations may be
   266 written in ML \cite{isabelle-ref}.
   266 written in ML \cite{isabelle-isar-ref}.
   267 *}
   267 *}
   268 
   268 
   269 
   269 
   270 section {* Document Preparation \label{sec:document-preparation} *}
   270 section {* Document Preparation \label{sec:document-preparation} *}
   271 
   271 
   529   text that are associated with formal Isabelle/Isar commands
   529   text that are associated with formal Isabelle/Isar commands
   530   (\bfindex{marginal comments}), or as standalone paragraphs within a
   530   (\bfindex{marginal comments}), or as standalone paragraphs within a
   531   theory or proof context (\bfindex{text blocks}).
   531   theory or proof context (\bfindex{text blocks}).
   532 
   532 
   533   \medskip Marginal comments are part of each command's concrete
   533   \medskip Marginal comments are part of each command's concrete
   534   syntax \cite{isabelle-ref}; the common form is ``\verb,--,~$text$''
   534   syntax \cite{isabelle-isar-ref}; the common form is ``\verb,--,~$text$''
   535   where $text$ is delimited by \verb,",@{text \<dots>}\verb,", or
   535   where $text$ is delimited by \verb,",@{text \<dots>}\verb,", or
   536   \verb,{,\verb,*,~@{text \<dots>}~\verb,*,\verb,}, as before.  Multiple
   536   \verb,{,\verb,*,~@{text \<dots>}~\verb,*,\verb,}, as before.  Multiple
   537   marginal comments may be given at the same time.  Here is a simple
   537   marginal comments may be given at the same time.  Here is a simple
   538   example:
   538   example:
   539 *}
   539 *}