| 1 |
Require Import Ltac2.Ltac2. |
| 2 |
|
| 3 |
Ltac2 Eval preterm:(notbound). |
| 4 |
|
| 5 |
Ltac2 Notation "pretermize" t(preterm) := t. |
| 6 |
|
| 7 |
Ltac2 Eval pretermize notbound. |
| 8 |
|
| 9 |
(* this check is intern time *) |
| 10 |
Fail Ltac2 Eval pretermize (fun x y : x => x). |
| 11 |
|
| 12 |
Ltac2 Eval Constr.pretype preterm:(nat). |
| 13 |
|
| 14 |
Fail Ltac2 Eval Constr.pretype preterm:(notbound). |
| 15 |
Fail Ltac2 Eval Constr.pretype preterm:(nat = 0). |
| 16 |
|
| 17 |
(* strict check *) |
| 18 |
Fail Ltac2 baz () := preterm:(notbound). |
| 19 |
|
| 20 |
(* variable capture *) |
| 21 |
Ltac2 Eval |
| 22 |
let x := preterm:(n = n) in |
| 23 |
constr:(forall n:nat, ltac2:(Control.refine (fun () => Constr.pretype x))). |
| 24 |
|
| 25 |
Ltac2 Notation "mypreterm:(" x(lpreterm) ")" := x. |
| 26 |
|
| 27 |
Ltac2 Eval mypreterm:(0 = 0). |