Zulip Chat Archive
Stream: general
Topic: code action "remove tactics after no goals" for "fail"
Asei Inoue (Apr 30 2024 at 12:09):
import Mathlib.Tactic
example {a b : Int} (h : a = b) : - a ^ 2 + b ^ 2 + (a + b) * (a - b) = 0 := by
try
ring
fail -- Remove tactics after "no goals"
rw [h]
ring
Asei Inoue (Apr 30 2024 at 12:10):
If the above “fail” is removed by code action, the proof will not pass.
Kyle Miller (Apr 30 2024 at 12:13):
That's amusing.
It makes me wonder if there should be a code action for a try
that always fails?
Asei Inoue (Apr 30 2024 at 12:20):
I feel "remove tactic after no goals" code action is not needed for done
or fail
Asei Inoue (Apr 30 2024 at 12:26):
It makes me wonder if there should be a code action for a
try
that always fails?
How about all_goals try <tactic>
?
Kyle Miller (Apr 30 2024 at 12:28):
I think the code action would be able to see that there's some evaluation of the try
that succeeds
Last updated: May 02 2025 at 03:31 UTC