Skip to content

Commit

Permalink
fix bug in lsimp
Browse files Browse the repository at this point in the history
  • Loading branch information
lecopivo committed Nov 29, 2024
1 parent 1d70152 commit 13f33cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SciLean/Tactic/LSimp/Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,11 @@ partial def processCongrHypothesis (h : Expr) : LSimpM Bool := do
return r.proof?.isSome || (xs.size > 0 && lhs != r.expr)

/-- Try to rewrite `e` children using the given congruence theorem -/
partial def trySimpCongrTheorem? (c : SimpCongrTheorem) (e : Expr) : LSimpM (Option Result) := withNewMCtxDepth do
partial def trySimpCongrTheorem? (c : SimpCongrTheorem) (e : Expr) : LSimpM (Option Result) :=
-- Looks like that `withNewMCtxDepth` does not work well with `MetaLCtxM` so we need to
-- add `withoutModifyingLCtx`
withoutModifyingLCtx (fun r? => r?.mapM (Result.bindVars ·)) do
withNewMCtxDepth do
trace[Debug.Meta.Tactic.simp.congr] "{c.theoremName}, {e}"
let thm ← mkConstWithFreshMVarLevels c.theoremName
let (xs, bis, type) ← forallMetaTelescopeReducing (← inferType thm)
Expand Down

0 comments on commit 13f33cd

Please sign in to comment.