doc-src/TutorialI/Advanced/simp.thy
author nipkow
Mon, 19 Mar 2001 17:25:42 +0100
changeset 11216 279004936bb0
parent 11196 bb4ede27fcb7
child 11458 09a6c44a48ea
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
     1
(*<*)
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
     2
theory simp = Main:
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
     3
(*>*)
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
     4
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
     5
section{*Simplification*}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
     6
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
     7
text{*\label{sec:simplification-II}\index{simplification|(}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
     8
This section discusses some additional nifty features not covered so far and
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
     9
gives a short introduction to the simplification process itself. The latter
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    10
is helpful to understand why a particular rule does or does not apply in some
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    11
situation.
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    12
*}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    13
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
    14
subsection{*Advanced Features*}
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    15
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
    16
subsubsection{*Congruence Rules*}
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    17
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    18
text{*\label{sec:simp-cong}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    19
It is hardwired into the simplifier that while simplifying the conclusion $Q$
11196
bb4ede27fcb7 *** empty log message ***
nipkow
parents: 10978
diff changeset
    20
of $P \Imp Q$ it is legal to make uses of the assumption $P$. This
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    21
kind of contextual information can also be made available for other
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    22
operators. For example, @{prop"xs = [] --> xs@xs = xs"} simplifies to @{term
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    23
True} because we may use @{prop"xs = []"} when simplifying @{prop"xs@xs =
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    24
xs"}. The generation of contextual information during simplification is
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    25
controlled by so-called \bfindex{congruence rules}. This is the one for
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    26
@{text"\<longrightarrow>"}:
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    27
@{thm[display]imp_cong[no_vars]}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    28
It should be read as follows:
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    29
In order to simplify @{prop"P-->Q"} to @{prop"P'-->Q'"},
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    30
simplify @{prop P} to @{prop P'}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    31
and assume @{prop"P'"} when simplifying @{prop Q} to @{prop"Q'"}.
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    32
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    33
Here are some more examples.  The congruence rules for bounded
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    34
quantifiers supply contextual information about the bound variable:
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    35
@{thm[display,eta_contract=false,margin=60]ball_cong[no_vars]}
11196
bb4ede27fcb7 *** empty log message ***
nipkow
parents: 10978
diff changeset
    36
The congruence rule for conditional expressions supplies contextual
bb4ede27fcb7 *** empty log message ***
nipkow
parents: 10978
diff changeset
    37
information for simplifying the @{text then} and @{text else} cases:
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    38
@{thm[display]if_cong[no_vars]}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    39
A congruence rule can also \emph{prevent} simplification of some arguments.
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    40
Here is an alternative congruence rule for conditional expressions:
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    41
@{thm[display]if_weak_cong[no_vars]}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    42
Only the first argument is simplified; the others remain unchanged.
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    43
This makes simplification much faster and is faithful to the evaluation
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    44
strategy in programming languages, which is why this is the default
11196
bb4ede27fcb7 *** empty log message ***
nipkow
parents: 10978
diff changeset
    45
congruence rule for @{text if}. Analogous rules control the evaluation of
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    46
@{text case} expressions.
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    47
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
    48
You can declare your own congruence rules with the attribute @{text cong},
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    49
either globally, in the usual manner,
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    50
\begin{quote}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    51
\isacommand{declare} \textit{theorem-name} @{text"[cong]"}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    52
\end{quote}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    53
or locally in a @{text"simp"} call by adding the modifier
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    54
\begin{quote}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    55
@{text"cong:"} \textit{list of theorem names}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    56
\end{quote}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    57
The effect is reversed by @{text"cong del"} instead of @{text cong}.
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    58
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    59
\begin{warn}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    60
The congruence rule @{thm[source]conj_cong}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    61
@{thm[display]conj_cong[no_vars]}
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
    62
\par\noindent
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
    63
is occasionally useful but is not a default rule; you have to declare it explicitly.
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    64
\end{warn}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    65
*}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    66
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
    67
subsubsection{*Permutative Rewrite Rules*}
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    68
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    69
text{*
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    70
\index{rewrite rule!permutative|bold}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    71
\index{rewriting!ordered|bold}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    72
\index{ordered rewriting|bold}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    73
\index{simplification!ordered|bold}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    74
An equation is a \bfindex{permutative rewrite rule} if the left-hand
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    75
side and right-hand side are the same up to renaming of variables.  The most
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    76
common permutative rule is commutativity: @{prop"x+y = y+x"}.  Other examples
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    77
include @{prop"(x-y)-z = (x-z)-y"} in arithmetic and @{prop"insert x (insert
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    78
y A) = insert y (insert x A)"} for sets. Such rules are problematic because
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    79
once they apply, they can be used forever. The simplifier is aware of this
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    80
danger and treats permutative rules by means of a special strategy, called
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    81
\bfindex{ordered rewriting}: a permutative rewrite
10978
5eebea8f359f *** empty log message ***
nipkow
parents: 10885
diff changeset
    82
rule is only applied if the term becomes smaller with respect to a fixed
5eebea8f359f *** empty log message ***
nipkow
parents: 10885
diff changeset
    83
lexicographic ordering on terms. For example, commutativity rewrites
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    84
@{term"b+a"} to @{term"a+b"}, but then stops because @{term"a+b"} is strictly
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    85
smaller than @{term"b+a"}.  Permutative rewrite rules can be turned into
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    86
simplification rules in the usual manner via the @{text simp} attribute; the
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    87
simplifier recognizes their special status automatically.
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    88
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    89
Permutative rewrite rules are most effective in the case of
10281
9554ce1c2e54 *** empty log message ***
nipkow
parents: 10186
diff changeset
    90
associative-commutative functions.  (Associativity by itself is not
9554ce1c2e54 *** empty log message ***
nipkow
parents: 10186
diff changeset
    91
permutative.)  When dealing with an AC-function~$f$, keep the
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    92
following points in mind:
10281
9554ce1c2e54 *** empty log message ***
nipkow
parents: 10186
diff changeset
    93
\begin{itemize}\index{associative-commutative function}
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    94
  
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    95
\item The associative law must always be oriented from left to right,
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    96
  namely $f(f(x,y),z) = f(x,f(y,z))$.  The opposite orientation, if
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    97
  used with commutativity, can lead to nontermination.
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    98
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
    99
\item To complete your set of rewrite rules, you must add not just
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   100
  associativity~(A) and commutativity~(C) but also a derived rule, {\bf
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   101
    left-com\-mut\-ativ\-ity} (LC): $f(x,f(y,z)) = f(y,f(x,z))$.
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   102
\end{itemize}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   103
Ordered rewriting with the combination of A, C, and LC sorts a term
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   104
lexicographically:
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   105
\[\def\maps#1{~\stackrel{#1}{\leadsto}~}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   106
 f(f(b,c),a) \maps{A} f(b,f(c,a)) \maps{C} f(b,f(a,c)) \maps{LC} f(a,f(b,c)) \]
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   107
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   108
Note that ordered rewriting for @{text"+"} and @{text"*"} on numbers is rarely
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   109
necessary because the built-in arithmetic prover often succeeds without
11196
bb4ede27fcb7 *** empty log message ***
nipkow
parents: 10978
diff changeset
   110
such tricks.
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   111
*}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   112
11216
279004936bb0 *** empty log message ***
nipkow
parents: 11196
diff changeset
   113
subsection{*How it Works*}
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   114
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   115
text{*\label{sec:SimpHow}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   116
Roughly speaking, the simplifier proceeds bottom-up (subterms are simplified
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   117
first) and a conditional equation is only applied if its condition could be
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   118
proved (again by simplification). Below we explain some special features of the rewriting process.
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   119
*}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   120
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   121
subsubsection{*Higher-Order Patterns*}
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   122
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   123
text{*\index{simplification rule|(}
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   124
So far we have pretended the simplifier can deal with arbitrary
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   125
rewrite rules. This is not quite true.  Due to efficiency (and
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   126
potentially also computability) reasons, the simplifier expects the
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   127
left-hand side of each rule to be a so-called \emph{higher-order
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   128
pattern}~\cite{nipkow-patterns}\indexbold{higher-order
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   129
pattern}\indexbold{pattern, higher-order}. This restricts where
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   130
unknowns may occur.  Higher-order patterns are terms in $\beta$-normal
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   131
form (this will always be the case unless you have done something
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   132
strange) where each occurrence of an unknown is of the form
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   133
$\Var{f}~x@1~\dots~x@n$, where the $x@i$ are distinct bound
10978
5eebea8f359f *** empty log message ***
nipkow
parents: 10885
diff changeset
   134
variables. Thus all ordinary rewrite rules, where all unknowns are
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   135
of base type, for example @{thm add_assoc}, are OK: if an unknown is
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   136
of base type, it cannot have any arguments. Additionally, the rule
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   137
@{text"(\<forall>x. ?P x \<and> ?Q x) = ((\<forall>x. ?P x) \<and> (\<forall>x. ?Q x))"} is also OK, in
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   138
both directions: all arguments of the unknowns @{text"?P"} and
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   139
@{text"?Q"} are distinct bound variables.
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   140
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   141
If the left-hand side is not a higher-order pattern, not all is lost
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   142
and the simplifier will still try to apply the rule, but only if it
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   143
matches \emph{directly}, i.e.\ without much $\lambda$-calculus hocus
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   144
pocus. For example, @{text"?f ?x \<in> range ?f = True"} rewrites
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   145
@{term"g a \<in> range g"} to @{term True}, but will fail to match
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   146
@{text"g(h b) \<in> range(\<lambda>x. g(h x))"}.  However, you can
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   147
replace the offending subterms (in our case @{text"?f ?x"}, which
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   148
is not a pattern) by adding new variables and conditions: @{text"?y =
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   149
?f ?x \<Longrightarrow> ?y \<in> range ?f = True"} is fine
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   150
as a conditional rewrite rule since conditions can be arbitrary
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   151
terms. However, this trick is not a panacea because the newly
11196
bb4ede27fcb7 *** empty log message ***
nipkow
parents: 10978
diff changeset
   152
introduced conditions may be hard to solve.
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   153
  
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   154
There is no restriction on the form of the right-hand
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   155
sides.  They may not contain extraneous term or type variables, though.
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   156
*}
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   157
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   158
subsubsection{*The Preprocessor*}
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   159
10845
3696bc935bbd *** empty log message ***
nipkow
parents: 10795
diff changeset
   160
text{*\label{sec:simp-preprocessor}
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   161
When a theorem is declared a simplification rule, it need not be a
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   162
conditional equation already.  The simplifier will turn it into a set of
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   163
conditional equations automatically.  For example, @{prop"f x =
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   164
g x & h x = k x"} becomes the two separate
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   165
simplification rules @{prop"f x = g x"} and @{prop"h x = k x"}. In
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   166
general, the input theorem is converted as follows:
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   167
\begin{eqnarray}
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   168
\neg P &\mapsto& P = \hbox{\isa{False}} \nonumber\\
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   169
P \longrightarrow Q &\mapsto& P \Longrightarrow Q \nonumber\\
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   170
P \land Q &\mapsto& P,\ Q \nonumber\\
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   171
\forall x.~P~x &\mapsto& P~\Var{x}\nonumber\\
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   172
\forall x \in A.\ P~x &\mapsto& \Var{x} \in A \Longrightarrow P~\Var{x} \nonumber\\
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   173
@{text if}\ P\ @{text then}\ Q\ @{text else}\ R &\mapsto&
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   174
 P \Longrightarrow Q,\ \neg P \Longrightarrow R \nonumber
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   175
\end{eqnarray}
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   176
Once this conversion process is finished, all remaining non-equations
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   177
$P$ are turned into trivial equations $P =\isa{True}$.
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   178
For example, the formula 
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   179
\begin{center}@{prop"(p \<longrightarrow> t=u \<and> ~r) \<and> s"}\end{center}
10845
3696bc935bbd *** empty log message ***
nipkow
parents: 10795
diff changeset
   180
is converted into the three rules
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   181
\begin{center}
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10845
diff changeset
   182
@{prop"p \<Longrightarrow> t = u"},\quad  @{prop"p \<Longrightarrow> r = False"},\quad  @{prop"s = True"}.
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   183
\end{center}
499637e8f2c6 *** empty log message ***
nipkow
parents: 9958
diff changeset
   184
\index{simplification rule|)}
9958
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   185
\index{simplification|)}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   186
*}
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   187
(*<*)
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   188
end
67f2920862c7 *** empty log message ***
nipkow
parents:
diff changeset
   189
(*>*)