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

Implicit arguments are not printed in match ... in #18163

Closed
ali-ghanbari opened this issue Oct 14, 2023 · 4 comments · Fixed by #18176
Closed

Implicit arguments are not printed in match ... in #18163

ali-ghanbari opened this issue Oct 14, 2023 · 4 comments · Fixed by #18176
Labels
kind: user messages Improvement of error messages, new warnings, etc.
Milestone

Comments

@ali-ghanbari
Copy link

Description of the problem

When I run the following commands.

Set Printing All.
Print eq_sym.

I get the following type-correct and valid definition.

eq_sym =
fun (A : Type) (x y : A) (H : @eq A x y) =>
match H in (eq _ a) return (@eq A a x) with
| eq_refl => @eq_refl A x
end
     : forall (A : Type) (x y : A) (_ : @eq A x y), @eq A y x

Unfortunately, despite the fact that I had instructed Coq to print implicit arguments, it used implicit arguments in the subexpression (eq _ a). I would expect to see the following definition, which is also valid and equivalent to the definition above.

eq_sym =
fun (A : Type) (x y : A) (H : @eq A x y) =>
match H in (@eq _ _ a) return (@eq A a x) with
| @eq_refl _ _ => @eq_refl A x
end
:  forall (A : Type) (x y : A) (_ : @eq A x y), @eq A y x

I did this test with both Coqtop and CoqIDE (by turning on the Display Implicit Arguments option), they both give the same results.
I might be missing something or this might be just a bug in the printing facility of Coq.

Coq Version

8.17.1 on MacOSX 14.0

@SkySkimmer SkySkimmer added the kind: user messages Improvement of error messages, new warnings, etc. label Oct 14, 2023
@SkySkimmer
Copy link
Contributor

This needs to check the printing options

match drop_implicits_in_patt (GlobRef.IndRef ind) 0 args with

herbelin added a commit to herbelin/github-coq that referenced this issue Oct 15, 2023
@herbelin
Copy link
Member

@SkySkimmer: are you on? (Otherwise I'll propose something.)

@JasonGross
Copy link
Member

Does the expanded version work regardless of the Set Asymmetric Patterns setting? If not, that setting should also be checked so that printing is reversible

@SkySkimmer SkySkimmer changed the title Implicit arguments are not printed. Implicit arguments are not printed in match ... in Oct 17, 2023
herbelin added a commit to herbelin/github-coq that referenced this issue Oct 18, 2023
herbelin added a commit to herbelin/github-coq that referenced this issue Oct 18, 2023
@herbelin
Copy link
Member

Does the expanded version work regardless of the Set Asymmetric Patterns setting?

Yes, when using a @...

If not, that setting should also be checked so that printing is reversible

... but indeed, it should be checked that @ is used when Print All and Asymmetric Patterns are both on.

Made #18176.

herbelin added a commit to herbelin/github-coq that referenced this issue Oct 18, 2023
@coqbot-app coqbot-app bot added this to the 8.19+rc1 milestone Oct 18, 2023
coqbot-app bot added a commit that referenced this issue Oct 18, 2023
…terns

Reviewed-by: SkySkimmer
Co-authored-by: SkySkimmer <SkySkimmer@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: user messages Improvement of error messages, new warnings, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants