aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite
diff options
context:
space:
mode:
authorGravatar Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>2017-09-15 23:39:11 +0200
committerGravatar Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>2017-11-24 19:18:56 +0100
commit4eb6d29d1ca7e0cc28d59d19a50adb83f7b30a2a (patch)
treee15ec2ec5e4a3b83d0a237e4eee06444c51cc76a /test-suite
parente414c07e193db7d4256c09167f6efd545831fa2b (diff)
Fix defining non primitive projections with abstracted universes.
I think this only affects printing (in the new test you would get [Var (0)] when printing runwrap) but is still ugly.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/output/UnivBinders.out51
-rw-r--r--test-suite/output/UnivBinders.v26
2 files changed, 71 insertions, 6 deletions
diff --git a/test-suite/output/UnivBinders.out b/test-suite/output/UnivBinders.out
index 904ff68aa..1bacb7513 100644
--- a/test-suite/output/UnivBinders.out
+++ b/test-suite/output/UnivBinders.out
@@ -1,12 +1,55 @@
+NonCumulative Inductive Empty@{u} : Type@{u} :=
+NonCumulative Record PWrap (A : Type@{u}) : Type@{u} := pwrap { punwrap : A }
+
+PWrap has primitive projections with eta conversion.
+For PWrap: Argument scope is [type_scope]
+For pwrap: Argument scopes are [type_scope _]
+punwrap@{u} =
+fun (A : Type@{u}) (p : PWrap@{u} A) => punwrap _ p
+ : forall A : Type@{u}, PWrap@{u} A -> A
+(* u |= *)
+
+punwrap is universe polymorphic
+Argument scopes are [type_scope _]
+NonCumulative Record RWrap (A : Type@{u}) : Type@{u} := rwrap { runwrap : A }
+
+For RWrap: Argument scope is [type_scope]
+For rwrap: Argument scopes are [type_scope _]
+runwrap@{u} =
+fun (A : Type@{u}) (r : RWrap@{u} A) => let (runwrap) := r in runwrap
+ : forall A : Type@{u}, RWrap@{u} A -> A
+(* u |= *)
+
+runwrap is universe polymorphic
+Argument scopes are [type_scope _]
+Wrap@{u} = fun A : Type@{u} => A
+ : Type@{u} -> Type@{u}
+(* u |= *)
+
+Wrap is universe polymorphic
+Argument scope is [type_scope]
+wrap@{u} =
+fun (A : Type@{u}) (Wrap : Wrap@{u} A) => Wrap
+ : forall A : Type@{u}, Wrap@{u} A -> A
+(* u |= *)
+
+wrap is universe polymorphic
+Arguments A, Wrap are implicit and maximally inserted
+Argument scopes are [type_scope _]
bar@{u} = nat
: Wrap@{u} Set
(* u |= Set < u
*)
bar is universe polymorphic
-foo@{u Top.8 v} =
-Type@{Top.8} -> Type@{v} -> Type@{u}
- : Type@{max(u+1, Top.8+1, v+1)}
-(* u Top.8 v |= *)
+foo@{u Top.17 v} =
+Type@{Top.17} -> Type@{v} -> Type@{u}
+ : Type@{max(u+1, Top.17+1, v+1)}
+(* u Top.17 v |= *)
foo is universe polymorphic
+Monomorphic mono = Type@{u}
+ : Type@{u+1}
+(* u |= *)
+
+mono is not universe polymorphic
diff --git a/test-suite/output/UnivBinders.v b/test-suite/output/UnivBinders.v
index 8656ff1a3..2c378e795 100644
--- a/test-suite/output/UnivBinders.v
+++ b/test-suite/output/UnivBinders.v
@@ -2,12 +2,34 @@ Set Universe Polymorphism.
Set Printing Universes.
Unset Strict Universe Declaration.
-Class Wrap A := wrap : A.
+(* universe binders on inductive types and record projections *)
+Inductive Empty@{u} : Type@{u} := .
+Print Empty.
-Instance bar@{u} : Wrap@{u} Set. Proof nat.
+Set Primitive Projections.
+Record PWrap@{u} (A:Type@{u}) := pwrap { punwrap : A }.
+Print PWrap.
+Print punwrap.
+
+Unset Primitive Projections.
+Record RWrap@{u} (A:Type@{u}) := rwrap { runwrap : A }.
+Print RWrap.
+Print runwrap.
+
+(* universe binders also go on the constants for operational typeclasses. *)
+Class Wrap@{u} (A:Type@{u}) := wrap : A.
+Print Wrap.
+Print wrap.
+
+(* Instance in lemma mode used to ignore the binders. *)
+Instance bar@{u} : Wrap@{u} Set. Proof. exact nat. Qed.
Print bar.
(* The universes in the binder come first, then the extra universes in
order of appearance. *)
Definition foo@{u +} := Type -> Type@{v} -> Type@{u}.
Print foo.
+
+(* Binders even work with monomorphic definitions! *)
+Monomorphic Definition mono@{u} := Type@{u}.
+Print mono.