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

Unspecified universe levels (_) trigger a syntax error in Type with sort variables #18978

Closed
kyoDralliam opened this issue Apr 26, 2024 · 2 comments · Fixed by #18981
Closed
Labels
kind: wish Feature or enhancement requests.
Milestone

Comments

@kyoDralliam
Copy link
Contributor

Description of the problem

Not being explicit with universe levels in Type@{s| .. }, e.g. using _ instead of a universe level variable, triggers a syntax error. This is both a usability issue (more annoying to use) and an incompleteness issue because it can be simulated with an auxilliary definition.

Small Coq file to reproduce the bug

Set Universe Polymorphism.
Set Printing Universes.

(* Fully explicit definition: we would like to spare the annotation u *)
Definition id@{s|u|} (A : Type@{s|u}) (a : A) : A := a.


(* Some kind of typical ambiguity can be simulated by rebinding Type to an auxilliary definition T*)
Definition T@{s|u|} := Type@{s|u}.
Definition idT@{s|+|} (A : T@{s|_}) (a : A) : A := a.

(* The actual problem *)
Definition id0@{s|+|} (A : Type@{s|_}) (a : A) : A := a.
(*
Error:
Syntax error: [universe] expected after '|' (in [sort]).
 *)

Version of Coq where this bug occurs

8.19.0

Last version of Coq where the bug did not occur

No response

@kyoDralliam kyoDralliam added kind: bug An error, flaw, fault or unintended behaviour. needs: triage The validity of this issue needs to be checked, or the issue itself updated. labels Apr 26, 2024
@SkySkimmer SkySkimmer added kind: wish Feature or enhancement requests. and removed kind: bug An error, flaw, fault or unintended behaviour. needs: triage The validity of this issue needs to be checked, or the issue itself updated. labels Apr 26, 2024
SkySkimmer added a commit to SkySkimmer/coq that referenced this issue Apr 26, 2024
@Alizter
Copy link
Contributor

Alizter commented Apr 26, 2024

What's the difference with writing Type@{q}?

@SkySkimmer
Copy link
Contributor

That will interpret q as a universe not a quality.

SkySkimmer added a commit to SkySkimmer/coq that referenced this issue Apr 29, 2024
@coqbot-app coqbot-app bot added this to the 8.20+rc1 milestone May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: wish Feature or enhancement requests.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants