Zulip Chat Archive
Stream: general
Topic: non-finishing `aesop?`
Damiano Testa (Nov 29 2023 at 21:44):
Dear All,
is there a way to get aesop?
to print the steps that it took, even when it does not close the goal?
For definiteness, here is an example where I may want to know what it is that aesop
did: can I access it?
Thanks!
import Mathlib.Tactic
example {n : ℕ} (h : (n = 0 ∧ False) ∨ n = 1) : False := by
aesop? -- can I get `aesop` to show what it did to reach this state?
sorry
Jannis Limperg (Nov 29 2023 at 21:47):
Not currently, but I should really fix this. There's no conceptual problem with this, just technical issues.
Damiano Testa (Nov 29 2023 at 21:48):
Ok, thanks! Of course, the reason for asking is that aesop
works so well that I want to use it even when it does not close the goal, but then I would like to replace it with the steps that it took!
Alex J. Best (Nov 29 2023 at 21:53):
I wonder if there is a way to hackily get this on the user side by adding a super low priority "give up and sorry rule" that only runs when all other goals are exhausted, then aesop
would always ("succeed")
Damiano Testa (Nov 29 2023 at 21:55):
Are you thinking of something like wrapping aesop
in aesop <;> sorry
? EDITED.
Damiano Testa (Nov 29 2023 at 21:56):
Ah, maybe this would backtrack, so I guess not this!
Alex J. Best (Nov 29 2023 at 22:44):
I mean like this
import Mathlib.Tactic
import Aesop
@[aesop 1% unsafe apply]
def sooryeh {A} : A := sorry
set_option trace.aesop true
example {n : ℕ} (h : (n = 0 ∧ False) ∨ n = 1) : False := by
aesop? -- can I get `aesop` to show what it did to reach this state?
sorry
Damiano Testa (Nov 29 2023 at 22:51):
@Alex J. Best this is a wonderful idea, thanks!
Siddhartha Gadgil (Dec 14 2023 at 08:57):
@Alex J. Best I agree this is brilliant. Maybe one can refine it with a variant of sorry
that logs the goal state and then uses sorry
.
Last updated: Dec 20 2023 at 11:08 UTC