coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Gregory Malecha <gmalecha AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: [Coq-Club] list :: nil?
- Date: Sat, 22 Oct 2016 01:16:48 +0000
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gmalecha AT gmail.com; spf=Pass smtp.mailfrom=gmalecha AT gmail.com; spf=None smtp.helo=postmaster AT mail-ua0-f171.google.com
- Ironport-phdr: 9a23:1Hzy8BOmOBRxjQ1COl8l6mtUPXoX/o7sNwtQ0KIMzox0KPz+rarrMEGX3/hxlliBBdydsKMezbSP+PywESxYuNDa7yBEKMQNHzY+yuwo3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEtfre9Msfogs+2z+G//YHIK0UN3WLlIOA6EBLjhgLI/uISnIEqfq02017CpmZCU+VQ32JhY1yJyUXS/MC1qbF5/itXoeNp0sdEXK76duxsQrlRCDktM2kd68jitB2FRgyKsChPGl4KmwZFVlCWpCrxWY38526j7rJw
Hello --
I've been tracking down universe issues the last few days and I keep running into issues surrounding standard library code that is not universe polymorphic but template universe polymorphic. My naive understanding of template universe polymorphism is that the type is "refreshed" every time that it is used. It is kind of like universe polymorphism, but not quite. This is what lets you have [list nat] and [list { x : nat & ... }]. Given this understanding, it seems not inconceivable that you could write the term `list :: nil` by setting up the universes appropriately. However, this seems impossible to write in Coq. Is there a description of template universe polymorphism somewhere that I could read?
Thanks.
Set Printing Universes.
Universe A.
Definition x : list (Type@{A} -> Type@{A}).
refine (cons (@list) nil). (** fails **)
Abort.
With polymorphic lists (a.la. ExtLib) everything works out well.
Polymorphic Inductive plist@{A} (T : Type@{A}) : Type@{A} :=
| pnil
| pcons (_ : T) (_ : plist T).
Definition x : plist (Type@{A} -> Type@{A}).
refine (@pcons (Type@{A} -> Type@{A}) (@plist@{A}) (@pnil _)).
Defined.
--
- gregory malecha
gmalecha.github.io
- [Coq-Club] list :: nil?, Gregory Malecha, 10/22/2016
- Re: [Coq-Club] list :: nil?, Jason Gross, 10/22/2016
- Re: [Coq-Club] list :: nil?, Matthieu Sozeau, 10/22/2016
- <Possible follow-up(s)>
- Re: [Coq-Club] list :: nil?, Ben Sherman, 10/26/2016
- Re: [Coq-Club] list :: nil?, Jason Gross, 10/22/2016
Archive powered by MHonArc 2.6.18.