fix(tests/lean): adjust error messages in the expected output

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-10-24 19:08:35 -07:00
parent 65a514ad8a
commit 46b9b2114a
6 changed files with 311 additions and 72 deletions

View file

@ -1,39 +1,138 @@
Set: pp::colors Set: pp::colors
Set: pp::unicode Set: pp::unicode
Assumed: f Assumed: f
Error (line: 4, pos: 6) type mismatch at application Failed to solve
f 10 ⊢ (?M3::1 ≈ λ x : , x) ⊕ (?M3::1 ≈ nat_to_int) ⊕ (?M3::1 ≈ nat_to_real)
Function type: (line: 4: pos: 8) Coercion for
Π (A : Type), A → A → A 10
Arguments types: Failed to solve
: Type ⊢ Bool ≺
10 : Substitution
: Bool ⊢ Bool ≺ ?M3::0
(line: 4: pos: 6) Type of argument 3 must be convertible to the expected type in the application of
f::explicit
with arguments:
?M3::0
?M3::1 10
Assignment
≺ ?M3::0
Substitution
⊢ (?M3::5[inst:0 (10)]) 10 ≺ ?M3::0
(line: 4: pos: 6) Type of argument 2 must be convertible to the expected type in the application of
f::explicit
with arguments:
?M3::0
?M3::1 10
Assignment
x : ⊢ λ x : , ≈ ?M3::5
Destruct/Decompose
x : ≈ ?M3::5 x
Destruct/Decompose
≈ Π x : ?M3::4, ?M3::5 x
Substitution
⊢ ?M3::3 ≈ Π x : ?M3::4, ?M3::5 x
Function expected at
?M3::1 10
Assignment
≺ ?M3::3
Propagate type, ?M3::1 : ?M3::3
Assignment
⊢ ?M3::1 ≈ λ x : , x
assumption 0
Failed to solve
⊢ Bool ≺
Substitution
⊢ Bool ≺ ?M3::0
(line: 4: pos: 6) Type of argument 3 must be convertible to the expected type in the application of
f::explicit
with arguments:
?M3::0
?M3::1 10
Assignment
≺ ?M3::0
Substitution
⊢ (?M3::5[inst:0 (10)]) 10 ≺ ?M3::0
(line: 4: pos: 6) Type of argument 2 must be convertible to the expected type in the application of
f::explicit
with arguments:
?M3::0
?M3::1 10
Assignment
_ : ⊢ λ x : , ≈ ?M3::5
Destruct/Decompose
_ : ≈ ?M3::5 _
Destruct/Decompose
≈ Π x : ?M3::4, ?M3::5 x
Substitution
⊢ ?M3::3 ≈ Π x : ?M3::4, ?M3::5 x
Function expected at
?M3::1 10
Assignment
≺ ?M3::3
Propagate type, ?M3::1 : ?M3::3
Assignment
⊢ ?M3::1 ≈ nat_to_int
assumption 1
Failed to solve
⊢ Bool ≺
Substitution
⊢ Bool ≺ ?M3::0
(line: 4: pos: 6) Type of argument 3 must be convertible to the expected type in the application of
f::explicit
with arguments:
?M3::0
?M3::1 10
Assignment
≺ ?M3::0
Substitution
⊢ (?M3::5[inst:0 (10)]) 10 ≺ ?M3::0
(line: 4: pos: 6) Type of argument 2 must be convertible to the expected type in the application of
f::explicit
with arguments:
?M3::0
?M3::1 10
Assignment
_ : ⊢ λ x : , ≈ ?M3::5
Destruct/Decompose
_ : ≈ ?M3::5 _
Destruct/Decompose
≈ Π x : ?M3::4, ?M3::5 x
Substitution
⊢ ?M3::3 ≈ Π x : ?M3::4, ?M3::5 x
Function expected at
?M3::1 10
Assignment
≺ ?M3::3
Propagate type, ?M3::1 : ?M3::3
Assignment
⊢ ?M3::1 ≈ nat_to_real
assumption 2
Assumed: g Assumed: g
Error (line: 7, pos: 6) unsolved placeholder at term Error (line: 7, pos: 6) unsolved placeholder at term
g 10 g 10
Assumed: h Assumed: h
Error (line: 11, pos: 27) application type mismatch during term elaboration Failed to solve
h A x x : ?M3::0, A : Type ⊢ ?M3::0[lift:0:2] ≺ A
Function type: (line: 11: pos: 27) Type of argument 2 must be convertible to the expected type in the application of
Π (A : Type), A → A h
Arguments types: with arguments:
A : Type A
x : ?M0[lift:0:2] x
Elaborator state
#0 ≈ ?M0[lift:0:2]
Assumed: eq Assumed: eq
Error (line: 15, pos: 51) application type mismatch during term elaboration Failed to solve
eq C a b A : Type, B : Type, a : ?M3::0, b : ?M3::1, C : Type ⊢ ?M3::0[lift:0:3] ≺ C
Function type: (line: 15: pos: 51) Type of argument 2 must be convertible to the expected type in the application of
Π (A : Type), A → A → Bool eq
Arguments types: with arguments:
C : Type C
a : ?M0[lift:0:3] a
b : ?M2[lift:0:2] b
Elaborator state
#0 ≈ ?M2[lift:0:2]
#0 ≈ ?M0[lift:0:3]
Assumed: a Assumed: a
Assumed: b Assumed: b
Assumed: H Assumed: H

View file

@ -4,21 +4,41 @@
myeq Bool myeq Bool
Assumed: T Assumed: T
Assumed: a Assumed: a
Error (line: 5, pos: 6) type mismatch at application Failed to solve
myeq Bool a ⊢ Bool ≺ T
Function type: Substitution
Π (A : Type), A → A → Bool ⊢ Bool ≺ ?M3::0
Arguments types: (line: 5: pos: 6) Type of argument 2 must be convertible to the expected type in the application of
Bool : Type myeq
: Bool with arguments:
a : T ?M3::0
a
Assignment
⊢ T ≺ ?M3::0
(line: 5: pos: 6) Type of argument 3 must be convertible to the expected type in the application of
myeq
with arguments:
?M3::0
a
Assumed: myeq2 Assumed: myeq2
Set: lean::pp::implicit Set: lean::pp::implicit
Error (line: 9, pos: 15) type mismatch at application Failed to solve
myeq2::explicit Bool a ⊢ Bool ≺ T
Function type: Substitution
Π (A : Type), A → A → Bool ⊢ Bool ≺ ?M3::0
Arguments types: (line: 9: pos: 15) Type of argument 2 must be convertible to the expected type in the application of
Bool : Type myeq2::explicit
: Bool with arguments:
a : T ?M3::0
a
Assignment
⊢ T ≺ ?M3::0
(line: 9: pos: 15) Type of argument 3 must be convertible to the expected type in the application of
myeq2::explicit
with arguments:
?M3::0
a

View file

