Skip to content

Commit 342bb8b

Browse files
committed
Update test
1 parent 88b0fbe commit 342bb8b

File tree

4 files changed

+37
-25
lines changed

4 files changed

+37
-25
lines changed

tests/lean/run/issue10749.lean

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test (a : List Nat) : Nat :=
1212
/--
1313
info: def test.match_1.{u_1} : (motive : List Nat → Sort u_1) →
1414
(a : List Nat) → ((x : List Nat) → motive x) → (Unit → motive []) → motive a :=
15-
fun motive a h_1 h_2 => h_1 a
15+
fun motive a h_1 h_2 => List.casesOn a (h_1 []) fun head tail => h_1 (head :: tail)
1616
-/
1717
#guard_msgs in #print test.match_1
1818

@@ -31,7 +31,7 @@ info: def test2.match_1.{u_1} : (motive : List Nat → List Nat → Sort u_1)
3131
(tail : List Nat) → (head_1 : Nat) → (tail_1 : List Nat) → motive (head :: tail) (head_1 :: tail_1)) →
3232
motive a b :=
3333
fun motive a b h_1 h_2 h_3 =>
34-
List.casesOn a (h_1 b) fun head tail =>
34+
List.casesOn a (List.casesOn b (h_1 []) fun head tail => h_1 (head :: tail)) fun head tail =>
3535
List.casesOn b (h_2 (head :: tail)) fun head_1 tail_1 => h_3 head tail head_1 tail_1
3636
-/
3737
#guard_msgs in #print test2.match_1
@@ -51,7 +51,8 @@ info: def test3.match_1.{u_1} : (motive : List Nat → Bool → Sort u_1) →
5151
((x : List Nat) → motive x true) →
5252
((x : Bool) → motive [] x) → ((x : List Nat) → (x_1 : Bool) → motive x x_1) → motive a b :=
5353
fun motive a b h_1 h_2 h_3 =>
54-
Bool.casesOn b (List.casesOn a (h_2 false) fun head tail => h_3 (head :: tail) false) (h_1 a)
54+
List.casesOn a (Bool.casesOn b (h_2 false) (h_1 [])) fun head tail =>
55+
Bool.casesOn b (h_3 (head :: tail) false) (h_1 (head :: tail))
5556
-/
5657
#guard_msgs in #print test3.match_1
5758

@@ -78,14 +79,29 @@ info: def test4.match_1.{u_1} : (motive : Bool → Bool → Bool → Bool → Bo
7879
((x x_5 x_6 x_7 : Bool) → motive true x x_5 x_6 x_7) →
7980
((x x_5 x_6 x_7 x_8 : Bool) → motive x x_5 x_6 x_7 x_8) → motive x x_1 x_2 x_3 x_4 :=
8081
fun motive x x_1 x_2 x_3 x_4 h_1 h_2 h_3 h_4 h_5 h_6 =>
81-
Bool.casesOn x_4
82-
(Bool.casesOn x_3
82+
Bool.casesOn x
83+
(Bool.casesOn x_1
8384
(Bool.casesOn x_2
84-
(Bool.casesOn x_1 (Bool.casesOn x (h_6 false false false false false) (h_5 false false false false))
85-
(h_4 x false false false))
86-
(h_3 x x_1 false false))
87-
(h_2 x x_1 x_2 false))
88-
(h_1 x x_1 x_2 x_3)
85+
(Bool.casesOn x_3 (Bool.casesOn x_4 (h_6 false false false false false) (h_1 false false false false))
86+
(Bool.casesOn x_4 (h_2 false false false false) (h_1 false false false true)))
87+
(Bool.casesOn x_3 (Bool.casesOn x_4 (h_3 false false false false) (h_1 false false true false))
88+
(Bool.casesOn x_4 (h_2 false false true false) (h_1 false false true true))))
89+
(Bool.casesOn x_2
90+
(Bool.casesOn x_3 (Bool.casesOn x_4 (h_4 false false false false) (h_1 false true false false))
91+
(Bool.casesOn x_4 (h_2 false true false false) (h_1 false true false true)))
92+
(Bool.casesOn x_3 (Bool.casesOn x_4 (h_3 false true false false) (h_1 false true true false))
93+
(Bool.casesOn x_4 (h_2 false true true false) (h_1 false true true true)))))
94+
(Bool.casesOn x_1
95+
(Bool.casesOn x_2
96+
(Bool.casesOn x_3 (Bool.casesOn x_4 (h_5 false false false false) (h_1 true false false false))
97+
(Bool.casesOn x_4 (h_2 true false false false) (h_1 true false false true)))
98+
(Bool.casesOn x_3 (Bool.casesOn x_4 (h_3 true false false false) (h_1 true false true false))
99+
(Bool.casesOn x_4 (h_2 true false true false) (h_1 true false true true))))
100+
(Bool.casesOn x_2
101+
(Bool.casesOn x_3 (Bool.casesOn x_4 (h_4 true false false false) (h_1 true true false false))
102+
(Bool.casesOn x_4 (h_2 true true false false) (h_1 true true false true)))
103+
(Bool.casesOn x_3 (Bool.casesOn x_4 (h_3 true true false false) (h_1 true true true false))
104+
(Bool.casesOn x_4 (h_2 true true true false) (h_1 true true true true)))))
89105
-/
90106
#guard_msgs in
91107
#print test4.match_1

