lean2/tests/lean/overload2.lean.expected.out
Leonardo de Moura 4357c9196e feat(kernel/metavar): make sure that a metavariable 'm' can only be assigned to a term that contains free variables available in the context associated with 'm'
This commit also simplifies the method check_pi in the type_checker and type_inferer.
It also fixes process_meta_app in the elaborator.
The problem was in the method process_meta_app and process_meta_inst.
They were processing convertability constrains as equality constraints.
For example, process_meta_app would handle

    ctx |- Type << ?f b

as

    ctx |- Type =:= ?f b

This is not correct because a ?f that returns (Type U) for b satisfies the first but not the second.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-14 12:25:00 -08:00

115 lines
4.8 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Set: pp::colors
Set: pp::unicode
Failed to solve
⊢ (?M::0 ≈ Nat::add) ⊕ (?M::0 ≈ Int::add) ⊕ (?M::0 ≈ Real::add)
(line: 1: pos: 10) Overloading at
(Real::add | Int::add | Nat::add) 1
Failed to solve
⊢ Bool ≺
Substitution
⊢ Bool ≺ ?M::8
(line: 1: pos: 10) Type of argument 2 must be convertible to the expected type in the application of
?M::0
with arguments:
?M::1 1
Assignment
≈ ?M::8
Destruct/Decompose
≈ Π x : ?M::8, ?M::9
Substitution
⊢ ?M::7[inst:0 (?M::1 1)] ≈ Π x : ?M::8, ?M::9
(line: 1: pos: 10) Function expected at
?M::0 (?M::1 1)
Assignment
_ : ≈ ?M::7
Destruct/Decompose
≈ Π x : ?M::6, ?M::7
Substitution
⊢ ?M::2 ≈ Π x : ?M::6, ?M::7
(line: 1: pos: 10) Function expected at
?M::0 (?M::1 1)
Assignment
≺ ?M::2
Propagate type, ?M::0 : ?M::2
Assignment
⊢ ?M::0 ≈ Nat::add
Assumption 0
Failed to solve
⊢ Bool ≺
Substitution
⊢ Bool ≺ ?M::8
(line: 1: pos: 10) Type of argument 2 must be convertible to the expected type in the application of
?M::0
with arguments:
?M::1 1
Assignment
≈ ?M::8
Destruct/Decompose
≈ Π x : ?M::8, ?M::9
Substitution
⊢ ?M::7[inst:0 (?M::1 1)] ≈ Π x : ?M::8, ?M::9
(line: 1: pos: 10) Function expected at
?M::0 (?M::1 1)
Assignment
_ : ≈ ?M::7
Destruct/Decompose
≈ Π x : ?M::6, ?M::7
Substitution
⊢ ?M::2 ≈ Π x : ?M::6, ?M::7
(line: 1: pos: 10) Function expected at
?M::0 (?M::1 1)
Assignment
≺ ?M::2
Propagate type, ?M::0 : ?M::2
Assignment
⊢ ?M::0 ≈ Int::add
Assumption 2
Failed to solve
⊢ Bool ≺
Substitution
⊢ Bool ≺ ?M::8
(line: 1: pos: 10) Type of argument 2 must be convertible to the expected type in the application of
?M::0
with arguments:
?M::1 1
Assignment
≈ ?M::8
Destruct/Decompose
≈ Π x : ?M::8, ?M::9
Substitution
⊢ ?M::7[inst:0 (?M::1 1)] ≈ Π x : ?M::8, ?M::9
(line: 1: pos: 10) Function expected at
?M::0 (?M::1 1)
Assignment
_ : ≈ ?M::7
Destruct/Decompose
≈ Π x : ?M::6, ?M::7
Substitution
⊢ ?M::2 ≈ Π x : ?M::6, ?M::7
(line: 1: pos: 10) Function expected at
?M::0 (?M::1 1)
Assignment
≺ ?M::2
Propagate type, ?M::0 : ?M::2
Assignment
⊢ ?M::0 ≈ Real::add
Assumption 5
Assumed: R
Assumed: T
Assumed: r2t
Coercion r2t
Assumed: t2r
Coercion t2r
Assumed: f
Assumed: a
Assumed: b
Set: lean::pp::coercion
Set: lean::pp::notation
f a b
f (r2t b) (t2r a)
Assumed: g
f a b
f (r2t b) (t2r a)