Skip to content

Commit 108bf11

Browse files
committed
fix: missing case in checkParents
This PR fixes a bug in the sanity checkers for the `grind` tactic.
1 parent 092449a commit 108bf11

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/Lean/Meta/Tactic/Grind/Inv.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ private def checkParents (e : Expr) : GoalM Unit := do
5757
if (← checkChild arg) then
5858
found := true
5959
break
60+
-- Recall that we have support for `Expr.forallE` propagation. See `ForallProp.lean`.
61+
if let .forallE _ d _ _ := parent then
62+
if (← checkChild d) then
63+
found := true
6064
unless found do
6165
assert! (← checkChild parent.getAppFn)
6266
else

tests/lean/run/grind_ematch2.lean

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
grind_pattern Array.size_set => Array.set a i v h
2+
grind_pattern Array.get_set_eq => a.set i v h
3+
grind_pattern Array.get_set_ne => (a.set i v hi)[j]
4+
5+
set_option grind.debug true
6+
set_option trace.grind.ematch.pattern true
7+
set_option trace.grind.ematch.instance true
8+
9+
example (as bs cs : Array α) (v₁ v₂ : α)
10+
(i₁ i₂ j : Nat)
11+
(h₁ : i₁ < as.size)
12+
(h₂ : bs = as.set i₁ v₁)
13+
(h₃ : i₂ < bs.size)
14+
(h₃ : cs = bs.set i₂ v₂)
15+
(h₄ : i₁ ≠ j ∧ i₂ ≠ j)
16+
(h₅ : j < cs.size)
17+
(h₆ : j < as.size)
18+
: cs[j] = as[j] := by
19+
grind

0 commit comments

Comments
 (0)