Skip to content

Commit

Permalink
chore: remove unused change_mlir_context (#325)
Browse files Browse the repository at this point in the history
This meta-code breaks with the next lean update. As it is unused, we
drop it beforehand.
  • Loading branch information
tobiasgrosser authored May 22, 2024
1 parent 3076821 commit 030dd3d
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions SSA/Core/Tactic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,6 @@ namespace SSA

open Ctxt (Var Valuation DerivedCtxt)

section

open Lean Meta Elab.Tactic Qq

/-- Given a `V : Valuation Γ`, fully reduce the context `Γ` in the type of `V` -/
elab "change_mlir_context " V:ident : tactic => do
let V : Name := V.getId
withMainContext do
let ctx ← getLCtx
let Vdecl : LocalDecl ← match ctx.findFromUserName? V with
| some decl => pure decl
| none => throwError f!"Failed to find variable `{V}` in the local context"

-- Assert that the type of `V` is `Ctxt.Valuation ?Γ`
let Ty ← mkFreshExprMVarQ q(Type)
let Γ ← mkFreshExprMVarQ q(Ctxt $Ty)
let G ← mkFreshExprMVarQ q(TyDenote $Ty)
let _ ← assertDefEqQ Vdecl.type q(@Ctxt.Valuation $Ty $G $Γ)

-- Reduce the context `Γ`
let Γr ← ctxtNf Γ
let Γr : Q(Ctxt $Ty) := Γr

let goal ← getMainGoal
let newGoal ← goal.changeLocalDecl Vdecl.fvarId q(Valuation $Γr)
replaceMainGoal [newGoal]

end

open Lean Elab Tactic Meta

/--
Expand Down

0 comments on commit 030dd3d

Please sign in to comment.