doc-src/Ref/substitution.tex
author paulson
Wed, 07 May 1997 16:29:06 +0200
changeset 3128 d01d4c0c4b44
parent 3108 335efc3f5632
child 3950 e9d5bcae8351
permissions -rw-r--r--
New acknowledgements; fixed overfull lines and tables
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     1
%% $Id$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     2
\chapter{Substitution Tactics} \label{substitution}
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
     3
\index{tactics!substitution|(}\index{equality|(}
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
     4
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     5
Replacing equals by equals is a basic form of reasoning.  Isabelle supports
332
01b87a921967 final Springer copy
lcp
parents: 323
diff changeset
     6
several kinds of equality reasoning.  {\bf Substitution} means replacing
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     7
free occurrences of~$t$ by~$u$ in a subgoal.  This is easily done, given an
332
01b87a921967 final Springer copy
lcp
parents: 323
diff changeset
     8
equality $t=u$, provided the logic possesses the appropriate rule.  The
01b87a921967 final Springer copy
lcp
parents: 323
diff changeset
     9
tactic {\tt hyp_subst_tac} performs substitution even in the assumptions.
01b87a921967 final Springer copy
lcp
parents: 323
diff changeset
    10
But it works via object-level implication, and therefore must be specially
01b87a921967 final Springer copy
lcp
parents: 323
diff changeset
    11
set up for each suitable object-logic.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    12
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    13
Substitution should not be confused with object-level {\bf rewriting}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    14
Given equalities of the form $t=u$, rewriting replaces instances of~$t$ by
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    15
corresponding instances of~$u$, and continues until it reaches a normal
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    16
form.  Substitution handles `one-off' replacements by particular
332
01b87a921967 final Springer copy
lcp
parents: 323
diff changeset
    17
equalities while rewriting handles general equations.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    18
Chapter~\ref{simp-chap} discusses Isabelle's rewriting tactics.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    19
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    20
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    21
\section{Substitution rules}
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    22
\index{substitution!rules}\index{*subst theorem}
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    23
Many logics include a substitution rule of the form
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2038
diff changeset
    24
$$
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2038
diff changeset
    25
\List{\Var{a}=\Var{b}; \Var{P}(\Var{a})} \Imp 
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2038
diff changeset
    26
\Var{P}(\Var{b})  \eqno(subst)
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2038
diff changeset
    27
$$
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    28
In backward proof, this may seem difficult to use: the conclusion
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    29
$\Var{P}(\Var{b})$ admits far too many unifiers.  But, if the theorem {\tt
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    30
eqth} asserts $t=u$, then \hbox{\tt eqth RS subst} is the derived rule
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    31
\[ \Var{P}(t) \Imp \Var{P}(u). \]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    32
Provided $u$ is not an unknown, resolution with this rule is
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    33
well-behaved.\footnote{Unifying $\Var{P}(u)$ with a formula~$Q$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    34
expresses~$Q$ in terms of its dependence upon~$u$.  There are still $2^k$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    35
unifiers, if $Q$ has $k$ occurrences of~$u$, but Isabelle ensures that
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    36
the first unifier includes all the occurrences.}  To replace $u$ by~$t$ in
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    37
subgoal~$i$, use
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    38
\begin{ttbox} 
332
01b87a921967 final Springer copy
lcp
parents: 323
diff changeset
    39
resolve_tac [eqth RS subst] \(i\){\it.}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    40
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    41
To replace $t$ by~$u$ in
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    42
subgoal~$i$, use
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    43
\begin{ttbox} 
332
01b87a921967 final Springer copy
lcp
parents: 323
diff changeset
    44
resolve_tac [eqth RS ssubst] \(i\){\it,}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    45
\end{ttbox}
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    46
where \tdxbold{ssubst} is the `swapped' substitution rule
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2038
diff changeset
    47
$$
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2038
diff changeset
    48
\List{\Var{a}=\Var{b}; \Var{P}(\Var{b})} \Imp 
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2038
diff changeset
    49
\Var{P}(\Var{a}).  \eqno(ssubst)
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2038
diff changeset
    50
$$
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    51
If \tdx{sym} denotes the symmetry rule
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    52
\(\Var{a}=\Var{b}\Imp\Var{b}=\Var{a}\), then {\tt ssubst} is just
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    53
\hbox{\tt sym RS subst}.  Many logics with equality include the rules {\tt
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    54
subst} and {\tt ssubst}, as well as {\tt refl}, {\tt sym} and {\tt trans}
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    55
(for the usual equality laws).  Examples include {\tt FOL} and {\tt HOL},
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    56
but not {\tt CTT} (Constructive Type Theory).
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    57
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    58
Elim-resolution is well-behaved with assumptions of the form $t=u$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    59
To replace $u$ by~$t$ or $t$ by~$u$ in subgoal~$i$, use
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    60
\begin{ttbox} 
332
01b87a921967 final Springer copy
lcp
parents: 323
diff changeset
    61
eresolve_tac [subst] \(i\)    {\rm or}    eresolve_tac [ssubst] \(i\){\it.}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    62
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    63
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2038
diff changeset
    64
Logics \HOL, {\FOL} and {\ZF} define the tactic \ttindexbold{stac} by
2038
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
    65
\begin{ttbox} 
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
    66
fun stac eqth = CHANGED o rtac (eqth RS ssubst);
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
    67
\end{ttbox}
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
    68
Now {\tt stac~eqth} is like {\tt resolve_tac [eqth RS ssubst]} but with the
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
    69
valuable property of failing if the substitution has no effect.
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
    70
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    71
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    72
\section{Substitution in the hypotheses}
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    73
\index{assumptions!substitution in}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    74
Substitution rules, like other rules of natural deduction, do not affect
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    75
the assumptions.  This can be inconvenient.  Consider proving the subgoal
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    76
\[ \List{c=a; c=b} \Imp a=b. \]
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    77
Calling {\tt eresolve_tac\ts[ssubst]\ts\(i\)} simply discards the
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    78
assumption~$c=a$, since $c$ does not occur in~$a=b$.  Of course, we can
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    79
work out a solution.  First apply {\tt eresolve_tac\ts[subst]\ts\(i\)},
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    80
replacing~$a$ by~$c$:
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    81
\[ \List{c=b} \Imp c=b \]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    82
Equality reasoning can be difficult, but this trivial proof requires
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    83
nothing more sophisticated than substitution in the assumptions.
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    84
Object-logics that include the rule~$(subst)$ provide tactics for this
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    85
purpose:
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    86
\begin{ttbox} 
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    87
hyp_subst_tac       : int -> tactic
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    88
bound_hyp_subst_tac : int -> tactic
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    89
\end{ttbox}
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    90
\begin{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    91
\item[\ttindexbold{hyp_subst_tac} {\it i}] 
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    92
  selects an equality assumption of the form $t=u$ or $u=t$, where $t$ is a
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    93
  free variable or parameter.  Deleting this assumption, it replaces $t$
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    94
  by~$u$ throughout subgoal~$i$, including the other assumptions.
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    95
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    96
\item[\ttindexbold{bound_hyp_subst_tac} {\it i}] 
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    97
  is similar but only substitutes for parameters (bound variables).
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    98
  Uses for this are discussed below.
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
    99
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   100
The term being replaced must be a free variable or parameter.  Substitution
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   101
for constants is usually unhelpful, since they may appear in other
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   102
theorems.  For instance, the best way to use the assumption $0=1$ is to
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   103
contradict a theorem that states $0\not=1$, rather than to replace 0 by~1
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   104
in the subgoal!
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   105
2038
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   106
Substitution for unknowns, such as $\Var{x}=0$, is a bad idea: we might prove
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   107
the subgoal more easily by instantiating~$\Var{x}$ to~1.
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   108
Substitution for free variables is unhelpful if they appear in the
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   109
premises of a rule being derived: the substitution affects object-level
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   110
assumptions, not meta-level assumptions.  For instance, replacing~$a$
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
   111
by~$b$ could make the premise~$P(a)$ worthless.  To avoid this problem, use
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
   112
{\tt bound_hyp_subst_tac}; alternatively, call \ttindex{cut_facts_tac} to
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
   113
insert the atomic premises as object-level assumptions.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   114
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   115
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   116
\section{Setting up {\tt hyp_subst_tac}} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   117
Many Isabelle object-logics, such as {\tt FOL}, {\tt HOL} and their
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   118
descendants, come with {\tt hyp_subst_tac} already defined.  A few others,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   119
such as {\tt CTT}, do not support this tactic because they lack the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   120
rule~$(subst)$.  When defining a new logic that includes a substitution
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   121
rule and implication, you must set up {\tt hyp_subst_tac} yourself.  It
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   122
is packaged as the \ML{} functor \ttindex{HypsubstFun}, which takes the
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
   123
argument signature~{\tt HYPSUBST_DATA}:
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   124
\begin{ttbox} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   125
signature HYPSUBST_DATA =
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   126
  sig
2038
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   127
  structure Simplifier : SIMPLIFIER
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   128
  val dest_eq          : term -> term*term
3128
d01d4c0c4b44 New acknowledgements; fixed overfull lines and tables
paulson
parents: 3108
diff changeset
   129
  val eq_reflection    : thm             (* a=b ==> a==b *)
d01d4c0c4b44 New acknowledgements; fixed overfull lines and tables
paulson
parents: 3108
diff changeset
   130
  val imp_intr         : thm             (* (P ==> Q) ==> P-->Q *)
d01d4c0c4b44 New acknowledgements; fixed overfull lines and tables
paulson
parents: 3108
diff changeset
   131
  val rev_mp           : thm             (* [| P;  P-->Q |] ==> Q *)
d01d4c0c4b44 New acknowledgements; fixed overfull lines and tables
paulson
parents: 3108
diff changeset
   132
  val subst            : thm             (* [| a=b;  P(a) |] ==> P(b) *)
d01d4c0c4b44 New acknowledgements; fixed overfull lines and tables
paulson
parents: 3108
diff changeset
   133
  val sym              : thm             (* a=b ==> b=a *)
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   134
  end;
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   135
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   136
Thus, the functor requires the following items:
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
   137
\begin{ttdescription}
2038
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   138
\item[Simplifier] should be an instance of the simplifier (see
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   139
  Chapter~\ref{simp-chap}).
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   140
2038
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   141
\item[\ttindexbold{dest_eq}] should return the pair~$(t,u)$ when
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   142
applied to the \ML{} term that represents~$t=u$.  For other terms, it
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   143
should raise exception~\xdx{Match}.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   144
2038
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   145
\item[\tdxbold{eq_reflection}] is the theorem discussed
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   146
  in~\S\ref{sec:setting-up-simp}. 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   147
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
   148
\item[\tdxbold{imp_intr}] should be the implies introduction
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   149
rule $(\Var{P}\Imp\Var{Q})\Imp \Var{P}\imp\Var{Q}$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   150
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
   151
\item[\tdxbold{rev_mp}] should be the `reversed' implies elimination
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   152
rule $\List{\Var{P};  \;\Var{P}\imp\Var{Q}} \Imp \Var{Q}$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   153
2038
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   154
\item[\tdxbold{subst}] should be the substitution rule
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   155
$\List{\Var{a}=\Var{b};\; \Var{P}(\Var{a})} \Imp \Var{P}(\Var{b})$.
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   156
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   157
\item[\tdxbold{sym}] should be the symmetry rule
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   158
$\Var{a}=\Var{b}\Imp\Var{b}=\Var{a}$.
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
   159
\end{ttdescription}
2038
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   160
%
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
   161
The functor resides in file {\tt Provers/hypsubst.ML} in the Isabelle
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   162
distribution directory.  It is not sensitive to the precise formalization
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   163
of the object-logic.  It is not concerned with the names of the equality
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   164
and implication symbols, or the types of formula and terms.  Coding the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   165
function {\tt dest_eq} requires knowledge of Isabelle's representation of
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   166
terms.  For {\tt FOL} it is defined by
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   167
\begin{ttbox} 
286
e7efbf03562b first draft of Springer book
lcp
parents: 148
diff changeset
   168
fun dest_eq (Const("Trueprop",_) $ (Const("op =",_)$t$u)) = (t,u)
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   169
\end{ttbox}
148
67d046de093e corrected trivial typo;
wenzelm
parents: 104
diff changeset
   170
Here {\tt Trueprop} is the coercion from type~$o$ to type~$prop$, while
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   171
\hbox{\tt op =} is the internal name of the infix operator~{\tt=}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   172
Pattern-matching expresses the function concisely, using wildcards~({\tt_})
332
01b87a921967 final Springer copy
lcp
parents: 323
diff changeset
   173
for the types.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   174
2038
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   175
The tactic {\tt hyp_subst_tac} works as follows.  First, it identifies a
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   176
suitable equality assumption, possibly re-orienting it using~{\tt sym}.  Then
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   177
it moves other assumptions into the conclusion of the goal, by repeatedly
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   178
caling {\tt eresolve_tac\ts[rev_mp]}.  Then, it uses {\tt asm_full_simp_tac}
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   179
or {\tt ssubst} to substitute throughout the subgoal.  (If the equality
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   180
involves unknowns then it must use {\tt ssubst}.)  Then, it deletes the
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   181
equality.  Finally, it moves the assumptions back to their original positions
26b62963806c Documented stac, and updated the documentation of hyp_subst_tac
paulson
parents: 332
diff changeset
   182
by calling \hbox{\tt resolve_tac\ts[imp_intr]}.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   183
323
361a71713176 penultimate Springer draft
lcp
parents: 286
diff changeset
   184
\index{equality|)}\index{tactics!substitution|)}