| 1 |
(* Test that fresh avoid the variables of intro patterns but also of |
| 2 |
simple intro patterns *) |
| 3 |
|
| 4 |
Ltac exploit_main t T pat cleanup |
| 5 |
:= |
| 6 |
(lazymatch T with |
| 7 |
| ?U1 -> ?U2 => |
| 8 |
let H := fresh |
| 9 |
in |
| 10 |
idtac "H=" H; |
| 11 |
assert U1 as H; |
| 12 |
[cleanup () | exploit_main (t H) U2 pat ltac:(fun _ => clear H; cleanup ())] |
| 13 |
| _ => |
| 14 |
pose proof t as pat; |
| 15 |
cleanup () |
| 16 |
end). |
| 17 |
|
| 18 |
Tactic Notation "exploit" constr(t) "as" simple_intropattern(pat) |
| 19 |
:= |
| 20 |
exploit_main t ltac:(type of t) pat ltac:(fun _ => idtac). |
| 21 |
|
| 22 |
Goal (True -> True) -> True. |
| 23 |
intro H0. exploit H0 as H. |
| 24 |
Abort. |
| 25 |
|
| 26 |
Tactic Notation "exploit'" constr(t) "as" intropattern(pat) |
| 27 |
:= |
| 28 |
exploit_main t ltac:(type of t) pat ltac:(fun _ => idtac). |
| 29 |
|
| 30 |
Goal (True -> True) -> True. |
| 31 |
intro H0. exploit' H0 as H. |
| 32 |
Abort. |