coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jan-Oliver Kaiser <janno AT mpi-sws.org>
- To: coq-club AT inria.fr, Guillaume Melquiond <guillaume.melquiond AT inria.fr>
- Subject: Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat
- Date: Wed, 6 Sep 2017 09:33:24 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=janno AT mpi-sws.org; spf=Pass smtp.mailfrom=janno AT mpi-sws.org; spf=None smtp.helo=postmaster AT jupiter.mpi-klsb.mpg.de
- Ironport-phdr: 9a23:wXlcbxSB+Y+a4jl8UOrxCkh3gtpsv+yvbD5Q0YIujvd0So/mwa64ZxaN2/xhgRfzUJnB7Loc0qyN7PCmBDRIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnY6Uy/yPgttJ+nzBpWaz4Huj7jzqNXvZFBDgyP4ardvJj23qx/Qv48Ym88qBbswzh/Av35FM8FbwXp1JFWVk16o6dqx+Jpq7iFd/fcs89ddUKL8c4w5S6ZZBXIoKTZmytfssEzhRA3KwX8dTGgM2jlBAhPI9lmuXJ73tCzSs/J8nTKFJovxV79iCmfq1LtiVBK90HRPDDU+6myCz5Uo1K8=
It does seem to be related to nil but also to the return type of the match. Below are some tests. N (n) stands for explicit (implicit) nil argument. M (m) stands for explicit (implicit) return type. Only the fully implicit version seems to introduce the new universe which does not appear anywhere in the term. Is this related to matches using functions internally?
Janno
From Coq Require List.
Set Printing Universes.
Set Printing All.
Definition tl_NM (A : Type) (l : list A) :=
match l return list A with
| nil => @nil A
| cons _ m => m
end.
Print tl_NM.
Definition tl_Nm (A : Type) (l : list A) :=
match l with
| nil => @nil A
| cons _ m => m
end.
Print tl_Nm.
Definition tl_nM (A : Type) (l : list A) :=
match l return list A with
| nil => @nil _
| cons _ m => m
end.
Print tl_nM.
Definition tl_nm (A : Type) (l : list A) :=
match l with
| nil => @nil _
| cons _ m => m
end.
Print tl_nm.
On 09/06/2017 07:49 AM, Guillaume Melquiond wrote:
On 06/09/2017 01:14, Jan-Oliver Kaiser wrote:
Hey everyone,
List.tl and List.repeat are outliers in the List module as they
introduce new universes which upper-bound list's own universe variable
in the global graph. Why is that?
Good catch. They are created because of the implicit argument of nil,
which is of type Type. I have no idea whether this deficiency of Coq is
easily fixed, but we can at least remove these superfluous universes by
explicit setting the argument of nil in the definitions of tl and repeat.
Best regards,
Guillaume
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, (continued)
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Guillaume Melquiond, 09/06/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Jacques-Henri Jourdan, 09/06/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Matthieu Sozeau, 09/06/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Jacques-Henri Jourdan, 09/06/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Guillaume Melquiond, 09/06/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Jacques-Henri Jourdan, 09/06/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Jan-Oliver Kaiser, 09/11/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Matthieu Sozeau, 09/12/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Jacques-Henri Jourdan, 09/13/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Ralf Jung, 09/14/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Jacques-Henri Jourdan, 09/06/2017
- Re: [Coq-Club] Mysterious Universes introduced by List.tl and List.repeat, Guillaume Melquiond, 09/06/2017
Archive powered by MHonArc 2.6.18.