Stream: Coq users

Topic: Cousin of auto which changes goal when it fails

view this post on Zulip Patrick Nicodemus (Jan 13 2022 at 18:27):

Auto does not change the goal when it fails to solve it completely. Are there any alternate tactics which do basically the same thing as auto, but which change the goal as much as they can before giving up?

My imagined use case is something like this - there are certain goals i have where i know i always want to perform a certain step, there's no other choice I would make, so I always want that step to be taken, and I would create a database with these special goals where the proof step is uniquely determined. In that case I wouldn't want auto to backtrack and undo the work when it succeeds.

My current solution is just to put all of these in a big "repeat match goal" but I would like to know if there's a better way.

view this post on Zulip Théo Winterhalter (Jan 13 2022 at 18:31):

Here is what I did after asking a similar question here:

#[export] Hint Extern 100 =>
  shelve : ssprove_valid_db.

Ltac ssprove_valid :=
  (unshelve typeclasses eauto with ssprove_valid_db) ; shelve_unifiable.

The idea is that it will "succeed" by shelving the goal, so afterward you unshelve what has been shelved.

view this post on Zulip Patrick Nicodemus (Jan 13 2022 at 18:32):

Interesting solution! Thanks!

Last updated: Jun 20 2024 at 13:02 UTC