| 1 |
Require Import Ltac2.Ltac2. |
| 2 |
|
| 3 |
Ltac2 check () := |
| 4 |
let t := Control.goal () in |
| 5 |
match Constr.Unsafe.kind t with |
| 6 |
| Constr.Unsafe.Prod b t => |
| 7 |
let na := Constr.Binder.name b in |
| 8 |
let u := Constr.Binder.type b in |
| 9 |
let b := Constr.Binder.make na u in |
| 10 |
let c := Constr.Unsafe.make (Constr.Unsafe.Prod b t) in |
| 11 |
pose (v := $c); |
| 12 |
refine '(_ : &v); |
| 13 |
unfold &v |
| 14 |
| _ => fail |
| 15 |
end. |
| 16 |
|
| 17 |
Goal forall x : nat, x = x. |
| 18 |
Proof. |
| 19 |
check (); intros; reflexivity. |
| 20 |
Qed. |
| 21 |
|
| 22 |
Goal forall x : Type, x = x. |
| 23 |
Proof. |
| 24 |
check (); intros; reflexivity. |
| 25 |
Qed. |
| 26 |
|
| 27 |
Goal forall x : Set, x = x. |
| 28 |
Proof. |
| 29 |
check (); intros; reflexivity. |
| 30 |
Qed. |
| 31 |
|
| 32 |
Inductive True : SProp := I. |
| 33 |
|
| 34 |
Goal forall x : True, True. |
| 35 |
Proof. |
| 36 |
check (); intros; constructor. |
| 37 |
Qed. |