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