@ -1,20 +1,47 @@
Set: pp::colors Set: pp::colors
Set: pp::unicode Set: pp::unicode
Error (line: 4, pos: 15) type mismatch at definition 'a', expected type let b := , a : := b in a
Given type:
Bool
Assumed: vector Assumed: vector
Assumed: const Assumed: const
let a := 10, v1 := const a , v2 := v1 in v2 : vector Bool 10 let a := 10, v1 := const a , v2 := v1 in v2 : vector Bool 10
let a := 10, v1 : vector Bool a := const a , v2 : vector Bool a := v1 in v2 let a := 10, v1 : vector Bool a := const a , v2 : vector Bool a := v1 in v2
let a := 10, v1 : vector Bool a := const a , v2 : vector Bool a := v1 in v2 : vector Bool 10 let a := 10, v1 : vector Bool a := const a , v2 : vector Bool a := v1 in v2 : vector Bool 10
Error (line: 31, pos: 26) type mismatch at definition 'v2', expected type Failed to solve
vector a a : := 10, v1 : vector ?M3::0 a := const a ⊢ Bool ≈
Given type: Substitution
vector Bool a a : := 10, v1 : vector ?M3::0 a := const a ⊢ ?M3::0[lift:0:1] ≈
Destruct/Decompose
a : := 10, v1 : vector ?M3::0 a := const a ⊢ vector (?M3::0[lift:0:1]) a ≺ vector a
(line: 31: pos: 26) Type of definition 'v2' must be convertible to expected type.
Assignment
a : := 10 ⊢ ?M3::0 ≈ Bool
Destruct/Decompose
a : := 10 ⊢ vector ?M3::0 a ≺ vector Bool a
(line: 30: pos: 26) Type of definition 'v1' must be convertible to expected type.
Assumed: foo Assumed: foo
Coercion foo Coercion foo
let a := 10, v1 : vector Bool a := const a , v2 : vector a := v1 in v2 : vector 10 Failed to solve
a : := 10, v1 : vector ?M3::0 a := const a ⊢ Bool ≈
Substitution
a : := 10, v1 : vector ?M3::0 a := const a ⊢ ?M3::0[lift:0:1] ≈
Destruct/Decompose
a : := 10, v1 : vector ?M3::0 a := const a ⊢ vector (?M3::0[lift:0:1]) a ≺ vector a
(line: 40: pos: 26) Type of definition 'v2' must be convertible to expected type.
Assignment
a : := 10 ⊢ ?M3::0 ≈ Bool
Destruct/Decompose
a : := 10 ⊢ vector ?M3::0 a ≺ vector Bool a
(line: 39: pos: 26) Type of definition 'v1' must be convertible to expected type.
Set: lean::pp::coercion Set: lean::pp::coercion
let a := 10, v1 : vector Bool a := const a , v2 : vector a := foo v1 in v2 Failed to solve
a : := 10, v1 : vector ?M3::0 a := const a ⊢ Bool ≈
Substitution
a : := 10, v1 : vector ?M3::0 a := const a ⊢ ?M3::0[lift:0:1] ≈
Destruct/Decompose
a : := 10, v1 : vector ?M3::0 a := const a ⊢ vector (?M3::0[lift:0:1]) a ≺ vector a
(line: 48: pos: 26) Type of definition 'v2' must be convertible to expected type.
Assignment
a : := 10 ⊢ ?M3::0 ≈ Bool
Destruct/Decompose
a : := 10 ⊢ vector ?M3::0 a ≺ vector Bool a
(line: 47: pos: 26) Type of definition 'v1' must be convertible to expected type.

View file

