author | kuncar |
Mon, 26 Mar 2012 15:32:54 +0200 | |
changeset 47116 | 529d2a949bd4 |
parent 46267 | bc9479cada96 |
permissions | -rw-r--r-- |
30296 | 1 |
% |
2 |
\begin{isabellebody}% |
|
3 |
\def\isabellecontext{Isar}% |
|
4 |
% |
|
5 |
\isadelimtheory |
|
6 |
% |
|
7 |
\endisadelimtheory |
|
8 |
% |
|
9 |
\isatagtheory |
|
10 |
\isacommand{theory}\isamarkupfalse% |
|
11 |
\ Isar\isanewline |
|
12 |
\isakeyword{imports}\ Base\isanewline |
|
13 |
\isakeyword{begin}% |
|
14 |
\endisatagtheory |
|
15 |
{\isafoldtheory}% |
|
16 |
% |
|
17 |
\isadelimtheory |
|
18 |
% |
|
19 |
\endisadelimtheory |
|
20 |
% |
|
21 |
\isamarkupchapter{Isar language elements% |
|
22 |
} |
|
23 |
\isamarkuptrue% |
|
24 |
% |
|
25 |
\begin{isamarkuptext}% |
|
40126 | 26 |
The Isar proof language (see also |
27 |
\cite[\S2]{isabelle-isar-ref}) consists of three main categories of |
|
28 |
language elements as follows. |
|
30296 | 29 |
|
30 |
\begin{enumerate} |
|
31 |
||
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
32 |
\item Proof \emph{commands} define the primary language of |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
33 |
transactions of the underlying Isar/VM interpreter. Typical |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
34 |
examples are \hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}}, \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}, \hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}, \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}, and \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
35 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
36 |
Composing proof commands according to the rules of the Isar/VM leads |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
37 |
to expressions of structured proof text, such that both the machine |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
38 |
and the human reader can give it a meaning as formal reasoning. |
30296 | 39 |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
40 |
\item Proof \emph{methods} define a secondary language of mixed |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
41 |
forward-backward refinement steps involving facts and goals. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
42 |
Typical examples are \hyperlink{method.rule}{\mbox{\isa{rule}}}, \hyperlink{method.unfold}{\mbox{\isa{unfold}}}, and \hyperlink{method.simp}{\mbox{\isa{simp}}}. |
30296 | 43 |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
44 |
Methods can occur in certain well-defined parts of the Isar proof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
45 |
language, say as arguments to \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}, \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}, |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
46 |
or \hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
47 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
48 |
\item \emph{Attributes} define a tertiary language of small |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
49 |
annotations to theorems being defined or referenced. Attributes can |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
50 |
modify both the context and the theorem. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
51 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
52 |
Typical examples are \hyperlink{attribute.intro}{\mbox{\isa{intro}}} (which affects the context), |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
53 |
and \hyperlink{attribute.symmetric}{\mbox{\isa{symmetric}}} (which affects the theorem). |
30296 | 54 |
|
55 |
\end{enumerate}% |
|
56 |
\end{isamarkuptext}% |
|
57 |
\isamarkuptrue% |
|
58 |
% |
|
59 |
\isamarkupsection{Proof commands% |
|
60 |
} |
|
61 |
\isamarkuptrue% |
|
62 |
% |
|
63 |
\begin{isamarkuptext}% |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
64 |
A \emph{proof command} is state transition of the Isar/VM |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
65 |
proof interpreter. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
66 |
|
40126 | 67 |
In principle, Isar proof commands could be defined in user-space as |
68 |
well. The system is built like that in the first place: one part of |
|
69 |
the commands are primitive, the other part is defined as derived |
|
70 |
elements. Adding to the genuine structured proof language requires |
|
71 |
profound understanding of the Isar/VM machinery, though, so this is |
|
72 |
beyond the scope of this manual. |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
73 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
74 |
What can be done realistically is to define some diagnostic commands |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
75 |
that inspect the general state of the Isar/VM, and report some |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
76 |
feedback to the user. Typically this involves checking of the |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
77 |
linguistic \emph{mode} of a proof state, or peeking at the pending |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
78 |
goals (if available). |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
79 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
80 |
Another common application is to define a toplevel command that |
40126 | 81 |
poses a problem to the user as Isar proof state and processes the |
82 |
final result relatively to the context. Thus a proof can be |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
83 |
incorporated into the context of some user-space tool, without |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
84 |
modifying the Isar proof language itself.% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
85 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
86 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
87 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
88 |
\isadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
89 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
90 |
\endisadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
91 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
92 |
\isatagmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
93 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
94 |
\begin{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
95 |
\begin{mldecls} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
96 |
\indexdef{}{ML type}{Proof.state}\verb|type Proof.state| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
97 |
\indexdef{}{ML}{Proof.assert\_forward}\verb|Proof.assert_forward: Proof.state -> Proof.state| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
98 |
\indexdef{}{ML}{Proof.assert\_chain}\verb|Proof.assert_chain: Proof.state -> Proof.state| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
99 |
\indexdef{}{ML}{Proof.assert\_backward}\verb|Proof.assert_backward: Proof.state -> Proof.state| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
100 |
\indexdef{}{ML}{Proof.simple\_goal}\verb|Proof.simple_goal: Proof.state -> {context: Proof.context, goal: thm}| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
101 |
\indexdef{}{ML}{Proof.goal}\verb|Proof.goal: Proof.state ->|\isasep\isanewline% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
102 |
\verb| {context: Proof.context, facts: thm list, goal: thm}| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
103 |
\indexdef{}{ML}{Proof.raw\_goal}\verb|Proof.raw_goal: Proof.state ->|\isasep\isanewline% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
104 |
\verb| {context: Proof.context, facts: thm list, goal: thm}| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
105 |
\indexdef{}{ML}{Proof.theorem}\verb|Proof.theorem: Method.text option ->|\isasep\isanewline% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
106 |
\verb| (thm list list -> Proof.context -> Proof.context) ->|\isasep\isanewline% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
107 |
\verb| (term * term list) list list -> Proof.context -> Proof.state| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
108 |
\end{mldecls} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
109 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
110 |
\begin{description} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
111 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
112 |
\item Type \verb|Proof.state| represents Isar proof states. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
113 |
This is a block-structured configuration with proof context, |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
114 |
linguistic mode, and optional goal. The latter consists of goal |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
115 |
context, goal facts (``\isa{using}''), and tactical goal state |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
116 |
(see \secref{sec:tactical-goals}). |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
117 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
118 |
The general idea is that the facts shall contribute to the |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
119 |
refinement of some parts of the tactical goal --- how exactly is |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
120 |
defined by the proof method that is applied in that situation. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
121 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
122 |
\item \verb|Proof.assert_forward|, \verb|Proof.assert_chain|, \verb|Proof.assert_backward| are partial identity functions that fail |
40406 | 123 |
unless a certain linguistic mode is active, namely ``\isa{proof{\isaliteral{28}{\isacharparenleft}}state{\isaliteral{29}{\isacharparenright}}}'', ``\isa{proof{\isaliteral{28}{\isacharparenleft}}chain{\isaliteral{29}{\isacharparenright}}}'', ``\isa{proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}}'', respectively (using the terminology of |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
124 |
\cite{isabelle-isar-ref}). |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
125 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
126 |
It is advisable study the implementations of existing proof commands |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
127 |
for suitable modes to be asserted. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
128 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
129 |
\item \verb|Proof.simple_goal|~\isa{state} returns the structured |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
130 |
Isar goal (if available) in the form seen by ``simple'' methods |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
131 |
(like \hyperlink{method.simp}{\mbox{\isa{simp}}} or \hyperlink{method.blast}{\mbox{\isa{blast}}}). The Isar goal facts are |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
132 |
already inserted as premises into the subgoals, which are presented |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
133 |
individually as in \verb|Proof.goal|. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
134 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
135 |
\item \verb|Proof.goal|~\isa{state} returns the structured Isar |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
136 |
goal (if available) in the form seen by regular methods (like |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
137 |
\hyperlink{method.rule}{\mbox{\isa{rule}}}). The auxiliary internal encoding of Pure |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
138 |
conjunctions is split into individual subgoals as usual. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
139 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
140 |
\item \verb|Proof.raw_goal|~\isa{state} returns the structured |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
141 |
Isar goal (if available) in the raw internal form seen by ``raw'' |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
142 |
methods (like \hyperlink{method.induct}{\mbox{\isa{induct}}}). This form is rarely appropriate |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
143 |
for dignostic tools; \verb|Proof.simple_goal| or \verb|Proof.goal| |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
144 |
should be used in most situations. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
145 |
|
40406 | 146 |
\item \verb|Proof.theorem|~\isa{before{\isaliteral{5F}{\isacharunderscore}}qed\ after{\isaliteral{5F}{\isacharunderscore}}qed\ statement\ ctxt} |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
147 |
initializes a toplevel Isar proof state within a given context. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
148 |
|
40406 | 149 |
The optional \isa{before{\isaliteral{5F}{\isacharunderscore}}qed} method is applied at the end of |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
150 |
the proof, just before extracting the result (this feature is rarely |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
151 |
used). |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
152 |
|
40406 | 153 |
The \isa{after{\isaliteral{5F}{\isacharunderscore}}qed} continuation receives the extracted result |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
154 |
in order to apply it to the final context in a suitable way (e.g.\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
155 |
storing named facts). Note that at this generic level the target |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
156 |
context is specified as \verb|Proof.context|, but the usual |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
157 |
wrapping of toplevel proofs into command transactions will provide a |
40126 | 158 |
\verb|local_theory| here (\chref{ch:local-theory}). This |
159 |
affects the way how results are stored. |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
160 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
161 |
The \isa{statement} is given as a nested list of terms, each |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
162 |
associated with optional \hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}} patterns as usual in the |
40126 | 163 |
Isar source language. The original nested list structure over terms |
40406 | 164 |
is turned into one over theorems when \isa{after{\isaliteral{5F}{\isacharunderscore}}qed} is |
40126 | 165 |
invoked. |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
166 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
167 |
\end{description}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
168 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
169 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
170 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
171 |
\endisatagmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
172 |
{\isafoldmlref}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
173 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
174 |
\isadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
175 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
176 |
\endisadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
177 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
178 |
\isadelimmlantiq |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
179 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
180 |
\endisadelimmlantiq |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
181 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
182 |
\isatagmlantiq |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
183 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
184 |
\begin{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
185 |
\begin{matharray}{rcl} |
40406 | 186 |
\indexdef{}{ML antiquotation}{Isar.goal}\hypertarget{ML antiquotation.Isar.goal}{\hyperlink{ML antiquotation.Isar.goal}{\mbox{\isa{Isar{\isaliteral{2E}{\isachardot}}goal}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\ |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
187 |
\end{matharray} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
188 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
189 |
\begin{description} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
190 |
|
40406 | 191 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}Isar{\isaliteral{2E}{\isachardot}}goal{\isaliteral{7D}{\isacharbraceright}}} refers to the regular goal state (if |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
192 |
available) of the current proof state managed by the Isar toplevel |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
193 |
--- as abstract value. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
194 |
|
40406 | 195 |
This only works for diagnostic ML commands, such as \hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}val}}}} or \hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}command}}}}. |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
196 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
197 |
\end{description}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
198 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
199 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
200 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
201 |
\endisatagmlantiq |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
202 |
{\isafoldmlantiq}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
203 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
204 |
\isadelimmlantiq |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
205 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
206 |
\endisadelimmlantiq |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
207 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
208 |
\isadelimmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
209 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
210 |
\endisadelimmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
211 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
212 |
\isatagmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
213 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
214 |
\begin{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
215 |
The following example peeks at a certain goal configuration.% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
216 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
217 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
218 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
219 |
\endisatagmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
220 |
{\isafoldmlex}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
221 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
222 |
\isadelimmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
223 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
224 |
\endisadelimmlex |
40964 | 225 |
\isacommand{notepad}\isamarkupfalse% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
226 |
\isanewline |
40964 | 227 |
\isakeyword{begin}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
228 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
229 |
\isadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
230 |
\ \ % |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
231 |
\endisadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
232 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
233 |
\isatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
234 |
\isacommand{have}\isamarkupfalse% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
235 |
\ A\ \isakeyword{and}\ B\ \isakeyword{and}\ C% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
236 |
\endisatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
237 |
{\isafoldproof}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
238 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
239 |
\isadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
240 |
\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
241 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
242 |
\endisadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
243 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
244 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
245 |
\ \ \ \ % |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
246 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
247 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
248 |
\isatagML |
40406 | 249 |
\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}val}\isamarkupfalse% |
250 |
\ {\isaliteral{7B2A}{\isacharverbatimopen}}\isanewline |
|
251 |
\ \ \ \ \ \ val\ n\ {\isaliteral{3D}{\isacharequal}}\ Thm{\isaliteral{2E}{\isachardot}}nprems{\isaliteral{5F}{\isacharunderscore}}of\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{23}{\isacharhash}}goal\ % |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
252 |
\isaantiq |
40406 | 253 |
Isar{\isaliteral{2E}{\isachardot}}goal{}% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
254 |
\endisaantiq |
40406 | 255 |
{\isaliteral{29}{\isacharparenright}}{\isaliteral{3B}{\isacharsemicolon}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
256 |
\ \ \ \ \ \ % |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
257 |
\isaantiq |
40406 | 258 |
assert{}% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
259 |
\endisaantiq |
40406 | 260 |
\ {\isaliteral{28}{\isacharparenleft}}n\ {\isaliteral{3D}{\isacharequal}}\ {\isadigit{3}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{3B}{\isacharsemicolon}}\isanewline |
261 |
\ \ \ \ {\isaliteral{2A7D}{\isacharverbatimclose}}% |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
262 |
\endisatagML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
263 |
{\isafoldML}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
264 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
265 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
266 |
\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
267 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
268 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
269 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
270 |
\isadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
271 |
\ \ \ \ % |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
272 |
\endisadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
273 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
274 |
\isatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
275 |
\isacommand{oops}\isamarkupfalse% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
276 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
277 |
\endisatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
278 |
{\isafoldproof}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
279 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
280 |
\isadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
281 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
282 |
\endisadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
283 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
284 |
\begin{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
285 |
Here we see 3 individual subgoals in the same way as regular |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
286 |
proof methods would do.% |
30296 | 287 |
\end{isamarkuptext}% |
288 |
\isamarkuptrue% |
|
289 |
% |
|
290 |
\isamarkupsection{Proof methods% |
|
291 |
} |
|
292 |
\isamarkuptrue% |
|
293 |
% |
|
294 |
\begin{isamarkuptext}% |
|
40406 | 295 |
A \isa{method} is a function \isa{context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ thm\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ goal\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}cases\ {\isaliteral{5C3C74696D65733E}{\isasymtimes}}\ goal{\isaliteral{29}{\isacharparenright}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}} that operates on the full Isar goal |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
296 |
configuration with context, goal facts, and tactical goal state and |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
297 |
enumerates possible follow-up goal states, with the potential |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
298 |
addition of named extensions of the proof context (\emph{cases}). |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
299 |
The latter feature is rarely used. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
300 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
301 |
This means a proof method is like a structurally enhanced tactic |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
302 |
(cf.\ \secref{sec:tactics}). The well-formedness conditions for |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
303 |
tactics need to hold for methods accordingly, with the following |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
304 |
additions. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
305 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
306 |
\begin{itemize} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
307 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
308 |
\item Goal addressing is further limited either to operate either |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
309 |
uniformly on \emph{all} subgoals, or specifically on the |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
310 |
\emph{first} subgoal. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
311 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
312 |
Exception: old-style tactic emulations that are embedded into the |
40406 | 313 |
method space, e.g.\ \hyperlink{method.rule-tac}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}tac}}}. |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
314 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
315 |
\item A non-trivial method always needs to make progress: an |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
316 |
identical follow-up goal state has to be avoided.\footnote{This |
40406 | 317 |
enables the user to write method expressions like \isa{meth\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2B}{\isacharplus}}} |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
318 |
without looping, while the trivial do-nothing case can be recovered |
40406 | 319 |
via \isa{meth\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{3F}{\isacharquery}}}.} |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
320 |
|
40406 | 321 |
Exception: trivial stuttering steps, such as ``\hyperlink{method.-}{\mbox{\isa{{\isaliteral{2D}{\isacharminus}}}}}'' or |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
322 |
\hyperlink{method.succeed}{\mbox{\isa{succeed}}}. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
323 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
324 |
\item Goal facts passed to the method must not be ignored. If there |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
325 |
is no sensible use of facts outside the goal state, facts should be |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
326 |
inserted into the subgoals that are addressed by the method. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
327 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
328 |
\end{itemize} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
329 |
|
40126 | 330 |
\medskip Syntactically, the language of proof methods appears as |
331 |
arguments to Isar commands like \hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}} or \hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}. |
|
332 |
User-space additions are reasonably easy by plugging suitable |
|
333 |
method-valued parser functions into the framework, using the |
|
40406 | 334 |
\hyperlink{command.method-setup}{\mbox{\isa{\isacommand{method{\isaliteral{5F}{\isacharunderscore}}setup}}}} command, for example. |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
335 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
336 |
To get a better idea about the range of possibilities, consider the |
40126 | 337 |
following Isar proof schemes. This is the general form of |
338 |
structured proof text: |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
339 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
340 |
\medskip |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
341 |
\begin{tabular}{l} |
40406 | 342 |
\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\isa{facts\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}}~\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{props}~\hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}~\isa{facts\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}} \\ |
343 |
\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isaliteral{28}{\isacharparenleft}}initial{\isaliteral{5F}{\isacharunderscore}}method{\isaliteral{29}{\isacharparenright}}} \\ |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
344 |
\quad\isa{body} \\ |
40406 | 345 |
\hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}~\isa{{\isaliteral{28}{\isacharparenleft}}terminal{\isaliteral{5F}{\isacharunderscore}}method{\isaliteral{29}{\isacharparenright}}} \\ |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
346 |
\end{tabular} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
347 |
\medskip |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
348 |
|
40406 | 349 |
The goal configuration consists of \isa{facts\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}} and |
350 |
\isa{facts\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}} appended in that order, and various \isa{props} being claimed. The \isa{initial{\isaliteral{5F}{\isacharunderscore}}method} is invoked |
|
40126 | 351 |
with facts and goals together and refines the problem to something |
40406 | 352 |
that is handled recursively in the proof \isa{body}. The \isa{terminal{\isaliteral{5F}{\isacharunderscore}}method} has another chance to finish any remaining |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
353 |
subgoals, but it does not see the facts of the initial step. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
354 |
|
40126 | 355 |
\medskip This pattern illustrates unstructured proof scripts: |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
356 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
357 |
\medskip |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
358 |
\begin{tabular}{l} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
359 |
\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{props} \\ |
40406 | 360 |
\quad\hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}~\isa{facts\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}}~\hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}~\isa{method\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}} \\ |
361 |
\quad\hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}~\isa{method\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}} \\ |
|
362 |
\quad\hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}~\isa{facts\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{3}}}~\hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}~\isa{method\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{3}}} \\ |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
363 |
\quad\hyperlink{command.done}{\mbox{\isa{\isacommand{done}}}} \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
364 |
\end{tabular} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
365 |
\medskip |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
366 |
|
40406 | 367 |
The \isa{method\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}} operates on the original claim while |
368 |
using \isa{facts\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}}. Since the \hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}} command |
|
369 |
structurally resets the facts, the \isa{method\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}} will |
|
370 |
operate on the remaining goal state without facts. The \isa{method\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{3}}} will see again a collection of \isa{facts\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{3}}} that has been inserted into the script explicitly. |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
371 |
|
40126 | 372 |
\medskip Empirically, any Isar proof method can be categorized as |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
373 |
follows. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
374 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
375 |
\begin{enumerate} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
376 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
377 |
\item \emph{Special method with cases} with named context additions |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
378 |
associated with the follow-up goal state. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
379 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
380 |
Example: \hyperlink{method.induct}{\mbox{\isa{induct}}}, which is also a ``raw'' method since it |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
381 |
operates on the internal representation of simultaneous claims as |
46134 | 382 |
Pure conjunction (\secref{sec:logic-aux}), instead of separate |
383 |
subgoals (\secref{sec:tactical-goals}). |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
384 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
385 |
\item \emph{Structured method} with strong emphasis on facts outside |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
386 |
the goal state. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
387 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
388 |
Example: \hyperlink{method.rule}{\mbox{\isa{rule}}}, which captures the key ideas behind |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
389 |
structured reasoning in Isar in purest form. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
390 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
391 |
\item \emph{Simple method} with weaker emphasis on facts, which are |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
392 |
inserted into subgoals to emulate old-style tactical as |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
393 |
``premises''. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
394 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
395 |
Examples: \hyperlink{method.simp}{\mbox{\isa{simp}}}, \hyperlink{method.blast}{\mbox{\isa{blast}}}, \hyperlink{method.auto}{\mbox{\isa{auto}}}. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
396 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
397 |
\item \emph{Old-style tactic emulation} with detailed numeric goal |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
398 |
addressing and explicit references to entities of the internal goal |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
399 |
state (which are otherwise invisible from proper Isar proof text). |
40406 | 400 |
The naming convention \isa{foo{\isaliteral{5F}{\isacharunderscore}}tac} makes this special |
40126 | 401 |
non-standard status clear. |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
402 |
|
40406 | 403 |
Example: \hyperlink{method.rule-tac}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}tac}}}. |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
404 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
405 |
\end{enumerate} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
406 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
407 |
When implementing proof methods, it is advisable to study existing |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
408 |
implementations carefully and imitate the typical ``boiler plate'' |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
409 |
for context-sensitive parsing and further combinators to wrap-up |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
410 |
tactic expressions as methods.\footnote{Aliases or abbreviations of |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
411 |
the standard method combinators should be avoided. Note that from |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
412 |
Isabelle99 until Isabelle2009 the system did provide various odd |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
413 |
combinations of method wrappers that made user applications more |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
414 |
complicated than necessary.}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
415 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
416 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
417 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
418 |
\isadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
419 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
420 |
\endisadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
421 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
422 |
\isatagmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
423 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
424 |
\begin{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
425 |
\begin{mldecls} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
426 |
\indexdef{}{ML type}{Proof.method}\verb|type Proof.method| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
427 |
\indexdef{}{ML}{METHOD\_CASES}\verb|METHOD_CASES: (thm list -> cases_tactic) -> Proof.method| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
428 |
\indexdef{}{ML}{METHOD}\verb|METHOD: (thm list -> tactic) -> Proof.method| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
429 |
\indexdef{}{ML}{SIMPLE\_METHOD}\verb|SIMPLE_METHOD: tactic -> Proof.method| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
430 |
\indexdef{}{ML}{SIMPLE\_METHOD'}\verb|SIMPLE_METHOD': (int -> tactic) -> Proof.method| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
431 |
\indexdef{}{ML}{Method.insert\_tac}\verb|Method.insert_tac: thm list -> int -> tactic| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
432 |
\indexdef{}{ML}{Method.setup}\verb|Method.setup: binding -> (Proof.context -> Proof.method) context_parser ->|\isasep\isanewline% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
433 |
\verb| string -> theory -> theory| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
434 |
\end{mldecls} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
435 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
436 |
\begin{description} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
437 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
438 |
\item Type \verb|Proof.method| represents proof methods as |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
439 |
abstract type. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
440 |
|
40406 | 441 |
\item \verb|METHOD_CASES|~\isa{{\isaliteral{28}{\isacharparenleft}}fn\ facts\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ cases{\isaliteral{5F}{\isacharunderscore}}tactic{\isaliteral{29}{\isacharparenright}}} wraps |
442 |
\isa{cases{\isaliteral{5F}{\isacharunderscore}}tactic} depending on goal facts as proof method with |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
443 |
cases; the goal context is passed via method syntax. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
444 |
|
40406 | 445 |
\item \verb|METHOD|~\isa{{\isaliteral{28}{\isacharparenleft}}fn\ facts\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ tactic{\isaliteral{29}{\isacharparenright}}} wraps \isa{tactic} depending on goal facts as regular proof method; the goal |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
446 |
context is passed via method syntax. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
447 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
448 |
\item \verb|SIMPLE_METHOD|~\isa{tactic} wraps a tactic that |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
449 |
addresses all subgoals uniformly as simple proof method. Goal facts |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
450 |
are already inserted into all subgoals before \isa{tactic} is |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
451 |
applied. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
452 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
453 |
\item \verb|SIMPLE_METHOD'|~\isa{tactic} wraps a tactic that |
46267 | 454 |
addresses a specific subgoal as simple proof method that operates on |
455 |
subgoal 1. Goal facts are inserted into the subgoal then the \isa{tactic} is applied. |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
456 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
457 |
\item \verb|Method.insert_tac|~\isa{facts\ i} inserts \isa{facts} into subgoal \isa{i}. This is convenient to reproduce |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
458 |
part of the \verb|SIMPLE_METHOD| or \verb|SIMPLE_METHOD'| wrapping |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
459 |
within regular \verb|METHOD|, for example. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
460 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
461 |
\item \verb|Method.setup|~\isa{name\ parser\ description} provides |
40406 | 462 |
the functionality of the Isar command \hyperlink{command.method-setup}{\mbox{\isa{\isacommand{method{\isaliteral{5F}{\isacharunderscore}}setup}}}} as ML |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
463 |
function. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
464 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
465 |
\end{description}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
466 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
467 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
468 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
469 |
\endisatagmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
470 |
{\isafoldmlref}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
471 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
472 |
\isadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
473 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
474 |
\endisadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
475 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
476 |
\isadelimmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
477 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
478 |
\endisadelimmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
479 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
480 |
\isatagmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
481 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
482 |
\begin{isamarkuptext}% |
40406 | 483 |
See also \hyperlink{command.method-setup}{\mbox{\isa{\isacommand{method{\isaliteral{5F}{\isacharunderscore}}setup}}}} in |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
484 |
\cite{isabelle-isar-ref} which includes some abstract examples. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
485 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
486 |
\medskip The following toy examples illustrate how the goal facts |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
487 |
and state are passed to proof methods. The pre-defined proof method |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
488 |
called ``\hyperlink{method.tactic}{\mbox{\isa{tactic}}}'' wraps ML source of type \verb|tactic| (abstracted over \verb|facts|). This allows immediate |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
489 |
experimentation without parsing of concrete syntax.% |
30296 | 490 |
\end{isamarkuptext}% |
491 |
\isamarkuptrue% |
|
492 |
% |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
493 |
\endisatagmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
494 |
{\isafoldmlex}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
495 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
496 |
\isadelimmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
497 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
498 |
\endisadelimmlex |
40964 | 499 |
\isacommand{notepad}\isamarkupfalse% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
500 |
\isanewline |
40964 | 501 |
\isakeyword{begin}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
502 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
503 |
\isadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
504 |
\ \ % |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
505 |
\endisadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
506 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
507 |
\isatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
508 |
\isacommand{assume}\isamarkupfalse% |
40406 | 509 |
\ a{\isaliteral{3A}{\isacharcolon}}\ A\ \isakeyword{and}\ b{\isaliteral{3A}{\isacharcolon}}\ B\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
510 |
\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
511 |
\ \ \isacommand{have}\isamarkupfalse% |
40406 | 512 |
\ {\isaliteral{22}{\isachardoublequoteopen}}A\ {\isaliteral{5C3C616E643E}{\isasymand}}\ B{\isaliteral{22}{\isachardoublequoteclose}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
513 |
\ \ \ \ \isacommand{apply}\isamarkupfalse% |
40406 | 514 |
\ {\isaliteral{28}{\isacharparenleft}}tactic\ {\isaliteral{7B2A}{\isacharverbatimopen}}\ rtac\ % |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
515 |
\isaantiq |
40406 | 516 |
thm\ conjI{}% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
517 |
\endisaantiq |
40406 | 518 |
\ {\isadigit{1}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}{\isaliteral{29}{\isacharparenright}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
519 |
\ \ \ \ \isacommand{using}\isamarkupfalse% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
520 |
\ a\ \isacommand{apply}\isamarkupfalse% |
40406 | 521 |
\ {\isaliteral{28}{\isacharparenleft}}tactic\ {\isaliteral{7B2A}{\isacharverbatimopen}}\ resolve{\isaliteral{5F}{\isacharunderscore}}tac\ facts\ {\isadigit{1}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}{\isaliteral{29}{\isacharparenright}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
522 |
\ \ \ \ \isacommand{using}\isamarkupfalse% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
523 |
\ b\ \isacommand{apply}\isamarkupfalse% |
40406 | 524 |
\ {\isaliteral{28}{\isacharparenleft}}tactic\ {\isaliteral{7B2A}{\isacharverbatimopen}}\ resolve{\isaliteral{5F}{\isacharunderscore}}tac\ facts\ {\isadigit{1}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}{\isaliteral{29}{\isacharparenright}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
525 |
\ \ \ \ \isacommand{done}\isamarkupfalse% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
526 |
\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
527 |
\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
528 |
\ \ \isacommand{have}\isamarkupfalse% |
40406 | 529 |
\ {\isaliteral{22}{\isachardoublequoteopen}}A\ {\isaliteral{5C3C616E643E}{\isasymand}}\ B{\isaliteral{22}{\isachardoublequoteclose}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
530 |
\ \ \ \ \isacommand{using}\isamarkupfalse% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
531 |
\ a\ \isakeyword{and}\ b% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
532 |
\endisatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
533 |
{\isafoldproof}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
534 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
535 |
\isadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
536 |
\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
537 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
538 |
\endisadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
539 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
540 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
541 |
\ \ \ \ % |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
542 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
543 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
544 |
\isatagML |
40406 | 545 |
\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}val}\isamarkupfalse% |
546 |
\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}Isar{\isaliteral{2E}{\isachardot}}goal{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{22}{\isachardoublequoteclose}}% |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
547 |
\endisatagML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
548 |
{\isafoldML}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
549 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
550 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
551 |
\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
552 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
553 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
554 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
555 |
\isadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
556 |
\ \ \ \ % |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
557 |
\endisadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
558 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
559 |
\isatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
560 |
\isacommand{apply}\isamarkupfalse% |
40406 | 561 |
\ {\isaliteral{28}{\isacharparenleft}}tactic\ {\isaliteral{7B2A}{\isacharverbatimopen}}\ Method{\isaliteral{2E}{\isachardot}}insert{\isaliteral{5F}{\isacharunderscore}}tac\ facts\ {\isadigit{1}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}{\isaliteral{29}{\isacharparenright}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
562 |
\ \ \ \ \isacommand{apply}\isamarkupfalse% |
40406 | 563 |
\ {\isaliteral{28}{\isacharparenleft}}tactic\ {\isaliteral{7B2A}{\isacharverbatimopen}}\ {\isaliteral{28}{\isacharparenleft}}rtac\ % |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
564 |
\isaantiq |
40406 | 565 |
thm\ conjI{}% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
566 |
\endisaantiq |
40406 | 567 |
\ THEN{\isaliteral{5F}{\isacharunderscore}}ALL{\isaliteral{5F}{\isacharunderscore}}NEW\ atac{\isaliteral{29}{\isacharparenright}}\ {\isadigit{1}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}{\isaliteral{29}{\isacharparenright}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
568 |
\ \ \ \ \isacommand{done}\isamarkupfalse% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
569 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
570 |
\endisatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
571 |
{\isafoldproof}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
572 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
573 |
\isadelimproof |
40964 | 574 |
\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
575 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
576 |
\endisadelimproof |
40964 | 577 |
\isacommand{end}\isamarkupfalse% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
578 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
579 |
\begin{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
580 |
\medskip The next example implements a method that simplifies |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
581 |
the first subgoal by rewrite rules given as arguments.% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
582 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
583 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
584 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
585 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
586 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
587 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
588 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
589 |
\isatagML |
40406 | 590 |
\isacommand{method{\isaliteral{5F}{\isacharunderscore}}setup}\isamarkupfalse% |
591 |
\ my{\isaliteral{5F}{\isacharunderscore}}simp\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{7B2A}{\isacharverbatimopen}}\isanewline |
|
592 |
\ \ Attrib{\isaliteral{2E}{\isachardot}}thms\ {\isaliteral{3E}{\isachargreater}}{\isaliteral{3E}{\isachargreater}}\ {\isaliteral{28}{\isacharparenleft}}fn\ thms\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ fn\ ctxt\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\isanewline |
|
593 |
\ \ \ \ SIMPLE{\isaliteral{5F}{\isacharunderscore}}METHOD{\isaliteral{27}{\isacharprime}}\ {\isaliteral{28}{\isacharparenleft}}fn\ i\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\isanewline |
|
594 |
\ \ \ \ \ \ CHANGED\ {\isaliteral{28}{\isacharparenleft}}asm{\isaliteral{5F}{\isacharunderscore}}full{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{5F}{\isacharunderscore}}tac\isanewline |
|
595 |
\ \ \ \ \ \ \ \ {\isaliteral{28}{\isacharparenleft}}HOL{\isaliteral{5F}{\isacharunderscore}}basic{\isaliteral{5F}{\isacharunderscore}}ss\ addsimps\ thms{\isaliteral{29}{\isacharparenright}}\ i{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\isanewline |
|
596 |
{\isaliteral{2A7D}{\isacharverbatimclose}}\ {\isaliteral{22}{\isachardoublequoteopen}}rewrite\ subgoal\ by\ given\ rules{\isaliteral{22}{\isachardoublequoteclose}}% |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
597 |
\endisatagML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
598 |
{\isafoldML}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
599 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
600 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
601 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
602 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
603 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
604 |
\begin{isamarkuptext}% |
40406 | 605 |
The concrete syntax wrapping of \hyperlink{command.method-setup}{\mbox{\isa{\isacommand{method{\isaliteral{5F}{\isacharunderscore}}setup}}}} always |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
606 |
passes-through the proof context at the end of parsing, but it is |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
607 |
not used in this example. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
608 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
609 |
The \verb|Attrib.thms| parser produces a list of theorems from the |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
610 |
usual Isar syntax involving attribute expressions etc.\ (syntax |
40126 | 611 |
category \hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}) \cite{isabelle-isar-ref}. The resulting |
612 |
\verb|thms| are added to \verb|HOL_basic_ss| which already |
|
613 |
contains the basic Simplifier setup for HOL. |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
614 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
615 |
The tactic \verb|asm_full_simp_tac| is the one that is also used in |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
616 |
method \hyperlink{method.simp}{\mbox{\isa{simp}}} by default. The extra wrapping by the \verb|CHANGED| tactical ensures progress of simplification: identical goal |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
617 |
states are filtered out explicitly to make the raw tactic conform to |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
618 |
standard Isar method behaviour. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
619 |
|
40406 | 620 |
\medskip Method \hyperlink{method.my-simp}{\mbox{\isa{my{\isaliteral{5F}{\isacharunderscore}}simp}}} can be used in Isar proofs like |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
621 |
this:% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
622 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
623 |
\isamarkuptrue% |
40964 | 624 |
\isacommand{notepad}\isamarkupfalse% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
625 |
\isanewline |
40964 | 626 |
\isakeyword{begin}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
627 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
628 |
\isadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
629 |
\ \ % |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
630 |
\endisadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
631 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
632 |
\isatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
633 |
\isacommand{fix}\isamarkupfalse% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
634 |
\ a\ b\ c\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
635 |
\ \ \isacommand{assume}\isamarkupfalse% |
40406 | 636 |
\ a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}a\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{22}{\isachardoublequoteclose}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
637 |
\ \ \isacommand{assume}\isamarkupfalse% |
40406 | 638 |
\ b{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}b\ {\isaliteral{3D}{\isacharequal}}\ c{\isaliteral{22}{\isachardoublequoteclose}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
639 |
\ \ \isacommand{have}\isamarkupfalse% |
40406 | 640 |
\ {\isaliteral{22}{\isachardoublequoteopen}}a\ {\isaliteral{3D}{\isacharequal}}\ c{\isaliteral{22}{\isachardoublequoteclose}}\ \isacommand{by}\isamarkupfalse% |
40964 | 641 |
\ {\isaliteral{28}{\isacharparenleft}}my{\isaliteral{5F}{\isacharunderscore}}simp\ a\ b{\isaliteral{29}{\isacharparenright}}% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
642 |
\endisatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
643 |
{\isafoldproof}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
644 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
645 |
\isadelimproof |
40964 | 646 |
\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
647 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
648 |
\endisadelimproof |
40964 | 649 |
\isacommand{end}\isamarkupfalse% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
650 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
651 |
\begin{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
652 |
Here is a similar method that operates on all subgoals, |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
653 |
instead of just the first one.% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
654 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
655 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
656 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
657 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
658 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
659 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
660 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
661 |
\isatagML |
40406 | 662 |
\isacommand{method{\isaliteral{5F}{\isacharunderscore}}setup}\isamarkupfalse% |
663 |
\ my{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{5F}{\isacharunderscore}}all\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{7B2A}{\isacharverbatimopen}}\isanewline |
|
664 |
\ \ Attrib{\isaliteral{2E}{\isachardot}}thms\ {\isaliteral{3E}{\isachargreater}}{\isaliteral{3E}{\isachargreater}}\ {\isaliteral{28}{\isacharparenleft}}fn\ thms\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ fn\ ctxt\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\isanewline |
|
665 |
\ \ \ \ SIMPLE{\isaliteral{5F}{\isacharunderscore}}METHOD\isanewline |
|
666 |
\ \ \ \ \ \ {\isaliteral{28}{\isacharparenleft}}CHANGED\isanewline |
|
667 |
\ \ \ \ \ \ \ \ {\isaliteral{28}{\isacharparenleft}}ALLGOALS\ {\isaliteral{28}{\isacharparenleft}}asm{\isaliteral{5F}{\isacharunderscore}}full{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{5F}{\isacharunderscore}}tac\isanewline |
|
668 |
\ \ \ \ \ \ \ \ \ \ {\isaliteral{28}{\isacharparenleft}}HOL{\isaliteral{5F}{\isacharunderscore}}basic{\isaliteral{5F}{\isacharunderscore}}ss\ addsimps\ thms{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\isanewline |
|
669 |
{\isaliteral{2A7D}{\isacharverbatimclose}}\ {\isaliteral{22}{\isachardoublequoteopen}}rewrite\ all\ subgoals\ by\ given\ rules{\isaliteral{22}{\isachardoublequoteclose}}% |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
670 |
\endisatagML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
671 |
{\isafoldML}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
672 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
673 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
674 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
675 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
676 |
\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
677 |
\isanewline |
40964 | 678 |
\isacommand{notepad}\isamarkupfalse% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
679 |
\isanewline |
40964 | 680 |
\isakeyword{begin}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
681 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
682 |
\isadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
683 |
\ \ % |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
684 |
\endisadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
685 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
686 |
\isatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
687 |
\isacommand{fix}\isamarkupfalse% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
688 |
\ a\ b\ c\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
689 |
\ \ \isacommand{assume}\isamarkupfalse% |
40406 | 690 |
\ a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}a\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{22}{\isachardoublequoteclose}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
691 |
\ \ \isacommand{assume}\isamarkupfalse% |
40406 | 692 |
\ b{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}b\ {\isaliteral{3D}{\isacharequal}}\ c{\isaliteral{22}{\isachardoublequoteclose}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
693 |
\ \ \isacommand{have}\isamarkupfalse% |
40406 | 694 |
\ {\isaliteral{22}{\isachardoublequoteopen}}a\ {\isaliteral{3D}{\isacharequal}}\ c{\isaliteral{22}{\isachardoublequoteclose}}\ \isakeyword{and}\ {\isaliteral{22}{\isachardoublequoteopen}}c\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{22}{\isachardoublequoteclose}}\ \isacommand{by}\isamarkupfalse% |
40964 | 695 |
\ {\isaliteral{28}{\isacharparenleft}}my{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{5F}{\isacharunderscore}}all\ a\ b{\isaliteral{29}{\isacharparenright}}% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
696 |
\endisatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
697 |
{\isafoldproof}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
698 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
699 |
\isadelimproof |
40964 | 700 |
\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
701 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
702 |
\endisadelimproof |
40964 | 703 |
\isacommand{end}\isamarkupfalse% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
704 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
705 |
\begin{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
706 |
\medskip Apart from explicit arguments, common proof methods |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
707 |
typically work with a default configuration provided by the context. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
708 |
As a shortcut to rule management we use a cheap solution via functor |
40802 | 709 |
\verb|Named_Thms| (see also \verb|~~/src/Pure/Tools/named_thms.ML|).% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
710 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
711 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
712 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
713 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
714 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
715 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
716 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
717 |
\isatagML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
718 |
\isacommand{ML}\isamarkupfalse% |
40406 | 719 |
\ {\isaliteral{7B2A}{\isacharverbatimopen}}\isanewline |
720 |
\ \ structure\ My{\isaliteral{5F}{\isacharunderscore}}Simps\ {\isaliteral{3D}{\isacharequal}}\isanewline |
|
721 |
\ \ \ \ Named{\isaliteral{5F}{\isacharunderscore}}Thms\isanewline |
|
45414 | 722 |
\ \ \ \ \ \ {\isaliteral{28}{\isacharparenleft}}val\ name\ {\isaliteral{3D}{\isacharequal}}\ % |
723 |
\isaantiq |
|
724 |
binding\ my{\isaliteral{5F}{\isacharunderscore}}simp{}% |
|
725 |
\endisaantiq |
|
726 |
\ val\ description\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{22}{\isachardoublequote}}my{\isaliteral{5F}{\isacharunderscore}}simp\ rule{\isaliteral{22}{\isachardoublequote}}{\isaliteral{29}{\isacharparenright}}\isanewline |
|
40406 | 727 |
{\isaliteral{2A7D}{\isacharverbatimclose}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
728 |
\isacommand{setup}\isamarkupfalse% |
40406 | 729 |
\ My{\isaliteral{5F}{\isacharunderscore}}Simps{\isaliteral{2E}{\isachardot}}setup% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
730 |
\endisatagML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
731 |
{\isafoldML}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
732 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
733 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
734 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
735 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
736 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
737 |
\begin{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
738 |
This provides ML access to a list of theorems in canonical |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
739 |
declaration order via \verb|My_Simps.get|. The user can add or |
40406 | 740 |
delete rules via the attribute \hyperlink{attribute.my-simp}{\mbox{\isa{my{\isaliteral{5F}{\isacharunderscore}}simp}}}. The actual |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
741 |
proof method is now defined as before, but we append the explicit |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
742 |
arguments and the rules from the context.% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
743 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
744 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
745 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
746 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
747 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
748 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
749 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
750 |
\isatagML |
40406 | 751 |
\isacommand{method{\isaliteral{5F}{\isacharunderscore}}setup}\isamarkupfalse% |
752 |
\ my{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{27}{\isacharprime}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{7B2A}{\isacharverbatimopen}}\isanewline |
|
753 |
\ \ Attrib{\isaliteral{2E}{\isachardot}}thms\ {\isaliteral{3E}{\isachargreater}}{\isaliteral{3E}{\isachargreater}}\ {\isaliteral{28}{\isacharparenleft}}fn\ thms\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ fn\ ctxt\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\isanewline |
|
754 |
\ \ \ \ SIMPLE{\isaliteral{5F}{\isacharunderscore}}METHOD{\isaliteral{27}{\isacharprime}}\ {\isaliteral{28}{\isacharparenleft}}fn\ i\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\isanewline |
|
755 |
\ \ \ \ \ \ CHANGED\ {\isaliteral{28}{\isacharparenleft}}asm{\isaliteral{5F}{\isacharunderscore}}full{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{5F}{\isacharunderscore}}tac\isanewline |
|
756 |
\ \ \ \ \ \ \ \ {\isaliteral{28}{\isacharparenleft}}HOL{\isaliteral{5F}{\isacharunderscore}}basic{\isaliteral{5F}{\isacharunderscore}}ss\ addsimps\ {\isaliteral{28}{\isacharparenleft}}thms\ {\isaliteral{40}{\isacharat}}\ My{\isaliteral{5F}{\isacharunderscore}}Simps{\isaliteral{2E}{\isachardot}}get\ ctxt{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ i{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\isanewline |
|
757 |
{\isaliteral{2A7D}{\isacharverbatimclose}}\ {\isaliteral{22}{\isachardoublequoteopen}}rewrite\ subgoal\ by\ given\ rules\ and\ my{\isaliteral{5F}{\isacharunderscore}}simp\ rules\ from\ the\ context{\isaliteral{22}{\isachardoublequoteclose}}% |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
758 |
\endisatagML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
759 |
{\isafoldML}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
760 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
761 |
\isadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
762 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
763 |
\endisadelimML |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
764 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
765 |
\begin{isamarkuptext}% |
40406 | 766 |
\medskip Method \hyperlink{method.my-simp'}{\mbox{\isa{my{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{27}{\isacharprime}}}}} can be used in Isar proofs |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
767 |
like this:% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
768 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
769 |
\isamarkuptrue% |
40964 | 770 |
\isacommand{notepad}\isamarkupfalse% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
771 |
\isanewline |
40964 | 772 |
\isakeyword{begin}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
773 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
774 |
\isadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
775 |
\ \ % |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
776 |
\endisadelimproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
777 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
778 |
\isatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
779 |
\isacommand{fix}\isamarkupfalse% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
780 |
\ a\ b\ c\isanewline |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
781 |
\ \ \isacommand{assume}\isamarkupfalse% |
40406 | 782 |
\ {\isaliteral{5B}{\isacharbrackleft}}my{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}a\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ b{\isaliteral{22}{\isachardoublequoteclose}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
783 |
\ \ \isacommand{assume}\isamarkupfalse% |
40406 | 784 |
\ {\isaliteral{5B}{\isacharbrackleft}}my{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}b\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ c{\isaliteral{22}{\isachardoublequoteclose}}\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
785 |
\ \ \isacommand{have}\isamarkupfalse% |
40406 | 786 |
\ {\isaliteral{22}{\isachardoublequoteopen}}a\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ c{\isaliteral{22}{\isachardoublequoteclose}}\ \isacommand{by}\isamarkupfalse% |
40964 | 787 |
\ my{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{27}{\isacharprime}}% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
788 |
\endisatagproof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
789 |
{\isafoldproof}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
790 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
791 |
\isadelimproof |
40964 | 792 |
\isanewline |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
793 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
794 |
\endisadelimproof |
40964 | 795 |
\isacommand{end}\isamarkupfalse% |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
796 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
797 |
\begin{isamarkuptext}% |
40406 | 798 |
\medskip The \hyperlink{method.my-simp}{\mbox{\isa{my{\isaliteral{5F}{\isacharunderscore}}simp}}} variants defined above are |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
799 |
``simple'' methods, i.e.\ the goal facts are merely inserted as goal |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
800 |
premises by the \verb|SIMPLE_METHOD'| or \verb|SIMPLE_METHOD| wrapper. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
801 |
For proof methods that are similar to the standard collection of |
40126 | 802 |
\hyperlink{method.simp}{\mbox{\isa{simp}}}, \hyperlink{method.blast}{\mbox{\isa{blast}}}, \hyperlink{method.fast}{\mbox{\isa{fast}}}, \hyperlink{method.auto}{\mbox{\isa{auto}}} |
803 |
there is little more that can be done. |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
804 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
805 |
Note that using the primary goal facts in the same manner as the |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
806 |
method arguments obtained via concrete syntax or the context does |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
807 |
not meet the requirement of ``strong emphasis on facts'' of regular |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
808 |
proof methods, because rewrite rules as used above can be easily |
40406 | 809 |
ignored. A proof text ``\hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}~\isa{foo}~\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{my{\isaliteral{5F}{\isacharunderscore}}simp}'' where \isa{foo} is not used would |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
810 |
deceive the reader. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
811 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
812 |
\medskip The technical treatment of rules from the context requires |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
813 |
further attention. Above we rebuild a fresh \verb|simpset| from |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
814 |
the arguments and \emph{all} rules retrieved from the context on |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
815 |
every invocation of the method. This does not scale to really large |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
816 |
collections of rules, which easily emerges in the context of a big |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
817 |
theory library, for example. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
818 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
819 |
This is an inherent limitation of the simplistic rule management via |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
820 |
functor \verb|Named_Thms|, because it lacks tool-specific |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
821 |
storage and retrieval. More realistic applications require |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
822 |
efficient index-structures that organize theorems in a customized |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
823 |
manner, such as a discrimination net that is indexed by the |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
824 |
left-hand sides of rewrite rules. For variations on the Simplifier, |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
825 |
re-use of the existing type \verb|simpset| is adequate, but |
40126 | 826 |
scalability would require it be maintained statically within the |
827 |
context data, not dynamically on each tool invocation.% |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
828 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
829 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
830 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
831 |
\isamarkupsection{Attributes \label{sec:attributes}% |
30296 | 832 |
} |
833 |
\isamarkuptrue% |
|
834 |
% |
|
835 |
\begin{isamarkuptext}% |
|
40406 | 836 |
An \emph{attribute} is a function \isa{context\ {\isaliteral{5C3C74696D65733E}{\isasymtimes}}\ thm\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ context\ {\isaliteral{5C3C74696D65733E}{\isasymtimes}}\ thm}, which means both a (generic) context and a theorem |
45414 | 837 |
can be modified simultaneously. In practice this mixed form is very |
838 |
rare, instead attributes are presented either as \emph{declaration |
|
839 |
attribute:} \isa{thm\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ context} or \emph{rule |
|
840 |
attribute:} \isa{context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ thm\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ thm}. |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
841 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
842 |
Attributes can have additional arguments via concrete syntax. There |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
843 |
is a collection of context-sensitive parsers for various logical |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
844 |
entities (types, terms, theorems). These already take care of |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
845 |
applying morphisms to the arguments when attribute expressions are |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
846 |
moved into a different context (see also \secref{sec:morphisms}). |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
847 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
848 |
When implementing declaration attributes, it is important to operate |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
849 |
exactly on the variant of the generic context that is provided by |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
850 |
the system, which is either global theory context or local proof |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
851 |
context. In particular, the background theory of a local context |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
852 |
must not be modified in this situation!% |
30296 | 853 |
\end{isamarkuptext}% |
854 |
\isamarkuptrue% |
|
855 |
% |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
856 |
\isadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
857 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
858 |
\endisadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
859 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
860 |
\isatagmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
861 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
862 |
\begin{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
863 |
\begin{mldecls} |
45414 | 864 |
\indexdef{}{ML type}{attribute}\verb|type attribute| \\ |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
865 |
\indexdef{}{ML}{Thm.rule\_attribute}\verb|Thm.rule_attribute: (Context.generic -> thm -> thm) -> attribute| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
866 |
\indexdef{}{ML}{Thm.declaration\_attribute}\verb|Thm.declaration_attribute: |\isasep\isanewline% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
867 |
\verb| (thm -> Context.generic -> Context.generic) -> attribute| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
868 |
\indexdef{}{ML}{Attrib.setup}\verb|Attrib.setup: binding -> attribute context_parser ->|\isasep\isanewline% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
869 |
\verb| string -> theory -> theory| \\ |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
870 |
\end{mldecls} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
871 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
872 |
\begin{description} |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
873 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
874 |
\item Type \verb|attribute| represents attributes as concrete |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
875 |
type alias. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
876 |
|
40406 | 877 |
\item \verb|Thm.rule_attribute|~\isa{{\isaliteral{28}{\isacharparenleft}}fn\ context\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ rule{\isaliteral{29}{\isacharparenright}}} wraps |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
878 |
a context-dependent rule (mapping on \verb|thm|) as attribute. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
879 |
|
40406 | 880 |
\item \verb|Thm.declaration_attribute|~\isa{{\isaliteral{28}{\isacharparenleft}}fn\ thm\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ decl{\isaliteral{29}{\isacharparenright}}} |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
881 |
wraps a theorem-dependent declaration (mapping on \verb|Context.generic|) as attribute. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
882 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
883 |
\item \verb|Attrib.setup|~\isa{name\ parser\ description} provides |
40406 | 884 |
the functionality of the Isar command \hyperlink{command.attribute-setup}{\mbox{\isa{\isacommand{attribute{\isaliteral{5F}{\isacharunderscore}}setup}}}} as |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
885 |
ML function. |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
886 |
|
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
887 |
\end{description}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
888 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
889 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
890 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
891 |
\endisatagmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
892 |
{\isafoldmlref}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
893 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
894 |
\isadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
895 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
896 |
\endisadelimmlref |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
897 |
% |
45592 | 898 |
\isadelimmlantiq |
899 |
% |
|
900 |
\endisadelimmlantiq |
|
901 |
% |
|
902 |
\isatagmlantiq |
|
903 |
% |
|
904 |
\begin{isamarkuptext}% |
|
905 |
\begin{matharray}{rcl} |
|
906 |
\indexdef{}{ML antiquotation}{attributes}\hypertarget{ML antiquotation.attributes}{\hyperlink{ML antiquotation.attributes}{\mbox{\isa{attributes}}}} & : & \isa{ML{\isaliteral{5F}{\isacharunderscore}}antiquotation} \\ |
|
907 |
\end{matharray} |
|
908 |
||
909 |
\begin{railoutput} |
|
910 |
\rail@begin{1}{} |
|
911 |
\rail@term{\hyperlink{ML antiquotation.attributes}{\mbox{\isa{attributes}}}}[] |
|
912 |
\rail@nont{\isa{attributes}}[] |
|
913 |
\rail@end |
|
914 |
\end{railoutput} |
|
915 |
||
916 |
||
917 |
\begin{description} |
|
918 |
||
919 |
\item \isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}attributes\ {\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{7D}{\isacharbraceright}}} embeds attribute source |
|
920 |
representation into the ML text, which is particularly useful with |
|
921 |
declarations like \verb|Local_Theory.note|. Attribute names are |
|
922 |
internalized at compile time, but the source is unevaluated. This |
|
923 |
means attributes with formal arguments (types, terms, theorems) may |
|
924 |
be subject to odd effects of dynamic scoping! |
|
925 |
||
926 |
\end{description}% |
|
927 |
\end{isamarkuptext}% |
|
928 |
\isamarkuptrue% |
|
929 |
% |
|
930 |
\endisatagmlantiq |
|
931 |
{\isafoldmlantiq}% |
|
932 |
% |
|
933 |
\isadelimmlantiq |
|
934 |
% |
|
935 |
\endisadelimmlantiq |
|
936 |
% |
|
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
937 |
\isadelimmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
938 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
939 |
\endisadelimmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
940 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
941 |
\isatagmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
942 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
943 |
\begin{isamarkuptext}% |
40406 | 944 |
See also \hyperlink{command.attribute-setup}{\mbox{\isa{\isacommand{attribute{\isaliteral{5F}{\isacharunderscore}}setup}}}} in |
39885
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
945 |
\cite{isabelle-isar-ref} which includes some abstract examples.% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
946 |
\end{isamarkuptext}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
947 |
\isamarkuptrue% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
948 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
949 |
\endisatagmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
950 |
{\isafoldmlex}% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
951 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
952 |
\isadelimmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
953 |
% |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
954 |
\endisadelimmlex |
6a3f7941c3a0
cumulative update of generated files (since bf164c153d10);
wenzelm
parents:
30296
diff
changeset
|
955 |
% |
30296 | 956 |
\isadelimtheory |
957 |
% |
|
958 |
\endisadelimtheory |
|
959 |
% |
|
960 |
\isatagtheory |
|
961 |
\isacommand{end}\isamarkupfalse% |
|
962 |
% |
|
963 |
\endisatagtheory |
|
964 |
{\isafoldtheory}% |
|
965 |
% |
|
966 |
\isadelimtheory |
|
967 |
% |
|
968 |
\endisadelimtheory |
|
969 |
\isanewline |
|
970 |
\end{isabellebody}% |
|
971 |
%%% Local Variables: |
|
972 |
%%% mode: latex |
|
973 |
%%% TeX-master: "root" |
|
974 |
%%% End: |