author | Christian Urban <urbanc@in.tum.de> |
Mon, 07 Nov 2011 16:13:26 +0000 | |
changeset 489 | 1343540ed715 |
parent 346 | 0fea8b7a14a1 |
child 517 | d8c376662bb4 |
permissions | -rw-r--r-- |
32 | 1 |
theory Ind_Intro |
346
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
295
diff
changeset
|
2 |
imports "../Base" |
32 | 3 |
begin |
4 |
||
346
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
295
diff
changeset
|
5 |
(*<*) |
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
295
diff
changeset
|
6 |
setup{* |
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
295
diff
changeset
|
7 |
open_file_with_prelude |
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
295
diff
changeset
|
8 |
"Ind_Package_Code.thy" |
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
295
diff
changeset
|
9 |
["theory Ind_Package", "imports Main", "begin"] |
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
295
diff
changeset
|
10 |
*} |
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
295
diff
changeset
|
11 |
(*>*) |
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
295
diff
changeset
|
12 |
|
217 | 13 |
chapter {* How to Write a Definitional Package\label{chp:package} *} |
32 | 14 |
|
15 |
text {* |
|
489 | 16 |
\begin{flushright} |
17 |
{\em |
|
18 |
``We will most likely never realize the full importance of painting the Tower,\\ |
|
19 |
that it is the essential element in the conservation of metal works and the\\ |
|
20 |
more meticulous the paint job, the longer the tower shall endure.''} \\[1ex] |
|
21 |
Gustave Eiffel, in his book {\em The 300-Meter Tower}.\footnote{The Eiffel Tower has been |
|
22 |
re-painted 18 times since its initial construction, an average of once every |
|
23 |
seven years. It takes more than one year for a team of 25 painters to paint the tower |
|
24 |
from top to bottom.} |
|
25 |
\end{flushright} |
|
26 |
||
27 |
\medskip |
|
113 | 28 |
HOL is based on just a few primitive constants, like equality and |
116
c9ff326e3ce5
more changes to the package chapter
Christian Urban <urbanc@in.tum.de>
parents:
115
diff
changeset
|
29 |
implication, whose properties are described by axioms. All other concepts, |
243 | 30 |
such as inductive predicates, datatypes or recursive functions, are defined |
31 |
in terms of those primitives, and the desired properties, for example |
|
32 |
induction theorems or recursion equations, are derived from the definitions |
|
116
c9ff326e3ce5
more changes to the package chapter
Christian Urban <urbanc@in.tum.de>
parents:
115
diff
changeset
|
33 |
by a formal proof. Since it would be very tedious for a user to define |
295
24c68350d059
polished the package chapter used FOCUS to explain the subproofs
Christian Urban <urbanc@in.tum.de>
parents:
243
diff
changeset
|
34 |
inductive predicates or datatypes ``by hand'' just using the |
116
c9ff326e3ce5
more changes to the package chapter
Christian Urban <urbanc@in.tum.de>
parents:
115
diff
changeset
|
35 |
primitive operators of higher order logic, \emph{definitional packages} have |
243 | 36 |
been implemented to automate such work. Thanks to those packages, the user |
116
c9ff326e3ce5
more changes to the package chapter
Christian Urban <urbanc@in.tum.de>
parents:
115
diff
changeset
|
37 |
can give a high-level specification, for example a list of introduction |
c9ff326e3ce5
more changes to the package chapter
Christian Urban <urbanc@in.tum.de>
parents:
115
diff
changeset
|
38 |
rules or constructors, and the package then does all the low-level |
c9ff326e3ce5
more changes to the package chapter
Christian Urban <urbanc@in.tum.de>
parents:
115
diff
changeset
|
39 |
definitions and proofs behind the scenes. In this chapter we explain how |
c9ff326e3ce5
more changes to the package chapter
Christian Urban <urbanc@in.tum.de>
parents:
115
diff
changeset
|
40 |
such a package can be implemented. |
32 | 41 |
|
219
98d43270024f
more work on the simple inductive chapter
Christian Urban <urbanc@in.tum.de>
parents:
217
diff
changeset
|
42 |
As the running example we have chosen a rather simple package for defining |
127
74846cb0fff9
updated and added two tentative recipes
Christian Urban <urbanc@in.tum.de>
parents:
121
diff
changeset
|
43 |
inductive predicates. To keep things really simple, we will not use the |
74846cb0fff9
updated and added two tentative recipes
Christian Urban <urbanc@in.tum.de>
parents:
121
diff
changeset
|
44 |
general Knaster-Tarski fixpoint theorem on complete lattices, which forms |
243 | 45 |
the basis of Isabelle/HOL's standard inductive definition package. Instead, we |
212 | 46 |
will describe a simpler \emph{impredicative} (i.e.\ involving quantification on |
127
74846cb0fff9
updated and added two tentative recipes
Christian Urban <urbanc@in.tum.de>
parents:
121
diff
changeset
|
47 |
predicate variables) encoding of inductive predicates. Due to its |
74846cb0fff9
updated and added two tentative recipes
Christian Urban <urbanc@in.tum.de>
parents:
121
diff
changeset
|
48 |
simplicity, this package will necessarily have a reduced functionality. It |
243 | 49 |
does neither support introduction rules involving arbitrary monotonic |
212 | 50 |
operators, nor does it prove case analysis rules (also called inversion rules). |
51 |
Moreover, it only proves a weaker form of the induction principle for inductive |
|
295
24c68350d059
polished the package chapter used FOCUS to explain the subproofs
Christian Urban <urbanc@in.tum.de>
parents:
243
diff
changeset
|
52 |
predicates. But it illustrates the implementation pf a typical package in |
24c68350d059
polished the package chapter used FOCUS to explain the subproofs
Christian Urban <urbanc@in.tum.de>
parents:
243
diff
changeset
|
53 |
Isabelle. |
32 | 54 |
*} |
55 |
||
56 |
end |