| 1 |
Axiom foo : forall A:Type, A -> Type. |
| 2 |
|
| 3 |
(* this test is about checking when Type in a notation is considered |
| 4 |
to match a term *) |
| 5 |
Notation "! x" := (foo Type x) (at level 2). |
| 6 |
|
| 7 |
(* first with Printing Universes off *) |
| 8 |
|
| 9 |
(* terms produced using the notation print using the notation *) |
| 10 |
Check ! nat. |
| 11 |
|
| 12 |
(* Set does not match Type *) |
| 13 |
Check foo Set nat. |
| 14 |
|
| 15 |
Sort s. |
| 16 |
Axiom S : Type@{s;Set}. |
| 17 |
|
| 18 |
(* rigid sorts (here global sort) should not match Type but currently do *) |
| 19 |
Check foo _ S. |
| 20 |
Fail Check ! S. |
| 21 |
|
| 22 |
Goal True. |
| 23 |
(* sort unification variable matches Type (and is printed as Type in the [forall] annotation) *) |
| 24 |
(* NB don't use Check here as it collapses before printing (maybe this will change someday?) *) |
| 25 |
assert (forall A, A -> foo _ A). 2:trivial. |
| 26 |
Show. |
| 27 |
Abort. |
| 28 |
|
| 29 |
(* now with Printing Universes on *) |
| 30 |
Set Printing Universes. |
| 31 |
|
| 32 |
(* Printing Universes makes universes not match Type *) |
| 33 |
Check ! nat. |
| 34 |
|
| 35 |
(* global sort still doesn't match Type *) |
| 36 |
Check foo _ S. |
| 37 |
|
| 38 |
Goal True. |
| 39 |
(* sort unif variable doesn't match Type *) |
| 40 |
assert (forall A, A -> foo _ A). 2:trivial. |
| 41 |
Show. |
| 42 |
Abort. |