Skip to content

Commit bdeff39

Browse files
committed
We need solveOverlap after all
1 parent 77bcddc commit bdeff39

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/Lean/Meta/Match/MatchEqs.lean

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,17 @@ where
214214
else
215215
throwError "spliIf failed")
216216
<|>
217-
(do solveOverlap mvarId; return #[])
217+
(do solveOverlap mvarId
218+
trace[Meta.Match.matchEqs] "solved with overlap"
219+
return #[])
218220
<|>
219221
(do if debug.Meta.Match.MatchEqs.grindAsSorry.get (← getOptions) then
220222
trace[Meta.Match.matchEqs] "proveCondEqThm.go: grind_as_sorry is enabled, admitting goal"
221223
mvarId.admit (synthetic := true)
222224
else
223225
let r ← Grind.main mvarId (← Grind.mkParams {})
224226
if r.hasFailed then throwError "grind failed"
227+
trace[Meta.Match.matchEqs] "solved with grind"
225228
return #[])
226229
<|>
227230
(throwMatchEqnFailedMessage matchDeclName thmName mvarId)

tests/lean/run/issue11342.lean

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,32 @@ info: private theorem testMe.match_1.congr_eq_1.{u_1} : ∀ (motive : Nat → So
121121
-/
122122
#guard_msgs(pass trace, all) in
123123
#print sig testMe.match_1.congr_eq_1
124+
125+
structure DefaultClause (n : Nat) where
126+
a : List (Fin n)
127+
b : a.Nodup
128+
c : a.Nodup
129+
130+
-- set_option trace.Meta.Match.matchEqs true
131+
132+
def deleteOne {n : Nat} (f : Option (DefaultClause n)) : Nat :=
133+
match f with
134+
| none => 0
135+
| some ⟨[_l], _, _⟩ => 1
136+
| some _ => 2
137+
138+
/--
139+
info: private theorem deleteOne.match_1.congr_eq_3.{u_1} : ∀ {n : Nat} (motive : Option (DefaultClause n) → Sort u_1)
140+
(f : Option (DefaultClause n)) (h_1 : Unit → motive none)
141+
(h_2 : (_l : Fin n) → (b c : [_l].Nodup) → motive (some { a := [_l], b := b, c := c }))
142+
(h_3 : (val : DefaultClause n) → motive (some val)) (val : DefaultClause n),
143+
f = some val →
144+
(∀ (_l : Fin n) (b c : [_l].Nodup), val = { a := [_l], b := b, c := c } → False) →
145+
(match f with
146+
| none => h_1 ()
147+
| some { a := [_l], b := b, c := c } => h_2 _l b c
148+
| some val => h_3 val) ≍
149+
h_3 val
150+
-/
151+
#guard_msgs in
152+
#print sig deleteOne.match_1.congr_eq_3

0 commit comments

Comments
 (0)