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

"Print" works for some notations but not all. #18096

Closed
RalfJung opened this issue Sep 29, 2023 · 7 comments · Fixed by #18104
Closed

"Print" works for some notations but not all. #18096

RalfJung opened this issue Sep 29, 2023 · 7 comments · Fixed by #18104

Comments

@RalfJung
Copy link
Contributor

Description of the problem

I recently noticed that Print "=" works and prints eq, but Print "<>" does not work and just says

Unable to interpret "<>" as a reference.

Why can some notations be printed and others not? Is this a bug or somehow intended?

Coq Version

8.16.1

@SkySkimmer
Copy link
Contributor

It works when the notation is basically just the reference (cf

let global_reference_of_notation ~head test (ntn,sc,(on_parsing,on_printing,{not_interp = (_,c)})) =
).
In the case of "x = y" := (@eq _ x y) this is the case but for "x <> y" := (not (@eq _ x y)) it's not.

@RalfJung
Copy link
Contributor Author

Oh I see... Print "<>" would have to print not and eq somehow but it's only supposed to print one thing. Yeah that makes sense, thanks!

@herbelin
Copy link
Member

Maybe the message should be improved?

@RalfJung
Copy link
Contributor Author

Yeah that would be a good idea.

@herbelin
Copy link
Member

Unable to non-ambiguously interpret "<>" as a reference. ??

(At the same time, we should take some time to rethink the articulation between Print, Check and About. There was an issue about it but I don't find it again. It would also be possible to give a positive answer on Print "<>", say Notation "x <> y" := (not (eq x y)).)

@RalfJung
Copy link
Contributor Author

Those 3 I actually see as fairly different, but Print and Locate have a lot of overlap... also see #18097.

Unable to non-ambiguously interpret "<>" as a reference. ??

What about something like

Unable to non-ambiguously interpret "<>" as a reference; found:
Notation "x <> y" := (not (eq x y)).

@herbelin
Copy link
Member

OK, adopted, made #18104.

herbelin added a commit to herbelin/github-coq that referenced this issue Oct 30, 2023
coqbot-app bot added a commit that referenced this issue Nov 6, 2023
…tation cannot be intepreted as a reference

Reviewed-by: ppedrot
Ack-by: proux01
Ack-by: JasonGross
Co-authored-by: ppedrot <ppedrot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants