feat: add evalFailIfSuccess

This commit is contained in:
Leonardo de Moura 2020-04-09 11:02:15 -07:00
parent 679bdb5886
commit 9a38aca8ec

View file

@ -298,6 +298,15 @@ fun stx => evalChoiceAux stx.getArgs 0
@[builtinTactic skip] def evalSkip : Tactic :=
fun stx => pure ()
@[builtinTactic failIfSuccess] def evalFailIfSuccess : Tactic :=
fun stx =>
let tactic := stx.getArg 1;
whenM
(catch
(do evalTactic tactic; pure true)
(fun _ => pure false))
(throwError stx ("tactic succeeded"))
@[builtinTactic traceState] def evalTraceState : Tactic :=
fun stx => do
gs ← getUnsolvedGoals;