Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Debugging Universe Inconsistencies

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Debugging Universe Inconsistencies


Chronological Thread 
  • From: Christian Doczkal <christian.doczkal AT ens-lyon.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Debugging Universe Inconsistencies
  • Date: Thu, 6 Sep 2018 13:01:15 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=christian.doczkal AT ens-lyon.fr; spf=Neutral smtp.mailfrom=christian.doczkal AT ens-lyon.fr; spf=None smtp.helo=postmaster AT labbe.ens-lyon.fr
  • Ironport-phdr: 9a23:7H7tDhBr1Qdm04xy1NpGUyQJP3N1i/DPJgcQr6AfoPdwSPv8osbcNUDSrc9gkEXOFd2Cra4c1KyO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUhjexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJKiA38G/XhMJzgqxUrh2uqB5jzIDbe4yVKPlzc7nBcd8GS2dMXMBcXDFBDIOmaIsPCvIMMPhYr4nnplsOtge+BQi2C+Pp1zRGiHj20rE70uQiCw7G2BErEtUSv3TUttX1NbwSUfy0zKbSyzXPde5Z2TDh54nJcRAuu/WMUKlufsrX0kkjDgfFj1WXqYzjJT+V2P4NvnGd4uF9Vuyvk3Yqpxx+rzSz3MshiIvEipgIxl3F9yh12pg5KcOmREJjfNKpH4dcuzuYOoZ0WM8uXm9ltDw+x7AIv5OwYTIEx449xxHFbvyKa4iI7QznVOaWOTp4gGhqd6mkiBms60Sv1Ov8VtKt3FZOritFld/MumoD1xzJ8sSHS/198Vm92TuXygze5f1ILVo2mKfZMZIt3789m5gJvUjdACP6hl36jKqMeUUl/uio5f7nYrLjppKEK4B0ihv+MqU1msyjAOQ3KA4OU3KG9uS7yLLi/E75T69OjvAtjKbZtovaKd0fpq+5BA9V1Jwv6xilDzu+ytQXgWEHLE5ZeBKAl4XmJ1bOIOnhAfijh1SsjSxkyuvdPrzhB5XNNmLMnK3gfbZ78U5cyRA8wcpR55JOWfk9J6f4XVa0v9jFBDc4NRa1yqDpEoZTzIQbDEmPGK6CLKLbtxek4ek9IOCILNseuCz8MOQk7viogXgyi1wUeYGk24BSbGG/GLJoORPKMjLXnt4dHDJS7UIFR+vwhQjaCG8BVzOJR6s5owoDJsejBIbHSJqqheXajiq9BdhSd2dATF6WQy2xK9e0HswUYSfXGfdP1yQeXOH6GYInzlSqpQj8jbR9fLKNp38o8Kn73d0w3NX90BE/8TstXpaZ2muHQid5mHhNQy4x2uZxux4lxw==

Hello,

I already had used "Set Printing Universes". As far as I can tell, the
only thing "Set Printing Universes" does is cause "Print/Check term." to
print the universe levels of all occurrences of "Type" occurring in a
particular definition as well as the constraints enforced by a
particular definition.

I have a constraint system with thousands of constraints arising from
hundreds of definitions and I would like to know which constraints
contribute to the inconsistency and which definitions/lemmas give rise
to a given constraint.

For instance, Print Universes might mention
"Coq.Relations.Relation_Definitions.1" which I could correctly guess is
the first argument of "relation":

relation =
fun A : Type@{Coq.Relations.Relation_Definitions.1} => A -> A -> Prop
: Type@{Coq.Relations.Relation_Definitions.1} ->
Type@{max(Coq.Relations.Relation_Definitions.1,Set+1)}

But its not always that easy to guess the definitions introducing a
particular universe index and even harder to guess which definition or
lemma enforces a given constraint.

Best,
Christian


On 05/09/18 20:42, Gaëtan Gilbert wrote:
> 1) yes
>
> 2) and 3)
> if you enable printing of universes (Set Printing Universes. in
> coqtop/proof general/etc, some GUI toggle in coqide) universe
> inconsistencies should print that information
>
> Gaëtan Gilbert
>
> On 05/09/2018 17:57, Christian Doczkal wrote:
>> Hello everyone,
>>
>> We have a large development where we have generic structures and some
>> concrete instances for them. One of these is for relations (X -> Y ->
>> Prop) with (X,Y : Set).
>>
>> Now I was trying to generalize this to all instances with (X,Y : Type).
>> This leads to a universe inconsistency thousands of lines down the road.
>> I would hope that this is merely a problem of making certain things
>> universe polymorphic, but I don't manage to come up with a minimal
>> example reproducing the problem.
>>
>> At first, I only got the rather uninformative "Universe Inconsistency"
>> error when trying to load two separately compiled parts of the library.
>>
>> With some trial and error I got to the point where I have statement that
>> type checks before the generalized instances are imported and fails to
>> type check afterwards. This gives me an Error of the form:
>>
>> "... cannot ensure that "Type@{foo.2}" is a subtype of Type@{bar.3}"
>>
>> I can use "Print Universes" before and after the Import, but that yields
>> thousands of constraints and even the diff is not too enlightening.
>>
>> If I understand the universe mechanism and the error message correctly,
>> this actually means that assuming "foo.2 <= bar.3" is inconsistent with
>> the current collection of universe constraints. So here are some
>> questions:
>>
>> 1) Is my understanding correct?
>>
>> 2) If yes, is there a way to obtain a minimal (or at least sufficiently
>> small) subset of the current collection of constraints, proving that
>> "foo.2 <= bar.3" cannot be consistently added.
>>
>> 3) What other things can I do to shed some light onto what is happening?
>>
>> Any help would be appreciated.
>>
>> Best,
>> Christian
>>



Archive powered by MHonArc 2.6.18.

Top of Page