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

constr in Custom Entry mistaken for SELF #11331

Closed
Janno opened this issue Dec 23, 2019 · 3 comments · Fixed by #11530 or #11613
Closed

constr in Custom Entry mistaken for SELF #11331

Janno opened this issue Dec 23, 2019 · 3 comments · Fixed by #11530 or #11613
Milestone

Comments

@Janno
Copy link
Contributor

Janno commented Dec 23, 2019

Description of the problem

The custom entry below treats parts p and b as custom expr instead of the specified constr.

Declare Custom Entry expr. Declare Custom Entry aux.
Notation "p u b" := (p (fun _ => b) u)
  (in custom expr at level 201, p constr, b constr, u custom aux at level 1).
Print Custom Grammar expr.
(*
Entry constr:expr is
[ "201" RIGHTA
  [ SELF; constr:aux LEVEL "1"; NEXT ] ]
*)

I suspect that this breaks some uses of my (more complicated) notations.

Coq Version

master, 8.10.2

@Janno
Copy link
Contributor Author

Janno commented Dec 23, 2019

It has to do with specifying the notation's level:

Declare Custom Entry expr.
Notation "{ p }" := (p)
  (in custom expr at level 201, p constr).
Notation "{ p }" := (p)
  (in custom expr, p constr).

The second notation correctly treats p as a constr whereas the first one doesn't.

@ppedrot
Copy link
Member

ppedrot commented Dec 23, 2019

The issue arises in Egramcoq.symbol_of_target. The from argument should also provide the ambient custom entry to be able to discriminate it against the entry being resolved. While this alone is easy to do, I don't really understand what adjust_level should do in that case, so I am deferring to @herbelin.

herbelin added a commit to herbelin/github-coq that referenced this issue Jan 2, 2020
…and constr).

There was a collision at the time of interpreting subentries (in metasyntax.ml) but also
at the time of "optimizing" the entries (in egramcoq.ml).
herbelin added a commit to herbelin/github-coq that referenced this issue Jan 2, 2020
…and constr).

There was a collision at the time of interpreting subentries (in metasyntax.ml) but also
at the time of "optimizing" the entries (in egramcoq.ml).
herbelin added a commit to herbelin/github-coq that referenced this issue Jan 2, 2020
…and constr).

There was a collision at the time of interpreting subentries (in metasyntax.ml) but also
at the time of "optimizing" the entries (in egramcoq.ml).
@herbelin
Copy link
Member

herbelin commented Jan 2, 2020

See #11355 #11530 for a fix. Printing of custom entries was missing some polishing. Thanks a lot for reporting.

herbelin added a commit to herbelin/github-coq that referenced this issue Jan 2, 2020
…and constr).

There was a collision at the time of interpreting subentries (in metasyntax.ml) but also
at the time of "optimizing" the entries (in egramcoq.ml).
herbelin added a commit to herbelin/github-coq that referenced this issue Jan 3, 2020
…and constr).

There was a collision at the time of interpreting subentries (in metasyntax.ml) but also
at the time of "optimizing" the entries (in egramcoq.ml).
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 5, 2020
…and constr).

There was a collision at the time of interpreting subentries (in metasyntax.ml) but also
at the time of "optimizing" the entries (in egramcoq.ml).
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 9, 2020
…and constr).

There was a collision at the time of interpreting subentries (in metasyntax.ml) but also
at the time of "optimizing" the entries (in egramcoq.ml).
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 9, 2020
…nd constr).

There was a collision at the time of interpreting subentries (in metasyntax.ml) but also
at the time of "optimizing" the entries (in egramcoq.ml).

Also fixes coq#9519.
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 14, 2020
…nd constr).

There was a collision at the time of interpreting subentries (in metasyntax.ml) but also
at the time of "optimizing" the entries (in egramcoq.ml).

Also fixes coq#9519.
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 14, 2020
…nd constr).

There was a collision at the time of interpreting subentries (in metasyntax.ml) but also
at the time of "optimizing" the entries (in egramcoq.ml).

Also fixes coq#9519.
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 14, 2020
…nd constr).

There was a collision at the time of interpreting subentries (in
metasyntax.ml) but also at the time of "optimizing" the entries (in
egramcoq.ml).

Also fixes coq#9517, fixes coq#9519.

fix main commit
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 14, 2020
…nd constr).

There was a collision at the time of interpreting subentries (in
metasyntax.ml) but also at the time of "optimizing" the entries (in
egramcoq.ml).

Also fixes coq#9517, fixes coq#9519.

fix main commit
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 15, 2020
…nd constr).

There was a collision at the time of interpreting subentries (in
metasyntax.ml) but also at the time of "optimizing" the entries (in
egramcoq.ml).

Also fixes coq#9517, fixes coq#9519.

fix main commit
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 16, 2020
…nd constr).

There was a collision at the time of interpreting subentries (in
metasyntax.ml) but also at the time of "optimizing" the entries (in
egramcoq.ml).

Also fixes coq#9517, fixes coq#9519, fixes coq#9640 (part 3).
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 17, 2020
…nd constr).

There was a collision at the time of interpreting subentries (in
metasyntax.ml) but also at the time of "optimizing" the entries (in
egramcoq.ml).

Also fixes coq#9517, fixes coq#9519, fixes coq#9640 (part 3).
ppedrot added a commit that referenced this issue Feb 18, 2020
Reviewed-by: Zimmi48
Reviewed-by: ppedrot
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 24, 2020
…nd constr).

There was a collision at the time of interpreting subentries (in
metasyntax.ml) but also at the time of "optimizing" the entries (in
egramcoq.ml).

Also fixes coq#9517, fixes coq#9519, fixes coq#9640 (part 3).
ppedrot added a commit that referenced this issue Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment