| author | huffman |
| Tue, 03 Apr 2012 15:15:00 +0200 | |
| changeset 47317 | 432b29a96f61 |
| parent 47174 | b9b2e183e94d |
| child 47498 | e3fc50c7da13 |
| permissions | -rw-r--r-- |
| 30296 | 1 |
% |
2 |
\begin{isabellebody}%
|
|
3 |
\def\isabellecontext{Logic}%
|
|
4 |
% |
|
5 |
\isadelimtheory |
|
6 |
% |
|
7 |
\endisadelimtheory |
|
8 |
% |
|
9 |
\isatagtheory |
|
10 |
\isacommand{theory}\isamarkupfalse%
|
|
11 |
\ Logic\isanewline |
|
12 |
\isakeyword{imports}\ Base\isanewline
|
|
13 |
\isakeyword{begin}%
|
|
14 |
\endisatagtheory |
|
15 |
{\isafoldtheory}%
|
|
16 |
% |
|
17 |
\isadelimtheory |
|
18 |
% |
|
19 |
\endisadelimtheory |
|
20 |
% |
|
21 |
\isamarkupchapter{Primitive logic \label{ch:logic}%
|
|
22 |
} |
|
23 |
\isamarkuptrue% |
|
24 |
% |
|
25 |
\begin{isamarkuptext}%
|
|
26 |
The logical foundations of Isabelle/Isar are that of the Pure logic, |
|
27 |
which has been introduced as a Natural Deduction framework in |
|
| 40406 | 28 |
\cite{paulson700}. This is essentially the same logic as ``\isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}HOL}'' in the more abstract setting of Pure Type Systems (PTS)
|
| 30296 | 29 |
\cite{Barendregt-Geuvers:2001}, although there are some key
|
30 |
differences in the specific treatment of simple types in |
|
31 |
Isabelle/Pure. |
|
32 |
||
33 |
Following type-theoretic parlance, the Pure logic consists of three |
|
| 40406 | 34 |
levels of \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}}-calculus with corresponding arrows, \isa{{\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}} for syntactic function space (terms depending on terms), \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}} for universal quantification (proofs depending on terms), and
|
35 |
\isa{{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}} for implication (proofs depending on proofs).
|
|
| 30296 | 36 |
|
37 |
Derivations are relative to a logical theory, which declares type |
|
38 |
constructors, constants, and axioms. Theory declarations support |
|
39 |
schematic polymorphism, which is strictly speaking outside the |
|
40 |
logic.\footnote{This is the deeper logical reason, why the theory
|
|
| 40406 | 41 |
context \isa{{\isaliteral{5C3C54686574613E}{\isasymTheta}}} is separate from the proof context \isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}}
|
| 35001 | 42 |
of the core calculus: type constructors, term constants, and facts |
43 |
(proof constants) may involve arbitrary type schemes, but the type |
|
44 |
of a locally fixed term parameter is also fixed!}% |
|
| 30296 | 45 |
\end{isamarkuptext}%
|
46 |
\isamarkuptrue% |
|
47 |
% |
|
48 |
\isamarkupsection{Types \label{sec:types}%
|
|
49 |
} |
|
50 |
\isamarkuptrue% |
|
51 |
% |
|
52 |
\begin{isamarkuptext}%
|
|
53 |
The language of types is an uninterpreted order-sorted first-order |
|
54 |
algebra; types are qualified by ordered type classes. |
|
55 |
||
56 |
\medskip A \emph{type class} is an abstract syntactic entity
|
|
| 40406 | 57 |
declared in the theory context. The \emph{subclass relation} \isa{c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}} is specified by stating an acyclic
|
| 30296 | 58 |
generating relation; the transitive closure is maintained |
59 |
internally. The resulting relation is an ordering: reflexive, |
|
60 |
transitive, and antisymmetric. |
|
61 |
||
| 40406 | 62 |
A \emph{sort} is a list of type classes written as \isa{s\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{7B}{\isacharbraceleft}}c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub m{\isaliteral{7D}{\isacharbraceright}}}, it represents symbolic intersection. Notationally, the
|
| 35001 | 63 |
curly braces are omitted for singleton intersections, i.e.\ any |
| 40406 | 64 |
class \isa{c} may be read as a sort \isa{{\isaliteral{7B}{\isacharbraceleft}}c{\isaliteral{7D}{\isacharbraceright}}}. The ordering
|
| 35001 | 65 |
on type classes is extended to sorts according to the meaning of |
| 40406 | 66 |
intersections: \isa{{\isaliteral{7B}{\isacharbraceleft}}c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub m{\isaliteral{7D}{\isacharbraceright}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ {\isaliteral{7B}{\isacharbraceleft}}d\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ d\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{7D}{\isacharbraceright}}} iff \isa{{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}j{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C6578697374733E}{\isasymexists}}i{\isaliteral{2E}{\isachardot}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub i\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ d\isaliteral{5C3C5E697375623E}{}\isactrlisub j}. The empty intersection \isa{{\isaliteral{7B}{\isacharbraceleft}}{\isaliteral{7D}{\isacharbraceright}}} refers to
|
| 35001 | 67 |
the universal sort, which is the largest element wrt.\ the sort |
| 40406 | 68 |
order. Thus \isa{{\isaliteral{7B}{\isacharbraceleft}}{\isaliteral{7D}{\isacharbraceright}}} represents the ``full sort'', not the
|
| 35001 | 69 |
empty one! The intersection of all (finitely many) classes declared |
70 |
in the current theory is the least element wrt.\ the sort ordering. |
|
| 30296 | 71 |
|
72 |
\medskip A \emph{fixed type variable} is a pair of a basic name
|
|
| 40406 | 73 |
(starting with a \isa{{\isaliteral{27}{\isacharprime}}} character) and a sort constraint, e.g.\
|
74 |
\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ s{\isaliteral{29}{\isacharparenright}}} which is usually printed as \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub s}.
|
|
| 30296 | 75 |
A \emph{schematic type variable} is a pair of an indexname and a
|
| 40406 | 76 |
sort constraint, e.g.\ \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\ s{\isaliteral{29}{\isacharparenright}}} which is usually
|
77 |
printed as \isa{{\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub s}.
|
|
| 30296 | 78 |
|
79 |
Note that \emph{all} syntactic components contribute to the identity
|
|
| 35001 | 80 |
of type variables: basic name, index, and sort constraint. The core |
81 |
logic handles type variables with the same name but different sorts |
|
82 |
as different, although the type-inference layer (which is outside |
|
83 |
the core) rejects anything like that. |
|
| 30296 | 84 |
|
| 40406 | 85 |
A \emph{type constructor} \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}} is a \isa{k}-ary operator
|
| 30296 | 86 |
on types declared in the theory. Type constructor application is |
| 40406 | 87 |
written postfix as \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub k{\isaliteral{29}{\isacharparenright}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}}. For
|
88 |
\isa{k\ {\isaliteral{3D}{\isacharequal}}\ {\isadigit{0}}} the argument tuple is omitted, e.g.\ \isa{prop}
|
|
89 |
instead of \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{29}{\isacharparenright}}prop}. For \isa{k\ {\isaliteral{3D}{\isacharequal}}\ {\isadigit{1}}} the parentheses
|
|
90 |
are omitted, e.g.\ \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ list} instead of \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{29}{\isacharparenright}}list}.
|
|
| 30296 | 91 |
Further notation is provided for specific constructors, notably the |
| 40406 | 92 |
right-associative infix \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}} instead of \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}{\isaliteral{29}{\isacharparenright}}fun}.
|
| 30296 | 93 |
|
| 35001 | 94 |
The logical category \emph{type} is defined inductively over type
|
| 40406 | 95 |
variables and type constructors as follows: \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub s\ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub s\ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E7375623E}{}\isactrlsub k{\isaliteral{29}{\isacharparenright}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}}.
|
| 30296 | 96 |
|
| 40406 | 97 |
A \emph{type abbreviation} is a syntactic definition \isa{{\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}} of an arbitrary type expression \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} over
|
98 |
variables \isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}}. Type abbreviations appear as type
|
|
| 30296 | 99 |
constructors in the syntax, but are expanded before entering the |
100 |
logical core. |
|
101 |
||
102 |
A \emph{type arity} declares the image behavior of a type
|
|
| 40406 | 103 |
constructor wrt.\ the algebra of sorts: \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ s\isaliteral{5C3C5E697375623E}{}\isactrlisub k{\isaliteral{29}{\isacharparenright}}s} means that \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub k{\isaliteral{29}{\isacharparenright}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}} is
|
104 |
of sort \isa{s} if every argument type \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub i} is
|
|
105 |
of sort \isa{s\isaliteral{5C3C5E697375623E}{}\isactrlisub i}. Arity declarations are implicitly
|
|
106 |
completed, i.e.\ \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s{\isaliteral{29}{\isacharparenright}}c} entails \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s{\isaliteral{29}{\isacharparenright}}c{\isaliteral{27}{\isacharprime}}} for any \isa{c{\isaliteral{27}{\isacharprime}}\ {\isaliteral{5C3C73757073657465713E}{\isasymsupseteq}}\ c}.
|
|
| 30296 | 107 |
|
108 |
\medskip The sort algebra is always maintained as \emph{coregular},
|
|
109 |
which means that type arities are consistent with the subclass |
|
| 40406 | 110 |
relation: for any type constructor \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}}, and classes \isa{c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}}, and arities \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{29}{\isacharparenright}}c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}} and \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}} holds \isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}} component-wise.
|
| 30296 | 111 |
|
112 |
The key property of a coregular order-sorted algebra is that sort |
|
113 |
constraints can be solved in a most general fashion: for each type |
|
| 40406 | 114 |
constructor \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}} and sort \isa{s} there is a most general
|
115 |
vector of argument sorts \isa{{\isaliteral{28}{\isacharparenleft}}s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ s\isaliteral{5C3C5E697375623E}{}\isactrlisub k{\isaliteral{29}{\isacharparenright}}} such
|
|
116 |
that a type scheme \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E627375623E}{}\isactrlbsub s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\isaliteral{5C3C5E657375623E}{}\isactrlesub {\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E627375623E}{}\isactrlbsub s\isaliteral{5C3C5E697375623E}{}\isactrlisub k\isaliteral{5C3C5E657375623E}{}\isactrlesub {\isaliteral{29}{\isacharparenright}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}} is of sort \isa{s}.
|
|
| 30296 | 117 |
Consequently, type unification has most general solutions (modulo |
118 |
equivalence of sorts), so type-inference produces primary types as |
|
119 |
expected \cite{nipkow-prehofer}.%
|
|
120 |
\end{isamarkuptext}%
|
|
121 |
\isamarkuptrue% |
|
122 |
% |
|
123 |
\isadelimmlref |
|
124 |
% |
|
125 |
\endisadelimmlref |
|
126 |
% |
|
127 |
\isatagmlref |
|
128 |
% |
|
129 |
\begin{isamarkuptext}%
|
|
130 |
\begin{mldecls}
|
|
| 35001 | 131 |
\indexdef{}{ML type}{class}\verb|type class = string| \\
|
132 |
\indexdef{}{ML type}{sort}\verb|type sort = class list| \\
|
|
133 |
\indexdef{}{ML type}{arity}\verb|type arity = string * sort list * sort| \\
|
|
| 30296 | 134 |
\indexdef{}{ML type}{typ}\verb|type typ| \\
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
135 |
\indexdef{}{ML}{Term.map\_atyps}\verb|Term.map_atyps: (typ -> typ) -> typ -> typ| \\
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
136 |
\indexdef{}{ML}{Term.fold\_atyps}\verb|Term.fold_atyps: (typ -> 'a -> 'a) -> typ -> 'a -> 'a| \\
|
| 30296 | 137 |
\end{mldecls}
|
138 |
\begin{mldecls}
|
|
139 |
\indexdef{}{ML}{Sign.subsort}\verb|Sign.subsort: theory -> sort * sort -> bool| \\
|
|
140 |
\indexdef{}{ML}{Sign.of\_sort}\verb|Sign.of_sort: theory -> typ * sort -> bool| \\
|
|
| 47174 | 141 |
\indexdef{}{ML}{Sign.add\_type}\verb|Sign.add_type: Proof.context -> binding * int * mixfix -> theory -> theory| \\
|
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
142 |
\indexdef{}{ML}{Sign.add\_type\_abbrev}\verb|Sign.add_type_abbrev: Proof.context ->|\isasep\isanewline%
|
|
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
143 |
\verb| binding * string list * typ -> theory -> theory| \\ |
| 30355 | 144 |
\indexdef{}{ML}{Sign.primitive\_class}\verb|Sign.primitive_class: binding * class list -> theory -> theory| \\
|
| 30296 | 145 |
\indexdef{}{ML}{Sign.primitive\_classrel}\verb|Sign.primitive_classrel: class * class -> theory -> theory| \\
|
146 |
\indexdef{}{ML}{Sign.primitive\_arity}\verb|Sign.primitive_arity: arity -> theory -> theory| \\
|
|
147 |
\end{mldecls}
|
|
148 |
||
149 |
\begin{description}
|
|
150 |
||
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
151 |
\item Type \verb|class| represents type classes. |
| 30296 | 152 |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
153 |
\item Type \verb|sort| represents sorts, i.e.\ finite |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
154 |
intersections of classes. The empty list \verb|[]: sort| refers to |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
155 |
the empty class intersection, i.e.\ the ``full sort''. |
| 30296 | 156 |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
157 |
\item Type \verb|arity| represents type arities. A triple |
| 40406 | 158 |
\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec s{\isaliteral{2C}{\isacharcomma}}\ s{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3A}{\isacharcolon}}\ arity} represents \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s{\isaliteral{29}{\isacharparenright}}s} as described above.
|
| 30296 | 159 |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
160 |
\item Type \verb|typ| represents types; this is a datatype with |
| 30296 | 161 |
constructors \verb|TFree|, \verb|TVar|, \verb|Type|. |
162 |
||
| 40406 | 163 |
\item \verb|Term.map_atyps|~\isa{f\ {\isaliteral{5C3C7461753E}{\isasymtau}}} applies the mapping \isa{f} to all atomic types (\verb|TFree|, \verb|TVar|) occurring in
|
164 |
\isa{{\isaliteral{5C3C7461753E}{\isasymtau}}}.
|
|
| 30296 | 165 |
|
| 40406 | 166 |
\item \verb|Term.fold_atyps|~\isa{f\ {\isaliteral{5C3C7461753E}{\isasymtau}}} iterates the operation
|
167 |
\isa{f} over all occurrences of atomic types (\verb|TFree|, \verb|TVar|) in \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}}; the type structure is traversed from left to
|
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
168 |
right. |
| 30296 | 169 |
|
| 40406 | 170 |
\item \verb|Sign.subsort|~\isa{thy\ {\isaliteral{28}{\isacharparenleft}}s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}}
|
171 |
tests the subsort relation \isa{s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ s\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}}.
|
|
| 30296 | 172 |
|
| 40406 | 173 |
\item \verb|Sign.of_sort|~\isa{thy\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{2C}{\isacharcomma}}\ s{\isaliteral{29}{\isacharparenright}}} tests whether type
|
174 |
\isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} is of sort \isa{s}.
|
|
| 30296 | 175 |
|
| 47174 | 176 |
\item \verb|Sign.add_type|~\isa{ctxt\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}{\isaliteral{2C}{\isacharcomma}}\ k{\isaliteral{2C}{\isacharcomma}}\ mx{\isaliteral{29}{\isacharparenright}}} declares a
|
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
177 |
new type constructors \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}} with \isa{k} arguments and
|
| 30296 | 178 |
optional mixfix syntax. |
179 |
||
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
180 |
\item \verb|Sign.add_type_abbrev|~\isa{ctxt\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}}
|
|
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
181 |
defines a new type abbreviation \isa{{\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}}.
|
| 30296 | 182 |
|
| 40406 | 183 |
\item \verb|Sign.primitive_class|~\isa{{\isaliteral{28}{\isacharparenleft}}c{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5B}{\isacharbrackleft}}c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{29}{\isacharparenright}}} declares a new class \isa{c}, together with class
|
184 |
relations \isa{c\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub i}, for \isa{i\ {\isaliteral{3D}{\isacharequal}}\ {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ n}.
|
|
| 30296 | 185 |
|
| 40406 | 186 |
\item \verb|Sign.primitive_classrel|~\isa{{\isaliteral{28}{\isacharparenleft}}c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}} declares the class relation \isa{c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}}.
|
| 30296 | 187 |
|
| 40406 | 188 |
\item \verb|Sign.primitive_arity|~\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec s{\isaliteral{2C}{\isacharcomma}}\ s{\isaliteral{29}{\isacharparenright}}} declares
|
189 |
the arity \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s{\isaliteral{29}{\isacharparenright}}s}.
|
|
| 30296 | 190 |
|
191 |
\end{description}%
|
|
192 |
\end{isamarkuptext}%
|
|
193 |
\isamarkuptrue% |
|
194 |
% |
|
195 |
\endisatagmlref |
|
196 |
{\isafoldmlref}%
|
|
197 |
% |
|
198 |
\isadelimmlref |
|
199 |
% |
|
200 |
\endisadelimmlref |
|
201 |
% |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
202 |
\isadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
203 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
204 |
\endisadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
205 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
206 |
\isatagmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
207 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
208 |
\begin{isamarkuptext}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
209 |
\begin{matharray}{rcl}
|
| 40406 | 210 |
\indexdef{}{ML antiquotation}{class}\hypertarget{ML antiquotation.class}{\hyperlink{ML antiquotation.class}{\mbox{\isa{class}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
211 |
\indexdef{}{ML antiquotation}{sort}\hypertarget{ML antiquotation.sort}{\hyperlink{ML antiquotation.sort}{\mbox{\isa{sort}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
212 |
\indexdef{}{ML antiquotation}{type\_name}\hypertarget{ML antiquotation.type-name}{\hyperlink{ML antiquotation.type-name}{\mbox{\isa{type{\isaliteral{5F}{\isacharunderscore}}name}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
213 |
\indexdef{}{ML antiquotation}{type\_abbrev}\hypertarget{ML antiquotation.type-abbrev}{\hyperlink{ML antiquotation.type-abbrev}{\mbox{\isa{type{\isaliteral{5F}{\isacharunderscore}}abbrev}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
214 |
\indexdef{}{ML antiquotation}{nonterminal}\hypertarget{ML antiquotation.nonterminal}{\hyperlink{ML antiquotation.nonterminal}{\mbox{\isa{nonterminal}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
215 |
\indexdef{}{ML antiquotation}{typ}\hypertarget{ML antiquotation.typ}{\hyperlink{ML antiquotation.typ}{\mbox{\isa{typ}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
216 |
\end{matharray}
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
217 |
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
218 |
\begin{railoutput}
|
| 42662 | 219 |
\rail@begin{1}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
220 |
\rail@term{\hyperlink{ML antiquotation.class}{\mbox{\isa{class}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
221 |
\rail@nont{\isa{nameref}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
222 |
\rail@end |
| 42662 | 223 |
\rail@begin{1}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
224 |
\rail@term{\hyperlink{ML antiquotation.sort}{\mbox{\isa{sort}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
225 |
\rail@nont{\isa{sort}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
226 |
\rail@end |
| 42662 | 227 |
\rail@begin{3}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
228 |
\rail@bar |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
229 |
\rail@term{\hyperlink{ML antiquotation.type-name}{\mbox{\isa{type{\isaliteral{5F}{\isacharunderscore}}name}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
230 |
\rail@nextbar{1}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
231 |
\rail@term{\hyperlink{ML antiquotation.type-abbrev}{\mbox{\isa{type{\isaliteral{5F}{\isacharunderscore}}abbrev}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
232 |
\rail@nextbar{2}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
233 |
\rail@term{\hyperlink{ML antiquotation.nonterminal}{\mbox{\isa{nonterminal}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
234 |
\rail@endbar |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
235 |
\rail@nont{\isa{nameref}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
236 |
\rail@end |
| 42662 | 237 |
\rail@begin{1}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
238 |
\rail@term{\hyperlink{ML antiquotation.typ}{\mbox{\isa{typ}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
239 |
\rail@nont{\isa{type}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
240 |
\rail@end |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
241 |
\end{railoutput}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
242 |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
243 |
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
244 |
\begin{description}
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
245 |
|
| 40406 | 246 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}class\ c{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized class \isa{c} --- as \verb|string| literal.
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
247 |
|
| 40406 | 248 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}sort\ s{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized sort \isa{s}
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
249 |
--- as \verb|string list| literal. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
250 |
|
| 40406 | 251 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}type{\isaliteral{5F}{\isacharunderscore}}name\ c{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized type
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
252 |
constructor \isa{c} --- as \verb|string| literal.
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
253 |
|
| 40406 | 254 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}type{\isaliteral{5F}{\isacharunderscore}}abbrev\ c{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized type
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
255 |
abbreviation \isa{c} --- as \verb|string| literal.
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
256 |
|
| 40406 | 257 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}nonterminal\ c{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized syntactic
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
258 |
type~/ grammar nonterminal \isa{c} --- as \verb|string|
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
259 |
literal. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
260 |
|
| 40406 | 261 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}typ\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized type \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}}
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
262 |
--- as constructor term for datatype \verb|typ|. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
263 |
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
264 |
\end{description}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
265 |
\end{isamarkuptext}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
266 |
\isamarkuptrue% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
267 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
268 |
\endisatagmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
269 |
{\isafoldmlantiq}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
270 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
271 |
\isadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
272 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
273 |
\endisadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
274 |
% |
| 30296 | 275 |
\isamarkupsection{Terms \label{sec:terms}%
|
276 |
} |
|
277 |
\isamarkuptrue% |
|
278 |
% |
|
279 |
\begin{isamarkuptext}%
|
|
| 40406 | 280 |
The language of terms is that of simply-typed \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}}-calculus
|
| 30296 | 281 |
with de-Bruijn indices for bound variables (cf.\ \cite{debruijn72}
|
282 |
or \cite{paulson-ml2}), with the types being determined by the
|
|
283 |
corresponding binders. In contrast, free variables and constants |
|
| 35001 | 284 |
have an explicit name and type in each occurrence. |
| 30296 | 285 |
|
286 |
\medskip A \emph{bound variable} is a natural number \isa{b},
|
|
287 |
which accounts for the number of intermediate binders between the |
|
288 |
variable occurrence in the body and its binding position. For |
|
| 40406 | 289 |
example, the de-Bruijn term \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}\isaliteral{5C3C5E627375623E}{}\isactrlbsub bool\isaliteral{5C3C5E657375623E}{}\isactrlesub {\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}\isaliteral{5C3C5E627375623E}{}\isactrlbsub bool\isaliteral{5C3C5E657375623E}{}\isactrlesub {\isaliteral{2E}{\isachardot}}\ {\isadigit{1}}\ {\isaliteral{5C3C616E643E}{\isasymand}}\ {\isadigit{0}}} would
|
290 |
correspond to \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x\isaliteral{5C3C5E627375623E}{}\isactrlbsub bool\isaliteral{5C3C5E657375623E}{}\isactrlesub {\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}y\isaliteral{5C3C5E627375623E}{}\isactrlbsub bool\isaliteral{5C3C5E657375623E}{}\isactrlesub {\isaliteral{2E}{\isachardot}}\ x\ {\isaliteral{5C3C616E643E}{\isasymand}}\ y} in a named
|
|
| 30296 | 291 |
representation. Note that a bound variable may be represented by |
292 |
different de-Bruijn indices at different occurrences, depending on |
|
293 |
the nesting of abstractions. |
|
294 |
||
295 |
A \emph{loose variable} is a bound variable that is outside the
|
|
296 |
scope of local binders. The types (and names) for loose variables |
|
297 |
can be managed as a separate context, that is maintained as a stack |
|
298 |
of hypothetical binders. The core logic operates on closed terms, |
|
299 |
without any loose variables. |
|
300 |
||
301 |
A \emph{fixed variable} is a pair of a basic name and a type, e.g.\
|
|
| 40406 | 302 |
\isa{{\isaliteral{28}{\isacharparenleft}}x{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}} which is usually printed \isa{x\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}} here. A
|
| 30296 | 303 |
\emph{schematic variable} is a pair of an indexname and a type,
|
| 40406 | 304 |
e.g.\ \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{28}{\isacharparenleft}}x{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}} which is likewise printed as \isa{{\isaliteral{3F}{\isacharquery}}x\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}}.
|
| 30296 | 305 |
|
306 |
\medskip A \emph{constant} is a pair of a basic name and a type,
|
|
| 40406 | 307 |
e.g.\ \isa{{\isaliteral{28}{\isacharparenleft}}c{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}} which is usually printed as \isa{c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}}
|
| 35001 | 308 |
here. Constants are declared in the context as polymorphic families |
| 40406 | 309 |
\isa{c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}}, meaning that all substitution instances \isa{c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}} for \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}} are valid.
|
| 30296 | 310 |
|
| 40406 | 311 |
The vector of \emph{type arguments} of constant \isa{c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}} wrt.\
|
312 |
the declaration \isa{c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}} is defined as the codomain of the
|
|
313 |
matcher \isa{{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{7B}{\isacharbraceleft}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C6D617073746F3E}{\isasymmapsto}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n\ {\isaliteral{5C3C6D617073746F3E}{\isasymmapsto}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{7D}{\isacharbraceright}}} presented in
|
|
314 |
canonical order \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{29}{\isacharparenright}}}, corresponding to the
|
|
315 |
left-to-right occurrences of the \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub i} in \isa{{\isaliteral{5C3C7369676D613E}{\isasymsigma}}}.
|
|
| 35001 | 316 |
Within a given theory context, there is a one-to-one correspondence |
| 40406 | 317 |
between any constant \isa{c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}} and the application \isa{c{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{29}{\isacharparenright}}} of its type arguments. For example, with \isa{plus\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}}, the instance \isa{plus\isaliteral{5C3C5E627375623E}{}\isactrlbsub nat\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ nat\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ nat\isaliteral{5C3C5E657375623E}{}\isactrlesub } corresponds to
|
318 |
\isa{plus{\isaliteral{28}{\isacharparenleft}}nat{\isaliteral{29}{\isacharparenright}}}.
|
|
| 30296 | 319 |
|
| 40406 | 320 |
Constant declarations \isa{c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}} may contain sort constraints
|
321 |
for type variables in \isa{{\isaliteral{5C3C7369676D613E}{\isasymsigma}}}. These are observed by
|
|
| 30296 | 322 |
type-inference as expected, but \emph{ignored} by the core logic.
|
323 |
This means the primitive logic is able to reason with instances of |
|
324 |
polymorphic constants that the user-level type-checker would reject |
|
325 |
due to violation of type class restrictions. |
|
326 |
||
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
327 |
\medskip An \emph{atomic term} is either a variable or constant.
|
| 35001 | 328 |
The logical category \emph{term} is defined inductively over atomic
|
| 40406 | 329 |
terms, with abstraction and application as follows: \isa{t\ {\isaliteral{3D}{\isacharequal}}\ b\ {\isaliteral{7C}{\isacharbar}}\ x\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{3F}{\isacharquery}}x\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{7C}{\isacharbar}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{2E}{\isachardot}}\ t\ {\isaliteral{7C}{\isacharbar}}\ t\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ t\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}}. Parsing and printing takes care of
|
| 35001 | 330 |
converting between an external representation with named bound |
331 |
variables. Subsequently, we shall use the latter notation instead |
|
332 |
of internal de-Bruijn representation. |
|
| 30296 | 333 |
|
| 40406 | 334 |
The inductive relation \isa{t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}} assigns a (unique) type to a
|
| 30296 | 335 |
term according to the structure of atomic terms, abstractions, and |
336 |
applicatins: |
|
337 |
\[ |
|
| 40406 | 338 |
\infer{\isa{a\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}}}{}
|
| 30296 | 339 |
\qquad |
| 40406 | 340 |
\infer{\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{2E}{\isachardot}}\ t{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}}}{\isa{t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}}}
|
| 30296 | 341 |
\qquad |
| 40406 | 342 |
\infer{\isa{t\ u\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}}}{\isa{t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}} & \isa{u\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}}}
|
| 30296 | 343 |
\] |
344 |
A \emph{well-typed term} is a term that can be typed according to these rules.
|
|
345 |
||
346 |
Typing information can be omitted: type-inference is able to |
|
347 |
reconstruct the most general type of a raw term, while assigning |
|
348 |
most general types to all of its variables and constants. |
|
349 |
Type-inference depends on a context of type constraints for fixed |
|
350 |
variables, and declarations for polymorphic constants. |
|
351 |
||
352 |
The identity of atomic terms consists both of the name and the type |
|
| 40406 | 353 |
component. This means that different variables \isa{x\isaliteral{5C3C5E627375623E}{}\isactrlbsub {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\isaliteral{5C3C5E657375623E}{}\isactrlesub } and \isa{x\isaliteral{5C3C5E627375623E}{}\isactrlbsub {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}\isaliteral{5C3C5E657375623E}{}\isactrlesub } may become the same after
|
| 35001 | 354 |
type instantiation. Type-inference rejects variables of the same |
355 |
name, but different types. In contrast, mixed instances of |
|
356 |
polymorphic constants occur routinely. |
|
| 30296 | 357 |
|
| 40406 | 358 |
\medskip The \emph{hidden polymorphism} of a term \isa{t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}}
|
| 30296 | 359 |
is the set of type variables occurring in \isa{t}, but not in
|
| 40406 | 360 |
its type \isa{{\isaliteral{5C3C7369676D613E}{\isasymsigma}}}. This means that the term implicitly depends
|
| 35001 | 361 |
on type arguments that are not accounted in the result type, i.e.\ |
| 40406 | 362 |
there are different type instances \isa{t{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}} and
|
363 |
\isa{t{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}{\isaliteral{27}{\isacharprime}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}} with the same type. This slightly
|
|
| 30296 | 364 |
pathological situation notoriously demands additional care. |
365 |
||
| 40406 | 366 |
\medskip A \emph{term abbreviation} is a syntactic definition \isa{c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t} of a closed term \isa{t} of type \isa{{\isaliteral{5C3C7369676D613E}{\isasymsigma}}},
|
| 30296 | 367 |
without any hidden polymorphism. A term abbreviation looks like a |
368 |
constant in the syntax, but is expanded before entering the logical |
|
369 |
core. Abbreviations are usually reverted when printing terms, using |
|
| 40406 | 370 |
\isa{t\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7369676D613E}{\isasymsigma}}} as rules for higher-order rewriting.
|
| 30296 | 371 |
|
| 40406 | 372 |
\medskip Canonical operations on \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}}-terms include \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5C3C626574613E}{\isasymbeta}}{\isaliteral{5C3C6574613E}{\isasymeta}}}-conversion: \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}}-conversion refers to capture-free
|
373 |
renaming of bound variables; \isa{{\isaliteral{5C3C626574613E}{\isasymbeta}}}-conversion contracts an
|
|
| 30296 | 374 |
abstraction applied to an argument term, substituting the argument |
| 40406 | 375 |
in the body: \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x{\isaliteral{2E}{\isachardot}}\ b{\isaliteral{29}{\isacharparenright}}a} becomes \isa{b{\isaliteral{5B}{\isacharbrackleft}}a{\isaliteral{2F}{\isacharslash}}x{\isaliteral{5D}{\isacharbrackright}}}; \isa{{\isaliteral{5C3C6574613E}{\isasymeta}}}-conversion contracts vacuous application-abstraction: \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x{\isaliteral{2E}{\isachardot}}\ f\ x} becomes \isa{f}, provided that the bound variable
|
| 30296 | 376 |
does not occur in \isa{f}.
|
377 |
||
| 40406 | 378 |
Terms are normally treated modulo \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}}-conversion, which is
|
| 30296 | 379 |
implicit in the de-Bruijn representation. Names for bound variables |
380 |
in abstractions are maintained separately as (meaningless) comments, |
|
| 40406 | 381 |
mostly for parsing and printing. Full \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5C3C626574613E}{\isasymbeta}}{\isaliteral{5C3C6574613E}{\isasymeta}}}-conversion is
|
| 30296 | 382 |
commonplace in various standard operations (\secref{sec:obj-rules})
|
383 |
that are based on higher-order unification and matching.% |
|
384 |
\end{isamarkuptext}%
|
|
385 |
\isamarkuptrue% |
|
386 |
% |
|
387 |
\isadelimmlref |
|
388 |
% |
|
389 |
\endisadelimmlref |
|
390 |
% |
|
391 |
\isatagmlref |
|
392 |
% |
|
393 |
\begin{isamarkuptext}%
|
|
394 |
\begin{mldecls}
|
|
395 |
\indexdef{}{ML type}{term}\verb|type term| \\
|
|
| 46262 | 396 |
\indexdef{}{ML infix}{aconv}\verb|infix aconv: term * term -> bool| \\
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
397 |
\indexdef{}{ML}{Term.map\_types}\verb|Term.map_types: (typ -> typ) -> term -> term| \\
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
398 |
\indexdef{}{ML}{Term.fold\_types}\verb|Term.fold_types: (typ -> 'a -> 'a) -> term -> 'a -> 'a| \\
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
399 |
\indexdef{}{ML}{Term.map\_aterms}\verb|Term.map_aterms: (term -> term) -> term -> term| \\
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
400 |
\indexdef{}{ML}{Term.fold\_aterms}\verb|Term.fold_aterms: (term -> 'a -> 'a) -> term -> 'a -> 'a| \\
|
| 30296 | 401 |
\end{mldecls}
|
402 |
\begin{mldecls}
|
|
403 |
\indexdef{}{ML}{fastype\_of}\verb|fastype_of: term -> typ| \\
|
|
404 |
\indexdef{}{ML}{lambda}\verb|lambda: term -> term -> term| \\
|
|
405 |
\indexdef{}{ML}{betapply}\verb|betapply: term * term -> term| \\
|
|
| 42934 | 406 |
\indexdef{}{ML}{incr\_boundvars}\verb|incr_boundvars: int -> term -> term| \\
|
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
407 |
\indexdef{}{ML}{Sign.declare\_const}\verb|Sign.declare_const: Proof.context ->|\isasep\isanewline%
|
|
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
408 |
\verb| (binding * typ) * mixfix -> theory -> term * theory| \\ |
| 33174 | 409 |
\indexdef{}{ML}{Sign.add\_abbrev}\verb|Sign.add_abbrev: string -> binding * term ->|\isasep\isanewline%
|
| 30296 | 410 |
\verb| theory -> (term * term) * theory| \\ |
411 |
\indexdef{}{ML}{Sign.const\_typargs}\verb|Sign.const_typargs: theory -> string * typ -> typ list| \\
|
|
412 |
\indexdef{}{ML}{Sign.const\_instance}\verb|Sign.const_instance: theory -> string * typ list -> typ| \\
|
|
413 |
\end{mldecls}
|
|
414 |
||
415 |
\begin{description}
|
|
416 |
||
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
417 |
\item Type \verb|term| represents de-Bruijn terms, with comments |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
418 |
in abstractions, and explicitly named free variables and constants; |
| 46262 | 419 |
this is a datatype with constructors \verb|Bound|, \verb|Free|, \verb|Var|, \verb|Const|, \verb|Abs|, \verb|$|. |
| 30296 | 420 |
|
| 40406 | 421 |
\item \isa{t}~\verb|aconv|~\isa{u} checks \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}}-equivalence of two terms. This is the basic equality relation
|
| 30296 | 422 |
on type \verb|term|; raw datatype equality should only be used |
423 |
for operations related to parsing or printing! |
|
424 |
||
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
425 |
\item \verb|Term.map_types|~\isa{f\ t} applies the mapping \isa{f} to all types occurring in \isa{t}.
|
| 30296 | 426 |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
427 |
\item \verb|Term.fold_types|~\isa{f\ t} iterates the operation
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
428 |
\isa{f} over all occurrences of types in \isa{t}; the term
|
| 30296 | 429 |
structure is traversed from left to right. |
430 |
||
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
431 |
\item \verb|Term.map_aterms|~\isa{f\ t} applies the mapping \isa{f} to all atomic terms (\verb|Bound|, \verb|Free|, \verb|Var|, \verb|Const|) occurring in \isa{t}.
|
| 30296 | 432 |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
433 |
\item \verb|Term.fold_aterms|~\isa{f\ t} iterates the operation
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
434 |
\isa{f} over all occurrences of atomic terms (\verb|Bound|, \verb|Free|, \verb|Var|, \verb|Const|) in \isa{t}; the term structure is
|
| 30296 | 435 |
traversed from left to right. |
436 |
||
437 |
\item \verb|fastype_of|~\isa{t} determines the type of a
|
|
438 |
well-typed term. This operation is relatively slow, despite the |
|
439 |
omission of any sanity checks. |
|
440 |
||
| 40406 | 441 |
\item \verb|lambda|~\isa{a\ b} produces an abstraction \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}a{\isaliteral{2E}{\isachardot}}\ b}, where occurrences of the atomic term \isa{a} in the
|
| 30296 | 442 |
body \isa{b} are replaced by bound variables.
|
443 |
||
| 40406 | 444 |
\item \verb|betapply|~\isa{{\isaliteral{28}{\isacharparenleft}}t{\isaliteral{2C}{\isacharcomma}}\ u{\isaliteral{29}{\isacharparenright}}} produces an application \isa{t\ u}, with topmost \isa{{\isaliteral{5C3C626574613E}{\isasymbeta}}}-conversion if \isa{t} is an
|
| 30296 | 445 |
abstraction. |
446 |
||
| 42934 | 447 |
\item \verb|incr_boundvars|~\isa{j} increments a term's dangling
|
448 |
bound variables by the offset \isa{j}. This is required when
|
|
449 |
moving a subterm into a context where it is enclosed by a different |
|
450 |
number of abstractions. Bound variables with a matching abstraction |
|
451 |
are unaffected. |
|
452 |
||
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
453 |
\item \verb|Sign.declare_const|~\isa{ctxt\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{28}{\isacharparenleft}}c{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\ mx{\isaliteral{29}{\isacharparenright}}} declares
|
|
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
454 |
a new constant \isa{c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}} with optional mixfix syntax.
|
| 30296 | 455 |
|
| 40406 | 456 |
\item \verb|Sign.add_abbrev|~\isa{print{\isaliteral{5F}{\isacharunderscore}}mode\ {\isaliteral{28}{\isacharparenleft}}c{\isaliteral{2C}{\isacharcomma}}\ t{\isaliteral{29}{\isacharparenright}}}
|
457 |
introduces a new term abbreviation \isa{c\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t}.
|
|
| 30296 | 458 |
|
| 40406 | 459 |
\item \verb|Sign.const_typargs|~\isa{thy\ {\isaliteral{28}{\isacharparenleft}}c{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}} and \verb|Sign.const_instance|~\isa{thy\ {\isaliteral{28}{\isacharparenleft}}c{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{29}{\isacharparenright}}}
|
| 30296 | 460 |
convert between two representations of polymorphic constants: full |
461 |
type instance vs.\ compact type arguments form. |
|
462 |
||
463 |
\end{description}%
|
|
464 |
\end{isamarkuptext}%
|
|
465 |
\isamarkuptrue% |
|
466 |
% |
|
467 |
\endisatagmlref |
|
468 |
{\isafoldmlref}%
|
|
469 |
% |
|
470 |
\isadelimmlref |
|
471 |
% |
|
472 |
\endisadelimmlref |
|
473 |
% |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
474 |
\isadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
475 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
476 |
\endisadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
477 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
478 |
\isatagmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
479 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
480 |
\begin{isamarkuptext}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
481 |
\begin{matharray}{rcl}
|
| 40406 | 482 |
\indexdef{}{ML antiquotation}{const\_name}\hypertarget{ML antiquotation.const-name}{\hyperlink{ML antiquotation.const-name}{\mbox{\isa{const{\isaliteral{5F}{\isacharunderscore}}name}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
483 |
\indexdef{}{ML antiquotation}{const\_abbrev}\hypertarget{ML antiquotation.const-abbrev}{\hyperlink{ML antiquotation.const-abbrev}{\mbox{\isa{const{\isaliteral{5F}{\isacharunderscore}}abbrev}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
484 |
\indexdef{}{ML antiquotation}{const}\hypertarget{ML antiquotation.const}{\hyperlink{ML antiquotation.const}{\mbox{\isa{const}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
485 |
\indexdef{}{ML antiquotation}{term}\hypertarget{ML antiquotation.term}{\hyperlink{ML antiquotation.term}{\mbox{\isa{term}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
486 |
\indexdef{}{ML antiquotation}{prop}\hypertarget{ML antiquotation.prop}{\hyperlink{ML antiquotation.prop}{\mbox{\isa{prop}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
487 |
\end{matharray}
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
488 |
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
489 |
\begin{railoutput}
|
| 42662 | 490 |
\rail@begin{2}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
491 |
\rail@bar |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
492 |
\rail@term{\hyperlink{ML antiquotation.const-name}{\mbox{\isa{const{\isaliteral{5F}{\isacharunderscore}}name}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
493 |
\rail@nextbar{1}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
494 |
\rail@term{\hyperlink{ML antiquotation.const-abbrev}{\mbox{\isa{const{\isaliteral{5F}{\isacharunderscore}}abbrev}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
495 |
\rail@endbar |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
496 |
\rail@nont{\isa{nameref}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
497 |
\rail@end |
| 42662 | 498 |
\rail@begin{3}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
499 |
\rail@term{\hyperlink{ML antiquotation.const}{\mbox{\isa{const}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
500 |
\rail@bar |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
501 |
\rail@nextbar{1}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
502 |
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
503 |
\rail@plus |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
504 |
\rail@nont{\isa{type}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
505 |
\rail@nextplus{2}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
506 |
\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
507 |
\rail@endplus |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
508 |
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
509 |
\rail@endbar |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
510 |
\rail@end |
| 42662 | 511 |
\rail@begin{1}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
512 |
\rail@term{\hyperlink{ML antiquotation.term}{\mbox{\isa{term}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
513 |
\rail@nont{\isa{term}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
514 |
\rail@end |
| 42662 | 515 |
\rail@begin{1}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
516 |
\rail@term{\hyperlink{ML antiquotation.prop}{\mbox{\isa{prop}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
517 |
\rail@nont{\isa{prop}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
518 |
\rail@end |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
519 |
\end{railoutput}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
520 |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
521 |
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
522 |
\begin{description}
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
523 |
|
| 40406 | 524 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}const{\isaliteral{5F}{\isacharunderscore}}name\ c{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized logical
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
525 |
constant name \isa{c} --- as \verb|string| literal.
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
526 |
|
| 40406 | 527 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}const{\isaliteral{5F}{\isacharunderscore}}abbrev\ c{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
528 |
abbreviated constant name \isa{c} --- as \verb|string|
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
529 |
literal. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
530 |
|
| 40406 | 531 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}const\ c{\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
532 |
constant \isa{c} with precise type instantiation in the sense of
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
533 |
\verb|Sign.const_instance| --- as \verb|Const| constructor term for |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
534 |
datatype \verb|term|. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
535 |
|
| 40406 | 536 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}term\ t{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized term \isa{t}
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
537 |
--- as constructor term for datatype \verb|term|. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
538 |
|
| 40406 | 539 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}prop\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{7D}{\isacharbraceright}}} inlines the internalized proposition
|
540 |
\isa{{\isaliteral{5C3C7068693E}{\isasymphi}}} --- as constructor term for datatype \verb|term|.
|
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
541 |
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
542 |
\end{description}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
543 |
\end{isamarkuptext}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
544 |
\isamarkuptrue% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
545 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
546 |
\endisatagmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
547 |
{\isafoldmlantiq}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
548 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
549 |
\isadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
550 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
551 |
\endisadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
552 |
% |
| 30296 | 553 |
\isamarkupsection{Theorems \label{sec:thms}%
|
554 |
} |
|
555 |
\isamarkuptrue% |
|
556 |
% |
|
557 |
\begin{isamarkuptext}%
|
|
558 |
A \emph{proposition} is a well-typed term of type \isa{prop}, a
|
|
559 |
\emph{theorem} is a proven proposition (depending on a context of
|
|
560 |
hypotheses and the background theory). Primitive inferences include |
|
| 40406 | 561 |
plain Natural Deduction rules for the primary connectives \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}} and \isa{{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}} of the framework. There is also a builtin
|
562 |
notion of equality/equivalence \isa{{\isaliteral{5C3C65717569763E}{\isasymequiv}}}.%
|
|
| 30296 | 563 |
\end{isamarkuptext}%
|
564 |
\isamarkuptrue% |
|
565 |
% |
|
566 |
\isamarkupsubsection{Primitive connectives and rules \label{sec:prim-rules}%
|
|
567 |
} |
|
568 |
\isamarkuptrue% |
|
569 |
% |
|
570 |
\begin{isamarkuptext}%
|
|
571 |
The theory \isa{Pure} contains constant declarations for the
|
|
| 40406 | 572 |
primitive connectives \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}}, \isa{{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}}, and \isa{{\isaliteral{5C3C65717569763E}{\isasymequiv}}} of
|
| 30296 | 573 |
the logical framework, see \figref{fig:pure-connectives}. The
|
| 40406 | 574 |
derivability judgment \isa{A\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ A\isaliteral{5C3C5E697375623E}{}\isactrlisub n\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B} is
|
| 30296 | 575 |
defined inductively by the primitive inferences given in |
576 |
\figref{fig:prim-rules}, with the global restriction that the
|
|
577 |
hypotheses must \emph{not} contain any schematic variables. The
|
|
578 |
builtin equality is conceptually axiomatized as shown in |
|
579 |
\figref{fig:pure-equality}, although the implementation works
|
|
580 |
directly with derived inferences. |
|
581 |
||
582 |
\begin{figure}[htb]
|
|
583 |
\begin{center}
|
|
584 |
\begin{tabular}{ll}
|
|
| 40406 | 585 |
\isa{all\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ prop{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ prop} & universal quantification (binder \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}}) \\
|
586 |
\isa{{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ prop\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ prop\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ prop} & implication (right associative infix) \\
|
|
587 |
\isa{{\isaliteral{5C3C65717569763E}{\isasymequiv}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ prop} & equality relation (infix) \\
|
|
| 30296 | 588 |
\end{tabular}
|
589 |
\caption{Primitive connectives of Pure}\label{fig:pure-connectives}
|
|
590 |
\end{center}
|
|
591 |
\end{figure}
|
|
592 |
||
593 |
\begin{figure}[htb]
|
|
594 |
\begin{center}
|
|
595 |
\[ |
|
| 40406 | 596 |
\infer[\isa{{\isaliteral{28}{\isacharparenleft}}axiom{\isaliteral{29}{\isacharparenright}}}]{\isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ A}}{\isa{A\ {\isaliteral{5C3C696E3E}{\isasymin}}\ {\isaliteral{5C3C54686574613E}{\isasymTheta}}}}
|
| 30296 | 597 |
\qquad |
| 40406 | 598 |
\infer[\isa{{\isaliteral{28}{\isacharparenleft}}assume{\isaliteral{29}{\isacharparenright}}}]{\isa{A\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ A}}{}
|
| 30296 | 599 |
\] |
600 |
\[ |
|
| 42666 | 601 |
\infer[\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{5C3C68797068656E3E}{\isasymhyphen}}intro{\isaliteral{29}{\isacharparenright}}}]{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C416E643E}{\isasymAnd}}x{\isaliteral{2E}{\isachardot}}\ b{\isaliteral{5B}{\isacharbrackleft}}x{\isaliteral{5D}{\isacharbrackright}}}}{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ b{\isaliteral{5B}{\isacharbrackleft}}x{\isaliteral{5D}{\isacharbrackright}}} & \isa{x\ {\isaliteral{5C3C6E6F74696E3E}{\isasymnotin}}\ {\isaliteral{5C3C47616D6D613E}{\isasymGamma}}}}
|
| 30296 | 602 |
\qquad |
| 42666 | 603 |
\infer[\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{5C3C68797068656E3E}{\isasymhyphen}}elim{\isaliteral{29}{\isacharparenright}}}]{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ b{\isaliteral{5B}{\isacharbrackleft}}a{\isaliteral{5D}{\isacharbrackright}}}}{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C416E643E}{\isasymAnd}}x{\isaliteral{2E}{\isachardot}}\ b{\isaliteral{5B}{\isacharbrackleft}}x{\isaliteral{5D}{\isacharbrackright}}}}
|
| 30296 | 604 |
\] |
605 |
\[ |
|
| 42666 | 606 |
\infer[\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}{\isaliteral{5C3C68797068656E3E}{\isasymhyphen}}intro{\isaliteral{29}{\isacharparenright}}}]{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{2D}{\isacharminus}}\ A\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B}}{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B}}
|
| 30296 | 607 |
\qquad |
| 42666 | 608 |
\infer[\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}{\isaliteral{5C3C68797068656E3E}{\isasymhyphen}}elim{\isaliteral{29}{\isacharparenright}}}]{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C756E696F6E3E}{\isasymunion}}\ {\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B}}{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B} & \isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ A}}
|
| 30296 | 609 |
\] |
610 |
\caption{Primitive inferences of Pure}\label{fig:prim-rules}
|
|
611 |
\end{center}
|
|
612 |
\end{figure}
|
|
613 |
||
614 |
\begin{figure}[htb]
|
|
615 |
\begin{center}
|
|
616 |
\begin{tabular}{ll}
|
|
| 40406 | 617 |
\isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x{\isaliteral{2E}{\isachardot}}\ b{\isaliteral{5B}{\isacharbrackleft}}x{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{29}{\isacharparenright}}\ a\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ b{\isaliteral{5B}{\isacharbrackleft}}a{\isaliteral{5D}{\isacharbrackright}}} & \isa{{\isaliteral{5C3C626574613E}{\isasymbeta}}}-conversion \\
|
618 |
\isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ x} & reflexivity \\
|
|
619 |
\isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ y\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ y} & substitution \\
|
|
620 |
\isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}x{\isaliteral{2E}{\isachardot}}\ f\ x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ g\ x{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ f\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ g} & extensionality \\
|
|
621 |
\isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{28}{\isacharparenleft}}A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ B} & logical equivalence \\
|
|
| 30296 | 622 |
\end{tabular}
|
623 |
\caption{Conceptual axiomatization of Pure equality}\label{fig:pure-equality}
|
|
624 |
\end{center}
|
|
625 |
\end{figure}
|
|
626 |
||
| 40406 | 627 |
The introduction and elimination rules for \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}} and \isa{{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}} are analogous to formation of dependently typed \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}}-terms representing the underlying proof objects. Proof terms
|
| 30296 | 628 |
are irrelevant in the Pure logic, though; they cannot occur within |
629 |
propositions. The system provides a runtime option to record |
|
630 |
explicit proof terms for primitive inferences. Thus all three |
|
| 40406 | 631 |
levels of \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}}-calculus become explicit: \isa{{\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}} for
|
632 |
terms, and \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{2F}{\isacharslash}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}} for proofs (cf.\
|
|
| 30296 | 633 |
\cite{Berghofer-Nipkow:2000:TPHOL}).
|
634 |
||
| 42666 | 635 |
Observe that locally fixed parameters (as in \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{5C3C68797068656E3E}{\isasymhyphen}}intro}) need not be recorded in the hypotheses, because
|
| 35001 | 636 |
the simple syntactic types of Pure are always inhabitable. |
| 40406 | 637 |
``Assumptions'' \isa{x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}} for type-membership are only
|
638 |
present as long as some \isa{x\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}} occurs in the statement
|
|
639 |
body.\footnote{This is the key difference to ``\isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}HOL}'' in
|
|
| 35001 | 640 |
the PTS framework \cite{Barendregt-Geuvers:2001}, where hypotheses
|
| 40406 | 641 |
\isa{x\ {\isaliteral{3A}{\isacharcolon}}\ A} are treated uniformly for propositions and types.}
|
| 30296 | 642 |
|
643 |
\medskip The axiomatization of a theory is implicitly closed by |
|
| 40406 | 644 |
forming all instances of type and term variables: \isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ A{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}} holds for any substitution instance of an axiom
|
645 |
\isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ A}. By pushing substitutions through derivations
|
|
| 35001 | 646 |
inductively, we also get admissible \isa{generalize} and \isa{instantiate} rules as shown in \figref{fig:subst-rules}.
|
| 30296 | 647 |
|
648 |
\begin{figure}[htb]
|
|
649 |
\begin{center}
|
|
650 |
\[ |
|
| 40406 | 651 |
\infer{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5D}{\isacharbrackright}}}}{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5D}{\isacharbrackright}}} & \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C6E6F74696E3E}{\isasymnotin}}\ {\isaliteral{5C3C47616D6D613E}{\isasymGamma}}}}
|
| 30296 | 652 |
\quad |
| 40406 | 653 |
\infer[\quad\isa{{\isaliteral{28}{\isacharparenleft}}generalize{\isaliteral{29}{\isacharparenright}}}]{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}x{\isaliteral{5D}{\isacharbrackright}}}}{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B{\isaliteral{5B}{\isacharbrackleft}}x{\isaliteral{5D}{\isacharbrackright}}} & \isa{x\ {\isaliteral{5C3C6E6F74696E3E}{\isasymnotin}}\ {\isaliteral{5C3C47616D6D613E}{\isasymGamma}}}}
|
| 30296 | 654 |
\] |
655 |
\[ |
|
| 40406 | 656 |
\infer{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{5D}{\isacharbrackright}}}}{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5D}{\isacharbrackright}}}}
|
| 30296 | 657 |
\quad |
| 40406 | 658 |
\infer[\quad\isa{{\isaliteral{28}{\isacharparenleft}}instantiate{\isaliteral{29}{\isacharparenright}}}]{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B{\isaliteral{5B}{\isacharbrackleft}}t{\isaliteral{5D}{\isacharbrackright}}}}{\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}x{\isaliteral{5D}{\isacharbrackright}}}}
|
| 30296 | 659 |
\] |
660 |
\caption{Admissible substitution rules}\label{fig:subst-rules}
|
|
661 |
\end{center}
|
|
662 |
\end{figure}
|
|
663 |
||
664 |
Note that \isa{instantiate} does not require an explicit
|
|
| 40406 | 665 |
side-condition, because \isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}} may never contain schematic
|
| 30296 | 666 |
variables. |
667 |
||
668 |
In principle, variables could be substituted in hypotheses as well, |
|
669 |
but this would disrupt the monotonicity of reasoning: deriving |
|
| 40406 | 670 |
\isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}} from \isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ B} is
|
671 |
correct, but \isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}\ {\isaliteral{5C3C73757073657465713E}{\isasymsupseteq}}\ {\isaliteral{5C3C47616D6D613E}{\isasymGamma}}} does not necessarily hold:
|
|
| 30296 | 672 |
the result belongs to a different proof context. |
673 |
||
674 |
\medskip An \emph{oracle} is a function that produces axioms on the
|
|
675 |
fly. Logically, this is an instance of the \isa{axiom} rule
|
|
676 |
(\figref{fig:prim-rules}), but there is an operational difference.
|
|
677 |
The system always records oracle invocations within derivations of |
|
678 |
theorems by a unique tag. |
|
679 |
||
680 |
Axiomatizations should be limited to the bare minimum, typically as |
|
681 |
part of the initial logical basis of an object-logic formalization. |
|
682 |
Later on, theories are usually developed in a strictly definitional |
|
683 |
fashion, by stating only certain equalities over new constants. |
|
684 |
||
| 40406 | 685 |
A \emph{simple definition} consists of a constant declaration \isa{c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}} together with an axiom \isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ c\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t}, where \isa{t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}} is a closed term without any hidden polymorphism. The RHS
|
| 30296 | 686 |
may depend on further defined constants, but not \isa{c} itself.
|
| 40406 | 687 |
Definitions of functions may be presented as \isa{c\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t} instead of the puristic \isa{c\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ {\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{2E}{\isachardot}}\ t}.
|
| 30296 | 688 |
|
689 |
An \emph{overloaded definition} consists of a collection of axioms
|
|
| 40406 | 690 |
for the same constant, with zero or one equations \isa{c{\isaliteral{28}{\isacharparenleft}}{\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{5C3C6B617070613E}{\isasymkappa}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t} for each type constructor \isa{{\isaliteral{5C3C6B617070613E}{\isasymkappa}}} (for
|
691 |
distinct variables \isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}}). The RHS may mention
|
|
692 |
previously defined constants as above, or arbitrary constants \isa{d{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub i{\isaliteral{29}{\isacharparenright}}} for some \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub i} projected from \isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}}. Thus overloaded definitions essentially work by
|
|
| 30296 | 693 |
primitive recursion over the syntactic structure of a single type |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
694 |
argument. See also \cite[\S4.3]{Haftmann-Wenzel:2006:classes}.%
|
| 30296 | 695 |
\end{isamarkuptext}%
|
696 |
\isamarkuptrue% |
|
697 |
% |
|
698 |
\isadelimmlref |
|
699 |
% |
|
700 |
\endisadelimmlref |
|
701 |
% |
|
702 |
\isatagmlref |
|
703 |
% |
|
704 |
\begin{isamarkuptext}%
|
|
705 |
\begin{mldecls}
|
|
| 46253 | 706 |
\indexdef{}{ML}{Logic.all}\verb|Logic.all: term -> term -> term| \\
|
707 |
\indexdef{}{ML}{Logic.mk\_implies}\verb|Logic.mk_implies: term * term -> term| \\
|
|
708 |
\end{mldecls}
|
|
709 |
\begin{mldecls}
|
|
| 30296 | 710 |
\indexdef{}{ML type}{ctyp}\verb|type ctyp| \\
|
711 |
\indexdef{}{ML type}{cterm}\verb|type cterm| \\
|
|
712 |
\indexdef{}{ML}{Thm.ctyp\_of}\verb|Thm.ctyp_of: theory -> typ -> ctyp| \\
|
|
713 |
\indexdef{}{ML}{Thm.cterm\_of}\verb|Thm.cterm_of: theory -> term -> cterm| \\
|
|
|
46497
89ccf66aa73d
renamed Thm.capply to Thm.apply, and Thm.cabs to Thm.lambda in conformance with similar operations in structure Term and Logic;
wenzelm
parents:
46262
diff
changeset
|
714 |
\indexdef{}{ML}{Thm.apply}\verb|Thm.apply: cterm -> cterm -> cterm| \\
|
|
89ccf66aa73d
renamed Thm.capply to Thm.apply, and Thm.cabs to Thm.lambda in conformance with similar operations in structure Term and Logic;
wenzelm
parents:
46262
diff
changeset
|
715 |
\indexdef{}{ML}{Thm.lambda}\verb|Thm.lambda: cterm -> cterm -> cterm| \\
|
| 46253 | 716 |
\indexdef{}{ML}{Thm.all}\verb|Thm.all: cterm -> cterm -> cterm| \\
|
717 |
\indexdef{}{ML}{Drule.mk\_implies}\verb|Drule.mk_implies: cterm * cterm -> cterm| \\
|
|
| 30296 | 718 |
\end{mldecls}
|
719 |
\begin{mldecls}
|
|
720 |
\indexdef{}{ML type}{thm}\verb|type thm| \\
|
|
| 32836 | 721 |
\indexdef{}{ML}{proofs}\verb|proofs: int Unsynchronized.ref| \\
|
| 42933 | 722 |
\indexdef{}{ML}{Thm.transfer}\verb|Thm.transfer: theory -> thm -> thm| \\
|
| 30296 | 723 |
\indexdef{}{ML}{Thm.assume}\verb|Thm.assume: cterm -> thm| \\
|
724 |
\indexdef{}{ML}{Thm.forall\_intr}\verb|Thm.forall_intr: cterm -> thm -> thm| \\
|
|
725 |
\indexdef{}{ML}{Thm.forall\_elim}\verb|Thm.forall_elim: cterm -> thm -> thm| \\
|
|
726 |
\indexdef{}{ML}{Thm.implies\_intr}\verb|Thm.implies_intr: cterm -> thm -> thm| \\
|
|
727 |
\indexdef{}{ML}{Thm.implies\_elim}\verb|Thm.implies_elim: thm -> thm -> thm| \\
|
|
728 |
\indexdef{}{ML}{Thm.generalize}\verb|Thm.generalize: string list * string list -> int -> thm -> thm| \\
|
|
729 |
\indexdef{}{ML}{Thm.instantiate}\verb|Thm.instantiate: (ctyp * ctyp) list * (cterm * cterm) list -> thm -> thm| \\
|
|
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
730 |
\indexdef{}{ML}{Thm.add\_axiom}\verb|Thm.add_axiom: Proof.context ->|\isasep\isanewline%
|
|
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
731 |
\verb| binding * term -> theory -> (string * thm) * theory| \\ |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
732 |
\indexdef{}{ML}{Thm.add\_oracle}\verb|Thm.add_oracle: binding * ('a -> cterm) -> theory ->|\isasep\isanewline%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
733 |
\verb| (string * ('a -> thm)) * theory| \\
|
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
734 |
\indexdef{}{ML}{Thm.add\_def}\verb|Thm.add_def: Proof.context -> bool -> bool ->|\isasep\isanewline%
|
|
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
735 |
\verb| binding * term -> theory -> (string * thm) * theory| \\ |
| 30296 | 736 |
\end{mldecls}
|
737 |
\begin{mldecls}
|
|
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
738 |
\indexdef{}{ML}{Theory.add\_deps}\verb|Theory.add_deps: Proof.context -> string ->|\isasep\isanewline%
|
|
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
739 |
\verb| string * typ -> (string * typ) list -> theory -> theory| \\ |
| 30296 | 740 |
\end{mldecls}
|
741 |
||
742 |
\begin{description}
|
|
743 |
||
| 46253 | 744 |
\item \verb|Logic.all|~\isa{a\ B} produces a Pure quantification
|
745 |
\isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}a{\isaliteral{2E}{\isachardot}}\ B}, where occurrences of the atomic term \isa{a} in
|
|
746 |
the body proposition \isa{B} are replaced by bound variables.
|
|
747 |
(See also \verb|lambda| on terms.) |
|
748 |
||
749 |
\item \verb|Logic.mk_implies|~\isa{{\isaliteral{28}{\isacharparenleft}}A{\isaliteral{2C}{\isacharcomma}}\ B{\isaliteral{29}{\isacharparenright}}} produces a Pure
|
|
750 |
implication \isa{A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B}.
|
|
751 |
||
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
752 |
\item Types \verb|ctyp| and \verb|cterm| represent certified |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
753 |
types and terms, respectively. These are abstract datatypes that |
| 30296 | 754 |
guarantee that its values have passed the full well-formedness (and |
755 |
well-typedness) checks, relative to the declarations of type |
|
| 46253 | 756 |
constructors, constants etc.\ in the background theory. The |
757 |
abstract types \verb|ctyp| and \verb|cterm| are part of the |
|
758 |
same inference kernel that is mainly responsible for \verb|thm|. |
|
759 |
Thus syntactic operations on \verb|ctyp| and \verb|cterm| |
|
760 |
are located in the \verb|Thm| module, even though theorems are |
|
761 |
not yet involved at that stage. |
|
| 30296 | 762 |
|
| 40406 | 763 |
\item \verb|Thm.ctyp_of|~\isa{thy\ {\isaliteral{5C3C7461753E}{\isasymtau}}} and \verb|Thm.cterm_of|~\isa{thy\ t} explicitly checks types and terms,
|
| 30296 | 764 |
respectively. This also involves some basic normalizations, such |
765 |
expansion of type and term abbreviations from the theory context. |
|
| 46253 | 766 |
Full re-certification is relatively slow and should be avoided in |
767 |
tight reasoning loops. |
|
| 30296 | 768 |
|
|
46497
89ccf66aa73d
renamed Thm.capply to Thm.apply, and Thm.cabs to Thm.lambda in conformance with similar operations in structure Term and Logic;
wenzelm
parents:
46262
diff
changeset
|
769 |
\item \verb|Thm.apply|, \verb|Thm.lambda|, \verb|Thm.all|, \verb|Drule.mk_implies| etc.\ compose certified terms (or propositions) |
| 46253 | 770 |
incrementally. This is equivalent to \verb|Thm.cterm_of| after |
| 46262 | 771 |
unchecked \verb|$|, \verb|lambda|, \verb|Logic.all|, \verb|Logic.mk_implies| etc., but there can be a big difference in |
| 46253 | 772 |
performance when large existing entities are composed by a few extra |
773 |
constructions on top. There are separate operations to decompose |
|
774 |
certified terms and theorems to produce certified terms again. |
|
| 30296 | 775 |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
776 |
\item Type \verb|thm| represents proven propositions. This is |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
777 |
an abstract datatype that guarantees that its values have been |
| 30296 | 778 |
constructed by basic principles of the \verb|Thm| module. |
779 |
Every \verb|thm| value contains a sliding back-reference to the |
|
780 |
enclosing theory, cf.\ \secref{sec:context-theory}.
|
|
781 |
||
| 35001 | 782 |
\item \verb|proofs| specifies the detail of proof recording within |
| 30296 | 783 |
\verb|thm| values: \verb|0| records only the names of oracles, |
784 |
\verb|1| records oracle names and propositions, \verb|2| additionally |
|
785 |
records full proof terms. Officially named theorems that contribute |
|
| 35001 | 786 |
to a result are recorded in any case. |
| 30296 | 787 |
|
| 42933 | 788 |
\item \verb|Thm.transfer|~\isa{thy\ thm} transfers the given
|
789 |
theorem to a \emph{larger} theory, see also \secref{sec:context}.
|
|
790 |
This formal adjustment of the background context has no logical |
|
791 |
significance, but is occasionally required for formal reasons, e.g.\ |
|
792 |
when theorems that are imported from more basic theories are used in |
|
793 |
the current situation. |
|
794 |
||
| 30296 | 795 |
\item \verb|Thm.assume|, \verb|Thm.forall_intr|, \verb|Thm.forall_elim|, \verb|Thm.implies_intr|, and \verb|Thm.implies_elim| |
796 |
correspond to the primitive inferences of \figref{fig:prim-rules}.
|
|
797 |
||
| 40406 | 798 |
\item \verb|Thm.generalize|~\isa{{\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{29}{\isacharparenright}}}
|
| 30296 | 799 |
corresponds to the \isa{generalize} rules of
|
800 |
\figref{fig:subst-rules}. Here collections of type and term
|
|
801 |
variables are generalized simultaneously, specified by the given |
|
802 |
basic names. |
|
803 |
||
| 40406 | 804 |
\item \verb|Thm.instantiate|~\isa{{\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub s{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}} corresponds to the \isa{instantiate} rules
|
| 30296 | 805 |
of \figref{fig:subst-rules}. Type variables are substituted before
|
| 40406 | 806 |
term variables. Note that the types in \isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec x\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}}
|
| 30296 | 807 |
refer to the instantiated versions. |
808 |
||
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
809 |
\item \verb|Thm.add_axiom|~\isa{ctxt\ {\isaliteral{28}{\isacharparenleft}}name{\isaliteral{2C}{\isacharcomma}}\ A{\isaliteral{29}{\isacharparenright}}} declares an
|
| 35927 | 810 |
arbitrary proposition as axiom, and retrieves it as a theorem from |
811 |
the resulting theory, cf.\ \isa{axiom} in
|
|
812 |
\figref{fig:prim-rules}. Note that the low-level representation in
|
|
813 |
the axiom table may differ slightly from the returned theorem. |
|
| 30296 | 814 |
|
| 40406 | 815 |
\item \verb|Thm.add_oracle|~\isa{{\isaliteral{28}{\isacharparenleft}}binding{\isaliteral{2C}{\isacharcomma}}\ oracle{\isaliteral{29}{\isacharparenright}}} produces a named
|
| 30296 | 816 |
oracle rule, essentially generating arbitrary axioms on the fly, |
817 |
cf.\ \isa{axiom} in \figref{fig:prim-rules}.
|
|
818 |
||
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
819 |
\item \verb|Thm.add_def|~\isa{ctxt\ unchecked\ overloaded\ {\isaliteral{28}{\isacharparenleft}}name{\isaliteral{2C}{\isacharcomma}}\ c\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t{\isaliteral{29}{\isacharparenright}}} states a definitional axiom for an existing constant
|
| 35927 | 820 |
\isa{c}. Dependencies are recorded via \verb|Theory.add_deps|,
|
821 |
unless the \isa{unchecked} option is set. Note that the
|
|
822 |
low-level representation in the axiom table may differ slightly from |
|
823 |
the returned theorem. |
|
| 30296 | 824 |
|
|
42401
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
825 |
\item \verb|Theory.add_deps|~\isa{ctxt\ name\ c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec d\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7369676D613E}{\isasymsigma}}}
|
|
9bfaf6819291
updated some theory primitives, which now depend on auxiliary context;
wenzelm
parents:
40406
diff
changeset
|
826 |
declares dependencies of a named specification for constant \isa{c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7461753E}{\isasymtau}}}, relative to existing specifications for constants \isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec d\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isaliteral{5C3C7369676D613E}{\isasymsigma}}}.
|
| 30296 | 827 |
|
828 |
\end{description}%
|
|
829 |
\end{isamarkuptext}%
|
|
830 |
\isamarkuptrue% |
|
831 |
% |
|
832 |
\endisatagmlref |
|
833 |
{\isafoldmlref}%
|
|
834 |
% |
|
835 |
\isadelimmlref |
|
836 |
% |
|
837 |
\endisadelimmlref |
|
838 |
% |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
839 |
\isadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
840 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
841 |
\endisadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
842 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
843 |
\isatagmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
844 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
845 |
\begin{isamarkuptext}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
846 |
\begin{matharray}{rcl}
|
| 40406 | 847 |
\indexdef{}{ML antiquotation}{ctyp}\hypertarget{ML antiquotation.ctyp}{\hyperlink{ML antiquotation.ctyp}{\mbox{\isa{ctyp}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
848 |
\indexdef{}{ML antiquotation}{cterm}\hypertarget{ML antiquotation.cterm}{\hyperlink{ML antiquotation.cterm}{\mbox{\isa{cterm}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
849 |
\indexdef{}{ML antiquotation}{cprop}\hypertarget{ML antiquotation.cprop}{\hyperlink{ML antiquotation.cprop}{\mbox{\isa{cprop}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
850 |
\indexdef{}{ML antiquotation}{thm}\hypertarget{ML antiquotation.thm}{\hyperlink{ML antiquotation.thm}{\mbox{\isa{thm}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
851 |
\indexdef{}{ML antiquotation}{thms}\hypertarget{ML antiquotation.thms}{\hyperlink{ML antiquotation.thms}{\mbox{\isa{thms}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
852 |
\indexdef{}{ML antiquotation}{lemma}\hypertarget{ML antiquotation.lemma}{\hyperlink{ML antiquotation.lemma}{\mbox{\isa{lemma}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\
|
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
853 |
\end{matharray}
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
854 |
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
855 |
\begin{railoutput}
|
| 42662 | 856 |
\rail@begin{1}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
857 |
\rail@term{\hyperlink{ML antiquotation.ctyp}{\mbox{\isa{ctyp}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
858 |
\rail@nont{\isa{typ}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
859 |
\rail@end |
| 42662 | 860 |
\rail@begin{1}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
861 |
\rail@term{\hyperlink{ML antiquotation.cterm}{\mbox{\isa{cterm}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
862 |
\rail@nont{\isa{term}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
863 |
\rail@end |
| 42662 | 864 |
\rail@begin{1}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
865 |
\rail@term{\hyperlink{ML antiquotation.cprop}{\mbox{\isa{cprop}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
866 |
\rail@nont{\isa{prop}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
867 |
\rail@end |
| 42662 | 868 |
\rail@begin{1}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
869 |
\rail@term{\hyperlink{ML antiquotation.thm}{\mbox{\isa{thm}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
870 |
\rail@nont{\isa{thmref}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
871 |
\rail@end |
| 42662 | 872 |
\rail@begin{1}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
873 |
\rail@term{\hyperlink{ML antiquotation.thms}{\mbox{\isa{thms}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
874 |
\rail@nont{\isa{thmrefs}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
875 |
\rail@end |
| 42662 | 876 |
\rail@begin{6}{}
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
877 |
\rail@term{\hyperlink{ML antiquotation.lemma}{\mbox{\isa{lemma}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
878 |
\rail@bar |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
879 |
\rail@nextbar{1}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
880 |
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
|
|
42517
b68e1c27709a
simplified keyword markup (without formal checking);
wenzelm
parents:
42510
diff
changeset
|
881 |
\rail@term{\isa{\isakeyword{open}}}[]
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
882 |
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
883 |
\rail@endbar |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
884 |
\rail@plus |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
885 |
\rail@plus |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
886 |
\rail@nont{\isa{prop}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
887 |
\rail@nextplus{1}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
888 |
\rail@endplus |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
889 |
\rail@nextplus{2}
|
|
42517
b68e1c27709a
simplified keyword markup (without formal checking);
wenzelm
parents:
42510
diff
changeset
|
890 |
\rail@cterm{\isa{\isakeyword{and}}}[]
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
891 |
\rail@endplus |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
892 |
\rail@cr{4}
|
|
42517
b68e1c27709a
simplified keyword markup (without formal checking);
wenzelm
parents:
42510
diff
changeset
|
893 |
\rail@term{\isa{\isakeyword{by}}}[]
|
|
42510
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
894 |
\rail@nont{\isa{method}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
895 |
\rail@bar |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
896 |
\rail@nextbar{5}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
897 |
\rail@nont{\isa{method}}[]
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
898 |
\rail@endbar |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
899 |
\rail@end |
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
900 |
\end{railoutput}
|
|
b9c106763325
use @{rail} antiquotation (with some nested markup);
wenzelm
parents:
42401
diff
changeset
|
901 |
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
902 |
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
903 |
\begin{description}
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
904 |
|
| 40406 | 905 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}ctyp\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{7D}{\isacharbraceright}}} produces a certified type wrt.\ the
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
906 |
current background theory --- as abstract value of type \verb|ctyp|. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
907 |
|
| 40406 | 908 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}cterm\ t{\isaliteral{7D}{\isacharbraceright}}} and \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}cprop\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{7D}{\isacharbraceright}}} produce a
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
909 |
certified term wrt.\ the current background theory --- as abstract |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
910 |
value of type \verb|cterm|. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
911 |
|
| 40406 | 912 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}thm\ a{\isaliteral{7D}{\isacharbraceright}}} produces a singleton fact --- as abstract
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
913 |
value of type \verb|thm|. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
914 |
|
| 40406 | 915 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}thms\ a{\isaliteral{7D}{\isacharbraceright}}} produces a general fact --- as abstract
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
916 |
value of type \verb|thm list|. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
917 |
|
| 40406 | 918 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}lemma\ {\isaliteral{5C3C7068693E}{\isasymphi}}\ by\ meth{\isaliteral{7D}{\isacharbraceright}}} produces a fact that is proven on
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
919 |
the spot according to the minimal proof, which imitates a terminal |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
920 |
Isar proof. The result is an abstract value of type \verb|thm| |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
921 |
or \verb|thm list|, depending on the number of propositions |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
922 |
given here. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
923 |
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
924 |
The internal derivation object lacks a proper theorem name, but it |
| 40406 | 925 |
is formally closed, unless the \isa{{\isaliteral{28}{\isacharparenleft}}open{\isaliteral{29}{\isacharparenright}}} option is specified
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
926 |
(this may impact performance of applications with proof terms). |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
927 |
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
928 |
Since ML antiquotations are always evaluated at compile-time, there |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
929 |
is no run-time overhead even for non-trivial proofs. Nonetheless, |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
930 |
the justification is syntactically limited to a single \hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}} step. More complex Isar proofs should be done in regular
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
931 |
theory source, before compiling the corresponding ML text that uses |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
932 |
the result. |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
933 |
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
934 |
\end{description}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
935 |
\end{isamarkuptext}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
936 |
\isamarkuptrue% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
937 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
938 |
\endisatagmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
939 |
{\isafoldmlantiq}%
|
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
940 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
941 |
\isadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
942 |
% |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
943 |
\endisadelimmlantiq |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
944 |
% |
| 46254 | 945 |
\isamarkupsubsection{Auxiliary connectives \label{sec:logic-aux}%
|
| 30296 | 946 |
} |
947 |
\isamarkuptrue% |
|
948 |
% |
|
949 |
\begin{isamarkuptext}%
|
|
| 46254 | 950 |
Theory \isa{Pure} provides a few auxiliary connectives
|
951 |
that are defined on top of the primitive ones, see |
|
952 |
\figref{fig:pure-aux}. These special constants are useful in
|
|
953 |
certain internal encodings, and are normally not directly exposed to |
|
954 |
the user. |
|
| 30296 | 955 |
|
956 |
\begin{figure}[htb]
|
|
957 |
\begin{center}
|
|
958 |
\begin{tabular}{ll}
|
|
| 40406 | 959 |
\isa{conjunction\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ prop\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ prop\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ prop} & (infix \isa{{\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}}) \\
|
960 |
\isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ A\ {\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}\ B\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}C{\isaliteral{2E}{\isachardot}}\ {\isaliteral{28}{\isacharparenleft}}A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ C{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ C{\isaliteral{29}{\isacharparenright}}} \\[1ex]
|
|
961 |
\isa{prop\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ prop\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ prop} & (prefix \isa{{\isaliteral{23}{\isacharhash}}}, suppressed) \\
|
|
962 |
\isa{{\isaliteral{23}{\isacharhash}}A\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ A} \\[1ex]
|
|
963 |
\isa{term\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ prop} & (prefix \isa{TERM}) \\
|
|
964 |
\isa{term\ x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}A{\isaliteral{2E}{\isachardot}}\ A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A{\isaliteral{29}{\isacharparenright}}} \\[1ex]
|
|
965 |
\isa{TYPE\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ itself} & (prefix \isa{TYPE}) \\
|
|
966 |
\isa{{\isaliteral{28}{\isacharparenleft}}unspecified{\isaliteral{29}{\isacharparenright}}} \\
|
|
| 30296 | 967 |
\end{tabular}
|
968 |
\caption{Definitions of auxiliary connectives}\label{fig:pure-aux}
|
|
969 |
\end{center}
|
|
970 |
\end{figure}
|
|
971 |
||
| 40406 | 972 |
The introduction \isa{A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A\ {\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}\ B}, and eliminations
|
973 |
(projections) \isa{A\ {\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}\ B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A} and \isa{A\ {\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}\ B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B} are
|
|
| 35001 | 974 |
available as derived rules. Conjunction allows to treat |
975 |
simultaneous assumptions and conclusions uniformly, e.g.\ consider |
|
| 40406 | 976 |
\isa{A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ C\ {\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}\ D}. In particular, the goal mechanism
|
| 35001 | 977 |
represents multiple claims as explicit conjunction internally, but |
978 |
this is refined (via backwards introduction) into separate sub-goals |
|
979 |
before the user commences the proof; the final result is projected |
|
980 |
into a list of theorems using eliminations (cf.\ |
|
| 30296 | 981 |
\secref{sec:tactical-goals}).
|
982 |
||
| 40406 | 983 |
The \isa{prop} marker (\isa{{\isaliteral{23}{\isacharhash}}}) makes arbitrarily complex
|
984 |
propositions appear as atomic, without changing the meaning: \isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ A} and \isa{{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{23}{\isacharhash}}A} are interchangeable. See
|
|
| 30296 | 985 |
\secref{sec:tactical-goals} for specific operations.
|
986 |
||
987 |
The \isa{term} marker turns any well-typed term into a derivable
|
|
| 40406 | 988 |
proposition: \isa{{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ TERM\ t} holds unconditionally. Although
|
| 30296 | 989 |
this is logically vacuous, it allows to treat terms and proofs |
990 |
uniformly, similar to a type-theoretic framework. |
|
991 |
||
992 |
The \isa{TYPE} constructor is the canonical representative of
|
|
| 40406 | 993 |
the unspecified type \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ itself}; it essentially injects the
|
| 30296 | 994 |
language of types into that of terms. There is specific notation |
| 40406 | 995 |
\isa{TYPE{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}} for \isa{TYPE\isaliteral{5C3C5E627375623E}{}\isactrlbsub {\isaliteral{5C3C7461753E}{\isasymtau}}\ itself\isaliteral{5C3C5E657375623E}{}\isactrlesub }.
|
996 |
Although being devoid of any particular meaning, the term \isa{TYPE{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}} accounts for the type \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} within the term
|
|
997 |
language. In particular, \isa{TYPE{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{29}{\isacharparenright}}} may be used as formal
|
|
| 30296 | 998 |
argument in primitive definitions, in order to circumvent hidden |
| 40406 | 999 |
polymorphism (cf.\ \secref{sec:terms}). For example, \isa{c\ TYPE{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ A{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5D}{\isacharbrackright}}} defines \isa{c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ itself\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ prop} in terms of
|
| 30296 | 1000 |
a proposition \isa{A} that depends on an additional type
|
1001 |
argument, which is essentially a predicate on types.% |
|
1002 |
\end{isamarkuptext}%
|
|
1003 |
\isamarkuptrue% |
|
1004 |
% |
|
1005 |
\isadelimmlref |
|
1006 |
% |
|
1007 |
\endisadelimmlref |
|
1008 |
% |
|
1009 |
\isatagmlref |
|
1010 |
% |
|
1011 |
\begin{isamarkuptext}%
|
|
1012 |
\begin{mldecls}
|
|
1013 |
\indexdef{}{ML}{Conjunction.intr}\verb|Conjunction.intr: thm -> thm -> thm| \\
|
|
1014 |
\indexdef{}{ML}{Conjunction.elim}\verb|Conjunction.elim: thm -> thm * thm| \\
|
|
1015 |
\indexdef{}{ML}{Drule.mk\_term}\verb|Drule.mk_term: cterm -> thm| \\
|
|
1016 |
\indexdef{}{ML}{Drule.dest\_term}\verb|Drule.dest_term: thm -> cterm| \\
|
|
1017 |
\indexdef{}{ML}{Logic.mk\_type}\verb|Logic.mk_type: typ -> term| \\
|
|
1018 |
\indexdef{}{ML}{Logic.dest\_type}\verb|Logic.dest_type: term -> typ| \\
|
|
1019 |
\end{mldecls}
|
|
1020 |
||
1021 |
\begin{description}
|
|
1022 |
||
| 40406 | 1023 |
\item \verb|Conjunction.intr| derives \isa{A\ {\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}\ B} from \isa{A} and \isa{B}.
|
| 30296 | 1024 |
|
1025 |
\item \verb|Conjunction.elim| derives \isa{A} and \isa{B}
|
|
| 40406 | 1026 |
from \isa{A\ {\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}{\isaliteral{26}{\isacharampersand}}\ B}.
|
| 30296 | 1027 |
|
1028 |
\item \verb|Drule.mk_term| derives \isa{TERM\ t}.
|
|
1029 |
||
1030 |
\item \verb|Drule.dest_term| recovers term \isa{t} from \isa{TERM\ t}.
|
|
1031 |
||
| 40406 | 1032 |
\item \verb|Logic.mk_type|~\isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} produces the term \isa{TYPE{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}}.
|
| 30296 | 1033 |
|
| 40406 | 1034 |
\item \verb|Logic.dest_type|~\isa{TYPE{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}} recovers the type
|
1035 |
\isa{{\isaliteral{5C3C7461753E}{\isasymtau}}}.
|
|
| 30296 | 1036 |
|
1037 |
\end{description}%
|
|
1038 |
\end{isamarkuptext}%
|
|
1039 |
\isamarkuptrue% |
|
1040 |
% |
|
1041 |
\endisatagmlref |
|
1042 |
{\isafoldmlref}%
|
|
1043 |
% |
|
1044 |
\isadelimmlref |
|
1045 |
% |
|
1046 |
\endisadelimmlref |
|
1047 |
% |
|
1048 |
\isamarkupsection{Object-level rules \label{sec:obj-rules}%
|
|
1049 |
} |
|
1050 |
\isamarkuptrue% |
|
1051 |
% |
|
1052 |
\begin{isamarkuptext}%
|
|
1053 |
The primitive inferences covered so far mostly serve foundational |
|
1054 |
purposes. User-level reasoning usually works via object-level rules |
|
1055 |
that are represented as theorems of Pure. Composition of rules |
|
1056 |
involves \emph{backchaining}, \emph{higher-order unification} modulo
|
|
| 40406 | 1057 |
\isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5C3C626574613E}{\isasymbeta}}{\isaliteral{5C3C6574613E}{\isasymeta}}}-conversion of \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}}-terms, and so-called
|
1058 |
\emph{lifting} of rules into a context of \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}} and \isa{{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}} connectives. Thus the full power of higher-order Natural
|
|
| 30296 | 1059 |
Deduction in Isabelle/Pure becomes readily available.% |
1060 |
\end{isamarkuptext}%
|
|
1061 |
\isamarkuptrue% |
|
1062 |
% |
|
1063 |
\isamarkupsubsection{Hereditary Harrop Formulae%
|
|
1064 |
} |
|
1065 |
\isamarkuptrue% |
|
1066 |
% |
|
1067 |
\begin{isamarkuptext}%
|
|
1068 |
The idea of object-level rules is to model Natural Deduction |
|
1069 |
inferences in the style of Gentzen \cite{Gentzen:1935}, but we allow
|
|
1070 |
arbitrary nesting similar to \cite{extensions91}. The most basic
|
|
1071 |
rule format is that of a \emph{Horn Clause}:
|
|
1072 |
\[ |
|
| 40406 | 1073 |
\infer{\isa{A}}{\isa{A\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}} & \isa{{\isaliteral{5C3C646F74733E}{\isasymdots}}} & \isa{A\isaliteral{5C3C5E7375623E}{}\isactrlsub n}}
|
| 30296 | 1074 |
\] |
| 40406 | 1075 |
where \isa{A{\isaliteral{2C}{\isacharcomma}}\ A\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ A\isaliteral{5C3C5E7375623E}{}\isactrlsub n} are atomic propositions
|
| 30296 | 1076 |
of the framework, usually of the form \isa{Trueprop\ B}, where
|
1077 |
\isa{B} is a (compound) object-level statement. This
|
|
1078 |
object-level inference corresponds to an iterated implication in |
|
1079 |
Pure like this: |
|
1080 |
\[ |
|
| 40406 | 1081 |
\isa{A\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ A\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A}
|
| 30296 | 1082 |
\] |
| 40406 | 1083 |
As an example consider conjunction introduction: \isa{A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A\ {\isaliteral{5C3C616E643E}{\isasymand}}\ B}. Any parameters occurring in such rule statements are
|
| 30296 | 1084 |
conceptionally treated as arbitrary: |
1085 |
\[ |
|
| 40406 | 1086 |
\isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{2E}{\isachardot}}\ A\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub m\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ A\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub m\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub m}
|
| 30296 | 1087 |
\] |
1088 |
||
| 40406 | 1089 |
Nesting of rules means that the positions of \isa{A\isaliteral{5C3C5E7375623E}{}\isactrlsub i} may
|
| 30296 | 1090 |
again hold compound rules, not just atomic propositions. |
1091 |
Propositions of this format are called \emph{Hereditary Harrop
|
|
1092 |
Formulae} in the literature \cite{Miller:1991}. Here we give an
|
|
1093 |
inductive characterization as follows: |
|
1094 |
||
1095 |
\medskip |
|
1096 |
\begin{tabular}{ll}
|
|
| 40406 | 1097 |
\isa{\isaliteral{5C3C5E626F6C643E}{}\isactrlbold x} & set of variables \\
|
1098 |
\isa{\isaliteral{5C3C5E626F6C643E}{}\isactrlbold A} & set of atomic propositions \\
|
|
1099 |
\isa{\isaliteral{5C3C5E626F6C643E}{}\isactrlbold H\ \ {\isaliteral{3D}{\isacharequal}}\ \ {\isaliteral{5C3C416E643E}{\isasymAnd}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold x\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{2E}{\isachardot}}\ \isaliteral{5C3C5E626F6C643E}{}\isactrlbold H\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ \isaliteral{5C3C5E626F6C643E}{}\isactrlbold A} & set of Hereditary Harrop Formulas \\
|
|
| 30296 | 1100 |
\end{tabular}
|
1101 |
\medskip |
|
1102 |
||
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
1103 |
Thus we essentially impose nesting levels on propositions formed |
| 40406 | 1104 |
from \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}} and \isa{{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}}. At each level there is a prefix
|
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
36345
diff
changeset
|
1105 |
of parameters and compound premises, concluding an atomic |
| 40406 | 1106 |
proposition. Typical examples are \isa{{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}}-introduction \isa{{\isaliteral{28}{\isacharparenleft}}A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ B} or mathematical induction \isa{P\ {\isadigit{0}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}n{\isaliteral{2E}{\isachardot}}\ P\ n\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ {\isaliteral{28}{\isacharparenleft}}Suc\ n{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ n}. Even deeper nesting occurs in well-founded
|
1107 |
induction \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}x{\isaliteral{2E}{\isachardot}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}y{\isaliteral{2E}{\isachardot}}\ y\ {\isaliteral{5C3C707265633E}{\isasymprec}}\ x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ y{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ x{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ x}, but this
|
|
| 35001 | 1108 |
already marks the limit of rule complexity that is usually seen in |
1109 |
practice. |
|
| 30296 | 1110 |
|
1111 |
\medskip Regular user-level inferences in Isabelle/Pure always |
|
1112 |
maintain the following canonical form of results: |
|
1113 |
||
1114 |
\begin{itemize}
|
|
1115 |
||
| 40406 | 1116 |
\item Normalization by \isa{{\isaliteral{28}{\isacharparenleft}}A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}x{\isaliteral{2E}{\isachardot}}\ B\ x{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}x{\isaliteral{2E}{\isachardot}}\ A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B\ x{\isaliteral{29}{\isacharparenright}}},
|
| 30296 | 1117 |
which is a theorem of Pure, means that quantifiers are pushed in |
1118 |
front of implication at each level of nesting. The normal form is a |
|
1119 |
Hereditary Harrop Formula. |
|
1120 |
||
1121 |
\item The outermost prefix of parameters is represented via |
|
| 40406 | 1122 |
schematic variables: instead of \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{2E}{\isachardot}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec H\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x} we have \isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec H\ {\isaliteral{3F}{\isacharquery}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A\ {\isaliteral{3F}{\isacharquery}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x}.
|
| 30296 | 1123 |
Note that this representation looses information about the order of |
1124 |
parameters, and vacuous quantifiers vanish automatically. |
|
1125 |
||
1126 |
\end{itemize}%
|
|
1127 |
\end{isamarkuptext}%
|
|
1128 |
\isamarkuptrue% |
|
1129 |
% |
|
1130 |
\isadelimmlref |
|
1131 |
% |
|
1132 |
\endisadelimmlref |
|
1133 |
% |
|
1134 |
\isatagmlref |
|
1135 |
% |
|
1136 |
\begin{isamarkuptext}%
|
|
1137 |
\begin{mldecls}
|
|
|
30552
58db56278478
provide Simplifier.norm_hhf(_protect) as regular simplifier operation;
wenzelm
parents:
30355
diff
changeset
|
1138 |
\indexdef{}{ML}{Simplifier.norm\_hhf}\verb|Simplifier.norm_hhf: thm -> thm| \\
|
| 30296 | 1139 |
\end{mldecls}
|
1140 |
||
1141 |
\begin{description}
|
|
1142 |
||
|
30552
58db56278478
provide Simplifier.norm_hhf(_protect) as regular simplifier operation;
wenzelm
parents:
30355
diff
changeset
|
1143 |
\item \verb|Simplifier.norm_hhf|~\isa{thm} normalizes the given
|
| 30296 | 1144 |
theorem according to the canonical form specified above. This is |
1145 |
occasionally helpful to repair some low-level tools that do not |
|
1146 |
handle Hereditary Harrop Formulae properly. |
|
1147 |
||
1148 |
\end{description}%
|
|
1149 |
\end{isamarkuptext}%
|
|
1150 |
\isamarkuptrue% |
|
1151 |
% |
|
1152 |
\endisatagmlref |
|
1153 |
{\isafoldmlref}%
|
|
1154 |
% |
|
1155 |
\isadelimmlref |
|
1156 |
% |
|
1157 |
\endisadelimmlref |
|
1158 |
% |
|
1159 |
\isamarkupsubsection{Rule composition%
|
|
1160 |
} |
|
1161 |
\isamarkuptrue% |
|
1162 |
% |
|
1163 |
\begin{isamarkuptext}%
|
|
1164 |
The rule calculus of Isabelle/Pure provides two main inferences: |
|
1165 |
\hyperlink{inference.resolution}{\mbox{\isa{resolution}}} (i.e.\ back-chaining of rules) and
|
|
1166 |
\hyperlink{inference.assumption}{\mbox{\isa{assumption}}} (i.e.\ closing a branch), both modulo
|
|
1167 |
higher-order unification. There are also combined variants, notably |
|
| 40406 | 1168 |
\hyperlink{inference.elim-resolution}{\mbox{\isa{elim{\isaliteral{5F}{\isacharunderscore}}resolution}}} and \hyperlink{inference.dest-resolution}{\mbox{\isa{dest{\isaliteral{5F}{\isacharunderscore}}resolution}}}.
|
| 30296 | 1169 |
|
1170 |
To understand the all-important \hyperlink{inference.resolution}{\mbox{\isa{resolution}}} principle,
|
|
1171 |
we first consider raw \indexdef{}{inference}{composition}\hypertarget{inference.composition}{\hyperlink{inference.composition}{\mbox{\isa{composition}}}} (modulo
|
|
| 40406 | 1172 |
higher-order unification with substitution \isa{{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}}):
|
| 30296 | 1173 |
\[ |
| 40406 | 1174 |
\infer[(\indexdef{}{inference}{composition}\hypertarget{inference.composition}{\hyperlink{inference.composition}{\mbox{\isa{composition}}}})]{\isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec A{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ C{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}}}
|
1175 |
{\isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B} & \isa{B{\isaliteral{27}{\isacharprime}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ C} & \isa{B{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}\ {\isaliteral{3D}{\isacharequal}}\ B{\isaliteral{27}{\isacharprime}}{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}}}
|
|
| 30296 | 1176 |
\] |
1177 |
Here the conclusion of the first rule is unified with the premise of |
|
1178 |
the second; the resulting rule instance inherits the premises of the |
|
1179 |
first and conclusion of the second. Note that \isa{C} can again
|
|
1180 |
consist of iterated implications. We can also permute the premises |
|
| 40406 | 1181 |
of the second rule back-and-forth in order to compose with \isa{B{\isaliteral{27}{\isacharprime}}} in any position (subsequently we shall always refer to
|
| 30296 | 1182 |
position 1 w.l.o.g.). |
1183 |
||
1184 |
In \hyperlink{inference.composition}{\mbox{\isa{composition}}} the internal structure of the common
|
|
| 40406 | 1185 |
part \isa{B} and \isa{B{\isaliteral{27}{\isacharprime}}} is not taken into account. For
|
| 30296 | 1186 |
proper \hyperlink{inference.resolution}{\mbox{\isa{resolution}}} we require \isa{B} to be atomic,
|
| 40406 | 1187 |
and explicitly observe the structure \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{2E}{\isachardot}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec H\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B{\isaliteral{27}{\isacharprime}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x} of the premise of the second rule. The
|
| 30296 | 1188 |
idea is to adapt the first rule by ``lifting'' it into this context, |
1189 |
by means of iterated application of the following inferences: |
|
1190 |
\[ |
|
| 40406 | 1191 |
\infer[(\indexdef{}{inference}{imp\_lift}\hypertarget{inference.imp-lift}{\hyperlink{inference.imp-lift}{\mbox{\isa{imp{\isaliteral{5F}{\isacharunderscore}}lift}}}})]{\isa{{\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec H\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec A{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec H\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B{\isaliteral{29}{\isacharparenright}}}}{\isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B}}
|
| 30296 | 1192 |
\] |
1193 |
\[ |
|
| 40406 | 1194 |
\infer[(\indexdef{}{inference}{all\_lift}\hypertarget{inference.all-lift}{\hyperlink{inference.all-lift}{\mbox{\isa{all{\isaliteral{5F}{\isacharunderscore}}lift}}}})]{\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{2E}{\isachardot}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec A\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{3F}{\isacharquery}}\isaliteral{5C3C5E7665633E}{}\isactrlvec a\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{2E}{\isachardot}}\ B\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{3F}{\isacharquery}}\isaliteral{5C3C5E7665633E}{}\isactrlvec a\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}}}{\isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec A\ {\isaliteral{3F}{\isacharquery}}\isaliteral{5C3C5E7665633E}{}\isactrlvec a\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B\ {\isaliteral{3F}{\isacharquery}}\isaliteral{5C3C5E7665633E}{}\isactrlvec a}}
|
| 30296 | 1195 |
\] |
1196 |
By combining raw composition with lifting, we get full \hyperlink{inference.resolution}{\mbox{\isa{resolution}}} as follows:
|
|
1197 |
\[ |
|
1198 |
\infer[(\indexdef{}{inference}{resolution}\hypertarget{inference.resolution}{\hyperlink{inference.resolution}{\mbox{\isa{resolution}}}})]
|
|
| 40406 | 1199 |
{\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{2E}{\isachardot}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec H\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec A\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{3F}{\isacharquery}}\isaliteral{5C3C5E7665633E}{}\isactrlvec a\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ C{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}}}
|
| 30296 | 1200 |
{\begin{tabular}{l}
|
| 40406 | 1201 |
\isa{\isaliteral{5C3C5E7665633E}{}\isactrlvec A\ {\isaliteral{3F}{\isacharquery}}\isaliteral{5C3C5E7665633E}{}\isactrlvec a\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B\ {\isaliteral{3F}{\isacharquery}}\isaliteral{5C3C5E7665633E}{}\isactrlvec a} \\
|
1202 |
\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{2E}{\isachardot}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec H\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B{\isaliteral{27}{\isacharprime}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ C} \\
|
|
1203 |
\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{2E}{\isachardot}}\ B\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{3F}{\isacharquery}}\isaliteral{5C3C5E7665633E}{}\isactrlvec a\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}\ {\isaliteral{3D}{\isacharequal}}\ B{\isaliteral{27}{\isacharprime}}{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}} \\
|
|
| 30296 | 1204 |
\end{tabular}}
|
1205 |
\] |
|
1206 |
||
1207 |
Continued resolution of rules allows to back-chain a problem towards |
|
1208 |
more and sub-problems. Branches are closed either by resolving with |
|
1209 |
a rule of 0 premises, or by producing a ``short-circuit'' within a |
|
1210 |
solved situation (again modulo unification): |
|
1211 |
\[ |
|
| 40406 | 1212 |
\infer[(\indexdef{}{inference}{assumption}\hypertarget{inference.assumption}{\hyperlink{inference.assumption}{\mbox{\isa{assumption}}}})]{\isa{C{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}}}
|
1213 |
{\isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}\isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{2E}{\isachardot}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec H\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ A\ \isaliteral{5C3C5E7665633E}{}\isactrlvec x{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ C} & \isa{A{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}\ {\isaliteral{3D}{\isacharequal}}\ H\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{5C3C76617274686574613E}{\isasymvartheta}}}~~\text{(for some~\isa{i})}}
|
|
| 30296 | 1214 |
\] |
1215 |
||
| 40406 | 1216 |
FIXME \indexdef{}{inference}{elim\_resolution}\hypertarget{inference.elim-resolution}{\hyperlink{inference.elim-resolution}{\mbox{\isa{elim{\isaliteral{5F}{\isacharunderscore}}resolution}}}}, \indexdef{}{inference}{dest\_resolution}\hypertarget{inference.dest-resolution}{\hyperlink{inference.dest-resolution}{\mbox{\isa{dest{\isaliteral{5F}{\isacharunderscore}}resolution}}}}%
|
| 30296 | 1217 |
\end{isamarkuptext}%
|
1218 |
\isamarkuptrue% |
|
1219 |
% |
|
1220 |
\isadelimmlref |
|
1221 |
% |
|
1222 |
\endisadelimmlref |
|
1223 |
% |
|
1224 |
\isatagmlref |
|
1225 |
% |
|
1226 |
\begin{isamarkuptext}%
|
|
1227 |
\begin{mldecls}
|
|
| 46262 | 1228 |
\indexdef{}{ML infix}{RSN}\verb|infix RSN: thm * (int * thm) -> thm| \\
|
1229 |
\indexdef{}{ML infix}{RS}\verb|infix RS: thm * thm -> thm| \\
|
|
| 46256 | 1230 |
|
| 46262 | 1231 |
\indexdef{}{ML infix}{RLN}\verb|infix RLN: thm list * (int * thm list) -> thm list| \\
|
1232 |
\indexdef{}{ML infix}{RL}\verb|infix RL: thm list * thm list -> thm list| \\
|
|
| 46256 | 1233 |
|
| 46262 | 1234 |
\indexdef{}{ML infix}{MRS}\verb|infix MRS: thm list * thm -> thm| \\
|
1235 |
\indexdef{}{ML infix}{OF}\verb|infix OF: thm * thm list -> thm| \\
|
|
| 30296 | 1236 |
\end{mldecls}
|
1237 |
||
1238 |
\begin{description}
|
|
1239 |
||
| 46256 | 1240 |
\item \isa{rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ RSN\ {\isaliteral{28}{\isacharparenleft}}i{\isaliteral{2C}{\isacharcomma}}\ rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}} resolves the conclusion of
|
1241 |
\isa{rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}} with the \isa{i}-th premise of \isa{rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}},
|
|
1242 |
according to the \hyperlink{inference.resolution}{\mbox{\isa{resolution}}} principle explained above.
|
|
1243 |
Unless there is precisely one resolvent it raises exception \verb|THM|. |
|
1244 |
||
1245 |
This corresponds to the rule attribute \hyperlink{attribute.THEN}{\mbox{\isa{THEN}}} in Isar
|
|
1246 |
source language. |
|
1247 |
||
1248 |
\item \isa{rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ RS\ rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}} abbreviates \isa{rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ RS\ {\isaliteral{28}{\isacharparenleft}}{\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}}.
|
|
| 30296 | 1249 |
|
| 46256 | 1250 |
\item \isa{rules\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ RLN\ {\isaliteral{28}{\isacharparenleft}}i{\isaliteral{2C}{\isacharcomma}}\ rules\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}} joins lists of rules. For
|
1251 |
every \isa{rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}} in \isa{rules\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}} and \isa{rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}} in
|
|
1252 |
\isa{rules\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}}, it resolves the conclusion of \isa{rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}} with
|
|
1253 |
the \isa{i}-th premise of \isa{rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}}, accumulating multiple
|
|
1254 |
results in one big list. Note that such strict enumerations of |
|
1255 |
higher-order unifications can be inefficient compared to the lazy |
|
1256 |
variant seen in elementary tactics like \verb|resolve_tac|. |
|
1257 |
||
1258 |
\item \isa{rules\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ RL\ rules\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}} abbreviates \isa{rules\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ RLN\ {\isaliteral{28}{\isacharparenleft}}{\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ rules\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}}.
|
|
1259 |
||
1260 |
\item \isa{{\isaliteral{5B}{\isacharbrackleft}}rule\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ rule\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{5D}{\isacharbrackright}}\ MRS\ rule} resolves \isa{rule\isaliteral{5C3C5E697375623E}{}\isactrlisub i}
|
|
1261 |
against premise \isa{i} of \isa{rule}, for \isa{i\ {\isaliteral{3D}{\isacharequal}}\ n{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{1}}}. By working from right to left, newly emerging premises are
|
|
1262 |
concatenated in the result, without interfering. |
|
1263 |
||
1264 |
\item \isa{rule\ OF\ rules} abbreviates \isa{rules\ MRS\ rule}.
|
|
1265 |
||
1266 |
This corresponds to the rule attribute \hyperlink{attribute.OF}{\mbox{\isa{OF}}} in Isar
|
|
1267 |
source language. |
|
| 30296 | 1268 |
|
1269 |
\end{description}%
|
|
1270 |
\end{isamarkuptext}%
|
|
1271 |
\isamarkuptrue% |
|
1272 |
% |
|
1273 |
\endisatagmlref |
|
1274 |
{\isafoldmlref}%
|
|
1275 |
% |
|
1276 |
\isadelimmlref |
|
1277 |
% |
|
1278 |
\endisadelimmlref |
|
1279 |
% |
|
1280 |
\isadelimtheory |
|
1281 |
% |
|
1282 |
\endisadelimtheory |
|
1283 |
% |
|
1284 |
\isatagtheory |
|
1285 |
\isacommand{end}\isamarkupfalse%
|
|
1286 |
% |
|
1287 |
\endisatagtheory |
|
1288 |
{\isafoldtheory}%
|
|
1289 |
% |
|
1290 |
\isadelimtheory |
|
1291 |
% |
|
1292 |
\endisadelimtheory |
|
1293 |
\isanewline |
|
1294 |
\end{isabellebody}%
|
|
1295 |
%%% Local Variables: |
|
1296 |
%%% mode: latex |
|
1297 |
%%% TeX-master: "root" |
|
1298 |
%%% End: |