typeclass eauto should offer an option to not shelve subgoals, similar to simple refine #20357
Labels
kind: wish
Feature or enhancement requests.
needs: triage
The validity of this issue needs to be checked, or the issue itself updated.
Is your feature request related to a problem?
Because the hole
?x
appears in the type of the goal after we applythe goal is shelved after
simple eapply g. But now there are no remaining unshelved goals, so
typeclasses eauto` regards the main goal as solved.Proposed solution
It would be useful if there was an option for
typeclasses eauto
to behave at each application in the proof search more likerapply
than likesimple eapply
, so that the goalX
is not shelved. SinceX
is not a declared typeclass, typeclass search would fail on this goal and backtrack, looking for other instances of typeB ?a
.Furthermore, a similar flag should be available for the
refine
tactic, as a way of controlling the behavior of typeclass search withinrefine
. Currentlysimple refine
has the somewhat unintuitive behavior that although it does not shelve any goals, the applications ofsimple eapply
during typeclass search may shelve goals, so it would be desirable to have a simpler version ofsimple refine
that uses something likesimple refine
during typeclass search.Alternative solutions
I guess you could work around this by using
Hint Extern: rapply <instance> : typeclass_instances
instead of declaring it as an instance.None of the current settings for
typeclasses eauto
flags such asbest_effort
orwith typeclass_instances
seem to affect the code above.The text was updated successfully, but these errors were encountered: