refactor: Cleanup the congruence tactics #81

Merged
aniva merged 4 commits from tactic/congruence into dev 2024-06-23 13:35:36 -07:00
1 changed files with 5 additions and 4 deletions
Showing only changes of commit b3a60fcea8 - Show all commits

View File

@ -204,15 +204,16 @@ def goalMotivatedApply (state: GoalState) (goalId: Nat) (recursor: String): Core
def goalNoConfuse (state: GoalState) (goalId: Nat) (eq: String): CoreM TacticResult := def goalNoConfuse (state: GoalState) (goalId: Nat) (eq: String): CoreM TacticResult :=
runTermElabM <| state.tryNoConfuse goalId eq runTermElabM <| state.tryNoConfuse goalId eq
inductive TacticExecute where inductive SyntheticTactic where
| congruenceArg | congruenceArg
| congruenceFun | congruenceFun
| congruence | congruence
@[export pantograph_goal_tactic_execute_m] /-- Executes a synthetic tactic which has no arguments -/
def goalTacticExecute (state: GoalState) (goalId: Nat) (tacticExecute: TacticExecute): CoreM TacticResult := @[export pantograph_goal_synthetic_tactic_m]
def goalSyntheticTactic (state: GoalState) (goalId: Nat) (case: SyntheticTactic): CoreM TacticResult :=
runTermElabM do runTermElabM do
state.restoreElabM state.restoreElabM
state.execute goalId $ match tacticExecute with state.execute goalId $ match case with
| .congruenceArg => Tactic.congruenceArg | .congruenceArg => Tactic.congruenceArg
| .congruenceFun => Tactic.congruenceFun | .congruenceFun => Tactic.congruenceFun
| .congruence => Tactic.congruence | .congruence => Tactic.congruence