rocq-prover / rocq-prover/stdlib
Declare `Hint Mode` for `Reflexive`, `Symmetric`, `Equivalence`, ...
Nobody has claimed this yet.
- Dominant language
- Rocq Prover
- Stars
- 42
- Forks
- 38
- Avg merge
- 14h 6m
- Merged PRs (30d)
- 3
Description
I noticed that as part of the type class inference performed by setoid rewrite, Coq's often performing a wild goose chase on trying to find instances like:
Reflexive A ?R
i.e. Coq is trying to find an arbitrary reflexive relation on a given type.
I think this should be avoided, since:
- It leads to enormous amounts of backtracking, hence poor performance.
- It's possible to get loops by adding instances like
Reflexive A R → Reflexive A (foo R).
The obvious choice to avoid this is to set Hint Modes like:
Hint Mode Symmetric ! ! : typeclass_instances.
Hint Mode Transitive ! ! : typeclass_instances.
Hint Mode Equivalence ! ! : typeclass_instances.
Hint Mode PreOrder ! ! : typeclass_instances.
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
Locate the declarations for Reflexive, Symmetric, Transitive, Equivalence, and PreOrder, then inspect their typeclass inference hints. Check how setoid rewrite searches for these instances and verify that the requested Hint Modes prevent unconstrained relation searches without breaking valid inference.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100