1
; Here is another example of a double-rewrite warning from the right-hand side
2
; of a rewrite rule (see also rhs1.lisp).
6
; The following explanation is given in a bit more detail in the associated
9
; The problem illustrated below is that when we are relieving hyps, we have
10
; just one rewrite to make everything work. So we cannot rely on the second
13
; In more detail, we need to relieve (h (e (f a))). H admits equiv1 as a
14
; congruence. We use rule1 to rewrite (h (e (f a))) to (h (f a)). Then we'd
15
; like to use rule2 to rewrite (h (f a)) to (h (g a)) so we can finish by
16
; appealing to rule4. But without a double-rewrite on the right-hand side of
17
; rule1 it won't work.
19
; The above is not absolutely correct. There is a way to make it work without
20
; putting a double-rewrite on the right-hand side of rule1. The way is to put
21
; TWO double-rewrites in rule3, i.e., turn it into
23
; (defthm rule3 (implies (h (double-rewrite (double-rewrite x))) (c x)))
25
; But we don't like that because you can't predict how many nested
26
; double-rewrites you'll need. The "fault" lies with rule1.
30
(defstub equiv1 (x y) t)
39
(defthm rule1 (equiv1 (e x) x)) ; Double-rewrite warning for x on rhs
40
(defthm rule2 (equiv1 (f x) (g x)))
41
(defcong equiv1 equal (h x) 1)
42
(defthm rule3 (implies (h (double-rewrite (double-rewrite x))) (c x)))
43
(defthm rule4 (h (g a)))))