tests/lean/run/issue10794.lean

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
/--
2-
error: Dependent elimination failed: Type mismatch when solving this alternative: it has type
3-
motive false
4-
but is expected to have type
5-
motive b✝
2+
error: Dependent match elimination failed: Could not solve constraints
3+
true ≋ false
64
-/
75
#guard_msgs in
86
def test1 b := match b with
97
| .(false) => 1
108
| true => 2
119

1210
/--
13-
error: Dependent elimination failed: Type mismatch when solving this alternative: it has type
14-
motive false ⋯
15-
but is expected to have type
16-
motive x✝¹ x✝
11+
error: Dependent match elimination failed: Could not solve constraints
12+
true ≋ false
1713
-/
1814
#guard_msgs in
1915
def test2 : (b : Bool) → (h : b = false) → Nat

tests/lean/run/match1.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ partial def natToBin' : (n : Nat) → List Bool
137137
/--
138138
error: Tactic `cases` failed with a nested error:
139139
Dependent elimination failed: Failed to solve equation
140-
n✝¹.succ = n✝.add n✝
140+
Nat.zero = n✝.add n✝
141141
at case `Parity.even` after processing
142-
(Nat.succ _), _
142+
Nat.zero, _
143143
the dependent pattern matcher can solve the following kinds of equations
144144
- <var> = <term> and <term> = <var>
145145
- <term> = <term> where the terms are definitionally equal

tests/lean/run/matchOverlapInaccesible.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ else
1616
/--
1717
error: Tactic `cases` failed with a nested error:
1818
Dependent elimination failed: Failed to solve equation
19-
n✝¹.succ = n✝.add n✝
19+
Nat.zero = n✝.add n✝
2020
at case `Parity.even` after processing
21-
(Nat.succ _), _
21+
Nat.zero, _
2222
the dependent pattern matcher can solve the following kinds of equations
2323
- <var> = <term> and <term> = <var>
2424
- <term> = <term> where the terms are definitionally equal
@@ -48,14 +48,14 @@ inductive Parity : MyNat -> Type
4848

4949
def parity (n : MyNat) : Parity n := sorry
5050

51-
set_option trace.Meta.Match.match true
51+
-- set_option trace.Meta.Match.match true
5252

5353
/--
5454
error: Tactic `cases` failed with a nested error:
5555
Dependent elimination failed: Failed to solve equation
56-
a✝.succ = sorry n✝ n✝
56+
zero = sorry n✝ n✝
5757
at case `Parity.even` after processing
58-
(succ _), _
58+
zero, _
5959
the dependent pattern matcher can solve the following kinds of equations
6060
- <var> = <term> and <term> = <var>
6161
- <term> = <term> where the terms are definitionally equal

0 commit comments

Comments
 (0)