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

Fix the compilation warnings #17

Open
Columbus240 opened this issue Dec 21, 2020 · 9 comments
Open

Fix the compilation warnings #17

Columbus240 opened this issue Dec 21, 2020 · 9 comments

Comments

@Columbus240
Copy link
Collaborator

The newer coq versions give some compilation warnings about how some hints are defined. (fragile-hint-constr)

Look into that and either disable the warning or follow the recommendation of the warning (declare constants for the hints).

Columbus240 added a commit that referenced this issue Jan 6, 2021
Move the `Require` outside of the `Section`.
Concerning issue #17
@Columbus240
Copy link
Collaborator Author

Columbus240 commented Aug 20, 2021

Fixing the deprecated-ident-entry warnings (from v8.13 upwards) is impossible while staying compatible with v8.10. I propose making a new release of the opam package, then dropping support for v8.10.

The fragile-hint-constr warnings don't look convincing to me for our use-case. Whenever we use it, we declare @some_lemma to be the hint. I see the following options:

  • ignore the warning, as we currently did
  • silence the warning with Local Set Warnings "-fragile-hint-constr".
  • define intermediate values like Local Definition some_lemma' := @some_lemma thus cluttering the namespaces.
  • make all arguments of these lemmas explicit (maybe then applying the lemmas will behave differently?)
  • verify coqc well-enough, to show that the warning can be removed for hints of this form. Then land an appropriate change.
Has been resolved. A non-issue upon closer inspection.

@Zimmi48
Copy link
Member

Zimmi48 commented Aug 20, 2021

@Columbus240 Are you sure that these hints would behave differently if you just dropped the @? IINM it used to be the case but it isn't anymore. cc @ppedrot

@ppedrot
Copy link
Contributor

ppedrot commented Aug 20, 2021

Globals behave the same as their @-explicit form in hints commands at least since Coq 8.5.

@Columbus240
Copy link
Collaborator Author

Hm, I thought I tried that once and it failed. Will check again. Thanks for pointing that out.

@ppedrot
Copy link
Contributor

ppedrot commented Aug 21, 2021

Note that it's not the case for the using clause of auto tactics, where foo and @foo are not the same thing (see coq/coq#12512 for instance). This might be the source of the confusion.

@Columbus240
Copy link
Collaborator Author

Columbus240 commented Aug 21, 2021

It seems Hint Rewrite can't cope with implicit arguments. But that's probably because Hint Rewrite is something different from Hint Unfold, Hint Resolve, etc.

Lemma foo {X : Type} : 0 = 0.
Admitted.

Lemma bar (X : Type) : 0 = 0.
Admitted.

Fail Hint Rewrite foo : core. (* Cannot infer implicit parameter X of foo whose type is "Type". *)
Hint Rewrite bar : core.

Concretely, the first failure appeared on inverse_image_empty, when I removed the @ in InverseImage.v.

@ppedrot
Copy link
Contributor

ppedrot commented Aug 21, 2021

Despite the name, Hint Rewrite is a completely different beast that does behave differently on foo and @foo. But it shouldn't complain with a warning if you pass it an arbitrary term (otherwise it's a bug). Just fix the warnings.

@Columbus240
Copy link
Collaborator Author

Columbus240 commented Aug 21, 2021

?
The fragile-hint-constr warnings are on Hint Rewrite @inverse_image_empty : sets.. So you mean its a bug that the warnings appear there?

Edit: In terms of foo:

Lemma foo {X : Type} : 0 = 0.
Admitted.

Hint Rewrite @foo : core. (* causes a 
Edit: I was mistaken, the warnings came from the `Hint Resolve` and not from the `Hint Rewrite`. Sorry.

@Columbus240
Copy link
Collaborator Author

I probably treated the Hint Resolve and the Hint Rewrite warnings the same, and always removed the @ for both kinds of hints (if they were next to eachother in a file), instead of only treating the Hint Resolve.
Thanks for the assistance.

Columbus240 added a commit to Columbus240/topology that referenced this issue Aug 31, 2021
This fix is incompatible with coq v8.10.
Concerns issue coq-community#17
Columbus240 added a commit to Columbus240/topology that referenced this issue Oct 11, 2021
This fix is incompatible with coq v8.10.
Concerns issue coq-community#17
@Columbus240 Columbus240 mentioned this issue Feb 12, 2022
5 tasks
Columbus240 added a commit to Columbus240/topology that referenced this issue Feb 14, 2022
This fix is incompatible with coq v8.10.
Concerns issue coq-community#17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants