author | wenzelm |
Fri, 17 Dec 2010 18:10:37 +0100 | |
changeset 41249 | 26f12f98f50a |
parent 40406 | 313a24b66a8d |
child 42596 | 6c621a9d612a |
permissions | -rw-r--r-- |
26840 | 1 |
% |
2 |
\begin{isabellebody}% |
|
40406 | 3 |
\def\isabellecontext{ZF{\isaliteral{5F}{\isacharunderscore}}Specific}% |
26840 | 4 |
% |
5 |
\isadelimtheory |
|
6 |
% |
|
7 |
\endisadelimtheory |
|
8 |
% |
|
9 |
\isatagtheory |
|
10 |
\isacommand{theory}\isamarkupfalse% |
|
40406 | 11 |
\ ZF{\isaliteral{5F}{\isacharunderscore}}Specific\isanewline |
26895 | 12 |
\isakeyword{imports}\ Main\isanewline |
26845 | 13 |
\isakeyword{begin}% |
14 |
\endisatagtheory |
|
15 |
{\isafoldtheory}% |
|
16 |
% |
|
17 |
\isadelimtheory |
|
18 |
% |
|
19 |
\endisadelimtheory |
|
20 |
% |
|
26852 | 21 |
\isamarkupchapter{Isabelle/ZF \label{ch:zf}% |
26845 | 22 |
} |
23 |
\isamarkuptrue% |
|
24 |
% |
|
25 |
\isamarkupsection{Type checking% |
|
26 |
} |
|
27 |
\isamarkuptrue% |
|
28 |
% |
|
29 |
\begin{isamarkuptext}% |
|
30 |
The ZF logic is essentially untyped, so the concept of ``type |
|
31 |
checking'' is performed as logical reasoning about set-membership |
|
32 |
statements. A special method assists users in this task; a version |
|
33 |
of this is already declared as a ``solver'' in the standard |
|
34 |
Simplifier setup. |
|
35 |
||
36 |
\begin{matharray}{rcl} |
|
40406 | 37 |
\indexdef{ZF}{command}{print\_tcset}\hypertarget{command.ZF.print-tcset}{\hyperlink{command.ZF.print-tcset}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}tcset}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\ |
28788 | 38 |
\indexdef{ZF}{method}{typecheck}\hypertarget{method.ZF.typecheck}{\hyperlink{method.ZF.typecheck}{\mbox{\isa{typecheck}}}} & : & \isa{method} \\ |
39 |
\indexdef{ZF}{attribute}{TC}\hypertarget{attribute.ZF.TC}{\hyperlink{attribute.ZF.TC}{\mbox{\isa{TC}}}} & : & \isa{attribute} \\ |
|
26845 | 40 |
\end{matharray} |
41 |
||
42 |
\begin{rail} |
|
43 |
'TC' (() | 'add' | 'del') |
|
44 |
; |
|
45 |
\end{rail} |
|
46 |
||
28788 | 47 |
\begin{description} |
26845 | 48 |
|
40406 | 49 |
\item \hyperlink{command.ZF.print-tcset}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}tcset}}}} prints the collection of |
26845 | 50 |
typechecking rules of the current context. |
51 |
||
28788 | 52 |
\item \hyperlink{method.ZF.typecheck}{\mbox{\isa{typecheck}}} attempts to solve any pending |
26845 | 53 |
type-checking problems in subgoals. |
54 |
||
28788 | 55 |
\item \hyperlink{attribute.ZF.TC}{\mbox{\isa{TC}}} adds or deletes type-checking rules from |
56 |
the context. |
|
26845 | 57 |
|
28788 | 58 |
\end{description}% |
26845 | 59 |
\end{isamarkuptext}% |
60 |
\isamarkuptrue% |
|
61 |
% |
|
62 |
\isamarkupsection{(Co)Inductive sets and datatypes% |
|
63 |
} |
|
64 |
\isamarkuptrue% |
|
65 |
% |
|
66 |
\isamarkupsubsection{Set definitions% |
|
67 |
} |
|
68 |
\isamarkuptrue% |
|
69 |
% |
|
70 |
\begin{isamarkuptext}% |
|
71 |
In ZF everything is a set. The generic inductive package also |
|
72 |
provides a specific view for ``datatype'' specifications. |
|
73 |
Coinductive definitions are available in both cases, too. |
|
74 |
||
75 |
\begin{matharray}{rcl} |
|
40406 | 76 |
\indexdef{ZF}{command}{inductive}\hypertarget{command.ZF.inductive}{\hyperlink{command.ZF.inductive}{\mbox{\isa{\isacommand{inductive}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\ |
77 |
\indexdef{ZF}{command}{coinductive}\hypertarget{command.ZF.coinductive}{\hyperlink{command.ZF.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\ |
|
78 |
\indexdef{ZF}{command}{datatype}\hypertarget{command.ZF.datatype}{\hyperlink{command.ZF.datatype}{\mbox{\isa{\isacommand{datatype}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\ |
|
79 |
\indexdef{ZF}{command}{codatatype}\hypertarget{command.ZF.codatatype}{\hyperlink{command.ZF.codatatype}{\mbox{\isa{\isacommand{codatatype}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\ |
|
26845 | 80 |
\end{matharray} |
81 |
||
82 |
\begin{rail} |
|
83 |
('inductive' | 'coinductive') domains intros hints |
|
84 |
; |
|
85 |
||
86 |
domains: 'domains' (term + '+') ('<=' | subseteq) term |
|
87 |
; |
|
88 |
intros: 'intros' (thmdecl? prop +) |
|
89 |
; |
|
90 |
hints: monos? condefs? typeintros? typeelims? |
|
91 |
; |
|
92 |
monos: ('monos' thmrefs)? |
|
93 |
; |
|
40255
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
wenzelm
parents:
30172
diff
changeset
|
94 |
condefs: ('con_defs' thmrefs)? |
26845 | 95 |
; |
40255
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
wenzelm
parents:
30172
diff
changeset
|
96 |
typeintros: ('type_intros' thmrefs)? |
26845 | 97 |
; |
40255
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
wenzelm
parents:
30172
diff
changeset
|
98 |
typeelims: ('type_elims' thmrefs)? |
26845 | 99 |
; |
100 |
\end{rail} |
|
101 |
||
40406 | 102 |
In the following syntax specification \isa{{\isaliteral{22}{\isachardoublequote}}monos{\isaliteral{22}{\isachardoublequote}}}, \isa{typeintros}, and \isa{typeelims} are the same as above. |
26845 | 103 |
|
104 |
\begin{rail} |
|
105 |
('datatype' | 'codatatype') domain? (dtspec + 'and') hints |
|
106 |
; |
|
107 |
||
108 |
domain: ('<=' | subseteq) term |
|
109 |
; |
|
110 |
dtspec: term '=' (con + '|') |
|
111 |
; |
|
112 |
con: name ('(' (term ',' +) ')')? |
|
113 |
; |
|
114 |
hints: monos? typeintros? typeelims? |
|
115 |
; |
|
116 |
\end{rail} |
|
117 |
||
118 |
See \cite{isabelle-ZF} for further information on inductive |
|
119 |
definitions in ZF, but note that this covers the old-style theory |
|
120 |
format.% |
|
121 |
\end{isamarkuptext}% |
|
122 |
\isamarkuptrue% |
|
123 |
% |
|
124 |
\isamarkupsubsection{Primitive recursive functions% |
|
125 |
} |
|
126 |
\isamarkuptrue% |
|
127 |
% |
|
128 |
\begin{isamarkuptext}% |
|
129 |
\begin{matharray}{rcl} |
|
40406 | 130 |
\indexdef{ZF}{command}{primrec}\hypertarget{command.ZF.primrec}{\hyperlink{command.ZF.primrec}{\mbox{\isa{\isacommand{primrec}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\ |
26845 | 131 |
\end{matharray} |
132 |
||
133 |
\begin{rail} |
|
134 |
'primrec' (thmdecl? prop +) |
|
135 |
; |
|
136 |
\end{rail}% |
|
137 |
\end{isamarkuptext}% |
|
138 |
\isamarkuptrue% |
|
139 |
% |
|
140 |
\isamarkupsubsection{Cases and induction: emulating tactic scripts% |
|
141 |
} |
|
142 |
\isamarkuptrue% |
|
143 |
% |
|
144 |
\begin{isamarkuptext}% |
|
145 |
The following important tactical tools of Isabelle/ZF have been |
|
146 |
ported to Isar. These should not be used in proper proof texts. |
|
147 |
||
148 |
\begin{matharray}{rcl} |
|
40406 | 149 |
\indexdef{ZF}{method}{case\_tac}\hypertarget{method.ZF.case-tac}{\hyperlink{method.ZF.case-tac}{\mbox{\isa{case{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\ |
150 |
\indexdef{ZF}{method}{induct\_tac}\hypertarget{method.ZF.induct-tac}{\hyperlink{method.ZF.induct-tac}{\mbox{\isa{induct{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\ |
|
151 |
\indexdef{ZF}{method}{ind\_cases}\hypertarget{method.ZF.ind-cases}{\hyperlink{method.ZF.ind-cases}{\mbox{\isa{ind{\isaliteral{5F}{\isacharunderscore}}cases}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\ |
|
152 |
\indexdef{ZF}{command}{inductive\_cases}\hypertarget{command.ZF.inductive-cases}{\hyperlink{command.ZF.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}cases}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\ |
|
26845 | 153 |
\end{matharray} |
154 |
||
155 |
\begin{rail} |
|
40255
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
wenzelm
parents:
30172
diff
changeset
|
156 |
('case_tac' | 'induct_tac') goalspec? name |
26845 | 157 |
; |
158 |
indcases (prop +) |
|
159 |
; |
|
160 |
inductivecases (thmdecl? (prop +) + 'and') |
|
161 |
; |
|
162 |
\end{rail}% |
|
163 |
\end{isamarkuptext}% |
|
164 |
\isamarkuptrue% |
|
165 |
% |
|
166 |
\isadelimtheory |
|
167 |
% |
|
168 |
\endisadelimtheory |
|
169 |
% |
|
170 |
\isatagtheory |
|
26840 | 171 |
\isacommand{end}\isamarkupfalse% |
172 |
% |
|
173 |
\endisatagtheory |
|
174 |
{\isafoldtheory}% |
|
175 |
% |
|
176 |
\isadelimtheory |
|
177 |
% |
|
178 |
\endisadelimtheory |
|
26845 | 179 |
\isanewline |
26840 | 180 |
\end{isabellebody}% |
181 |
%%% Local Variables: |
|
182 |
%%% mode: latex |
|
183 |
%%% TeX-master: "root" |
|
184 |
%%% End: |