@ -1,13 +1,108 @@
Set: pp::colors Set: pp::colors
Set: pp::unicode Set: pp::unicode
Error (line: 1, pos: 10) application type mismatch, none of the overloads can be used Failed to solve
Candidates: ⊢ (?M3::0 ≈ Nat::add) ⊕ (?M3::0 ≈ Int::add) ⊕ (?M3::0 ≈ Real::add)
Real::add : (line: 1: pos: 10) Overloading at
Int::add : (Real::add | Int::add | Nat::add) 1
Nat::add : Failed to solve
Arguments: ⊢ Bool ≺
1 : Substitution
: Bool ⊢ Bool ≺ ?M3::8
(line: 1: pos: 10) Type of argument 2 must be convertible to the expected type in the application of
?M3::0
with arguments:
?M3::1 1
Assignment
≈ ?M3::8
Destruct/Decompose
≈ Π x : ?M3::8, ?M3::9 x
Substitution
⊢ (?M3::7[inst:0 (?M3::1 1)]) (?M3::1 1) ≈ Π x : ?M3::8, ?M3::9 x
(line: 1: pos: 10) Function expected at
?M3::0 (?M3::1 1)
Assignment
_ : ⊢ λ x : , ≈ ?M3::7
Destruct/Decompose
_ : ≈ ?M3::7 _
Destruct/Decompose
≈ Π x : ?M3::6, ?M3::7 x
Substitution
⊢ ?M3::2 ≈ Π x : ?M3::6, ?M3::7 x
(line: 1: pos: 10) Function expected at
?M3::0 (?M3::1 1)
Assignment
≺ ?M3::2
Propagate type, ?M3::0 : ?M3::2
Assignment
⊢ ?M3::0 ≈ Nat::add
assumption 0
Failed to solve
⊢ Bool ≺
Substitution
⊢ Bool ≺ ?M3::8
(line: 1: pos: 10) Type of argument 2 must be convertible to the expected type in the application of
?M3::0
with arguments:
?M3::1 1
Assignment
≈ ?M3::8
Destruct/Decompose
≈ Π x : ?M3::8, ?M3::9 x
Substitution
⊢ (?M3::7[inst:0 (?M3::1 1)]) (?M3::1 1) ≈ Π x : ?M3::8, ?M3::9 x
(line: 1: pos: 10) Function expected at
?M3::0 (?M3::1 1)
Assignment
_ : ⊢ λ x : , ≈ ?M3::7
Destruct/Decompose
_ : ≈ ?M3::7 _
Destruct/Decompose
≈ Π x : ?M3::6, ?M3::7 x
Substitution
⊢ ?M3::2 ≈ Π x : ?M3::6, ?M3::7 x
(line: 1: pos: 10) Function expected at
?M3::0 (?M3::1 1)
Assignment
≺ ?M3::2
Propagate type, ?M3::0 : ?M3::2
Assignment
⊢ ?M3::0 ≈ Int::add
assumption 2
Failed to solve
⊢ Bool ≺
Substitution
⊢ Bool ≺ ?M3::8
(line: 1: pos: 10) Type of argument 2 must be convertible to the expected type in the application of
?M3::0
with arguments:
?M3::1 1
Assignment
≈ ?M3::8
Destruct/Decompose
≈ Π x : ?M3::8, ?M3::9 x
Substitution
⊢ (?M3::7[inst:0 (?M3::1 1)]) (?M3::1 1) ≈ Π x : ?M3::8, ?M3::9 x
(line: 1: pos: 10) Function expected at
?M3::0 (?M3::1 1)
Assignment
_ : ⊢ λ x : , ≈ ?M3::7
Destruct/Decompose
_ : ≈ ?M3::7 _
Destruct/Decompose
≈ Π x : ?M3::6, ?M3::7 x
Substitution
⊢ ?M3::2 ≈ Π x : ?M3::6, ?M3::7 x
(line: 1: pos: 10) Function expected at
?M3::0 (?M3::1 1)
Assignment
≺ ?M3::2
Propagate type, ?M3::0 : ?M3::2
Assignment
⊢ ?M3::0 ≈ Real::add
assumption 5
Assumed: R Assumed: R
Assumed: T Assumed: T
Assumed: r2t Assumed: r2t

View file

@ -26,7 +26,7 @@ Definition map {A B C : Type} {n : N} (f : A → B → C) (v1 : vector A n) (v2
Definition map::explicit (A B C : Type) (n : N) (f : A → B → C) (v1 : vector A n) (v2 : vector B n) : vector C n := Definition map::explicit (A B C : Type) (n : N) (f : A → B → C) (v1 : vector A n) (v2 : vector B n) : vector C n :=
map f v1 v2 map f v1 v2
select (update (const three ⊥) two ) two two_lt_three : Bool select (update (const three ⊥) two ) two two_lt_three : Bool
if Bool (two = two)
update (const three ⊥) two : vector Bool three update (const three ⊥) two : vector Bool three
-------- --------

View file

@ -2,15 +2,13 @@
Set: pp::unicode Set: pp::unicode
Assumed: f Assumed: f
λ (A B : Type) (a : B), f B a λ (A B : Type) (a : B), f B a
Error (line: 4, pos: 40) application type mismatch during term elaboration Failed to solve
f B a A : Type, a : ?M3::0, B : Type ⊢ ?M3::0[lift:0:2] ≺ B
Function type: (line: 4: pos: 40) Type of argument 2 must be convertible to the expected type in the application of
Π (A : Type), A → Bool f
Arguments types: with arguments:
B : Type B
a : ?M0[lift:0:2] a
Elaborator state
#0 ≈ ?M0[lift:0:2]
Assumed: myeq Assumed: myeq
myeq (Π (A : Type), A → A) (λ (A : Type) (a : A), a) (λ (B : Type) (b : B), b) myeq (Π (A : Type), A → A) (λ (A : Type) (a : A), a) (λ (B : Type) (b : B), b)
myeq (Π (A : Type), A → A) (λ (A : Type) (a : A), a) (λ (B : Type) (b : B), b) : Bool myeq (Π (A : Type), A → A) (λ (A : Type) (a : A), a) (λ (B : Type) (b : B), b) : Bool