| 1 |
Set Universe Polymorphism. |
| 2 |
Inductive sum@{s;u v|} (A : Type@{s;u}) (B : Type@{s;v}) : Type@{s;max(u,v)} := |
| 3 |
| inl : A -> sum A B |
| 4 |
| inr : B -> sum A B. |
| 5 |
Arguments inl {A B}. |
| 6 |
Arguments inr {A B}. |
| 7 |
|
| 8 |
Fail Check (fun p : sum@{Prop;_ _} True False => match p return Set with inl a => unit | inr b => bool end). |
| 9 |
(* |
| 10 |
Error: The quality constraints are inconsistent: cannot enforce Prop -> Type because it would identify Type and Prop which is inconsistent. |
| 11 |
This is introduced by the constraints Prop -> Type |
| 12 |
*) |
| 13 |
|
| 14 |
|
| 15 |
Inductive sBox@{s s';u|} (A:Type@{s;u}) : Type@{s';u} := sbox (_:A). |
| 16 |
|
| 17 |
Fail Definition elim@{s s';u|} (A:Type@{s;u}) (x:sBox@{s s';u} A) : A := |
| 18 |
match x with sbox _ v => v end. |
| 19 |
(* Error: Elimination constraints are not implied by the ones declared: s' -> s *) |
| 20 |
|
| 21 |
Inductive sP : SProp := sC. |
| 22 |
|
| 23 |
Fail Check match sC with sC => I end. |
| 24 |
(* |
| 25 |
Error: The quality constraints are inconsistent: cannot enforce SProp -> Prop because it would identify Prop and SProp which is inconsistent. |
| 26 |
This is introduced by the constraints SProp -> Prop |
| 27 |
*) |