Debian Codegraph @

test-suite/bugs/bug_5197.v

raw
1 Set Universe Polymorphism.
2 Set Primitive Projections.
3
4 Axiom Ω : Type.
5
6 Record Pack (A : Ω -> Type) (Aᴿ : Ω -> (forall ω : Ω, A ω) -> Type) := mkPack {
7 elt : forall ω, A ω;
8 prp : forall ω, Aᴿ ω elt;
9 }.
10
11 Record TYPE := mkTYPE {
12 wit : Ω -> Type;
13 rel : Ω -> (forall ω : Ω, wit ω) -> Type;
14 }.
15
16 Definition El (A : TYPE) : Type := Pack A.(wit) A.(rel).
17
18 Definition Typeᶠ : TYPE := {|
19 wit := fun _ => Type;
20 rel := fun _ A => (forall ω : Ω, A ω) -> Type;
21 |}.
22 Set Printing Universes.
23 Definition Typeᵇ : El Typeᶠ :=
24 mkPack _ _ (fun w => Type) (fun w A => (forall ω, A ω) -> Type).
25
26 (* Definition Typeᵇ : El Typeᶠ := *)
27 (* mkPack _ (fun _ (A : Ω -> Type) => (forall ω : Ω, A ω) -> _) (fun w => Type) (fun w A => (forall ω, A ω) -> Type). *)
28
29 (** Bidirectional typechecking helps here *)
30 Require Import Program.Tactics.
31 Program Definition progTypeᵇ : El Typeᶠ :=
32 mkPack _ _ (fun w => Type) (fun w A => (forall ω, A ω) -> Type).
33
34 (**
35 The command has indeed failed with message:
36 Error: Conversion test raised an anomaly
37 **)
38
39 Definition Typeᵇ' : El Typeᶠ.
40 Proof.
41 unshelve refine (mkPack _ _ _ _).
42 + refine (fun _ => Type).
43 + simpl. refine (fun _ A => (forall ω, A ω) -> Type).
44 Defined.