Hi! I have a somewhat weird testcase for a tactic, where I verify that it produces less than N goals, by using Fail Focus N. Abort.
. But Focus
command is deprecated, and although Fail N:{. Abort.
does the job, it makes Emacs go crazy due to unbalanced braces. Is there a less hacky way to check the number of goals?
There are numgoals and guard, and they are mentioned in the manual. For instance, see the following code:
Tactic Notation "nosplit" tactic3(tac) := tac; let n := numgoals in guard n = 1.
After that, "nosplit foo" will run foo and fail if it produces more than one goal. I suspect you just need to adapt the argument of guard.
Thanks, this worked nicely.
Last updated: Oct 01 2023 at 18:01 UTC