Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on empty constraints @{|} with universe checking off #17355

Closed
drcicero opened this issue Mar 8, 2023 · 0 comments · Fixed by #17357
Closed

Error on empty constraints @{|} with universe checking off #17355

drcicero opened this issue Mar 8, 2023 · 0 comments · Fixed by #17357
Milestone

Comments

@drcicero
Copy link

drcicero commented Mar 8, 2023

Description of the problem

I was hoping to use unset universe checking to disable universes, and temporarily work in Type:Type bliss. However, occasionally my code still fails on a universe constraint even though I have disabled universe checking. I tried to minimize the problem and came up with the idea to define an identity universe cast function. And indeed it does not work; the error message “Universe constraints are not implied by the ones declared” comes up independent of whether universe checking is set or not:

Set Universe Checking.
Fail Definition castU@{u v |}(t: Type@{u}): Type@{v} := t.
(* The command has indeed failed with message:
Universe constraints are not implied by the ones declared: u <= v *)

Unset Universe Checking.
Fail Definition castU@{u v |}(t: Type@{u}): Type@{v} := t.
(* The command has indeed failed with message:
Universe constraints are not implied by the ones declared: u <= v *)

Furthermore, if I leave all universes to be inferred, and unset universe checking Coq will nevertheless generate universe constraints, e.g., u <= u0:

Set Universe Checking.
Set Universe Polymorphism.
Definition castU(t: Type): Type := t.
Set Printing Universes.
Print castU.
(* castU@{u u0} = fun t : Type@{u} => t
        : Type@{u} -> Type@{u0}
   (* u u0 |= u <= u0 *)
*)

I asked this on discourse first https://coq.discourse.group/t/is-it-possible-to-define-a-cbn-able-universe-cast-with-universe-checking-disabled/1899/1 and SkySkimmer encouraged me that this could be considered a bug.

Coq Version

The Coq Proof Assistant, version 8.16.1
compiled with OCaml 4.13.1

SkySkimmer added a commit to SkySkimmer/coq that referenced this issue Mar 8, 2023
Fix coq#17355

We also refactor the checking of universe declarations in ustate so
that when given non extensible constraints we return them instead of
returning the inferred constraints.
SkySkimmer added a commit to SkySkimmer/coq that referenced this issue Mar 8, 2023
Fix coq#17355

We also refactor the checking of universe declarations in ustate so
that when given non extensible constraints we return them instead of
returning the inferred constraints.
@coqbot-app coqbot-app bot added this to the 8.18+rc1 milestone Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant