Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove SplitIf.ext cache #5571

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Lean.lean
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import Lean.Server
import Lean.ScopedEnvExtension
import Lean.DocString
import Lean.DeclarationRange
import Lean.LazyInitExtension
import Lean.LoadDynlib
import Lean.Widget
import Lean.Log
Expand Down
42 changes: 0 additions & 42 deletions src/Lean/LazyInitExtension.lean

This file was deleted.

27 changes: 11 additions & 16 deletions src/Lean/Meta/Tactic/SplitIf.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,26 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
prelude
import Lean.LazyInitExtension
import Lean.Meta.Tactic.Cases
import Lean.Meta.Tactic.Simp.Main

namespace Lean.Meta
namespace SplitIf

builtin_initialize ext : LazyInitExtension MetaM Simp.Context ←
registerLazyInitExtension do
let mut s : SimpTheorems := {}
s ← s.addConst ``if_pos
s ← s.addConst ``if_neg
s ← s.addConst ``dif_pos
s ← s.addConst ``dif_neg
return {
simpTheorems := #[s]
congrTheorems := (← getSimpCongrTheorems)
config := { Simp.neutralConfig with dsimp := false }
}

/--
Default `Simp.Context` for `simpIf` methods. It contains all congruence theorems, but
just the rewriting rules for reducing `if` expressions. -/
def getSimpContext : MetaM Simp.Context :=
ext.get
def getSimpContext : MetaM Simp.Context := do
let mut s : SimpTheorems := {}
s ← s.addConst ``if_pos
s ← s.addConst ``if_neg
s ← s.addConst ``dif_pos
s ← s.addConst ``dif_neg
return {
simpTheorems := #[s]
congrTheorems := (← getSimpCongrTheorems)
config := { Simp.neutralConfig with dsimp := false }
}

/--
Default `discharge?` function for `simpIf` methods.
Expand Down
Loading