| 1 |
(* Test various subtleties of the "subst" tactics *) |
| 2 |
|
| 3 |
(* Should proceed from left to right (see #4222) *) |
| 4 |
Goal forall x y, x = y -> x = 3 -> y = 2 -> x = y. |
| 5 |
intros. |
| 6 |
subst. |
| 7 |
change (3 = 2) in H1. |
| 8 |
change (3 = 3). |
| 9 |
Abort. |
| 10 |
|
| 11 |
(* Should work with "x = y" and "x = t" equations (see #4214, failed in 8.4) *) |
| 12 |
Goal forall x y, x = y -> x = 3 -> x = y. |
| 13 |
intros. |
| 14 |
subst. |
| 15 |
change (3 = 3). |
| 16 |
Abort. |
| 17 |
|
| 18 |
(* Should substitute cycles once, until a recursive equation is obtained *) |
| 19 |
(* (failed in 8.4) *) |
| 20 |
Goal forall x y, x = S y -> y = S x -> x = y. |
| 21 |
intros. |
| 22 |
subst. |
| 23 |
change (y = S (S y)) in H0. |
| 24 |
change (S y = y). |
| 25 |
Abort. |
| 26 |
|
| 27 |
(* A bug revealed by OCaml 4.03 warnings *) |
| 28 |
(* fixes in 4e3d464 and 89ec88f for v8.5, 4e3d4646 and 89ec88f1e for v8.6 *) |
| 29 |
Goal forall y, let x:=0 in y=x -> y=y. |
| 30 |
intros * H; |
| 31 |
(* This worked as expected *) |
| 32 |
subst. |
| 33 |
Fail clear H. |
| 34 |
Abort. |
| 35 |
|
| 36 |
Goal forall y, let x:=0 in x=y -> y=y. |
| 37 |
intros * H; |
| 38 |
(* Before the fix, this unfolded x instead of |
| 39 |
substituting y and erasing H *) |
| 40 |
subst. |
| 41 |
Fail clear H. |
| 42 |
Abort. |