feat(goal): Add unshielded tactic execution mode #219

Merged
aniva merged 12 commits from goal/automatic-mode into dev 2025-06-26 15:52:17 -07:00
1 changed files with 21 additions and 0 deletions
Showing only changes of commit 8e35926b5c - Show all commits

View File

@ -10,6 +10,27 @@ import Lean
namespace Pantograph
open Lean
/-- Determine the acting area of a tactic -/
inductive Site where
| focus (goal : MVarId)
| prefer (goal : MVarId)
| unfocus
instance : Coe MVarId Site where
coe := .focus
protected def Site.runTacticM (site : Site) { m } [Monad m] [MonadLiftT Elab.Tactic.TacticM m] [MonadControlT Elab.Tactic.TacticM m]
(f : m α) : m α :=
match site with
| .focus goal => do
Elab.Tactic.setGoals [goal]
f
| .prefer goal => do
let otherGoals := (← Elab.Tactic.getUnsolvedGoals).filter (· != goal)
Elab.Tactic.setGoals (goal :: otherGoals)
f
| .unfocus => f
/--
Represents an interconnected set of metavariables, or a state in proof search
-/