author | wenzelm |
Sat, 24 Oct 2009 17:49:44 +0200 | |
changeset 33088 | 757d7787b10c |
parent 32302 | aa48c2b8f8e0 |
child 35001 | 31f8d9eaceff |
permissions | -rw-r--r-- |
30296 | 1 |
% |
2 |
\begin{isabellebody}% |
|
3 |
\def\isabellecontext{Proof}% |
|
4 |
% |
|
5 |
\isadelimtheory |
|
6 |
% |
|
7 |
\endisadelimtheory |
|
8 |
% |
|
9 |
\isatagtheory |
|
10 |
\isacommand{theory}\isamarkupfalse% |
|
11 |
\ Proof\isanewline |
|
12 |
\isakeyword{imports}\ Base\isanewline |
|
13 |
\isakeyword{begin}% |
|
14 |
\endisatagtheory |
|
15 |
{\isafoldtheory}% |
|
16 |
% |
|
17 |
\isadelimtheory |
|
18 |
% |
|
19 |
\endisadelimtheory |
|
20 |
% |
|
21 |
\isamarkupchapter{Structured proofs% |
|
22 |
} |
|
23 |
\isamarkuptrue% |
|
24 |
% |
|
25 |
\isamarkupsection{Variables \label{sec:variables}% |
|
26 |
} |
|
27 |
\isamarkuptrue% |
|
28 |
% |
|
29 |
\begin{isamarkuptext}% |
|
30 |
Any variable that is not explicitly bound by \isa{{\isasymlambda}}-abstraction |
|
31 |
is considered as ``free''. Logically, free variables act like |
|
32 |
outermost universal quantification at the sequent level: \isa{A\isactrlisub {\isadigit{1}}{\isacharparenleft}x{\isacharparenright}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ A\isactrlisub n{\isacharparenleft}x{\isacharparenright}\ {\isasymturnstile}\ B{\isacharparenleft}x{\isacharparenright}} means that the result |
|
33 |
holds \emph{for all} values of \isa{x}. Free variables for |
|
34 |
terms (not types) can be fully internalized into the logic: \isa{{\isasymturnstile}\ B{\isacharparenleft}x{\isacharparenright}} and \isa{{\isasymturnstile}\ {\isasymAnd}x{\isachardot}\ B{\isacharparenleft}x{\isacharparenright}} are interchangeable, provided |
|
35 |
that \isa{x} does not occur elsewhere in the context. |
|
36 |
Inspecting \isa{{\isasymturnstile}\ {\isasymAnd}x{\isachardot}\ B{\isacharparenleft}x{\isacharparenright}} more closely, we see that inside the |
|
37 |
quantifier, \isa{x} is essentially ``arbitrary, but fixed'', |
|
38 |
while from outside it appears as a place-holder for instantiation |
|
39 |
(thanks to \isa{{\isasymAnd}} elimination). |
|
40 |
||
41 |
The Pure logic represents the idea of variables being either inside |
|
42 |
or outside the current scope by providing separate syntactic |
|
43 |
categories for \emph{fixed variables} (e.g.\ \isa{x}) vs.\ |
|
44 |
\emph{schematic variables} (e.g.\ \isa{{\isacharquery}x}). Incidently, a |
|
45 |
universal result \isa{{\isasymturnstile}\ {\isasymAnd}x{\isachardot}\ B{\isacharparenleft}x{\isacharparenright}} has the HHF normal form \isa{{\isasymturnstile}\ B{\isacharparenleft}{\isacharquery}x{\isacharparenright}}, which represents its generality nicely without requiring |
|
46 |
an explicit quantifier. The same principle works for type |
|
47 |
variables: \isa{{\isasymturnstile}\ B{\isacharparenleft}{\isacharquery}{\isasymalpha}{\isacharparenright}} represents the idea of ``\isa{{\isasymturnstile}\ {\isasymforall}{\isasymalpha}{\isachardot}\ B{\isacharparenleft}{\isasymalpha}{\isacharparenright}}'' without demanding a truly polymorphic framework. |
|
48 |
||
49 |
\medskip Additional care is required to treat type variables in a |
|
50 |
way that facilitates type-inference. In principle, term variables |
|
51 |
depend on type variables, which means that type variables would have |
|
52 |
to be declared first. For example, a raw type-theoretic framework |
|
53 |
would demand the context to be constructed in stages as follows: |
|
54 |
\isa{{\isasymGamma}\ {\isacharequal}\ {\isasymalpha}{\isacharcolon}\ type{\isacharcomma}\ x{\isacharcolon}\ {\isasymalpha}{\isacharcomma}\ a{\isacharcolon}\ A{\isacharparenleft}x\isactrlisub {\isasymalpha}{\isacharparenright}}. |
|
55 |
||
56 |
We allow a slightly less formalistic mode of operation: term |
|
57 |
variables \isa{x} are fixed without specifying a type yet |
|
58 |
(essentially \emph{all} potential occurrences of some instance |
|
59 |
\isa{x\isactrlisub {\isasymtau}} are fixed); the first occurrence of \isa{x} |
|
60 |
within a specific term assigns its most general type, which is then |
|
61 |
maintained consistently in the context. The above example becomes |
|
62 |
\isa{{\isasymGamma}\ {\isacharequal}\ x{\isacharcolon}\ term{\isacharcomma}\ {\isasymalpha}{\isacharcolon}\ type{\isacharcomma}\ A{\isacharparenleft}x\isactrlisub {\isasymalpha}{\isacharparenright}}, where type \isa{{\isasymalpha}} is fixed \emph{after} term \isa{x}, and the constraint |
|
63 |
\isa{x\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}} is an implicit consequence of the occurrence of |
|
64 |
\isa{x\isactrlisub {\isasymalpha}} in the subsequent proposition. |
|
65 |
||
66 |
This twist of dependencies is also accommodated by the reverse |
|
67 |
operation of exporting results from a context: a type variable |
|
68 |
\isa{{\isasymalpha}} is considered fixed as long as it occurs in some fixed |
|
69 |
term variable of the context. For example, exporting \isa{x{\isacharcolon}\ term{\isacharcomma}\ {\isasymalpha}{\isacharcolon}\ type\ {\isasymturnstile}\ x\isactrlisub {\isasymalpha}\ {\isacharequal}\ x\isactrlisub {\isasymalpha}} produces in the first step |
|
70 |
\isa{x{\isacharcolon}\ term\ {\isasymturnstile}\ x\isactrlisub {\isasymalpha}\ {\isacharequal}\ x\isactrlisub {\isasymalpha}} for fixed \isa{{\isasymalpha}}, |
|
71 |
and only in the second step \isa{{\isasymturnstile}\ {\isacharquery}x\isactrlisub {\isacharquery}\isactrlisub {\isasymalpha}\ {\isacharequal}\ {\isacharquery}x\isactrlisub {\isacharquery}\isactrlisub {\isasymalpha}} for schematic \isa{{\isacharquery}x} and \isa{{\isacharquery}{\isasymalpha}}. |
|
72 |
||
73 |
\medskip The Isabelle/Isar proof context manages the gory details of |
|
74 |
term vs.\ type variables, with high-level principles for moving the |
|
75 |
frontier between fixed and schematic variables. |
|
76 |
||
77 |
The \isa{add{\isacharunderscore}fixes} operation explictly declares fixed |
|
78 |
variables; the \isa{declare{\isacharunderscore}term} operation absorbs a term into |
|
79 |
a context by fixing new type variables and adding syntactic |
|
80 |
constraints. |
|
81 |
||
82 |
The \isa{export} operation is able to perform the main work of |
|
83 |
generalizing term and type variables as sketched above, assuming |
|
84 |
that fixing variables and terms have been declared properly. |
|
85 |
||
86 |
There \isa{import} operation makes a generalized fact a genuine |
|
87 |
part of the context, by inventing fixed variables for the schematic |
|
88 |
ones. The effect can be reversed by using \isa{export} later, |
|
89 |
potentially with an extended context; the result is equivalent to |
|
90 |
the original modulo renaming of schematic variables. |
|
91 |
||
92 |
The \isa{focus} operation provides a variant of \isa{import} |
|
93 |
for nested propositions (with explicit quantification): \isa{{\isasymAnd}x\isactrlisub {\isadigit{1}}\ {\isasymdots}\ x\isactrlisub n{\isachardot}\ B{\isacharparenleft}x\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ x\isactrlisub n{\isacharparenright}} is |
|
94 |
decomposed by inventing fixed variables \isa{x\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ x\isactrlisub n} for the body.% |
|
95 |
\end{isamarkuptext}% |
|
96 |
\isamarkuptrue% |
|
97 |
% |
|
98 |
\isadelimmlref |
|
99 |
% |
|
100 |
\endisadelimmlref |
|
101 |
% |
|
102 |
\isatagmlref |
|
103 |
% |
|
104 |
\begin{isamarkuptext}% |
|
105 |
\begin{mldecls} |
|
106 |
\indexdef{}{ML}{Variable.add\_fixes}\verb|Variable.add_fixes: |\isasep\isanewline% |
|
107 |
\verb| string list -> Proof.context -> string list * Proof.context| \\ |
|
108 |
\indexdef{}{ML}{Variable.variant\_fixes}\verb|Variable.variant_fixes: |\isasep\isanewline% |
|
109 |
\verb| string list -> Proof.context -> string list * Proof.context| \\ |
|
110 |
\indexdef{}{ML}{Variable.declare\_term}\verb|Variable.declare_term: term -> Proof.context -> Proof.context| \\ |
|
111 |
\indexdef{}{ML}{Variable.declare\_constraints}\verb|Variable.declare_constraints: term -> Proof.context -> Proof.context| \\ |
|
112 |
\indexdef{}{ML}{Variable.export}\verb|Variable.export: Proof.context -> Proof.context -> thm list -> thm list| \\ |
|
113 |
\indexdef{}{ML}{Variable.polymorphic}\verb|Variable.polymorphic: Proof.context -> term list -> term list| \\ |
|
31794
71af1fd6a5e4
renamed Variable.import_thms to Variable.import (back again cf. ed7aa5a350ef -- Alice is no longer supported);
wenzelm
parents:
30296
diff
changeset
|
114 |
\indexdef{}{ML}{Variable.import}\verb|Variable.import: bool -> thm list -> Proof.context ->|\isasep\isanewline% |
32302 | 115 |
\verb| (((ctyp * ctyp) list * (cterm * cterm) list) * thm list) * Proof.context| \\ |
32201
3689b647356d
updated Variable.focus, SUBPROOF, Obtain.result, Goal.finish;
wenzelm
parents:
31794
diff
changeset
|
116 |
\indexdef{}{ML}{Variable.focus}\verb|Variable.focus: cterm -> Proof.context -> ((string * cterm) list * cterm) * Proof.context| \\ |
30296 | 117 |
\end{mldecls} |
118 |
||
119 |
\begin{description} |
|
120 |
||
121 |
\item \verb|Variable.add_fixes|~\isa{xs\ ctxt} fixes term |
|
122 |
variables \isa{xs}, returning the resulting internal names. By |
|
123 |
default, the internal representation coincides with the external |
|
124 |
one, which also means that the given variables must not be fixed |
|
125 |
already. There is a different policy within a local proof body: the |
|
126 |
given names are just hints for newly invented Skolem variables. |
|
127 |
||
128 |
\item \verb|Variable.variant_fixes| is similar to \verb|Variable.add_fixes|, but always produces fresh variants of the given |
|
129 |
names. |
|
130 |
||
131 |
\item \verb|Variable.declare_term|~\isa{t\ ctxt} declares term |
|
132 |
\isa{t} to belong to the context. This automatically fixes new |
|
133 |
type variables, but not term variables. Syntactic constraints for |
|
134 |
type and term variables are declared uniformly, though. |
|
135 |
||
136 |
\item \verb|Variable.declare_constraints|~\isa{t\ ctxt} declares |
|
137 |
syntactic constraints from term \isa{t}, without making it part |
|
138 |
of the context yet. |
|
139 |
||
140 |
\item \verb|Variable.export|~\isa{inner\ outer\ thms} generalizes |
|
141 |
fixed type and term variables in \isa{thms} according to the |
|
142 |
difference of the \isa{inner} and \isa{outer} context, |
|
143 |
following the principles sketched above. |
|
144 |
||
145 |
\item \verb|Variable.polymorphic|~\isa{ctxt\ ts} generalizes type |
|
146 |
variables in \isa{ts} as far as possible, even those occurring |
|
147 |
in fixed term variables. The default policy of type-inference is to |
|
148 |
fix newly introduced type variables, which is essentially reversed |
|
149 |
with \verb|Variable.polymorphic|: here the given terms are detached |
|
150 |
from the context as far as possible. |
|
151 |
||
31794
71af1fd6a5e4
renamed Variable.import_thms to Variable.import (back again cf. ed7aa5a350ef -- Alice is no longer supported);
wenzelm
parents:
30296
diff
changeset
|
152 |
\item \verb|Variable.import|~\isa{open\ thms\ ctxt} invents fixed |
30296 | 153 |
type and term variables for the schematic ones occurring in \isa{thms}. The \isa{open} flag indicates whether the fixed names |
154 |
should be accessible to the user, otherwise newly introduced names |
|
155 |
are marked as ``internal'' (\secref{sec:names}). |
|
156 |
||
157 |
\item \verb|Variable.focus|~\isa{B} decomposes the outermost \isa{{\isasymAnd}} prefix of proposition \isa{B}. |
|
158 |
||
159 |
\end{description}% |
|
160 |
\end{isamarkuptext}% |
|
161 |
\isamarkuptrue% |
|
162 |
% |
|
163 |
\endisatagmlref |
|
164 |
{\isafoldmlref}% |
|
165 |
% |
|
166 |
\isadelimmlref |
|
167 |
% |
|
168 |
\endisadelimmlref |
|
169 |
% |
|
170 |
\isamarkupsection{Assumptions \label{sec:assumptions}% |
|
171 |
} |
|
172 |
\isamarkuptrue% |
|
173 |
% |
|
174 |
\begin{isamarkuptext}% |
|
175 |
An \emph{assumption} is a proposition that it is postulated in the |
|
176 |
current context. Local conclusions may use assumptions as |
|
177 |
additional facts, but this imposes implicit hypotheses that weaken |
|
178 |
the overall statement. |
|
179 |
||
180 |
Assumptions are restricted to fixed non-schematic statements, i.e.\ |
|
181 |
all generality needs to be expressed by explicit quantifiers. |
|
182 |
Nevertheless, the result will be in HHF normal form with outermost |
|
183 |
quantifiers stripped. For example, by assuming \isa{{\isasymAnd}x\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}{\isachardot}\ P\ x} we get \isa{{\isasymAnd}x\ {\isacharcolon}{\isacharcolon}\ {\isasymalpha}{\isachardot}\ P\ x\ {\isasymturnstile}\ P\ {\isacharquery}x} for schematic \isa{{\isacharquery}x} |
|
184 |
of fixed type \isa{{\isasymalpha}}. Local derivations accumulate more and |
|
185 |
more explicit references to hypotheses: \isa{A\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ A\isactrlisub n\ {\isasymturnstile}\ B} where \isa{A\isactrlisub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ A\isactrlisub n} needs to |
|
186 |
be covered by the assumptions of the current context. |
|
187 |
||
188 |
\medskip The \isa{add{\isacharunderscore}assms} operation augments the context by |
|
189 |
local assumptions, which are parameterized by an arbitrary \isa{export} rule (see below). |
|
190 |
||
191 |
The \isa{export} operation moves facts from a (larger) inner |
|
192 |
context into a (smaller) outer context, by discharging the |
|
193 |
difference of the assumptions as specified by the associated export |
|
194 |
rules. Note that the discharged portion is determined by the |
|
195 |
difference contexts, not the facts being exported! There is a |
|
196 |
separate flag to indicate a goal context, where the result is meant |
|
197 |
to refine an enclosing sub-goal of a structured proof state. |
|
198 |
||
199 |
\medskip The most basic export rule discharges assumptions directly |
|
200 |
by means of the \isa{{\isasymLongrightarrow}} introduction rule: |
|
201 |
\[ |
|
202 |
\infer[(\isa{{\isasymLongrightarrow}{\isacharunderscore}intro})]{\isa{{\isasymGamma}\ {\isacharbackslash}\ A\ {\isasymturnstile}\ A\ {\isasymLongrightarrow}\ B}}{\isa{{\isasymGamma}\ {\isasymturnstile}\ B}} |
|
203 |
\] |
|
204 |
||
205 |
The variant for goal refinements marks the newly introduced |
|
206 |
premises, which causes the canonical Isar goal refinement scheme to |
|
207 |
enforce unification with local premises within the goal: |
|
208 |
\[ |
|
209 |
\infer[(\isa{{\isacharhash}{\isasymLongrightarrow}{\isacharunderscore}intro})]{\isa{{\isasymGamma}\ {\isacharbackslash}\ A\ {\isasymturnstile}\ {\isacharhash}A\ {\isasymLongrightarrow}\ B}}{\isa{{\isasymGamma}\ {\isasymturnstile}\ B}} |
|
210 |
\] |
|
211 |
||
212 |
\medskip Alternative versions of assumptions may perform arbitrary |
|
213 |
transformations on export, as long as the corresponding portion of |
|
214 |
hypotheses is removed from the given facts. For example, a local |
|
215 |
definition works by fixing \isa{x} and assuming \isa{x\ {\isasymequiv}\ t}, |
|
216 |
with the following export rule to reverse the effect: |
|
217 |
\[ |
|
218 |
\infer[(\isa{{\isasymequiv}{\isacharminus}expand})]{\isa{{\isasymGamma}\ {\isacharbackslash}\ x\ {\isasymequiv}\ t\ {\isasymturnstile}\ B\ t}}{\isa{{\isasymGamma}\ {\isasymturnstile}\ B\ x}} |
|
219 |
\] |
|
220 |
This works, because the assumption \isa{x\ {\isasymequiv}\ t} was introduced in |
|
221 |
a context with \isa{x} being fresh, so \isa{x} does not |
|
222 |
occur in \isa{{\isasymGamma}} here.% |
|
223 |
\end{isamarkuptext}% |
|
224 |
\isamarkuptrue% |
|
225 |
% |
|
226 |
\isadelimmlref |
|
227 |
% |
|
228 |
\endisadelimmlref |
|
229 |
% |
|
230 |
\isatagmlref |
|
231 |
% |
|
232 |
\begin{isamarkuptext}% |
|
233 |
\begin{mldecls} |
|
234 |
\indexdef{}{ML type}{Assumption.export}\verb|type Assumption.export| \\ |
|
235 |
\indexdef{}{ML}{Assumption.assume}\verb|Assumption.assume: cterm -> thm| \\ |
|
236 |
\indexdef{}{ML}{Assumption.add\_assms}\verb|Assumption.add_assms: Assumption.export ->|\isasep\isanewline% |
|
237 |
\verb| cterm list -> Proof.context -> thm list * Proof.context| \\ |
|
238 |
\indexdef{}{ML}{Assumption.add\_assumes}\verb|Assumption.add_assumes: |\isasep\isanewline% |
|
239 |
\verb| cterm list -> Proof.context -> thm list * Proof.context| \\ |
|
240 |
\indexdef{}{ML}{Assumption.export}\verb|Assumption.export: bool -> Proof.context -> Proof.context -> thm -> thm| \\ |
|
241 |
\end{mldecls} |
|
242 |
||
243 |
\begin{description} |
|
244 |
||
245 |
\item \verb|Assumption.export| represents arbitrary export |
|
246 |
rules, which is any function of type \verb|bool -> cterm list -> thm -> thm|, |
|
247 |
where the \verb|bool| indicates goal mode, and the \verb|cterm list| the collection of assumptions to be discharged |
|
248 |
simultaneously. |
|
249 |
||
250 |
\item \verb|Assumption.assume|~\isa{A} turns proposition \isa{A} into a raw assumption \isa{A\ {\isasymturnstile}\ A{\isacharprime}}, where the conclusion |
|
251 |
\isa{A{\isacharprime}} is in HHF normal form. |
|
252 |
||
253 |
\item \verb|Assumption.add_assms|~\isa{r\ As} augments the context |
|
254 |
by assumptions \isa{As} with export rule \isa{r}. The |
|
255 |
resulting facts are hypothetical theorems as produced by the raw |
|
256 |
\verb|Assumption.assume|. |
|
257 |
||
258 |
\item \verb|Assumption.add_assumes|~\isa{As} is a special case of |
|
259 |
\verb|Assumption.add_assms| where the export rule performs \isa{{\isasymLongrightarrow}{\isacharunderscore}intro} or \isa{{\isacharhash}{\isasymLongrightarrow}{\isacharunderscore}intro}, depending on goal mode. |
|
260 |
||
261 |
\item \verb|Assumption.export|~\isa{is{\isacharunderscore}goal\ inner\ outer\ thm} |
|
262 |
exports result \isa{thm} from the the \isa{inner} context |
|
263 |
back into the \isa{outer} one; \isa{is{\isacharunderscore}goal\ {\isacharequal}\ true} means |
|
264 |
this is a goal context. The result is in HHF normal form. Note |
|
265 |
that \verb|ProofContext.export| combines \verb|Variable.export| |
|
266 |
and \verb|Assumption.export| in the canonical way. |
|
267 |
||
268 |
\end{description}% |
|
269 |
\end{isamarkuptext}% |
|
270 |
\isamarkuptrue% |
|
271 |
% |
|
272 |
\endisatagmlref |
|
273 |
{\isafoldmlref}% |
|
274 |
% |
|
275 |
\isadelimmlref |
|
276 |
% |
|
277 |
\endisadelimmlref |
|
278 |
% |
|
279 |
\isamarkupsection{Results \label{sec:results}% |
|
280 |
} |
|
281 |
\isamarkuptrue% |
|
282 |
% |
|
283 |
\begin{isamarkuptext}% |
|
284 |
Local results are established by monotonic reasoning from facts |
|
285 |
within a context. This allows common combinations of theorems, |
|
286 |
e.g.\ via \isa{{\isasymAnd}{\isacharslash}{\isasymLongrightarrow}} elimination, resolution rules, or equational |
|
287 |
reasoning, see \secref{sec:thms}. Unaccounted context manipulations |
|
288 |
should be avoided, notably raw \isa{{\isasymAnd}{\isacharslash}{\isasymLongrightarrow}} introduction or ad-hoc |
|
289 |
references to free variables or assumptions not present in the proof |
|
290 |
context. |
|
291 |
||
292 |
\medskip The \isa{SUBPROOF} combinator allows to structure a |
|
293 |
tactical proof recursively by decomposing a selected sub-goal: |
|
294 |
\isa{{\isacharparenleft}{\isasymAnd}x{\isachardot}\ A{\isacharparenleft}x{\isacharparenright}\ {\isasymLongrightarrow}\ B{\isacharparenleft}x{\isacharparenright}{\isacharparenright}\ {\isasymLongrightarrow}\ {\isasymdots}} is turned into \isa{B{\isacharparenleft}x{\isacharparenright}\ {\isasymLongrightarrow}\ {\isasymdots}} |
|
295 |
after fixing \isa{x} and assuming \isa{A{\isacharparenleft}x{\isacharparenright}}. This means |
|
296 |
the tactic needs to solve the conclusion, but may use the premise as |
|
297 |
a local fact, for locally fixed variables. |
|
298 |
||
299 |
The \isa{prove} operation provides an interface for structured |
|
300 |
backwards reasoning under program control, with some explicit sanity |
|
301 |
checks of the result. The goal context can be augmented by |
|
302 |
additional fixed variables (cf.\ \secref{sec:variables}) and |
|
303 |
assumptions (cf.\ \secref{sec:assumptions}), which will be available |
|
304 |
as local facts during the proof and discharged into implications in |
|
305 |
the result. Type and term variables are generalized as usual, |
|
306 |
according to the context. |
|
307 |
||
308 |
The \isa{obtain} operation produces results by eliminating |
|
309 |
existing facts by means of a given tactic. This acts like a dual |
|
310 |
conclusion: the proof demonstrates that the context may be augmented |
|
311 |
by certain fixed variables and assumptions. See also |
|
312 |
\cite{isabelle-isar-ref} for the user-level \isa{{\isasymOBTAIN}} and |
|
313 |
\isa{{\isasymGUESS}} elements. Final results, which may not refer to |
|
314 |
the parameters in the conclusion, need to exported explicitly into |
|
315 |
the original context.% |
|
316 |
\end{isamarkuptext}% |
|
317 |
\isamarkuptrue% |
|
318 |
% |
|
319 |
\isadelimmlref |
|
320 |
% |
|
321 |
\endisadelimmlref |
|
322 |
% |
|
323 |
\isatagmlref |
|
324 |
% |
|
325 |
\begin{isamarkuptext}% |
|
326 |
\begin{mldecls} |
|
32201
3689b647356d
updated Variable.focus, SUBPROOF, Obtain.result, Goal.finish;
wenzelm
parents:
31794
diff
changeset
|
327 |
\indexdef{}{ML}{SUBPROOF}\verb|SUBPROOF: (Subgoal.focus -> tactic) -> Proof.context -> int -> tactic| \\ |
30296 | 328 |
\end{mldecls} |
329 |
\begin{mldecls} |
|
330 |
\indexdef{}{ML}{Goal.prove}\verb|Goal.prove: Proof.context -> string list -> term list -> term ->|\isasep\isanewline% |
|
331 |
\verb| ({prems: thm list, context: Proof.context} -> tactic) -> thm| \\ |
|
332 |
\indexdef{}{ML}{Goal.prove\_multi}\verb|Goal.prove_multi: Proof.context -> string list -> term list -> term list ->|\isasep\isanewline% |
|
333 |
\verb| ({prems: thm list, context: Proof.context} -> tactic) -> thm list| \\ |
|
334 |
\end{mldecls} |
|
335 |
\begin{mldecls} |
|
336 |
\indexdef{}{ML}{Obtain.result}\verb|Obtain.result: (Proof.context -> tactic) ->|\isasep\isanewline% |
|
32201
3689b647356d
updated Variable.focus, SUBPROOF, Obtain.result, Goal.finish;
wenzelm
parents:
31794
diff
changeset
|
337 |
\verb| thm list -> Proof.context -> ((string * cterm) list * thm list) * Proof.context| \\ |
30296 | 338 |
\end{mldecls} |
339 |
||
340 |
\begin{description} |
|
341 |
||
342 |
\item \verb|SUBPROOF|~\isa{tac\ ctxt\ i} decomposes the structure |
|
343 |
of the specified sub-goal, producing an extended context and a |
|
344 |
reduced goal, which needs to be solved by the given tactic. All |
|
345 |
schematic parameters of the goal are imported into the context as |
|
346 |
fixed ones, which may not be instantiated in the sub-proof. |
|
347 |
||
348 |
\item \verb|Goal.prove|~\isa{ctxt\ xs\ As\ C\ tac} states goal \isa{C} in the context augmented by fixed variables \isa{xs} and |
|
349 |
assumptions \isa{As}, and applies tactic \isa{tac} to solve |
|
350 |
it. The latter may depend on the local assumptions being presented |
|
351 |
as facts. The result is in HHF normal form. |
|
352 |
||
353 |
\item \verb|Goal.prove_multi| is simular to \verb|Goal.prove|, but |
|
354 |
states several conclusions simultaneously. The goal is encoded by |
|
355 |
means of Pure conjunction; \verb|Goal.conjunction_tac| will turn this |
|
356 |
into a collection of individual subgoals. |
|
357 |
||
358 |
\item \verb|Obtain.result|~\isa{tac\ thms\ ctxt} eliminates the |
|
359 |
given facts using a tactic, which results in additional fixed |
|
360 |
variables and assumptions in the context. Final results need to be |
|
361 |
exported explicitly. |
|
362 |
||
363 |
\end{description}% |
|
364 |
\end{isamarkuptext}% |
|
365 |
\isamarkuptrue% |
|
366 |
% |
|
367 |
\endisatagmlref |
|
368 |
{\isafoldmlref}% |
|
369 |
% |
|
370 |
\isadelimmlref |
|
371 |
% |
|
372 |
\endisadelimmlref |
|
373 |
% |
|
374 |
\isadelimtheory |
|
375 |
% |
|
376 |
\endisadelimtheory |
|
377 |
% |
|
378 |
\isatagtheory |
|
379 |
\isacommand{end}\isamarkupfalse% |
|
380 |
% |
|
381 |
\endisatagtheory |
|
382 |
{\isafoldtheory}% |
|
383 |
% |
|
384 |
\isadelimtheory |
|
385 |
% |
|
386 |
\endisadelimtheory |
|
387 |
\isanewline |
|
388 |
\end{isabellebody}% |
|
389 |
%%% Local Variables: |
|
390 |
%%% mode: latex |
|
391 |
%%% TeX-master: "root" |
|
392 |
%%% End: |