doc-src/IsarRef/Thy/document/pure.tex
author wenzelm
Sat, 10 May 2008 00:14:00 +0200
changeset 26870 94bedbb34b92
parent 26867 6274cf7e2b8e
child 26895 d066f9db833b
permissions -rw-r--r--
misc reorganization;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
     1
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
     2
\begin{isabellebody}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
     3
\def\isabellecontext{pure}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
     4
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
     5
\isadelimtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
     6
\isanewline
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
     7
\isanewline
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
     8
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
     9
\endisadelimtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    10
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    11
\isatagtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    12
\isacommand{theory}\isamarkupfalse%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    13
\ pure\isanewline
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    14
\isakeyword{imports}\ CPure\isanewline
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    15
\isakeyword{begin}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    16
\endisatagtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    17
{\isafoldtheory}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    18
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    19
\isadelimtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    20
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    21
\endisadelimtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    22
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    23
\isamarkupchapter{Basic language elements \label{ch:pure-syntax}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    24
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    25
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    26
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    27
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    28
Subsequently, we introduce the main part of Pure theory and proof
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    29
  commands, together with fundamental proof methods and attributes.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    30
  \Chref{ch:gen-tools} describes further Isar elements provided by
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    31
  generic tools and packages (such as the Simplifier) that are either
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    32
  part of Pure Isabelle or pre-installed in most object logics.
26852
a31203f58b20 misc tuning;
wenzelm
parents: 26842
diff changeset
    33
  Specific language elements introduced by the major object-logics are
a31203f58b20 misc tuning;
wenzelm
parents: 26842
diff changeset
    34
  described in \chref{ch:hol} (Isabelle/HOL), \chref{ch:holcf}
a31203f58b20 misc tuning;
wenzelm
parents: 26842
diff changeset
    35
  (Isabelle/HOLCF), and \chref{ch:zf} (Isabelle/ZF).  Nevertheless,
a31203f58b20 misc tuning;
wenzelm
parents: 26842
diff changeset
    36
  examples given in the generic parts will usually refer to
a31203f58b20 misc tuning;
wenzelm
parents: 26842
diff changeset
    37
  Isabelle/HOL as well.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    38
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    39
  \medskip Isar commands may be either \emph{proper} document
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    40
  constructors, or \emph{improper commands}.  Some proof methods and
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    41
  attributes introduced later are classified as improper as well.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    42
  Improper Isar language elements, which are subsequently marked by
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
    43
  ``\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}}'', are often helpful when developing proof
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    44
  documents, while their use is discouraged for the final
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    45
  human-readable outcome.  Typical examples are diagnostic commands
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    46
  that print terms or theorems according to the current context; other
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    47
  commands emulate old-style tactical theorem proving.%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    48
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    49
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    50
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    51
\isamarkupsection{Theory commands%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    52
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    53
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    54
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    55
\isamarkupsubsection{Markup commands \label{sec:markup-thy}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    56
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    57
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    58
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    59
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    60
\begin{matharray}{rcl}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
    61
    \indexdef{}{command}{chapter}\mbox{\isa{\isacommand{chapter}}} & : & \isarkeep{local{\dsh}theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
    62
    \indexdef{}{command}{section}\mbox{\isa{\isacommand{section}}} & : & \isarkeep{local{\dsh}theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
    63
    \indexdef{}{command}{subsection}\mbox{\isa{\isacommand{subsection}}} & : & \isarkeep{local{\dsh}theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
    64
    \indexdef{}{command}{subsubsection}\mbox{\isa{\isacommand{subsubsection}}} & : & \isarkeep{local{\dsh}theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
    65
    \indexdef{}{command}{text}\mbox{\isa{\isacommand{text}}} & : & \isarkeep{local{\dsh}theory} \\
26854
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
    66
    \indexdef{}{command}{text\_raw}\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}} & : & \isarkeep{local{\dsh}theory} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    67
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    68
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    69
  Apart from formal comments (see \secref{sec:comments}), markup
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    70
  commands provide a structured way to insert text into the document
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    71
  generated from a theory (see \cite{isabelle-sys} for more
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    72
  information on Isabelle's document preparation tools).
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    73
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    74
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    75
    ('chapter' | 'section' | 'subsection' | 'subsubsection' | 'text') target? text
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    76
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    77
    'text\_raw' text
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    78
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    79
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    80
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    81
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    82
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
    83
  \item [\mbox{\isa{\isacommand{chapter}}}, \mbox{\isa{\isacommand{section}}}, \mbox{\isa{\isacommand{subsection}}}, and \mbox{\isa{\isacommand{subsubsection}}}] mark chapter and
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    84
  section headings.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    85
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
    86
  \item [\mbox{\isa{\isacommand{text}}}] specifies paragraphs of plain text.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    87
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
    88
  \item [\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}] inserts {\LaTeX} source into the
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    89
  output, without additional markup.  Thus the full range of document
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    90
  manipulations becomes available.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    91
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    92
  \end{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    93
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
    94
  The \isa{{\isachardoublequote}text{\isachardoublequote}} argument of these markup commands (except for
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
    95
  \mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}) may contain references to formal entities
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    96
  (``antiquotations'', see also \secref{sec:antiq}).  These are
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
    97
  interpreted in the present theory context, or the named \isa{{\isachardoublequote}target{\isachardoublequote}}.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    98
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
    99
  Any of these markup elements corresponds to a {\LaTeX} command with
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   100
  the name prefixed by \verb|\isamarkup|.  For the sectioning
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   101
  commands this is a plain macro with a single argument, e.g.\
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   102
  \verb|\isamarkupchapter{|\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}\verb|}| for
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   103
  \mbox{\isa{\isacommand{chapter}}}.  The \mbox{\isa{\isacommand{text}}} markup results in a
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   104
  {\LaTeX} environment \verb|\begin{isamarkuptext}| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|\end{isamarkuptext}|, while \mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   105
  causes the text to be inserted directly into the {\LaTeX} source.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   106
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   107
  \medskip Additional markup commands are available for proofs (see
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   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
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   109
  section markup just preceding the actual theory definition.%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   110
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   111
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   112
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   113
\isamarkupsubsection{Type classes and sorts \label{sec:classes}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   114
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   115
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   116
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   117
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   118
\begin{matharray}{rcll}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   119
    \indexdef{}{command}{classes}\mbox{\isa{\isacommand{classes}}} & : & \isartrans{theory}{theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   120
    \indexdef{}{command}{classrel}\mbox{\isa{\isacommand{classrel}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   121
    \indexdef{}{command}{defaultsort}\mbox{\isa{\isacommand{defaultsort}}} & : & \isartrans{theory}{theory} \\
26854
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   122
    \indexdef{}{command}{class\_deps}\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}} & : & \isarkeep{theory~|~proof} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   123
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   124
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   125
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   126
    'classes' (classdecl +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   127
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   128
    'classrel' (nameref ('<' | subseteq) nameref + 'and')
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   129
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   130
    'defaultsort' sort
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   131
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   132
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   133
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   134
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   135
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   136
  \item [\mbox{\isa{\isacommand{classes}}}~\isa{{\isachardoublequote}c\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n{\isachardoublequote}}]
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   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.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   138
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   139
  \item [\mbox{\isa{\isacommand{classrel}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}{\isachardoublequote}}] states
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   140
  subclass relations between existing classes \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}{\isachardoublequote}} and
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   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
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   142
  introduce proven class relations.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   143
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   144
  \item [\mbox{\isa{\isacommand{defaultsort}}}~\isa{s}] makes sort \isa{s} the
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   145
  new default sort for any type variables given without sort
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   146
  constraints.  Usually, the default sort would be only changed when
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   147
  defining a new object-logic.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   148
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   149
  \item [\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}}] visualizes the subclass relation,
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   150
  using Isabelle's graph browser tool (see also \cite{isabelle-sys}).
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   151
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   152
  \end{descr}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   153
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   154
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   155
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   156
\isamarkupsubsection{Primitive types and type abbreviations \label{sec:types-pure}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   157
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   158
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   159
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   160
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   161
\begin{matharray}{rcll}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   162
    \indexdef{}{command}{types}\mbox{\isa{\isacommand{types}}} & : & \isartrans{theory}{theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   163
    \indexdef{}{command}{typedecl}\mbox{\isa{\isacommand{typedecl}}} & : & \isartrans{theory}{theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   164
    \indexdef{}{command}{nonterminals}\mbox{\isa{\isacommand{nonterminals}}} & : & \isartrans{theory}{theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   165
    \indexdef{}{command}{arities}\mbox{\isa{\isacommand{arities}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   166
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   167
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   168
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   169
    'types' (typespec '=' type infix? +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   170
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   171
    'typedecl' typespec infix?
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   172
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   173
    'nonterminals' (name +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   174
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   175
    'arities' (nameref '::' arity +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   176
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   177
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   178
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   179
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   180
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   181
  \item [\mbox{\isa{\isacommand{types}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t\ {\isacharequal}\ {\isasymtau}{\isachardoublequote}}]
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   182
  introduces \emph{type synonym} \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   183
  for existing type \isa{{\isachardoublequote}{\isasymtau}{\isachardoublequote}}.  Unlike actual type definitions, as
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   184
  are available in Isabelle/HOL for example, type synonyms are just
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   185
  purely syntactic abbreviations without any logical significance.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   186
  Internally, type synonyms are fully expanded.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   187
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   188
  \item [\mbox{\isa{\isacommand{typedecl}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}]
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   189
  declares a new type constructor \isa{t}, intended as an actual
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   190
  logical type (of the object-logic, if available).
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   191
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   192
  \item [\mbox{\isa{\isacommand{nonterminals}}}~\isa{c}] declares type
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   193
  constructors \isa{c} (without arguments) to act as purely
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   194
  syntactic types, i.e.\ nonterminal symbols of Isabelle's inner
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   195
  syntax of terms or types.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   196
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   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
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   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
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   199
  introduce proven type arities.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   200
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   201
  \end{descr}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   202
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   203
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   204
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   205
\isamarkupsubsection{Primitive constants and definitions \label{sec:consts}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   206
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   207
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   208
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   209
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   210
Definitions essentially express abbreviations within the logic.  The
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   211
  simplest form of a definition is \isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}\ {\isasymequiv}\ t{\isachardoublequote}}, where \isa{c} is a newly declared constant.  Isabelle also allows derived forms
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   212
  where the arguments of \isa{c} appear on the left, abbreviating a
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   213
  prefix of \isa{{\isasymlambda}}-abstractions, e.g.\ \isa{{\isachardoublequote}c\ {\isasymequiv}\ {\isasymlambda}x\ y{\isachardot}\ t{\isachardoublequote}} may be
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   214
  written more conveniently as \isa{{\isachardoublequote}c\ x\ y\ {\isasymequiv}\ t{\isachardoublequote}}.  Moreover,
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   215
  definitions may be weakened by adding arbitrary pre-conditions:
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   216
  \isa{{\isachardoublequote}A\ {\isasymLongrightarrow}\ c\ x\ y\ {\isasymequiv}\ t{\isachardoublequote}}.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   217
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   218
  \medskip The built-in well-formedness conditions for definitional
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   219
  specifications are:
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   220
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   221
  \begin{itemize}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   222
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   223
  \item Arguments (on the left-hand side) must be distinct variables.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   224
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   225
  \item All variables on the right-hand side must also appear on the
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   226
  left-hand side.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   227
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   228
  \item All type variables on the right-hand side must also appear on
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   229
  the left-hand side; this prohibits \isa{{\isachardoublequote}{\isadigit{0}}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymequiv}\ length\ {\isacharparenleft}{\isacharbrackleft}{\isacharbrackright}\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ list{\isacharparenright}{\isachardoublequote}} for example.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   230
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   231
  \item The definition must not be recursive.  Most object-logics
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   232
  provide definitional principles that can be used to express
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   233
  recursion safely.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   234
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   235
  \end{itemize}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   236
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   237
  Overloading means that a constant being declared as \isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ decl{\isachardoublequote}} may be defined separately on type instances \isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}{\isasymbeta}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymbeta}\isactrlsub n{\isacharparenright}\ t\ decl{\isachardoublequote}} for each type constructor \isa{t}.  The right-hand side may mention overloaded constants
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   238
  recursively at type instances corresponding to the immediate
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   239
  argument types \isa{{\isachardoublequote}{\isasymbeta}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymbeta}\isactrlsub n{\isachardoublequote}}.  Incomplete
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   240
  specification patterns impose global constraints on all occurrences,
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   241
  e.g.\ \isa{{\isachardoublequote}d\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ {\isasymtimes}\ {\isasymalpha}{\isachardoublequote}} on the left-hand side means that all
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   242
  corresponding occurrences on some right-hand side need to be an
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   243
  instance of this, general \isa{{\isachardoublequote}d\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ {\isasymtimes}\ {\isasymbeta}{\isachardoublequote}} will be disallowed.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   244
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   245
  \begin{matharray}{rcl}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   246
    \indexdef{}{command}{consts}\mbox{\isa{\isacommand{consts}}} & : & \isartrans{theory}{theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   247
    \indexdef{}{command}{defs}\mbox{\isa{\isacommand{defs}}} & : & \isartrans{theory}{theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   248
    \indexdef{}{command}{constdefs}\mbox{\isa{\isacommand{constdefs}}} & : & \isartrans{theory}{theory} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   249
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   250
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   251
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   252
    'consts' ((name '::' type mixfix?) +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   253
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   254
    'defs' ('(' 'unchecked'? 'overloaded'? ')')? \\ (axmdecl prop +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   255
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   256
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   257
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   258
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   259
    'constdefs' structs? (constdecl? constdef +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   260
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   261
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   262
    structs: '(' 'structure' (vars + 'and') ')'
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   263
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   264
    constdecl:  ((name '::' type mixfix | name '::' type | name mixfix) 'where'?) | name 'where'
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   265
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   266
    constdef: thmdecl? prop
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   267
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   268
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   269
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   270
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   271
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   272
  \item [\mbox{\isa{\isacommand{consts}}}~\isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}{\isachardoublequote}}] declares constant
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   273
  \isa{c} to have any instance of type scheme \isa{{\isasymsigma}}.  The
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   274
  optional mixfix annotations may attach concrete syntax to the
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   275
  constants declared.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   276
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   277
  \item [\mbox{\isa{\isacommand{defs}}}~\isa{{\isachardoublequote}name{\isacharcolon}\ eqn{\isachardoublequote}}] introduces \isa{eqn}
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   278
  as a definitional axiom for some existing constant.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   279
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   280
  The \isa{{\isachardoublequote}{\isacharparenleft}unchecked{\isacharparenright}{\isachardoublequote}} option disables global dependency checks
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   281
  for this definition, which is occasionally useful for exotic
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   282
  overloading.  It is at the discretion of the user to avoid malformed
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   283
  theory specifications!
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   284
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   285
  The \isa{{\isachardoublequote}{\isacharparenleft}overloaded{\isacharparenright}{\isachardoublequote}} option declares definitions to be
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   286
  potentially overloaded.  Unless this option is given, a warning
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   287
  message would be issued for any definitional equation with a more
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   288
  special type than that of the corresponding constant declaration.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   289
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   290
  \item [\mbox{\isa{\isacommand{constdefs}}}] provides a streamlined combination of
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   291
  constants declarations and definitions: type-inference takes care of
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   292
  the most general typing of the given specification (the optional
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   293
  type constraint may refer to type-inference dummies ``\isa{{\isacharunderscore}}'' as usual).  The resulting type declaration needs to agree with
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   294
  that of the specification; overloading is \emph{not} supported here!
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   295
  
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   296
  The constant name may be omitted altogether, if neither type nor
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   297
  syntax declarations are given.  The canonical name of the
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   298
  definitional axiom for constant \isa{c} will be \isa{c{\isacharunderscore}def},
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   299
  unless specified otherwise.  Also note that the given list of
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   300
  specifications is processed in a strictly sequential manner, with
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   301
  type-checking being performed independently.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   302
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   303
  An optional initial context of \isa{{\isachardoublequote}{\isacharparenleft}structure{\isacharparenright}{\isachardoublequote}} declarations
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   304
  admits use of indexed syntax, using the special symbol \verb|\<index>| (printed as ``\isa{{\isachardoublequote}{\isasymindex}{\isachardoublequote}}'').  The latter concept is
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   305
  particularly useful with locales (see also \S\ref{sec:locale}).
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   306
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   307
  \end{descr}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   308
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   309
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   310
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   311
\isamarkupsubsection{Syntax and translations \label{sec:syn-trans}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   312
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   313
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   314
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   315
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   316
\begin{matharray}{rcl}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   317
    \indexdef{}{command}{syntax}\mbox{\isa{\isacommand{syntax}}} & : & \isartrans{theory}{theory} \\
26854
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   318
    \indexdef{}{command}{no\_syntax}\mbox{\isa{\isacommand{no{\isacharunderscore}syntax}}} & : & \isartrans{theory}{theory} \\
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   319
    \indexdef{}{command}{translations}\mbox{\isa{\isacommand{translations}}} & : & \isartrans{theory}{theory} \\
26854
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   320
    \indexdef{}{command}{no\_translations}\mbox{\isa{\isacommand{no{\isacharunderscore}translations}}} & : & \isartrans{theory}{theory} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   321
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   322
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   323
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   324
    ('syntax' | 'no\_syntax') mode? (constdecl +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   325
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   326
    ('translations' | 'no\_translations') (transpat ('==' | '=>' | '<=' | rightleftharpoons | rightharpoonup | leftharpoondown) transpat +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   327
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   328
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   329
    mode: ('(' ( name | 'output' | name 'output' ) ')')
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   330
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   331
    transpat: ('(' nameref ')')? string
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   332
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   333
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   334
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   335
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   336
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   337
  \item [\mbox{\isa{\isacommand{syntax}}}~\isa{{\isachardoublequote}{\isacharparenleft}mode{\isacharparenright}\ decls{\isachardoublequote}}] is similar to
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   338
  \mbox{\isa{\isacommand{consts}}}~\isa{decls}, except that the actual logical
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   339
  signature extension is omitted.  Thus the context free grammar of
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   340
  Isabelle's inner syntax may be augmented in arbitrary ways,
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   341
  independently of the logic.  The \isa{mode} argument refers to the
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   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
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   343
  input and output grammar.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   344
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   345
  \item [\mbox{\isa{\isacommand{no{\isacharunderscore}syntax}}}~\isa{{\isachardoublequote}{\isacharparenleft}mode{\isacharparenright}\ decls{\isachardoublequote}}] removes
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   346
  grammar declarations (and translations) resulting from \isa{decls}, which are interpreted in the same manner as for \mbox{\isa{\isacommand{syntax}}} above.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   347
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   348
  \item [\mbox{\isa{\isacommand{translations}}}~\isa{rules}] specifies syntactic
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   349
  translation rules (i.e.\ macros): parse~/ print rules (\isa{{\isachardoublequote}{\isasymrightleftharpoons}{\isachardoublequote}}),
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   350
  parse rules (\isa{{\isachardoublequote}{\isasymrightharpoonup}{\isachardoublequote}}), or print rules (\isa{{\isachardoublequote}{\isasymleftharpoondown}{\isachardoublequote}}).
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   351
  Translation patterns may be prefixed by the syntactic category to be
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   352
  used for parsing; the default is \isa{logic}.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   353
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   354
  \item [\mbox{\isa{\isacommand{no{\isacharunderscore}translations}}}~\isa{rules}] removes syntactic
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   355
  translation rules, which are interpreted in the same manner as for
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   356
  \mbox{\isa{\isacommand{translations}}} above.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   357
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   358
  \end{descr}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   359
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   360
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   361
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   362
\isamarkupsubsection{Axioms and theorems \label{sec:axms-thms}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   363
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   364
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   365
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   366
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   367
\begin{matharray}{rcll}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   368
    \indexdef{}{command}{axioms}\mbox{\isa{\isacommand{axioms}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   369
    \indexdef{}{command}{lemmas}\mbox{\isa{\isacommand{lemmas}}} & : & \isarkeep{local{\dsh}theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   370
    \indexdef{}{command}{theorems}\mbox{\isa{\isacommand{theorems}}} & : & isarkeep{local{\dsh}theory} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   371
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   372
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   373
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   374
    'axioms' (axmdecl prop +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   375
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   376
    ('lemmas' | 'theorems') target? (thmdef? thmrefs + 'and')
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   377
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   378
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   379
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   380
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   381
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   382
  \item [\mbox{\isa{\isacommand{axioms}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] introduces arbitrary
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   383
  statements as axioms of the meta-logic.  In fact, axioms are
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   384
  ``axiomatic theorems'', and may be referred later just as any other
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   385
  theorem.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   386
  
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   387
  Axioms are usually only introduced when declaring new logical
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   388
  systems.  Everyday work is typically done the hard way, with proper
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   389
  definitions and proven theorems.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   390
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   391
  \item [\mbox{\isa{\isacommand{lemmas}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}]
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   392
  retrieves and stores existing facts in the theory context, or the
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   393
  specified target context (see also \secref{sec:target}).  Typical
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   394
  applications would also involve attributes, to declare Simplifier
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   395
  rules, for example.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   396
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   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.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   398
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   399
  \end{descr}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   400
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   401
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   402
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   403
\isamarkupsubsection{Name spaces%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   404
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   405
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   406
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   407
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   408
\begin{matharray}{rcl}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   409
    \indexdef{}{command}{global}\mbox{\isa{\isacommand{global}}} & : & \isartrans{theory}{theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   410
    \indexdef{}{command}{local}\mbox{\isa{\isacommand{local}}} & : & \isartrans{theory}{theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   411
    \indexdef{}{command}{hide}\mbox{\isa{\isacommand{hide}}} & : & \isartrans{theory}{theory} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   412
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   413
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   414
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   415
    'hide' ('(open)')? name (nameref + )
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   416
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   417
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   418
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   419
  Isabelle organizes any kind of name declarations (of types,
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   420
  constants, theorems etc.) by separate hierarchically structured name
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   421
  spaces.  Normally the user does not have to control the behavior of
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   422
  name spaces by hand, yet the following commands provide some way to
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   423
  do so.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   424
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   425
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   426
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   427
  \item [\mbox{\isa{\isacommand{global}}} and \mbox{\isa{\isacommand{local}}}] change the
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   428
  current name declaration mode.  Initially, theories start in
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   429
  \mbox{\isa{\isacommand{local}}} mode, causing all names to be automatically
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   430
  qualified by the theory name.  Changing this to \mbox{\isa{\isacommand{global}}}
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   431
  causes all names to be declared without the theory prefix, until
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   432
  \mbox{\isa{\isacommand{local}}} is declared again.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   433
  
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   434
  Note that global names are prone to get hidden accidently later,
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   435
  when qualified names of the same base name are introduced.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   436
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   437
  \item [\mbox{\isa{\isacommand{hide}}}~\isa{{\isachardoublequote}space\ names{\isachardoublequote}}] fully removes
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   438
  declarations from a given name space (which may be \isa{{\isachardoublequote}class{\isachardoublequote}},
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   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
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   440
  (unqualified) names may never be hidden.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   441
  
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   442
  Note that hiding name space accesses has no impact on logical
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   443
  declarations -- they remain valid internally.  Entities that are no
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   444
  longer accessible to the user are printed with the special qualifier
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   445
  ``\isa{{\isachardoublequote}{\isacharquery}{\isacharquery}{\isachardoublequote}}'' prefixed to the full internal name.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   446
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   447
  \end{descr}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   448
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   449
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   450
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   451
\isamarkupsubsection{Incorporating ML code \label{sec:ML}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   452
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   453
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   454
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   455
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   456
\begin{matharray}{rcl}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   457
    \indexdef{}{command}{use}\mbox{\isa{\isacommand{use}}} & : & \isarkeep{theory~|~local{\dsh}theory} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   458
    \indexdef{}{command}{ML}\mbox{\isa{\isacommand{ML}}} & : & \isarkeep{theory~|~local{\dsh}theory} \\
26854
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   459
    \indexdef{}{command}{ML\_val}\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}} & : & \isartrans{\cdot}{\cdot} \\
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   460
    \indexdef{}{command}{ML\_command}\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}} & : & \isartrans{\cdot}{\cdot} \\
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   461
    \indexdef{}{command}{setup}\mbox{\isa{\isacommand{setup}}} & : & \isartrans{theory}{theory} \\
26854
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   462
    \indexdef{}{command}{method\_setup}\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}} & : & \isartrans{theory}{theory} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   463
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   464
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   465
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   466
    'use' name
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   467
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   468
    ('ML' | 'ML\_val' | 'ML\_command' | 'setup') text
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   469
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   470
    'method\_setup' name '=' text text
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   471
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   472
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   473
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   474
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   475
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   476
  \item [\mbox{\isa{\isacommand{use}}}~\isa{{\isachardoublequote}file{\isachardoublequote}}] reads and executes ML
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   477
  commands from \isa{{\isachardoublequote}file{\isachardoublequote}}.  The current theory context is passed
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   478
  down to the ML toplevel and may be modified, using \verb|"Context.>>"| or derived ML commands.  The file name is checked with
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   479
  the \indexref{}{keyword}{uses}\mbox{\isa{\isakeyword{uses}}} dependency declaration given in the theory
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   480
  header (see also \secref{sec:begin-thy}).
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   481
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   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}}.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   483
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   484
  \item [\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}} and \mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}] are
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   485
  diagnostic versions of \mbox{\isa{\isacommand{ML}}}, which means that the context
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   486
  may not be updated.  \mbox{\isa{\isacommand{ML{\isacharunderscore}val}}} echos the bindings produced
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   487
  at the ML toplevel, but \mbox{\isa{\isacommand{ML{\isacharunderscore}command}}} is silent.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   488
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   489
  \item [\mbox{\isa{\isacommand{setup}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] changes the current theory
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   490
  context by applying \isa{{\isachardoublequote}text{\isachardoublequote}}, which refers to an ML expression
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   491
  of type \verb|"theory -> theory"|.  This enables to initialize
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   492
  any object-logic specific tools and packages written in ML, for
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   493
  example.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   494
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   495
  \item [\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}}~\isa{{\isachardoublequote}name\ {\isacharequal}\ text\ description{\isachardoublequote}}]
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   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%
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   497
\verb|  Proof.context -> Proof.method"|.  Parsing concrete method syntax
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   498
  from \verb|Args.src| input can be quite tedious in general.  The
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   499
  following simple examples are for methods without any explicit
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   500
  arguments, or a list of theorems, respectively.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   501
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   502
%FIXME proper antiquotations
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   503
{\footnotesize
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   504
\begin{verbatim}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   505
 Method.no_args (Method.METHOD (fn facts => foobar_tac))
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   506
 Method.thms_args (fn thms => Method.METHOD (fn facts => foobar_tac))
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   507
 Method.ctxt_args (fn ctxt => Method.METHOD (fn facts => foobar_tac))
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   508
 Method.thms_ctxt_args (fn thms => fn ctxt =>
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   509
    Method.METHOD (fn facts => foobar_tac))
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   510
\end{verbatim}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   511
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   512
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   513
  Note that mere tactic emulations may ignore the \isa{facts}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   514
  parameter above.  Proper proof methods would do something
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   515
  appropriate with the list of current facts, though.  Single-rule
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   516
  methods usually do strict forward-chaining (e.g.\ by using \verb|Drule.multi_resolves|), while automatic ones just insert the facts
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   517
  using \verb|Method.insert_tac| before applying the main tactic.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   518
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   519
  \end{descr}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   520
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   521
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   522
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   523
\isamarkupsubsection{Syntax translation functions%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   524
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   525
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   526
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   527
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   528
\begin{matharray}{rcl}
26854
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   529
    \indexdef{}{command}{parse\_ast\_translation}\mbox{\isa{\isacommand{parse{\isacharunderscore}ast{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   530
    \indexdef{}{command}{parse\_translation}\mbox{\isa{\isacommand{parse{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   531
    \indexdef{}{command}{print\_translation}\mbox{\isa{\isacommand{print{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   532
    \indexdef{}{command}{typed\_print\_translation}\mbox{\isa{\isacommand{typed{\isacharunderscore}print{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   533
    \indexdef{}{command}{print\_ast\_translation}\mbox{\isa{\isacommand{print{\isacharunderscore}ast{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   534
    \indexdef{}{command}{token\_translation}\mbox{\isa{\isacommand{token{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   535
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   536
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   537
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   538
  ( 'parse\_ast\_translation' | 'parse\_translation' | 'print\_translation' |
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   539
    'typed\_print\_translation' | 'print\_ast\_translation' ) ('(advanced)')? text
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   540
  ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   541
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   542
  'token\_translation' text
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   543
  ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   544
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   545
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   546
  Syntax translation functions written in ML admit almost arbitrary
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   547
  manipulations of Isabelle's inner syntax.  Any of the above commands
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   548
  have a single \railqtok{text} argument that refers to an ML
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   549
  expression of appropriate type, which are as follows by default:
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   550
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   551
%FIXME proper antiquotations
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   552
\begin{ttbox}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   553
val parse_ast_translation   : (string * (ast list -> ast)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   554
val parse_translation       : (string * (term list -> term)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   555
val print_translation       : (string * (term list -> term)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   556
val typed_print_translation :
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   557
  (string * (bool -> typ -> term list -> term)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   558
val print_ast_translation   : (string * (ast list -> ast)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   559
val token_translation       :
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   560
  (string * string * (string -> string * real)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   561
\end{ttbox}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   562
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   563
  If the \isa{{\isachardoublequote}{\isacharparenleft}advanced{\isacharparenright}{\isachardoublequote}} option is given, the corresponding
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   564
  translation functions may depend on the current theory or proof
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   565
  context.  This allows to implement advanced syntax mechanisms, as
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   566
  translations functions may refer to specific theory declarations or
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   567
  auxiliary proof data.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   568
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   569
  See also \cite[\S8]{isabelle-ref} for more information on the
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   570
  general concept of syntax transformations in Isabelle.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   571
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   572
%FIXME proper antiquotations
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   573
\begin{ttbox}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   574
val parse_ast_translation:
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   575
  (string * (Context.generic -> ast list -> ast)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   576
val parse_translation:
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   577
  (string * (Context.generic -> term list -> term)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   578
val print_translation:
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   579
  (string * (Context.generic -> term list -> term)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   580
val typed_print_translation:
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   581
  (string * (Context.generic -> bool -> typ -> term list -> term)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   582
val print_ast_translation:
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   583
  (string * (Context.generic -> ast list -> ast)) list
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   584
\end{ttbox}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   585
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   586
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   587
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   588
\isamarkupsubsection{Oracles%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   589
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   590
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   591
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   592
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   593
\begin{matharray}{rcl}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   594
    \indexdef{}{command}{oracle}\mbox{\isa{\isacommand{oracle}}} & : & \isartrans{theory}{theory} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   595
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   596
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   597
  The oracle interface promotes a given ML function \verb|theory -> T -> term| to \verb|theory -> T -> thm|, for some
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   598
  type \verb|T| given by the user.  This acts like an infinitary
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   599
  specification of axioms -- there is no internal check of the
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   600
  correctness of the results!  The inference kernel records oracle
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   601
  invocations within the internal derivation object of theorems, and
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   602
  the pretty printer attaches ``\isa{{\isachardoublequote}{\isacharbrackleft}{\isacharbang}{\isacharbrackright}{\isachardoublequote}}'' to indicate results
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   603
  that are not fully checked by Isabelle inferences.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   604
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   605
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   606
    'oracle' name '(' type ')' '=' text
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   607
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   608
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   609
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   610
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   611
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   612
  \item [\mbox{\isa{\isacommand{oracle}}}~\isa{{\isachardoublequote}name\ {\isacharparenleft}type{\isacharparenright}\ {\isacharequal}\ text{\isachardoublequote}}] turns the
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   613
  given ML expression \isa{{\isachardoublequote}text{\isachardoublequote}} of type
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   614
  \verb|theory ->|~\isa{{\isachardoublequote}type{\isachardoublequote}}~\verb|-> term| into an
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   615
  ML function of type
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   616
  \verb|theory ->|~\isa{{\isachardoublequote}type{\isachardoublequote}}~\verb|-> thm|, which is
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   617
  bound to the global identifier \verb|name|.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   618
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   619
  \end{descr}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   620
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   621
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   622
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   623
\isamarkupsection{Proof commands%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   624
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   625
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   626
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   627
\isamarkupsubsection{Markup commands \label{sec:markup-prf}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   628
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   629
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   630
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   631
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   632
\begin{matharray}{rcl}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   633
    \indexdef{}{command}{sect}\mbox{\isa{\isacommand{sect}}} & : & \isartrans{proof}{proof} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   634
    \indexdef{}{command}{subsect}\mbox{\isa{\isacommand{subsect}}} & : & \isartrans{proof}{proof} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   635
    \indexdef{}{command}{subsubsect}\mbox{\isa{\isacommand{subsubsect}}} & : & \isartrans{proof}{proof} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   636
    \indexdef{}{command}{txt}\mbox{\isa{\isacommand{txt}}} & : & \isartrans{proof}{proof} \\
26854
9b4aec46ad78 improved treatment of "_" thanks to underscore.sty;
wenzelm
parents: 26852
diff changeset
   637
    \indexdef{}{command}{txt\_raw}\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}} & : & \isartrans{proof}{proof} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   638
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   639
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   640
  These markup commands for proof mode closely correspond to the ones
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   641
  of theory mode (see \S\ref{sec:markup-thy}).
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   642
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   643
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   644
    ('sect' | 'subsect' | 'subsubsect' | 'txt' | 'txt\_raw') text
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   645
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   646
  \end{rail}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   647
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   648
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   649
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   650
\isamarkupsection{Other commands%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   651
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   652
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   653
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   654
\isamarkupsubsection{Diagnostics%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   655
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   656
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   657
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   658
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   659
\begin{matharray}{rcl}
26867
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   660
    \indexdef{}{command}{pr}\mbox{\isa{\isacommand{pr}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   661
    \indexdef{}{command}{thm}\mbox{\isa{\isacommand{thm}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   662
    \indexdef{}{command}{term}\mbox{\isa{\isacommand{term}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   663
    \indexdef{}{command}{prop}\mbox{\isa{\isacommand{prop}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   664
    \indexdef{}{command}{typ}\mbox{\isa{\isacommand{typ}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   665
    \indexdef{}{command}{prf}\mbox{\isa{\isacommand{prf}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   666
    \indexdef{}{command}{full\_prf}\mbox{\isa{\isacommand{full{\isacharunderscore}prf}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   667
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   668
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   669
  These diagnostic commands assist interactive development.  Note that
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   670
  \mbox{\isa{\isacommand{undo}}} does not apply here, the theory or proof
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   671
  configuration is not changed.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   672
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   673
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   674
    'pr' modes? nat? (',' nat)?
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   675
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   676
    'thm' modes? thmrefs
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   677
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   678
    'term' modes? term
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   679
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   680
    'prop' modes? prop
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   681
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   682
    'typ' modes? type
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   683
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   684
    'prf' modes? thmrefs?
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   685
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   686
    'full\_prf' modes? thmrefs?
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   687
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   688
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   689
    modes: '(' (name + ) ')'
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   690
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   691
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   692
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   693
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   694
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   695
  \item [\mbox{\isa{\isacommand{pr}}}~\isa{{\isachardoublequote}goals{\isacharcomma}\ prems{\isachardoublequote}}] prints the current
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   696
  proof state (if present), including the proof context, current facts
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   697
  and goals.  The optional limit arguments affect the number of goals
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   698
  and premises to be displayed, which is initially 10 for both.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   699
  Omitting limit values leaves the current setting unchanged.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   700
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   701
  \item [\mbox{\isa{\isacommand{thm}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] retrieves
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   702
  theorems from the current theory or proof context.  Note that any
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   703
  attributes included in the theorem specifications are applied to a
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   704
  temporary context derived from the current theory or proof; the
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   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.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   706
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   707
  \item [\mbox{\isa{\isacommand{term}}}~\isa{t} and \mbox{\isa{\isacommand{prop}}}~\isa{{\isasymphi}}]
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   708
  read, type-check and print terms or propositions according to the
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   709
  current theory or proof context; the inferred type of \isa{t} is
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   710
  output as well.  Note that these commands are also useful in
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   711
  inspecting the current environment of term abbreviations.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   712
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   713
  \item [\mbox{\isa{\isacommand{typ}}}~\isa{{\isasymtau}}] reads and prints types of the
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   714
  meta-logic according to the current theory or proof context.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   715
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   716
  \item [\mbox{\isa{\isacommand{prf}}}] displays the (compact) proof term of the
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   717
  current proof state (if present), or of the given theorems. Note
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   718
  that this requires proof terms to be switched on for the current
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   719
  object logic (see the ``Proof terms'' section of the Isabelle
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   720
  reference manual for information on how to do this).
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   721
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   722
  \item [\mbox{\isa{\isacommand{full{\isacharunderscore}prf}}}] is like \mbox{\isa{\isacommand{prf}}}, but displays
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   723
  the full proof term, i.e.\ also displays information omitted in the
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   724
  compact proof term, which is denoted by ``\isa{{\isacharunderscore}}'' placeholders
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   725
  there.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   726
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   727
  \end{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   728
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   729
  All of the diagnostic commands above admit a list of \isa{modes}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   730
  to be specified, which is appended to the current print mode (see
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   731
  also \cite{isabelle-ref}).  Thus the output behavior may be modified
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   732
  according particular print mode features.  For example, \mbox{\isa{\isacommand{pr}}}~\isa{{\isachardoublequote}{\isacharparenleft}latex\ xsymbols\ symbols{\isacharparenright}{\isachardoublequote}} would print the current
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   733
  proof state with mathematical symbols and special characters
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   734
  represented in {\LaTeX} source, according to the Isabelle style
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   735
  \cite{isabelle-sys}.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   736
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   737
  Note that antiquotations (cf.\ \secref{sec:antiq}) provide a more
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   738
  systematic way to include formal items into the printed text
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   739
  document.%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   740
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   741
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   742
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   743
\isamarkupsubsection{Inspecting the context%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   744
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   745
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   746
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   747
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   748
\begin{matharray}{rcl}
26867
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   749
    \indexdef{}{command}{print\_commands}\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   750
    \indexdef{}{command}{print\_theory}\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   751
    \indexdef{}{command}{print\_syntax}\mbox{\isa{\isacommand{print{\isacharunderscore}syntax}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   752
    \indexdef{}{command}{print\_methods}\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   753
    \indexdef{}{command}{print\_attributes}\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   754
    \indexdef{}{command}{print\_theorems}\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   755
    \indexdef{}{command}{find\_theorems}\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   756
    \indexdef{}{command}{thms\_deps}\mbox{\isa{\isacommand{thms{\isacharunderscore}deps}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   757
    \indexdef{}{command}{print\_facts}\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{proof} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   758
    \indexdef{}{command}{print\_binds}\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{proof} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   759
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   760
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   761
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   762
    'print\_theory' ( '!'?)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   763
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   764
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   765
    'find\_theorems' (('(' (nat)? ('with\_dups')? ')')?) (criterion *)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   766
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   767
    criterion: ('-'?) ('name' ':' nameref | 'intro' | 'elim' | 'dest' |
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   768
      'simp' ':' term | term)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   769
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   770
    'thm\_deps' thmrefs
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   771
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   772
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   773
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   774
  These commands print certain parts of the theory and proof context.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   775
  Note that there are some further ones available, such as for the set
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   776
  of rules declared for simplifications.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   777
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   778
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   779
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   780
  \item [\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}] prints Isabelle's outer theory
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   781
  syntax, including keywords and command.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   782
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   783
  \item [\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}] prints the main logical content of
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   784
  the theory context; the ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' option indicates extra
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   785
  verbosity.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   786
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   787
  \item [\mbox{\isa{\isacommand{print{\isacharunderscore}syntax}}}] prints the inner syntax of types
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   788
  and terms, depending on the current context.  The output can be very
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   789
  verbose, including grammar tables and syntax translation rules.  See
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   790
  \cite[\S7, \S8]{isabelle-ref} for further information on Isabelle's
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   791
  inner syntax.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   792
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   793
  \item [\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}] prints all proof methods
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   794
  available in the current theory context.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   795
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   796
  \item [\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}] prints all attributes
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   797
  available in the current theory context.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   798
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   799
  \item [\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}] prints theorems resulting from
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   800
  the last command.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   801
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   802
  \item [\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}~\isa{criteria}] retrieves facts
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   803
  from the theory or proof context matching all of given search
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   804
  criteria.  The criterion \isa{{\isachardoublequote}name{\isacharcolon}\ p{\isachardoublequote}} selects all theorems
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   805
  whose fully qualified name matches pattern \isa{p}, which may
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   806
  contain ``\isa{{\isachardoublequote}{\isacharasterisk}{\isachardoublequote}}'' wildcards.  The criteria \isa{intro},
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   807
  \isa{elim}, and \isa{dest} select theorems that match the
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   808
  current goal as introduction, elimination or destruction rules,
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   809
  respectively.  The criterion \isa{{\isachardoublequote}simp{\isacharcolon}\ t{\isachardoublequote}} selects all rewrite
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   810
  rules whose left-hand side matches the given term.  The criterion
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   811
  term \isa{t} selects all theorems that contain the pattern \isa{t} -- as usual, patterns may contain occurrences of the dummy
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   812
  ``\isa{{\isacharunderscore}}'', schematic variables, and type constraints.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   813
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   814
  Criteria can be preceded by ``\isa{{\isachardoublequote}{\isacharminus}{\isachardoublequote}}'' to select theorems that
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   815
  do \emph{not} match. Note that giving the empty list of criteria
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   816
  yields \emph{all} currently known facts.  An optional limit for the
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   817
  number of printed facts may be given; the default is 40.  By
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   818
  default, duplicates are removed from the search result. Use
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   819
  \mbox{\isa{\isakeyword{with{\isacharunderscore}dups}}} to display duplicates.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   820
  
26842
81308d44fe0a updated generated file;
wenzelm
parents: 26788
diff changeset
   821
  \item [\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}]
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   822
  visualizes dependencies of facts, using Isabelle's graph browser
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   823
  tool (see also \cite{isabelle-sys}).
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   824
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   825
  \item [\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}] prints all local facts of the
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   826
  current context, both named and unnamed ones.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   827
  
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   828
  \item [\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}] prints all term abbreviations
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   829
  present in the context.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   830
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   831
  \end{descr}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   832
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   833
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   834
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   835
\isamarkupsubsection{History commands \label{sec:history}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   836
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   837
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   838
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   839
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   840
\begin{matharray}{rcl}
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   841
    \indexdef{}{command}{undo}\mbox{\isa{\isacommand{undo}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   842
    \indexdef{}{command}{redo}\mbox{\isa{\isacommand{redo}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   843
    \indexdef{}{command}{kill}\mbox{\isa{\isacommand{kill}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   844
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   845
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   846
  The Isabelle/Isar top-level maintains a two-stage history, for
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   847
  theory and proof state transformation.  Basically, any command can
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   848
  be undone using \mbox{\isa{\isacommand{undo}}}, excluding mere diagnostic
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   849
  elements.  Its effect may be revoked via \mbox{\isa{\isacommand{redo}}}, unless
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   850
  the corresponding \mbox{\isa{\isacommand{undo}}} step has crossed the beginning
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   851
  of a proof or theory.  The \mbox{\isa{\isacommand{kill}}} command aborts the
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   852
  current history node altogether, discontinuing a proof or even the
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   853
  whole theory.  This operation is \emph{not} undo-able.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   854
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   855
  \begin{warn}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   856
    History commands should never be used with user interfaces such as
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   857
    Proof~General \cite{proofgeneral,Aspinall:TACAS:2000}, which takes
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   858
    care of stepping forth and back itself.  Interfering by manual
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   859
    \mbox{\isa{\isacommand{undo}}}, \mbox{\isa{\isacommand{redo}}}, or even \mbox{\isa{\isacommand{kill}}}
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   860
    commands would quickly result in utter confusion.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   861
  \end{warn}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   862
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   863
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   864
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   865
\isamarkupsubsection{System operations%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   866
}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   867
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   868
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   869
\begin{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   870
\begin{matharray}{rcl}
26867
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   871
    \indexdef{}{command}{cd}\mbox{\isa{\isacommand{cd}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   872
    \indexdef{}{command}{pwd}\mbox{\isa{\isacommand{pwd}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   873
    \indexdef{}{command}{use\_thy}\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   874
    \indexdef{}{command}{display\_drafts}\mbox{\isa{\isacommand{display{\isacharunderscore}drafts}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
6274cf7e2b8e updated generated file;
wenzelm
parents: 26854
diff changeset
   875
    \indexdef{}{command}{print\_drafts}\mbox{\isa{\isacommand{print{\isacharunderscore}drafts}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   876
  \end{matharray}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   877
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   878
  \begin{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   879
    ('cd' | 'use\_thy' | 'update\_thy') name
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   880
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   881
    ('display\_drafts' | 'print\_drafts') (name +)
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   882
    ;
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   883
  \end{rail}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   884
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   885
  \begin{descr}
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   886
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   887
  \item [\mbox{\isa{\isacommand{cd}}}~\isa{path}] changes the current directory
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   888
  of the Isabelle process.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   889
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   890
  \item [\mbox{\isa{\isacommand{pwd}}}] prints the current working directory.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   891
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   892
  \item [\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}~\isa{A}] preload theory \isa{A}.
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   893
  These system commands are scarcely used when working interactively,
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   894
  since loading of theories is done automatically as required.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   895
26776
030db8c8b79d updated generated file;
wenzelm
parents: 26767
diff changeset
   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
26767
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   897
  of raw source files.  Only those symbols that do not require
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   898
  additional {\LaTeX} packages are displayed properly, everything else
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   899
  is left verbatim.
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   900
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   901
  \end{descr}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   902
\end{isamarkuptext}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   903
\isamarkuptrue%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   904
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   905
\isadelimtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   906
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   907
\endisadelimtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   908
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   909
\isatagtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   910
\isacommand{end}\isamarkupfalse%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   911
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   912
\endisatagtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   913
{\isafoldtheory}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   914
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   915
\isadelimtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   916
%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   917
\endisadelimtheory
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   918
\isanewline
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   919
\end{isabellebody}%
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   920
%%% Local Variables:
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   921
%%% mode: latex
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   922
%%% TeX-master: "root"
cc127cc0951b converted pure.tex to Thy/pure.thy;
wenzelm
parents:
diff changeset
   923
%%% End: