Compare commits
No commits in common. "222cb035d1d0a9f8bda842b8a1f3bab967a8366f" and "403d92692e056b730c98cfca615a910463ec7399" have entirely different histories.
222cb035d1
...
403d92692e
|
@ -34,7 +34,6 @@ structure GoalState where
|
||||||
-- Existence of this field shows that we are currently in `conv` mode.
|
-- Existence of this field shows that we are currently in `conv` mode.
|
||||||
convMVar?: Option (MVarId × MVarId) := .none
|
convMVar?: Option (MVarId × MVarId) := .none
|
||||||
-- Previous RHS for calc, so we don't have to repeat it every time
|
-- Previous RHS for calc, so we don't have to repeat it every time
|
||||||
-- WARNING: If using `state with` outside of `calc`, this must be set to `.none`
|
|
||||||
calcPrevRhs?: Option Expr := .none
|
calcPrevRhs?: Option Expr := .none
|
||||||
|
|
||||||
protected def GoalState.create (expr: Expr): Elab.TermElabM GoalState := do
|
protected def GoalState.create (expr: Expr): Elab.TermElabM GoalState := do
|
||||||
|
@ -140,7 +139,6 @@ protected def GoalState.tryTactic (state: GoalState) (goalId: Nat) (tactic: Stri
|
||||||
savedState := nextSavedState
|
savedState := nextSavedState
|
||||||
newMVars := newMVarSet prevMCtx nextMCtx,
|
newMVars := newMVarSet prevMCtx nextMCtx,
|
||||||
parentMVar? := .some goal,
|
parentMVar? := .some goal,
|
||||||
calcPrevRhs? := .none,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/-- Assumes elabM has already been restored. Assumes expr has already typechecked -/
|
/-- Assumes elabM has already been restored. Assumes expr has already typechecked -/
|
||||||
|
@ -406,7 +404,6 @@ protected def GoalState.focus (state: GoalState) (goalId: Nat): Option GoalState
|
||||||
state.savedState with
|
state.savedState with
|
||||||
tactic := { goals := [goal] },
|
tactic := { goals := [goal] },
|
||||||
},
|
},
|
||||||
calcPrevRhs? := .none,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/--
|
/--
|
||||||
|
@ -426,7 +423,6 @@ protected def GoalState.resume (state: GoalState) (goals: List MVarId): Except S
|
||||||
term := state.savedState.term,
|
term := state.savedState.term,
|
||||||
tactic := { goals := unassigned },
|
tactic := { goals := unassigned },
|
||||||
},
|
},
|
||||||
calcPrevRhs? := .none,
|
|
||||||
}
|
}
|
||||||
/--
|
/--
|
||||||
Brings into scope all goals from `branch`
|
Brings into scope all goals from `branch`
|
||||||
|
|
|
@ -178,10 +178,6 @@ def goalConv (state: GoalState) (goalId: Nat): Lean.CoreM TacticResult :=
|
||||||
def goalConvExit (state: GoalState): Lean.CoreM TacticResult :=
|
def goalConvExit (state: GoalState): Lean.CoreM TacticResult :=
|
||||||
runTermElabM <| state.convExit
|
runTermElabM <| state.convExit
|
||||||
|
|
||||||
@[export pantograph_goal_calc_m]
|
|
||||||
def goalCalc (state: GoalState) (goalId: Nat) (pred: String): Lean.CoreM TacticResult :=
|
|
||||||
runTermElabM <| state.tryCalc goalId pred
|
|
||||||
|
|
||||||
@[export pantograph_goal_focus]
|
@[export pantograph_goal_focus]
|
||||||
def goalFocus (state: GoalState) (goalId: Nat): Option GoalState :=
|
def goalFocus (state: GoalState) (goalId: Nat): Option GoalState :=
|
||||||
state.focus goalId
|
state.focus goalId
|
||||||
|
|
Loading…
Reference in New Issue