| 1 |
Require Import Corelib.Program.Tactics. |
| 2 |
|
| 3 |
(** We make a version of [rapply] that takes [uconstr]; we do not |
| 4 |
currently test what scope [rapply] interprets terms in. *) |
| 5 |
|
| 6 |
Tactic Notation "urapply" uconstr(p) := rapply p. |
| 7 |
|
| 8 |
Ltac test n := |
| 9 |
(*let __ := match goal with _ => idtac n end in*) |
| 10 |
lazymatch n with |
| 11 |
| O => let __ := match goal with _ => assert True by urapply I; clear end in |
| 12 |
uconstr:(fun _ => I) |
| 13 |
| S ?n' |
| 14 |
=> let lem := test n' in |
| 15 |
let __ := match goal with _ => assert True by (unshelve urapply lem; try exact I); clear end in |
| 16 |
uconstr:(fun _ : True => lem) |
| 17 |
end. |
| 18 |
|
| 19 |
Goal True. |
| 20 |
assert True by urapply I. |
| 21 |
assert True by (unshelve urapply (fun _ => I); try exact I). |
| 22 |
assert True by (unshelve urapply (fun _ _ => I); try exact I). |
| 23 |
assert True by (unshelve urapply (fun _ _ _ => I); try exact I). |
| 24 |
clear. |
| 25 |
Time let __ := test 50 in idtac. |
| 26 |
urapply I. |
| 27 |
Qed. |