(* A variant of Burali-Forti that used to pass in V8.1beta, because of a bug in the instantiation of sort-polymorphic inductive types *)
(* The following type seems to satisfy the hypothesis of the paradox below *)
(* It should infer constraints forbidding the paradox to go through, but via *)
(* a redefinition that did not propagate constraints correctly in V8.1beta *)
(* it was exploitable to derive an inconsistency *)
(* We keep the file as a non regression test of the bug *)
Record A1 (B:Type) (g:B->Type) : Type :=  (* Type_i' *)
i1 {X0 : B; R0 : g X0 -> g X0 -> Prop}. (* X0: Type_j' *)
Definition A2 := A1. (* here was the bug *)
Definition A0 := (A2 Type (fun x => x)).
Definition i0 := (i1 Type (fun x => x)).
(* The rest is as in universes-buraliforti.v *)
(* Some properties about relations on objects in Type *)
Inductive ACC (A : Type) (R : A -> A -> Prop) : A -> Prop :=
ACC_intro :
forall x : A, (forall y : A, R y x -> ACC A R y) -> ACC A R x.

Lemma ACC_nonreflexive :
forall (A : Type) (R : A -> A -> Prop) (x : A),
ACC A R x -> R x x -> False.