| author | wenzelm |
| Fri, 09 May 2008 23:20:43 +0200 | |
| changeset 26867 | 6274cf7e2b8e |
| parent 26854 | 9b4aec46ad78 |
| child 26870 | 94bedbb34b92 |
| permissions | -rw-r--r-- |
| 26767 | 1 |
% |
2 |
\begin{isabellebody}%
|
|
3 |
\def\isabellecontext{pure}%
|
|
4 |
% |
|
5 |
\isadelimtheory |
|
6 |
\isanewline |
|
7 |
\isanewline |
|
8 |
% |
|
9 |
\endisadelimtheory |
|
10 |
% |
|
11 |
\isatagtheory |
|
12 |
\isacommand{theory}\isamarkupfalse%
|
|
13 |
\ pure\isanewline |
|
14 |
\isakeyword{imports}\ CPure\isanewline
|
|
15 |
\isakeyword{begin}%
|
|
16 |
\endisatagtheory |
|
17 |
{\isafoldtheory}%
|
|
18 |
% |
|
19 |
\isadelimtheory |
|
20 |
% |
|
21 |
\endisadelimtheory |
|
22 |
% |
|
23 |
\isamarkupchapter{Basic language elements \label{ch:pure-syntax}%
|
|
24 |
} |
|
25 |
\isamarkuptrue% |
|
26 |
% |
|
27 |
\begin{isamarkuptext}%
|
|
28 |
Subsequently, we introduce the main part of Pure theory and proof |
|
29 |
commands, together with fundamental proof methods and attributes. |
|
30 |
\Chref{ch:gen-tools} describes further Isar elements provided by
|
|
31 |
generic tools and packages (such as the Simplifier) that are either |
|
32 |
part of Pure Isabelle or pre-installed in most object logics. |
|
| 26852 | 33 |
Specific language elements introduced by the major object-logics are |
34 |
described in \chref{ch:hol} (Isabelle/HOL), \chref{ch:holcf}
|
|
35 |
(Isabelle/HOLCF), and \chref{ch:zf} (Isabelle/ZF). Nevertheless,
|
|
36 |
examples given in the generic parts will usually refer to |
|
37 |
Isabelle/HOL as well. |
|
| 26767 | 38 |
|
39 |
\medskip Isar commands may be either \emph{proper} document
|
|
40 |
constructors, or \emph{improper commands}. Some proof methods and
|
|
41 |
attributes introduced later are classified as improper as well. |
|
42 |
Improper Isar language elements, which are subsequently marked by |
|
| 26842 | 43 |
``\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}}'', are often helpful when developing proof
|
| 26767 | 44 |
documents, while their use is discouraged for the final |
45 |
human-readable outcome. Typical examples are diagnostic commands |
|
46 |
that print terms or theorems according to the current context; other |
|
47 |
commands emulate old-style tactical theorem proving.% |
|
48 |
\end{isamarkuptext}%
|
|
49 |
\isamarkuptrue% |
|
50 |
% |
|
51 |
\isamarkupsection{Theory commands%
|
|
52 |
} |
|
53 |
\isamarkuptrue% |
|
54 |
% |
|
55 |
\isamarkupsubsection{Defining theories \label{sec:begin-thy}%
|
|
56 |
} |
|
57 |
\isamarkuptrue% |
|
58 |
% |
|
59 |
\begin{isamarkuptext}%
|
|
60 |
\begin{matharray}{rcl}
|
|
| 26776 | 61 |
\indexdef{}{command}{header}\mbox{\isa{\isacommand{header}}} & : & \isarkeep{toplevel} \\
|
62 |
\indexdef{}{command}{theory}\mbox{\isa{\isacommand{theory}}} & : & \isartrans{toplevel}{theory} \\
|
|
63 |
\indexdef{}{command}{end}\mbox{\isa{\isacommand{end}}} & : & \isartrans{theory}{toplevel} \\
|
|
| 26767 | 64 |
\end{matharray}
|
65 |
||
66 |
Isabelle/Isar theories are defined via theory, which contain both |
|
67 |
specifications and proofs; occasionally definitional mechanisms also |
|
68 |
require some explicit proof. |
|
69 |
||
| 26776 | 70 |
The first ``real'' command of any theory has to be \mbox{\isa{\isacommand{theory}}}, which starts a new theory based on the merge of existing
|
71 |
ones. Just preceding the \mbox{\isa{\isacommand{theory}}} keyword, there may be
|
|
72 |
an optional \mbox{\isa{\isacommand{header}}} declaration, which is relevant to
|
|
| 26767 | 73 |
document preparation only; it acts very much like a special |
74 |
pre-theory markup command (cf.\ \secref{sec:markup-thy} and
|
|
| 26776 | 75 |
\secref{sec:markup-thy}). The \mbox{\isa{\isacommand{end}}} command concludes a
|
| 26767 | 76 |
theory development; it has to be the very last command of any theory |
77 |
file loaded in batch-mode. |
|
78 |
||
79 |
\begin{rail}
|
|
80 |
'header' text |
|
81 |
; |
|
82 |
'theory' name 'imports' (name +) uses? 'begin' |
|
83 |
; |
|
84 |
||
85 |
uses: 'uses' ((name | parname) +); |
|
86 |
\end{rail}
|
|
87 |
||
88 |
\begin{descr}
|
|
89 |
||
| 26842 | 90 |
\item [\mbox{\isa{\isacommand{header}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] provides plain text
|
| 26767 | 91 |
markup just preceding the formal beginning of a theory. In actual |
92 |
document preparation the corresponding {\LaTeX} macro \verb|\isamarkupheader| may be redefined to produce chapter or section
|
|
93 |
headings. See also \secref{sec:markup-thy} and
|
|
94 |
\secref{sec:markup-prf} for further markup commands.
|
|
95 |
||
| 26842 | 96 |
\item [\mbox{\isa{\isacommand{theory}}}~\isa{{\isachardoublequote}A\ {\isasymIMPORTS}\ B\isactrlsub {\isadigit{1}}\ {\isasymdots}\ B\isactrlsub n\ {\isasymBEGIN}{\isachardoublequote}}] starts a new theory \isa{A} based on the
|
97 |
merge of existing theories \isa{{\isachardoublequote}B\isactrlsub {\isadigit{1}}\ {\isasymdots}\ B\isactrlsub n{\isachardoublequote}}.
|
|
| 26767 | 98 |
|
99 |
Due to inclusion of several ancestors, the overall theory structure |
|
100 |
emerging in an Isabelle session forms a directed acyclic graph |
|
101 |
(DAG). Isabelle's theory loader ensures that the sources |
|
102 |
contributing to the development graph are always up-to-date. |
|
103 |
Changed files are automatically reloaded when processing theory |
|
104 |
headers. |
|
105 |
||
| 26776 | 106 |
The optional \indexdef{}{keyword}{uses}\mbox{\isa{\isakeyword{uses}}} specification declares additional
|
| 26767 | 107 |
dependencies on extra files (usually ML sources). Files will be |
108 |
loaded immediately (as ML), unless the name is put in parentheses, |
|
109 |
which merely documents the dependency to be resolved later in the |
|
| 26776 | 110 |
text (typically via explicit \indexref{}{command}{use}\mbox{\isa{\isacommand{use}}} in the body text,
|
| 26767 | 111 |
see \secref{sec:ML}).
|
112 |
||
| 26776 | 113 |
\item [\mbox{\isa{\isacommand{end}}}] concludes the current theory definition or
|
| 26767 | 114 |
context switch. |
115 |
||
116 |
\end{descr}%
|
|
117 |
\end{isamarkuptext}%
|
|
118 |
\isamarkuptrue% |
|
119 |
% |
|
120 |
\isamarkupsubsection{Markup commands \label{sec:markup-thy}%
|
|
121 |
} |
|
122 |
\isamarkuptrue% |
|
123 |
% |
|
124 |
\begin{isamarkuptext}%
|
|
125 |
\begin{matharray}{rcl}
|
|
| 26776 | 126 |
\indexdef{}{command}{chapter}\mbox{\isa{\isacommand{chapter}}} & : & \isarkeep{local{\dsh}theory} \\
|
127 |
\indexdef{}{command}{section}\mbox{\isa{\isacommand{section}}} & : & \isarkeep{local{\dsh}theory} \\
|
|
128 |
\indexdef{}{command}{subsection}\mbox{\isa{\isacommand{subsection}}} & : & \isarkeep{local{\dsh}theory} \\
|
|
129 |
\indexdef{}{command}{subsubsection}\mbox{\isa{\isacommand{subsubsection}}} & : & \isarkeep{local{\dsh}theory} \\
|
|
130 |
\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
|
131 |
\indexdef{}{command}{text\_raw}\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}} & : & \isarkeep{local{\dsh}theory} \\
|
| 26767 | 132 |
\end{matharray}
|
133 |
||
134 |
Apart from formal comments (see \secref{sec:comments}), markup
|
|
135 |
commands provide a structured way to insert text into the document |
|
136 |
generated from a theory (see \cite{isabelle-sys} for more
|
|
137 |
information on Isabelle's document preparation tools). |
|
138 |
||
139 |
\begin{rail}
|
|
140 |
('chapter' | 'section' | 'subsection' | 'subsubsection' | 'text') target? text
|
|
141 |
; |
|
142 |
'text\_raw' text |
|
143 |
; |
|
144 |
\end{rail}
|
|
145 |
||
146 |
\begin{descr}
|
|
147 |
||
| 26776 | 148 |
\item [\mbox{\isa{\isacommand{chapter}}}, \mbox{\isa{\isacommand{section}}}, \mbox{\isa{\isacommand{subsection}}}, and \mbox{\isa{\isacommand{subsubsection}}}] mark chapter and
|
| 26767 | 149 |
section headings. |
150 |
||
| 26776 | 151 |
\item [\mbox{\isa{\isacommand{text}}}] specifies paragraphs of plain text.
|
| 26767 | 152 |
|
| 26776 | 153 |
\item [\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}] inserts {\LaTeX} source into the
|
| 26767 | 154 |
output, without additional markup. Thus the full range of document |
155 |
manipulations becomes available. |
|
156 |
||
157 |
\end{descr}
|
|
158 |
||
| 26842 | 159 |
The \isa{{\isachardoublequote}text{\isachardoublequote}} argument of these markup commands (except for
|
| 26776 | 160 |
\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}) may contain references to formal entities
|
| 26767 | 161 |
(``antiquotations'', see also \secref{sec:antiq}). These are
|
| 26842 | 162 |
interpreted in the present theory context, or the named \isa{{\isachardoublequote}target{\isachardoublequote}}.
|
| 26767 | 163 |
|
164 |
Any of these markup elements corresponds to a {\LaTeX} command with
|
|
165 |
the name prefixed by \verb|\isamarkup|. For the sectioning |
|
166 |
commands this is a plain macro with a single argument, e.g.\ |
|
| 26842 | 167 |
\verb|\isamarkupchapter{|\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}\verb|}| for
|
| 26776 | 168 |
\mbox{\isa{\isacommand{chapter}}}. The \mbox{\isa{\isacommand{text}}} markup results in a
|
| 26842 | 169 |
{\LaTeX} environment \verb|\begin{isamarkuptext}| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|\end{isamarkuptext}|, while \mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}
|
| 26767 | 170 |
causes the text to be inserted directly into the {\LaTeX} source.
|
171 |
||
172 |
\medskip Additional markup commands are available for proofs (see |
|
| 26776 | 173 |
\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 | 174 |
section markup just preceding the actual theory definition.% |
175 |
\end{isamarkuptext}%
|
|
176 |
\isamarkuptrue% |
|
177 |
% |
|
178 |
\isamarkupsubsection{Type classes and sorts \label{sec:classes}%
|
|
179 |
} |
|
180 |
\isamarkuptrue% |
|
181 |
% |
|
182 |
\begin{isamarkuptext}%
|
|
183 |
\begin{matharray}{rcll}
|
|
| 26776 | 184 |
\indexdef{}{command}{classes}\mbox{\isa{\isacommand{classes}}} & : & \isartrans{theory}{theory} \\
|
185 |
\indexdef{}{command}{classrel}\mbox{\isa{\isacommand{classrel}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
|
|
186 |
\indexdef{}{command}{defaultsort}\mbox{\isa{\isacommand{defaultsort}}} & : & \isartrans{theory}{theory} \\
|
|
|
26854
9b4aec46ad78
improved treatment of "_" thanks to underscore.sty;
wenzelm
parents:
26852
diff
changeset
|
187 |
\indexdef{}{command}{class\_deps}\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}} & : & \isarkeep{theory~|~proof} \\
|
| 26767 | 188 |
\end{matharray}
|
189 |
||
190 |
\begin{rail}
|
|
191 |
'classes' (classdecl +) |
|
192 |
; |
|
193 |
'classrel' (nameref ('<' | subseteq) nameref + 'and')
|
|
194 |
; |
|
195 |
'defaultsort' sort |
|
196 |
; |
|
197 |
\end{rail}
|
|
198 |
||
199 |
\begin{descr}
|
|
200 |
||
| 26842 | 201 |
\item [\mbox{\isa{\isacommand{classes}}}~\isa{{\isachardoublequote}c\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlsub n{\isachardoublequote}}]
|
202 |
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 | 203 |
|
| 26842 | 204 |
\item [\mbox{\isa{\isacommand{classrel}}}~\isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}{\isachardoublequote}}] states
|
205 |
subclass relations between existing classes \isa{{\isachardoublequote}c\isactrlsub {\isadigit{1}}{\isachardoublequote}} and
|
|
206 |
\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 | 207 |
introduce proven class relations. |
208 |
||
| 26776 | 209 |
\item [\mbox{\isa{\isacommand{defaultsort}}}~\isa{s}] makes sort \isa{s} the
|
| 26767 | 210 |
new default sort for any type variables given without sort |
211 |
constraints. Usually, the default sort would be only changed when |
|
212 |
defining a new object-logic. |
|
213 |
||
| 26776 | 214 |
\item [\mbox{\isa{\isacommand{class{\isacharunderscore}deps}}}] visualizes the subclass relation,
|
| 26767 | 215 |
using Isabelle's graph browser tool (see also \cite{isabelle-sys}).
|
216 |
||
217 |
\end{descr}%
|
|
218 |
\end{isamarkuptext}%
|
|
219 |
\isamarkuptrue% |
|
220 |
% |
|
221 |
\isamarkupsubsection{Primitive types and type abbreviations \label{sec:types-pure}%
|
|
222 |
} |
|
223 |
\isamarkuptrue% |
|
224 |
% |
|
225 |
\begin{isamarkuptext}%
|
|
226 |
\begin{matharray}{rcll}
|
|
| 26776 | 227 |
\indexdef{}{command}{types}\mbox{\isa{\isacommand{types}}} & : & \isartrans{theory}{theory} \\
|
228 |
\indexdef{}{command}{typedecl}\mbox{\isa{\isacommand{typedecl}}} & : & \isartrans{theory}{theory} \\
|
|
229 |
\indexdef{}{command}{nonterminals}\mbox{\isa{\isacommand{nonterminals}}} & : & \isartrans{theory}{theory} \\
|
|
230 |
\indexdef{}{command}{arities}\mbox{\isa{\isacommand{arities}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
|
|
| 26767 | 231 |
\end{matharray}
|
232 |
||
233 |
\begin{rail}
|
|
234 |
'types' (typespec '=' type infix? +) |
|
235 |
; |
|
236 |
'typedecl' typespec infix? |
|
237 |
; |
|
238 |
'nonterminals' (name +) |
|
239 |
; |
|
240 |
'arities' (nameref '::' arity +) |
|
241 |
; |
|
242 |
\end{rail}
|
|
243 |
||
244 |
\begin{descr}
|
|
245 |
||
| 26842 | 246 |
\item [\mbox{\isa{\isacommand{types}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t\ {\isacharequal}\ {\isasymtau}{\isachardoublequote}}]
|
247 |
introduces \emph{type synonym} \isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}
|
|
248 |
for existing type \isa{{\isachardoublequote}{\isasymtau}{\isachardoublequote}}. Unlike actual type definitions, as
|
|
| 26767 | 249 |
are available in Isabelle/HOL for example, type synonyms are just |
250 |
purely syntactic abbreviations without any logical significance. |
|
251 |
Internally, type synonyms are fully expanded. |
|
252 |
||
| 26842 | 253 |
\item [\mbox{\isa{\isacommand{typedecl}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t{\isachardoublequote}}]
|
| 26767 | 254 |
declares a new type constructor \isa{t}, intended as an actual
|
255 |
logical type (of the object-logic, if available). |
|
256 |
||
| 26776 | 257 |
\item [\mbox{\isa{\isacommand{nonterminals}}}~\isa{c}] declares type
|
| 26767 | 258 |
constructors \isa{c} (without arguments) to act as purely
|
259 |
syntactic types, i.e.\ nonterminal symbols of Isabelle's inner |
|
260 |
syntax of terms or types. |
|
261 |
||
| 26842 | 262 |
\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 | 263 |
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 | 264 |
introduce proven type arities. |
265 |
||
266 |
\end{descr}%
|
|
267 |
\end{isamarkuptext}%
|
|
268 |
\isamarkuptrue% |
|
269 |
% |
|
270 |
\isamarkupsubsection{Primitive constants and definitions \label{sec:consts}%
|
|
271 |
} |
|
272 |
\isamarkuptrue% |
|
273 |
% |
|
274 |
\begin{isamarkuptext}%
|
|
275 |
Definitions essentially express abbreviations within the logic. The |
|
| 26842 | 276 |
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 | 277 |
where the arguments of \isa{c} appear on the left, abbreviating a
|
| 26842 | 278 |
prefix of \isa{{\isasymlambda}}-abstractions, e.g.\ \isa{{\isachardoublequote}c\ {\isasymequiv}\ {\isasymlambda}x\ y{\isachardot}\ t{\isachardoublequote}} may be
|
279 |
written more conveniently as \isa{{\isachardoublequote}c\ x\ y\ {\isasymequiv}\ t{\isachardoublequote}}. Moreover,
|
|
| 26767 | 280 |
definitions may be weakened by adding arbitrary pre-conditions: |
| 26842 | 281 |
\isa{{\isachardoublequote}A\ {\isasymLongrightarrow}\ c\ x\ y\ {\isasymequiv}\ t{\isachardoublequote}}.
|
| 26767 | 282 |
|
283 |
\medskip The built-in well-formedness conditions for definitional |
|
284 |
specifications are: |
|
285 |
||
286 |
\begin{itemize}
|
|
287 |
||
288 |
\item Arguments (on the left-hand side) must be distinct variables. |
|
289 |
||
290 |
\item All variables on the right-hand side must also appear on the |
|
291 |
left-hand side. |
|
292 |
||
293 |
\item All type variables on the right-hand side must also appear on |
|
| 26842 | 294 |
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 | 295 |
|
296 |
\item The definition must not be recursive. Most object-logics |
|
297 |
provide definitional principles that can be used to express |
|
298 |
recursion safely. |
|
299 |
||
300 |
\end{itemize}
|
|
301 |
||
| 26842 | 302 |
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 | 303 |
recursively at type instances corresponding to the immediate |
| 26842 | 304 |
argument types \isa{{\isachardoublequote}{\isasymbeta}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymbeta}\isactrlsub n{\isachardoublequote}}. Incomplete
|
| 26767 | 305 |
specification patterns impose global constraints on all occurrences, |
| 26842 | 306 |
e.g.\ \isa{{\isachardoublequote}d\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ {\isasymtimes}\ {\isasymalpha}{\isachardoublequote}} on the left-hand side means that all
|
| 26767 | 307 |
corresponding occurrences on some right-hand side need to be an |
| 26842 | 308 |
instance of this, general \isa{{\isachardoublequote}d\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ {\isasymtimes}\ {\isasymbeta}{\isachardoublequote}} will be disallowed.
|
| 26767 | 309 |
|
310 |
\begin{matharray}{rcl}
|
|
| 26776 | 311 |
\indexdef{}{command}{consts}\mbox{\isa{\isacommand{consts}}} & : & \isartrans{theory}{theory} \\
|
312 |
\indexdef{}{command}{defs}\mbox{\isa{\isacommand{defs}}} & : & \isartrans{theory}{theory} \\
|
|
313 |
\indexdef{}{command}{constdefs}\mbox{\isa{\isacommand{constdefs}}} & : & \isartrans{theory}{theory} \\
|
|
| 26767 | 314 |
\end{matharray}
|
315 |
||
316 |
\begin{rail}
|
|
317 |
'consts' ((name '::' type mixfix?) +) |
|
318 |
; |
|
319 |
'defs' ('(' 'unchecked'? 'overloaded'? ')')? \\ (axmdecl prop +)
|
|
320 |
; |
|
321 |
\end{rail}
|
|
322 |
||
323 |
\begin{rail}
|
|
324 |
'constdefs' structs? (constdecl? constdef +) |
|
325 |
; |
|
326 |
||
327 |
structs: '(' 'structure' (vars + 'and') ')'
|
|
328 |
; |
|
329 |
constdecl: ((name '::' type mixfix | name '::' type | name mixfix) 'where'?) | name 'where' |
|
330 |
; |
|
331 |
constdef: thmdecl? prop |
|
332 |
; |
|
333 |
\end{rail}
|
|
334 |
||
335 |
\begin{descr}
|
|
336 |
||
| 26842 | 337 |
\item [\mbox{\isa{\isacommand{consts}}}~\isa{{\isachardoublequote}c\ {\isacharcolon}{\isacharcolon}\ {\isasymsigma}{\isachardoublequote}}] declares constant
|
| 26767 | 338 |
\isa{c} to have any instance of type scheme \isa{{\isasymsigma}}. The
|
339 |
optional mixfix annotations may attach concrete syntax to the |
|
340 |
constants declared. |
|
341 |
||
| 26842 | 342 |
\item [\mbox{\isa{\isacommand{defs}}}~\isa{{\isachardoublequote}name{\isacharcolon}\ eqn{\isachardoublequote}}] introduces \isa{eqn}
|
| 26767 | 343 |
as a definitional axiom for some existing constant. |
344 |
||
| 26842 | 345 |
The \isa{{\isachardoublequote}{\isacharparenleft}unchecked{\isacharparenright}{\isachardoublequote}} option disables global dependency checks
|
| 26767 | 346 |
for this definition, which is occasionally useful for exotic |
347 |
overloading. It is at the discretion of the user to avoid malformed |
|
348 |
theory specifications! |
|
349 |
||
| 26842 | 350 |
The \isa{{\isachardoublequote}{\isacharparenleft}overloaded{\isacharparenright}{\isachardoublequote}} option declares definitions to be
|
| 26767 | 351 |
potentially overloaded. Unless this option is given, a warning |
352 |
message would be issued for any definitional equation with a more |
|
353 |
special type than that of the corresponding constant declaration. |
|
354 |
||
| 26776 | 355 |
\item [\mbox{\isa{\isacommand{constdefs}}}] provides a streamlined combination of
|
| 26767 | 356 |
constants declarations and definitions: type-inference takes care of |
357 |
the most general typing of the given specification (the optional |
|
| 26776 | 358 |
type constraint may refer to type-inference dummies ``\isa{{\isacharunderscore}}'' as usual). The resulting type declaration needs to agree with
|
| 26767 | 359 |
that of the specification; overloading is \emph{not} supported here!
|
360 |
||
361 |
The constant name may be omitted altogether, if neither type nor |
|
362 |
syntax declarations are given. The canonical name of the |
|
363 |
definitional axiom for constant \isa{c} will be \isa{c{\isacharunderscore}def},
|
|
364 |
unless specified otherwise. Also note that the given list of |
|
365 |
specifications is processed in a strictly sequential manner, with |
|
366 |
type-checking being performed independently. |
|
367 |
||
| 26842 | 368 |
An optional initial context of \isa{{\isachardoublequote}{\isacharparenleft}structure{\isacharparenright}{\isachardoublequote}} declarations
|
369 |
admits use of indexed syntax, using the special symbol \verb|\<index>| (printed as ``\isa{{\isachardoublequote}{\isasymindex}{\isachardoublequote}}''). The latter concept is
|
|
| 26767 | 370 |
particularly useful with locales (see also \S\ref{sec:locale}).
|
371 |
||
372 |
\end{descr}%
|
|
373 |
\end{isamarkuptext}%
|
|
374 |
\isamarkuptrue% |
|
375 |
% |
|
376 |
\isamarkupsubsection{Syntax and translations \label{sec:syn-trans}%
|
|
377 |
} |
|
378 |
\isamarkuptrue% |
|
379 |
% |
|
380 |
\begin{isamarkuptext}%
|
|
381 |
\begin{matharray}{rcl}
|
|
| 26776 | 382 |
\indexdef{}{command}{syntax}\mbox{\isa{\isacommand{syntax}}} & : & \isartrans{theory}{theory} \\
|
|
26854
9b4aec46ad78
improved treatment of "_" thanks to underscore.sty;
wenzelm
parents:
26852
diff
changeset
|
383 |
\indexdef{}{command}{no\_syntax}\mbox{\isa{\isacommand{no{\isacharunderscore}syntax}}} & : & \isartrans{theory}{theory} \\
|
| 26776 | 384 |
\indexdef{}{command}{translations}\mbox{\isa{\isacommand{translations}}} & : & \isartrans{theory}{theory} \\
|
|
26854
9b4aec46ad78
improved treatment of "_" thanks to underscore.sty;
wenzelm
parents:
26852
diff
changeset
|
385 |
\indexdef{}{command}{no\_translations}\mbox{\isa{\isacommand{no{\isacharunderscore}translations}}} & : & \isartrans{theory}{theory} \\
|
| 26767 | 386 |
\end{matharray}
|
387 |
||
388 |
\begin{rail}
|
|
389 |
('syntax' | 'no\_syntax') mode? (constdecl +)
|
|
390 |
; |
|
391 |
('translations' | 'no\_translations') (transpat ('==' | '=>' | '<=' | rightleftharpoons | rightharpoonup | leftharpoondown) transpat +)
|
|
392 |
; |
|
393 |
||
394 |
mode: ('(' ( name | 'output' | name 'output' ) ')')
|
|
395 |
; |
|
396 |
transpat: ('(' nameref ')')? string
|
|
397 |
; |
|
398 |
\end{rail}
|
|
399 |
||
400 |
\begin{descr}
|
|
401 |
||
| 26842 | 402 |
\item [\mbox{\isa{\isacommand{syntax}}}~\isa{{\isachardoublequote}{\isacharparenleft}mode{\isacharparenright}\ decls{\isachardoublequote}}] is similar to
|
| 26776 | 403 |
\mbox{\isa{\isacommand{consts}}}~\isa{decls}, except that the actual logical
|
| 26767 | 404 |
signature extension is omitted. Thus the context free grammar of |
405 |
Isabelle's inner syntax may be augmented in arbitrary ways, |
|
406 |
independently of the logic. The \isa{mode} argument refers to the
|
|
| 26776 | 407 |
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 | 408 |
input and output grammar. |
409 |
||
| 26842 | 410 |
\item [\mbox{\isa{\isacommand{no{\isacharunderscore}syntax}}}~\isa{{\isachardoublequote}{\isacharparenleft}mode{\isacharparenright}\ decls{\isachardoublequote}}] removes
|
| 26776 | 411 |
grammar declarations (and translations) resulting from \isa{decls}, which are interpreted in the same manner as for \mbox{\isa{\isacommand{syntax}}} above.
|
| 26767 | 412 |
|
| 26776 | 413 |
\item [\mbox{\isa{\isacommand{translations}}}~\isa{rules}] specifies syntactic
|
| 26842 | 414 |
translation rules (i.e.\ macros): parse~/ print rules (\isa{{\isachardoublequote}{\isasymrightleftharpoons}{\isachardoublequote}}),
|
415 |
parse rules (\isa{{\isachardoublequote}{\isasymrightharpoonup}{\isachardoublequote}}), or print rules (\isa{{\isachardoublequote}{\isasymleftharpoondown}{\isachardoublequote}}).
|
|
| 26767 | 416 |
Translation patterns may be prefixed by the syntactic category to be |
417 |
used for parsing; the default is \isa{logic}.
|
|
418 |
||
| 26776 | 419 |
\item [\mbox{\isa{\isacommand{no{\isacharunderscore}translations}}}~\isa{rules}] removes syntactic
|
| 26767 | 420 |
translation rules, which are interpreted in the same manner as for |
| 26776 | 421 |
\mbox{\isa{\isacommand{translations}}} above.
|
| 26767 | 422 |
|
423 |
\end{descr}%
|
|
424 |
\end{isamarkuptext}%
|
|
425 |
\isamarkuptrue% |
|
426 |
% |
|
427 |
\isamarkupsubsection{Axioms and theorems \label{sec:axms-thms}%
|
|
428 |
} |
|
429 |
\isamarkuptrue% |
|
430 |
% |
|
431 |
\begin{isamarkuptext}%
|
|
432 |
\begin{matharray}{rcll}
|
|
| 26776 | 433 |
\indexdef{}{command}{axioms}\mbox{\isa{\isacommand{axioms}}} & : & \isartrans{theory}{theory} & (axiomatic!) \\
|
434 |
\indexdef{}{command}{lemmas}\mbox{\isa{\isacommand{lemmas}}} & : & \isarkeep{local{\dsh}theory} \\
|
|
435 |
\indexdef{}{command}{theorems}\mbox{\isa{\isacommand{theorems}}} & : & isarkeep{local{\dsh}theory} \\
|
|
| 26767 | 436 |
\end{matharray}
|
437 |
||
438 |
\begin{rail}
|
|
439 |
'axioms' (axmdecl prop +) |
|
440 |
; |
|
441 |
('lemmas' | 'theorems') target? (thmdef? thmrefs + 'and')
|
|
442 |
; |
|
443 |
\end{rail}
|
|
444 |
||
445 |
\begin{descr}
|
|
446 |
||
| 26842 | 447 |
\item [\mbox{\isa{\isacommand{axioms}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] introduces arbitrary
|
| 26767 | 448 |
statements as axioms of the meta-logic. In fact, axioms are |
449 |
``axiomatic theorems'', and may be referred later just as any other |
|
450 |
theorem. |
|
451 |
||
452 |
Axioms are usually only introduced when declaring new logical |
|
453 |
systems. Everyday work is typically done the hard way, with proper |
|
454 |
definitions and proven theorems. |
|
455 |
||
| 26842 | 456 |
\item [\mbox{\isa{\isacommand{lemmas}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}]
|
| 26767 | 457 |
retrieves and stores existing facts in the theory context, or the |
458 |
specified target context (see also \secref{sec:target}). Typical
|
|
459 |
applications would also involve attributes, to declare Simplifier |
|
460 |
rules, for example. |
|
461 |
||
| 26776 | 462 |
\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 | 463 |
|
464 |
\end{descr}%
|
|
465 |
\end{isamarkuptext}%
|
|
466 |
\isamarkuptrue% |
|
467 |
% |
|
468 |
\isamarkupsubsection{Name spaces%
|
|
469 |
} |
|
470 |
\isamarkuptrue% |
|
471 |
% |
|
472 |
\begin{isamarkuptext}%
|
|
473 |
\begin{matharray}{rcl}
|
|
| 26776 | 474 |
\indexdef{}{command}{global}\mbox{\isa{\isacommand{global}}} & : & \isartrans{theory}{theory} \\
|
475 |
\indexdef{}{command}{local}\mbox{\isa{\isacommand{local}}} & : & \isartrans{theory}{theory} \\
|
|
476 |
\indexdef{}{command}{hide}\mbox{\isa{\isacommand{hide}}} & : & \isartrans{theory}{theory} \\
|
|
| 26767 | 477 |
\end{matharray}
|
478 |
||
479 |
\begin{rail}
|
|
480 |
'hide' ('(open)')? name (nameref + )
|
|
481 |
; |
|
482 |
\end{rail}
|
|
483 |
||
484 |
Isabelle organizes any kind of name declarations (of types, |
|
485 |
constants, theorems etc.) by separate hierarchically structured name |
|
486 |
spaces. Normally the user does not have to control the behavior of |
|
487 |
name spaces by hand, yet the following commands provide some way to |
|
488 |
do so. |
|
489 |
||
490 |
\begin{descr}
|
|
491 |
||
| 26776 | 492 |
\item [\mbox{\isa{\isacommand{global}}} and \mbox{\isa{\isacommand{local}}}] change the
|
| 26767 | 493 |
current name declaration mode. Initially, theories start in |
| 26776 | 494 |
\mbox{\isa{\isacommand{local}}} mode, causing all names to be automatically
|
495 |
qualified by the theory name. Changing this to \mbox{\isa{\isacommand{global}}}
|
|
| 26767 | 496 |
causes all names to be declared without the theory prefix, until |
| 26776 | 497 |
\mbox{\isa{\isacommand{local}}} is declared again.
|
| 26767 | 498 |
|
499 |
Note that global names are prone to get hidden accidently later, |
|
500 |
when qualified names of the same base name are introduced. |
|
501 |
||
| 26842 | 502 |
\item [\mbox{\isa{\isacommand{hide}}}~\isa{{\isachardoublequote}space\ names{\isachardoublequote}}] fully removes
|
503 |
declarations from a given name space (which may be \isa{{\isachardoublequote}class{\isachardoublequote}},
|
|
504 |
\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 | 505 |
(unqualified) names may never be hidden. |
506 |
||
507 |
Note that hiding name space accesses has no impact on logical |
|
508 |
declarations -- they remain valid internally. Entities that are no |
|
509 |
longer accessible to the user are printed with the special qualifier |
|
| 26842 | 510 |
``\isa{{\isachardoublequote}{\isacharquery}{\isacharquery}{\isachardoublequote}}'' prefixed to the full internal name.
|
| 26767 | 511 |
|
512 |
\end{descr}%
|
|
513 |
\end{isamarkuptext}%
|
|
514 |
\isamarkuptrue% |
|
515 |
% |
|
516 |
\isamarkupsubsection{Incorporating ML code \label{sec:ML}%
|
|
517 |
} |
|
518 |
\isamarkuptrue% |
|
519 |
% |
|
520 |
\begin{isamarkuptext}%
|
|
521 |
\begin{matharray}{rcl}
|
|
| 26776 | 522 |
\indexdef{}{command}{use}\mbox{\isa{\isacommand{use}}} & : & \isarkeep{theory~|~local{\dsh}theory} \\
|
523 |
\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
|
524 |
\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
|
525 |
\indexdef{}{command}{ML\_command}\mbox{\isa{\isacommand{ML{\isacharunderscore}command}}} & : & \isartrans{\cdot}{\cdot} \\
|
| 26776 | 526 |
\indexdef{}{command}{setup}\mbox{\isa{\isacommand{setup}}} & : & \isartrans{theory}{theory} \\
|
|
26854
9b4aec46ad78
improved treatment of "_" thanks to underscore.sty;
wenzelm
parents:
26852
diff
changeset
|
527 |
\indexdef{}{command}{method\_setup}\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}} & : & \isartrans{theory}{theory} \\
|
| 26767 | 528 |
\end{matharray}
|
529 |
||
530 |
\begin{rail}
|
|
531 |
'use' name |
|
532 |
; |
|
533 |
('ML' | 'ML\_val' | 'ML\_command' | 'setup') text
|
|
534 |
; |
|
535 |
'method\_setup' name '=' text text |
|
536 |
; |
|
537 |
\end{rail}
|
|
538 |
||
539 |
\begin{descr}
|
|
540 |
||
| 26842 | 541 |
\item [\mbox{\isa{\isacommand{use}}}~\isa{{\isachardoublequote}file{\isachardoublequote}}] reads and executes ML
|
542 |
commands from \isa{{\isachardoublequote}file{\isachardoublequote}}. The current theory context is passed
|
|
543 |
down to the ML toplevel and may be modified, using \verb|"Context.>>"| or derived ML commands. The file name is checked with |
|
| 26776 | 544 |
the \indexref{}{keyword}{uses}\mbox{\isa{\isakeyword{uses}}} dependency declaration given in the theory
|
| 26767 | 545 |
header (see also \secref{sec:begin-thy}).
|
546 |
||
| 26842 | 547 |
\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 | 548 |
|
| 26776 | 549 |
\item [\mbox{\isa{\isacommand{ML{\isacharunderscore}val}}} and \mbox{\isa{\isacommand{ML{\isacharunderscore}command}}}] are
|
550 |
diagnostic versions of \mbox{\isa{\isacommand{ML}}}, which means that the context
|
|
551 |
may not be updated. \mbox{\isa{\isacommand{ML{\isacharunderscore}val}}} echos the bindings produced
|
|
552 |
at the ML toplevel, but \mbox{\isa{\isacommand{ML{\isacharunderscore}command}}} is silent.
|
|
| 26767 | 553 |
|
| 26842 | 554 |
\item [\mbox{\isa{\isacommand{setup}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] changes the current theory
|
555 |
context by applying \isa{{\isachardoublequote}text{\isachardoublequote}}, which refers to an ML expression
|
|
556 |
of type \verb|"theory -> theory"|. This enables to initialize |
|
| 26767 | 557 |
any object-logic specific tools and packages written in ML, for |
558 |
example. |
|
559 |
||
| 26842 | 560 |
\item [\mbox{\isa{\isacommand{method{\isacharunderscore}setup}}}~\isa{{\isachardoublequote}name\ {\isacharequal}\ text\ description{\isachardoublequote}}]
|
561 |
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%
|
|
562 |
\verb| Proof.context -> Proof.method"|. Parsing concrete method syntax |
|
| 26767 | 563 |
from \verb|Args.src| input can be quite tedious in general. The |
564 |
following simple examples are for methods without any explicit |
|
565 |
arguments, or a list of theorems, respectively. |
|
566 |
||
567 |
%FIXME proper antiquotations |
|
568 |
{\footnotesize
|
|
569 |
\begin{verbatim}
|
|
570 |
Method.no_args (Method.METHOD (fn facts => foobar_tac)) |
|
571 |
Method.thms_args (fn thms => Method.METHOD (fn facts => foobar_tac)) |
|
572 |
Method.ctxt_args (fn ctxt => Method.METHOD (fn facts => foobar_tac)) |
|
573 |
Method.thms_ctxt_args (fn thms => fn ctxt => |
|
574 |
Method.METHOD (fn facts => foobar_tac)) |
|
575 |
\end{verbatim}
|
|
576 |
} |
|
577 |
||
578 |
Note that mere tactic emulations may ignore the \isa{facts}
|
|
579 |
parameter above. Proper proof methods would do something |
|
580 |
appropriate with the list of current facts, though. Single-rule |
|
581 |
methods usually do strict forward-chaining (e.g.\ by using \verb|Drule.multi_resolves|), while automatic ones just insert the facts |
|
582 |
using \verb|Method.insert_tac| before applying the main tactic. |
|
583 |
||
584 |
\end{descr}%
|
|
585 |
\end{isamarkuptext}%
|
|
586 |
\isamarkuptrue% |
|
587 |
% |
|
588 |
\isamarkupsubsection{Syntax translation functions%
|
|
589 |
} |
|
590 |
\isamarkuptrue% |
|
591 |
% |
|
592 |
\begin{isamarkuptext}%
|
|
593 |
\begin{matharray}{rcl}
|
|
|
26854
9b4aec46ad78
improved treatment of "_" thanks to underscore.sty;
wenzelm
parents:
26852
diff
changeset
|
594 |
\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
|
595 |
\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
|
596 |
\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
|
597 |
\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
|
598 |
\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
|
599 |
\indexdef{}{command}{token\_translation}\mbox{\isa{\isacommand{token{\isacharunderscore}translation}}} & : & \isartrans{theory}{theory} \\
|
| 26767 | 600 |
\end{matharray}
|
601 |
||
602 |
\begin{rail}
|
|
603 |
( 'parse\_ast\_translation' | 'parse\_translation' | 'print\_translation' | |
|
604 |
'typed\_print\_translation' | 'print\_ast\_translation' ) ('(advanced)')? text
|
|
605 |
; |
|
606 |
||
607 |
'token\_translation' text |
|
608 |
; |
|
609 |
\end{rail}
|
|
610 |
||
611 |
Syntax translation functions written in ML admit almost arbitrary |
|
612 |
manipulations of Isabelle's inner syntax. Any of the above commands |
|
613 |
have a single \railqtok{text} argument that refers to an ML
|
|
614 |
expression of appropriate type, which are as follows by default: |
|
615 |
||
616 |
%FIXME proper antiquotations |
|
617 |
\begin{ttbox}
|
|
618 |
val parse_ast_translation : (string * (ast list -> ast)) list |
|
619 |
val parse_translation : (string * (term list -> term)) list |
|
620 |
val print_translation : (string * (term list -> term)) list |
|
621 |
val typed_print_translation : |
|
622 |
(string * (bool -> typ -> term list -> term)) list |
|
623 |
val print_ast_translation : (string * (ast list -> ast)) list |
|
624 |
val token_translation : |
|
625 |
(string * string * (string -> string * real)) list |
|
626 |
\end{ttbox}
|
|
627 |
||
| 26842 | 628 |
If the \isa{{\isachardoublequote}{\isacharparenleft}advanced{\isacharparenright}{\isachardoublequote}} option is given, the corresponding
|
| 26767 | 629 |
translation functions may depend on the current theory or proof |
630 |
context. This allows to implement advanced syntax mechanisms, as |
|
631 |
translations functions may refer to specific theory declarations or |
|
632 |
auxiliary proof data. |
|
633 |
||
634 |
See also \cite[\S8]{isabelle-ref} for more information on the
|
|
635 |
general concept of syntax transformations in Isabelle. |
|
636 |
||
637 |
%FIXME proper antiquotations |
|
638 |
\begin{ttbox}
|
|
639 |
val parse_ast_translation: |
|
640 |
(string * (Context.generic -> ast list -> ast)) list |
|
641 |
val parse_translation: |
|
642 |
(string * (Context.generic -> term list -> term)) list |
|
643 |
val print_translation: |
|
644 |
(string * (Context.generic -> term list -> term)) list |
|
645 |
val typed_print_translation: |
|
646 |
(string * (Context.generic -> bool -> typ -> term list -> term)) list |
|
647 |
val print_ast_translation: |
|
648 |
(string * (Context.generic -> ast list -> ast)) list |
|
649 |
\end{ttbox}%
|
|
650 |
\end{isamarkuptext}%
|
|
651 |
\isamarkuptrue% |
|
652 |
% |
|
653 |
\isamarkupsubsection{Oracles%
|
|
654 |
} |
|
655 |
\isamarkuptrue% |
|
656 |
% |
|
657 |
\begin{isamarkuptext}%
|
|
658 |
\begin{matharray}{rcl}
|
|
| 26776 | 659 |
\indexdef{}{command}{oracle}\mbox{\isa{\isacommand{oracle}}} & : & \isartrans{theory}{theory} \\
|
| 26767 | 660 |
\end{matharray}
|
661 |
||
| 26776 | 662 |
The oracle interface promotes a given ML function \verb|theory -> T -> term| to \verb|theory -> T -> thm|, for some |
663 |
type \verb|T| given by the user. This acts like an infinitary |
|
| 26767 | 664 |
specification of axioms -- there is no internal check of the |
665 |
correctness of the results! The inference kernel records oracle |
|
666 |
invocations within the internal derivation object of theorems, and |
|
| 26842 | 667 |
the pretty printer attaches ``\isa{{\isachardoublequote}{\isacharbrackleft}{\isacharbang}{\isacharbrackright}{\isachardoublequote}}'' to indicate results
|
| 26767 | 668 |
that are not fully checked by Isabelle inferences. |
669 |
||
670 |
\begin{rail}
|
|
671 |
'oracle' name '(' type ')' '=' text
|
|
672 |
; |
|
673 |
\end{rail}
|
|
674 |
||
675 |
\begin{descr}
|
|
676 |
||
| 26842 | 677 |
\item [\mbox{\isa{\isacommand{oracle}}}~\isa{{\isachardoublequote}name\ {\isacharparenleft}type{\isacharparenright}\ {\isacharequal}\ text{\isachardoublequote}}] turns the
|
678 |
given ML expression \isa{{\isachardoublequote}text{\isachardoublequote}} of type
|
|
679 |
\verb|theory ->|~\isa{{\isachardoublequote}type{\isachardoublequote}}~\verb|-> term| into an
|
|
| 26776 | 680 |
ML function of type |
| 26842 | 681 |
\verb|theory ->|~\isa{{\isachardoublequote}type{\isachardoublequote}}~\verb|-> thm|, which is
|
| 26776 | 682 |
bound to the global identifier \verb|name|. |
| 26767 | 683 |
|
684 |
\end{descr}%
|
|
685 |
\end{isamarkuptext}%
|
|
686 |
\isamarkuptrue% |
|
687 |
% |
|
688 |
\isamarkupsection{Proof commands%
|
|
689 |
} |
|
690 |
\isamarkuptrue% |
|
691 |
% |
|
692 |
\begin{isamarkuptext}%
|
|
693 |
Proof commands perform transitions of Isar/VM machine |
|
694 |
configurations, which are block-structured, consisting of a stack of |
|
695 |
nodes with three main components: logical proof context, current |
|
696 |
facts, and open goals. Isar/VM transitions are \emph{typed}
|
|
697 |
according to the following three different modes of operation: |
|
698 |
||
699 |
\begin{descr}
|
|
700 |
||
| 26842 | 701 |
\item [\isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}}] means that a new goal has just been
|
| 26767 | 702 |
stated that is now to be \emph{proven}; the next command may refine
|
703 |
it by some proof method, and enter a sub-proof to establish the |
|
704 |
actual result. |
|
705 |
||
| 26842 | 706 |
\item [\isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}}] is like a nested theory mode: the
|
| 26767 | 707 |
context may be augmented by \emph{stating} additional assumptions,
|
708 |
intermediate results etc. |
|
709 |
||
| 26842 | 710 |
\item [\isa{{\isachardoublequote}proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}}] is intermediate between \isa{{\isachardoublequote}proof{\isacharparenleft}state{\isacharparenright}{\isachardoublequote}} and \isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}}: existing facts (i.e.\
|
| 26776 | 711 |
the contents of the special ``\indexref{}{fact}{this}\mbox{\isa{this}}'' register) have been
|
| 26767 | 712 |
just picked up in order to be used when refining the goal claimed |
713 |
next. |
|
714 |
||
715 |
\end{descr}
|
|
716 |
||
717 |
The proof mode indicator may be read as a verb telling the writer |
|
718 |
what kind of operation may be performed next. The corresponding |
|
719 |
typings of proof commands restricts the shape of well-formed proof |
|
720 |
texts to particular command sequences. So dynamic arrangements of |
|
721 |
commands eventually turn out as static texts of a certain structure. |
|
722 |
\Appref{ap:refcard} gives a simplified grammar of the overall
|
|
723 |
(extensible) language emerging that way.% |
|
724 |
\end{isamarkuptext}%
|
|
725 |
\isamarkuptrue% |
|
726 |
% |
|
727 |
\isamarkupsubsection{Markup commands \label{sec:markup-prf}%
|
|
728 |
} |
|
729 |
\isamarkuptrue% |
|
730 |
% |
|
731 |
\begin{isamarkuptext}%
|
|
732 |
\begin{matharray}{rcl}
|
|
| 26776 | 733 |
\indexdef{}{command}{sect}\mbox{\isa{\isacommand{sect}}} & : & \isartrans{proof}{proof} \\
|
734 |
\indexdef{}{command}{subsect}\mbox{\isa{\isacommand{subsect}}} & : & \isartrans{proof}{proof} \\
|
|
735 |
\indexdef{}{command}{subsubsect}\mbox{\isa{\isacommand{subsubsect}}} & : & \isartrans{proof}{proof} \\
|
|
736 |
\indexdef{}{command}{txt}\mbox{\isa{\isacommand{txt}}} & : & \isartrans{proof}{proof} \\
|
|
|
26854
9b4aec46ad78
improved treatment of "_" thanks to underscore.sty;
wenzelm
parents:
26852
diff
changeset
|
737 |
\indexdef{}{command}{txt\_raw}\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}} & : & \isartrans{proof}{proof} \\
|
| 26767 | 738 |
\end{matharray}
|
739 |
||
740 |
These markup commands for proof mode closely correspond to the ones |
|
741 |
of theory mode (see \S\ref{sec:markup-thy}).
|
|
742 |
||
743 |
\begin{rail}
|
|
744 |
('sect' | 'subsect' | 'subsubsect' | 'txt' | 'txt\_raw') text
|
|
745 |
; |
|
746 |
\end{rail}%
|
|
747 |
\end{isamarkuptext}%
|
|
748 |
\isamarkuptrue% |
|
749 |
% |
|
750 |
\isamarkupsubsection{Context elements \label{sec:proof-context}%
|
|
751 |
} |
|
752 |
\isamarkuptrue% |
|
753 |
% |
|
754 |
\begin{isamarkuptext}%
|
|
755 |
\begin{matharray}{rcl}
|
|
| 26776 | 756 |
\indexdef{}{command}{fix}\mbox{\isa{\isacommand{fix}}} & : & \isartrans{proof(state)}{proof(state)} \\
|
757 |
\indexdef{}{command}{assume}\mbox{\isa{\isacommand{assume}}} & : & \isartrans{proof(state)}{proof(state)} \\
|
|
758 |
\indexdef{}{command}{presume}\mbox{\isa{\isacommand{presume}}} & : & \isartrans{proof(state)}{proof(state)} \\
|
|
759 |
\indexdef{}{command}{def}\mbox{\isa{\isacommand{def}}} & : & \isartrans{proof(state)}{proof(state)} \\
|
|
| 26767 | 760 |
\end{matharray}
|
761 |
||
762 |
The logical proof context consists of fixed variables and |
|
763 |
assumptions. The former closely correspond to Skolem constants, or |
|
764 |
meta-level universal quantification as provided by the Isabelle/Pure |
|
765 |
logical framework. Introducing some \emph{arbitrary, but fixed}
|
|
| 26776 | 766 |
variable via ``\mbox{\isa{\isacommand{fix}}}~\isa{x}'' results in a local value
|
| 26767 | 767 |
that may be used in the subsequent proof as any other variable or |
| 26842 | 768 |
constant. Furthermore, any result \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymphi}{\isacharbrackleft}x{\isacharbrackright}{\isachardoublequote}} exported from
|
| 26767 | 769 |
the context will be universally closed wrt.\ \isa{x} at the
|
| 26842 | 770 |
outermost level: \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymAnd}x{\isachardot}\ {\isasymphi}{\isacharbrackleft}x{\isacharbrackright}{\isachardoublequote}} (this is expressed in normal
|
| 26767 | 771 |
form using Isabelle's meta-variables). |
772 |
||
773 |
Similarly, introducing some assumption \isa{{\isasymchi}} has two effects.
|
|
774 |
On the one hand, a local theorem is created that may be used as a |
|
775 |
fact in subsequent proof steps. On the other hand, any result |
|
| 26842 | 776 |
\isa{{\isachardoublequote}{\isasymchi}\ {\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} exported from the context becomes conditional wrt.\
|
777 |
the assumption: \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymchi}\ {\isasymLongrightarrow}\ {\isasymphi}{\isachardoublequote}}. Thus, solving an enclosing goal
|
|
| 26767 | 778 |
using such a result would basically introduce a new subgoal stemming |
779 |
from the assumption. How this situation is handled depends on the |
|
| 26776 | 780 |
version of assumption command used: while \mbox{\isa{\isacommand{assume}}}
|
| 26767 | 781 |
insists on solving the subgoal by unification with some premise of |
| 26776 | 782 |
the goal, \mbox{\isa{\isacommand{presume}}} leaves the subgoal unchanged in order
|
| 26767 | 783 |
to be proved later by the user. |
784 |
||
| 26842 | 785 |
Local definitions, introduced by ``\mbox{\isa{\isacommand{def}}}~\isa{{\isachardoublequote}x\ {\isasymequiv}\ t{\isachardoublequote}}'', are achieved by combining ``\mbox{\isa{\isacommand{fix}}}~\isa{x}'' with
|
| 26767 | 786 |
another version of assumption that causes any hypothetical equation |
| 26842 | 787 |
\isa{{\isachardoublequote}x\ {\isasymequiv}\ t{\isachardoublequote}} to be eliminated by the reflexivity rule. Thus,
|
788 |
exporting some result \isa{{\isachardoublequote}x\ {\isasymequiv}\ t\ {\isasymturnstile}\ {\isasymphi}{\isacharbrackleft}x{\isacharbrackright}{\isachardoublequote}} yields \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymphi}{\isacharbrackleft}t{\isacharbrackright}{\isachardoublequote}}.
|
|
| 26767 | 789 |
|
790 |
\begin{rail}
|
|
791 |
'fix' (vars + 'and') |
|
792 |
; |
|
793 |
('assume' | 'presume') (props + 'and')
|
|
794 |
; |
|
795 |
'def' (def + 'and') |
|
796 |
; |
|
797 |
def: thmdecl? \\ name ('==' | equiv) term termpat?
|
|
798 |
; |
|
799 |
\end{rail}
|
|
800 |
||
801 |
\begin{descr}
|
|
802 |
||
| 26776 | 803 |
\item [\mbox{\isa{\isacommand{fix}}}~\isa{x}] introduces a local variable
|
| 26767 | 804 |
\isa{x} that is \emph{arbitrary, but fixed.}
|
805 |
||
| 26842 | 806 |
\item [\mbox{\isa{\isacommand{assume}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} and \mbox{\isa{\isacommand{presume}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] introduce a local fact \isa{{\isachardoublequote}{\isasymphi}\ {\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} by
|
| 26767 | 807 |
assumption. Subsequent results applied to an enclosing goal (e.g.\ |
| 26776 | 808 |
by \indexref{}{command}{show}\mbox{\isa{\isacommand{show}}}) are handled as follows: \mbox{\isa{\isacommand{assume}}} expects to be able to unify with existing premises in the
|
809 |
goal, while \mbox{\isa{\isacommand{presume}}} leaves \isa{{\isasymphi}} as new subgoals.
|
|
| 26767 | 810 |
|
811 |
Several lists of assumptions may be given (separated by |
|
| 26776 | 812 |
\indexref{}{keyword}{and}\mbox{\isa{\isakeyword{and}}}; the resulting list of current facts consists
|
| 26767 | 813 |
of all of these concatenated. |
814 |
||
| 26842 | 815 |
\item [\mbox{\isa{\isacommand{def}}}~\isa{{\isachardoublequote}x\ {\isasymequiv}\ t{\isachardoublequote}}] introduces a local
|
| 26767 | 816 |
(non-polymorphic) definition. In results exported from the context, |
| 26842 | 817 |
\isa{x} is replaced by \isa{t}. Basically, ``\mbox{\isa{\isacommand{def}}}~\isa{{\isachardoublequote}x\ {\isasymequiv}\ t{\isachardoublequote}}'' abbreviates ``\mbox{\isa{\isacommand{fix}}}~\isa{x}~\mbox{\isa{\isacommand{assume}}}~\isa{{\isachardoublequote}x\ {\isasymequiv}\ t{\isachardoublequote}}'', with the resulting
|
| 26767 | 818 |
hypothetical equation solved by reflexivity. |
819 |
||
820 |
The default name for the definitional equation is \isa{x{\isacharunderscore}def}.
|
|
821 |
Several simultaneous definitions may be given at the same time. |
|
822 |
||
823 |
\end{descr}
|
|
824 |
||
| 26776 | 825 |
The special name \indexref{}{fact}{prems}\mbox{\isa{prems}} refers to all assumptions of the
|
| 26767 | 826 |
current context as a list of theorems. This feature should be used |
827 |
with great care! It is better avoided in final proof texts.% |
|
828 |
\end{isamarkuptext}%
|
|
829 |
\isamarkuptrue% |
|
830 |
% |
|
831 |
\isamarkupsubsection{Facts and forward chaining%
|
|
832 |
} |
|
833 |
\isamarkuptrue% |
|
834 |
% |
|
835 |
\begin{isamarkuptext}%
|
|
836 |
\begin{matharray}{rcl}
|
|
| 26776 | 837 |
\indexdef{}{command}{note}\mbox{\isa{\isacommand{note}}} & : & \isartrans{proof(state)}{proof(state)} \\
|
838 |
\indexdef{}{command}{then}\mbox{\isa{\isacommand{then}}} & : & \isartrans{proof(state)}{proof(chain)} \\
|
|
839 |
\indexdef{}{command}{from}\mbox{\isa{\isacommand{from}}} & : & \isartrans{proof(state)}{proof(chain)} \\
|
|
840 |
\indexdef{}{command}{with}\mbox{\isa{\isacommand{with}}} & : & \isartrans{proof(state)}{proof(chain)} \\
|
|
841 |
\indexdef{}{command}{using}\mbox{\isa{\isacommand{using}}} & : & \isartrans{proof(prove)}{proof(prove)} \\
|
|
842 |
\indexdef{}{command}{unfolding}\mbox{\isa{\isacommand{unfolding}}} & : & \isartrans{proof(prove)}{proof(prove)} \\
|
|
| 26767 | 843 |
\end{matharray}
|
844 |
||
845 |
New facts are established either by assumption or proof of local |
|
846 |
statements. Any fact will usually be involved in further proofs, |
|
847 |
either as explicit arguments of proof methods, or when forward |
|
| 26776 | 848 |
chaining towards the next goal via \mbox{\isa{\isacommand{then}}} (and variants);
|
849 |
\mbox{\isa{\isacommand{from}}} and \mbox{\isa{\isacommand{with}}} are composite forms
|
|
850 |
involving \mbox{\isa{\isacommand{note}}}. The \mbox{\isa{\isacommand{using}}} elements
|
|
| 26767 | 851 |
augments the collection of used facts \emph{after} a goal has been
|
| 26776 | 852 |
stated. Note that the special theorem name \indexref{}{fact}{this}\mbox{\isa{this}} refers
|
| 26767 | 853 |
to the most recently established facts, but only \emph{before}
|
854 |
issuing a follow-up claim. |
|
855 |
||
856 |
\begin{rail}
|
|
857 |
'note' (thmdef? thmrefs + 'and') |
|
858 |
; |
|
859 |
('from' | 'with' | 'using' | 'unfolding') (thmrefs + 'and')
|
|
860 |
; |
|
861 |
\end{rail}
|
|
862 |
||
863 |
\begin{descr}
|
|
864 |
||
| 26842 | 865 |
\item [\mbox{\isa{\isacommand{note}}}~\isa{{\isachardoublequote}a\ {\isacharequal}\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}]
|
866 |
recalls existing facts \isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ b\isactrlsub n{\isachardoublequote}}, binding
|
|
| 26767 | 867 |
the result as \isa{a}. Note that attributes may be involved as
|
868 |
well, both on the left and right hand sides. |
|
869 |
||
| 26776 | 870 |
\item [\mbox{\isa{\isacommand{then}}}] indicates forward chaining by the current
|
| 26767 | 871 |
facts in order to establish the goal to be claimed next. The |
872 |
initial proof method invoked to refine that will be offered the |
|
873 |
facts to do ``anything appropriate'' (see also |
|
| 26776 | 874 |
\secref{sec:proof-steps}). For example, method \indexref{}{method}{rule}\mbox{\isa{rule}}
|
| 26767 | 875 |
(see \secref{sec:pure-meth-att}) would typically do an elimination
|
876 |
rather than an introduction. Automatic methods usually insert the |
|
877 |
facts into the goal state before operation. This provides a simple |
|
878 |
scheme to control relevance of facts in automated proof search. |
|
879 |
||
| 26776 | 880 |
\item [\mbox{\isa{\isacommand{from}}}~\isa{b}] abbreviates ``\mbox{\isa{\isacommand{note}}}~\isa{b}~\mbox{\isa{\isacommand{then}}}''; thus \mbox{\isa{\isacommand{then}}} is
|
881 |
equivalent to ``\mbox{\isa{\isacommand{from}}}~\isa{this}''.
|
|
| 26767 | 882 |
|
| 26842 | 883 |
\item [\mbox{\isa{\isacommand{with}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}]
|
884 |
abbreviates ``\mbox{\isa{\isacommand{from}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n\ {\isasymAND}\ this{\isachardoublequote}}''; thus the forward chaining is from earlier facts together
|
|
| 26767 | 885 |
with the current ones. |
886 |
||
| 26842 | 887 |
\item [\mbox{\isa{\isacommand{using}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}] augments
|
| 26767 | 888 |
the facts being currently indicated for use by a subsequent |
| 26776 | 889 |
refinement step (such as \indexref{}{command}{apply}\mbox{\isa{\isacommand{apply}}} or \indexref{}{command}{proof}\mbox{\isa{\isacommand{proof}}}).
|
| 26767 | 890 |
|
| 26842 | 891 |
\item [\mbox{\isa{\isacommand{unfolding}}}~\isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}}] is
|
| 26776 | 892 |
structurally similar to \mbox{\isa{\isacommand{using}}}, but unfolds definitional
|
| 26842 | 893 |
equations \isa{{\isachardoublequote}b\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}\ b\isactrlsub n{\isachardoublequote}} throughout the goal state
|
| 26767 | 894 |
and facts. |
895 |
||
896 |
\end{descr}
|
|
897 |
||
898 |
Forward chaining with an empty list of theorems is the same as not |
|
| 26776 | 899 |
chaining at all. Thus ``\mbox{\isa{\isacommand{from}}}~\isa{nothing}'' has no
|
| 26842 | 900 |
effect apart from entering \isa{{\isachardoublequote}prove{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} mode, since
|
| 26776 | 901 |
\indexref{}{fact}{nothing}\mbox{\isa{nothing}} is bound to the empty list of theorems.
|
| 26767 | 902 |
|
| 26776 | 903 |
Basic proof methods (such as \indexref{}{method}{rule}\mbox{\isa{rule}}) expect multiple
|
| 26767 | 904 |
facts to be given in their proper order, corresponding to a prefix |
905 |
of the premises of the rule involved. Note that positions may be |
|
| 26842 | 906 |
easily skipped using something like \mbox{\isa{\isacommand{from}}}~\isa{{\isachardoublequote}{\isacharunderscore}\ {\isasymAND}\ a\ {\isasymAND}\ b{\isachardoublequote}}, for example. This involves the trivial rule
|
907 |
\isa{{\isachardoublequote}PROP\ {\isasympsi}\ {\isasymLongrightarrow}\ PROP\ {\isasympsi}{\isachardoublequote}}, which is bound in Isabelle/Pure as
|
|
|
26854
9b4aec46ad78
improved treatment of "_" thanks to underscore.sty;
wenzelm
parents:
26852
diff
changeset
|
908 |
``\indexref{}{fact}{\_}\mbox{\isa{{\isacharunderscore}}}'' (underscore).
|
| 26767 | 909 |
|
| 26776 | 910 |
Automated methods (such as \mbox{\isa{simp}} or \mbox{\isa{auto}}) just
|
| 26767 | 911 |
insert any given facts before their usual operation. Depending on |
912 |
the kind of procedure involved, the order of facts is less |
|
913 |
significant here.% |
|
914 |
\end{isamarkuptext}%
|
|
915 |
\isamarkuptrue% |
|
916 |
% |
|
917 |
\isamarkupsubsection{Goal statements \label{sec:goals}%
|
|
918 |
} |
|
919 |
\isamarkuptrue% |
|
920 |
% |
|
921 |
\begin{isamarkuptext}%
|
|
922 |
\begin{matharray}{rcl}
|
|
| 26867 | 923 |
\indexdef{}{command}{lemma}\mbox{\isa{\isacommand{lemma}}} & : & \isartrans{local{\dsh}theory}{proof(prove)} \\
|
924 |
\indexdef{}{command}{theorem}\mbox{\isa{\isacommand{theorem}}} & : & \isartrans{local{\dsh}theory}{proof(prove)} \\
|
|
925 |
\indexdef{}{command}{corollary}\mbox{\isa{\isacommand{corollary}}} & : & \isartrans{local{\dsh}theory}{proof(prove)} \\
|
|
926 |
\indexdef{}{command}{have}\mbox{\isa{\isacommand{have}}} & : & \isartrans{proof(state) ~|~ proof(chain)}{proof(prove)} \\
|
|
927 |
\indexdef{}{command}{show}\mbox{\isa{\isacommand{show}}} & : & \isartrans{proof(state) ~|~ proof(chain)}{proof(prove)} \\
|
|
928 |
\indexdef{}{command}{hence}\mbox{\isa{\isacommand{hence}}} & : & \isartrans{proof(state)}{proof(prove)} \\
|
|
929 |
\indexdef{}{command}{thus}\mbox{\isa{\isacommand{thus}}} & : & \isartrans{proof(state)}{proof(prove)} \\
|
|
930 |
\indexdef{}{command}{print\_statement}\mbox{\isa{\isacommand{print{\isacharunderscore}statement}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
| 26767 | 931 |
\end{matharray}
|
932 |
||
933 |
From a theory context, proof mode is entered by an initial goal |
|
| 26776 | 934 |
command such as \mbox{\isa{\isacommand{lemma}}}, \mbox{\isa{\isacommand{theorem}}}, or
|
935 |
\mbox{\isa{\isacommand{corollary}}}. Within a proof, new claims may be
|
|
| 26767 | 936 |
introduced locally as well; four variants are available here to |
937 |
indicate whether forward chaining of facts should be performed |
|
| 26776 | 938 |
initially (via \indexref{}{command}{then}\mbox{\isa{\isacommand{then}}}), and whether the final result
|
| 26767 | 939 |
is meant to solve some pending goal. |
940 |
||
941 |
Goals may consist of multiple statements, resulting in a list of |
|
942 |
facts eventually. A pending multi-goal is internally represented as |
|
| 26842 | 943 |
a meta-level conjunction (printed as \isa{{\isachardoublequote}{\isacharampersand}{\isacharampersand}{\isachardoublequote}}), which is usually
|
| 26767 | 944 |
split into the corresponding number of sub-goals prior to an initial |
| 26776 | 945 |
method application, via \indexref{}{command}{proof}\mbox{\isa{\isacommand{proof}}}
|
946 |
(\secref{sec:proof-steps}) or \indexref{}{command}{apply}\mbox{\isa{\isacommand{apply}}}
|
|
947 |
(\secref{sec:tactic-commands}). The \indexref{}{method}{induct}\mbox{\isa{induct}} method
|
|
| 26767 | 948 |
covered in \secref{sec:cases-induct} acts on multiple claims
|
949 |
simultaneously. |
|
950 |
||
951 |
Claims at the theory level may be either in short or long form. A |
|
952 |
short goal merely consists of several simultaneous propositions |
|
953 |
(often just one). A long goal includes an explicit context |
|
954 |
specification for the subsequent conclusion, involving local |
|
955 |
parameters and assumptions. Here the role of each part of the |
|
956 |
statement is explicitly marked by separate keywords (see also |
|
957 |
\secref{sec:locale}); the local assumptions being introduced here
|
|
| 26776 | 958 |
are available as \indexref{}{fact}{assms}\mbox{\isa{assms}} in the proof. Moreover, there
|
| 26788 | 959 |
are two kinds of conclusions: \indexdef{}{element}{shows}\mbox{\isa{\isakeyword{shows}}} states several
|
| 26767 | 960 |
simultaneous propositions (essentially a big conjunction), while |
| 26788 | 961 |
\indexdef{}{element}{obtains}\mbox{\isa{\isakeyword{obtains}}} claims several simultaneous simultaneous
|
| 26767 | 962 |
contexts of (essentially a big disjunction of eliminated parameters |
963 |
and assumptions, cf.\ \secref{sec:obtain}).
|
|
964 |
||
965 |
\begin{rail}
|
|
966 |
('lemma' | 'theorem' | 'corollary') target? (goal | longgoal)
|
|
967 |
; |
|
968 |
('have' | 'show' | 'hence' | 'thus') goal
|
|
969 |
; |
|
970 |
'print\_statement' modes? thmrefs |
|
971 |
; |
|
972 |
||
973 |
goal: (props + 'and') |
|
974 |
; |
|
975 |
longgoal: thmdecl? (contextelem *) conclusion |
|
976 |
; |
|
977 |
conclusion: 'shows' goal | 'obtains' (parname? case + '|') |
|
978 |
; |
|
979 |
case: (vars + 'and') 'where' (props + 'and') |
|
980 |
; |
|
981 |
\end{rail}
|
|
982 |
||
983 |
\begin{descr}
|
|
984 |
||
| 26842 | 985 |
\item [\mbox{\isa{\isacommand{lemma}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] enters proof mode with
|
986 |
\isa{{\isasymphi}} as main goal, eventually resulting in some fact \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} to be put back into the target context. An additional
|
|
| 26767 | 987 |
\railnonterm{context} specification may build up an initial proof
|
988 |
context for the subsequent claim; this includes local definitions |
|
| 26776 | 989 |
and syntax as well, see the definition of \mbox{\isa{contextelem}} in
|
| 26767 | 990 |
\secref{sec:locale}.
|
991 |
||
| 26842 | 992 |
\item [\mbox{\isa{\isacommand{theorem}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} and \mbox{\isa{\isacommand{corollary}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] are essentially the same as \mbox{\isa{\isacommand{lemma}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}, but the facts are internally marked as
|
| 26767 | 993 |
being of a different kind. This discrimination acts like a formal |
994 |
comment. |
|
995 |
||
| 26842 | 996 |
\item [\mbox{\isa{\isacommand{have}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] claims a local goal,
|
| 26767 | 997 |
eventually resulting in a fact within the current logical context. |
998 |
This operation is completely independent of any pending sub-goals of |
|
| 26776 | 999 |
an enclosing goal statements, so \mbox{\isa{\isacommand{have}}} may be freely
|
| 26767 | 1000 |
used for experimental exploration of potential results within a |
1001 |
proof body. |
|
1002 |
||
| 26842 | 1003 |
\item [\mbox{\isa{\isacommand{show}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}}] is like \mbox{\isa{\isacommand{have}}}~\isa{{\isachardoublequote}a{\isacharcolon}\ {\isasymphi}{\isachardoublequote}} plus a second stage to refine some pending
|
| 26767 | 1004 |
sub-goal for each one of the finished result, after having been |
1005 |
exported into the corresponding context (at the head of the |
|
| 26776 | 1006 |
sub-proof of this \mbox{\isa{\isacommand{show}}} command).
|
| 26767 | 1007 |
|
1008 |
To accommodate interactive debugging, resulting rules are printed |
|
1009 |
before being applied internally. Even more, interactive execution |
|
| 26776 | 1010 |
of \mbox{\isa{\isacommand{show}}} predicts potential failure and displays the
|
| 26767 | 1011 |
resulting error as a warning beforehand. Watch out for the |
1012 |
following message: |
|
1013 |
||
1014 |
%FIXME proper antiquitation |
|
1015 |
\begin{ttbox}
|
|
1016 |
Problem! Local statement will fail to solve any pending goal |
|
1017 |
\end{ttbox}
|
|
1018 |
||
| 26776 | 1019 |
\item [\mbox{\isa{\isacommand{hence}}}] abbreviates ``\mbox{\isa{\isacommand{then}}}~\mbox{\isa{\isacommand{have}}}'', i.e.\ claims a local goal to be proven by forward
|
1020 |
chaining the current facts. Note that \mbox{\isa{\isacommand{hence}}} is also
|
|
1021 |
equivalent to ``\mbox{\isa{\isacommand{from}}}~\isa{this}~\mbox{\isa{\isacommand{have}}}''.
|
|
| 26767 | 1022 |
|
| 26776 | 1023 |
\item [\mbox{\isa{\isacommand{thus}}}] abbreviates ``\mbox{\isa{\isacommand{then}}}~\mbox{\isa{\isacommand{show}}}''. Note that \mbox{\isa{\isacommand{thus}}} is also equivalent to
|
1024 |
``\mbox{\isa{\isacommand{from}}}~\isa{this}~\mbox{\isa{\isacommand{show}}}''.
|
|
| 26767 | 1025 |
|
| 26776 | 1026 |
\item [\mbox{\isa{\isacommand{print{\isacharunderscore}statement}}}~\isa{a}] prints facts from the
|
| 26767 | 1027 |
current theory or proof context in long statement form, according to |
| 26776 | 1028 |
the syntax for \mbox{\isa{\isacommand{lemma}}} given above.
|
| 26767 | 1029 |
|
1030 |
\end{descr}
|
|
1031 |
||
1032 |
Any goal statement causes some term abbreviations (such as |
|
| 26776 | 1033 |
\indexref{}{variable}{?thesis}\mbox{\isa{{\isacharquery}thesis}}) to be bound automatically, see also
|
| 26767 | 1034 |
\secref{sec:term-abbrev}. Furthermore, the local context of a
|
|
26854
9b4aec46ad78
improved treatment of "_" thanks to underscore.sty;
wenzelm
parents:
26852
diff
changeset
|
1035 |
(non-atomic) goal is provided via the \indexref{}{case}{rule\_context}\mbox{\isa{rule{\isacharunderscore}context}} case.
|
| 26767 | 1036 |
|
| 26788 | 1037 |
The optional case names of \indexref{}{element}{obtains}\mbox{\isa{\isakeyword{obtains}}} have a twofold
|
| 26767 | 1038 |
meaning: (1) during the of this claim they refer to the the local |
1039 |
context introductions, (2) the resulting rule is annotated |
|
1040 |
accordingly to support symbolic case splits when used with the |
|
| 26776 | 1041 |
\indexref{}{method}{cases}\mbox{\isa{cases}} method (cf. \secref{sec:cases-induct}).
|
| 26767 | 1042 |
|
1043 |
\medskip |
|
1044 |
||
1045 |
\begin{warn}
|
|
1046 |
Isabelle/Isar suffers theory-level goal statements to contain |
|
1047 |
\emph{unbound schematic variables}, although this does not conform
|
|
1048 |
to the aim of human-readable proof documents! The main problem |
|
1049 |
with schematic goals is that the actual outcome is usually hard to |
|
1050 |
predict, depending on the behavior of the proof methods applied |
|
1051 |
during the course of reasoning. Note that most semi-automated |
|
1052 |
methods heavily depend on several kinds of implicit rule |
|
1053 |
declarations within the current theory context. As this would |
|
1054 |
also result in non-compositional checking of sub-proofs, |
|
1055 |
\emph{local goals} are not allowed to be schematic at all.
|
|
1056 |
Nevertheless, schematic goals do have their use in Prolog-style |
|
1057 |
interactive synthesis of proven results, usually by stepwise |
|
1058 |
refinement via emulation of traditional Isabelle tactic scripts |
|
1059 |
(see also \secref{sec:tactic-commands}). In any case, users
|
|
1060 |
should know what they are doing. |
|
1061 |
\end{warn}%
|
|
1062 |
\end{isamarkuptext}%
|
|
1063 |
\isamarkuptrue% |
|
1064 |
% |
|
1065 |
\isamarkupsubsection{Initial and terminal proof steps \label{sec:proof-steps}%
|
|
1066 |
} |
|
1067 |
\isamarkuptrue% |
|
1068 |
% |
|
1069 |
\begin{isamarkuptext}%
|
|
1070 |
\begin{matharray}{rcl}
|
|
| 26776 | 1071 |
\indexdef{}{command}{proof}\mbox{\isa{\isacommand{proof}}} & : & \isartrans{proof(prove)}{proof(state)} \\
|
1072 |
\indexdef{}{command}{qed}\mbox{\isa{\isacommand{qed}}} & : & \isartrans{proof(state)}{proof(state) ~|~ theory} \\
|
|
1073 |
\indexdef{}{command}{by}\mbox{\isa{\isacommand{by}}} & : & \isartrans{proof(prove)}{proof(state) ~|~ theory} \\
|
|
1074 |
\indexdef{}{command}{..}\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}} & : & \isartrans{proof(prove)}{proof(state) ~|~ theory} \\
|
|
1075 |
\indexdef{}{command}{.}\mbox{\isa{\isacommand{{\isachardot}}}} & : & \isartrans{proof(prove)}{proof(state) ~|~ theory} \\
|
|
1076 |
\indexdef{}{command}{sorry}\mbox{\isa{\isacommand{sorry}}} & : & \isartrans{proof(prove)}{proof(state) ~|~ theory} \\
|
|
| 26767 | 1077 |
\end{matharray}
|
1078 |
||
1079 |
Arbitrary goal refinement via tactics is considered harmful. |
|
1080 |
Structured proof composition in Isar admits proof methods to be |
|
1081 |
invoked in two places only. |
|
1082 |
||
1083 |
\begin{enumerate}
|
|
1084 |
||
| 26842 | 1085 |
\item An \emph{initial} refinement step \indexref{}{command}{proof}\mbox{\isa{\isacommand{proof}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}} reduces a newly stated goal to a number
|
| 26767 | 1086 |
of sub-goals that are to be solved later. Facts are passed to |
| 26842 | 1087 |
\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}} for forward chaining, if so indicated by \isa{{\isachardoublequote}proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} mode.
|
| 26767 | 1088 |
|
| 26842 | 1089 |
\item A \emph{terminal} conclusion step \indexref{}{command}{qed}\mbox{\isa{\isacommand{qed}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}} is intended to solve remaining goals. No facts are
|
1090 |
passed to \isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}}.
|
|
| 26767 | 1091 |
|
1092 |
\end{enumerate}
|
|
1093 |
||
1094 |
The only other (proper) way to affect pending goals in a proof body |
|
| 26776 | 1095 |
is by \indexref{}{command}{show}\mbox{\isa{\isacommand{show}}}, which involves an explicit statement of
|
| 26767 | 1096 |
what is to be solved eventually. Thus we avoid the fundamental |
1097 |
problem of unstructured tactic scripts that consist of numerous |
|
1098 |
consecutive goal transformations, with invisible effects. |
|
1099 |
||
1100 |
\medskip As a general rule of thumb for good proof style, initial |
|
1101 |
proof methods should either solve the goal completely, or constitute |
|
1102 |
some well-understood reduction to new sub-goals. Arbitrary |
|
1103 |
automatic proof tools that are prone leave a large number of badly |
|
1104 |
structured sub-goals are no help in continuing the proof document in |
|
1105 |
an intelligible manner. |
|
1106 |
||
1107 |
Unless given explicitly by the user, the default initial method is |
|
| 26776 | 1108 |
``\indexref{}{method}{rule}\mbox{\isa{rule}}'', which applies a single standard elimination
|
| 26767 | 1109 |
or introduction rule according to the topmost symbol involved. |
1110 |
There is no separate default terminal method. Any remaining goals |
|
1111 |
are always solved by assumption in the very last step. |
|
1112 |
||
1113 |
\begin{rail}
|
|
1114 |
'proof' method? |
|
1115 |
; |
|
1116 |
'qed' method? |
|
1117 |
; |
|
1118 |
'by' method method? |
|
1119 |
; |
|
1120 |
('.' | '..' | 'sorry')
|
|
1121 |
; |
|
1122 |
\end{rail}
|
|
1123 |
||
1124 |
\begin{descr}
|
|
1125 |
||
| 26842 | 1126 |
\item [\mbox{\isa{\isacommand{proof}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}] refines the goal by
|
1127 |
proof method \isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}; facts for forward chaining are
|
|
1128 |
passed if so indicated by \isa{{\isachardoublequote}proof{\isacharparenleft}chain{\isacharparenright}{\isachardoublequote}} mode.
|
|
| 26767 | 1129 |
|
| 26842 | 1130 |
\item [\mbox{\isa{\isacommand{qed}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}}] refines any remaining
|
1131 |
goals by proof method \isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}} and concludes the
|
|
1132 |
sub-proof by assumption. If the goal had been \isa{{\isachardoublequote}show{\isachardoublequote}} (or
|
|
1133 |
\isa{{\isachardoublequote}thus{\isachardoublequote}}), some pending sub-goal is solved as well by the rule
|
|
| 26767 | 1134 |
resulting from the result \emph{exported} into the enclosing goal
|
| 26842 | 1135 |
context. Thus \isa{{\isachardoublequote}qed{\isachardoublequote}} may fail for two reasons: either \isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}} fails, or the resulting rule does not fit to any
|
| 26767 | 1136 |
pending goal\footnote{This includes any additional ``strong''
|
| 26776 | 1137 |
assumptions as introduced by \mbox{\isa{\isacommand{assume}}}.} of the enclosing
|
| 26767 | 1138 |
context. Debugging such a situation might involve temporarily |
| 26776 | 1139 |
changing \mbox{\isa{\isacommand{show}}} into \mbox{\isa{\isacommand{have}}}, or weakening the
|
1140 |
local context by replacing occurrences of \mbox{\isa{\isacommand{assume}}} by
|
|
1141 |
\mbox{\isa{\isacommand{presume}}}.
|
|
| 26767 | 1142 |
|
| 26842 | 1143 |
\item [\mbox{\isa{\isacommand{by}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}\ m\isactrlsub {\isadigit{2}}{\isachardoublequote}}] is a
|
| 26767 | 1144 |
\emph{terminal proof}\index{proof!terminal}; it abbreviates
|
| 26842 | 1145 |
\mbox{\isa{\isacommand{proof}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}~\isa{{\isachardoublequote}qed{\isachardoublequote}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{2}}{\isachardoublequote}}, but with backtracking across both methods. Debugging
|
1146 |
an unsuccessful \mbox{\isa{\isacommand{by}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}\ m\isactrlsub {\isadigit{2}}{\isachardoublequote}}
|
|
| 26767 | 1147 |
command can be done by expanding its definition; in many cases |
| 26842 | 1148 |
\mbox{\isa{\isacommand{proof}}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}} (or even \isa{{\isachardoublequote}apply{\isachardoublequote}}~\isa{{\isachardoublequote}m\isactrlsub {\isadigit{1}}{\isachardoublequote}}) is already sufficient to see the
|
| 26767 | 1149 |
problem. |
1150 |
||
| 26776 | 1151 |
\item [``\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}}''] is a \emph{default
|
| 26842 | 1152 |
proof}\index{proof!default}; it abbreviates \mbox{\isa{\isacommand{by}}}~\isa{{\isachardoublequote}rule{\isachardoublequote}}.
|
| 26767 | 1153 |
|
| 26776 | 1154 |
\item [``\mbox{\isa{\isacommand{{\isachardot}}}}''] is a \emph{trivial
|
| 26842 | 1155 |
proof}\index{proof!trivial}; it abbreviates \mbox{\isa{\isacommand{by}}}~\isa{{\isachardoublequote}this{\isachardoublequote}}.
|
| 26767 | 1156 |
|
| 26776 | 1157 |
\item [\mbox{\isa{\isacommand{sorry}}}] is a \emph{fake proof}\index{proof!fake}
|
| 26767 | 1158 |
pretending to solve the pending claim without further ado. This |
1159 |
only works in interactive development, or if the \verb|quick_and_dirty| flag is enabled (in ML). Facts emerging from fake |
|
1160 |
proofs are not the real thing. Internally, each theorem container |
|
| 26842 | 1161 |
is tainted by an oracle invocation, which is indicated as ``\isa{{\isachardoublequote}{\isacharbrackleft}{\isacharbang}{\isacharbrackright}{\isachardoublequote}}'' in the printed result.
|
| 26767 | 1162 |
|
| 26776 | 1163 |
The most important application of \mbox{\isa{\isacommand{sorry}}} is to support
|
| 26767 | 1164 |
experimentation and top-down proof development. |
1165 |
||
1166 |
\end{descr}%
|
|
1167 |
\end{isamarkuptext}%
|
|
1168 |
\isamarkuptrue% |
|
1169 |
% |
|
1170 |
\isamarkupsubsection{Fundamental methods and attributes \label{sec:pure-meth-att}%
|
|
1171 |
} |
|
1172 |
\isamarkuptrue% |
|
1173 |
% |
|
1174 |
\begin{isamarkuptext}%
|
|
1175 |
The following proof methods and attributes refer to basic logical |
|
1176 |
operations of Isar. Further methods and attributes are provided by |
|
1177 |
several generic and object-logic specific tools and packages (see |
|
| 26852 | 1178 |
\chref{ch:gen-tools} and \chref{ch:hol}).
|
| 26767 | 1179 |
|
1180 |
\begin{matharray}{rcl}
|
|
| 26776 | 1181 |
\indexdef{}{method}{-}\mbox{\isa{{\isacharminus}}} & : & \isarmeth \\
|
1182 |
\indexdef{}{method}{fact}\mbox{\isa{fact}} & : & \isarmeth \\
|
|
1183 |
\indexdef{}{method}{assumption}\mbox{\isa{assumption}} & : & \isarmeth \\
|
|
1184 |
\indexdef{}{method}{this}\mbox{\isa{this}} & : & \isarmeth \\
|
|
1185 |
\indexdef{}{method}{rule}\mbox{\isa{rule}} & : & \isarmeth \\
|
|
1186 |
\indexdef{}{method}{iprover}\mbox{\isa{iprover}} & : & \isarmeth \\[0.5ex]
|
|
1187 |
\indexdef{}{attribute}{intro}\mbox{\isa{intro}} & : & \isaratt \\
|
|
1188 |
\indexdef{}{attribute}{elim}\mbox{\isa{elim}} & : & \isaratt \\
|
|
1189 |
\indexdef{}{attribute}{dest}\mbox{\isa{dest}} & : & \isaratt \\
|
|
1190 |
\indexdef{}{attribute}{rule}\mbox{\isa{rule}} & : & \isaratt \\[0.5ex]
|
|
1191 |
\indexdef{}{attribute}{OF}\mbox{\isa{OF}} & : & \isaratt \\
|
|
1192 |
\indexdef{}{attribute}{of}\mbox{\isa{of}} & : & \isaratt \\
|
|
1193 |
\indexdef{}{attribute}{where}\mbox{\isa{where}} & : & \isaratt \\
|
|
| 26767 | 1194 |
\end{matharray}
|
1195 |
||
1196 |
\begin{rail}
|
|
1197 |
'fact' thmrefs? |
|
1198 |
; |
|
1199 |
'rule' thmrefs? |
|
1200 |
; |
|
1201 |
'iprover' ('!' ?) (rulemod *)
|
|
1202 |
; |
|
1203 |
rulemod: ('intro' | 'elim' | 'dest') ((('!' | () | '?') nat?) | 'del') ':' thmrefs
|
|
1204 |
; |
|
1205 |
('intro' | 'elim' | 'dest') ('!' | () | '?') nat?
|
|
1206 |
; |
|
1207 |
'rule' 'del' |
|
1208 |
; |
|
1209 |
'OF' thmrefs |
|
1210 |
; |
|
1211 |
'of' insts ('concl' ':' insts)?
|
|
1212 |
; |
|
1213 |
'where' ((name | var | typefree | typevar) '=' (type | term) * 'and') |
|
1214 |
; |
|
1215 |
\end{rail}
|
|
1216 |
||
1217 |
\begin{descr}
|
|
1218 |
||
| 26776 | 1219 |
\item [``\mbox{\isa{{\isacharminus}}}'' (minus)] does nothing but insert the
|
1220 |
forward chaining facts as premises into the goal. Note that command |
|
1221 |
\indexref{}{command}{proof}\mbox{\isa{\isacommand{proof}}} without any method actually performs a single
|
|
1222 |
reduction step using the \indexref{}{method}{rule}\mbox{\isa{rule}} method; thus a plain
|
|
| 26842 | 1223 |
\emph{do-nothing} proof step would be ``\mbox{\isa{\isacommand{proof}}}~\isa{{\isachardoublequote}{\isacharminus}{\isachardoublequote}}'' rather than \mbox{\isa{\isacommand{proof}}} alone.
|
| 26767 | 1224 |
|
| 26842 | 1225 |
\item [\mbox{\isa{fact}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] composes
|
1226 |
some fact from \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ a\isactrlsub n{\isachardoublequote}} (or implicitly from
|
|
| 26767 | 1227 |
the current proof context) modulo unification of schematic type and |
1228 |
term variables. The rule structure is not taken into account, i.e.\ |
|
1229 |
meta-level implication is considered atomic. This is the same |
|
1230 |
principle underlying literal facts (cf.\ \secref{sec:syn-att}):
|
|
| 26842 | 1231 |
``\mbox{\isa{\isacommand{have}}}~\isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}}~\mbox{\isa{\isacommand{by}}}~\isa{fact}'' is
|
1232 |
equivalent to ``\mbox{\isa{\isacommand{note}}}~\verb|`|\isa{{\isasymphi}}\verb|`|'' provided that \isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} is an instance of some known
|
|
1233 |
\isa{{\isachardoublequote}{\isasymturnstile}\ {\isasymphi}{\isachardoublequote}} in the proof context.
|
|
| 26767 | 1234 |
|
| 26776 | 1235 |
\item [\mbox{\isa{assumption}}] solves some goal by a single assumption
|
| 26767 | 1236 |
step. All given facts are guaranteed to participate in the |
1237 |
refinement; this means there may be only 0 or 1 in the first place. |
|
| 26776 | 1238 |
Recall that \mbox{\isa{\isacommand{qed}}} (\secref{sec:proof-steps}) already
|
| 26767 | 1239 |
concludes any remaining sub-goals by assumption, so structured |
| 26776 | 1240 |
proofs usually need not quote the \mbox{\isa{assumption}} method at
|
| 26767 | 1241 |
all. |
1242 |
||
| 26776 | 1243 |
\item [\mbox{\isa{this}}] applies all of the current facts directly as
|
1244 |
rules. Recall that ``\mbox{\isa{\isacommand{{\isachardot}}}}'' (dot) abbreviates ``\mbox{\isa{\isacommand{by}}}~\isa{this}''.
|
|
| 26767 | 1245 |
|
| 26842 | 1246 |
\item [\mbox{\isa{rule}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] applies some
|
| 26767 | 1247 |
rule given as argument in backward manner; facts are used to reduce |
| 26776 | 1248 |
the rule before applying it to the goal. Thus \mbox{\isa{rule}}
|
| 26767 | 1249 |
without facts is plain introduction, while with facts it becomes |
1250 |
elimination. |
|
1251 |
||
| 26776 | 1252 |
When no arguments are given, the \mbox{\isa{rule}} method tries to pick
|
| 26767 | 1253 |
appropriate rules automatically, as declared in the current context |
| 26776 | 1254 |
using the \mbox{\isa{intro}}, \mbox{\isa{elim}}, \mbox{\isa{dest}}
|
1255 |
attributes (see below). This is the default behavior of \mbox{\isa{\isacommand{proof}}} and ``\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}}'' (double-dot) steps (see
|
|
| 26767 | 1256 |
\secref{sec:proof-steps}).
|
1257 |
||
| 26776 | 1258 |
\item [\mbox{\isa{iprover}}] performs intuitionistic proof search,
|
| 26767 | 1259 |
depending on specifically declared rules from the context, or given |
1260 |
as explicit arguments. Chained facts are inserted into the goal |
|
| 26842 | 1261 |
before commencing proof search; ``\mbox{\isa{iprover}}\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}''
|
| 26776 | 1262 |
means to include the current \mbox{\isa{prems}} as well.
|
| 26767 | 1263 |
|
| 26842 | 1264 |
Rules need to be classified as \mbox{\isa{intro}}, \mbox{\isa{elim}}, or \mbox{\isa{dest}}; here the ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' indicator
|
| 26776 | 1265 |
refers to ``safe'' rules, which may be applied aggressively (without |
| 26842 | 1266 |
considering back-tracking later). Rules declared with ``\isa{{\isachardoublequote}{\isacharquery}{\isachardoublequote}}'' are ignored in proof search (the single-step \mbox{\isa{rule}}
|
| 26767 | 1267 |
method still observes these). An explicit weight annotation may be |
1268 |
given as well; otherwise the number of rule premises will be taken |
|
1269 |
into account here. |
|
1270 |
||
| 26776 | 1271 |
\item [\mbox{\isa{intro}}, \mbox{\isa{elim}}, and \mbox{\isa{dest}}]
|
| 26767 | 1272 |
declare introduction, elimination, and destruct rules, to be used |
| 26776 | 1273 |
with the \mbox{\isa{rule}} and \mbox{\isa{iprover}} methods. Note that
|
| 26842 | 1274 |
the latter will ignore rules declared with ``\isa{{\isachardoublequote}{\isacharquery}{\isachardoublequote}}'', while
|
1275 |
``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' are used most aggressively.
|
|
| 26767 | 1276 |
|
1277 |
The classical reasoner (see \secref{sec:classical}) introduces its
|
|
1278 |
own variants of these attributes; use qualified names to access the |
|
| 26776 | 1279 |
present versions of Isabelle/Pure, i.e.\ \mbox{\isa{Pure{\isachardot}intro}}.
|
| 26767 | 1280 |
|
| 26776 | 1281 |
\item [\mbox{\isa{rule}}~\isa{del}] undeclares introduction,
|
| 26767 | 1282 |
elimination, or destruct rules. |
1283 |
||
| 26842 | 1284 |
\item [\mbox{\isa{OF}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] applies some
|
1285 |
theorem to all of the given rules \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ a\isactrlsub n{\isachardoublequote}}
|
|
1286 |
(in parallel). This corresponds to the \verb|"op MRS"| operation in |
|
| 26767 | 1287 |
ML, but note the reversed order. Positions may be effectively |
| 26776 | 1288 |
skipped by including ``\isa{{\isacharunderscore}}'' (underscore) as argument.
|
| 26767 | 1289 |
|
| 26842 | 1290 |
\item [\mbox{\isa{of}}~\isa{{\isachardoublequote}t\isactrlsub {\isadigit{1}}\ {\isasymdots}\ t\isactrlsub n{\isachardoublequote}}] performs
|
1291 |
positional instantiation of term variables. The terms \isa{{\isachardoublequote}t\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ t\isactrlsub n{\isachardoublequote}} are substituted for any schematic
|
|
| 26776 | 1292 |
variables occurring in a theorem from left to right; ``\isa{{\isacharunderscore}}'' (underscore) indicates to skip a position. Arguments following
|
| 26842 | 1293 |
a ``\mbox{\isa{\isakeyword{concl}}}\isa{{\isachardoublequote}{\isacharcolon}{\isachardoublequote}}'' specification refer to positions
|
| 26767 | 1294 |
of the conclusion of a rule. |
1295 |
||
| 26842 | 1296 |
\item [\mbox{\isa{where}}~\isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}\ {\isacharequal}\ t\isactrlsub {\isadigit{1}}\ {\isasymAND}\ {\isasymdots}\ x\isactrlsub n\ {\isacharequal}\ t\isactrlsub n{\isachardoublequote}}] performs named instantiation of schematic
|
| 26776 | 1297 |
type and term variables occurring in a theorem. Schematic variables |
| 26842 | 1298 |
have to be specified on the left-hand side (e.g.\ \isa{{\isachardoublequote}{\isacharquery}x{\isadigit{1}}{\isachardot}{\isadigit{3}}{\isachardoublequote}}).
|
| 26776 | 1299 |
The question mark may be omitted if the variable name is a plain |
1300 |
identifier without index. As type instantiations are inferred from |
|
1301 |
term instantiations, explicit type instantiations are seldom |
|
1302 |
necessary. |
|
| 26767 | 1303 |
|
1304 |
\end{descr}%
|
|
1305 |
\end{isamarkuptext}%
|
|
1306 |
\isamarkuptrue% |
|
1307 |
% |
|
1308 |
\isamarkupsubsection{Term abbreviations \label{sec:term-abbrev}%
|
|
1309 |
} |
|
1310 |
\isamarkuptrue% |
|
1311 |
% |
|
1312 |
\begin{isamarkuptext}%
|
|
1313 |
\begin{matharray}{rcl}
|
|
| 26776 | 1314 |
\indexdef{}{command}{let}\mbox{\isa{\isacommand{let}}} & : & \isartrans{proof(state)}{proof(state)} \\
|
1315 |
\indexdef{}{keyword}{is}\mbox{\isa{\isakeyword{is}}} & : & syntax \\
|
|
| 26767 | 1316 |
\end{matharray}
|
1317 |
||
| 26842 | 1318 |
Abbreviations may be either bound by explicit \mbox{\isa{\isacommand{let}}}~\isa{{\isachardoublequote}p\ {\isasymequiv}\ t{\isachardoublequote}} statements, or by annotating assumptions or
|
1319 |
goal statements with a list of patterns ``\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIS}\ p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub n{\isacharparenright}{\isachardoublequote}}''. In both cases, higher-order matching is invoked to
|
|
| 26776 | 1320 |
bind extra-logical term variables, which may be either named |
1321 |
schematic variables of the form \isa{{\isacharquery}x}, or nameless dummies
|
|
1322 |
``\mbox{\isa{{\isacharunderscore}}}'' (underscore). Note that in the \mbox{\isa{\isacommand{let}}}
|
|
1323 |
form the patterns occur on the left-hand side, while the \mbox{\isa{\isakeyword{is}}} patterns are in postfix position.
|
|
| 26767 | 1324 |
|
1325 |
Polymorphism of term bindings is handled in Hindley-Milner style, |
|
1326 |
similar to ML. Type variables referring to local assumptions or |
|
1327 |
open goal statements are \emph{fixed}, while those of finished
|
|
| 26776 | 1328 |
results or bound by \mbox{\isa{\isacommand{let}}} may occur in \emph{arbitrary}
|
| 26767 | 1329 |
instances later. Even though actual polymorphism should be rarely |
1330 |
used in practice, this mechanism is essential to achieve proper |
|
1331 |
incremental type-inference, as the user proceeds to build up the |
|
1332 |
Isar proof text from left to right. |
|
1333 |
||
1334 |
\medskip Term abbreviations are quite different from local |
|
| 26776 | 1335 |
definitions as introduced via \mbox{\isa{\isacommand{def}}} (see
|
| 26767 | 1336 |
\secref{sec:proof-context}). The latter are visible within the
|
1337 |
logic as actual equations, while abbreviations disappear during the |
|
| 26776 | 1338 |
input process just after type checking. Also note that \mbox{\isa{\isacommand{def}}} does not support polymorphism.
|
| 26767 | 1339 |
|
1340 |
\begin{rail}
|
|
1341 |
'let' ((term + 'and') '=' term + 'and') |
|
1342 |
; |
|
1343 |
\end{rail}
|
|
1344 |
||
| 26776 | 1345 |
The syntax of \mbox{\isa{\isakeyword{is}}} patterns follows \railnonterm{termpat}
|
| 26767 | 1346 |
or \railnonterm{proppat} (see \secref{sec:term-decls}).
|
1347 |
||
1348 |
\begin{descr}
|
|
1349 |
||
| 26842 | 1350 |
\item [\mbox{\isa{\isacommand{let}}}~\isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}\ {\isacharequal}\ t\isactrlsub {\isadigit{1}}\ {\isasymAND}\ {\isasymdots}\ p\isactrlsub n\ {\isacharequal}\ t\isactrlsub n{\isachardoublequote}}] binds any text variables in patterns \isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ p\isactrlsub n{\isachardoublequote}} by simultaneous higher-order matching
|
1351 |
against terms \isa{{\isachardoublequote}t\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ t\isactrlsub n{\isachardoublequote}}.
|
|
| 26767 | 1352 |
|
| 26842 | 1353 |
\item [\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIS}\ p\isactrlsub {\isadigit{1}}\ {\isasymdots}\ p\isactrlsub n{\isacharparenright}{\isachardoublequote}}] resembles \mbox{\isa{\isacommand{let}}}, but matches \isa{{\isachardoublequote}p\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ p\isactrlsub n{\isachardoublequote}} against the
|
| 26776 | 1354 |
preceding statement. Also note that \mbox{\isa{\isakeyword{is}}} is not a
|
1355 |
separate command, but part of others (such as \mbox{\isa{\isacommand{assume}}},
|
|
1356 |
\mbox{\isa{\isacommand{have}}} etc.).
|
|
| 26767 | 1357 |
|
1358 |
\end{descr}
|
|
1359 |
||
1360 |
Some \emph{implicit} term abbreviations\index{term abbreviations}
|
|
1361 |
for goals and facts are available as well. For any open goal, |
|
| 26776 | 1362 |
\indexref{}{variable}{thesis}\mbox{\isa{thesis}} refers to its object-level statement,
|
| 26767 | 1363 |
abstracted over any meta-level parameters (if present). Likewise, |
| 26776 | 1364 |
\indexref{}{variable}{this}\mbox{\isa{this}} is bound for fact statements resulting from
|
1365 |
assumptions or finished goals. In case \mbox{\isa{this}} refers to
|
|
| 26842 | 1366 |
an object-logic statement that is an application \isa{{\isachardoublequote}f\ t{\isachardoublequote}}, then
|
| 26776 | 1367 |
\isa{t} is bound to the special text variable ``\mbox{\isa{{\isasymdots}}}''
|
| 26767 | 1368 |
(three dots). The canonical application of this convenience are |
1369 |
calculational proofs (see \secref{sec:calculation}).%
|
|
1370 |
\end{isamarkuptext}%
|
|
1371 |
\isamarkuptrue% |
|
1372 |
% |
|
1373 |
\isamarkupsubsection{Block structure%
|
|
1374 |
} |
|
1375 |
\isamarkuptrue% |
|
1376 |
% |
|
1377 |
\begin{isamarkuptext}%
|
|
1378 |
\begin{matharray}{rcl}
|
|
| 26776 | 1379 |
\indexdef{}{command}{next}\mbox{\isa{\isacommand{next}}} & : & \isartrans{proof(state)}{proof(state)} \\
|
1380 |
\indexdef{}{command}{\{}\mbox{\isa{\isacommand{{\isacharbraceleft}}}} & : & \isartrans{proof(state)}{proof(state)} \\
|
|
1381 |
\indexdef{}{command}{\}}\mbox{\isa{\isacommand{{\isacharbraceright}}}} & : & \isartrans{proof(state)}{proof(state)} \\
|
|
| 26767 | 1382 |
\end{matharray}
|
1383 |
||
1384 |
While Isar is inherently block-structured, opening and closing |
|
1385 |
blocks is mostly handled rather casually, with little explicit |
|
1386 |
user-intervention. Any local goal statement automatically opens |
|
1387 |
\emph{two} internal blocks, which are closed again when concluding
|
|
| 26776 | 1388 |
the sub-proof (by \mbox{\isa{\isacommand{qed}}} etc.). Sections of different
|
1389 |
context within a sub-proof may be switched via \mbox{\isa{\isacommand{next}}},
|
|
| 26767 | 1390 |
which is just a single block-close followed by block-open again. |
| 26776 | 1391 |
The effect of \mbox{\isa{\isacommand{next}}} is to reset the local proof context;
|
| 26767 | 1392 |
there is no goal focus involved here! |
1393 |
||
1394 |
For slightly more advanced applications, there are explicit block |
|
1395 |
parentheses as well. These typically achieve a stronger forward |
|
1396 |
style of reasoning. |
|
1397 |
||
1398 |
\begin{descr}
|
|
1399 |
||
| 26776 | 1400 |
\item [\mbox{\isa{\isacommand{next}}}] switches to a fresh block within a
|
| 26767 | 1401 |
sub-proof, resetting the local context to the initial one. |
1402 |
||
| 26776 | 1403 |
\item [\mbox{\isa{\isacommand{{\isacharbraceleft}}}} and \mbox{\isa{\isacommand{{\isacharbraceright}}}}] explicitly open and close
|
1404 |
blocks. Any current facts pass through ``\mbox{\isa{\isacommand{{\isacharbraceleft}}}}''
|
|
1405 |
unchanged, while ``\mbox{\isa{\isacommand{{\isacharbraceright}}}}'' causes any result to be
|
|
| 26767 | 1406 |
\emph{exported} into the enclosing context. Thus fixed variables
|
1407 |
are generalized, assumptions discharged, and local definitions |
|
1408 |
unfolded (cf.\ \secref{sec:proof-context}). There is no difference
|
|
| 26776 | 1409 |
of \mbox{\isa{\isacommand{assume}}} and \mbox{\isa{\isacommand{presume}}} in this mode of
|
| 26767 | 1410 |
forward reasoning --- in contrast to plain backward reasoning with |
| 26776 | 1411 |
the result exported at \mbox{\isa{\isacommand{show}}} time.
|
| 26767 | 1412 |
|
1413 |
\end{descr}%
|
|
1414 |
\end{isamarkuptext}%
|
|
1415 |
\isamarkuptrue% |
|
1416 |
% |
|
1417 |
\isamarkupsubsection{Emulating tactic scripts \label{sec:tactic-commands}%
|
|
1418 |
} |
|
1419 |
\isamarkuptrue% |
|
1420 |
% |
|
1421 |
\begin{isamarkuptext}%
|
|
1422 |
The Isar provides separate commands to accommodate tactic-style |
|
1423 |
proof scripts within the same system. While being outside the |
|
1424 |
orthodox Isar proof language, these might come in handy for |
|
1425 |
interactive exploration and debugging, or even actual tactical proof |
|
1426 |
within new-style theories (to benefit from document preparation, for |
|
1427 |
example). See also \secref{sec:tactics} for actual tactics, that
|
|
1428 |
have been encapsulated as proof methods. Proper proof methods may |
|
1429 |
be used in scripts, too. |
|
1430 |
||
1431 |
\begin{matharray}{rcl}
|
|
| 26867 | 1432 |
\indexdef{}{command}{apply}\mbox{\isa{\isacommand{apply}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof(prove)}{proof(prove)} \\
|
1433 |
\indexdef{}{command}{apply\_end}\mbox{\isa{\isacommand{apply{\isacharunderscore}end}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof(state)}{proof(state)} \\
|
|
1434 |
\indexdef{}{command}{done}\mbox{\isa{\isacommand{done}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof(prove)}{proof(state)} \\
|
|
1435 |
\indexdef{}{command}{defer}\mbox{\isa{\isacommand{defer}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof}{proof} \\
|
|
1436 |
\indexdef{}{command}{prefer}\mbox{\isa{\isacommand{prefer}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof}{proof} \\
|
|
1437 |
\indexdef{}{command}{back}\mbox{\isa{\isacommand{back}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isartrans{proof}{proof} \\
|
|
| 26767 | 1438 |
\end{matharray}
|
1439 |
||
1440 |
\begin{rail}
|
|
1441 |
( 'apply' | 'apply\_end' ) method |
|
1442 |
; |
|
1443 |
'defer' nat? |
|
1444 |
; |
|
1445 |
'prefer' nat |
|
1446 |
; |
|
1447 |
\end{rail}
|
|
1448 |
||
1449 |
\begin{descr}
|
|
1450 |
||
| 26776 | 1451 |
\item [\mbox{\isa{\isacommand{apply}}}~\isa{m}] applies proof method \isa{m}
|
1452 |
in initial position, but unlike \mbox{\isa{\isacommand{proof}}} it retains
|
|
| 26842 | 1453 |
``\isa{{\isachardoublequote}proof{\isacharparenleft}prove{\isacharparenright}{\isachardoublequote}}'' mode. Thus consecutive method
|
| 26767 | 1454 |
applications may be given just as in tactic scripts. |
1455 |
||
1456 |
Facts are passed to \isa{m} as indicated by the goal's
|
|
1457 |
forward-chain mode, and are \emph{consumed} afterwards. Thus any
|
|
| 26776 | 1458 |
further \mbox{\isa{\isacommand{apply}}} command would always work in a purely
|
| 26767 | 1459 |
backward manner. |
1460 |
||
| 26842 | 1461 |
\item [\mbox{\isa{\isacommand{apply{\isacharunderscore}end}}}~\isa{{\isachardoublequote}m{\isachardoublequote}}] applies proof method
|
| 26767 | 1462 |
\isa{m} as if in terminal position. Basically, this simulates a
|
| 26776 | 1463 |
multi-step tactic script for \mbox{\isa{\isacommand{qed}}}, but may be given
|
| 26767 | 1464 |
anywhere within the proof body. |
1465 |
||
| 26776 | 1466 |
No facts are passed to \mbox{\isa{m}} here. Furthermore, the static
|
1467 |
context is that of the enclosing goal (as for actual \mbox{\isa{\isacommand{qed}}}). Thus the proof method may not refer to any assumptions
|
|
| 26767 | 1468 |
introduced in the current body, for example. |
1469 |
||
| 26776 | 1470 |
\item [\mbox{\isa{\isacommand{done}}}] completes a proof script, provided that
|
| 26767 | 1471 |
the current goal state is solved completely. Note that actual |
| 26776 | 1472 |
structured proof commands (e.g.\ ``\mbox{\isa{\isacommand{{\isachardot}}}}'' or \mbox{\isa{\isacommand{sorry}}}) may be used to conclude proof scripts as well.
|
| 26767 | 1473 |
|
| 26776 | 1474 |
\item [\mbox{\isa{\isacommand{defer}}}~\isa{n} and \mbox{\isa{\isacommand{prefer}}}~\isa{n}] shuffle the list of pending goals: \mbox{\isa{\isacommand{defer}}} puts off
|
| 26842 | 1475 |
sub-goal \isa{n} to the end of the list (\isa{{\isachardoublequote}n\ {\isacharequal}\ {\isadigit{1}}{\isachardoublequote}} by
|
| 26776 | 1476 |
default), while \mbox{\isa{\isacommand{prefer}}} brings sub-goal \isa{n} to the
|
| 26767 | 1477 |
front. |
1478 |
||
| 26776 | 1479 |
\item [\mbox{\isa{\isacommand{back}}}] does back-tracking over the result
|
| 26767 | 1480 |
sequence of the latest proof command. Basically, any proof command |
1481 |
may return multiple results. |
|
1482 |
||
1483 |
\end{descr}
|
|
1484 |
||
1485 |
Any proper Isar proof method may be used with tactic script commands |
|
| 26776 | 1486 |
such as \mbox{\isa{\isacommand{apply}}}. A few additional emulations of actual
|
| 26767 | 1487 |
tactics are provided as well; these would be never used in actual |
1488 |
structured proofs, of course.% |
|
1489 |
\end{isamarkuptext}%
|
|
1490 |
\isamarkuptrue% |
|
1491 |
% |
|
1492 |
\isamarkupsubsection{Meta-linguistic features%
|
|
1493 |
} |
|
1494 |
\isamarkuptrue% |
|
1495 |
% |
|
1496 |
\begin{isamarkuptext}%
|
|
1497 |
\begin{matharray}{rcl}
|
|
| 26776 | 1498 |
\indexdef{}{command}{oops}\mbox{\isa{\isacommand{oops}}} & : & \isartrans{proof}{theory} \\
|
| 26767 | 1499 |
\end{matharray}
|
1500 |
||
| 26776 | 1501 |
The \mbox{\isa{\isacommand{oops}}} command discontinues the current proof
|
| 26767 | 1502 |
attempt, while considering the partial proof text as properly |
1503 |
processed. This is conceptually quite different from ``faking'' |
|
| 26776 | 1504 |
actual proofs via \indexref{}{command}{sorry}\mbox{\isa{\isacommand{sorry}}} (see
|
1505 |
\secref{sec:proof-steps}): \mbox{\isa{\isacommand{oops}}} does not observe the
|
|
| 26767 | 1506 |
proof structure at all, but goes back right to the theory level. |
| 26776 | 1507 |
Furthermore, \mbox{\isa{\isacommand{oops}}} does not produce any result theorem
|
| 26767 | 1508 |
--- there is no intended claim to be able to complete the proof |
1509 |
anyhow. |
|
1510 |
||
| 26776 | 1511 |
A typical application of \mbox{\isa{\isacommand{oops}}} is to explain Isar proofs
|
| 26767 | 1512 |
\emph{within} the system itself, in conjunction with the document
|
1513 |
preparation tools of Isabelle described in \cite{isabelle-sys}.
|
|
1514 |
Thus partial or even wrong proof attempts can be discussed in a |
|
1515 |
logically sound manner. Note that the Isabelle {\LaTeX} macros can
|
|
| 26842 | 1516 |
be easily adapted to print something like ``\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}'' instead of
|
| 26776 | 1517 |
the keyword ``\mbox{\isa{\isacommand{oops}}}''.
|
| 26767 | 1518 |
|
| 26776 | 1519 |
\medskip The \mbox{\isa{\isacommand{oops}}} command is undo-able, unlike
|
1520 |
\indexref{}{command}{kill}\mbox{\isa{\isacommand{kill}}} (see \secref{sec:history}). The effect is to
|
|
| 26767 | 1521 |
get back to the theory just before the opening of the proof.% |
1522 |
\end{isamarkuptext}%
|
|
1523 |
\isamarkuptrue% |
|
1524 |
% |
|
1525 |
\isamarkupsection{Other commands%
|
|
1526 |
} |
|
1527 |
\isamarkuptrue% |
|
1528 |
% |
|
1529 |
\isamarkupsubsection{Diagnostics%
|
|
1530 |
} |
|
1531 |
\isamarkuptrue% |
|
1532 |
% |
|
1533 |
\begin{isamarkuptext}%
|
|
1534 |
\begin{matharray}{rcl}
|
|
| 26867 | 1535 |
\indexdef{}{command}{pr}\mbox{\isa{\isacommand{pr}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
|
1536 |
\indexdef{}{command}{thm}\mbox{\isa{\isacommand{thm}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1537 |
\indexdef{}{command}{term}\mbox{\isa{\isacommand{term}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1538 |
\indexdef{}{command}{prop}\mbox{\isa{\isacommand{prop}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1539 |
\indexdef{}{command}{typ}\mbox{\isa{\isacommand{typ}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1540 |
\indexdef{}{command}{prf}\mbox{\isa{\isacommand{prf}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1541 |
\indexdef{}{command}{full\_prf}\mbox{\isa{\isacommand{full{\isacharunderscore}prf}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
| 26767 | 1542 |
\end{matharray}
|
1543 |
||
1544 |
These diagnostic commands assist interactive development. Note that |
|
| 26776 | 1545 |
\mbox{\isa{\isacommand{undo}}} does not apply here, the theory or proof
|
| 26767 | 1546 |
configuration is not changed. |
1547 |
||
1548 |
\begin{rail}
|
|
1549 |
'pr' modes? nat? (',' nat)?
|
|
1550 |
; |
|
1551 |
'thm' modes? thmrefs |
|
1552 |
; |
|
1553 |
'term' modes? term |
|
1554 |
; |
|
1555 |
'prop' modes? prop |
|
1556 |
; |
|
1557 |
'typ' modes? type |
|
1558 |
; |
|
1559 |
'prf' modes? thmrefs? |
|
1560 |
; |
|
1561 |
'full\_prf' modes? thmrefs? |
|
1562 |
; |
|
1563 |
||
1564 |
modes: '(' (name + ) ')'
|
|
1565 |
; |
|
1566 |
\end{rail}
|
|
1567 |
||
1568 |
\begin{descr}
|
|
1569 |
||
| 26842 | 1570 |
\item [\mbox{\isa{\isacommand{pr}}}~\isa{{\isachardoublequote}goals{\isacharcomma}\ prems{\isachardoublequote}}] prints the current
|
| 26767 | 1571 |
proof state (if present), including the proof context, current facts |
1572 |
and goals. The optional limit arguments affect the number of goals |
|
1573 |
and premises to be displayed, which is initially 10 for both. |
|
1574 |
Omitting limit values leaves the current setting unchanged. |
|
1575 |
||
| 26842 | 1576 |
\item [\mbox{\isa{\isacommand{thm}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}] retrieves
|
| 26767 | 1577 |
theorems from the current theory or proof context. Note that any |
1578 |
attributes included in the theorem specifications are applied to a |
|
1579 |
temporary context derived from the current theory or proof; the |
|
| 26842 | 1580 |
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 | 1581 |
|
| 26776 | 1582 |
\item [\mbox{\isa{\isacommand{term}}}~\isa{t} and \mbox{\isa{\isacommand{prop}}}~\isa{{\isasymphi}}]
|
| 26767 | 1583 |
read, type-check and print terms or propositions according to the |
1584 |
current theory or proof context; the inferred type of \isa{t} is
|
|
1585 |
output as well. Note that these commands are also useful in |
|
1586 |
inspecting the current environment of term abbreviations. |
|
1587 |
||
| 26776 | 1588 |
\item [\mbox{\isa{\isacommand{typ}}}~\isa{{\isasymtau}}] reads and prints types of the
|
| 26767 | 1589 |
meta-logic according to the current theory or proof context. |
1590 |
||
| 26776 | 1591 |
\item [\mbox{\isa{\isacommand{prf}}}] displays the (compact) proof term of the
|
| 26767 | 1592 |
current proof state (if present), or of the given theorems. Note |
1593 |
that this requires proof terms to be switched on for the current |
|
1594 |
object logic (see the ``Proof terms'' section of the Isabelle |
|
1595 |
reference manual for information on how to do this). |
|
1596 |
||
| 26776 | 1597 |
\item [\mbox{\isa{\isacommand{full{\isacharunderscore}prf}}}] is like \mbox{\isa{\isacommand{prf}}}, but displays
|
| 26767 | 1598 |
the full proof term, i.e.\ also displays information omitted in the |
| 26776 | 1599 |
compact proof term, which is denoted by ``\isa{{\isacharunderscore}}'' placeholders
|
1600 |
there. |
|
| 26767 | 1601 |
|
1602 |
\end{descr}
|
|
1603 |
||
1604 |
All of the diagnostic commands above admit a list of \isa{modes}
|
|
1605 |
to be specified, which is appended to the current print mode (see |
|
1606 |
also \cite{isabelle-ref}). Thus the output behavior may be modified
|
|
| 26842 | 1607 |
according particular print mode features. For example, \mbox{\isa{\isacommand{pr}}}~\isa{{\isachardoublequote}{\isacharparenleft}latex\ xsymbols\ symbols{\isacharparenright}{\isachardoublequote}} would print the current
|
| 26767 | 1608 |
proof state with mathematical symbols and special characters |
1609 |
represented in {\LaTeX} source, according to the Isabelle style
|
|
1610 |
\cite{isabelle-sys}.
|
|
1611 |
||
1612 |
Note that antiquotations (cf.\ \secref{sec:antiq}) provide a more
|
|
1613 |
systematic way to include formal items into the printed text |
|
1614 |
document.% |
|
1615 |
\end{isamarkuptext}%
|
|
1616 |
\isamarkuptrue% |
|
1617 |
% |
|
1618 |
\isamarkupsubsection{Inspecting the context%
|
|
1619 |
} |
|
1620 |
\isamarkuptrue% |
|
1621 |
% |
|
1622 |
\begin{isamarkuptext}%
|
|
1623 |
\begin{matharray}{rcl}
|
|
| 26867 | 1624 |
\indexdef{}{command}{print\_commands}\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
|
1625 |
\indexdef{}{command}{print\_theory}\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1626 |
\indexdef{}{command}{print\_syntax}\mbox{\isa{\isacommand{print{\isacharunderscore}syntax}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1627 |
\indexdef{}{command}{print\_methods}\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1628 |
\indexdef{}{command}{print\_attributes}\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1629 |
\indexdef{}{command}{print\_theorems}\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1630 |
\indexdef{}{command}{find\_theorems}\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1631 |
\indexdef{}{command}{thms\_deps}\mbox{\isa{\isacommand{thms{\isacharunderscore}deps}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{theory~|~proof} \\
|
|
1632 |
\indexdef{}{command}{print\_facts}\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{proof} \\
|
|
1633 |
\indexdef{}{command}{print\_binds}\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{proof} \\
|
|
| 26767 | 1634 |
\end{matharray}
|
1635 |
||
1636 |
\begin{rail}
|
|
1637 |
'print\_theory' ( '!'?) |
|
1638 |
; |
|
1639 |
||
1640 |
'find\_theorems' (('(' (nat)? ('with\_dups')? ')')?) (criterion *)
|
|
1641 |
; |
|
1642 |
criterion: ('-'?) ('name' ':' nameref | 'intro' | 'elim' | 'dest' |
|
|
1643 |
'simp' ':' term | term) |
|
1644 |
; |
|
1645 |
'thm\_deps' thmrefs |
|
1646 |
; |
|
1647 |
\end{rail}
|
|
1648 |
||
1649 |
These commands print certain parts of the theory and proof context. |
|
1650 |
Note that there are some further ones available, such as for the set |
|
1651 |
of rules declared for simplifications. |
|
1652 |
||
1653 |
\begin{descr}
|
|
1654 |
||
| 26776 | 1655 |
\item [\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}] prints Isabelle's outer theory
|
| 26767 | 1656 |
syntax, including keywords and command. |
1657 |
||
| 26776 | 1658 |
\item [\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}] prints the main logical content of
|
| 26842 | 1659 |
the theory context; the ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' option indicates extra
|
| 26767 | 1660 |
verbosity. |
1661 |
||
| 26776 | 1662 |
\item [\mbox{\isa{\isacommand{print{\isacharunderscore}syntax}}}] prints the inner syntax of types
|
| 26767 | 1663 |
and terms, depending on the current context. The output can be very |
1664 |
verbose, including grammar tables and syntax translation rules. See |
|
1665 |
\cite[\S7, \S8]{isabelle-ref} for further information on Isabelle's
|
|
1666 |
inner syntax. |
|
1667 |
||
| 26776 | 1668 |
\item [\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}] prints all proof methods
|
| 26767 | 1669 |
available in the current theory context. |
1670 |
||
| 26776 | 1671 |
\item [\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}] prints all attributes
|
| 26767 | 1672 |
available in the current theory context. |
1673 |
||
| 26776 | 1674 |
\item [\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}] prints theorems resulting from
|
| 26767 | 1675 |
the last command. |
1676 |
||
| 26776 | 1677 |
\item [\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}~\isa{criteria}] retrieves facts
|
| 26767 | 1678 |
from the theory or proof context matching all of given search |
| 26842 | 1679 |
criteria. The criterion \isa{{\isachardoublequote}name{\isacharcolon}\ p{\isachardoublequote}} selects all theorems
|
| 26767 | 1680 |
whose fully qualified name matches pattern \isa{p}, which may
|
| 26842 | 1681 |
contain ``\isa{{\isachardoublequote}{\isacharasterisk}{\isachardoublequote}}'' wildcards. The criteria \isa{intro},
|
| 26767 | 1682 |
\isa{elim}, and \isa{dest} select theorems that match the
|
1683 |
current goal as introduction, elimination or destruction rules, |
|
| 26842 | 1684 |
respectively. The criterion \isa{{\isachardoublequote}simp{\isacharcolon}\ t{\isachardoublequote}} selects all rewrite
|
| 26767 | 1685 |
rules whose left-hand side matches the given term. The criterion |
1686 |
term \isa{t} selects all theorems that contain the pattern \isa{t} -- as usual, patterns may contain occurrences of the dummy
|
|
| 26776 | 1687 |
``\isa{{\isacharunderscore}}'', schematic variables, and type constraints.
|
| 26767 | 1688 |
|
| 26842 | 1689 |
Criteria can be preceded by ``\isa{{\isachardoublequote}{\isacharminus}{\isachardoublequote}}'' to select theorems that
|
| 26767 | 1690 |
do \emph{not} match. Note that giving the empty list of criteria
|
1691 |
yields \emph{all} currently known facts. An optional limit for the
|
|
1692 |
number of printed facts may be given; the default is 40. By |
|
1693 |
default, duplicates are removed from the search result. Use |
|
| 26776 | 1694 |
\mbox{\isa{\isakeyword{with{\isacharunderscore}dups}}} to display duplicates.
|
| 26767 | 1695 |
|
| 26842 | 1696 |
\item [\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}]
|
| 26767 | 1697 |
visualizes dependencies of facts, using Isabelle's graph browser |
1698 |
tool (see also \cite{isabelle-sys}).
|
|
1699 |
||
| 26776 | 1700 |
\item [\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}] prints all local facts of the
|
| 26767 | 1701 |
current context, both named and unnamed ones. |
1702 |
||
| 26776 | 1703 |
\item [\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}] prints all term abbreviations
|
| 26767 | 1704 |
present in the context. |
1705 |
||
1706 |
\end{descr}%
|
|
1707 |
\end{isamarkuptext}%
|
|
1708 |
\isamarkuptrue% |
|
1709 |
% |
|
1710 |
\isamarkupsubsection{History commands \label{sec:history}%
|
|
1711 |
} |
|
1712 |
\isamarkuptrue% |
|
1713 |
% |
|
1714 |
\begin{isamarkuptext}%
|
|
1715 |
\begin{matharray}{rcl}
|
|
| 26776 | 1716 |
\indexdef{}{command}{undo}\mbox{\isa{\isacommand{undo}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
|
1717 |
\indexdef{}{command}{redo}\mbox{\isa{\isacommand{redo}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
|
|
1718 |
\indexdef{}{command}{kill}\mbox{\isa{\isacommand{kill}}}^{{ * }{ * }} & : & \isarkeep{\cdot} \\
|
|
| 26767 | 1719 |
\end{matharray}
|
1720 |
||
1721 |
The Isabelle/Isar top-level maintains a two-stage history, for |
|
1722 |
theory and proof state transformation. Basically, any command can |
|
| 26776 | 1723 |
be undone using \mbox{\isa{\isacommand{undo}}}, excluding mere diagnostic
|
1724 |
elements. Its effect may be revoked via \mbox{\isa{\isacommand{redo}}}, unless
|
|
1725 |
the corresponding \mbox{\isa{\isacommand{undo}}} step has crossed the beginning
|
|
1726 |
of a proof or theory. The \mbox{\isa{\isacommand{kill}}} command aborts the
|
|
| 26767 | 1727 |
current history node altogether, discontinuing a proof or even the |
1728 |
whole theory. This operation is \emph{not} undo-able.
|
|
1729 |
||
1730 |
\begin{warn}
|
|
1731 |
History commands should never be used with user interfaces such as |
|
1732 |
Proof~General \cite{proofgeneral,Aspinall:TACAS:2000}, which takes
|
|
1733 |
care of stepping forth and back itself. Interfering by manual |
|
| 26776 | 1734 |
\mbox{\isa{\isacommand{undo}}}, \mbox{\isa{\isacommand{redo}}}, or even \mbox{\isa{\isacommand{kill}}}
|
| 26767 | 1735 |
commands would quickly result in utter confusion. |
1736 |
\end{warn}%
|
|
1737 |
\end{isamarkuptext}%
|
|
1738 |
\isamarkuptrue% |
|
1739 |
% |
|
1740 |
\isamarkupsubsection{System operations%
|
|
1741 |
} |
|
1742 |
\isamarkuptrue% |
|
1743 |
% |
|
1744 |
\begin{isamarkuptext}%
|
|
1745 |
\begin{matharray}{rcl}
|
|
| 26867 | 1746 |
\indexdef{}{command}{cd}\mbox{\isa{\isacommand{cd}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
|
1747 |
\indexdef{}{command}{pwd}\mbox{\isa{\isacommand{pwd}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
|
|
1748 |
\indexdef{}{command}{use\_thy}\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
|
|
1749 |
\indexdef{}{command}{display\_drafts}\mbox{\isa{\isacommand{display{\isacharunderscore}drafts}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
|
|
1750 |
\indexdef{}{command}{print\_drafts}\mbox{\isa{\isacommand{print{\isacharunderscore}drafts}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
|
|
| 26767 | 1751 |
\end{matharray}
|
1752 |
||
1753 |
\begin{rail}
|
|
1754 |
('cd' | 'use\_thy' | 'update\_thy') name
|
|
1755 |
; |
|
1756 |
('display\_drafts' | 'print\_drafts') (name +)
|
|
1757 |
; |
|
1758 |
\end{rail}
|
|
1759 |
||
1760 |
\begin{descr}
|
|
1761 |
||
| 26776 | 1762 |
\item [\mbox{\isa{\isacommand{cd}}}~\isa{path}] changes the current directory
|
| 26767 | 1763 |
of the Isabelle process. |
1764 |
||
| 26776 | 1765 |
\item [\mbox{\isa{\isacommand{pwd}}}] prints the current working directory.
|
| 26767 | 1766 |
|
| 26776 | 1767 |
\item [\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}~\isa{A}] preload theory \isa{A}.
|
| 26767 | 1768 |
These system commands are scarcely used when working interactively, |
1769 |
since loading of theories is done automatically as required. |
|
1770 |
||
| 26776 | 1771 |
\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 | 1772 |
of raw source files. Only those symbols that do not require |
1773 |
additional {\LaTeX} packages are displayed properly, everything else
|
|
1774 |
is left verbatim. |
|
1775 |
||
1776 |
\end{descr}%
|
|
1777 |
\end{isamarkuptext}%
|
|
1778 |
\isamarkuptrue% |
|
1779 |
% |
|
1780 |
\isadelimtheory |
|
1781 |
% |
|
1782 |
\endisadelimtheory |
|
1783 |
% |
|
1784 |
\isatagtheory |
|
1785 |
\isacommand{end}\isamarkupfalse%
|
|
1786 |
% |
|
1787 |
\endisatagtheory |
|
1788 |
{\isafoldtheory}%
|
|
1789 |
% |
|
1790 |
\isadelimtheory |
|
1791 |
% |
|
1792 |
\endisadelimtheory |
|
1793 |
\isanewline |
|
1794 |
\end{isabellebody}%
|
|
1795 |
%%% Local Variables: |
|
1796 |
%%% mode: latex |
|
1797 |
%%% TeX-master: "root" |
|
1798 |
%%% End: |