doc-src/TutorialI/Rules/rules.tex
changeset 11159 07b13770c4d6
parent 11155 603df40ef1e9
child 11179 bee6673b020a
equal deleted inserted replaced
11158:5652018b809a 11159:07b13770c4d6
   568 As we have seen, Isabelle rules involve schematic variables that begin with
   568 As we have seen, Isabelle rules involve schematic variables that begin with
   569 a question mark and act as
   569 a question mark and act as
   570 placeholders for terms.  \emph{Unification} refers to  the process of
   570 placeholders for terms.  \emph{Unification} refers to  the process of
   571 making two terms identical, possibly by replacing their schematic variables by
   571 making two terms identical, possibly by replacing their schematic variables by
   572 terms.  The simplest case is when the two terms  are already the same. Next
   572 terms.  The simplest case is when the two terms  are already the same. Next
   573 simplest is when the variables in only one of the term
   573 simplest is when the variables in only one of the terms
   574  are replaced; this is called pattern-matching.  The
   574  are replaced; this is called pattern-matching.  The
   575 \isa{rule} method typically  matches the rule's conclusion
   575 \isa{rule} method typically  matches the rule's conclusion
   576 against the current subgoal.  In the most complex case,  variables in both
   576 against the current subgoal.  In the most complex case,  variables in both
   577 terms are replaced; the \isa{rule} method can do this if the goal
   577 terms are replaced; the \isa{rule} method can do this if the goal
   578 itself contains schematic variables.  Other occurrences of the variables in
   578 itself contains schematic variables.  Other occurrences of the variables in
   653 cases it can be fooled.) When we apply substitution,  Isabelle replaces every
   653 cases it can be fooled.) When we apply substitution,  Isabelle replaces every
   654 \isa{x} in the subgoal by \isa{f x} just once: it cannot loop.  The
   654 \isa{x} in the subgoal by \isa{f x} just once: it cannot loop.  The
   655 resulting subgoal is trivial by assumption, so the \isacommand{by} command
   655 resulting subgoal is trivial by assumption, so the \isacommand{by} command
   656 proves it implicitly. 
   656 proves it implicitly. 
   657 
   657 
   658 We are using the \isa{erule} method it in a novel way. Hitherto, 
   658 We are using the \isa{erule} method in a novel way. Hitherto, 
   659 the conclusion of the rule was just a variable such as~\isa{?R}, but it may
   659 the conclusion of the rule was just a variable such as~\isa{?R}, but it may
   660 be any term. The conclusion is unified with the subgoal just as 
   660 be any term. The conclusion is unified with the subgoal just as 
   661 it would be with the \isa{rule} method. At the same time \isa{erule} looks 
   661 it would be with the \isa{rule} method. At the same time \isa{erule} looks 
   662 for an assumption that matches the rule's first premise, as usual.  With
   662 for an assumption that matches the rule's first premise, as usual.  With
   663 \isa{ssubst} the effect is to find, use and delete an equality 
   663 \isa{ssubst} the effect is to find, use and delete an equality