doc-src/IsarRef/Thy/document/pure.tex
changeset 26902 8db1e960d636
parent 26895 d066f9db833b
child 26907 75466ad27dd7
equal deleted inserted replaced
26901:d1694ef6e7a7 26902:8db1e960d636
    56 }
    56 }
    57 \isamarkuptrue%
    57 \isamarkuptrue%
    58 %
    58 %
    59 \begin{isamarkuptext}%
    59 \begin{isamarkuptext}%
    60 \begin{matharray}{rcl}
    60 \begin{matharray}{rcl}
    61     \indexdef{}{command}{chapter}\mbox{\isa{\isacommand{chapter}}} & : & \isarkeep{local{\dsh}theory} \\
    61     \indexdef{}{command}{chapter}\hypertarget{command.chapter}{\hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}} & : & \isarkeep{local{\dsh}theory} \\
    62     \indexdef{}{command}{section}\mbox{\isa{\isacommand{section}}} & : & \isarkeep{local{\dsh}theory} \\
    62     \indexdef{}{command}{section}\hypertarget{command.section}{\hyperlink{command.section}{\mbox{\isa{\isacommand{section}}}}} & : & \isarkeep{local{\dsh}theory} \\
    63     \indexdef{}{command}{subsection}\mbox{\isa{\isacommand{subsection}}} & : & \isarkeep{local{\dsh}theory} \\
    63     \indexdef{}{command}{subsection}\hypertarget{command.subsection}{\hyperlink{command.subsection}{\mbox{\isa{\isacommand{subsection}}}}} & : & \isarkeep{local{\dsh}theory} \\
    64     \indexdef{}{command}{subsubsection}\mbox{\isa{\isacommand{subsubsection}}} & : & \isarkeep{local{\dsh}theory} \\
    64     \indexdef{}{command}{subsubsection}\hypertarget{command.subsubsection}{\hyperlink{command.subsubsection}{\mbox{\isa{\isacommand{subsubsection}}}}} & : & \isarkeep{local{\dsh}theory} \\
    65     \indexdef{}{command}{text}\mbox{\isa{\isacommand{text}}} & : & \isarkeep{local{\dsh}theory} \\
    65     \indexdef{}{command}{text}\hypertarget{command.text}{\hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}}} & : & \isarkeep{local{\dsh}theory} \\
    66     \indexdef{}{command}{text\_raw}\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}} & : & \isarkeep{local{\dsh}theory} \\
    66     \indexdef{}{command}{text\_raw}\hypertarget{command.text_raw}{\hyperlink{command.text_raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}} & : & \isarkeep{local{\dsh}theory} \\
    67   \end{matharray}
    67   \end{matharray}
    68 
    68 
    69   Apart from formal comments (see \secref{sec:comments}), markup
    69   Apart from formal comments (see \secref{sec:comments}), markup
    70   commands provide a structured way to insert text into the document
    70   commands provide a structured way to insert text into the document
    71   generated from a theory (see \cite{isabelle-sys} for more
    71   generated from a theory (see \cite{isabelle-sys} for more
    78     ;
    78     ;
    79   \end{rail}
    79   \end{rail}
    80 
    80 
    81   \begin{descr}
    81   \begin{descr}
    82 
    82 
    83   \item [\mbox{\isa{\isacommand{chapter}}}, \mbox{\isa{\isacommand{section}}}, \mbox{\isa{\isacommand{subsection}}}, and \mbox{\isa{\isacommand{subsubsection}}}] mark chapter and
    83   \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
    84   section headings.
    84   section headings.
    85 
    85 
    86   \item [\mbox{\isa{\isacommand{text}}}] specifies paragraphs of plain text.
    86   \item [\hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}}] specifies paragraphs of plain text.
    87 
    87 
    88   \item [\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}] inserts {\LaTeX} source into the
    88   \item [\hyperlink{command.text_raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}] inserts {\LaTeX} source into the
    89   output, without additional markup.  Thus the full range of document
    89   output, without additional markup.  Thus the full range of document
    90   manipulations becomes available.
    90   manipulations becomes available.
    91 
    91 
    92   \end{descr}
    92   \end{descr}
    93 
    93 
    94   The \isa{{\isachardoublequote}text{\isachardoublequote}} argument of these markup commands (except for
    94   The \isa{{\isachardoublequote}text{\isachardoublequote}} argument of these markup commands (except for
    95   \mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}) may contain references to formal entities
    95   \hyperlink{command.text_raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}) may contain references to formal entities
    96   (``antiquotations'', see also \secref{sec:antiq}).  These are
    96   (``antiquotations'', see also \secref{sec:antiq}).  These are
    97   interpreted in the present theory context, or the named \isa{{\isachardoublequote}target{\isachardoublequote}}.
    97   interpreted in the present theory context, or the named \isa{{\isachardoublequote}target{\isachardoublequote}}.
    98 
    98 
    99   Any of these markup elements corresponds to a {\LaTeX} command with
    99   Any of these markup elements corresponds to a {\LaTeX} command with
   100   the name prefixed by \verb|\isamarkup|.  For the sectioning
   100   the name prefixed by \verb|\isamarkup|.  For the sectioning
   101   commands this is a plain macro with a single argument, e.g.\
   101   commands this is a plain macro with a single argument, e.g.\
   102   \verb|\isamarkupchapter{|\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}\verb|}| for
   102   \verb|\isamarkupchapter{|\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}\verb|}| for
   103   \mbox{\isa{\isacommand{chapter}}}.  The \mbox{\isa{\isacommand{text}}} markup results in a
   103   \hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}.  The \hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}} markup results in a
   104   {\LaTeX} environment \verb|\begin{isamarkuptext}| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|\end{isamarkuptext}|, while \mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}
   104   {\LaTeX} environment \verb|\begin{isamarkuptext}| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|\end{isamarkuptext}|, while \hyperlink{command.text_raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}
   105   causes the text to be inserted directly into the {\LaTeX} source.
   105   causes the text to be inserted directly into the {\LaTeX} source.
   106 
   106 
   107   \medskip Additional markup commands are available for proofs (see
   107   \medskip Additional markup commands are available for proofs (see
   108   \secref{sec:markup-prf}).  Also note that the \indexref{}{command}{header}\mbox{\isa{\isacommand{header}}} declaration (see \secref{sec:begin-thy}) admits to insert
   108   \secref{sec:markup-prf}).  Also note that the \indexref{}{command}{header}\hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}} declaration (see \secref{sec:begin-thy}) admits to insert
   109   section markup just preceding the actual theory definition.%
   109   section markup just preceding the actual theory definition.%
   110 \end{isamarkuptext}%
   110 \end{isamarkuptext}%
   111 \isamarkuptrue%
   111 \isamarkuptrue%
   112 %
   112 %
   113 \isamarkupsubsection{Type classes and sorts \label{sec:classes}%
   113 \isamarkupsubsection{Type classes and sorts \label{sec:classes}%
   114 }
   114 }
   115 \isamarkuptrue%
   115 \isamarkuptrue%
   116 %
   116 %
   117 \begin{isamarkuptext}%
   117 \begin{isamarkuptext}%
   118 \begin{matharray}{rcll}
   118 \begin{matharray}{rcll}
   119     \indexdef{}{command}{classes}\mbox{\isa{\isacommand{classes}}} & : & \isartrans{theory}{theory} \\
   119     \indexdef{}{command}{classes}\hypertarget{command.classes}{\hyperlink{command.classes}{\mbox{\isa{\isacommand{classes}}}}} & : & \isartrans{theory}{theory} \\
   120     \indexdef{}{command}{classrel}\mbox{\isa{\isacommand{classrel}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
   120     \indexdef{}{command}{classrel}\hypertarget{command.classrel}{\hyperlink{command.classrel}{\mbox{\isa{\isacommand{classrel}}}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
   121     \indexdef{}{command}{defaultsort}\mbox{\isa{\isacommand{defaultsort}}} & : & \isartrans{theory}{theory} \\
   121     \indexdef{}{command}{defaultsort}\hypertarget{command.defaultsort}{\hyperlink{command.defaultsort}{\mbox{\isa{\isacommand{defaultsort}}}}} & : & \isartrans{theory}{theory} \\
   122     \indexdef{}{command}{class\_deps}\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}} & : & \isarkeep{theory~|~proof} \\
   122     \indexdef{}{command}{class\_deps}\hypertarget{command.class_deps}{\hyperlink{command.class_deps}{\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}}}} & : & \isarkeep{theory~|~proof} \\
   123   \end{matharray}
   123   \end{matharray}
   124 
   124 
   125   \begin{rail}
   125   \begin{rail}
   126     'classes' (classdecl +)
   126     'classes' (classdecl +)
   127     ;
   127     ;
   131     ;
   131     ;
   132   \end{rail}
   132   \end{rail}
   133 
   133 
   134   \begin{descr}
   134   \begin{descr}
   135 
   135 
   136   \item [\mbox{\isa{\isacommand{classes}}}~\isa{{\isachardoublequote}c\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n{\isachardoublequote}}]
   136   \item [\hyperlink{command.classes}{\mbox{\isa{\isacommand{classes}}}}~\isa{{\isachardoublequote}c\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n{\isachardoublequote}}]
   137   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.
   137   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.
   138 
   138 
   139   \item [\mbox{\isa{\isacommand{classrel}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}{\isachardoublequote}}] states
   139   \item [\hyperlink{command.classrel}{\mbox{\isa{\isacommand{classrel}}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}{\isachardoublequote}}] states
   140   subclass relations between existing classes \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}{\isachardoublequote}} and
   140   subclass relations between existing classes \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}{\isachardoublequote}} and
   141   \isa{{\isachardoublequote}c\isactrlsub {\isadigit{2}}{\isachardoublequote}}.  This is done axiomatically!  The \indexref{}{command}{instance}\mbox{\isa{\isacommand{instance}}} command (see \secref{sec:axclass}) provides a way to
   141   \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
   142   introduce proven class relations.
   142   introduce proven class relations.
   143 
   143 
   144   \item [\mbox{\isa{\isacommand{defaultsort}}}~\isa{s}] makes sort \isa{s} the
   144   \item [\hyperlink{command.defaultsort}{\mbox{\isa{\isacommand{defaultsort}}}}~\isa{s}] makes sort \isa{s} the
   145   new default sort for any type variables given without sort
   145   new default sort for any type variables given without sort
   146   constraints.  Usually, the default sort would be only changed when
   146   constraints.  Usually, the default sort would be only changed when
   147   defining a new object-logic.
   147   defining a new object-logic.
   148 
   148 
   149   \item [\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}}] visualizes the subclass relation,
   149   \item [\hyperlink{command.class_deps}{\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}}}] visualizes the subclass relation,
   150   using Isabelle's graph browser tool (see also \cite{isabelle-sys}).
   150   using Isabelle's graph browser tool (see also \cite{isabelle-sys}).
   151 
   151 
   152   \end{descr}%
   152   \end{descr}%
   153 \end{isamarkuptext}%
   153 \end{isamarkuptext}%
   154 \isamarkuptrue%
   154 \isamarkuptrue%
   157 }
   157 }
   158 \isamarkuptrue%
   158 \isamarkuptrue%
   159 %
   159 %
   160 \begin{isamarkuptext}%
   160 \begin{isamarkuptext}%
   161 \begin{matharray}{rcll}
   161 \begin{matharray}{rcll}
   162     \indexdef{}{command}{types}\mbox{\isa{\isacommand{types}}} & : & \isartrans{theory}{theory} \\
   162     \indexdef{}{command}{types}\hypertarget{command.types}{\hyperlink{command.types}{\mbox{\isa{\isacommand{types}}}}} & : & \isartrans{theory}{theory} \\
   163     \indexdef{}{command}{typedecl}\mbox{\isa{\isacommand{typedecl}}} & : & \isartrans{theory}{theory} \\
   163     \indexdef{}{command}{typedecl}\hypertarget{command.typedecl}{\hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}} & : & \isartrans{theory}{theory} \\
   164     \indexdef{}{command}{nonterminals}\mbox{\isa{\isacommand{nonterminals}}} & : & \isartrans{theory}{theory} \\
   164     \indexdef{}{command}{nonterminals}\hypertarget{command.nonterminals}{\hyperlink{command.nonterminals}{\mbox{\isa{\isacommand{nonterminals}}}}} & : & \isartrans{theory}{theory} \\
   165     \indexdef{}{command}{arities}\mbox{\isa{\isacommand{arities}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
   165     \indexdef{}{command}{arities}\hypertarget{command.arities}{\hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
   166   \end{matharray}
   166   \end{matharray}
   167 
   167 
   168   \begin{rail}
   168   \begin{rail}
   169     'types' (typespec '=' type infix? +)
   169     'types' (typespec '=' type infix? +)
   170     ;
   170     ;
   176     ;
   176     ;
   177   \end{rail}
   177   \end{rail}
   178 
   178 
   179   \begin{descr}
   179   \begin{descr}
   180 
   180 
   181   \item [\mbox{\isa{\isacommand{types}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t\ {\isacharequal}\ {\isasymtau}{\isachardoublequote}}]
   181   \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}}]
   182   introduces \emph{type synonym} \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}
   182   introduces \emph{type synonym} \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}
   183   for existing type \isa{{\isachardoublequote}{\isasymtau}{\isachardoublequote}}.  Unlike actual type definitions, as
   183   for existing type \isa{{\isachardoublequote}{\isasymtau}{\isachardoublequote}}.  Unlike actual type definitions, as
   184   are available in Isabelle/HOL for example, type synonyms are just
   184   are available in Isabelle/HOL for example, type synonyms are just
   185   purely syntactic abbreviations without any logical significance.
   185   purely syntactic abbreviations without any logical significance.
   186   Internally, type synonyms are fully expanded.
   186   Internally, type synonyms are fully expanded.
   187   
   187   
   188   \item [\mbox{\isa{\isacommand{typedecl}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}]
   188   \item [\hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}]
   189   declares a new type constructor \isa{t}, intended as an actual
   189   declares a new type constructor \isa{t}, intended as an actual
   190   logical type (of the object-logic, if available).
   190   logical type (of the object-logic, if available).
   191 
   191 
   192   \item [\mbox{\isa{\isacommand{nonterminals}}}~\isa{c}] declares type
   192   \item [\hyperlink{command.nonterminals}{\mbox{\isa{\isacommand{nonterminals}}}}~\isa{c}] declares type
   193   constructors \isa{c} (without arguments) to act as purely
   193   constructors \isa{c} (without arguments) to act as purely
   194   syntactic types, i.e.\ nonterminal symbols of Isabelle's inner
   194   syntactic types, i.e.\ nonterminal symbols of Isabelle's inner
   195   syntax of terms or types.
   195   syntax of terms or types.
   196 
   196 
   197   \item [\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
   197   \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
   198   constructor arities.  This is done axiomatically!  The \indexref{}{command}{instance}\mbox{\isa{\isacommand{instance}}} command (see \S\ref{sec:axclass}) provides a way to
   198   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
   199   introduce proven type arities.
   199   introduce proven type arities.
   200 
   200 
   201   \end{descr}%
   201   \end{descr}%
   202 \end{isamarkuptext}%
   202 \end{isamarkuptext}%
   203 \isamarkuptrue%
   203 \isamarkuptrue%
   241   e.g.\ \isa{{\isachardoublequote}d\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ {\isasymtimes}\ {\isasymalpha}{\isachardoublequote}} on the left-hand side means that all
   241   e.g.\ \isa{{\isachardoublequote}d\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ {\isasymtimes}\ {\isasymalpha}{\isachardoublequote}} on the left-hand side means that all
   242   corresponding occurrences on some right-hand side need to be an
   242   corresponding occurrences on some right-hand side need to be an
   243   instance of this, general \isa{{\isachardoublequote}d\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ {\isasymtimes}\ {\isasymbeta}{\isachardoublequote}} will be disallowed.
   243   instance of this, general \isa{{\isachardoublequote}d\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ {\isasymtimes}\ {\isasymbeta}{\isachardoublequote}} will be disallowed.
   244 
   244 
   245   \begin{matharray}{rcl}
   245   \begin{matharray}{rcl}
   246     \indexdef{}{command}{consts}\mbox{\isa{\isacommand{consts}}} & : & \isartrans{theory}{theory} \\
   246     \indexdef{}{command}{consts}\hypertarget{command.consts}{\hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}} & : & \isartrans{theory}{theory} \\
   247     \indexdef{}{command}{defs}\mbox{\isa{\isacommand{defs}}} & : & \isartrans{theory}{theory} \\
   247     \indexdef{}{command}{defs}\hypertarget{command.defs}{\hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}}} & : & \isartrans{theory}{theory} \\
   248     \indexdef{}{command}{constdefs}\mbox{\isa{\isacommand{constdefs}}} & : & \isartrans{theory}{theory} \\
   248     \indexdef{}{command}{constdefs}\hypertarget{command.constdefs}{\hyperlink{command.constdefs}{\mbox{\isa{\isacommand{constdefs}}}}} & : & \isartrans{theory}{theory} \\
   249   \end{matharray}
   249   \end{matharray}
   250 
   250 
   251   \begin{rail}
   251   \begin{rail}
   252     'consts' ((name '::' type mixfix?) +)
   252     'consts' ((name '::' type mixfix?) +)
   253     ;
   253     ;
   267     ;
   267     ;
   268   \end{rail}
   268   \end{rail}
   269 
   269 
   270   \begin{descr}
   270   \begin{descr}
   271 
   271 
   272   \item [\mbox{\isa{\isacommand{consts}}}~\isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}{\isachardoublequote}}] declares constant
   272   \item [\hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}~\isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}{\isachardoublequote}}] declares constant
   273   \isa{c} to have any instance of type scheme \isa{{\isasymsigma}}.  The
   273   \isa{c} to have any instance of type scheme \isa{{\isasymsigma}}.  The
   274   optional mixfix annotations may attach concrete syntax to the
   274   optional mixfix annotations may attach concrete syntax to the
   275   constants declared.
   275   constants declared.
   276   
   276   
   277   \item [\mbox{\isa{\isacommand{defs}}}~\isa{{\isachardoublequote}name{\isacharcolon}\ eqn{\isachardoublequote}}] introduces \isa{eqn}
   277   \item [\hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}}~\isa{{\isachardoublequote}name{\isacharcolon}\ eqn{\isachardoublequote}}] introduces \isa{eqn}
   278   as a definitional axiom for some existing constant.
   278   as a definitional axiom for some existing constant.
   279   
   279   
   280   The \isa{{\isachardoublequote}{\isacharparenleft}unchecked{\isacharparenright}{\isachardoublequote}} option disables global dependency checks
   280   The \isa{{\isachardoublequote}{\isacharparenleft}unchecked{\isacharparenright}{\isachardoublequote}} option disables global dependency checks
   281   for this definition, which is occasionally useful for exotic
   281   for this definition, which is occasionally useful for exotic
   282   overloading.  It is at the discretion of the user to avoid malformed
   282   overloading.  It is at the discretion of the user to avoid malformed
   285   The \isa{{\isachardoublequote}{\isacharparenleft}overloaded{\isacharparenright}{\isachardoublequote}} option declares definitions to be
   285   The \isa{{\isachardoublequote}{\isacharparenleft}overloaded{\isacharparenright}{\isachardoublequote}} option declares definitions to be
   286   potentially overloaded.  Unless this option is given, a warning
   286   potentially overloaded.  Unless this option is given, a warning
   287   message would be issued for any definitional equation with a more
   287   message would be issued for any definitional equation with a more
   288   special type than that of the corresponding constant declaration.
   288   special type than that of the corresponding constant declaration.
   289   
   289   
   290   \item [\mbox{\isa{\isacommand{constdefs}}}] provides a streamlined combination of
   290   \item [\hyperlink{command.constdefs}{\mbox{\isa{\isacommand{constdefs}}}}] provides a streamlined combination of
   291   constants declarations and definitions: type-inference takes care of
   291   constants declarations and definitions: type-inference takes care of
   292   the most general typing of the given specification (the optional
   292   the most general typing of the given specification (the optional
   293   type constraint may refer to type-inference dummies ``\isa{{\isacharunderscore}}'' as usual).  The resulting type declaration needs to agree with
   293   type constraint may refer to type-inference dummies ``\isa{{\isacharunderscore}}'' as usual).  The resulting type declaration needs to agree with
   294   that of the specification; overloading is \emph{not} supported here!
   294   that of the specification; overloading is \emph{not} supported here!
   295   
   295   
   312 }
   312 }
   313 \isamarkuptrue%
   313 \isamarkuptrue%
   314 %
   314 %
   315 \begin{isamarkuptext}%
   315 \begin{isamarkuptext}%
   316 \begin{matharray}{rcl}
   316 \begin{matharray}{rcl}
   317     \indexdef{}{command}{syntax}\mbox{\isa{\isacommand{syntax}}} & : & \isartrans{theory}{theory} \\
   317     \indexdef{}{command}{syntax}\hypertarget{command.syntax}{\hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}}} & : & \isartrans{theory}{theory} \\
   318     \indexdef{}{command}{no\_syntax}\mbox{\isa{\isacommand{no{\isacharunderscore}syntax}}} & : & \isartrans{theory}{theory} \\
   318     \indexdef{}{command}{no\_syntax}\hypertarget{command.no_syntax}{\hyperlink{command.no_syntax}{\mbox{\isa{\isacommand{no{\isacharunderscore}syntax}}}}} & : & \isartrans{theory}{theory} \\
   319     \indexdef{}{command}{translations}\mbox{\isa{\isacommand{translations}}} & : & \isartrans{theory}{theory} \\
   319     \indexdef{}{command}{translations}\hypertarget{command.translations}{\hyperlink{command.translations}{\mbox{\isa{\isacommand{translations}}}}} & : & \isartrans{theory}{theory} \\
   320     \indexdef{}{command}{no\_translations}\mbox{\isa{\isacommand{no{\isacharunderscore}translations}}} & : & \isartrans{theory}{theory} \\
   320     \indexdef{}{command}{no\_translations}\hypertarget{command.no_translations}{\hyperlink{command.no_translations}{\mbox{\isa{\isacommand{no{\isacharunderscore}translations}}}}} & : & \isartrans{theory}{theory} \\
   321   \end{matharray}
   321   \end{matharray}
   322 
   322 
   323   \begin{rail}
   323   \begin{rail}
   324     ('syntax' | 'no\_syntax') mode? (constdecl +)
   324     ('syntax' | 'no\_syntax') mode? (constdecl +)
   325     ;
   325     ;
   332     ;
   332     ;
   333   \end{rail}
   333   \end{rail}
   334 
   334 
   335   \begin{descr}
   335   \begin{descr}
   336   
   336   
   337   \item [\mbox{\isa{\isacommand{syntax}}}~\isa{{\isachardoublequote}{\isacharparenleft}mode{\isacharparenright}\ decls{\isachardoublequote}}] is similar to
   337   \item [\hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}}~\isa{{\isachardoublequote}{\isacharparenleft}mode{\isacharparenright}\ decls{\isachardoublequote}}] is similar to
   338   \mbox{\isa{\isacommand{consts}}}~\isa{decls}, except that the actual logical
   338   \hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}~\isa{decls}, except that the actual logical
   339   signature extension is omitted.  Thus the context free grammar of
   339   signature extension is omitted.  Thus the context free grammar of
   340   Isabelle's inner syntax may be augmented in arbitrary ways,
   340   Isabelle's inner syntax may be augmented in arbitrary ways,
   341   independently of the logic.  The \isa{mode} argument refers to the
   341   independently of the logic.  The \isa{mode} argument refers to the
   342   print mode that the grammar rules belong; unless the \indexref{}{keyword}{output}\mbox{\isa{\isakeyword{output}}} indicator is given, all productions are added both to the
   342   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
   343   input and output grammar.
   343   input and output grammar.
   344   
   344   
   345   \item [\mbox{\isa{\isacommand{no{\isacharunderscore}syntax}}}~\isa{{\isachardoublequote}{\isacharparenleft}mode{\isacharparenright}\ decls{\isachardoublequote}}] removes
   345   \item [\hyperlink{command.no_syntax}{\mbox{\isa{\isacommand{no{\isacharunderscore}syntax}}}}~\isa{{\isachardoublequote}{\isacharparenleft}mode{\isacharparenright}\ decls{\isachardoublequote}}] removes
   346   grammar declarations (and translations) resulting from \isa{decls}, which are interpreted in the same manner as for \mbox{\isa{\isacommand{syntax}}} above.
   346   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.
   347   
   347   
   348   \item [\mbox{\isa{\isacommand{translations}}}~\isa{rules}] specifies syntactic
   348   \item [\hyperlink{command.translations}{\mbox{\isa{\isacommand{translations}}}}~\isa{rules}] specifies syntactic
   349   translation rules (i.e.\ macros): parse~/ print rules (\isa{{\isachardoublequote}{\isasymrightleftharpoons}{\isachardoublequote}}),
   349   translation rules (i.e.\ macros): parse~/ print rules (\isa{{\isachardoublequote}{\isasymrightleftharpoons}{\isachardoublequote}}),
   350   parse rules (\isa{{\isachardoublequote}{\isasymrightharpoonup}{\isachardoublequote}}), or print rules (\isa{{\isachardoublequote}{\isasymleftharpoondown}{\isachardoublequote}}).
   350   parse rules (\isa{{\isachardoublequote}{\isasymrightharpoonup}{\isachardoublequote}}), or print rules (\isa{{\isachardoublequote}{\isasymleftharpoondown}{\isachardoublequote}}).
   351   Translation patterns may be prefixed by the syntactic category to be
   351   Translation patterns may be prefixed by the syntactic category to be
   352   used for parsing; the default is \isa{logic}.
   352   used for parsing; the default is \isa{logic}.
   353   
   353   
   354   \item [\mbox{\isa{\isacommand{no{\isacharunderscore}translations}}}~\isa{rules}] removes syntactic
   354   \item [\hyperlink{command.no_translations}{\mbox{\isa{\isacommand{no{\isacharunderscore}translations}}}}~\isa{rules}] removes syntactic
   355   translation rules, which are interpreted in the same manner as for
   355   translation rules, which are interpreted in the same manner as for
   356   \mbox{\isa{\isacommand{translations}}} above.
   356   \hyperlink{command.translations}{\mbox{\isa{\isacommand{translations}}}} above.
   357 
   357 
   358   \end{descr}%
   358   \end{descr}%
   359 \end{isamarkuptext}%
   359 \end{isamarkuptext}%
   360 \isamarkuptrue%
   360 \isamarkuptrue%
   361 %
   361 %
   363 }
   363 }
   364 \isamarkuptrue%
   364 \isamarkuptrue%
   365 %
   365 %
   366 \begin{isamarkuptext}%
   366 \begin{isamarkuptext}%
   367 \begin{matharray}{rcll}
   367 \begin{matharray}{rcll}
   368     \indexdef{}{command}{axioms}\mbox{\isa{\isacommand{axioms}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
   368     \indexdef{}{command}{axioms}\hypertarget{command.axioms}{\hyperlink{command.axioms}{\mbox{\isa{\isacommand{axioms}}}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
   369     \indexdef{}{command}{lemmas}\mbox{\isa{\isacommand{lemmas}}} & : & \isarkeep{local{\dsh}theory} \\
   369     \indexdef{}{command}{lemmas}\hypertarget{command.lemmas}{\hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}} & : & \isarkeep{local{\dsh}theory} \\
   370     \indexdef{}{command}{theorems}\mbox{\isa{\isacommand{theorems}}} & : & isarkeep{local{\dsh}theory} \\
   370     \indexdef{}{command}{theorems}\hypertarget{command.theorems}{\hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}}} & : & isarkeep{local{\dsh}theory} \\
   371   \end{matharray}
   371   \end{matharray}
   372 
   372 
   373   \begin{rail}
   373   \begin{rail}
   374     'axioms' (axmdecl prop +)
   374     'axioms' (axmdecl prop +)
   375     ;
   375     ;
   377     ;
   377     ;
   378   \end{rail}
   378   \end{rail}
   379 
   379 
   380   \begin{descr}
   380   \begin{descr}
   381   
   381   
   382   \item [\mbox{\isa{\isacommand{axioms}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] introduces arbitrary
   382   \item [\hyperlink{command.axioms}{\mbox{\isa{\isacommand{axioms}}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] introduces arbitrary
   383   statements as axioms of the meta-logic.  In fact, axioms are
   383   statements as axioms of the meta-logic.  In fact, axioms are
   384   ``axiomatic theorems'', and may be referred later just as any other
   384   ``axiomatic theorems'', and may be referred later just as any other
   385   theorem.
   385   theorem.
   386   
   386   
   387   Axioms are usually only introduced when declaring new logical
   387   Axioms are usually only introduced when declaring new logical
   388   systems.  Everyday work is typically done the hard way, with proper
   388   systems.  Everyday work is typically done the hard way, with proper
   389   definitions and proven theorems.
   389   definitions and proven theorems.
   390   
   390   
   391   \item [\mbox{\isa{\isacommand{lemmas}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}]
   391   \item [\hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}]
   392   retrieves and stores existing facts in the theory context, or the
   392   retrieves and stores existing facts in the theory context, or the
   393   specified target context (see also \secref{sec:target}).  Typical
   393   specified target context (see also \secref{sec:target}).  Typical
   394   applications would also involve attributes, to declare Simplifier
   394   applications would also involve attributes, to declare Simplifier
   395   rules, for example.
   395   rules, for example.
   396   
   396   
   397   \item [\mbox{\isa{\isacommand{theorems}}}] is essentially the same as \mbox{\isa{\isacommand{lemmas}}}, but marks the result as a different kind of facts.
   397   \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.
   398 
   398 
   399   \end{descr}%
   399   \end{descr}%
   400 \end{isamarkuptext}%
   400 \end{isamarkuptext}%
   401 \isamarkuptrue%
   401 \isamarkuptrue%
   402 %
   402 %
   404 }
   404 }
   405 \isamarkuptrue%
   405 \isamarkuptrue%
   406 %
   406 %
   407 \begin{isamarkuptext}%
   407 \begin{isamarkuptext}%
   408 \begin{matharray}{rcl}
   408 \begin{matharray}{rcl}
   409     \indexdef{}{command}{global}\mbox{\isa{\isacommand{global}}} & : & \isartrans{theory}{theory} \\
   409     \indexdef{}{command}{global}\hypertarget{command.global}{\hyperlink{command.global}{\mbox{\isa{\isacommand{global}}}}} & : & \isartrans{theory}{theory} \\
   410     \indexdef{}{command}{local}\mbox{\isa{\isacommand{local}}} & : & \isartrans{theory}{theory} \\
   410     \indexdef{}{command}{local}\hypertarget{command.local}{\hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}}} & : & \isartrans{theory}{theory} \\
   411     \indexdef{}{command}{hide}\mbox{\isa{\isacommand{hide}}} & : & \isartrans{theory}{theory} \\
   411     \indexdef{}{command}{hide}\hypertarget{command.hide}{\hyperlink{command.hide}{\mbox{\isa{\isacommand{hide}}}}} & : & \isartrans{theory}{theory} \\
   412   \end{matharray}
   412   \end{matharray}
   413 
   413 
   414   \begin{rail}
   414   \begin{rail}
   415     'hide' ('(open)')? name (nameref + )
   415     'hide' ('(open)')? name (nameref + )
   416     ;
   416     ;
   422   name spaces by hand, yet the following commands provide some way to
   422   name spaces by hand, yet the following commands provide some way to
   423   do so.
   423   do so.
   424 
   424 
   425   \begin{descr}
   425   \begin{descr}
   426 
   426 
   427   \item [\mbox{\isa{\isacommand{global}}} and \mbox{\isa{\isacommand{local}}}] change the
   427   \item [\hyperlink{command.global}{\mbox{\isa{\isacommand{global}}}} and \hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}}] change the
   428   current name declaration mode.  Initially, theories start in
   428   current name declaration mode.  Initially, theories start in
   429   \mbox{\isa{\isacommand{local}}} mode, causing all names to be automatically
   429   \hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}} mode, causing all names to be automatically
   430   qualified by the theory name.  Changing this to \mbox{\isa{\isacommand{global}}}
   430   qualified by the theory name.  Changing this to \hyperlink{command.global}{\mbox{\isa{\isacommand{global}}}}
   431   causes all names to be declared without the theory prefix, until
   431   causes all names to be declared without the theory prefix, until
   432   \mbox{\isa{\isacommand{local}}} is declared again.
   432   \hyperlink{command.local}{\mbox{\isa{\isacommand{local}}}} is declared again.
   433   
   433   
   434   Note that global names are prone to get hidden accidently later,
   434   Note that global names are prone to get hidden accidently later,
   435   when qualified names of the same base name are introduced.
   435   when qualified names of the same base name are introduced.
   436   
   436   
   437   \item [\mbox{\isa{\isacommand{hide}}}~\isa{{\isachardoublequote}space\ names{\isachardoublequote}}] fully removes
   437   \item [\hyperlink{command.hide}{\mbox{\isa{\isacommand{hide}}}}~\isa{{\isachardoublequote}space\ names{\isachardoublequote}}] fully removes
   438   declarations from a given name space (which may be \isa{{\isachardoublequote}class{\isachardoublequote}},
   438   declarations from a given name space (which may be \isa{{\isachardoublequote}class{\isachardoublequote}},
   439   \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
   439   \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
   440   (unqualified) names may never be hidden.
   440   (unqualified) names may never be hidden.
   441   
   441   
   442   Note that hiding name space accesses has no impact on logical
   442   Note that hiding name space accesses has no impact on logical
   452 }
   452 }
   453 \isamarkuptrue%
   453 \isamarkuptrue%
   454 %
   454 %
   455 \begin{isamarkuptext}%
   455 \begin{isamarkuptext}%
   456 \begin{matharray}{rcl}
   456 \begin{matharray}{rcl}
   457     \indexdef{}{command}{use}\mbox{\isa{\isacommand{use}}} & : & \isarkeep{theory~|~local{\dsh}theory} \\
   457     \indexdef{}{command}{use}\hypertarget{command.use}{\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}}} & : & \isarkeep{theory~|~local{\dsh}theory} \\
   458     \indexdef{}{command}{ML}\mbox{\isa{\isacommand{ML}}} & : & \isarkeep{theory~|~local{\dsh}theory} \\
   458     \indexdef{}{command}{ML}\hypertarget{command.ML}{\hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}} & : & \isarkeep{theory~|~local{\dsh}theory} \\
   459     \indexdef{}{command}{ML\_val}\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}} & : & \isartrans{\cdot}{\cdot} \\
   459     \indexdef{}{command}{ML\_val}\hypertarget{command.ML_val}{\hyperlink{command.ML_val}{\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}}}} & : & \isartrans{\cdot}{\cdot} \\
   460     \indexdef{}{command}{ML\_command}\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}} & : & \isartrans{\cdot}{\cdot} \\
   460     \indexdef{}{command}{ML\_command}\hypertarget{command.ML_command}{\hyperlink{command.ML_command}{\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}}} & : & \isartrans{\cdot}{\cdot} \\
   461     \indexdef{}{command}{setup}\mbox{\isa{\isacommand{setup}}} & : & \isartrans{theory}{theory} \\
   461     \indexdef{}{command}{setup}\hypertarget{command.setup}{\hyperlink{command.setup}{\mbox{\isa{\isacommand{setup}}}}} & : & \isartrans{theory}{theory} \\
   462     \indexdef{}{command}{method\_setup}\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}} & : & \isartrans{theory}{theory} \\
   462     \indexdef{}{command}{method\_setup}\hypertarget{command.method_setup}{\hyperlink{command.method_setup}{\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}}}} & : & \isartrans{theory}{theory} \\
   463   \end{matharray}
   463   \end{matharray}
   464 
   464 
   465   \begin{rail}
   465   \begin{rail}
   466     'use' name
   466     'use' name
   467     ;
   467     ;
   471     ;
   471     ;
   472   \end{rail}
   472   \end{rail}
   473 
   473 
   474   \begin{descr}
   474   \begin{descr}
   475 
   475 
   476   \item [\mbox{\isa{\isacommand{use}}}~\isa{{\isachardoublequote}file{\isachardoublequote}}] reads and executes ML
   476   \item [\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}}~\isa{{\isachardoublequote}file{\isachardoublequote}}] reads and executes ML
   477   commands from \isa{{\isachardoublequote}file{\isachardoublequote}}.  The current theory context is passed
   477   commands from \isa{{\isachardoublequote}file{\isachardoublequote}}.  The current theory context is passed
   478   down to the ML toplevel and may be modified, using \verb|"Context.>>"| or derived ML commands.  The file name is checked with
   478   down to the ML toplevel and may be modified, using \verb|"Context.>>"| or derived ML commands.  The file name is checked with
   479   the \indexref{}{keyword}{uses}\mbox{\isa{\isakeyword{uses}}} dependency declaration given in the theory
   479   the \indexref{}{keyword}{uses}\hyperlink{keyword.uses}{\mbox{\isa{\isakeyword{uses}}}} dependency declaration given in the theory
   480   header (see also \secref{sec:begin-thy}).
   480   header (see also \secref{sec:begin-thy}).
   481   
   481   
   482   \item [\mbox{\isa{\isacommand{ML}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] is similar to \mbox{\isa{\isacommand{use}}}, but executes ML commands directly from the given \isa{{\isachardoublequote}text{\isachardoublequote}}.
   482   \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}}.
   483 
   483 
   484   \item [\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}} and \mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}] are
   484   \item [\hyperlink{command.ML_val}{\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}}} and \hyperlink{command.ML_command}{\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}}] are
   485   diagnostic versions of \mbox{\isa{\isacommand{ML}}}, which means that the context
   485   diagnostic versions of \hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}, which means that the context
   486   may not be updated.  \mbox{\isa{\isacommand{ML{\isacharunderscore}val}}} echos the bindings produced
   486   may not be updated.  \hyperlink{command.ML_val}{\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}}} echos the bindings produced
   487   at the ML toplevel, but \mbox{\isa{\isacommand{ML{\isacharunderscore}command}}} is silent.
   487   at the ML toplevel, but \hyperlink{command.ML_command}{\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}} is silent.
   488   
   488   
   489   \item [\mbox{\isa{\isacommand{setup}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] changes the current theory
   489   \item [\hyperlink{command.setup}{\mbox{\isa{\isacommand{setup}}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] changes the current theory
   490   context by applying \isa{{\isachardoublequote}text{\isachardoublequote}}, which refers to an ML expression
   490   context by applying \isa{{\isachardoublequote}text{\isachardoublequote}}, which refers to an ML expression
   491   of type \verb|"theory -> theory"|.  This enables to initialize
   491   of type \verb|"theory -> theory"|.  This enables to initialize
   492   any object-logic specific tools and packages written in ML, for
   492   any object-logic specific tools and packages written in ML, for
   493   example.
   493   example.
   494   
   494   
   495   \item [\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}}~\isa{{\isachardoublequote}name\ {\isacharequal}\ text\ description{\isachardoublequote}}]
   495   \item [\hyperlink{command.method_setup}{\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}}}~\isa{{\isachardoublequote}name\ {\isacharequal}\ text\ description{\isachardoublequote}}]
   496   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%
   496   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%
   497 \verb|  Proof.context -> Proof.method"|.  Parsing concrete method syntax
   497 \verb|  Proof.context -> Proof.method"|.  Parsing concrete method syntax
   498   from \verb|Args.src| input can be quite tedious in general.  The
   498   from \verb|Args.src| input can be quite tedious in general.  The
   499   following simple examples are for methods without any explicit
   499   following simple examples are for methods without any explicit
   500   arguments, or a list of theorems, respectively.
   500   arguments, or a list of theorems, respectively.
   524 }
   524 }
   525 \isamarkuptrue%
   525 \isamarkuptrue%
   526 %
   526 %
   527 \begin{isamarkuptext}%
   527 \begin{isamarkuptext}%
   528 \begin{matharray}{rcl}
   528 \begin{matharray}{rcl}
   529     \indexdef{}{command}{parse\_ast\_translation}\mbox{\isa{\isacommand{parse{\isacharunderscore}ast{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
   529     \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} \\
   530     \indexdef{}{command}{parse\_translation}\mbox{\isa{\isacommand{parse{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
   530     \indexdef{}{command}{parse\_translation}\hypertarget{command.parse_translation}{\hyperlink{command.parse_translation}{\mbox{\isa{\isacommand{parse{\isacharunderscore}translation}}}}} & : & \isartrans{theory}{theory} \\
   531     \indexdef{}{command}{print\_translation}\mbox{\isa{\isacommand{print{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
   531     \indexdef{}{command}{print\_translation}\hypertarget{command.print_translation}{\hyperlink{command.print_translation}{\mbox{\isa{\isacommand{print{\isacharunderscore}translation}}}}} & : & \isartrans{theory}{theory} \\
   532     \indexdef{}{command}{typed\_print\_translation}\mbox{\isa{\isacommand{typed{\isacharunderscore}print{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
   532     \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} \\
   533     \indexdef{}{command}{print\_ast\_translation}\mbox{\isa{\isacommand{print{\isacharunderscore}ast{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
   533     \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} \\
   534     \indexdef{}{command}{token\_translation}\mbox{\isa{\isacommand{token{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
   534     \indexdef{}{command}{token\_translation}\hypertarget{command.token_translation}{\hyperlink{command.token_translation}{\mbox{\isa{\isacommand{token{\isacharunderscore}translation}}}}} & : & \isartrans{theory}{theory} \\
   535   \end{matharray}
   535   \end{matharray}
   536 
   536 
   537   \begin{rail}
   537   \begin{rail}
   538   ( 'parse\_ast\_translation' | 'parse\_translation' | 'print\_translation' |
   538   ( 'parse\_ast\_translation' | 'parse\_translation' | 'print\_translation' |
   539     'typed\_print\_translation' | 'print\_ast\_translation' ) ('(advanced)')? text
   539     'typed\_print\_translation' | 'print\_ast\_translation' ) ('(advanced)')? text
   589 }
   589 }
   590 \isamarkuptrue%
   590 \isamarkuptrue%
   591 %
   591 %
   592 \begin{isamarkuptext}%
   592 \begin{isamarkuptext}%
   593 \begin{matharray}{rcl}
   593 \begin{matharray}{rcl}
   594     \indexdef{}{command}{oracle}\mbox{\isa{\isacommand{oracle}}} & : & \isartrans{theory}{theory} \\
   594     \indexdef{}{command}{oracle}\hypertarget{command.oracle}{\hyperlink{command.oracle}{\mbox{\isa{\isacommand{oracle}}}}} & : & \isartrans{theory}{theory} \\
   595   \end{matharray}
   595   \end{matharray}
   596 
   596 
   597   The oracle interface promotes a given ML function \verb|theory -> T -> term| to \verb|theory -> T -> thm|, for some
   597   The oracle interface promotes a given ML function \verb|theory -> T -> term| to \verb|theory -> T -> thm|, for some
   598   type \verb|T| given by the user.  This acts like an infinitary
   598   type \verb|T| given by the user.  This acts like an infinitary
   599   specification of axioms -- there is no internal check of the
   599   specification of axioms -- there is no internal check of the
   607     ;
   607     ;
   608   \end{rail}
   608   \end{rail}
   609 
   609 
   610   \begin{descr}
   610   \begin{descr}
   611 
   611 
   612   \item [\mbox{\isa{\isacommand{oracle}}}~\isa{{\isachardoublequote}name\ {\isacharparenleft}type{\isacharparenright}\ {\isacharequal}\ text{\isachardoublequote}}] turns the
   612   \item [\hyperlink{command.oracle}{\mbox{\isa{\isacommand{oracle}}}}~\isa{{\isachardoublequote}name\ {\isacharparenleft}type{\isacharparenright}\ {\isacharequal}\ text{\isachardoublequote}}] turns the
   613   given ML expression \isa{{\isachardoublequote}text{\isachardoublequote}} of type
   613   given ML expression \isa{{\isachardoublequote}text{\isachardoublequote}} of type
   614   \verb|theory ->|~\isa{{\isachardoublequote}type{\isachardoublequote}}~\verb|-> term| into an
   614   \verb|theory ->|~\isa{{\isachardoublequote}type{\isachardoublequote}}~\verb|-> term| into an
   615   ML function of type
   615   ML function of type
   616   \verb|theory ->|~\isa{{\isachardoublequote}type{\isachardoublequote}}~\verb|-> thm|, which is
   616   \verb|theory ->|~\isa{{\isachardoublequote}type{\isachardoublequote}}~\verb|-> thm|, which is
   617   bound to the global identifier \verb|name|.
   617   bound to the global identifier \verb|name|.
   628 }
   628 }
   629 \isamarkuptrue%
   629 \isamarkuptrue%
   630 %
   630 %
   631 \begin{isamarkuptext}%
   631 \begin{isamarkuptext}%
   632 \begin{matharray}{rcl}
   632 \begin{matharray}{rcl}
   633     \indexdef{}{command}{sect}\mbox{\isa{\isacommand{sect}}} & : & \isartrans{proof}{proof} \\
   633     \indexdef{}{command}{sect}\hypertarget{command.sect}{\hyperlink{command.sect}{\mbox{\isa{\isacommand{sect}}}}} & : & \isartrans{proof}{proof} \\
   634     \indexdef{}{command}{subsect}\mbox{\isa{\isacommand{subsect}}} & : & \isartrans{proof}{proof} \\
   634     \indexdef{}{command}{subsect}\hypertarget{command.subsect}{\hyperlink{command.subsect}{\mbox{\isa{\isacommand{subsect}}}}} & : & \isartrans{proof}{proof} \\
   635     \indexdef{}{command}{subsubsect}\mbox{\isa{\isacommand{subsubsect}}} & : & \isartrans{proof}{proof} \\
   635     \indexdef{}{command}{subsubsect}\hypertarget{command.subsubsect}{\hyperlink{command.subsubsect}{\mbox{\isa{\isacommand{subsubsect}}}}} & : & \isartrans{proof}{proof} \\
   636     \indexdef{}{command}{txt}\mbox{\isa{\isacommand{txt}}} & : & \isartrans{proof}{proof} \\
   636     \indexdef{}{command}{txt}\hypertarget{command.txt}{\hyperlink{command.txt}{\mbox{\isa{\isacommand{txt}}}}} & : & \isartrans{proof}{proof} \\
   637     \indexdef{}{command}{txt\_raw}\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}} & : & \isartrans{proof}{proof} \\
   637     \indexdef{}{command}{txt\_raw}\hypertarget{command.txt_raw}{\hyperlink{command.txt_raw}{\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}}}} & : & \isartrans{proof}{proof} \\
   638   \end{matharray}
   638   \end{matharray}
   639 
   639 
   640   These markup commands for proof mode closely correspond to the ones
   640   These markup commands for proof mode closely correspond to the ones
   641   of theory mode (see \S\ref{sec:markup-thy}).
   641   of theory mode (see \S\ref{sec:markup-thy}).
   642 
   642 
   655 }
   655 }
   656 \isamarkuptrue%
   656 \isamarkuptrue%
   657 %
   657 %
   658 \begin{isamarkuptext}%
   658 \begin{isamarkuptext}%
   659 \begin{matharray}{rcl}
   659 \begin{matharray}{rcl}
   660     \indexdef{}{command}{pr}\mbox{\isa{\isacommand{pr}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   660     \indexdef{}{command}{pr}\hypertarget{command.pr}{\hyperlink{command.pr}{\mbox{\isa{\isacommand{pr}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   661     \indexdef{}{command}{thm}\mbox{\isa{\isacommand{thm}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   661     \indexdef{}{command}{thm}\hypertarget{command.thm}{\hyperlink{command.thm}{\mbox{\isa{\isacommand{thm}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   662     \indexdef{}{command}{term}\mbox{\isa{\isacommand{term}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   662     \indexdef{}{command}{term}\hypertarget{command.term}{\hyperlink{command.term}{\mbox{\isa{\isacommand{term}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   663     \indexdef{}{command}{prop}\mbox{\isa{\isacommand{prop}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   663     \indexdef{}{command}{prop}\hypertarget{command.prop}{\hyperlink{command.prop}{\mbox{\isa{\isacommand{prop}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   664     \indexdef{}{command}{typ}\mbox{\isa{\isacommand{typ}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   664     \indexdef{}{command}{typ}\hypertarget{command.typ}{\hyperlink{command.typ}{\mbox{\isa{\isacommand{typ}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   665     \indexdef{}{command}{prf}\mbox{\isa{\isacommand{prf}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   665     \indexdef{}{command}{prf}\hypertarget{command.prf}{\hyperlink{command.prf}{\mbox{\isa{\isacommand{prf}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   666     \indexdef{}{command}{full\_prf}\mbox{\isa{\isacommand{full{\isacharunderscore}prf}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   666     \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} \\
   667   \end{matharray}
   667   \end{matharray}
   668 
   668 
   669   These diagnostic commands assist interactive development.  Note that
   669   These diagnostic commands assist interactive development.  Note that
   670   \mbox{\isa{\isacommand{undo}}} does not apply here, the theory or proof
   670   \hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}} does not apply here, the theory or proof
   671   configuration is not changed.
   671   configuration is not changed.
   672 
   672 
   673   \begin{rail}
   673   \begin{rail}
   674     'pr' modes? nat? (',' nat)?
   674     'pr' modes? nat? (',' nat)?
   675     ;
   675     ;
   690     ;
   690     ;
   691   \end{rail}
   691   \end{rail}
   692 
   692 
   693   \begin{descr}
   693   \begin{descr}
   694 
   694 
   695   \item [\mbox{\isa{\isacommand{pr}}}~\isa{{\isachardoublequote}goals{\isacharcomma}\ prems{\isachardoublequote}}] prints the current
   695   \item [\hyperlink{command.pr}{\mbox{\isa{\isacommand{pr}}}}~\isa{{\isachardoublequote}goals{\isacharcomma}\ prems{\isachardoublequote}}] prints the current
   696   proof state (if present), including the proof context, current facts
   696   proof state (if present), including the proof context, current facts
   697   and goals.  The optional limit arguments affect the number of goals
   697   and goals.  The optional limit arguments affect the number of goals
   698   and premises to be displayed, which is initially 10 for both.
   698   and premises to be displayed, which is initially 10 for both.
   699   Omitting limit values leaves the current setting unchanged.
   699   Omitting limit values leaves the current setting unchanged.
   700 
   700 
   701   \item [\mbox{\isa{\isacommand{thm}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] retrieves
   701   \item [\hyperlink{command.thm}{\mbox{\isa{\isacommand{thm}}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] retrieves
   702   theorems from the current theory or proof context.  Note that any
   702   theorems from the current theory or proof context.  Note that any
   703   attributes included in the theorem specifications are applied to a
   703   attributes included in the theorem specifications are applied to a
   704   temporary context derived from the current theory or proof; the
   704   temporary context derived from the current theory or proof; the
   705   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.
   705   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.
   706 
   706 
   707   \item [\mbox{\isa{\isacommand{term}}}~\isa{t} and \mbox{\isa{\isacommand{prop}}}~\isa{{\isasymphi}}]
   707   \item [\hyperlink{command.term}{\mbox{\isa{\isacommand{term}}}}~\isa{t} and \hyperlink{command.prop}{\mbox{\isa{\isacommand{prop}}}}~\isa{{\isasymphi}}]
   708   read, type-check and print terms or propositions according to the
   708   read, type-check and print terms or propositions according to the
   709   current theory or proof context; the inferred type of \isa{t} is
   709   current theory or proof context; the inferred type of \isa{t} is
   710   output as well.  Note that these commands are also useful in
   710   output as well.  Note that these commands are also useful in
   711   inspecting the current environment of term abbreviations.
   711   inspecting the current environment of term abbreviations.
   712 
   712 
   713   \item [\mbox{\isa{\isacommand{typ}}}~\isa{{\isasymtau}}] reads and prints types of the
   713   \item [\hyperlink{command.typ}{\mbox{\isa{\isacommand{typ}}}}~\isa{{\isasymtau}}] reads and prints types of the
   714   meta-logic according to the current theory or proof context.
   714   meta-logic according to the current theory or proof context.
   715 
   715 
   716   \item [\mbox{\isa{\isacommand{prf}}}] displays the (compact) proof term of the
   716   \item [\hyperlink{command.prf}{\mbox{\isa{\isacommand{prf}}}}] displays the (compact) proof term of the
   717   current proof state (if present), or of the given theorems. Note
   717   current proof state (if present), or of the given theorems. Note
   718   that this requires proof terms to be switched on for the current
   718   that this requires proof terms to be switched on for the current
   719   object logic (see the ``Proof terms'' section of the Isabelle
   719   object logic (see the ``Proof terms'' section of the Isabelle
   720   reference manual for information on how to do this).
   720   reference manual for information on how to do this).
   721 
   721 
   722   \item [\mbox{\isa{\isacommand{full{\isacharunderscore}prf}}}] is like \mbox{\isa{\isacommand{prf}}}, but displays
   722   \item [\hyperlink{command.full_prf}{\mbox{\isa{\isacommand{full{\isacharunderscore}prf}}}}] is like \hyperlink{command.prf}{\mbox{\isa{\isacommand{prf}}}}, but displays
   723   the full proof term, i.e.\ also displays information omitted in the
   723   the full proof term, i.e.\ also displays information omitted in the
   724   compact proof term, which is denoted by ``\isa{{\isacharunderscore}}'' placeholders
   724   compact proof term, which is denoted by ``\isa{{\isacharunderscore}}'' placeholders
   725   there.
   725   there.
   726 
   726 
   727   \end{descr}
   727   \end{descr}
   728 
   728 
   729   All of the diagnostic commands above admit a list of \isa{modes}
   729   All of the diagnostic commands above admit a list of \isa{modes}
   730   to be specified, which is appended to the current print mode (see
   730   to be specified, which is appended to the current print mode (see
   731   also \cite{isabelle-ref}).  Thus the output behavior may be modified
   731   also \cite{isabelle-ref}).  Thus the output behavior may be modified
   732   according particular print mode features.  For example, \mbox{\isa{\isacommand{pr}}}~\isa{{\isachardoublequote}{\isacharparenleft}latex\ xsymbols\ symbols{\isacharparenright}{\isachardoublequote}} would print the current
   732   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
   733   proof state with mathematical symbols and special characters
   733   proof state with mathematical symbols and special characters
   734   represented in {\LaTeX} source, according to the Isabelle style
   734   represented in {\LaTeX} source, according to the Isabelle style
   735   \cite{isabelle-sys}.
   735   \cite{isabelle-sys}.
   736 
   736 
   737   Note that antiquotations (cf.\ \secref{sec:antiq}) provide a more
   737   Note that antiquotations (cf.\ \secref{sec:antiq}) provide a more
   744 }
   744 }
   745 \isamarkuptrue%
   745 \isamarkuptrue%
   746 %
   746 %
   747 \begin{isamarkuptext}%
   747 \begin{isamarkuptext}%
   748 \begin{matharray}{rcl}
   748 \begin{matharray}{rcl}
   749     \indexdef{}{command}{print\_commands}\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   749     \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} \\
   750     \indexdef{}{command}{print\_theory}\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   750     \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} \\
   751     \indexdef{}{command}{print\_syntax}\mbox{\isa{\isacommand{print{\isacharunderscore}syntax}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   751     \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} \\
   752     \indexdef{}{command}{print\_methods}\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   752     \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} \\
   753     \indexdef{}{command}{print\_attributes}\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   753     \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} \\
   754     \indexdef{}{command}{print\_theorems}\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   754     \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} \\
   755     \indexdef{}{command}{find\_theorems}\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   755     \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} \\
   756     \indexdef{}{command}{thm\_deps}\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
   756     \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} \\
   757     \indexdef{}{command}{print\_facts}\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{proof} \\
   757     \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} \\
   758     \indexdef{}{command}{print\_binds}\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{proof} \\
   758     \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} \\
   759   \end{matharray}
   759   \end{matharray}
   760 
   760 
   761   \begin{rail}
   761   \begin{rail}
   762     'print\_theory' ( '!'?)
   762     'print\_theory' ( '!'?)
   763     ;
   763     ;
   775   Note that there are some further ones available, such as for the set
   775   Note that there are some further ones available, such as for the set
   776   of rules declared for simplifications.
   776   of rules declared for simplifications.
   777 
   777 
   778   \begin{descr}
   778   \begin{descr}
   779   
   779   
   780   \item [\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}] prints Isabelle's outer theory
   780   \item [\hyperlink{command.print_commands}{\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}}] prints Isabelle's outer theory
   781   syntax, including keywords and command.
   781   syntax, including keywords and command.
   782   
   782   
   783   \item [\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}] prints the main logical content of
   783   \item [\hyperlink{command.print_theory}{\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}}] prints the main logical content of
   784   the theory context; the ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' option indicates extra
   784   the theory context; the ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' option indicates extra
   785   verbosity.
   785   verbosity.
   786 
   786 
   787   \item [\mbox{\isa{\isacommand{print{\isacharunderscore}syntax}}}] prints the inner syntax of types
   787   \item [\hyperlink{command.print_syntax}{\mbox{\isa{\isacommand{print{\isacharunderscore}syntax}}}}] prints the inner syntax of types
   788   and terms, depending on the current context.  The output can be very
   788   and terms, depending on the current context.  The output can be very
   789   verbose, including grammar tables and syntax translation rules.  See
   789   verbose, including grammar tables and syntax translation rules.  See
   790   \cite[\S7, \S8]{isabelle-ref} for further information on Isabelle's
   790   \cite[\S7, \S8]{isabelle-ref} for further information on Isabelle's
   791   inner syntax.
   791   inner syntax.
   792   
   792   
   793   \item [\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}] prints all proof methods
   793   \item [\hyperlink{command.print_methods}{\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}}] prints all proof methods
   794   available in the current theory context.
   794   available in the current theory context.
   795   
   795   
   796   \item [\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}] prints all attributes
   796   \item [\hyperlink{command.print_attributes}{\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}}] prints all attributes
   797   available in the current theory context.
   797   available in the current theory context.
   798   
   798   
   799   \item [\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}] prints theorems resulting from
   799   \item [\hyperlink{command.print_theorems}{\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}}] prints theorems resulting from
   800   the last command.
   800   the last command.
   801   
   801   
   802   \item [\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}~\isa{criteria}] retrieves facts
   802   \item [\hyperlink{command.find_theorems}{\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}}~\isa{criteria}] retrieves facts
   803   from the theory or proof context matching all of given search
   803   from the theory or proof context matching all of given search
   804   criteria.  The criterion \isa{{\isachardoublequote}name{\isacharcolon}\ p{\isachardoublequote}} selects all theorems
   804   criteria.  The criterion \isa{{\isachardoublequote}name{\isacharcolon}\ p{\isachardoublequote}} selects all theorems
   805   whose fully qualified name matches pattern \isa{p}, which may
   805   whose fully qualified name matches pattern \isa{p}, which may
   806   contain ``\isa{{\isachardoublequote}{\isacharasterisk}{\isachardoublequote}}'' wildcards.  The criteria \isa{intro},
   806   contain ``\isa{{\isachardoublequote}{\isacharasterisk}{\isachardoublequote}}'' wildcards.  The criteria \isa{intro},
   807   \isa{elim}, and \isa{dest} select theorems that match the
   807   \isa{elim}, and \isa{dest} select theorems that match the
   816   yields \emph{all} currently known facts.  An optional limit for the
   816   yields \emph{all} currently known facts.  An optional limit for the
   817   number of printed facts may be given; the default is 40.  By
   817   number of printed facts may be given; the default is 40.  By
   818   default, duplicates are removed from the search result. Use
   818   default, duplicates are removed from the search result. Use
   819   \isa{with{\isacharunderscore}dups} to display duplicates.
   819   \isa{with{\isacharunderscore}dups} to display duplicates.
   820   
   820   
   821   \item [\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}]
   821   \item [\hyperlink{command.thm_deps}{\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}]
   822   visualizes dependencies of facts, using Isabelle's graph browser
   822   visualizes dependencies of facts, using Isabelle's graph browser
   823   tool (see also \cite{isabelle-sys}).
   823   tool (see also \cite{isabelle-sys}).
   824   
   824   
   825   \item [\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}] prints all local facts of the
   825   \item [\hyperlink{command.print_facts}{\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}}] prints all local facts of the
   826   current context, both named and unnamed ones.
   826   current context, both named and unnamed ones.
   827   
   827   
   828   \item [\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}] prints all term abbreviations
   828   \item [\hyperlink{command.print_binds}{\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}}] prints all term abbreviations
   829   present in the context.
   829   present in the context.
   830 
   830 
   831   \end{descr}%
   831   \end{descr}%
   832 \end{isamarkuptext}%
   832 \end{isamarkuptext}%
   833 \isamarkuptrue%
   833 \isamarkuptrue%
   836 }
   836 }
   837 \isamarkuptrue%
   837 \isamarkuptrue%
   838 %
   838 %
   839 \begin{isamarkuptext}%
   839 \begin{isamarkuptext}%
   840 \begin{matharray}{rcl}
   840 \begin{matharray}{rcl}
   841     \indexdef{}{command}{undo}\mbox{\isa{\isacommand{undo}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
   841     \indexdef{}{command}{undo}\hypertarget{command.undo}{\hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
   842     \indexdef{}{command}{redo}\mbox{\isa{\isacommand{redo}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
   842     \indexdef{}{command}{redo}\hypertarget{command.redo}{\hyperlink{command.redo}{\mbox{\isa{\isacommand{redo}}}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
   843     \indexdef{}{command}{kill}\mbox{\isa{\isacommand{kill}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
   843     \indexdef{}{command}{kill}\hypertarget{command.kill}{\hyperlink{command.kill}{\mbox{\isa{\isacommand{kill}}}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
   844   \end{matharray}
   844   \end{matharray}
   845 
   845 
   846   The Isabelle/Isar top-level maintains a two-stage history, for
   846   The Isabelle/Isar top-level maintains a two-stage history, for
   847   theory and proof state transformation.  Basically, any command can
   847   theory and proof state transformation.  Basically, any command can
   848   be undone using \mbox{\isa{\isacommand{undo}}}, excluding mere diagnostic
   848   be undone using \hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}}, excluding mere diagnostic
   849   elements.  Its effect may be revoked via \mbox{\isa{\isacommand{redo}}}, unless
   849   elements.  Its effect may be revoked via \hyperlink{command.redo}{\mbox{\isa{\isacommand{redo}}}}, unless
   850   the corresponding \mbox{\isa{\isacommand{undo}}} step has crossed the beginning
   850   the corresponding \hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}} step has crossed the beginning
   851   of a proof or theory.  The \mbox{\isa{\isacommand{kill}}} command aborts the
   851   of a proof or theory.  The \hyperlink{command.kill}{\mbox{\isa{\isacommand{kill}}}} command aborts the
   852   current history node altogether, discontinuing a proof or even the
   852   current history node altogether, discontinuing a proof or even the
   853   whole theory.  This operation is \emph{not} undo-able.
   853   whole theory.  This operation is \emph{not} undo-able.
   854 
   854 
   855   \begin{warn}
   855   \begin{warn}
   856     History commands should never be used with user interfaces such as
   856     History commands should never be used with user interfaces such as
   857     Proof~General \cite{proofgeneral,Aspinall:TACAS:2000}, which takes
   857     Proof~General \cite{proofgeneral,Aspinall:TACAS:2000}, which takes
   858     care of stepping forth and back itself.  Interfering by manual
   858     care of stepping forth and back itself.  Interfering by manual
   859     \mbox{\isa{\isacommand{undo}}}, \mbox{\isa{\isacommand{redo}}}, or even \mbox{\isa{\isacommand{kill}}}
   859     \hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}}, \hyperlink{command.redo}{\mbox{\isa{\isacommand{redo}}}}, or even \hyperlink{command.kill}{\mbox{\isa{\isacommand{kill}}}}
   860     commands would quickly result in utter confusion.
   860     commands would quickly result in utter confusion.
   861   \end{warn}%
   861   \end{warn}%
   862 \end{isamarkuptext}%
   862 \end{isamarkuptext}%
   863 \isamarkuptrue%
   863 \isamarkuptrue%
   864 %
   864 %
   866 }
   866 }
   867 \isamarkuptrue%
   867 \isamarkuptrue%
   868 %
   868 %
   869 \begin{isamarkuptext}%
   869 \begin{isamarkuptext}%
   870 \begin{matharray}{rcl}
   870 \begin{matharray}{rcl}
   871     \indexdef{}{command}{cd}\mbox{\isa{\isacommand{cd}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   871     \indexdef{}{command}{cd}\hypertarget{command.cd}{\hyperlink{command.cd}{\mbox{\isa{\isacommand{cd}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   872     \indexdef{}{command}{pwd}\mbox{\isa{\isacommand{pwd}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   872     \indexdef{}{command}{pwd}\hypertarget{command.pwd}{\hyperlink{command.pwd}{\mbox{\isa{\isacommand{pwd}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   873     \indexdef{}{command}{use\_thy}\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   873     \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} \\
   874     \indexdef{}{command}{display\_drafts}\mbox{\isa{\isacommand{display{\isacharunderscore}drafts}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   874     \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} \\
   875     \indexdef{}{command}{print\_drafts}\mbox{\isa{\isacommand{print{\isacharunderscore}drafts}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
   875     \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} \\
   876   \end{matharray}
   876   \end{matharray}
   877 
   877 
   878   \begin{rail}
   878   \begin{rail}
   879     ('cd' | 'use\_thy' | 'update\_thy') name
   879     ('cd' | 'use\_thy' | 'update\_thy') name
   880     ;
   880     ;
   882     ;
   882     ;
   883   \end{rail}
   883   \end{rail}
   884 
   884 
   885   \begin{descr}
   885   \begin{descr}
   886 
   886 
   887   \item [\mbox{\isa{\isacommand{cd}}}~\isa{path}] changes the current directory
   887   \item [\hyperlink{command.cd}{\mbox{\isa{\isacommand{cd}}}}~\isa{path}] changes the current directory
   888   of the Isabelle process.
   888   of the Isabelle process.
   889 
   889 
   890   \item [\mbox{\isa{\isacommand{pwd}}}] prints the current working directory.
   890   \item [\hyperlink{command.pwd}{\mbox{\isa{\isacommand{pwd}}}}] prints the current working directory.
   891 
   891 
   892   \item [\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}~\isa{A}] preload theory \isa{A}.
   892   \item [\hyperlink{command.use_thy}{\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}}~\isa{A}] preload theory \isa{A}.
   893   These system commands are scarcely used when working interactively,
   893   These system commands are scarcely used when working interactively,
   894   since loading of theories is done automatically as required.
   894   since loading of theories is done automatically as required.
   895 
   895 
   896   \item [\mbox{\isa{\isacommand{display{\isacharunderscore}drafts}}}~\isa{paths} and \mbox{\isa{\isacommand{print{\isacharunderscore}drafts}}}~\isa{paths}] perform simple output of a given list
   896   \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
   897   of raw source files.  Only those symbols that do not require
   897   of raw source files.  Only those symbols that do not require
   898   additional {\LaTeX} packages are displayed properly, everything else
   898   additional {\LaTeX} packages are displayed properly, everything else
   899   is left verbatim.
   899   is left verbatim.
   900 
   900 
   901   \end{descr}%
   901   \end{descr}%