author | huffman |
Wed, 22 Aug 2007 20:59:19 +0200 | |
changeset 24407 | 61b10ffb2549 |
parent 24110 | 4ab3084e311c |
child 24429 | 76372c3847a2 |
permissions | -rw-r--r-- |
13048 | 1 |
\chapter{Generic tools and packages}\label{ch:gen-tools} |
7167 | 2 |
|
24085 | 3 |
\section{Specification commands} |
12618 | 4 |
|
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
5 |
\subsection{Derived specifications} |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
6 |
|
19666 | 7 |
\indexisarcmd{axiomatization} |
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
8 |
\indexisarcmd{definition}\indexisaratt{defn} |
21716 | 9 |
\indexisarcmd{abbreviation}\indexisarcmd{print-abbrevs} |
21209
dbb8decc36bc
'const_syntax' command: allow fixed variables, renamed to 'notation';
wenzelm
parents:
21076
diff
changeset
|
10 |
\indexisarcmd{notation} |
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
11 |
\begin{matharray}{rcll} |
19666 | 12 |
\isarcmd{axiomatization} & : & \isarkeep{local{\dsh}theory} & (axiomatic!)\\ |
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
13 |
\isarcmd{definition} & : & \isarkeep{local{\dsh}theory} \\ |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
14 |
defn & : & \isaratt \\ |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
15 |
\isarcmd{abbreviation} & : & \isarkeep{local{\dsh}theory} \\ |
21716 | 16 |
\isarcmd{print_abbrevs}^* & : & \isarkeep{theory~|~proof} \\ |
21209
dbb8decc36bc
'const_syntax' command: allow fixed variables, renamed to 'notation';
wenzelm
parents:
21076
diff
changeset
|
17 |
\isarcmd{notation} & : & \isarkeep{local{\dsh}theory} \\ |
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
18 |
\end{matharray} |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
19 |
|
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
20 |
These specification mechanisms provide a slightly more abstract view |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
21 |
than the underlying primitives of $\CONSTS$, $\DEFS$ (see |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
22 |
\S\ref{sec:consts}), and $\isarkeyword{axioms}$ (see |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
23 |
\S\ref{sec:axms-thms}). In particular, type-inference is commonly |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
24 |
available, and result names need not be given. |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
25 |
|
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
26 |
\begin{rail} |
21601
6588b947d631
simplified syntax for 'definition', 'abbreviation';
wenzelm
parents:
21403
diff
changeset
|
27 |
'axiomatization' target? fixes? ('where' specs)? |
19666 | 28 |
; |
21601
6588b947d631
simplified syntax for 'definition', 'abbreviation';
wenzelm
parents:
21403
diff
changeset
|
29 |
'definition' target? (decl 'where')? thmdecl? prop |
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
30 |
; |
21601
6588b947d631
simplified syntax for 'definition', 'abbreviation';
wenzelm
parents:
21403
diff
changeset
|
31 |
'abbreviation' target? mode? (decl 'where')? prop |
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
32 |
; |
21403 | 33 |
'notation' target? mode? (nameref mixfix + 'and') |
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
34 |
; |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
35 |
|
21601
6588b947d631
simplified syntax for 'definition', 'abbreviation';
wenzelm
parents:
21403
diff
changeset
|
36 |
fixes: ((name ('::' type)? mixfix? | vars) + 'and') |
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
37 |
; |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
38 |
specs: (thmdecl? props + 'and') |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
39 |
; |
21601
6588b947d631
simplified syntax for 'definition', 'abbreviation';
wenzelm
parents:
21403
diff
changeset
|
40 |
decl: name ('::' type)? mixfix? |
6588b947d631
simplified syntax for 'definition', 'abbreviation';
wenzelm
parents:
21403
diff
changeset
|
41 |
; |
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
42 |
\end{rail} |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
43 |
|
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
44 |
\begin{descr} |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
45 |
|
19666 | 46 |
\item $\isarkeyword{axiomatization} ~ c@1 \dots c@n ~ |
47 |
\isarkeyword{where} ~ A@1 \dots A@m$ introduces several constants |
|
48 |
simultaneously and states axiomatic properties for these. The |
|
49 |
constants are marked as being specified once and for all, which |
|
50 |
prevents additional specifications being issued later on. |
|
51 |
||
52 |
Note that axiomatic specifications are only appropriate when |
|
53 |
declaring a new logical system. Normal applications should only use |
|
54 |
definitional mechanisms! |
|
55 |
||
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
56 |
\item $\isarkeyword{definition}~c~\isarkeyword{where}~eq$ produces an |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
57 |
internal definition $c \equiv t$ according to the specification |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
58 |
given as $eq$, which is then turned into a proven fact. The given |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
59 |
proposition may deviate from internal meta-level equality according |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
60 |
to the rewrite rules declared as $defn$ by the object-logic. This |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
61 |
typically covers object-level equality $x = t$ and equivalence $A |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
62 |
\leftrightarrow B$. Users normally need not change the $defn$ |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
63 |
setup. |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
64 |
|
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
65 |
Definitions may be presented with explicit arguments on the LHS, as |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
66 |
well as additional conditions, e.g.\ $f\;x\;y = t$ instead of $f |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
67 |
\equiv \lambda x\;y. t$ and $y \not= 0 \Imp g\;x\;y = u$ instead of |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
68 |
an unguarded $g \equiv \lambda x\;y. u$. |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
69 |
|
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
70 |
\item $\isarkeyword{abbreviation}~c~\isarkeyword{where}~eq$ introduces |
19363 | 71 |
a syntactic constant which is associated with a certain term |
72 |
according to the meta-level equality $eq$. |
|
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
73 |
|
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
74 |
Abbreviations participate in the usual type-inference process, but |
19363 | 75 |
are expanded before the logic ever sees them. Pretty printing of |
76 |
terms involves higher-order rewriting with rules stemming from |
|
77 |
reverted abbreviations. This needs some care to avoid overlapping |
|
78 |
or looping syntactic replacements! |
|
79 |
||
80 |
The optional $mode$ specification restricts output to a particular |
|
81 |
print mode; using ``$input$'' here achieves the effect of one-way |
|
82 |
abbreviations. The mode may also include an ``$output$'' qualifier |
|
83 |
that affects the concrete syntax declared for abbreviations, cf.\ |
|
84 |
$\isarkeyword{syntax}$ in \S\ref{sec:syn-trans}. |
|
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
85 |
|
21716 | 86 |
\item $\isarkeyword{print_abbrevs}$ prints all constant abbreviations |
87 |
of the current context. |
|
88 |
||
21209
dbb8decc36bc
'const_syntax' command: allow fixed variables, renamed to 'notation';
wenzelm
parents:
21076
diff
changeset
|
89 |
\item $\isarkeyword{notation}~c~mx$ associates mixfix syntax with an |
dbb8decc36bc
'const_syntax' command: allow fixed variables, renamed to 'notation';
wenzelm
parents:
21076
diff
changeset
|
90 |
existing constant or fixed variable. This is a robust interface to |
dbb8decc36bc
'const_syntax' command: allow fixed variables, renamed to 'notation';
wenzelm
parents:
21076
diff
changeset
|
91 |
the underlying $\isarkeyword{syntax}$ primitive |
dbb8decc36bc
'const_syntax' command: allow fixed variables, renamed to 'notation';
wenzelm
parents:
21076
diff
changeset
|
92 |
(\S\ref{sec:syn-trans}). Type declaration and internal syntactic |
dbb8decc36bc
'const_syntax' command: allow fixed variables, renamed to 'notation';
wenzelm
parents:
21076
diff
changeset
|
93 |
representation of the given entity is retrieved from the context. |
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
94 |
|
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
95 |
\end{descr} |
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
96 |
|
21303 | 97 |
All of these specifications support local theory targets (cf.\ |
98 |
\S\ref{sec:target}). |
|
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
99 |
|
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
100 |
|
24026 | 101 |
\subsection{Generic declarations} |
102 |
||
103 |
Arbitrary operations on the background context may be wrapped-up as |
|
104 |
generic declaration elements. Since the underlying concept of local |
|
105 |
theories may be subject to later re-interpretation, there is an |
|
106 |
additional dependency on a morphism that tells the difference of the |
|
107 |
original declaration context wrt.\ the application context encountered |
|
108 |
later on. A fact declaration is an important special case: it |
|
109 |
consists of a theorem which is applied to the context by means of an |
|
110 |
attribute. |
|
111 |
||
112 |
\indexisarcmd{declaration}\indexisarcmd{declare} |
|
113 |
\begin{matharray}{rcl} |
|
114 |
\isarcmd{declaration} & : & \isarkeep{local{\dsh}theory} \\ |
|
115 |
\isarcmd{declare} & : & \isarkeep{local{\dsh}theory} \\ |
|
116 |
\end{matharray} |
|
117 |
||
118 |
\begin{rail} |
|
119 |
'declaration' target? text |
|
120 |
; |
|
121 |
'declare' target? (thmrefs + 'and') |
|
122 |
; |
|
123 |
\end{rail} |
|
124 |
||
125 |
\begin{descr} |
|
126 |
||
127 |
\item [$\isarkeyword{declaration}~d$] adds the declaration function |
|
128 |
$d$ of ML type \verb,declaration, to the current local theory under |
|
129 |
construction. In later application contexts, the function is |
|
130 |
transformed according to the morphisms being involved in the |
|
131 |
interpretation hierarchy. |
|
132 |
||
133 |
\item [$\isarkeyword{declare}~thms$] declares theorems to the current |
|
134 |
local theory context. No theorem binding is involved here, unlike |
|
135 |
$\isarkeyword{theorems}$ or $\isarkeyword{lemmas}$ (cf.\ |
|
136 |
\S\ref{sec:axms-thms}), so $\isarkeyword{declare}$ only has the |
|
137 |
effect of applying attributes as included in the theorem |
|
138 |
specification. |
|
139 |
||
140 |
\end{descr} |
|
141 |
||
142 |
||
21303 | 143 |
\subsection{Local theory targets}\label{sec:target} |
144 |
||
145 |
A local theory target is a context managed separately within the |
|
146 |
enclosing theory. Contexts may introduce parameters (fixed variables) |
|
147 |
and assumptions (hypotheses). Definitions and theorems depending on |
|
148 |
the context may be added incrementally later on. Named contexts refer |
|
149 |
to locales (cf.\ \S\ref{sec:locale}) or type classes (cf.\ |
|
150 |
\S\ref{sec:class}); the name ``$-$'' signifies the global theory |
|
151 |
context. |
|
152 |
||
153 |
\indexisarcmd{context}\indexisarcmd{end} |
|
154 |
\begin{matharray}{rcll} |
|
155 |
\isarcmd{context} & : & \isartrans{theory}{local{\dsh}theory} \\ |
|
156 |
\isarcmd{end} & : & \isartrans{local{\dsh}theory}{theory} \\ |
|
157 |
\end{matharray} |
|
158 |
||
159 |
\indexouternonterm{target} |
|
160 |
\begin{rail} |
|
161 |
'context' name 'begin' |
|
162 |
; |
|
163 |
||
164 |
target: '(' 'in' name ')' |
|
165 |
; |
|
166 |
\end{rail} |
|
167 |
||
168 |
\begin{descr} |
|
169 |
||
170 |
\item $\isarkeyword{context}~c~\isarkeyword{begin}$ recommences an |
|
171 |
existing locale or class context $c$. Note that locale and class |
|
172 |
definitions allow to include the $\isarkeyword{begin}$ keyword as |
|
173 |
well, in order to continue the local theory immediately after the |
|
174 |
initial specification. |
|
175 |
||
176 |
\item $\END$ concludes the current local theory and continues the |
|
177 |
enclosing global theory. Note that a non-local $\END$ has a |
|
178 |
different meaning: it concludes the theory itself |
|
179 |
(\S\ref{sec:begin-thy}). |
|
180 |
||
181 |
\item $(\IN~loc)$ given after any local theory command specifies an |
|
182 |
immediate target, e.g.\ |
|
183 |
``$\isarkeyword{definition}~(\IN~loc)~\dots$'' or |
|
184 |
``$\THEOREMNAME~(\IN~loc)~\dots$''. This works both in a local or |
|
185 |
global theory context; the current target context will be suspended |
|
186 |
for this command only. Note that $(\IN~-)$ will always produce a |
|
187 |
global result independently of the current target context. |
|
188 |
||
189 |
\end{descr} |
|
190 |
||
191 |
The exact meaning of results produced within a local theory context |
|
192 |
depends on the underlying target infrastructure (locale, type class |
|
193 |
etc.). The general idea is as follows, considering a context named |
|
194 |
$c$ with parameter $x$ and assumption $A[x]$. |
|
195 |
||
196 |
Definitions are exported by introducing a global version with |
|
197 |
additional arguments; a syntactic abbreviation links the long form |
|
198 |
with the abstract version of the target context. For example, $a |
|
199 |
\equiv t[x]$ becomes $c\dtt a \; ?x \equiv t[?x]$ at the theory level |
|
200 |
(for arbitrary $?x$), together with a local abbreviation $c \equiv |
|
201 |
c\dtt a\; x$ in the target context (for fixed $x$). |
|
202 |
||
203 |
Theorems are exported by discharging the assumptions and generalizing |
|
204 |
the parameters of the context. For example, $a: B[x]$ becomes $c\dtt |
|
205 |
a: A[?x] \Imp B[?x]$ (for arbitrary $?x$). |
|
206 |
||
207 |
||
208 |
\subsection{Locales}\label{sec:locale} |
|
12618 | 209 |
|
13040 | 210 |
Locales are named local contexts, consisting of a list of declaration elements |
13041 | 211 |
that are modeled after the Isar proof context commands (cf.\ |
13040 | 212 |
\S\ref{sec:proof-context}). |
12976 | 213 |
|
13048 | 214 |
|
12976 | 215 |
\subsubsection{Locale specifications} |
216 |
||
217 |
\indexisarcmd{locale}\indexisarcmd{print-locale}\indexisarcmd{print-locales} |
|
218 |
\begin{matharray}{rcl} |
|
19070
99001616e0e2
derived specifications: definition, abbreviation, axiomatization;
wenzelm
parents:
18903
diff
changeset
|
219 |
\isarcmd{locale} & : & \isartrans{theory}{local{\dsh}theory} \\ |
12976 | 220 |
\isarcmd{print_locale}^* & : & \isarkeep{theory~|~proof} \\ |
221 |
\isarcmd{print_locales}^* & : & \isarkeep{theory~|~proof} \\ |
|
20468
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
222 |
intro_locales & : & \isarmeth \\ |
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
223 |
unfold_locales & : & \isarmeth \\ |
12976 | 224 |
\end{matharray} |
225 |
||
226 |
\indexouternonterm{contextexpr}\indexouternonterm{contextelem} |
|
18903 | 227 |
\indexisarelem{fixes}\indexisarelem{constrains}\indexisarelem{assumes} |
228 |
\indexisarelem{defines}\indexisarelem{notes}\indexisarelem{includes} |
|
12976 | 229 |
|
230 |
\begin{rail} |
|
21303 | 231 |
'locale' ('(open)')? name ('=' localeexpr)? 'begin'? |
12976 | 232 |
; |
18903 | 233 |
'print\_locale' '!'? localeexpr |
12976 | 234 |
; |
235 |
localeexpr: ((contextexpr '+' (contextelem+)) | contextexpr | (contextelem+)) |
|
236 |
; |
|
237 |
||
238 |
contextexpr: nameref | '(' contextexpr ')' | |
|
16102
c5f6726d9bb1
Locale expressions: rename with optional mixfix syntax.
ballarin
parents:
16010
diff
changeset
|
239 |
(contextexpr (name mixfix? +)) | (contextexpr + '+') |
12976 | 240 |
; |
16168
adb83939177f
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
241 |
contextelem: fixes | constrains | assumes | defines | notes | includes |
12976 | 242 |
; |
18854 | 243 |
fixes: 'fixes' ((name ('::' type)? structmixfix? | vars) + 'and') |
12976 | 244 |
; |
16168
adb83939177f
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
245 |
constrains: 'constrains' (name '::' type + 'and') |
adb83939177f
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
246 |
; |
12976 | 247 |
assumes: 'assumes' (thmdecl? props + 'and') |
248 |
; |
|
249 |
defines: 'defines' (thmdecl? prop proppat? + 'and') |
|
250 |
; |
|
251 |
notes: 'notes' (thmdef? thmrefs + 'and') |
|
252 |
; |
|
253 |
includes: 'includes' contextexpr |
|
254 |
; |
|
12967 | 255 |
\end{rail} |
12618 | 256 |
|
12976 | 257 |
\begin{descr} |
13411 | 258 |
|
259 |
\item [$\LOCALE~loc~=~import~+~body$] defines a new locale $loc$ as a context |
|
12976 | 260 |
consisting of a certain view of existing locales ($import$) plus some |
261 |
additional elements ($body$). Both $import$ and $body$ are optional; the |
|
13024 | 262 |
degenerate form $\LOCALE~loc$ defines an empty locale, which may still be |
263 |
useful to collect declarations of facts later on. Type-inference on locale |
|
12976 | 264 |
expressions automatically takes care of the most general typing that the |
265 |
combined context elements may acquire. |
|
13041 | 266 |
|
12976 | 267 |
The $import$ consists of a structured context expression, consisting of |
268 |
references to existing locales, renamed contexts, or merged contexts. |
|
16102
c5f6726d9bb1
Locale expressions: rename with optional mixfix syntax.
ballarin
parents:
16010
diff
changeset
|
269 |
Renaming uses positional notation: $c~\vec x$ means that (a prefix of) the |
12976 | 270 |
fixed parameters of context $c$ are named according to $\vec x$; a |
16102
c5f6726d9bb1
Locale expressions: rename with optional mixfix syntax.
ballarin
parents:
16010
diff
changeset
|
271 |
``\texttt{_}'' (underscore) \indexisarthm{_@\texttt{_}} means to skip that |
c5f6726d9bb1
Locale expressions: rename with optional mixfix syntax.
ballarin
parents:
16010
diff
changeset
|
272 |
position. Renaming by default deletes existing syntax. Optionally, |
c5f6726d9bb1
Locale expressions: rename with optional mixfix syntax.
ballarin
parents:
16010
diff
changeset
|
273 |
new syntax may by specified with a mixfix annotation. Note that the |
c5f6726d9bb1
Locale expressions: rename with optional mixfix syntax.
ballarin
parents:
16010
diff
changeset
|
274 |
special syntax declared with ``$(structure)$'' (see below) is |
c5f6726d9bb1
Locale expressions: rename with optional mixfix syntax.
ballarin
parents:
16010
diff
changeset
|
275 |
neither deleted nor can it be changed. |
13041 | 276 |
Merging proceeds from left-to-right, suppressing any duplicates stemming |
277 |
from different paths through the import hierarchy. |
|
278 |
||
12976 | 279 |
The $body$ consists of basic context elements, further context expressions |
280 |
may be included as well. |
|
281 |
||
282 |
\begin{descr} |
|
13041 | 283 |
|
12976 | 284 |
\item [$\FIXES{~x::\tau~(mx)}$] declares a local parameter of type $\tau$ |
285 |
and mixfix annotation $mx$ (both are optional). The special syntax |
|
13027 | 286 |
declaration ``$(structure)$'' means that $x$ may be referenced |
287 |
implicitly in this context. |
|
13041 | 288 |
|
16168
adb83939177f
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
289 |
\item [$\CONSTRAINS{~x::\tau}$] introduces a type constraint $\tau$ |
adb83939177f
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
290 |
on the local parameter $x$. |
adb83939177f
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
291 |
|
12976 | 292 |
\item [$\ASSUMES{a}{\vec\phi}$] introduces local premises, similar to |
293 |
$\ASSUMENAME$ within a proof (cf.\ \S\ref{sec:proof-context}). |
|
13041 | 294 |
|
12976 | 295 |
\item [$\DEFINES{a}{x \equiv t}$] defines a previously declared parameter. |
13041 | 296 |
This is close to $\DEFNAME$ within a proof (cf.\ |
12976 | 297 |
\S\ref{sec:proof-context}), but $\DEFINESNAME$ takes an equational |
13041 | 298 |
proposition instead of variable-term pair. The left-hand side of the |
299 |
equation may have additional arguments, e.g.\ ``$\DEFINES{}{f~\vec x |
|
300 |
\equiv t}$''. |
|
301 |
||
12976 | 302 |
\item [$\NOTES{a}{\vec b}$] reconsiders facts within a local context. Most |
303 |
notably, this may include arbitrary declarations in any attribute |
|
304 |
specifications included here, e.g.\ a local $simp$ rule. |
|
13041 | 305 |
|
12976 | 306 |
\item [$\INCLUDES{c}$] copies the specified context in a statically scoped |
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
307 |
manner. Only available in the long goal format of \S\ref{sec:goals}. |
13041 | 308 |
|
12976 | 309 |
In contrast, the initial $import$ specification of a locale expression |
310 |
maintains a dynamic relation to the locales being referenced (benefiting |
|
311 |
from any later fact declarations in the obvious manner). |
|
312 |
\end{descr} |
|
13411 | 313 |
|
13041 | 314 |
Note that ``$\IS{p}$'' patterns given in the syntax of $\ASSUMESNAME$ and |
13411 | 315 |
$\DEFINESNAME$ above are illegal in locale definitions. In the long goal |
316 |
format of \S\ref{sec:goals}, term bindings may be included as expected, |
|
317 |
though. |
|
318 |
||
319 |
\medskip By default, locale specifications are ``closed up'' by turning the |
|
320 |
given text into a predicate definition $loc_axioms$ and deriving the |
|
321 |
original assumptions as local lemmas (modulo local definitions). The |
|
322 |
predicate statement covers only the newly specified assumptions, omitting |
|
323 |
the content of included locale expressions. The full cumulative view is |
|
324 |
only provided on export, involving another predicate $loc$ that refers to |
|
325 |
the complete specification text. |
|
326 |
||
327 |
In any case, the predicate arguments are those locale parameters that |
|
328 |
actually occur in the respective piece of text. Also note that these |
|
329 |
predicates operate at the meta-level in theory, but the locale packages |
|
330 |
attempts to internalize statements according to the object-logic setup |
|
331 |
(e.g.\ replacing $\Forall$ by $\forall$, and $\Imp$ by $\imp$ in HOL; see |
|
332 |
also \S\ref{sec:object-logic}). Separate introduction rules |
|
333 |
$loc_axioms.intro$ and $loc.intro$ are declared as well. |
|
334 |
||
335 |
The $(open)$ option of a locale specification prevents both the current |
|
336 |
$loc_axioms$ and cumulative $loc$ predicate constructions. Predicates are |
|
337 |
also omitted for empty specification texts. |
|
12976 | 338 |
|
339 |
\item [$\isarkeyword{print_locale}~import~+~body$] prints the specified locale |
|
340 |
expression in a flattened form. The notable special case |
|
341 |
$\isarkeyword{print_locale}~loc$ just prints the contents of the named |
|
342 |
locale, but keep in mind that type-inference will normalize type variables |
|
17228 | 343 |
according to the usual alphabetical order. The command omits |
344 |
$\isarkeyword{notes}$ elements by default. Use |
|
345 |
$\isarkeyword{print_locale}!$ to get them included. |
|
13041 | 346 |
|
12976 | 347 |
\item [$\isarkeyword{print_locales}$] prints the names of all locales of the |
348 |
current theory. |
|
349 |
||
20468
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
350 |
\item [$intro_locales$ and $unfold_locales$] repeatedly expand |
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
351 |
all introduction rules of locale predicates of the theory. While |
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
352 |
$intro_locales$ only applies the $loc.intro$ introduction rules and |
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
353 |
therefore does not decend to assumptions, $unfold_locales$ is more |
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
354 |
aggressive and applies $loc_axioms.intro$ as well. Both methods are |
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
355 |
aware of locale specifications entailed by the context, both from |
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
356 |
target and $\isarkeyword{includes}$ statements, and from |
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
357 |
interpretations (see below). New goals that are entailed by the |
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
358 |
current context are discharged automatically. |
0bda06d731ee
Documented methods intro_locales and unfold_locales.
ballarin
parents:
20467
diff
changeset
|
359 |
|
12976 | 360 |
\end{descr} |
361 |
||
12621 | 362 |
|
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
363 |
\subsubsection{Interpretation of locales} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
364 |
|
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
365 |
Locale expressions (more precisely, \emph{context expressions}) may be |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
366 |
instantiated, and the instantiated facts added to the current context. |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
367 |
This requires a proof of the instantiated specification and is called |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
368 |
\emph{locale interpretation}. Interpretation is possible in theories |
21303 | 369 |
and locales (command $\isarcmd{interpretation}$) and also in proof |
370 |
contexts ($\isarcmd{interpret}$). |
|
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
371 |
|
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
372 |
\indexisarcmd{interpretation}\indexisarcmd{interpret} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
373 |
\indexisarcmd{print-interps} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
374 |
\begin{matharray}{rcl} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
375 |
\isarcmd{interpretation} & : & \isartrans{theory}{proof(prove)} \\ |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
376 |
\isarcmd{interpret} & : & \isartrans{proof(state) ~|~ proof(chain)}{proof(prove)} \\ |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
377 |
\isarcmd{print_interps}^* & : & \isarkeep{theory~|~proof} \\ |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
378 |
\end{matharray} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
379 |
|
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
380 |
\indexouternonterm{interp} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
381 |
|
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
382 |
\railalias{printinterps}{print\_interps} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
383 |
\railterm{printinterps} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
384 |
|
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
385 |
\begin{rail} |
23920 | 386 |
'interpretation' (interp | name ('<' | subseteq) contextexpr) |
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
387 |
; |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
388 |
'interpret' interp |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
389 |
; |
17139
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
390 |
printinterps '!'? name |
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
391 |
; |
23920 | 392 |
interp: thmdecl? \\ (contextexpr ('[' (inst+) ']')? | |
393 |
name ('[' (inst+) ']')? 'where' (prop + 'and')) |
|
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
394 |
; |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
395 |
\end{rail} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
396 |
|
17043 | 397 |
|
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
398 |
\begin{descr} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
399 |
|
23920 | 400 |
\item [$\isarcmd{interpretation}~expr~insts~\isarkeyword{where}~eqns$] |
17043 | 401 |
|
23920 | 402 |
The first form of $\isarcmd{interpretation}$ interprets $expr$ in |
403 |
the theory. The instantiation is given as a list of terms $insts$ |
|
404 |
and is positional. All parameters must receive an instantiation |
|
405 |
term --- with the exception of defined parameters. These are, if |
|
406 |
omitted, derived from the defining equation and other |
|
407 |
instantiations. Use ``\_'' to omit an instantiation term. Free |
|
408 |
variables are automatically generalized. |
|
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
409 |
|
17043 | 410 |
The command generates proof obligations for the instantiated |
411 |
specifications (assumes and defines elements). Once these are |
|
412 |
discharged by the user, instantiated facts are added to the theory in |
|
413 |
a post-processing phase. |
|
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
414 |
|
23920 | 415 |
Additional equations, which are unfolded in facts during |
416 |
post-processing, may be given after the keyword |
|
417 |
$\isarkeyword{where}$. This is useful for interpreting concepts |
|
418 |
introduced through definition specification elements. The equations |
|
419 |
must be proved. Note that if equations are present, the context |
|
420 |
expression is restricted to a locale name. |
|
421 |
||
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
422 |
The command is aware of interpretations already active in the |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
423 |
theory. No proof obligations are generated for those, neither is |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
424 |
post-processing applied to their facts. This avoids duplication of |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
425 |
interpreted facts, in particular. Note that, in the case of a |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
426 |
locale with import, parts of the interpretation may already be |
23920 | 427 |
active. The command will only generate proof obligations and process |
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
428 |
facts for new parts. |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
429 |
|
17043 | 430 |
The context expression may be preceded by a name and/or attributes. |
431 |
These take effect in the post-processing of facts. The name is used |
|
432 |
to prefix fact names, for example to avoid accidental hiding of |
|
433 |
other facts. Attributes are applied after attributes of the |
|
434 |
interpreted facts. |
|
435 |
||
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
436 |
Adding facts to locales has the |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
437 |
effect of adding interpreted facts to the theory for all active |
17043 | 438 |
interpretations also. That is, interpretations dynamically |
439 |
participate in any facts added to locales. |
|
440 |
||
441 |
\item [$\isarcmd{interpretation}~name~\subseteq~expr$] |
|
442 |
||
443 |
This form of the command interprets $expr$ in the locale $name$. It |
|
444 |
requires a proof that the specification of $name$ implies the |
|
445 |
specification of $expr$. As in the localized version of the theorem |
|
446 |
command, the proof is in the context of $name$. After the proof |
|
447 |
obligation has been dischared, the facts of $expr$ |
|
448 |
become part of locale $name$ as \emph{derived} context elements and |
|
449 |
are available when the context $name$ is subsequently entered. |
|
450 |
Note that, like import, this is dynamic: facts added to a locale |
|
17139
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
451 |
part of $expr$ after interpretation become also available in |
17043 | 452 |
$name$. Like facts |
453 |
of renamed context elements, facts obtained by interpretation may be |
|
454 |
accessed by prefixing with the parameter renaming (where the parameters |
|
455 |
are separated by `\_'). |
|
456 |
||
457 |
Unlike interpretation in theories, instantiation is confined to the |
|
458 |
renaming of parameters, which may be specified as part of the context |
|
459 |
expression $expr$. Using defined parameters in $name$ one may |
|
460 |
achieve an effect similar to instantiation, though. |
|
461 |
||
462 |
Only specification fragments of $expr$ that are not already part of |
|
463 |
$name$ (be it imported, derived or a derived fragment of the import) |
|
464 |
are considered by interpretation. This enables circular |
|
465 |
interpretations. |
|
466 |
||
17139
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
467 |
If interpretations of $name$ exist in the current theory, the |
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
468 |
command adds interpretations for $expr$ as well, with the same |
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
469 |
prefix and attributes, although only for fragments of $expr$ that |
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
470 |
are not interpreted in the theory already. |
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
471 |
|
23920 | 472 |
\item [$\isarcmd{interpret}~expr~insts~\isarkeyword{where}~eqns$] |
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
473 |
interprets $expr$ in the proof context and is otherwise similar to |
17043 | 474 |
interpretation in theories. Free variables in instantiations are not |
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
475 |
generalized, however. |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
476 |
|
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
477 |
\item [$\isarcmd{print_interps}~loc$] |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
478 |
prints the interpretations of a particular locale $loc$ that are |
17139
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
479 |
active in the current context, either theory or proof context. The |
19145 | 480 |
exclamation point argument triggers printing of |
17139
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
481 |
\emph{witness} theorems justifying interpretations. These are |
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
482 |
normally omitted from the output. |
165c97f9bb63
Printing of interpretations: option to show witness theorems;
ballarin
parents:
17043
diff
changeset
|
483 |
|
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
484 |
|
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
485 |
\end{descr} |
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
486 |
|
15837 | 487 |
\begin{warn} |
488 |
Since attributes are applied to interpreted theorems, interpretation |
|
21303 | 489 |
may modify the context of common proof tools, e.g.\ the Simplifier |
490 |
or Classical Reasoner. Since the behavior of such automated |
|
491 |
reasoning tools is \emph{not} stable under interpretation morphisms, |
|
492 |
manual declarations might have to be issued. |
|
15837 | 493 |
\end{warn} |
494 |
||
16168
adb83939177f
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
495 |
\begin{warn} |
17043 | 496 |
An interpretation in a theory may subsume previous interpretations. |
497 |
This happens if the same specification fragment is interpreted twice |
|
498 |
and the instantiation of the second interpretation is more general |
|
21303 | 499 |
than the interpretation of the first. A warning is issued, since it |
500 |
is likely that these could have been generalized in the first place. |
|
501 |
The locale package does not attempt to remove subsumed |
|
502 |
interpretations. |
|
16168
adb83939177f
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
503 |
\end{warn} |
adb83939177f
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
504 |
|
15763
b901a127ac73
Interpretation supports statically scoped attributes; documentation.
ballarin
parents:
14605
diff
changeset
|
505 |
|
21303 | 506 |
\subsection{Type classes}\label{sec:class} |
20379 | 507 |
|
21303 | 508 |
A type class is a special case of a locale, with some additional |
509 |
infrastructure (notably a link to type-inference). Type classes |
|
510 |
consist of a locale with \emph{exactly one} type variable and an |
|
511 |
corresponding axclass. \cite{isabelle-classes} gives a substantial |
|
21076 | 512 |
introduction on type classes. |
20379 | 513 |
|
20467 | 514 |
\indexisarcmd{instance}\indexisarcmd{class}\indexisarcmd{print-classes} |
20379 | 515 |
\begin{matharray}{rcl} |
516 |
\isarcmd{class} & : & \isartrans{theory}{local{\dsh}theory} \\ |
|
517 |
\isarcmd{instance} & : & \isartrans{theory}{proof(prove)} \\ |
|
518 |
\isarcmd{print_classes}^* & : & \isarkeep{theory~|~proof} \\ |
|
519 |
\end{matharray} |
|
520 |
||
521 |
\begin{rail} |
|
21303 | 522 |
'class' name '=' classexpr 'begin'? |
20379 | 523 |
; |
524 |
'instance' (instarity | instsubsort) |
|
525 |
; |
|
526 |
'print\_classes' |
|
527 |
; |
|
528 |
||
529 |
classexpr: ((superclassexpr '+' (contextelem+)) | superclassexpr | (contextelem+)) |
|
530 |
; |
|
22294 | 531 |
instarity: (nameref '::' arity + 'and') (axmdecl prop +)? |
20379 | 532 |
; |
533 |
instsubsort: nameref ('<' | subseteq) sort |
|
534 |
; |
|
535 |
superclassexpr: nameref | (nameref '+' superclassexpr) |
|
536 |
; |
|
537 |
\end{rail} |
|
538 |
||
539 |
\begin{descr} |
|
540 |
||
541 |
\item [$\CLASS~c = superclasses~+~body$] defines a new class $c$, |
|
542 |
inheriting from $superclasses$. Simultaneously, a locale |
|
20467 | 543 |
named $c$ is introduced, inheriting from the locales |
20379 | 544 |
corresponding to $superclasses$; also, an axclass |
545 |
named $c$, inheriting from the axclasses corresponding to |
|
546 |
$superclasses$. $\FIXESNAME$ in $body$ are lifted |
|
547 |
to the theory toplevel, constraining |
|
548 |
the free type variable to sort $c$ and stripping local syntax. |
|
549 |
$\ASSUMESNAME$ in $body$ are also lifted, |
|
550 |
constraining |
|
551 |
the free type variable to sort $c$. |
|
552 |
||
553 |
\item [$\INSTANCE~a: \vec{arity}~\vec{defs}$] |
|
554 |
sets up a goal stating type arities. The proof would usually |
|
555 |
proceed by $intro_classes$, and then establish the characteristic theorems |
|
556 |
of the type classes involved. |
|
557 |
The $defs$, if given, must correspond to the class parameters |
|
558 |
involved in the $arities$ and are introduces in the theory |
|
22294 | 559 |
before proof. |
20379 | 560 |
After finishing the proof, the theory will be |
561 |
augmented by a type signature declaration corresponding to the |
|
562 |
resulting theorems. |
|
22294 | 563 |
This $\isarcmd{instance}$ command is actually an extension |
564 |
of primitive axclass $\isarcmd{instance}$ (see \ref{sec:axclass}). |
|
20379 | 565 |
|
566 |
\item [$\INSTANCE~c \subseteq \vec{c}$] sets up a |
|
567 |
goal stating |
|
568 |
the interpretation of the locale corresponding to $c$ |
|
569 |
in the merge of all locales corresponding to $\vec{c}$. |
|
570 |
After finishing the proof, it is automatically lifted to |
|
571 |
prove the additional class relation $c \subseteq \vec{c}$. |
|
572 |
||
22294 | 573 |
\item [$\isarkeyword{print_classes}$] prints all classes |
20467 | 574 |
in the current theory. |
20379 | 575 |
|
576 |
\end{descr} |
|
577 |
||
578 |
||
20492 | 579 |
\subsection{Axiomatic type classes}\label{sec:axclass} |
580 |
||
581 |
\indexisarcmd{axclass}\indexisarmeth{intro-classes} |
|
582 |
\begin{matharray}{rcl} |
|
583 |
\isarcmd{axclass} & : & \isartrans{theory}{theory} \\ |
|
584 |
\isarcmd{instance} & : & \isartrans{theory}{proof(prove)} \\ |
|
585 |
intro_classes & : & \isarmeth \\ |
|
586 |
\end{matharray} |
|
587 |
||
588 |
Axiomatic type classes are provided by Isabelle/Pure as a \emph{definitional} |
|
589 |
interface to type classes (cf.~\S\ref{sec:classes}). Thus any object logic |
|
590 |
may make use of this light-weight mechanism of abstract theories |
|
591 |
\cite{Wenzel:1997:TPHOL}. There is also a tutorial on using axiomatic type |
|
592 |
classes in Isabelle \cite{isabelle-axclass} that is part of the standard |
|
593 |
Isabelle documentation. |
|
594 |
||
595 |
\begin{rail} |
|
596 |
'axclass' classdecl (axmdecl prop +) |
|
597 |
; |
|
598 |
'instance' (nameref ('<' | subseteq) nameref | nameref '::' arity) |
|
599 |
; |
|
600 |
\end{rail} |
|
601 |
||
602 |
\begin{descr} |
|
603 |
||
604 |
\item [$\AXCLASS~c \subseteq \vec c~~axms$] defines an axiomatic type class as |
|
605 |
the intersection of existing classes, with additional axioms holding. Class |
|
606 |
axioms may not contain more than one type variable. The class axioms (with |
|
607 |
implicit sort constraints added) are bound to the given names. Furthermore |
|
608 |
a class introduction rule is generated (being bound as |
|
609 |
$c_class{\dtt}intro$); this rule is employed by method $intro_classes$ to |
|
610 |
support instantiation proofs of this class. |
|
611 |
||
612 |
The ``axioms'' are stored as theorems according to the given name |
|
613 |
specifications, adding the class name $c$ as name space prefix; the same |
|
614 |
facts are also stored collectively as $c_class{\dtt}axioms$. |
|
615 |
||
616 |
\item [$\INSTANCE~c@1 \subseteq c@2$ and $\INSTANCE~t :: (\vec s)s$] setup a |
|
617 |
goal stating a class relation or type arity. The proof would usually |
|
618 |
proceed by $intro_classes$, and then establish the characteristic theorems |
|
619 |
of the type classes involved. After finishing the proof, the theory will be |
|
620 |
augmented by a type signature declaration corresponding to the resulting |
|
621 |
theorem. |
|
622 |
||
623 |
\item [$intro_classes$] repeatedly expands all class introduction rules of |
|
624 |
this theory. Note that this method usually needs not be named explicitly, |
|
625 |
as it is already included in the default proof step (of $\PROOFNAME$ etc.). |
|
626 |
In particular, instantiation of trivial (syntactic) classes may be performed |
|
627 |
by a single ``$\DDOT$'' proof step. |
|
628 |
||
629 |
\end{descr} |
|
630 |
||
631 |
||
24085 | 632 |
\subsection{Configuration options} |
633 |
||
24110
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
634 |
Isabelle/Pure maintains a record of named configuration options within the |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
635 |
theory or proof context, with values of type $bool$, $int$, or $string$. |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
636 |
Tools may declare options in ML, and then refer to these values (relative to |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
637 |
the context). Thus global reference variables are easily avoided. The user |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
638 |
may change the value of a configuration option by means of an associated |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
639 |
attribute of the same name. This form of context declaration works |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
640 |
particularly well with commands such as $\isarkeyword{declare}$ or |
24085 | 641 |
$\isarkeyword{using}$. |
642 |
||
643 |
For historical reasons, some tools cannot take the full proof context |
|
644 |
into account and merely refer to the background theory. This is |
|
645 |
accommodated by configuration options being declared as ``global'', |
|
646 |
which may not be changed within a local context. |
|
647 |
||
24110
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
648 |
\indexisarcmd{print-configs} |
24085 | 649 |
\begin{matharray}{rcll} |
24110
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
650 |
\isarcmd{print_configs} & : & \isarkeep{theory~|~proof} \\ |
24085 | 651 |
\end{matharray} |
652 |
||
653 |
\begin{rail} |
|
24110
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
654 |
name ('=' ('true' | 'false' | int | name))? |
24085 | 655 |
\end{rail} |
656 |
||
657 |
\begin{descr} |
|
24110
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
658 |
|
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
659 |
\item [$\isarkeyword{print_configs}$] prints the available configuration |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
660 |
options, with names, types, and current values. |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
661 |
|
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
662 |
\item [$name = value$] as an attribute expression modifies the named option, |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
663 |
with the syntax of the value depending on the option's type. For $bool$ the |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
664 |
default value is $true$. Any attempt to change a global option in a local |
4ab3084e311c
tuned config options: eliminated separate attribute "option";
wenzelm
parents:
24085
diff
changeset
|
665 |
context is ignored. |
24085 | 666 |
|
667 |
\end{descr} |
|
668 |
||
20492 | 669 |
|
12621 | 670 |
\section{Derived proof schemes} |
671 |
||
672 |
\subsection{Generalized elimination}\label{sec:obtain} |
|
673 |
||
17864 | 674 |
\indexisarcmd{obtain}\indexisarcmd{guess} |
12621 | 675 |
\begin{matharray}{rcl} |
676 |
\isarcmd{obtain} & : & \isartrans{proof(state)}{proof(prove)} \\ |
|
17864 | 677 |
\isarcmd{guess}^* & : & \isartrans{proof(state)}{proof(prove)} \\ |
12621 | 678 |
\end{matharray} |
679 |
||
680 |
Generalized elimination means that additional elements with certain properties |
|
13041 | 681 |
may be introduced in the current context, by virtue of a locally proven |
12621 | 682 |
``soundness statement''. Technically speaking, the $\OBTAINNAME$ language |
683 |
element is like a declaration of $\FIXNAME$ and $\ASSUMENAME$ (see also see |
|
684 |
\S\ref{sec:proof-context}), together with a soundness proof of its additional |
|
685 |
claim. According to the nature of existential reasoning, assumptions get |
|
686 |
eliminated from any result exported from the context later, provided that the |
|
687 |
corresponding parameters do \emph{not} occur in the conclusion. |
|
688 |
||
689 |
\begin{rail} |
|
18903 | 690 |
'obtain' parname? (vars + 'and') 'where' (props + 'and') |
12621 | 691 |
; |
17864 | 692 |
'guess' (vars + 'and') |
693 |
; |
|
12621 | 694 |
\end{rail} |
12618 | 695 |
|
12621 | 696 |
$\OBTAINNAME$ is defined as a derived Isar command as follows, where $\vec b$ |
697 |
shall refer to (optional) facts indicated for forward chaining. |
|
698 |
\begin{matharray}{l} |
|
699 |
\langle facts~\vec b\rangle \\ |
|
700 |
\OBTAIN{\vec x}{a}{\vec \phi}~~\langle proof\rangle \equiv {} \\[1ex] |
|
13041 | 701 |
\quad \HAVE{}{\All{thesis} (\All{\vec x} \vec\phi \Imp thesis) \Imp thesis} \\ |
702 |
\quad \PROOF{succeed} \\ |
|
12621 | 703 |
\qquad \FIX{thesis} \\ |
13041 | 704 |
\qquad \ASSUME{that~[intro?]}{\All{\vec x} \vec\phi \Imp thesis} \\ |
13042 | 705 |
\qquad \THUS{}{thesis} \\ |
706 |
\quad\qquad \APPLY{-} \\ |
|
13041 | 707 |
\quad\qquad \USING{\vec b}~~\langle proof\rangle \\ |
708 |
\quad \QED{} \\ |
|
12621 | 709 |
\quad \FIX{\vec x}~\ASSUMENAME^\ast~a\colon~\vec\phi \\ |
710 |
\end{matharray} |
|
711 |
||
712 |
Typically, the soundness proof is relatively straight-forward, often just by |
|
13048 | 713 |
canonical automated tools such as ``$\BY{simp}$'' or ``$\BY{blast}$''. |
714 |
Accordingly, the ``$that$'' reduction above is declared as simplification and |
|
715 |
introduction rule. |
|
12621 | 716 |
|
717 |
In a sense, $\OBTAINNAME$ represents at the level of Isar proofs what would be |
|
718 |
meta-logical existential quantifiers and conjunctions. This concept has a |
|
13041 | 719 |
broad range of useful applications, ranging from plain elimination (or |
17864 | 720 |
introduction) of object-level existential and conjunctions, to elimination |
12621 | 721 |
over results of symbolic evaluation of recursive definitions, for example. |
722 |
Also note that $\OBTAINNAME$ without parameters acts much like $\HAVENAME$, |
|
13041 | 723 |
where the result is treated as a genuine assumption. |
12621 | 724 |
|
18903 | 725 |
An alternative name to be used instead of ``$that$'' above may be |
726 |
given in parentheses. |
|
727 |
||
17864 | 728 |
\medskip |
729 |
||
730 |
The improper variant $\isarkeyword{guess}$ is similar to $\OBTAINNAME$, but |
|
731 |
derives the obtained statement from the course of reasoning! The proof starts |
|
732 |
with a fixed goal $thesis$. The subsequent proof may refine this to anything |
|
733 |
of the form like $\All{\vec x} \vec\phi \Imp thesis$, but must not introduce |
|
734 |
new subgoals. The final goal state is then used as reduction rule for the |
|
735 |
obtain scheme described above. Obtained parameters $\vec x$ are marked as |
|
736 |
internal by default, which prevents the proof context from being polluted by |
|
737 |
ad-hoc variables. The variable names and type constraints given as arguments |
|
738 |
for $\isarkeyword{guess}$ specify a prefix of obtained parameters explicitly |
|
739 |
in the text. |
|
740 |
||
741 |
It is important to note that the facts introduced by $\OBTAINNAME$ and |
|
742 |
$\isarkeyword{guess}$ may not be polymorphic: any type-variables occurring |
|
743 |
here are fixed in the present context! |
|
744 |
||
12621 | 745 |
|
746 |
\subsection{Calculational reasoning}\label{sec:calculation} |
|
7315 | 747 |
|
8619 | 748 |
\indexisarcmd{also}\indexisarcmd{finally} |
749 |
\indexisarcmd{moreover}\indexisarcmd{ultimately} |
|
12976 | 750 |
\indexisarcmd{print-trans-rules} |
751 |
\indexisaratt{trans}\indexisaratt{sym}\indexisaratt{symmetric} |
|
7315 | 752 |
\begin{matharray}{rcl} |
753 |
\isarcmd{also} & : & \isartrans{proof(state)}{proof(state)} \\ |
|
754 |
\isarcmd{finally} & : & \isartrans{proof(state)}{proof(chain)} \\ |
|
8619 | 755 |
\isarcmd{moreover} & : & \isartrans{proof(state)}{proof(state)} \\ |
756 |
\isarcmd{ultimately} & : & \isartrans{proof(state)}{proof(chain)} \\ |
|
10154 | 757 |
\isarcmd{print_trans_rules}^* & : & \isarkeep{theory~|~proof} \\ |
7315 | 758 |
trans & : & \isaratt \\ |
12976 | 759 |
sym & : & \isaratt \\ |
760 |
symmetric & : & \isaratt \\ |
|
7315 | 761 |
\end{matharray} |
762 |
||
763 |
Calculational proof is forward reasoning with implicit application of |
|
11332 | 764 |
transitivity rules (such those of $=$, $\leq$, $<$). Isabelle/Isar maintains |
7391 | 765 |
an auxiliary register $calculation$\indexisarthm{calculation} for accumulating |
7897 | 766 |
results obtained by transitivity composed with the current result. Command |
767 |
$\ALSO$ updates $calculation$ involving $this$, while $\FINALLY$ exhibits the |
|
768 |
final $calculation$ by forward chaining towards the next goal statement. Both |
|
769 |
commands require valid current facts, i.e.\ may occur only after commands that |
|
770 |
produce theorems such as $\ASSUMENAME$, $\NOTENAME$, or some finished proof of |
|
8619 | 771 |
$\HAVENAME$, $\SHOWNAME$ etc. The $\MOREOVER$ and $\ULTIMATELY$ commands are |
772 |
similar to $\ALSO$ and $\FINALLY$, but only collect further results in |
|
773 |
$calculation$ without applying any rules yet. |
|
7315 | 774 |
|
13041 | 775 |
Also note that the implicit term abbreviation ``$\dots$'' has its canonical |
776 |
application with calculational proofs. It refers to the argument of the |
|
777 |
preceding statement. (The argument of a curried infix expression happens to be |
|
778 |
its right-hand side.) |
|
7315 | 779 |
|
780 |
Isabelle/Isar calculations are implicitly subject to block structure in the |
|
781 |
sense that new threads of calculational reasoning are commenced for any new |
|
782 |
block (as opened by a local goal, for example). This means that, apart from |
|
783 |
being able to nest calculations, there is no separate \emph{begin-calculation} |
|
784 |
command required. |
|
785 |
||
8619 | 786 |
\medskip |
787 |
||
13041 | 788 |
The Isar calculation proof commands may be defined as follows:\footnote{We |
789 |
suppress internal bookkeeping such as proper handling of block-structure.} |
|
8619 | 790 |
\begin{matharray}{rcl} |
791 |
\ALSO@0 & \equiv & \NOTE{calculation}{this} \\ |
|
9606 | 792 |
\ALSO@{n+1} & \equiv & \NOTE{calculation}{trans~[OF~calculation~this]} \\[0.5ex] |
8619 | 793 |
\FINALLY & \equiv & \ALSO~\FROM{calculation} \\ |
794 |
\MOREOVER & \equiv & \NOTE{calculation}{calculation~this} \\ |
|
795 |
\ULTIMATELY & \equiv & \MOREOVER~\FROM{calculation} \\ |
|
796 |
\end{matharray} |
|
797 |
||
7315 | 798 |
\begin{rail} |
13024 | 799 |
('also' | 'finally') ('(' thmrefs ')')? |
8619 | 800 |
; |
8507 | 801 |
'trans' (() | 'add' | 'del') |
7315 | 802 |
; |
803 |
\end{rail} |
|
804 |
||
805 |
\begin{descr} |
|
13041 | 806 |
|
8547 | 807 |
\item [$\ALSO~(\vec a)$] maintains the auxiliary $calculation$ register as |
7315 | 808 |
follows. The first occurrence of $\ALSO$ in some calculational thread |
7905 | 809 |
initializes $calculation$ by $this$. Any subsequent $\ALSO$ on the same |
7335 | 810 |
level of block-structure updates $calculation$ by some transitivity rule |
7458 | 811 |
applied to $calculation$ and $this$ (in that order). Transitivity rules are |
11095 | 812 |
picked from the current context, unless alternative rules are given as |
813 |
explicit arguments. |
|
9614 | 814 |
|
8547 | 815 |
\item [$\FINALLY~(\vec a)$] maintaining $calculation$ in the same way as |
7315 | 816 |
$\ALSO$, and concludes the current calculational thread. The final result |
817 |
is exhibited as fact for forward chaining towards the next goal. Basically, |
|
7987 | 818 |
$\FINALLY$ just abbreviates $\ALSO~\FROM{calculation}$. Note that |
819 |
``$\FINALLY~\SHOW{}{\Var{thesis}}~\DOT$'' and |
|
820 |
``$\FINALLY~\HAVE{}{\phi}~\DOT$'' are typical idioms for concluding |
|
821 |
calculational proofs. |
|
9614 | 822 |
|
8619 | 823 |
\item [$\MOREOVER$ and $\ULTIMATELY$] are analogous to $\ALSO$ and $\FINALLY$, |
824 |
but collect results only, without applying rules. |
|
13041 | 825 |
|
13024 | 826 |
\item [$\isarkeyword{print_trans_rules}$] prints the list of transitivity |
827 |
rules (for calculational commands $\ALSO$ and $\FINALLY$) and symmetry rules |
|
828 |
(for the $symmetric$ operation and single step elimination patters) of the |
|
829 |
current context. |
|
13041 | 830 |
|
8547 | 831 |
\item [$trans$] declares theorems as transitivity rules. |
13041 | 832 |
|
13024 | 833 |
\item [$sym$] declares symmetry rules. |
13041 | 834 |
|
12976 | 835 |
\item [$symmetric$] resolves a theorem with some rule declared as $sym$ in the |
836 |
current context. For example, ``$\ASSUME{[symmetric]}{x = y}$'' produces a |
|
837 |
swapped fact derived from that assumption. |
|
13041 | 838 |
|
13024 | 839 |
In structured proof texts it is often more appropriate to use an explicit |
840 |
single-step elimination proof, such as ``$\ASSUME{}{x = y}~\HENCE{}{y = |
|
13041 | 841 |
x}~\DDOT$''. The very same rules known to $symmetric$ are declared as |
842 |
$elim?$ as well. |
|
13027 | 843 |
|
7315 | 844 |
\end{descr} |
845 |
||
846 |
||
13041 | 847 |
\section{Proof tools} |
8517 | 848 |
|
12618 | 849 |
\subsection{Miscellaneous methods and attributes}\label{sec:misc-meth-att} |
8517 | 850 |
|
9606 | 851 |
\indexisarmeth{unfold}\indexisarmeth{fold}\indexisarmeth{insert} |
8517 | 852 |
\indexisarmeth{erule}\indexisarmeth{drule}\indexisarmeth{frule} |
853 |
\indexisarmeth{fail}\indexisarmeth{succeed} |
|
854 |
\begin{matharray}{rcl} |
|
855 |
unfold & : & \isarmeth \\ |
|
10741 | 856 |
fold & : & \isarmeth \\ |
857 |
insert & : & \isarmeth \\[0.5ex] |
|
8517 | 858 |
erule^* & : & \isarmeth \\ |
859 |
drule^* & : & \isarmeth \\ |
|
13024 | 860 |
frule^* & : & \isarmeth \\ |
8517 | 861 |
succeed & : & \isarmeth \\ |
862 |
fail & : & \isarmeth \\ |
|
863 |
\end{matharray} |
|
7135 | 864 |
|
865 |
\begin{rail} |
|
10741 | 866 |
('fold' | 'unfold' | 'insert') thmrefs |
867 |
; |
|
868 |
('erule' | 'drule' | 'frule') ('('nat')')? thmrefs |
|
7135 | 869 |
; |
870 |
\end{rail} |
|
871 |
||
7167 | 872 |
\begin{descr} |
19379 | 873 |
|
874 |
\item [$unfold~\vec a$ and $fold~\vec a$] expand (or fold back again) |
|
875 |
the given definitions throughout all goals; any chained facts |
|
876 |
provided are inserted into the goal and subject to rewriting as |
|
877 |
well. |
|
13041 | 878 |
|
10741 | 879 |
\item [$insert~\vec a$] inserts theorems as facts into all goals of the proof |
880 |
state. Note that current facts indicated for forward chaining are ignored. |
|
13024 | 881 |
|
8547 | 882 |
\item [$erule~\vec a$, $drule~\vec a$, and $frule~\vec a$] are similar to the |
883 |
basic $rule$ method (see \S\ref{sec:pure-meth-att}), but apply rules by |
|
8517 | 884 |
elim-resolution, destruct-resolution, and forward-resolution, respectively |
10741 | 885 |
\cite{isabelle-ref}. The optional natural number argument (default $0$) |
13041 | 886 |
specifies additional assumption steps to be performed here. |
887 |
||
10741 | 888 |
Note that these methods are improper ones, mainly serving for |
889 |
experimentation and tactic script emulation. Different modes of basic rule |
|
890 |
application are usually expressed in Isar at the proof language level, |
|
891 |
rather than via implicit proof state manipulations. For example, a proper |
|
13041 | 892 |
single-step elimination would be done using the plain $rule$ method, with |
10741 | 893 |
forward chaining of current facts. |
13024 | 894 |
|
8517 | 895 |
\item [$succeed$] yields a single (unchanged) result; it is the identity of |
896 |
the ``\texttt{,}'' method combinator (cf.\ \S\ref{sec:syn-meth}). |
|
13024 | 897 |
|
8517 | 898 |
\item [$fail$] yields an empty result sequence; it is the identity of the |
899 |
``\texttt{|}'' method combinator (cf.\ \S\ref{sec:syn-meth}). |
|
13024 | 900 |
|
7167 | 901 |
\end{descr} |
7135 | 902 |
|
10318 | 903 |
\indexisaratt{tagged}\indexisaratt{untagged} |
9614 | 904 |
\indexisaratt{THEN}\indexisaratt{COMP} |
14175
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
905 |
\indexisaratt{unfolded}\indexisaratt{folded} |
13027 | 906 |
\indexisaratt{standard}\indexisarattof{Pure}{elim-format} |
13024 | 907 |
\indexisaratt{no-vars} |
8517 | 908 |
\begin{matharray}{rcl} |
9905 | 909 |
tagged & : & \isaratt \\ |
910 |
untagged & : & \isaratt \\[0.5ex] |
|
9614 | 911 |
THEN & : & \isaratt \\ |
8517 | 912 |
COMP & : & \isaratt \\[0.5ex] |
9905 | 913 |
unfolded & : & \isaratt \\ |
914 |
folded & : & \isaratt \\[0.5ex] |
|
9941
fe05af7ec816
renamed atts: rulify to rule_format, elimify to elim_format;
wenzelm
parents:
9936
diff
changeset
|
915 |
elim_format & : & \isaratt \\ |
13041 | 916 |
standard^* & : & \isaratt \\ |
9936 | 917 |
no_vars^* & : & \isaratt \\ |
8517 | 918 |
\end{matharray} |
919 |
||
920 |
\begin{rail} |
|
23654 | 921 |
'tagged' nameref |
8517 | 922 |
; |
9905 | 923 |
'untagged' name |
8517 | 924 |
; |
10154 | 925 |
('THEN' | 'COMP') ('[' nat ']')? thmref |
8517 | 926 |
; |
9905 | 927 |
('unfolded' | 'folded') thmrefs |
8517 | 928 |
; |
929 |
\end{rail} |
|
930 |
||
931 |
\begin{descr} |
|
13041 | 932 |
|
23654 | 933 |
\item [$tagged~name~arg$ and $untagged~name$] add and remove $tags$ of some |
8517 | 934 |
theorem. Tags may be any list of strings that serve as comment for some |
935 |
tools (e.g.\ $\LEMMANAME$ causes the tag ``$lemma$'' to be added to the |
|
23654 | 936 |
result). The first string is considered the tag name, the second its |
937 |
argument. Note that $untagged$ removes any tags of the same name. |
|
13041 | 938 |
|
939 |
\item [$THEN~a$ and $COMP~a$] compose rules by resolution. $THEN$ resolves |
|
940 |
with the first premise of $a$ (an alternative position may be also |
|
941 |
specified); the $COMP$ version skips the automatic lifting process that is |
|
942 |
normally intended (cf.\ \texttt{RS} and \texttt{COMP} in |
|
8547 | 943 |
\cite[\S5]{isabelle-ref}). |
19379 | 944 |
|
945 |
\item [$unfolded~\vec a$ and $folded~\vec a$] expand and fold back |
|
946 |
again the given definitions throughout a rule. |
|
13041 | 947 |
|
13027 | 948 |
\item [$elim_format$] turns a destruction rule into elimination rule format, |
949 |
by resolving with the rule $\PROP A \Imp (\PROP A \Imp \PROP B) \Imp \PROP |
|
950 |
B$. |
|
13048 | 951 |
|
952 |
Note that the Classical Reasoner (\S\ref{sec:classical}) provides its own |
|
953 |
version of this operation. |
|
13041 | 954 |
|
955 |
\item [$standard$] puts a theorem into the standard form of object-rules at |
|
956 |
the outermost theory level. Note that this operation violates the local |
|
957 |
proof context (including active locales). |
|
958 |
||
9232 | 959 |
\item [$no_vars$] replaces schematic variables by free ones; this is mainly |
960 |
for tuning output of pretty printed theorems. |
|
13027 | 961 |
|
8517 | 962 |
\end{descr} |
7135 | 963 |
|
964 |
||
12621 | 965 |
\subsection{Further tactic emulations}\label{sec:tactics} |
9606 | 966 |
|
967 |
The following improper proof methods emulate traditional tactics. These admit |
|
968 |
direct access to the goal state, which is normally considered harmful! In |
|
969 |
particular, this may involve both numbered goal addressing (default 1), and |
|
970 |
dynamic instantiation within the scope of some subgoal. |
|
971 |
||
972 |
\begin{warn} |
|
14175
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
973 |
Dynamic instantiations refer to universally quantified parameters of |
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
974 |
a subgoal (the dynamic context) rather than fixed variables and term |
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
975 |
abbreviations of a (static) Isar context. |
9606 | 976 |
\end{warn} |
977 |
||
14175
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
978 |
Tactic emulation methods, unlike their ML counterparts, admit |
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
979 |
simultaneous instantiation from both dynamic and static contexts. If |
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
980 |
names occur in both contexts goal parameters hide locally fixed |
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
981 |
variables. Likewise, schematic variables refer to term abbreviations, |
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
982 |
if present in the static context. Otherwise the schematic variable is |
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
983 |
interpreted as a schematic variable and left to be solved by unification |
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
984 |
with certain parts of the subgoal. |
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
985 |
|
9606 | 986 |
Note that the tactic emulation proof methods in Isabelle/Isar are consistently |
14175
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
987 |
named $foo_tac$. Note also that variable names occurring on left hand sides |
14212 | 988 |
of instantiations must be preceded by a question mark if they coincide with |
989 |
a keyword or contain dots. |
|
14175
dbd16ebaf907
Method rule_tac understands Isar contexts: documentation.
ballarin
parents:
13622
diff
changeset
|
990 |
This is consistent with the attribute $where$ (see \S\ref{sec:pure-meth-att}). |
9606 | 991 |
|
992 |
\indexisarmeth{rule-tac}\indexisarmeth{erule-tac} |
|
993 |
\indexisarmeth{drule-tac}\indexisarmeth{frule-tac} |
|
994 |
\indexisarmeth{cut-tac}\indexisarmeth{thin-tac} |
|
9642 | 995 |
\indexisarmeth{subgoal-tac}\indexisarmeth{rename-tac} |
9614 | 996 |
\indexisarmeth{rotate-tac}\indexisarmeth{tactic} |
9606 | 997 |
\begin{matharray}{rcl} |
998 |
rule_tac^* & : & \isarmeth \\ |
|
999 |
erule_tac^* & : & \isarmeth \\ |
|
1000 |
drule_tac^* & : & \isarmeth \\ |
|
1001 |
frule_tac^* & : & \isarmeth \\ |
|
1002 |
cut_tac^* & : & \isarmeth \\ |
|
1003 |
thin_tac^* & : & \isarmeth \\ |
|
1004 |
subgoal_tac^* & : & \isarmeth \\ |
|
9614 | 1005 |
rename_tac^* & : & \isarmeth \\ |
1006 |
rotate_tac^* & : & \isarmeth \\ |
|
9606 | 1007 |
tactic^* & : & \isarmeth \\ |
1008 |
\end{matharray} |
|
1009 |
||
1010 |
\railalias{ruletac}{rule\_tac} |
|
1011 |
\railterm{ruletac} |
|
1012 |
||
1013 |
\railalias{eruletac}{erule\_tac} |
|
1014 |
\railterm{eruletac} |
|
1015 |
||
1016 |
\railalias{druletac}{drule\_tac} |
|
1017 |
\railterm{druletac} |
|
1018 |
||
1019 |
\railalias{fruletac}{frule\_tac} |
|
1020 |
\railterm{fruletac} |
|
1021 |
||
1022 |
\railalias{cuttac}{cut\_tac} |
|
1023 |
\railterm{cuttac} |
|
1024 |
||
1025 |
\railalias{thintac}{thin\_tac} |
|
1026 |
\railterm{thintac} |
|
1027 |
||
1028 |
\railalias{subgoaltac}{subgoal\_tac} |
|
1029 |
\railterm{subgoaltac} |
|
1030 |
||
9614 | 1031 |
\railalias{renametac}{rename\_tac} |
1032 |
\railterm{renametac} |
|
1033 |
||
1034 |
\railalias{rotatetac}{rotate\_tac} |
|
1035 |
\railterm{rotatetac} |
|
1036 |
||
9606 | 1037 |
\begin{rail} |
1038 |
( ruletac | eruletac | druletac | fruletac | cuttac | thintac ) goalspec? |
|
1039 |
( insts thmref | thmrefs ) |
|
1040 |
; |
|
1041 |
subgoaltac goalspec? (prop +) |
|
1042 |
; |
|
9614 | 1043 |
renametac goalspec? (name +) |
1044 |
; |
|
1045 |
rotatetac goalspec? int? |
|
1046 |
; |
|
9606 | 1047 |
'tactic' text |
1048 |
; |
|
1049 |
||
1050 |
insts: ((name '=' term) + 'and') 'in' |
|
1051 |
; |
|
1052 |
\end{rail} |
|
1053 |
||
1054 |
\begin{descr} |
|
13041 | 1055 |
|
9606 | 1056 |
\item [$rule_tac$ etc.] do resolution of rules with explicit instantiation. |
1057 |
This works the same way as the ML tactics \texttt{res_inst_tac} etc. (see |
|
1058 |
\cite[\S3]{isabelle-ref}). |
|
13041 | 1059 |
|
1060 |
Multiple rules may be only given if there is no instantiation; then |
|
9606 | 1061 |
$rule_tac$ is the same as \texttt{resolve_tac} in ML (see |
1062 |
\cite[\S3]{isabelle-ref}). |
|
13041 | 1063 |
|
9606 | 1064 |
\item [$cut_tac$] inserts facts into the proof state as assumption of a |
1065 |
subgoal, see also \texttt{cut_facts_tac} in \cite[\S3]{isabelle-ref}. Note |
|
13027 | 1066 |
that the scope of schematic variables is spread over the main goal |
1067 |
statement. Instantiations may be given as well, see also ML tactic |
|
9606 | 1068 |
\texttt{cut_inst_tac} in \cite[\S3]{isabelle-ref}. |
13041 | 1069 |
|
9606 | 1070 |
\item [$thin_tac~\phi$] deletes the specified assumption from a subgoal; note |
1071 |
that $\phi$ may contain schematic variables. See also \texttt{thin_tac} in |
|
1072 |
\cite[\S3]{isabelle-ref}. |
|
13041 | 1073 |
|
9606 | 1074 |
\item [$subgoal_tac~\phi$] adds $\phi$ as an assumption to a subgoal. See |
1075 |
also \texttt{subgoal_tac} and \texttt{subgoals_tac} in |
|
1076 |
\cite[\S3]{isabelle-ref}. |
|
13041 | 1077 |
|
9614 | 1078 |
\item [$rename_tac~\vec x$] renames parameters of a goal according to the list |
1079 |
$\vec x$, which refers to the \emph{suffix} of variables. |
|
13041 | 1080 |
|
9614 | 1081 |
\item [$rotate_tac~n$] rotates the assumptions of a goal by $n$ positions: |
1082 |
from right to left if $n$ is positive, and from left to right if $n$ is |
|
1083 |
negative; the default value is $1$. See also \texttt{rotate_tac} in |
|
1084 |
\cite[\S3]{isabelle-ref}. |
|
13041 | 1085 |
|
9606 | 1086 |
\item [$tactic~text$] produces a proof method from any ML text of type |
1087 |
\texttt{tactic}. Apart from the usual ML environment and the current |
|
1088 |
implicit theory context, the ML code may refer to the following locally |
|
1089 |
bound values: |
|
1090 |
||
1091 |
{\footnotesize\begin{verbatim} |
|
1092 |
val ctxt : Proof.context |
|
1093 |
val facts : thm list |
|
1094 |
val thm : string -> thm |
|
1095 |
val thms : string -> thm list |
|
1096 |
\end{verbatim}} |
|
1097 |
Here \texttt{ctxt} refers to the current proof context, \texttt{facts} |
|
1098 |
indicates any current facts for forward-chaining, and |
|
1099 |
\texttt{thm}~/~\texttt{thms} retrieve named facts (including global |
|
1100 |
theorems) from the context. |
|
1101 |
\end{descr} |
|
1102 |
||
1103 |
||
12621 | 1104 |
\subsection{The Simplifier}\label{sec:simplifier} |
1105 |
||
13048 | 1106 |
\subsubsection{Simplification methods} |
12618 | 1107 |
|
8483 | 1108 |
\indexisarmeth{simp}\indexisarmeth{simp-all} |
7315 | 1109 |
\begin{matharray}{rcl} |
1110 |
simp & : & \isarmeth \\ |
|
8483 | 1111 |
simp_all & : & \isarmeth \\ |
7315 | 1112 |
\end{matharray} |
1113 |
||
11128 | 1114 |
\indexouternonterm{simpmod} |
7315 | 1115 |
\begin{rail} |
20126 | 1116 |
('simp' | 'simp\_all') ('!' ?) opt? (simpmod *) |
7315 | 1117 |
; |
1118 |
||
20126 | 1119 |
opt: '(' ('no\_asm' | 'no\_asm\_simp' | 'no\_asm\_use' | 'asm\_lr' | 'depth\_limit' ':' nat) ')' |
8704 | 1120 |
; |
9711 | 1121 |
simpmod: ('add' | 'del' | 'only' | 'cong' (() | 'add' | 'del') | |
9847 | 1122 |
'split' (() | 'add' | 'del')) ':' thmrefs |
7315 | 1123 |
; |
1124 |
\end{rail} |
|
1125 |
||
7321 | 1126 |
\begin{descr} |
13015 | 1127 |
|
8547 | 1128 |
\item [$simp$] invokes Isabelle's simplifier, after declaring additional rules |
8594 | 1129 |
according to the arguments given. Note that the \railtterm{only} modifier |
8547 | 1130 |
first removes all other rewrite rules, congruences, and looper tactics |
8594 | 1131 |
(including splits), and then behaves like \railtterm{add}. |
13041 | 1132 |
|
9711 | 1133 |
\medskip The \railtterm{cong} modifiers add or delete Simplifier congruence |
1134 |
rules (see also \cite{isabelle-ref}), the default is to add. |
|
13041 | 1135 |
|
9711 | 1136 |
\medskip The \railtterm{split} modifiers add or delete rules for the |
1137 |
Splitter (see also \cite{isabelle-ref}), the default is to add. This works |
|
1138 |
only if the Simplifier method has been properly setup to include the |
|
1139 |
Splitter (all major object logics such HOL, HOLCF, FOL, ZF do this already). |
|
13041 | 1140 |
|
13015 | 1141 |
\item [$simp_all$] is similar to $simp$, but acts on all goals (backwards from |
1142 |
the last to the first one). |
|
1143 |
||
7321 | 1144 |
\end{descr} |
1145 |
||
13015 | 1146 |
By default the Simplifier methods take local assumptions fully into account, |
1147 |
using equational assumptions in the subsequent normalization process, or |
|
13024 | 1148 |
simplifying assumptions themselves (cf.\ \texttt{asm_full_simp_tac} in |
13015 | 1149 |
\cite[\S10]{isabelle-ref}). In structured proofs this is usually quite well |
1150 |
behaved in practice: just the local premises of the actual goal are involved, |
|
13041 | 1151 |
additional facts may be inserted via explicit forward-chaining (using $\THEN$, |
13015 | 1152 |
$\FROMNAME$ etc.). The full context of assumptions is only included if the |
1153 |
``$!$'' (bang) argument is given, which should be used with some care, though. |
|
7321 | 1154 |
|
13015 | 1155 |
Additional Simplifier options may be specified to tune the behavior further |
13041 | 1156 |
(mostly for unstructured scripts with many accidental local facts): |
20126 | 1157 |
``$(no_asm)$'' means assumptions are ignored completely (cf.\ |
13041 | 1158 |
\texttt{simp_tac}), ``$(no_asm_simp)$'' means assumptions are used in the |
20126 | 1159 |
simplification of the conclusion but are not themselves simplified (cf.\ |
13041 | 1160 |
\texttt{asm_simp_tac}), and ``$(no_asm_use)$'' means assumptions are |
1161 |
simplified but are not used in the simplification of each other or the |
|
20126 | 1162 |
conclusion (cf.\ \texttt{full_simp_tac}). For compatibility reasons, there is |
1163 |
also an option ``$(asm_lr)$'', which means that an assumption is only used for |
|
1164 |
simplifying assumptions which are to the right of it (cf.\ |
|
1165 |
\texttt{asm_lr_simp_tac}). Giving an option ``$(depth_limit: n)$'' limits the |
|
1166 |
number of recursive invocations of the simplifier during conditional |
|
1167 |
rewriting. |
|
8704 | 1168 |
|
1169 |
\medskip |
|
1170 |
||
1171 |
The Splitter package is usually configured to work as part of the Simplifier. |
|
9711 | 1172 |
The effect of repeatedly applying \texttt{split_tac} can be simulated by |
13041 | 1173 |
``$(simp~only\colon~split\colon~\vec a)$''. There is also a separate $split$ |
1174 |
method available for single-step case splitting. |
|
8483 | 1175 |
|
1176 |
||
12621 | 1177 |
\subsubsection{Declaring rules} |
8483 | 1178 |
|
8667 | 1179 |
\indexisarcmd{print-simpset} |
8638 | 1180 |
\indexisaratt{simp}\indexisaratt{split}\indexisaratt{cong} |
7321 | 1181 |
\begin{matharray}{rcl} |
13024 | 1182 |
\isarcmd{print_simpset}^* & : & \isarkeep{theory~|~proof} \\ |
7321 | 1183 |
simp & : & \isaratt \\ |
9711 | 1184 |
cong & : & \isaratt \\ |
8483 | 1185 |
split & : & \isaratt \\ |
7321 | 1186 |
\end{matharray} |
1187 |
||
1188 |
\begin{rail} |
|
9711 | 1189 |
('simp' | 'cong' | 'split') (() | 'add' | 'del') |
7321 | 1190 |
; |
1191 |
\end{rail} |
|
1192 |
||
1193 |
\begin{descr} |
|
13024 | 1194 |
|
1195 |
\item [$\isarcmd{print_simpset}$] prints the collection of rules declared to |
|
1196 |
the Simplifier, which is also known as ``simpset'' internally |
|
8667 | 1197 |
\cite{isabelle-ref}. This is a diagnostic command; $undo$ does not apply. |
13024 | 1198 |
|
8547 | 1199 |
\item [$simp$] declares simplification rules. |
13024 | 1200 |
|
8638 | 1201 |
\item [$cong$] declares congruence rules. |
13024 | 1202 |
|
9711 | 1203 |
\item [$split$] declares case split rules. |
13024 | 1204 |
|
7321 | 1205 |
\end{descr} |
7319 | 1206 |
|
7315 | 1207 |
|
24015
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1208 |
\subsubsection{Simplification procedures} |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1209 |
|
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1210 |
\indexisarcmd{simproc-setup} |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1211 |
\indexisaratt{simproc} |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1212 |
\begin{matharray}{rcl} |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1213 |
\isarcmd{simproc_setup} & : & \isarkeep{local{\dsh}theory} \\ |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1214 |
simproc & : & \isaratt \\ |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1215 |
\end{matharray} |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1216 |
|
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1217 |
\begin{rail} |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1218 |
'simproc\_setup' name '(' (term + '|') ')' '=' text \\ ('identifier' (nameref+))? |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1219 |
; |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1220 |
|
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1221 |
'simproc' (('add' ':')? | 'del' ':') (name+) |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1222 |
; |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1223 |
\end{rail} |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1224 |
|
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1225 |
\begin{descr} |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1226 |
|
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1227 |
\item [$\isarcmd{simproc_setup}$] defines a named simplification |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1228 |
procedure that is invoked by the Simplifier whenever any of the |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1229 |
given term patterns match the current redex. The implementation, |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1230 |
which is provided as ML source text, needs to be of type |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1231 |
\verb,morphism -> simpset -> cterm -> thm option,, where the |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1232 |
\verb,cterm, represents the current redex $r$ and the result is |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1233 |
supposed to be some proven rewrite rule $r \equiv r'$ (or a |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1234 |
generalized version), or \verb,NONE, to indicate failure. The |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1235 |
\verb,simpset, argument holds the full context of the current |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1236 |
Simplifier invocation, including the actual Isar proof context. The |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1237 |
\verb,morphism, informs about the difference of the original |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1238 |
compilation context wrt.\ the one of the actual application later |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1239 |
on. The optional $\isarkeyword{identifier}$ specifies theorems that |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1240 |
represent the logical content of the abstract theory of this |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1241 |
simproc. |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1242 |
|
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1243 |
Morphisms and identifiers are only relevant for simprocs that are |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1244 |
defined within a local target context, e.g.\ in a locale. |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1245 |
|
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1246 |
\item [$simproc\;add\colon\;name$ and $simproc\;del\colon\;name$] add |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1247 |
or delete named simprocs to the current Simplifier context. The |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1248 |
default is to add a simproc. Note that $\isarcmd{simproc_setup}$ |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1249 |
already adds the new simproc to the subsequent context. |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1250 |
|
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1251 |
\end{descr} |
253720dddcde
added command 'simproc_setup', attribute "simproc";
wenzelm
parents:
23920
diff
changeset
|
1252 |
|
12621 | 1253 |
\subsubsection{Forward simplification} |
1254 |
||
9905 | 1255 |
\indexisaratt{simplified} |
7315 | 1256 |
\begin{matharray}{rcl} |
9905 | 1257 |
simplified & : & \isaratt \\ |
7315 | 1258 |
\end{matharray} |
1259 |
||
9905 | 1260 |
\begin{rail} |
13015 | 1261 |
'simplified' opt? thmrefs? |
9905 | 1262 |
; |
1263 |
||
1264 |
opt: '(' (noasm | noasmsimp | noasmuse) ')' |
|
1265 |
; |
|
1266 |
\end{rail} |
|
7905 | 1267 |
|
9905 | 1268 |
\begin{descr} |
13048 | 1269 |
|
13015 | 1270 |
\item [$simplified~\vec a$] causes a theorem to be simplified, either by |
1271 |
exactly the specified rules $\vec a$, or the implicit Simplifier context if |
|
1272 |
no arguments are given. The result is fully simplified by default, |
|
1273 |
including assumptions and conclusion; the options $no_asm$ etc.\ tune the |
|
13048 | 1274 |
Simplifier in the same way as the for the $simp$ method. |
13041 | 1275 |
|
13015 | 1276 |
Note that forward simplification restricts the simplifier to its most basic |
1277 |
operation of term rewriting; solver and looper tactics \cite{isabelle-ref} |
|
1278 |
are \emph{not} involved here. The $simplified$ attribute should be only |
|
1279 |
rarely required under normal circumstances. |
|
1280 |
||
9905 | 1281 |
\end{descr} |
7315 | 1282 |
|
1283 |
||
13048 | 1284 |
\subsubsection{Low-level equational reasoning} |
9614 | 1285 |
|
12976 | 1286 |
\indexisarmeth{subst}\indexisarmeth{hypsubst}\indexisarmeth{split} |
9614 | 1287 |
\begin{matharray}{rcl} |
13015 | 1288 |
subst^* & : & \isarmeth \\ |
9614 | 1289 |
hypsubst^* & : & \isarmeth \\ |
13015 | 1290 |
split^* & : & \isarmeth \\ |
9614 | 1291 |
\end{matharray} |
1292 |
||
1293 |
\begin{rail} |
|
15995 | 1294 |
'subst' ('(' 'asm' ')')? ('(' (nat+) ')')? thmref |
9614 | 1295 |
; |
9799 | 1296 |
'split' ('(' 'asm' ')')? thmrefs |
9703 | 1297 |
; |
9614 | 1298 |
\end{rail} |
1299 |
||
13015 | 1300 |
These methods provide low-level facilities for equational reasoning that are |
1301 |
intended for specialized applications only. Normally, single step |
|
1302 |
calculations would be performed in a structured text (see also |
|
1303 |
\S\ref{sec:calculation}), while the Simplifier methods provide the canonical |
|
1304 |
way for automated normalization (see \S\ref{sec:simplifier}). |
|
9614 | 1305 |
|
1306 |
\begin{descr} |
|
13041 | 1307 |
|
15995 | 1308 |
\item [$subst~eq$] performs a single substitution step using rule $eq$, which |
13041 | 1309 |
may be either a meta or object equality. |
1310 |
||
15995 | 1311 |
\item [$subst~(asm)~eq$] substitutes in an assumption. |
1312 |
||
1313 |
\item [$subst~(i \dots j)~eq$] performs several substitutions in the |
|
1314 |
conclusion. The numbers $i$ to $j$ indicate the positions to substitute at. |
|
1315 |
Positions are ordered from the top of the term tree moving down from left to |
|
1316 |
right. For example, in $(a+b)+(c+d)$ there are three positions where |
|
1317 |
commutativity of $+$ is applicable: 1 refers to the whole term, 2 to $a+b$ |
|
1318 |
and 3 to $c+d$. If the positions in the list $(i \dots j)$ are |
|
1319 |
non-overlapping (e.g. $(2~3)$ in $(a+b)+(c+d)$) you may assume all |
|
1320 |
substitutions are performed simultaneously. Otherwise the behaviour of |
|
1321 |
$subst$ is not specified. |
|
1322 |
||
1323 |
\item [$subst~(asm)~(i \dots j)~eq$] performs the substitutions in the |
|
16010 | 1324 |
assumptions. Positions $1 \dots i@1$ refer |
1325 |
to assumption 1, positions $i@1+1 \dots i@2$ to assumption 2, and so on. |
|
15995 | 1326 |
|
13041 | 1327 |
\item [$hypsubst$] performs substitution using some assumption; this only |
1328 |
works for equations of the form $x = t$ where $x$ is a free or bound |
|
1329 |
variable. |
|
1330 |
||
1331 |
\item [$split~\vec a$] performs single-step case splitting using rules $thms$. |
|
9799 | 1332 |
By default, splitting is performed in the conclusion of a goal; the $asm$ |
1333 |
option indicates to operate on assumptions instead. |
|
13048 | 1334 |
|
9703 | 1335 |
Note that the $simp$ method already involves repeated application of split |
13048 | 1336 |
rules as declared in the current context. |
9614 | 1337 |
\end{descr} |
1338 |
||
1339 |
||
12621 | 1340 |
\subsection{The Classical Reasoner}\label{sec:classical} |
7135 | 1341 |
|
13048 | 1342 |
\subsubsection{Basic methods} |
7321 | 1343 |
|
13024 | 1344 |
\indexisarmeth{rule}\indexisarmeth{default}\indexisarmeth{contradiction} |
1345 |
\indexisarmeth{intro}\indexisarmeth{elim} |
|
7321 | 1346 |
\begin{matharray}{rcl} |
1347 |
rule & : & \isarmeth \\ |
|
13024 | 1348 |
contradiction & : & \isarmeth \\ |
7321 | 1349 |
intro & : & \isarmeth \\ |
1350 |
elim & : & \isarmeth \\ |
|
1351 |
\end{matharray} |
|
1352 |
||
1353 |
\begin{rail} |
|
8547 | 1354 |
('rule' | 'intro' | 'elim') thmrefs? |
7321 | 1355 |
; |
1356 |
\end{rail} |
|
1357 |
||
1358 |
\begin{descr} |
|
13041 | 1359 |
|
7466 | 1360 |
\item [$rule$] as offered by the classical reasoner is a refinement over the |
13024 | 1361 |
primitive one (see \S\ref{sec:pure-meth-att}). Both versions essentially |
1362 |
work the same, but the classical version observes the classical rule context |
|
13041 | 1363 |
in addition to that of Isabelle/Pure. |
1364 |
||
1365 |
Common object logics (HOL, ZF, etc.) declare a rich collection of classical |
|
1366 |
rules (even if these would qualify as intuitionistic ones), but only few |
|
1367 |
declarations to the rule context of Isabelle/Pure |
|
1368 |
(\S\ref{sec:pure-meth-att}). |
|
1369 |
||
13024 | 1370 |
\item [$contradiction$] solves some goal by contradiction, deriving any result |
20379 | 1371 |
from both $\lnot A$ and $A$. Chained facts, which are guaranteed to |
13041 | 1372 |
participate, may appear in either order. |
9614 | 1373 |
|
7466 | 1374 |
\item [$intro$ and $elim$] repeatedly refine some goal by intro- or |
13041 | 1375 |
elim-resolution, after having inserted any chained facts. Exactly the rules |
1376 |
given as arguments are taken into account; this allows fine-tuned |
|
1377 |
decomposition of a proof problem, in contrast to common automated tools. |
|
1378 |
||
7321 | 1379 |
\end{descr} |
1380 |
||
1381 |
||
13048 | 1382 |
\subsubsection{Automated methods} |
7315 | 1383 |
|
9799 | 1384 |
\indexisarmeth{blast}\indexisarmeth{fast}\indexisarmeth{slow} |
1385 |
\indexisarmeth{best}\indexisarmeth{safe}\indexisarmeth{clarify} |
|
7321 | 1386 |
\begin{matharray}{rcl} |
9780 | 1387 |
blast & : & \isarmeth \\ |
1388 |
fast & : & \isarmeth \\ |
|
9799 | 1389 |
slow & : & \isarmeth \\ |
9780 | 1390 |
best & : & \isarmeth \\ |
1391 |
safe & : & \isarmeth \\ |
|
1392 |
clarify & : & \isarmeth \\ |
|
7321 | 1393 |
\end{matharray} |
1394 |
||
11128 | 1395 |
\indexouternonterm{clamod} |
7321 | 1396 |
\begin{rail} |
13027 | 1397 |
'blast' ('!' ?) nat? (clamod *) |
7321 | 1398 |
; |
13027 | 1399 |
('fast' | 'slow' | 'best' | 'safe' | 'clarify') ('!' ?) (clamod *) |
7321 | 1400 |
; |
1401 |
||
9408 | 1402 |
clamod: (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del') ':' thmrefs |
7321 | 1403 |
; |
1404 |
\end{rail} |
|
1405 |
||
1406 |
\begin{descr} |
|
1407 |
\item [$blast$] refers to the classical tableau prover (see \texttt{blast_tac} |
|
7335 | 1408 |
in \cite[\S11]{isabelle-ref}). The optional argument specifies a |
10858 | 1409 |
user-supplied search bound (default 20). |
9799 | 1410 |
\item [$fast$, $slow$, $best$, $safe$, and $clarify$] refer to the generic |
1411 |
classical reasoner. See \texttt{fast_tac}, \texttt{slow_tac}, |
|
1412 |
\texttt{best_tac}, \texttt{safe_tac}, and \texttt{clarify_tac} in |
|
1413 |
\cite[\S11]{isabelle-ref} for more information. |
|
7321 | 1414 |
\end{descr} |
1415 |
||
13041 | 1416 |
Any of the above methods support additional modifiers of the context of |
1417 |
classical rules. Their semantics is analogous to the attributes given before. |
|
1418 |
Facts provided by forward chaining are inserted into the goal before |
|
1419 |
commencing proof search. The ``!''~argument causes the full context of |
|
1420 |
assumptions to be included as well. |
|
7321 | 1421 |
|
7315 | 1422 |
|
12621 | 1423 |
\subsubsection{Combined automated methods}\label{sec:clasimp} |
7315 | 1424 |
|
9799 | 1425 |
\indexisarmeth{auto}\indexisarmeth{force}\indexisarmeth{clarsimp} |
1426 |
\indexisarmeth{fastsimp}\indexisarmeth{slowsimp}\indexisarmeth{bestsimp} |
|
7321 | 1427 |
\begin{matharray}{rcl} |
9606 | 1428 |
auto & : & \isarmeth \\ |
7321 | 1429 |
force & : & \isarmeth \\ |
9438 | 1430 |
clarsimp & : & \isarmeth \\ |
9606 | 1431 |
fastsimp & : & \isarmeth \\ |
9799 | 1432 |
slowsimp & : & \isarmeth \\ |
1433 |
bestsimp & : & \isarmeth \\ |
|
7321 | 1434 |
\end{matharray} |
1435 |
||
11128 | 1436 |
\indexouternonterm{clasimpmod} |
7321 | 1437 |
\begin{rail} |
13027 | 1438 |
'auto' '!'? (nat nat)? (clasimpmod *) |
9780 | 1439 |
; |
13027 | 1440 |
('force' | 'clarsimp' | 'fastsimp' | 'slowsimp' | 'bestsimp') '!'? (clasimpmod *) |
7321 | 1441 |
; |
7315 | 1442 |
|
9711 | 1443 |
clasimpmod: ('simp' (() | 'add' | 'del' | 'only') | |
10031 | 1444 |
('cong' | 'split') (() | 'add' | 'del') | |
1445 |
'iff' (((() | 'add') '?'?) | 'del') | |
|
9408 | 1446 |
(('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del')) ':' thmrefs |
7321 | 1447 |
\end{rail} |
7315 | 1448 |
|
7321 | 1449 |
\begin{descr} |
9799 | 1450 |
\item [$auto$, $force$, $clarsimp$, $fastsimp$, $slowsimp$, and $bestsimp$] |
1451 |
provide access to Isabelle's combined simplification and classical reasoning |
|
1452 |
tactics. These correspond to \texttt{auto_tac}, \texttt{force_tac}, |
|
1453 |
\texttt{clarsimp_tac}, and Classical Reasoner tactics with the Simplifier |
|
1454 |
added as wrapper, see \cite[\S11]{isabelle-ref} for more information. The |
|
13048 | 1455 |
modifier arguments correspond to those given in \S\ref{sec:simplifier} and |
1456 |
\S\ref{sec:classical}. Just note that the ones related to the Simplifier |
|
1457 |
are prefixed by \railtterm{simp} here. |
|
9614 | 1458 |
|
7987 | 1459 |
Facts provided by forward chaining are inserted into the goal before doing |
1460 |
the search. The ``!''~argument causes the full context of assumptions to be |
|
1461 |
included as well. |
|
7321 | 1462 |
\end{descr} |
1463 |
||
7987 | 1464 |
|
13048 | 1465 |
\subsubsection{Declaring rules} |
7135 | 1466 |
|
8667 | 1467 |
\indexisarcmd{print-claset} |
7391 | 1468 |
\indexisaratt{intro}\indexisaratt{elim}\indexisaratt{dest} |
9936 | 1469 |
\indexisaratt{iff}\indexisaratt{rule} |
7321 | 1470 |
\begin{matharray}{rcl} |
13024 | 1471 |
\isarcmd{print_claset}^* & : & \isarkeep{theory~|~proof} \\ |
7321 | 1472 |
intro & : & \isaratt \\ |
1473 |
elim & : & \isaratt \\ |
|
1474 |
dest & : & \isaratt \\ |
|
9936 | 1475 |
rule & : & \isaratt \\ |
7391 | 1476 |
iff & : & \isaratt \\ |
7321 | 1477 |
\end{matharray} |
7135 | 1478 |
|
7321 | 1479 |
\begin{rail} |
18854 | 1480 |
('intro' | 'elim' | 'dest') ('!' | () | '?') nat? |
7321 | 1481 |
; |
9936 | 1482 |
'rule' 'del' |
1483 |
; |
|
10031 | 1484 |
'iff' (((() | 'add') '?'?) | 'del') |
9936 | 1485 |
; |
7321 | 1486 |
\end{rail} |
7135 | 1487 |
|
7321 | 1488 |
\begin{descr} |
13024 | 1489 |
|
1490 |
\item [$\isarcmd{print_claset}$] prints the collection of rules declared to |
|
21076 | 1491 |
the Classical Reasoner, which is also known as ``claset'' internally |
8667 | 1492 |
\cite{isabelle-ref}. This is a diagnostic command; $undo$ does not apply. |
18854 | 1493 |
|
8517 | 1494 |
\item [$intro$, $elim$, and $dest$] declare introduction, elimination, and |
11332 | 1495 |
destruction rules, respectively. By default, rules are considered as |
9408 | 1496 |
\emph{unsafe} (i.e.\ not applied blindly without backtracking), while a |
13041 | 1497 |
single ``!'' classifies as \emph{safe}. Rule declarations marked by ``?'' |
18854 | 1498 |
coincide with those of Isabelle/Pure, cf.\ \S\ref{sec:pure-meth-att} (i.e.\ |
1499 |
are only applied in single steps of the $rule$ method). The optional |
|
1500 |
natural number specifies an explicit weight argument, which is ignored by |
|
1501 |
automated tools, but determines the search order of single rule steps. |
|
13024 | 1502 |
|
11332 | 1503 |
\item [$rule~del$] deletes introduction, elimination, or destruction rules from |
9936 | 1504 |
the context. |
13041 | 1505 |
|
1506 |
\item [$iff$] declares logical equivalences to the Simplifier and the |
|
13024 | 1507 |
Classical reasoner at the same time. Non-conditional rules result in a |
1508 |
``safe'' introduction and elimination pair; conditional ones are considered |
|
1509 |
``unsafe''. Rules with negative conclusion are automatically inverted |
|
20379 | 1510 |
(using $\lnot$ elimination internally). |
13041 | 1511 |
|
1512 |
The ``?'' version of $iff$ declares rules to the Isabelle/Pure context only, |
|
1513 |
and omits the Simplifier declaration. |
|
1514 |
||
7321 | 1515 |
\end{descr} |
7135 | 1516 |
|
8203
2fcc6017cb72
intro/elim/dest attributes: changed ! / !! flags to ? / ??;
wenzelm
parents:
8195
diff
changeset
|
1517 |
|
13048 | 1518 |
\subsubsection{Classical operations} |
13027 | 1519 |
|
18530 | 1520 |
\indexisaratt{swapped} |
13027 | 1521 |
|
1522 |
\begin{matharray}{rcl} |
|
1523 |
swapped & : & \isaratt \\ |
|
1524 |
\end{matharray} |
|
1525 |
||
1526 |
\begin{descr} |
|
13041 | 1527 |
|
13027 | 1528 |
\item [$swapped$] turns an introduction rule into an elimination, by resolving |
20379 | 1529 |
with the classical swap principle $(\lnot B \Imp A) \Imp (\lnot A \Imp B)$. |
13027 | 1530 |
|
1531 |
\end{descr} |
|
1532 |
||
1533 |
||
12621 | 1534 |
\subsection{Proof by cases and induction}\label{sec:cases-induct} |
12618 | 1535 |
|
13048 | 1536 |
\subsubsection{Rule contexts} |
12618 | 1537 |
|
1538 |
\indexisarcmd{case}\indexisarcmd{print-cases} |
|
18232 | 1539 |
\indexisaratt{case-names}\indexisaratt{case-conclusion} |
1540 |
\indexisaratt{params}\indexisaratt{consumes} |
|
12618 | 1541 |
\begin{matharray}{rcl} |
1542 |
\isarcmd{case} & : & \isartrans{proof(state)}{proof(state)} \\ |
|
1543 |
\isarcmd{print_cases}^* & : & \isarkeep{proof} \\ |
|
1544 |
case_names & : & \isaratt \\ |
|
18232 | 1545 |
case_conclusion & : & \isaratt \\ |
12618 | 1546 |
params & : & \isaratt \\ |
1547 |
consumes & : & \isaratt \\ |
|
1548 |
\end{matharray} |
|
1549 |
||
18232 | 1550 |
The puristic way to build up Isar proof contexts is by explicit language |
1551 |
elements like $\FIXNAME$, $\ASSUMENAME$, $\LET$ (see |
|
1552 |
\S\ref{sec:proof-context}). This is adequate for plain natural deduction, but |
|
1553 |
easily becomes unwieldy in concrete verification tasks, which typically |
|
1554 |
involve big induction rules with several cases. |
|
1555 |
||
1556 |
The $\CASENAME$ command provides a shorthand to refer to a local context |
|
1557 |
symbolically: certain proof methods provide an environment of named ``cases'' |
|
1558 |
of the form $c\colon \vec x, \vec \phi$; the effect of ``$\CASE{c}$'' is then |
|
1559 |
equivalent to ``$\FIX{\vec x}~\ASSUME{c}{\vec\phi}$''. Term bindings may be |
|
1560 |
covered as well, notably $\Var{case}$ for the main conclusion. |
|
1561 |
||
1562 |
By default, the ``terminology'' $\vec x$ of a case value is marked as hidden, |
|
1563 |
i.e.\ there is no way to refer to such parameters in the subsequent proof |
|
1564 |
text. After all, original rule parameters stem from somewhere outside of the |
|
1565 |
current proof text. By using the explicit form ``$\CASE{(c~\vec y)}$'' |
|
1566 |
instead, the proof author is able to chose local names that fit nicely into |
|
1567 |
the current context. |
|
12618 | 1568 |
|
1569 |
\medskip |
|
1570 |
||
18232 | 1571 |
It is important to note that proper use of $\CASENAME$ does not provide means |
1572 |
to peek at the current goal state, which is not directly observable in Isar! |
|
1573 |
Nonetheless, goal refinement commands do provide named cases $goal@i$ for each |
|
1574 |
subgoal $i = 1, \dots, n$ of the resulting goal state. Using this feature |
|
1575 |
requires great care, because some bits of the internal tactical machinery |
|
1576 |
intrude the proof text. In particular, parameter names stemming from the |
|
1577 |
left-over of automated reasoning tools are usually quite unpredictable. |
|
12618 | 1578 |
|
18232 | 1579 |
Under normal circumstances, the text of cases emerge from standard elimination |
1580 |
or induction rules, which in turn are derived from previous theory |
|
13041 | 1581 |
specifications in a canonical way (say from $\isarkeyword{inductive}$ |
1582 |
definitions). |
|
13027 | 1583 |
|
18232 | 1584 |
\medskip Proper cases are only available if both the proof method and the |
1585 |
rules involved support this. By using appropriate attributes, case names, |
|
1586 |
conclusions, and parameters may be also declared by hand. Thus variant |
|
19786 | 1587 |
versions of rules that have been derived manually become ready to use in |
18232 | 1588 |
advanced case analysis later. |
12618 | 1589 |
|
1590 |
\begin{rail} |
|
13041 | 1591 |
'case' (caseref | '(' caseref ((name | underscore) +) ')') |
12618 | 1592 |
; |
13024 | 1593 |
caseref: nameref attributes? |
1594 |
; |
|
1595 |
||
18232 | 1596 |
'case\_names' (name +) |
1597 |
; |
|
1598 |
'case\_conclusion' name (name *) |
|
12618 | 1599 |
; |
13027 | 1600 |
'params' ((name *) + 'and') |
12618 | 1601 |
; |
1602 |
'consumes' nat? |
|
1603 |
; |
|
1604 |
\end{rail} |
|
1605 |
||
1606 |
\begin{descr} |
|
18232 | 1607 |
|
13041 | 1608 |
\item [$\CASE{(c~\vec x)}$] invokes a named local context $c\colon \vec x, |
1609 |
\vec \phi$, as provided by an appropriate proof method (such as $cases$ and |
|
18232 | 1610 |
$induct$). The command ``$\CASE{(c~\vec x)}$'' abbreviates ``$\FIX{\vec |
1611 |
x}~\ASSUME{c}{\vec\phi}$''. |
|
13041 | 1612 |
|
12618 | 1613 |
\item [$\isarkeyword{print_cases}$] prints all local contexts of the current |
1614 |
state, using Isar proof language notation. This is a diagnostic command; |
|
1615 |
$undo$ does not apply. |
|
18232 | 1616 |
|
12618 | 1617 |
\item [$case_names~\vec c$] declares names for the local contexts of premises |
18232 | 1618 |
of a theorem; $\vec c$ refers to the \emph{suffix} of the list of premises. |
1619 |
||
1620 |
\item [$case_conclusion~c~\vec d$] declares names for the conclusions of a |
|
1621 |
named premise $c$; here $\vec d$ refers to the prefix of arguments of a |
|
1622 |
logical formula built by nesting a binary connective (e.g.\ $\lor$). |
|
1623 |
||
1624 |
Note that proof methods such as $induct$ and $coinduct$ already provide a |
|
1625 |
default name for the conclusion as a whole. The need to name subformulas |
|
1626 |
only arises with cases that split into several sub-cases, as in common |
|
1627 |
co-induction rules. |
|
13041 | 1628 |
|
12618 | 1629 |
\item [$params~\vec p@1 \dots \vec p@n$] renames the innermost parameters of |
1630 |
premises $1, \dots, n$ of some theorem. An empty list of names may be given |
|
1631 |
to skip positions, leaving the present parameters unchanged. |
|
18232 | 1632 |
|
12618 | 1633 |
Note that the default usage of case rules does \emph{not} directly expose |
18232 | 1634 |
parameters to the proof context. |
1635 |
||
12618 | 1636 |
\item [$consumes~n$] declares the number of ``major premises'' of a rule, |
1637 |
i.e.\ the number of facts to be consumed when it is applied by an |
|
18232 | 1638 |
appropriate proof method. The default value of $consumes$ is $n = 1$, which |
1639 |
is appropriate for the usual kind of cases and induction rules for inductive |
|
1640 |
sets (cf.\ \S\ref{sec:hol-inductive}). Rules without any $consumes$ |
|
1641 |
declaration given are treated as if $consumes~0$ had been specified. |
|
1642 |
||
12618 | 1643 |
Note that explicit $consumes$ declarations are only rarely needed; this is |
18232 | 1644 |
already taken care of automatically by the higher-level $cases$, $induct$, |
1645 |
and $coinduct$ declarations. |
|
13027 | 1646 |
|
12618 | 1647 |
\end{descr} |
1648 |
||
1649 |
||
18232 | 1650 |
\subsubsection{Proof methods} |
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1651 |
|
18232 | 1652 |
\indexisarmeth{cases}\indexisarmeth{induct}\indexisarmeth{coinduct} |
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1653 |
\begin{matharray}{rcl} |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1654 |
cases & : & \isarmeth \\ |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1655 |
induct & : & \isarmeth \\ |
18232 | 1656 |
coinduct & : & \isarmeth \\ |
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1657 |
\end{matharray} |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1658 |
|
18232 | 1659 |
The $cases$, $induct$, and $coinduct$ methods provide a uniform interface to |
1660 |
common proof techniques over datatypes, inductive sets, recursive functions |
|
1661 |
etc. The corresponding rules may be specified and instantiated in a casual |
|
1662 |
manner. Furthermore, these methods provide named local contexts that may be |
|
1663 |
invoked via the $\CASENAME$ proof command within the subsequent proof text. |
|
1664 |
This accommodates compact proof texts even when reasoning about large |
|
13048 | 1665 |
specifications. |
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1666 |
|
18232 | 1667 |
The $induct$ method also provides some additional infrastructure in order to |
1668 |
be applicable to structure statements (either using explicit meta-level |
|
1669 |
connectives, or including facts and parameters separately). This avoids |
|
1670 |
cumbersome encoding of ``strengthened'' inductive statements within the |
|
1671 |
object-logic. |
|
1672 |
||
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1673 |
\begin{rail} |
18232 | 1674 |
'cases' open? (insts * 'and') rule? |
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1675 |
; |
20503 | 1676 |
'induct' open? (definsts * 'and') \\ arbitrary? taking? rule? |
18232 | 1677 |
; |
1678 |
'coinduct' open? insts taking rule? |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1679 |
; |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1680 |
|
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1681 |
open: '(' 'open' ')' |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1682 |
; |
18505 | 1683 |
rule: ('type' | 'set') ':' (nameref +) | 'rule' ':' (thmref +) |
18232 | 1684 |
; |
1685 |
definst: name ('==' | equiv) term | inst |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1686 |
; |
18232 | 1687 |
definsts: ( definst *) |
1688 |
; |
|
20503 | 1689 |
arbitrary: 'arbitrary' ':' ((term *) 'and' +) |
18232 | 1690 |
; |
1691 |
taking: 'taking' ':' insts |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1692 |
; |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1693 |
\end{rail} |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1694 |
|
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1695 |
\begin{descr} |
13041 | 1696 |
|
1697 |
\item [$cases~insts~R$] applies method $rule$ with an appropriate case |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1698 |
distinction theorem, instantiated to the subjects $insts$. Symbolic case |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1699 |
names are bound according to the rule's local contexts. |
13041 | 1700 |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1701 |
The rule is determined as follows, according to the facts and arguments |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1702 |
passed to the $cases$ method: |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1703 |
\begin{matharray}{llll} |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1704 |
\Text{facts} & & \Text{arguments} & \Text{rule} \\\hline |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1705 |
& cases & & \Text{classical case split} \\ |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1706 |
& cases & t & \Text{datatype exhaustion (type of $t$)} \\ |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1707 |
\edrv a \in A & cases & \dots & \Text{inductive set elimination (of $A$)} \\ |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1708 |
\dots & cases & \dots ~ R & \Text{explicit rule $R$} \\ |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1709 |
\end{matharray} |
13041 | 1710 |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1711 |
Several instantiations may be given, referring to the \emph{suffix} of |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1712 |
premises of the case rule; within each premise, the \emph{prefix} of |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1713 |
variables is instantiated. In most situations, only a single term needs to |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1714 |
be specified; this refers to the first variable of the last premise (it is |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1715 |
usually the same for all cases). |
13041 | 1716 |
|
1717 |
The ``$(open)$'' option causes the parameters of the new local contexts to |
|
1718 |
be exposed to the current proof context. Thus local variables stemming from |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1719 |
distant parts of the theory development may be introduced in an implicit |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1720 |
manner, which can be quite confusing to the reader. Furthermore, this |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1721 |
option may cause unwanted hiding of existing local variables, resulting in |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1722 |
less robust proof texts. |
13041 | 1723 |
|
1724 |
\item [$induct~insts~R$] is analogous to the $cases$ method, but refers to |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1725 |
induction rules, which are determined as follows: |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1726 |
\begin{matharray}{llll} |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1727 |
\Text{facts} & & \Text{arguments} & \Text{rule} \\\hline |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1728 |
& induct & P ~ x ~ \dots & \Text{datatype induction (type of $x$)} \\ |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1729 |
\edrv x \in A & induct & \dots & \Text{set induction (of $A$)} \\ |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1730 |
\dots & induct & \dots ~ R & \Text{explicit rule $R$} \\ |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1731 |
\end{matharray} |
18505 | 1732 |
|
1733 |
Several instantiations may be given, each referring to some part of |
|
1734 |
a mutual inductive definition or datatype --- only related partial |
|
1735 |
induction rules may be used together, though. Any of the lists of |
|
1736 |
terms $P, x, \dots$ refers to the \emph{suffix} of variables present |
|
1737 |
in the induction rule. This enables the writer to specify only |
|
1738 |
induction variables, or both predicates and variables, for example. |
|
18232 | 1739 |
|
1740 |
Instantiations may be definitional: equations $x \equiv t$ introduce local |
|
1741 |
definitions, which are inserted into the claim and discharged after applying |
|
1742 |
the induction rule. Equalities reappear in the inductive cases, but have |
|
1743 |
been transformed according to the induction principle being involved here. |
|
1744 |
In order to achieve practically useful induction hypotheses, some variables |
|
1745 |
occurring in $t$ need to be fixed (see below). |
|
1746 |
||
20503 | 1747 |
The optional ``$arbitrary\colon \vec x$'' specification generalizes |
1748 |
variables $\vec x$ of the original goal before applying induction. Thus |
|
1749 |
induction hypotheses may become sufficiently general to get the proof |
|
1750 |
through. Together with definitional instantiations, one may effectively |
|
1751 |
perform induction over expressions of a certain structure. |
|
18232 | 1752 |
|
1753 |
The optional ``$taking\colon \vec t$'' specification provides additional |
|
1754 |
instantiations of a prefix of pending variables in the rule. Such schematic |
|
1755 |
induction rules rarely occur in practice, though. |
|
1756 |
||
1757 |
The ``$(open)$'' option works the same way as for $cases$. |
|
1758 |
||
1759 |
\item [$coinduct~inst~R$] is analogous to the $induct$ method, but refers to |
|
1760 |
coinduction rules, which are determined as follows: |
|
1761 |
\begin{matharray}{llll} |
|
1762 |
\Text{goal} & & \Text{arguments} & \Text{rule} \\\hline |
|
1763 |
& coinduct & x ~ \dots & \Text{type coinduction (type of $x$)} \\ |
|
1764 |
x \in A & coinduct & \dots & \Text{set coinduction (of $A$)} \\ |
|
1765 |
\dots & coinduct & \dots ~ R & \Text{explicit rule $R$} \\ |
|
1766 |
\end{matharray} |
|
1767 |
||
1768 |
Coinduction is the dual of induction. Induction essentially eliminates $x |
|
1769 |
\in A$ towards a generic result $P ~ x$, while coinduction introduces $x \in |
|
1770 |
A$ starting with $x \in B$, for a suitable ``bisimulation'' $B$. The cases |
|
1771 |
of a coinduct rule are typically named after the sets being covered, while |
|
1772 |
the conclusions consist of several alternatives being named after the |
|
1773 |
individual destructor patterns. |
|
1774 |
||
1775 |
The given instantiation refers to the \emph{prefix} of variables occurring |
|
1776 |
in the rule's conclusion. An additional ``$taking: \vec t$'' specification |
|
1777 |
may be required in order to specify the bisimulation to be used in the |
|
1778 |
coinduction step. |
|
13041 | 1779 |
|
1780 |
The ``$(open)$'' option works the same way as for $cases$. |
|
13027 | 1781 |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1782 |
\end{descr} |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1783 |
|
13048 | 1784 |
Above methods produce named local contexts, as determined by the instantiated |
18232 | 1785 |
rule as given in the text. Beyond that, the $induct$ and $coinduct$ methods |
1786 |
guess further instantiations from the goal specification itself. Any |
|
1787 |
persisting unresolved schematic variables of the resulting rule will render |
|
1788 |
the the corresponding case invalid. The term binding |
|
1789 |
$\Var{case}$\indexisarvar{case} for the conclusion will be provided with each |
|
1790 |
case, provided that term is fully specified. |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1791 |
|
13048 | 1792 |
The $\isarkeyword{print_cases}$ command prints all named cases present in the |
1793 |
current proof state. |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1794 |
|
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1795 |
\medskip |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1796 |
|
18232 | 1797 |
Despite the additional infrastructure, both $cases$ and $coinduct$ merely |
1798 |
apply a certain rule, after instantiation, while conforming due to the usual |
|
1799 |
way of monotonic natural deduction: the context of a structured statement |
|
1800 |
$\All{\vec x} \vec\phi \Imp \dots$ reappears unchanged after the case split. |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1801 |
|
18232 | 1802 |
The $induct$ method is significantly different in this respect: the meta-level |
1803 |
structure is passed through the ``recursive'' course involved in the |
|
1804 |
induction. Thus the original statement is basically replaced by separate |
|
1805 |
copies, corresponding to the induction hypotheses and conclusion; the original |
|
1806 |
goal context is no longer available. Thus local assumptions, fixed parameters |
|
1807 |
and definitions effectively participate in the inductive rephrasing of the |
|
1808 |
original statement. |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1809 |
|
13425
119ae829ad9b
support for split assumptions in cases (hyps vs. prems);
wenzelm
parents:
13411
diff
changeset
|
1810 |
In induction proofs, local assumptions introduced by cases are split into two |
119ae829ad9b
support for split assumptions in cases (hyps vs. prems);
wenzelm
parents:
13411
diff
changeset
|
1811 |
different kinds: $hyps$ stemming from the rule and $prems$ from the goal |
119ae829ad9b
support for split assumptions in cases (hyps vs. prems);
wenzelm
parents:
13411
diff
changeset
|
1812 |
statement. This is reflected in the extracted cases accordingly, so invoking |
119ae829ad9b
support for split assumptions in cases (hyps vs. prems);
wenzelm
parents:
13411
diff
changeset
|
1813 |
``$\isarcmd{case}~c$'' will provide separate facts $c\mathord.hyps$ and |
119ae829ad9b
support for split assumptions in cases (hyps vs. prems);
wenzelm
parents:
13411
diff
changeset
|
1814 |
$c\mathord.prems$, as well as fact $c$ to hold the all-inclusive list. |
119ae829ad9b
support for split assumptions in cases (hyps vs. prems);
wenzelm
parents:
13411
diff
changeset
|
1815 |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1816 |
\medskip |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1817 |
|
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1818 |
Facts presented to either method are consumed according to the number of |
18232 | 1819 |
``major premises'' of the rule involved, which is usually $0$ for plain cases |
1820 |
and induction rules of datatypes etc.\ and $1$ for rules of inductive sets and |
|
1821 |
the like. The remaining facts are inserted into the goal verbatim before the |
|
1822 |
actual $cases$, $induct$, or $coinduct$ rule is applied. |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1823 |
|
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1824 |
|
18232 | 1825 |
\subsubsection{Declaring rules} |
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1826 |
|
18232 | 1827 |
\indexisarcmd{print-induct-rules}\indexisaratt{cases}\indexisaratt{induct}\indexisaratt{coinduct} |
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1828 |
\begin{matharray}{rcl} |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1829 |
\isarcmd{print_induct_rules}^* & : & \isarkeep{theory~|~proof} \\ |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1830 |
cases & : & \isaratt \\ |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1831 |
induct & : & \isaratt \\ |
18232 | 1832 |
coinduct & : & \isaratt \\ |
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1833 |
\end{matharray} |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1834 |
|
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1835 |
\begin{rail} |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1836 |
'cases' spec |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1837 |
; |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1838 |
'induct' spec |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1839 |
; |
18232 | 1840 |
'coinduct' spec |
1841 |
; |
|
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1842 |
|
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1843 |
spec: ('type' | 'set') ':' nameref |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1844 |
; |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1845 |
\end{rail} |
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1846 |
|
13024 | 1847 |
\begin{descr} |
13041 | 1848 |
|
13024 | 1849 |
\item [$\isarkeyword{print_induct_rules}$] prints cases and induct rules for |
1850 |
sets and types of the current context. |
|
13048 | 1851 |
|
18232 | 1852 |
\item [$cases$, $induct$, and $coinduct$] (as attributes) augment the |
1853 |
corresponding context of rules for reasoning about (co)inductive sets and |
|
1854 |
types, using the corresponding methods of the same name. Certain |
|
1855 |
definitional packages of object-logics usually declare emerging cases and |
|
1856 |
induction rules as expected, so users rarely need to intervene. |
|
1857 |
||
1858 |
Manual rule declarations usually refer to the $case_names$ and $params$ |
|
1859 |
attributes to adjust names of cases and parameters of a rule; the $consumes$ |
|
1860 |
declaration is taken care of automatically: $consumes~0$ is specified for |
|
1861 |
``type'' rules and $consumes~1$ for ``set'' rules. |
|
13041 | 1862 |
|
13024 | 1863 |
\end{descr} |
11691
fc9bd420162c
induct/cases made generic, removed simplified/stripped options;
wenzelm
parents:
11469
diff
changeset
|
1864 |
|
9614 | 1865 |
%%% Local Variables: |
7135 | 1866 |
%%% mode: latex |
1867 |
%%% TeX-master: "isar-ref" |
|
9614 | 1868 |
%%% End: |