fix: unfold x<y in discrimination tree module
This commit is contained in:
parent
e15a656fd2
commit
7537fa7795
2 changed files with 15 additions and 1 deletions
|
|
@ -259,7 +259,7 @@ where
|
|||
step (e : Expr) := do
|
||||
let e ← whnfCore e
|
||||
match (← unfoldDefinition? e) with
|
||||
| some e' => if isBadKey e' then return e else step e'
|
||||
| some e' => if isBadKey e'.getAppFn then return e else step e'
|
||||
| none => return e
|
||||
|
||||
/-- whnf for the discrimination tree module -/
|
||||
|
|
|
|||
14
tests/lean/run/simpUnfoldAbbrev.lean
Normal file
14
tests/lean/run/simpUnfoldAbbrev.lean
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
example {x y : Nat} (h : y > x) : x < y := by
|
||||
-- simp should unfold `>` when inserting into the discrimination tree
|
||||
simp [h]
|
||||
|
||||
abbrev good (n : Nat) :=
|
||||
n > 42
|
||||
|
||||
example (h : good n) : n > 42 := by
|
||||
-- simp should unfold `good` when inserting into the discrimination tree
|
||||
simp [h]
|
||||
|
||||
example {x y : Nat} (h : x ≠ y) : x ≠ y := by
|
||||
-- ≠ is also an abbreviation
|
||||
simp [h]
|
||||
Loading…
Add table
Reference in a new issue