1
(* Non regression for bug #1302 *)
3
(* With universe polymorphism for inductive types, subtyping of
4
inductive types needs a special treatment: the standard conversion
5
algorithm does not work as it only knows to deal with constraints of
6
the form alpha = beta or max(alphas, alphas+1) <= beta, while
7
subtyping of inductive types in Type generates constraints of the form
8
max(alphas, alphas+1) <= max(betas, betas+1).
10
These constraints are anyway valid by monotonicity of subtyping but we
11
have to detect it early enough to avoid breaking the standard
12
algorithm for constraints on algebraic universes. *)
16
Parameter A : Type (* Top.1 *) .
18
Inductive L : Type (* max(Top.1,1) *) :=
20
| L1 : (A -> Prop) -> L.
24
Axiom Tp : Type (* Top.5 *) .
28
Definition A : Type (* Top.6 *) := Tp. (* generates Top.5 <= Top.6 *)
30
Inductive L : Type (* max(Top.6,1) *) :=
32
| L1 : (A -> Prop) -> L.
34
End TT. (* Generates Top.6 <= Top.1 (+ auxiliary constraints for L_rect) *)
36
(* Note: Top.6 <= Top.1 is generated by subtyping on A;
37
subtyping of L follows and has not to be checked *)
41
(* The same bug as #1302 but for Definition *)
42
(* Check that inferred algebraic universes in interfaces are considered *)
44
Module Type U. Definition A := Type -> Type. End U.
45
Module M:U. Definition A := Type -> Type. End M.