coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Matthieu Sozeau <mattam AT mattam.org>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] list :: nil?
- Date: Sat, 22 Oct 2016 07:57:13 +0000
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=mattam AT mattam.org; spf=Pass smtp.mailfrom=matthieu.sozeau AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f43.google.com
- Ironport-phdr: 9a23:YxBiKh3v+OOxn3pysmDT+DRfVm0co7zxezQtwd8ZsegQKfad9pjvdHbS+e9qxAeQG96KsbQa0qGH6ejJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL2PbrnD61zMOABK3bVMzfbWvXNCLxJXtn8mJuLTrKz1SgzS8Zb4gZD6Xli728vcsvI15N6wqwQHIqHYbM85fxGdvOE7B102kvpT41NdZ/i9Ro/Ms8dJbGeW/JvxgDO8QMDNzGGcsrObvqBOLGQCI/z4XVngcuhtOGQnMqh/gCMTfqCz/4890xDWaPMDrBYszSzmr8u8/TRb0lC4CHzsw7H3ej4p3lq0N80HpnAB234OBONLdD/F5ZK6IOIpCHWc=
Indeed, in the template case partial applications do not give you a fresh instance (because there's no way to know what the fresh levels are in that case, when retyping) , but an eta-expanded version will work I think, e.g fun X => list X, as then we can look at the type of X to determine the type of list X.
On Sat, 22 Oct 2016 at 06:56, Jason Gross <jasongross9 AT gmail.com> wrote:
Template universes are "refreshed" every time you use a fully instantiated version of the inductive, together with a constraint that the new universes are not larger than the original ones, I believe. So you should be able to write [(list Type) :: nil] but not [list :: nil].
Tangentially, note that template polymorphic universes can be instantiated with [Prop], but universe polymorphic universes can not be so instantiated.
On Fri, Oct 21, 2016, 9:17 PM Gregory Malecha <gmalecha AT gmail.com> wrote: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.