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

Coq does not use the notation for printing (with custom entries) #18914

Closed
amblafont opened this issue Apr 9, 2024 · 1 comment · Fixed by #19089
Closed

Coq does not use the notation for printing (with custom entries) #18914

amblafont opened this issue Apr 9, 2024 · 1 comment · Fixed by #19089
Labels
kind: bug An error, flaw, fault or unintended behaviour. kind: regression Problems that were not present in previous versions. kind: user messages Improvement of error messages, new warnings, etc. part: notations The notation system.
Milestone

Comments

@amblafont
Copy link
Contributor

Description of the problem

In the last line below, Coq does not use the notation "++" for printing (although it is able to parse).

Small Coq file to reproduce the bug

Declare Custom Entry mor.
Declare Custom Entry obj.
Notation "< x >" := (x) (x custom mor).
Notation "x" := x (in custom mor at level 0, x global).
Notation "x" := x (in custom obj at level 0, x global).

Parameter C : Type.
Parameters a b c : C.


Parameter op : C -> C ->  C.
Notation "x -- y" := (op x y)  (y custom obj, at level 40, left associativity).
(* displays "a -- b -- c" *)
Check (a -- b -- c).

Parameter op2 : C -> C ->  C.
Notation "x -- y" := (op2 x y)  (in custom mor at level 40, left associativity).
(* displays "< a -- b -- c >" *)
Check (< a -- b -- c > ).


Parameter op3 : C -> C ->  C.
Notation "x ++ y" := (op3 x y)  (y custom obj, in custom mor at level 40, left associativity).
(* displays "op3 < a ++ b >" (Coq 8.19.0 or 8.19.1) 
   instead of "< a ++ b ++ c >" (Coq 8.18.0) as expected *)
Check (< a ++ b ++ c >).

Version of Coq where this bug occurs

8.19.0,8.19.1

Last version of Coq where the bug did not occur

8.18.0

@amblafont amblafont 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 9, 2024
@SkySkimmer SkySkimmer changed the title Coq does not use the notation for printing Coq does not use the notation for printing (with custom entries) Apr 24, 2024
@SkySkimmer SkySkimmer added kind: user messages Improvement of error messages, new warnings, etc. part: notations The notation system. and removed needs: triage The validity of this issue needs to be checked, or the issue itself updated. labels Apr 24, 2024
@herbelin herbelin added the kind: regression Problems that were not present in previous versions. label May 25, 2024
herbelin added a commit to herbelin/github-coq that referenced this issue May 25, 2024
herbelin added a commit to herbelin/github-coq that referenced this issue May 25, 2024
@herbelin
Copy link
Member

Thanks for the report! This is fixed in #19089.

coqbot-app bot added a commit that referenced this issue May 26, 2024
…s too confidently assuming being in the same entry

Reviewed-by: proux01
Co-authored-by: proux01 <proux01@users.noreply.github.com>
@coqbot-app coqbot-app bot added this to the 8.19.2 milestone May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug An error, flaw, fault or unintended behaviour. kind: regression Problems that were not present in previous versions. kind: user messages Improvement of error messages, new warnings, etc. part: notations The notation system.
Projects
None yet
3 participants