18537
|
1 |
%
|
|
2 |
\begin{isabellebody}%
|
|
3 |
\def\isabellecontext{logic}%
|
|
4 |
%
|
|
5 |
\isadelimtheory
|
|
6 |
\isanewline
|
|
7 |
\isanewline
|
|
8 |
\isanewline
|
|
9 |
%
|
|
10 |
\endisadelimtheory
|
|
11 |
%
|
|
12 |
\isatagtheory
|
|
13 |
\isacommand{theory}\isamarkupfalse%
|
|
14 |
\ logic\ \isakeyword{imports}\ base\ \isakeyword{begin}%
|
|
15 |
\endisatagtheory
|
|
16 |
{\isafoldtheory}%
|
|
17 |
%
|
|
18 |
\isadelimtheory
|
|
19 |
%
|
|
20 |
\endisadelimtheory
|
|
21 |
%
|
20471
|
22 |
\isamarkupchapter{Primitive logic \label{ch:logic}%
|
18537
|
23 |
}
|
|
24 |
\isamarkuptrue%
|
|
25 |
%
|
20481
|
26 |
\begin{isamarkuptext}%
|
|
27 |
The logical foundations of Isabelle/Isar are that of the Pure logic,
|
|
28 |
which has been introduced as a natural-deduction framework in
|
20493
|
29 |
\cite{paulson700}. This is essentially the same logic as ``\isa{{\isasymlambda}HOL}'' in the more abstract setting of Pure Type Systems (PTS)
|
20481
|
30 |
\cite{Barendregt-Geuvers:2001}, although there are some key
|
20491
|
31 |
differences in the specific treatment of simple types in
|
|
32 |
Isabelle/Pure.
|
20481
|
33 |
|
|
34 |
Following type-theoretic parlance, the Pure logic consists of three
|
|
35 |
levels of \isa{{\isasymlambda}}-calculus with corresponding arrows: \isa{{\isasymRightarrow}} for syntactic function space (terms depending on terms), \isa{{\isasymAnd}} for universal quantification (proofs depending on terms), and
|
|
36 |
\isa{{\isasymLongrightarrow}} for implication (proofs depending on proofs).
|
|
37 |
|
|
38 |
Pure derivations are relative to a logical theory, which declares
|
20491
|
39 |
type constructors, term constants, and axioms. Theory declarations
|
|
40 |
support schematic polymorphism, which is strictly speaking outside
|
|
41 |
the logic.\footnote{Incidently, this is the main logical reason, why
|
|
42 |
the theory context \isa{{\isasymTheta}} is separate from the context \isa{{\isasymGamma}} of the core calculus.}%
|
20481
|
43 |
\end{isamarkuptext}%
|
|
44 |
\isamarkuptrue%
|
|
45 |
%
|
20451
|
46 |
\isamarkupsection{Types \label{sec:types}%
|
18537
|
47 |
}
|
|
48 |
\isamarkuptrue%
|
|
49 |
%
|
|
50 |
\begin{isamarkuptext}%
|
20481
|
51 |
The language of types is an uninterpreted order-sorted first-order
|
|
52 |
algebra; types are qualified by ordered type classes.
|
20451
|
53 |
|
20481
|
54 |
\medskip A \emph{type class} is an abstract syntactic entity
|
|
55 |
declared in the theory context. The \emph{subclass relation} \isa{c\isactrlisub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlisub {\isadigit{2}}} is specified by stating an acyclic
|
20491
|
56 |
generating relation; the transitive closure is maintained
|
|
57 |
internally. The resulting relation is an ordering: reflexive,
|
|
58 |
transitive, and antisymmetric.
|
20451
|
59 |
|
20481
|
60 |
A \emph{sort} is a list of type classes written as \isa{{\isacharbraceleft}c\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlisub m{\isacharbraceright}}, which represents symbolic
|
|
61 |
intersection. Notationally, the curly braces are omitted for
|
|
62 |
singleton intersections, i.e.\ any class \isa{c} may be read as
|
|
63 |
a sort \isa{{\isacharbraceleft}c{\isacharbraceright}}. The ordering on type classes is extended to
|
20491
|
64 |
sorts according to the meaning of intersections: \isa{{\isacharbraceleft}c\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}\ c\isactrlisub m{\isacharbraceright}\ {\isasymsubseteq}\ {\isacharbraceleft}d\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ d\isactrlisub n{\isacharbraceright}} iff
|
|
65 |
\isa{{\isasymforall}j{\isachardot}\ {\isasymexists}i{\isachardot}\ c\isactrlisub i\ {\isasymsubseteq}\ d\isactrlisub j}. The empty intersection
|
|
66 |
\isa{{\isacharbraceleft}{\isacharbraceright}} refers to the universal sort, which is the largest
|
|
67 |
element wrt.\ the sort order. The intersections of all (finitely
|
|
68 |
many) classes declared in the current theory are the minimal
|
|
69 |
elements wrt.\ the sort order.
|
20451
|
70 |
|
20491
|
71 |
\medskip A \emph{fixed type variable} is a pair of a basic name
|
20493
|
72 |
(starting with a \isa{{\isacharprime}} character) and a sort constraint. For
|
20481
|
73 |
example, \isa{{\isacharparenleft}{\isacharprime}a{\isacharcomma}\ s{\isacharparenright}} which is usually printed as \isa{{\isasymalpha}\isactrlisub s}. A \emph{schematic type variable} is a pair of an
|
20491
|
74 |
indexname and a sort constraint. For example, \isa{{\isacharparenleft}{\isacharparenleft}{\isacharprime}a{\isacharcomma}\ {\isadigit{0}}{\isacharparenright}{\isacharcomma}\ s{\isacharparenright}} which is usually printed as \isa{{\isacharquery}{\isasymalpha}\isactrlisub s}.
|
20481
|
75 |
|
|
76 |
Note that \emph{all} syntactic components contribute to the identity
|
20493
|
77 |
of type variables, including the sort constraint. The core logic
|
|
78 |
handles type variables with the same name but different sorts as
|
|
79 |
different, although some outer layers of the system make it hard to
|
|
80 |
produce anything like this.
|
18537
|
81 |
|
20493
|
82 |
A \emph{type constructor} \isa{{\isasymkappa}} is a \isa{k}-ary operator
|
|
83 |
on types declared in the theory. Type constructor application is
|
|
84 |
usually written postfix as \isa{{\isacharparenleft}FIXME{\isacharparenright}{\isasymkappa}}. For \isa{k\ {\isacharequal}\ {\isadigit{0}}}
|
|
85 |
the argument tuple is omitted, e.g.\ \isa{prop} instead of
|
|
86 |
\isa{{\isacharparenleft}{\isacharparenright}prop}. For \isa{k\ {\isacharequal}\ {\isadigit{1}}} the parentheses are omitted,
|
|
87 |
e.g.\ \isa{{\isasymalpha}\ list} instead of \isa{{\isacharparenleft}{\isasymalpha}{\isacharparenright}list}. Further
|
|
88 |
notation is provided for specific constructors, notably
|
|
89 |
right-associative infix \isa{{\isasymalpha}\ {\isasymRightarrow}\ {\isasymbeta}} instead of \isa{{\isacharparenleft}{\isasymalpha}{\isacharcomma}\ {\isasymbeta}{\isacharparenright}fun} constructor.
|
20481
|
90 |
|
|
91 |
A \emph{type} is defined inductively over type variables and type
|
20491
|
92 |
constructors as follows: \isa{{\isasymtau}\ {\isacharequal}\ {\isasymalpha}\isactrlisub s\ {\isacharbar}\ {\isacharquery}{\isasymalpha}\isactrlisub s\ {\isacharbar}\ {\isacharparenleft}{\isasymtau}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymtau}\isactrlsub k{\isacharparenright}c}.
|
20451
|
93 |
|
20481
|
94 |
A \emph{type abbreviation} is a syntactic abbreviation of an
|
|
95 |
arbitrary type expression of the theory. Type abbreviations looks
|
|
96 |
like type constructors at the surface, but are expanded before the
|
|
97 |
core logic encounters them.
|
20451
|
98 |
|
20481
|
99 |
A \emph{type arity} declares the image behavior of a type
|
20491
|
100 |
constructor wrt.\ the algebra of sorts: \isa{c\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}s\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ s\isactrlisub k{\isacharparenright}s} means that \isa{{\isacharparenleft}{\isasymtau}\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymtau}\isactrlisub k{\isacharparenright}c} is
|
20481
|
101 |
of sort \isa{s} if each argument type \isa{{\isasymtau}\isactrlisub i} is of
|
20491
|
102 |
sort \isa{s\isactrlisub i}. Arity declarations are implicitly
|
|
103 |
completed, i.e.\ \isa{c\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s{\isacharparenright}c} entails \isa{c\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s{\isacharparenright}c{\isacharprime}} for any \isa{c{\isacharprime}\ {\isasymsupseteq}\ c}.
|
20451
|
104 |
|
20491
|
105 |
\medskip The sort algebra is always maintained as \emph{coregular},
|
|
106 |
which means that type arities are consistent with the subclass
|
|
107 |
relation: for each type constructor \isa{c} and classes \isa{c\isactrlisub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlisub {\isadigit{2}}}, any arity \isa{c\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s\isactrlisub {\isadigit{1}}{\isacharparenright}c\isactrlisub {\isadigit{1}}} has a corresponding arity \isa{c\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s\isactrlisub {\isadigit{2}}{\isacharparenright}c\isactrlisub {\isadigit{2}}} where \isa{\isactrlvec s\isactrlisub {\isadigit{1}}\ {\isasymsubseteq}\ \isactrlvec s\isactrlisub {\isadigit{2}}} holds pointwise for all argument sorts.
|
|
108 |
|
|
109 |
The key property of a coregular order-sorted algebra is that sort
|
20481
|
110 |
constraints may be always fulfilled in a most general fashion: for
|
|
111 |
each type constructor \isa{c} and sort \isa{s} there is a
|
20491
|
112 |
most general vector of argument sorts \isa{{\isacharparenleft}s\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ s\isactrlisub k{\isacharparenright}} such that a type scheme \isa{{\isacharparenleft}{\isasymalpha}\isactrlbsub s\isactrlisub {\isadigit{1}}\isactrlesub {\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlbsub s\isactrlisub k\isactrlesub {\isacharparenright}c} is
|
|
113 |
of sort \isa{s}. Consequently, the unification problem on the
|
|
114 |
algebra of types has most general solutions (modulo renaming and
|
|
115 |
equivalence of sorts). Moreover, the usual type-inference algorithm
|
|
116 |
will produce primary types as expected \cite{nipkow-prehofer}.%
|
18537
|
117 |
\end{isamarkuptext}%
|
|
118 |
\isamarkuptrue%
|
|
119 |
%
|
20481
|
120 |
\isadelimmlref
|
|
121 |
%
|
|
122 |
\endisadelimmlref
|
|
123 |
%
|
|
124 |
\isatagmlref
|
|
125 |
%
|
|
126 |
\begin{isamarkuptext}%
|
|
127 |
\begin{mldecls}
|
|
128 |
\indexmltype{class}\verb|type class| \\
|
|
129 |
\indexmltype{sort}\verb|type sort| \\
|
|
130 |
\indexmltype{typ}\verb|type typ| \\
|
|
131 |
\indexmltype{arity}\verb|type arity| \\
|
|
132 |
\indexml{Sign.subsort}\verb|Sign.subsort: theory -> sort * sort -> bool| \\
|
|
133 |
\indexml{Sign.of-sort}\verb|Sign.of_sort: theory -> typ * sort -> bool| \\
|
|
134 |
\indexml{Sign.add-types}\verb|Sign.add_types: (bstring * int * mixfix) list -> theory -> theory| \\
|
|
135 |
\indexml{Sign.add-tyabbrs-i}\verb|Sign.add_tyabbrs_i: |\isasep\isanewline%
|
|
136 |
\verb| (bstring * string list * typ * mixfix) list -> theory -> theory| \\
|
|
137 |
\indexml{Sign.primitive-class}\verb|Sign.primitive_class: string * class list -> theory -> theory| \\
|
|
138 |
\indexml{Sign.primitive-classrel}\verb|Sign.primitive_classrel: class * class -> theory -> theory| \\
|
|
139 |
\indexml{Sign.primitive-arity}\verb|Sign.primitive_arity: arity -> theory -> theory| \\
|
|
140 |
\end{mldecls}
|
|
141 |
|
|
142 |
\begin{description}
|
|
143 |
|
|
144 |
\item \verb|class| represents type classes; this is an alias for
|
|
145 |
\verb|string|.
|
|
146 |
|
|
147 |
\item \verb|sort| represents sorts; this is an alias for
|
|
148 |
\verb|class list|.
|
|
149 |
|
|
150 |
\item \verb|arity| represents type arities; this is an alias for
|
|
151 |
triples of the form \isa{{\isacharparenleft}c{\isacharcomma}\ \isactrlvec s{\isacharcomma}\ s{\isacharparenright}} for \isa{c\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s{\isacharparenright}s} described above.
|
|
152 |
|
|
153 |
\item \verb|typ| represents types; this is a datatype with
|
|
154 |
constructors \verb|TFree|, \verb|TVar|, \verb|Type|.
|
|
155 |
|
|
156 |
\item \verb|Sign.subsort|~\isa{thy\ {\isacharparenleft}s\isactrlisub {\isadigit{1}}{\isacharcomma}\ s\isactrlisub {\isadigit{2}}{\isacharparenright}}
|
|
157 |
tests the subsort relation \isa{s\isactrlisub {\isadigit{1}}\ {\isasymsubseteq}\ s\isactrlisub {\isadigit{2}}}.
|
|
158 |
|
|
159 |
\item \verb|Sign.of_sort|~\isa{thy\ {\isacharparenleft}{\isasymtau}{\isacharcomma}\ s{\isacharparenright}} tests whether a type
|
20491
|
160 |
is of a given sort.
|
20481
|
161 |
|
|
162 |
\item \verb|Sign.add_types|~\isa{{\isacharbrackleft}{\isacharparenleft}c{\isacharcomma}\ k{\isacharcomma}\ mx{\isacharparenright}{\isacharcomma}\ {\isasymdots}{\isacharbrackright}} declares new
|
20491
|
163 |
type constructors \isa{c} with \isa{k} arguments and
|
20481
|
164 |
optional mixfix syntax.
|
|
165 |
|
|
166 |
\item \verb|Sign.add_tyabbrs_i|~\isa{{\isacharbrackleft}{\isacharparenleft}c{\isacharcomma}\ \isactrlvec {\isasymalpha}{\isacharcomma}\ {\isasymtau}{\isacharcomma}\ mx{\isacharparenright}{\isacharcomma}\ {\isasymdots}{\isacharbrackright}}
|
20491
|
167 |
defines a new type abbreviation \isa{{\isacharparenleft}\isactrlvec {\isasymalpha}{\isacharparenright}c\ {\isacharequal}\ {\isasymtau}} with
|
|
168 |
optional mixfix syntax.
|
20481
|
169 |
|
|
170 |
\item \verb|Sign.primitive_class|~\isa{{\isacharparenleft}c{\isacharcomma}\ {\isacharbrackleft}c\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ c\isactrlisub n{\isacharbrackright}{\isacharparenright}} declares new class \isa{c} derived together with
|
20491
|
171 |
class relations \isa{c\ {\isasymsubseteq}\ c\isactrlisub i}, for \isa{i\ {\isacharequal}\ {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ n}.
|
20481
|
172 |
|
|
173 |
\item \verb|Sign.primitive_classrel|~\isa{{\isacharparenleft}c\isactrlisub {\isadigit{1}}{\isacharcomma}\ c\isactrlisub {\isadigit{2}}{\isacharparenright}} declares class relation \isa{c\isactrlisub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlisub {\isadigit{2}}}.
|
|
174 |
|
|
175 |
\item \verb|Sign.primitive_arity|~\isa{{\isacharparenleft}c{\isacharcomma}\ \isactrlvec s{\isacharcomma}\ s{\isacharparenright}} declares
|
|
176 |
arity \isa{c\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}\isactrlvec s{\isacharparenright}s}.
|
|
177 |
|
|
178 |
\end{description}%
|
|
179 |
\end{isamarkuptext}%
|
|
180 |
\isamarkuptrue%
|
|
181 |
%
|
|
182 |
\endisatagmlref
|
|
183 |
{\isafoldmlref}%
|
|
184 |
%
|
|
185 |
\isadelimmlref
|
|
186 |
%
|
|
187 |
\endisadelimmlref
|
|
188 |
%
|
20451
|
189 |
\isamarkupsection{Terms \label{sec:terms}%
|
18537
|
190 |
}
|
|
191 |
\isamarkuptrue%
|
|
192 |
%
|
|
193 |
\begin{isamarkuptext}%
|
20451
|
194 |
\glossary{Term}{FIXME}
|
18537
|
195 |
|
20491
|
196 |
The language of terms is that of simply-typed \isa{{\isasymlambda}}-calculus
|
|
197 |
with de-Bruijn indices for bound variables, and named free
|
|
198 |
variables, and constants. Terms with loose bound variables are
|
|
199 |
usually considered malformed. The types of variables and constants
|
|
200 |
is stored explicitly at each occurrence in the term (which is a
|
|
201 |
known performance issue).
|
|
202 |
|
20481
|
203 |
FIXME de-Bruijn representation of lambda terms
|
|
204 |
|
|
205 |
Term syntax provides explicit abstraction \isa{{\isasymlambda}x\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}{\isachardot}\ b{\isacharparenleft}x{\isacharparenright}}
|
|
206 |
and application \isa{t\ u}, while types are usually implicit
|
|
207 |
thanks to type-inference.
|
|
208 |
|
|
209 |
Terms of type \isa{prop} are called
|
|
210 |
propositions. Logical statements are composed via \isa{{\isasymAnd}x\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}{\isachardot}\ B{\isacharparenleft}x{\isacharparenright}} and \isa{A\ {\isasymLongrightarrow}\ B}.%
|
18537
|
211 |
\end{isamarkuptext}%
|
|
212 |
\isamarkuptrue%
|
|
213 |
%
|
|
214 |
\begin{isamarkuptext}%
|
|
215 |
FIXME
|
|
216 |
|
|
217 |
\glossary{Schematic polymorphism}{FIXME}
|
|
218 |
|
|
219 |
\glossary{Type variable}{FIXME}%
|
|
220 |
\end{isamarkuptext}%
|
|
221 |
\isamarkuptrue%
|
|
222 |
%
|
20451
|
223 |
\isamarkupsection{Theorems \label{sec:thms}%
|
18537
|
224 |
}
|
|
225 |
\isamarkuptrue%
|
|
226 |
%
|
|
227 |
\begin{isamarkuptext}%
|
20481
|
228 |
Primitive reasoning operates on judgments of the form \isa{{\isasymGamma}\ {\isasymturnstile}\ {\isasymphi}}, with standard introduction and elimination rules for \isa{{\isasymAnd}} and \isa{{\isasymLongrightarrow}} that refer to fixed parameters \isa{x} and
|
|
229 |
hypotheses \isa{A} from the context \isa{{\isasymGamma}}. The
|
|
230 |
corresponding proof terms are left implicit in the classic
|
|
231 |
``LCF-approach'', although they could be exploited separately
|
|
232 |
\cite{Berghofer-Nipkow:2000}.
|
|
233 |
|
|
234 |
The framework also provides definitional equality \isa{{\isasymequiv}\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}\ {\isasymRightarrow}\ {\isasymalpha}\ {\isasymRightarrow}\ prop}, with \isa{{\isasymalpha}{\isasymbeta}{\isasymeta}}-conversion rules. The internal
|
|
235 |
conjunction \isa{{\isacharampersand}\ {\isacharcolon}{\isacharcolon}\ prop\ {\isasymRightarrow}\ prop\ {\isasymRightarrow}\ prop} enables the view of
|
|
236 |
assumptions and conclusions emerging uniformly as simultaneous
|
|
237 |
statements.
|
|
238 |
|
|
239 |
|
|
240 |
|
|
241 |
FIXME
|
18537
|
242 |
|
|
243 |
\glossary{Proposition}{A \seeglossary{term} of \seeglossary{type}
|
|
244 |
\isa{prop}. Internally, there is nothing special about
|
|
245 |
propositions apart from their type, but the concrete syntax enforces a
|
|
246 |
clear distinction. Propositions are structured via implication \isa{A\ {\isasymLongrightarrow}\ B} or universal quantification \isa{{\isasymAnd}x{\isachardot}\ B\ x} --- anything
|
|
247 |
else is considered atomic. The canonical form for propositions is
|
|
248 |
that of a \seeglossary{Hereditary Harrop Formula}.}
|
|
249 |
|
|
250 |
\glossary{Theorem}{A proven proposition within a certain theory and
|
|
251 |
proof context, formally \isa{{\isasymGamma}\ {\isasymturnstile}\isactrlsub {\isasymTheta}\ {\isasymphi}}; both contexts are
|
|
252 |
rarely spelled out explicitly. Theorems are usually normalized
|
|
253 |
according to the \seeglossary{HHF} format.}
|
|
254 |
|
|
255 |
\glossary{Fact}{Sometimes used interchangably for
|
|
256 |
\seeglossary{theorem}. Strictly speaking, a list of theorems,
|
|
257 |
essentially an extra-logical conjunction. Facts emerge either as
|
|
258 |
local assumptions, or as results of local goal statements --- both may
|
|
259 |
be simultaneous, hence the list representation.}
|
|
260 |
|
|
261 |
\glossary{Schematic variable}{FIXME}
|
|
262 |
|
|
263 |
\glossary{Fixed variable}{A variable that is bound within a certain
|
|
264 |
proof context; an arbitrary-but-fixed entity within a portion of proof
|
|
265 |
text.}
|
|
266 |
|
|
267 |
\glossary{Free variable}{Synonymous for \seeglossary{fixed variable}.}
|
|
268 |
|
|
269 |
\glossary{Bound variable}{FIXME}
|
|
270 |
|
|
271 |
\glossary{Variable}{See \seeglossary{schematic variable},
|
|
272 |
\seeglossary{fixed variable}, \seeglossary{bound variable}, or
|
|
273 |
\seeglossary{type variable}. The distinguishing feature of different
|
|
274 |
variables is their binding scope.}%
|
|
275 |
\end{isamarkuptext}%
|
|
276 |
\isamarkuptrue%
|
|
277 |
%
|
20491
|
278 |
\isamarkupsection{Proof terms%
|
18537
|
279 |
}
|
|
280 |
\isamarkuptrue%
|
|
281 |
%
|
|
282 |
\begin{isamarkuptext}%
|
20491
|
283 |
FIXME !?%
|
18537
|
284 |
\end{isamarkuptext}%
|
|
285 |
\isamarkuptrue%
|
|
286 |
%
|
20491
|
287 |
\isamarkupsection{Rules \label{sec:rules}%
|
18537
|
288 |
}
|
|
289 |
\isamarkuptrue%
|
|
290 |
%
|
|
291 |
\begin{isamarkuptext}%
|
|
292 |
FIXME
|
|
293 |
|
20491
|
294 |
A \emph{rule} is any Pure theorem in HHF normal form; there is a
|
|
295 |
separate calculus for rule composition, which is modeled after
|
|
296 |
Gentzen's Natural Deduction \cite{Gentzen:1935}, but allows
|
|
297 |
rules to be nested arbitrarily, similar to \cite{extensions91}.
|
|
298 |
|
|
299 |
Normally, all theorems accessible to the user are proper rules.
|
|
300 |
Low-level inferences are occasional required internally, but the
|
|
301 |
result should be always presented in canonical form. The higher
|
|
302 |
interfaces of Isabelle/Isar will always produce proper rules. It is
|
|
303 |
important to maintain this invariant in add-on applications!
|
|
304 |
|
|
305 |
There are two main principles of rule composition: \isa{resolution} (i.e.\ backchaining of rules) and \isa{by{\isacharminus}assumption} (i.e.\ closing a branch); both principles are
|
|
306 |
combined in the variants of \isa{elim{\isacharminus}resosultion} and \isa{dest{\isacharminus}resolution}. Raw \isa{composition} is occasionally
|
|
307 |
useful as well, also it is strictly speaking outside of the proper
|
|
308 |
rule calculus.
|
|
309 |
|
|
310 |
Rules are treated modulo general higher-order unification, which is
|
|
311 |
unification modulo the equational theory of \isa{{\isasymalpha}{\isasymbeta}{\isasymeta}}-conversion
|
|
312 |
on \isa{{\isasymlambda}}-terms. Moreover, propositions are understood modulo
|
|
313 |
the (derived) equivalence \isa{{\isacharparenleft}A\ {\isasymLongrightarrow}\ {\isacharparenleft}{\isasymAnd}x{\isachardot}\ B\ x{\isacharparenright}{\isacharparenright}\ {\isasymequiv}\ {\isacharparenleft}{\isasymAnd}x{\isachardot}\ A\ {\isasymLongrightarrow}\ B\ x{\isacharparenright}}.
|
|
314 |
|
|
315 |
This means that any operations within the rule calculus may be
|
|
316 |
subject to spontaneous \isa{{\isasymalpha}{\isasymbeta}{\isasymeta}}-HHF conversions. It is common
|
|
317 |
practice not to contract or expand unnecessarily. Some mechanisms
|
|
318 |
prefer an one form, others the opposite, so there is a potential
|
|
319 |
danger to produce some oscillation!
|
|
320 |
|
|
321 |
Only few operations really work \emph{modulo} HHF conversion, but
|
|
322 |
expect a normal form: quantifiers \isa{{\isasymAnd}} before implications
|
|
323 |
\isa{{\isasymLongrightarrow}} at each level of nesting.
|
|
324 |
|
18537
|
325 |
\glossary{Hereditary Harrop Formula}{The set of propositions in HHF
|
|
326 |
format is defined inductively as \isa{H\ {\isacharequal}\ {\isacharparenleft}{\isasymAnd}x\isactrlsup {\isacharasterisk}{\isachardot}\ H\isactrlsup {\isacharasterisk}\ {\isasymLongrightarrow}\ A{\isacharparenright}}, for variables \isa{x} and atomic propositions \isa{A}.
|
|
327 |
Any proposition may be put into HHF form by normalizing with the rule
|
|
328 |
\isa{{\isacharparenleft}A\ {\isasymLongrightarrow}\ {\isacharparenleft}{\isasymAnd}x{\isachardot}\ B\ x{\isacharparenright}{\isacharparenright}\ {\isasymequiv}\ {\isacharparenleft}{\isasymAnd}x{\isachardot}\ A\ {\isasymLongrightarrow}\ B\ x{\isacharparenright}}. In Isabelle, the outermost
|
|
329 |
quantifier prefix is represented via \seeglossary{schematic
|
|
330 |
variables}, such that the top-level structure is merely that of a
|
|
331 |
\seeglossary{Horn Clause}}.
|
|
332 |
|
|
333 |
\glossary{HHF}{See \seeglossary{Hereditary Harrop Formula}.}%
|
|
334 |
\end{isamarkuptext}%
|
|
335 |
\isamarkuptrue%
|
|
336 |
%
|
|
337 |
\isadelimtheory
|
|
338 |
%
|
|
339 |
\endisadelimtheory
|
|
340 |
%
|
|
341 |
\isatagtheory
|
|
342 |
\isacommand{end}\isamarkupfalse%
|
|
343 |
%
|
|
344 |
\endisatagtheory
|
|
345 |
{\isafoldtheory}%
|
|
346 |
%
|
|
347 |
\isadelimtheory
|
|
348 |
%
|
|
349 |
\endisadelimtheory
|
|
350 |
\isanewline
|
|
351 |
\end{isabellebody}%
|
|
352 |
%%% Local Variables:
|
|
353 |
%%% mode: latex
|
|
354 |
%%% TeX-master: "root"
|
|
355 |
%%% End:
|