aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/success/autorewrite.v
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-06-18 20:35:32 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-06-18 20:35:32 +0000
commit32e18eb2ec0d44e4265f44d2f3f51daa7d67e9c0 (patch)
tree7571347858ea69b085ba522ccebf78301b8c1ae1 /test-suite/success/autorewrite.v
parent9d7499dcd4440aca458cb190ed108ae9b3adff17 (diff)
Relaxed the constraint introduced in r14190 that froze the existing
evars when rewriting. Use it for autorewrite and subst. Accept evars instantiation in multi_rewrite so that rewrite alone remains compatible (it is used in contribs, e.g. Godel, in places where it does not seem absurd to allow it), but there are no good reason for it. Comments welcome. + addition of some tests for rewriting (one being related to commit 14217) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14222 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'test-suite/success/autorewrite.v')
-rw-r--r--test-suite/success/autorewrite.v29
1 files changed, 29 insertions, 0 deletions
diff --git a/test-suite/success/autorewrite.v b/test-suite/success/autorewrite.v
new file mode 100644
index 000000000..5e9064f8a
--- /dev/null
+++ b/test-suite/success/autorewrite.v
@@ -0,0 +1,29 @@
+Variable Ack : nat -> nat -> nat.
+
+Axiom Ack0 : forall m : nat, Ack 0 m = S m.
+Axiom Ack1 : forall n : nat, Ack (S n) 0 = Ack n 1.
+Axiom Ack2 : forall n m : nat, Ack (S n) (S m) = Ack n (Ack (S n) m).
+
+Hint Rewrite Ack0 Ack1 Ack2 : base0.
+
+Lemma ResAck0 : (Ack 2 2 = 7 -> False) -> False.
+Proof.
+ intros.
+ autorewrite with base0 in H using try (apply H; reflexivity).
+Qed.
+
+Lemma ResAck1 : forall H:(Ack 2 2 = 7 -> False), True -> False.
+Proof.
+ intros.
+ autorewrite with base0 in *.
+ apply H;reflexivity.
+Qed.
+
+(* Check autorewrite does not solve existing evars *)
+(* See discussion started by A. Chargueraud in Oct 2010 on coqdev *)
+
+Hint Rewrite <- plus_n_O : base1.
+Goal forall y, exists x, y+x = y.
+eexists. autorewrite with base1.
+Fail reflexivity.
+