| 1 |
Parameter Ack : nat -> nat -> nat. |
| 2 |
|
| 3 |
Axiom Ack0 : forall m : nat, Ack 0 m = S m. |
| 4 |
Axiom Ack1 : forall n : nat, Ack (S n) 0 = Ack n 1. |
| 5 |
Axiom Ack2 : forall n m : nat, Ack (S n) (S m) = Ack n (Ack (S n) m). |
| 6 |
|
| 7 |
Module M. |
| 8 |
#[export] Hint Rewrite Ack0 Ack1 Ack2 : base0. |
| 9 |
|
| 10 |
Lemma ResAck0 : (Ack 2 2 = 7 -> False) -> False. |
| 11 |
Proof. |
| 12 |
intros. |
| 13 |
autorewrite with base0 in H using try (apply H; reflexivity). |
| 14 |
Qed. |
| 15 |
End M. |
| 16 |
|
| 17 |
Lemma ResAck1 : forall H:(Ack 2 2 = 7 -> False), True -> False. |
| 18 |
Proof. |
| 19 |
intros. |
| 20 |
Fail autorewrite with base0 in *. |
| 21 |
Abort. |
| 22 |
|
| 23 |
Import M. |
| 24 |
|
| 25 |
Lemma ResAck1 : forall H:(Ack 2 2 = 7 -> False), True -> False. |
| 26 |
Proof. |
| 27 |
intros. |
| 28 |
autorewrite with base0 in *. |
| 29 |
apply H;reflexivity. |
| 30 |
Qed. |
| 31 |
|
| 32 |
(* Check autorewrite does not solve existing evars *) |
| 33 |
(* See discussion started by A. Chargueraud in Oct 2010 on coqdev *) |
| 34 |
|
| 35 |
Global Hint Rewrite <- plus_n_O : base1. |
| 36 |
Goal forall y, exists x, y+x = y. |
| 37 |
eexists. autorewrite with base1. |
| 38 |
Fail reflexivity. |
| 39 |
|
| 40 |
Abort. |