rocq-prover / rocq-prover/stdlib
Conflicting use of "~=" in Coq.Program.Equality and Coq.Structures.Equalities
Nobody has claimed this yet.
- Dominant language
- Rocq Prover
- Stars
- 42
- Forks
- 38
- Avg merge
- 14h 6m
- Merged PRs (30d)
- 3
Description
Description of the problem
The Coq.Structures.Equalities library file declares the ~= notation (in the empty scope) to mean inequivalence according to some equivalence relation:
Module Type EqNotation (Import E:Eq).
Infix "==" := eq (at level 70, no associativity).
Notation "x ~= y" := (~eq x y) (at level 70, no associativity).
End EqNotation.
The Coq.Program.Equality library file, however, declares it to mean heterogeneous-type equality:
Notation " x ~= y " := (@JMeq _ x _ y) (at level 70, no associativity).
This is not exactly a bug but leads to annoying redefinition warnings when including EqNotation in a module where the Equality library is imported.
Since most projects importing Coq.Program.Equality are probably doing so for access to its tactics, and not making use of the declared ~= notation, it is probably unnecessary to export that notation at all. I cannot find any actual uses of it within the standard library, so simply deleting the notation from Coq.Program.Equality is probably an acceptable solution. If in fact it is being used, another solution would be to declare it in type_scope or program_scope rather than the empty scope. However, it is in any case probably bad practice to use the same notation for equality in one setting and inequality in another, so probably some change should be made to one or the other of these declarations.
Coq Version
The Coq Proof Assistant, version 8.15.2
compiled with OCaml 4.13.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the ~= declarations in Coq.Structures.Equalities and Coq.Program.Equality, then search the standard library for uses of the notation. Decide which declaration or scope should change so importing both libraries no longer produces a redefinition warning, and verify the affected library imports and any discovered uses.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100