feat: add helper method
This commit is contained in:
parent
dfa5cf9282
commit
5f5cc55d6a
1 changed files with 11 additions and 0 deletions
|
|
@ -195,6 +195,17 @@ def getMainTag : TacticM Name := do
|
|||
let (g, _) ← getMainGoal
|
||||
pure (← getMVarDecl g).userName
|
||||
|
||||
/- Evaluate `tac` at `mvarId`, and return the list of resulting subgoals. -/
|
||||
def evalTacticAt (tac : Syntax) (mvarId : MVarId) : TacticM (List MVarId) := do
|
||||
let gs ← getGoals
|
||||
try
|
||||
setGoals [mvarId]
|
||||
evalTactic tac
|
||||
pruneSolvedGoals
|
||||
getGoals
|
||||
finally
|
||||
setGoals gs
|
||||
|
||||
def ensureHasNoMVars (e : Expr) : TacticM Unit := do
|
||||
let e ← instantiateMVars e
|
||||
let pendingMVars ← getMVars e
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue