doc-src/TutorialI/Documents/Documents.thy
changeset 12746 892af6538f3d
parent 12744 8e1b3d425b71
child 12748 4cc93529646d
equal deleted inserted replaced
12745:d7b4d8c9bf86 12746:892af6538f3d
    51   applications with less than two operands there is a special notation
    51   applications with less than two operands there is a special notation
    52   with \isa{op} prefix: @{text xor} without arguments is represented
    52   with \isa{op} prefix: @{text xor} without arguments is represented
    53   as @{text "op [+]"}; together with plain prefix application this
    53   as @{text "op [+]"}; together with plain prefix application this
    54   turns @{text "xor A"} into @{text "op [+] A"}.
    54   turns @{text "xor A"} into @{text "op [+] A"}.
    55 
    55 
    56   \medskip The keyword \isakeyword{infixl} specifies an infix operator
    56   \medskip The keyword \isakeyword{infixl} seen above specifies an
    57   that is nested to the \emph{left}: in iterated applications the more
    57   infix operator that is nested to the \emph{left}: in iterated
    58   complex expression appears on the left-hand side: @{term "A [+] B
    58   applications the more complex expression appears on the left-hand
    59   [+] C"} stands for @{text "(A [+] B) [+] C"}.  Similarly,
    59   side, @{term "A [+] B [+] C"} stands for @{text "(A [+] B) [+] C"}.
    60   \isakeyword{infixr} specifies to nesting to the \emph{right},
    60   Similarly, \isakeyword{infixr} specifies nesting to the
    61   reading @{term "A [+] B [+] C"} as @{text "A [+] (B [+] C)"}.  In
    61   \emph{right}, reading @{term "A [+] B [+] C"} as @{text "A [+] (B
    62   contrast, a \emph{non-oriented} declaration via \isakeyword{infix}
    62   [+] C)"}.  In contrast, a \emph{non-oriented} declaration via
    63   would render @{term "A [+] B [+] C"} illegal, but demand explicit
    63   \isakeyword{infix} would render @{term "A [+] B [+] C"} illegal, but
    64   parentheses to indicate the intended grouping.
    64   demand explicit parentheses to indicate the intended grouping.
    65 
    65 
    66   The string @{text [source] "[+]"} in the above annotation refers to
    66   The string @{text [source] "[+]"} in our annotation refers to the
    67   the concrete syntax to represent the operator (a literal token),
    67   concrete syntax to represent the operator (a literal token), while
    68   while the number @{text 60} determines the precedence of the
    68   the number @{text 60} determines the precedence of the construct
    69   construct (i.e.\ the syntactic priorities of the arguments and
    69   (i.e.\ the syntactic priorities of the arguments and result).  As it
    70   result).  As it happens, Isabelle/HOL already uses up many popular
    70   happens, Isabelle/HOL already uses up many popular combinations of
    71   combinations of ASCII symbols for its own use, including both @{text
    71   ASCII symbols for its own use, including both @{text "+"} and @{text
    72   "+"} and @{text "++"}.  Slightly more awkward combinations like the
    72   "++"}.  As a rule of thumb, more awkward character combinations are
    73   present @{text "[+]"} tend to be available for user extensions.
    73   more likely to be still available for user extensions, just as our
       
    74   present @{text "[+]"}.
    74 
    75 
    75   Operator precedence also needs some special considerations.  The
    76   Operator precedence also needs some special considerations.  The
    76   admissible range is 0--1000.  Very low or high priorities are
    77   admissible range is 0--1000.  Very low or high priorities are
    77   basically reserved for the meta-logic.  Syntax of Isabelle/HOL
    78   basically reserved for the meta-logic.  Syntax of Isabelle/HOL
    78   mainly uses the range of 10--100: the equality infix @{text "="} is
    79   mainly uses the range of 10--100: the equality infix @{text "="} is
   143   \noindent The X-Symbol package within Proof~General provides several
   144   \noindent The X-Symbol package within Proof~General provides several
   144   input methods to enter @{text \<oplus>} in the text.  If all fails one may
   145   input methods to enter @{text \<oplus>} in the text.  If all fails one may
   145   just type a named entity \verb,\,\verb,<oplus>, by hand; the display
   146   just type a named entity \verb,\,\verb,<oplus>, by hand; the display
   146   will be adapted immediately after continuing input.
   147   will be adapted immediately after continuing input.
   147 
   148 
   148   \medskip A slightly more refined scheme is to provide alternative
   149   \medskip A slightly more refined scheme of providing alternative
   149   syntax via the \bfindex{print mode} concept of Isabelle (see also
   150   syntax forms uses the \bfindex{print mode} concept of Isabelle (see
   150   \cite{isabelle-ref}).  By convention, the mode of ``$xsymbols$'' is
   151   also \cite{isabelle-ref}).  By convention, the mode of
   151   enabled whenever Proof~General's X-Symbol mode (or {\LaTeX} output)
   152   ``$xsymbols$'' is enabled whenever Proof~General's X-Symbol mode or
   152   is active.  Now consider the following hybrid declaration of @{text
   153   {\LaTeX} output is active.  Now consider the following hybrid
   153   xor}.
   154   declaration of @{text xor}:
   154 *}
   155 *}
   155 
   156 
   156 (*<*)
   157 (*<*)
   157 hide const xor
   158 hide const xor
   158 ML_setup {* Context.>> (Theory.add_path "version2") *}
   159 ML_setup {* Context.>> (Theory.add_path "version2") *}
   168 (*>*)
   169 (*>*)
   169 
   170 
   170 text {*
   171 text {*
   171   The \commdx{syntax} command introduced here acts like
   172   The \commdx{syntax} command introduced here acts like
   172   \isakeyword{consts}, but without declaring a logical constant.  The
   173   \isakeyword{consts}, but without declaring a logical constant.  The
   173   print mode specification (here @{text "(xsymbols)"}) limits the
   174   print mode specification of \isakeyword{syntax}, here @{text
   174   effect of the syntax annotation concerning output; that alternative
   175   "(xsymbols)"}, is optional.  Also note that its type merely serves
   175   production available for input invariably.  Also note that the type
   176   for syntactic purposes, and is \emph{not} checked for consistency
   176   declaration in \isakeyword{syntax} merely serves for syntactic
   177   with the real constant.
   177   purposes, and is \emph{not} checked for consistency with the real
       
   178   constant.
       
   179 
   178 
   180   \medskip We may now write @{text "A [+] B"} or @{text "A \<oplus> B"} in
   179   \medskip We may now write @{text "A [+] B"} or @{text "A \<oplus> B"} in
   181   input, while output uses the nicer syntax of $xsymbols$, provided
   180   input, while output uses the nicer syntax of $xsymbols$, provided
   182   that print mode is active.  Such an arrangement is particularly
   181   that print mode is active.  Such an arrangement is particularly
   183   useful for interactive development, where users may type plain ASCII
   182   useful for interactive development, where users may type plain ASCII
   204 text {*
   203 text {*
   205   \noindent Here the mixfix annotations on the rightmost column happen
   204   \noindent Here the mixfix annotations on the rightmost column happen
   206   to consist of a single Isabelle symbol each: \verb,\,\verb,<euro>,,
   205   to consist of a single Isabelle symbol each: \verb,\,\verb,<euro>,,
   207   \verb,\,\verb,<pounds>,, \verb,\,\verb,<yen>,, and \verb,$,.  Recall
   206   \verb,\,\verb,<pounds>,, \verb,\,\verb,<yen>,, and \verb,$,.  Recall
   208   that a constructor like @{text Euro} actually is a function @{typ
   207   that a constructor like @{text Euro} actually is a function @{typ
   209   "nat \<Rightarrow> currency"}.  An expression like @{text "Euro 10"} will be
   208   "nat \<Rightarrow> currency"}.  The expression @{text "Euro 10"} will be
   210   printed as @{term "\<euro> 10"}; only the head of the application is
   209   printed as @{term "\<euro> 10"}; only the head of the application is
   211   subject to our concrete syntax.  This rather simple form already
   210   subject to our concrete syntax.  This rather simple form already
   212   achieves conformance with notational standards of the European
   211   achieves conformance with notational standards of the European
   213   Commission.
   212   Commission.
   214 
   213 
   233   expressions.  This essentially provides a simple mechanism for
   232   expressions.  This essentially provides a simple mechanism for
   234   syntactic macros; even heavier transformations may be written in ML
   233   syntactic macros; even heavier transformations may be written in ML
   235   \cite{isabelle-ref}.
   234   \cite{isabelle-ref}.
   236 
   235 
   237   \medskip A typical example of syntax translations is to decorate
   236   \medskip A typical example of syntax translations is to decorate
   238   relational expressions (i.e.\ set-membership of tuples) with nice
   237   relational expressions (set-membership of tuples) with symbolic
   239   symbolic notation, such as @{text "(x, y) \<in> sim"} versus @{text "x
   238   notation, e.g.\ @{text "(x, y) \<in> sim"} versus @{text "x \<approx> y"}.
   240   \<approx> y"}.
       
   241 *}
   239 *}
   242 
   240 
   243 consts
   241 consts
   244   sim :: "('a \<times> 'a) set"
   242   sim :: "('a \<times> 'a) set"
   245 
   243 
   293 
   291 
   294   \medskip The Isabelle document preparation system essentially acts
   292   \medskip The Isabelle document preparation system essentially acts
   295   as a front-end to {\LaTeX}.  After checking specifications and
   293   as a front-end to {\LaTeX}.  After checking specifications and
   296   proofs formally, the theory sources are turned into typesetting
   294   proofs formally, the theory sources are turned into typesetting
   297   instructions in a schematic manner.  This enables users to write
   295   instructions in a schematic manner.  This enables users to write
   298   authentic reports on theory developments with little effort, where
   296   authentic reports on theory developments with little effort --- many
   299   most consistency checks are handled by the system.
   297   technical consistency checks are handled by the system.
   300 
   298 
   301   Here is an example to illustrate the idea of Isabelle document
   299   Here is an example to illustrate the idea of Isabelle document
   302   preparation.
   300   preparation.
   303 
   301 *}
   304   \bigskip The following datatype definition of @{text "'a bintree"}
   302 
   305   models binary trees with nodes being decorated by elements of type
   303 text_raw {* \begin{quotation} *}
   306   @{typ 'a}.
   304 
       
   305 text {*
       
   306   The following datatype definition of @{text "'a bintree"} models
       
   307   binary trees with nodes being decorated by elements of type @{typ
       
   308   'a}.
   307 *}
   309 *}
   308 
   310 
   309 datatype 'a bintree =
   311 datatype 'a bintree =
   310   Leaf | Branch 'a  "'a bintree"  "'a bintree"
   312      Leaf | Branch 'a  "'a bintree"  "'a bintree"
   311 
   313 
   312 text {*
   314 text {*
   313   \noindent The datatype induction rule generated here is of the form
   315   \noindent The datatype induction rule generated here is of the form
   314   @{thm [display] bintree.induct [no_vars]}
   316   @{thm [indent = 1, display] bintree.induct [no_vars]}
   315 
   317 *}
   316   \bigskip The above document output has been produced by the
   318 
   317   following theory specification:
   319 text_raw {* \end{quotation} *}
       
   320 
       
   321 text {*
       
   322   The above document output has been produced by the following theory
       
   323   specification:
   318 
   324 
   319   \begin{ttbox}
   325   \begin{ttbox}
   320   text {\ttlbrace}*
   326   text {\ttlbrace}*
   321     The following datatype definition of {\at}{\ttlbrace}text "'a bintree"{\ttrbrace}
   327     The following datatype definition of {\at}{\ttlbrace}text "'a bintree"{\ttrbrace}
   322     models binary trees with nodes being decorated by elements
   328     models binary trees with nodes being decorated by elements
   330     {\ttback}noindent The datatype induction rule generated here is
   336     {\ttback}noindent The datatype induction rule generated here is
   331     of the form {\at}{\ttlbrace}thm [display] bintree.induct [no_vars]{\ttrbrace}
   337     of the form {\at}{\ttlbrace}thm [display] bintree.induct [no_vars]{\ttrbrace}
   332   *{\ttrbrace}
   338   *{\ttrbrace}
   333   \end{ttbox}
   339   \end{ttbox}
   334 
   340 
   335   Here we have augmented the theory by formal comments (via
   341   \noindent Here we have augmented the theory by formal comments
   336   \isakeyword{text} blocks).  The informal parts may again refer to
   342   (using \isakeyword{text} blocks).  The informal parts may again
   337   formal entities by means of ``antiquotations'' (such as
   343   refer to formal entities by means of ``antiquotations'' (such as
   338   \texttt{\at}\verb,{text "'a bintree"}, or
   344   \texttt{\at}\verb,{text "'a bintree"}, or
   339   \texttt{\at}\verb,{typ 'a},; see also \S\ref{sec:doc-prep-text}.
   345   \texttt{\at}\verb,{typ 'a},), see also \S\ref{sec:doc-prep-text}.
   340 *}
   346 *}
   341 
   347 
   342 
   348 
   343 subsection {* Isabelle Sessions *}
   349 subsection {* Isabelle Sessions *}
   344 
   350 
   372   make sure that \texttt{pdflatex} is present; if all fails one may
   378   make sure that \texttt{pdflatex} is present; if all fails one may
   373   fall back on DVI output by changing \texttt{usedir} options in
   379   fall back on DVI output by changing \texttt{usedir} options in
   374   \texttt{IsaMakefile} \cite{isabelle-sys}.}
   380   \texttt{IsaMakefile} \cite{isabelle-sys}.}
   375 
   381 
   376   \medskip The detailed arrangement of the session sources is as
   382   \medskip The detailed arrangement of the session sources is as
   377   follows.  This may be ignored in the beginning, but some of these
   383   follows.
   378   files need to be edited in realistic applications.
       
   379 
   384 
   380   \begin{itemize}
   385   \begin{itemize}
   381 
   386 
   382   \item Directory \texttt{MySession} holds the required theory files
   387   \item Directory \texttt{MySession} holds the required theory files
   383   $T@1$\texttt{.thy}, \dots, $T@n$\texttt{.thy}.
   388   $T@1$\texttt{.thy}, \dots, $T@n$\texttt{.thy}.
   393 
   398 
   394   The latter file holds appropriate {\LaTeX} code to commence a
   399   The latter file holds appropriate {\LaTeX} code to commence a
   395   document (\verb,\documentclass, etc.), and to include the generated
   400   document (\verb,\documentclass, etc.), and to include the generated
   396   files $T@i$\texttt{.tex} for each theory.  Isabelle will generate a
   401   files $T@i$\texttt{.tex} for each theory.  Isabelle will generate a
   397   file \texttt{session.tex} holding {\LaTeX} commands to include all
   402   file \texttt{session.tex} holding {\LaTeX} commands to include all
   398   generated theory output files in topologically sorted order.  So
   403   generated theory output files in topologically sorted order, so
   399   \verb,\input{session}, in \texttt{root.tex} does the job in most
   404   \verb,\input{session}, in the body of \texttt{root.tex} does the job
   400   situations.
   405   in most situations.
   401 
   406 
   402   \item \texttt{IsaMakefile} holds appropriate dependencies and
   407   \item \texttt{IsaMakefile} holds appropriate dependencies and
   403   invocations of Isabelle tools to control the batch job.  In fact,
   408   invocations of Isabelle tools to control the batch job.  In fact,
   404   several sessions may be controlled by the same \texttt{IsaMakefile}.
   409   several sessions may be managed by the same \texttt{IsaMakefile}.
   405   See also \cite{isabelle-sys} for further details, especially on
   410   See also \cite{isabelle-sys} for further details, especially on
   406   \texttt{isatool usedir} and \texttt{isatool make}.
   411   \texttt{isatool usedir} and \texttt{isatool make}.
   407 
   412 
   408   \end{itemize}
   413   \end{itemize}
   409 
   414 
   420   symbols), and the final \texttt{pdfsetup} (provides sane defaults
   425   symbols), and the final \texttt{pdfsetup} (provides sane defaults
   421   for \texttt{hyperref}, including URL markup) --- all three are
   426   for \texttt{hyperref}, including URL markup) --- all three are
   422   distributed with Isabelle. Further packages may be required in
   427   distributed with Isabelle. Further packages may be required in
   423   particular applications, e.g.\ for unusual mathematical symbols.
   428   particular applications, e.g.\ for unusual mathematical symbols.
   424 
   429 
   425   \medskip Additional files for the {\LaTeX} stage may be put into the
   430   \medskip Any additional files for the {\LaTeX} stage go into the
   426   \texttt{MySession/document} directory, too.  In particular, adding
   431   \texttt{MySession/document} directory as well.  In particular,
   427   \texttt{root.bib} here (with that specific name) causes an automatic
   432   adding \texttt{root.bib} (with that specific name) causes an
   428   run of \texttt{bibtex} to process a bibliographic database; see also
   433   automatic run of \texttt{bibtex} to process a bibliographic
   429   \texttt{isatool document} covered in \cite{isabelle-sys}.
   434   database; see also \texttt{isatool document} in \cite{isabelle-sys}.
   430 
   435 
   431   \medskip Any failure of the document preparation phase in an
   436   \medskip Any failure of the document preparation phase in an
   432   Isabelle batch session leaves the generated sources in their target
   437   Isabelle batch session leaves the generated sources in their target
   433   location (as pointed out by the accompanied error message).  This
   438   location (as pointed out by the accompanied error message).  This
   434   enables users to trace {\LaTeX} problems with the target files at
   439   enables users to trace {\LaTeX} problems with the generated files at
   435   hand.
   440   hand.
   436 *}
   441 *}
   437 
   442 
   438 
   443 
   439 subsection {* Structure Markup *}
   444 subsection {* Structure Markup *}
   462   \end{tabular}
   467   \end{tabular}
   463 
   468 
   464   \medskip
   469   \medskip
   465 
   470 
   466   From the Isabelle perspective, each markup command takes a single
   471   From the Isabelle perspective, each markup command takes a single
   467   $text$ argument (delimited by \verb,",\dots\verb,", or
   472   $text$ argument (delimited by \verb,",~@{text \<dots>}~\verb,", or
   468   \verb,{,\verb,*,~\dots~\verb,*,\verb,},).  After stripping any
   473   \verb,{,\verb,*,~@{text \<dots>}~\verb,*,\verb,},).  After stripping any
   469   surrounding white space, the argument is passed to a {\LaTeX} macro
   474   surrounding white space, the argument is passed to a {\LaTeX} macro
   470   \verb,\isamarkupXYZ, for any command \isakeyword{XYZ}.  These macros
   475   \verb,\isamarkupXYZ, for any command \isakeyword{XYZ}.  These macros
   471   are defined in \verb,isabelle.sty, according to the meaning given in
   476   are defined in \verb,isabelle.sty, according to the meaning given in
   472   the rightmost column above.
   477   the rightmost column above.
   473 
   478 
   531 
   536 
   532 subsection {* Formal Comments and Antiquotations \label{sec:doc-prep-text} *}
   537 subsection {* Formal Comments and Antiquotations \label{sec:doc-prep-text} *}
   533 
   538 
   534 text {*
   539 text {*
   535   Isabelle \bfindex{source comments}, which are of the form
   540   Isabelle \bfindex{source comments}, which are of the form
   536   \verb,(,\verb,*,~\dots~\verb,*,\verb,),, essentially act like white
   541   \verb,(,\verb,*,~@{text \<dots>}~\verb,*,\verb,),, essentially act like
   537   space and do not really contribute to the content.  They mainly
   542   white space and do not really contribute to the content.  They
   538   serve technical purposes to mark certain oddities in the raw input
   543   mainly serve technical purposes to mark certain oddities in the raw
   539   text.  In contrast, \bfindex{formal comments} are portions of text
   544   input text.  In contrast, \bfindex{formal comments} are portions of
   540   that are associated with formal Isabelle/Isar commands
   545   text that are associated with formal Isabelle/Isar commands
   541   (\bfindex{marginal comments}), or as standalone paragraphs within a
   546   (\bfindex{marginal comments}), or as standalone paragraphs within a
   542   theory or proof context (\bfindex{text blocks}).
   547   theory or proof context (\bfindex{text blocks}).
   543 
   548 
   544   \medskip Marginal comments are part of each command's concrete
   549   \medskip Marginal comments are part of each command's concrete
   545   syntax \cite{isabelle-ref}; the common form is ``\verb,--,~$text$''
   550   syntax \cite{isabelle-ref}; the common form is ``\verb,--,~$text$''
   546   where $text$ is delimited by \verb,",\dots\verb,", or
   551   where $text$ is delimited by \verb,",@{text \<dots>}\verb,", or
   547   \verb,{,\verb,*,~\dots~\verb,*,\verb,}, as before.  Multiple
   552   \verb,{,\verb,*,~@{text \<dots>}~\verb,*,\verb,}, as before.  Multiple
   548   marginal comments may be given at the same time.  Here is a simple
   553   marginal comments may be given at the same time.  Here is a simple
   549   example:
   554   example:
   550 *}
   555 *}
   551 
   556 
   552 lemma "A --> A"
   557 lemma "A --> A"
   575   vertical space).  This behavior may be changed by redefining the
   580   vertical space).  This behavior may be changed by redefining the
   576   {\LaTeX} environments of \verb,isamarkuptext, or
   581   {\LaTeX} environments of \verb,isamarkuptext, or
   577   \verb,isamarkuptxt,, respectively (via \verb,\renewenvironment,) The
   582   \verb,isamarkuptxt,, respectively (via \verb,\renewenvironment,) The
   578   text style of the body is determined by \verb,\isastyletext, and
   583   text style of the body is determined by \verb,\isastyletext, and
   579   \verb,\isastyletxt,; the default setup uses a smaller font within
   584   \verb,\isastyletxt,; the default setup uses a smaller font within
   580   proofs.
   585   proofs.  This may be changed as follows:
       
   586 
       
   587 \begin{verbatim}
       
   588   \renewcommand{\isastyletxt}{\isastyletext}
       
   589 \end{verbatim}
   581 
   590 
   582   \medskip The $text$ part of each of the various markup commands
   591   \medskip The $text$ part of each of the various markup commands
   583   considered so far essentially inserts \emph{quoted material} into a
   592   considered so far essentially inserts \emph{quoted material} into a
   584   formal text, mainly for instruction of the reader.  An
   593   formal text, mainly for instruction of the reader.  An
   585   \bfindex{antiquotation} is again a formal object embedded into such
   594   \bfindex{antiquotation} is again a formal object embedded into such
   586   an informal portion.  The interpretation of antiquotations is
   595   an informal portion.  The interpretation of antiquotations is
   587   limited to some well-formedness checks, with the result being pretty
   596   limited to some well-formedness checks, with the result being pretty
   588   printed to the resulting document.  So quoted text blocks together
   597   printed to the resulting document.  Quoted text blocks together with
   589   with antiquotations provide very useful means to reference formal
   598   antiquotations provide very useful means to reference formal
   590   entities with good confidence in getting the technical details right
   599   entities, with good confidence in getting the technical details
   591   (especially syntax and types).
   600   right (especially syntax and types).
   592 
   601 
   593   The general syntax of antiquotations is as follows:
   602   The general syntax of antiquotations is as follows:
   594   \texttt{{\at}{\ttlbrace}$name$ $arguments${\ttrbrace}}, or
   603   \texttt{{\at}{\ttlbrace}$name$ $arguments${\ttrbrace}}, or
   595   \texttt{{\at}{\ttlbrace}$name$ [$options$] $arguments${\ttrbrace}}
   604   \texttt{{\at}{\ttlbrace}$name$ [$options$] $arguments${\ttrbrace}}
   596   for a comma-separated list of options consisting of a $name$ or
   605   for a comma-separated list of options consisting of a $name$ or
   635   \texttt{\at}\verb,{prop,~$\phi$\verb,}, & print proposition $\phi$ \\
   644   \texttt{\at}\verb,{prop,~$\phi$\verb,}, & print proposition $\phi$ \\
   636   \texttt{\at}\verb,{prop [display],~$\phi$\verb,}, & print large proposition $\phi$ (with linebreaks) \\
   645   \texttt{\at}\verb,{prop [display],~$\phi$\verb,}, & print large proposition $\phi$ (with linebreaks) \\
   637   \texttt{\at}\verb,{prop [source],~$\phi$\verb,}, & check proposition $\phi$, print its input \\
   646   \texttt{\at}\verb,{prop [source],~$\phi$\verb,}, & check proposition $\phi$, print its input \\
   638   \texttt{\at}\verb,{thm,~$a$\verb,}, & print fact $a$ \\
   647   \texttt{\at}\verb,{thm,~$a$\verb,}, & print fact $a$ \\
   639   \texttt{\at}\verb,{thm,~$a$~\verb,[no_vars]}, & print fact $a$, fixing schematic variables \\
   648   \texttt{\at}\verb,{thm,~$a$~\verb,[no_vars]}, & print fact $a$, fixing schematic variables \\
   640   \texttt{\at}\verb,{thm [source],~$a$\verb,}, & check availability of fact, print name $a$ \\
   649   \texttt{\at}\verb,{thm [source],~$a$\verb,}, & check availability of fact $a$, print its name \\
   641   \texttt{\at}\verb,{text,~$s$\verb,}, & print uninterpreted text $s$ \\
   650   \texttt{\at}\verb,{text,~$s$\verb,}, & print uninterpreted text $s$ \\
   642   \end{tabular}
   651   \end{tabular}
   643 
   652 
   644   \medskip
   653   \medskip
   645 
   654 
   678   redefining certain macros, say in \texttt{root.tex} of the document.
   687   redefining certain macros, say in \texttt{root.tex} of the document.
   679 
   688 
   680   \begin{enumerate}
   689   \begin{enumerate}
   681 
   690 
   682   \item 7-bit ASCII characters: letters \texttt{A\dots Z} and
   691   \item 7-bit ASCII characters: letters \texttt{A\dots Z} and
   683   \texttt{a\dots z} are output verbatim, digits are passed as an
   692   \texttt{a\dots z} are output directly, digits are passed as an
   684   argument to the \verb,\isadigit, macro, other characters are
   693   argument to the \verb,\isadigit, macro, other characters are
   685   replaced by specifically named macros of the form
   694   replaced by specifically named macros of the form
   686   \verb,\isacharXYZ,.
   695   \verb,\isacharXYZ,.
   687 
   696 
   688   \item Named symbols: \verb,\,\verb,<,$XYZ$\verb,>, become
   697   \item Named symbols: \verb,\,\verb,<,$XYZ$\verb,>, is turned into
   689   \verb,{\isasym,$XYZ$\verb,}, each (note the additional braces).
   698   \verb,{\isasym,$XYZ$\verb,},; note the additional braces.
   690 
   699 
   691   \item Named control symbols: \verb,{\isasym,$XYZ$\verb,}, become
   700   \item Named control symbols: \verb,\,\verb,<^,$XYZ$\verb,>, is
   692   \verb,\isactrl,$XYZ$ each; subsequent symbols may act as arguments
   701   turned into \verb,\isactrl,$XYZ$; subsequent symbols may act as
   693   if the corresponding macro is defined accordingly.
   702   arguments if the corresponding macro is defined accordingly.
   694 
   703 
   695   \end{enumerate}
   704   \end{enumerate}
   696 
   705 
   697   Users may occasionally wish to give new {\LaTeX} interpretations of
   706   Users may occasionally wish to give new {\LaTeX} interpretations of
   698   named symbols; this merely requires an appropriate definition of
   707   named symbols; this merely requires an appropriate definition of
   699   \verb,\,\verb,<,$XYZ$\verb,>, (see \texttt{isabelle.sty} for working
   708   \verb,\isasym,$XYZ$\verb,, for \verb,\,\verb,<,$XYZ$\verb,>, (see
   700   examples).  Control symbols are slightly more difficult to get
   709   \texttt{isabelle.sty} for working examples).  Control symbols are
   701   right, though.
   710   slightly more difficult to get right, though.
   702 
   711 
   703   \medskip The \verb,\isabellestyle, macro provides a high-level
   712   \medskip The \verb,\isabellestyle, macro provides a high-level
   704   interface to tune the general appearance of individual symbols.  For
   713   interface to tune the general appearance of individual symbols.  For
   705   example, \verb,\isabellestyle{it}, uses the italics text style to
   714   example, \verb,\isabellestyle{it}, uses the italics text style to
   706   mimic the general appearance of the {\LaTeX} math mode; double
   715   mimic the general appearance of the {\LaTeX} math mode; double
   716   By default, Isabelle's document system generates a {\LaTeX} source
   725   By default, Isabelle's document system generates a {\LaTeX} source
   717   file for each theory that gets loaded while running the session.
   726   file for each theory that gets loaded while running the session.
   718   The generated \texttt{session.tex} will include all of these in
   727   The generated \texttt{session.tex} will include all of these in
   719   order of appearance, which in turn gets included by the standard
   728   order of appearance, which in turn gets included by the standard
   720   \texttt{root.tex}.  Certainly one may change the order or suppress
   729   \texttt{root.tex}.  Certainly one may change the order or suppress
   721   unwanted theories by ignoring \texttt{session.tex} and include
   730   unwanted theories by ignoring \texttt{session.tex} and load
   722   individual files in \texttt{root.tex} by hand.  On the other hand,
   731   individual files directly in \texttt{root.tex}.  On the other hand,
   723   such an arrangement requires additional maintenance chores whenever
   732   such an arrangement requires additional maintenance whenever the
   724   the collection of theories changes.
   733   collection of theories changes.
   725 
   734 
   726   Alternatively, one may tune the theory loading process in
   735   Alternatively, one may tune the theory loading process in
   727   \texttt{ROOT.ML} itself: traversal of the theory dependency graph
   736   \texttt{ROOT.ML} itself: traversal of the theory dependency graph
   728   may be fine-tuned by adding \verb,use_thy, invocations, although
   737   may be fine-tuned by adding \verb,use_thy, invocations, although
   729   topological sorting still has to be observed.  Moreover, the ML
   738   topological sorting still has to be observed.  Moreover, the ML
   739   formal content in full.  In order to delimit \bfindex{ignored
   748   formal content in full.  In order to delimit \bfindex{ignored
   740   material} special source comments
   749   material} special source comments
   741   \verb,(,\verb,*,\verb,<,\verb,*,\verb,), and
   750   \verb,(,\verb,*,\verb,<,\verb,*,\verb,), and
   742   \verb,(,\verb,*,\verb,>,\verb,*,\verb,), may be included in the
   751   \verb,(,\verb,*,\verb,>,\verb,*,\verb,), may be included in the
   743   text.  Only the document preparation system is affected, the formal
   752   text.  Only the document preparation system is affected, the formal
   744   checking the theory is performed unchanged.
   753   checking of the theory is performed unchanged.
   745 
   754 
   746   In the following example we suppress the slightly formalistic
   755   In the subsequent example we suppress the slightly formalistic
   747   \isakeyword{theory} + \isakeyword{end} surroundings a theory.
   756   \isakeyword{theory} + \isakeyword{end} surroundings a theory.
   748 
   757 
   749   \medskip
   758   \medskip
   750 
   759 
   751   \begin{tabular}{l}
   760   \begin{tabular}{l}
   759   \end{tabular}
   768   \end{tabular}
   760 
   769 
   761   \medskip
   770   \medskip
   762 
   771 
   763   Text may be suppressed in a fine-grained manner.  We may even drop
   772   Text may be suppressed in a fine-grained manner.  We may even drop
   764   vital parts of a formal proof, pretending that things have been
   773   vital parts of a proof, pretending that things have been simpler
   765   simpler than in reality.  For example, the following ``fully
   774   than in reality.  For example, this ``fully automatic'' proof is
   766   automatic'' proof is actually a fake:
   775   actually a fake:
   767 *}
   776 *}
   768 
   777 
   769 lemma "x \<noteq> (0::int) \<Longrightarrow> 0 < x * x"
   778 lemma "x \<noteq> (0::int) \<Longrightarrow> 0 < x * x"
   770   by (auto(*<*)simp add: int_less_le(*>*))
   779   by (auto(*<*)simp add: int_less_le(*>*))
   771 
   780 
   776   by (auto(*<*)simp add: int_less_le(*>*))
   785   by (auto(*<*)simp add: int_less_le(*>*))
   777 \end{verbatim}
   786 \end{verbatim}
   778 %(*
   787 %(*
   779 
   788 
   780   \medskip Ignoring portions of printed text does demand some care by
   789   \medskip Ignoring portions of printed text does demand some care by
   781   the writer.  First of all, the writer is responsible not to
   790   the writer.  First of all, the user is responsible not to obfuscate
   782   obfuscate the underlying formal development in an unduly manner.  It
   791   the underlying theory development in an unduly manner.  It is fairly
   783   is fairly easy to invalidate the remaining visible text, e.g.\ by
   792   easy to invalidate the visible text, e.g.\ by referencing
   784   referencing questionable formal items (strange definitions,
   793   questionable formal items (strange definitions, arbitrary axioms
   785   arbitrary axioms etc.) that have been hidden from sight beforehand.
   794   etc.) that have been hidden from sight beforehand.
   786 
   795 
   787   Authentic reports of formal theories, say as part of a library,
   796   Authentic reports of Isabelle/Isar theories, say as part of a
   788   should refrain from suppressing parts of the text at all.  Other
   797   library, should refrain from suppressing parts of the text at all.
   789   users may need the full information for their own derivative work.
   798   Other users may need the full information for their own derivative
   790   If a particular formalization appears inadequate for general public
   799   work.  If a particular formalization appears inadequate for general
   791   coverage, it is often more appropriate to think of a better way in
   800   public coverage, it is often more appropriate to think of a better
   792   the first place.
   801   way in the first place.
   793 
   802 
   794   \medskip Some technical subtleties of the
   803   \medskip Some technical subtleties of the
   795   \verb,(,\verb,*,\verb,<,\verb,*,\verb,),~\verb,(,\verb,*,\verb,>,\verb,*,\verb,),
   804   \verb,(,\verb,*,\verb,<,\verb,*,\verb,),~\verb,(,\verb,*,\verb,>,\verb,*,\verb,),
   796   elements need to be kept in mind, too --- the system performs little
   805   elements need to be kept in mind, too --- the system performs little
   797   sanity checks here.  Arguments of markup commands and formal
   806   sanity checks here.  Arguments of markup commands and formal