168 \ttindex{BEST_FIRST}. |
168 \ttindex{BEST_FIRST}. |
169 \end{ttdescription} |
169 \end{ttdescription} |
170 |
170 |
171 \index{search!tacticals|)} |
171 \index{search!tacticals|)} |
172 |
172 |
173 |
|
174 \section{Tacticals for subgoal numbering} |
|
175 When conducting a backward proof, we normally consider one goal at a time. |
|
176 A tactic can affect the entire proof state, but many tactics --- such as |
|
177 {\tt resolve_tac} and {\tt assume_tac} --- work on a single subgoal. |
|
178 Subgoals are designated by a positive integer, so Isabelle provides |
|
179 tacticals for combining values of type {\tt int->tactic}. |
|
180 |
|
181 |
|
182 \subsection{Restricting a tactic to one subgoal} |
|
183 \index{tactics!restricting to a subgoal} |
|
184 \index{tacticals!for restriction to a subgoal} |
|
185 \begin{ttbox} |
|
186 SELECT_GOAL : tactic -> int -> tactic |
|
187 \end{ttbox} |
|
188 \begin{ttdescription} |
|
189 \item[\ttindexbold{SELECT_GOAL} {\it tac} $i$] |
|
190 restricts the effect of {\it tac\/} to subgoal~$i$ of the proof state. It |
|
191 fails if there is no subgoal~$i$, or if {\it tac\/} changes the main goal. |
|
192 It applies {\it tac\/} to a dummy proof state and uses the result to |
|
193 refine the original proof state at subgoal~$i$. If {\it tac\/} |
|
194 returns multiple results then so does \hbox{\tt SELECT_GOAL {\it tac} |
|
195 $i$}. |
|
196 |
|
197 {\tt SELECT_GOAL} works by creating a state of the form $\phi\Imp\phi$, |
|
198 with the one subgoal~$\phi$. If subgoal~$i$ has the form $\psi\Imp\theta$ |
|
199 then $(\psi\Imp\theta)\Imp(\psi\Imp\theta)$ is in fact |
|
200 $\List{\psi\Imp\theta;\; \psi}\Imp\theta$, a proof state with two subgoals. |
|
201 Such a proof state might cause tactics to go astray. Therefore {\tt |
|
202 SELECT_GOAL} inserts a quantifier to create the state |
|
203 \[ (\Forall x.\psi\Imp\theta)\Imp(\Forall x.\psi\Imp\theta). \] |
|
204 |
|
205 \end{ttdescription} |
|
206 |
|
207 \index{tacticals|)} |
|
208 |
|
209 |
|
210 %%% Local Variables: |
173 %%% Local Variables: |
211 %%% mode: latex |
174 %%% mode: latex |
212 %%% TeX-master: "ref" |
175 %%% TeX-master: "ref" |
213 %%% End: |
176 %%% End: |