fix(frontends/lean/elaborator): fix bugs and adjust tests

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-10-24 15:29:56 -07:00
parent bbc265ded4
commit a7f94b55db
4 changed files with 6 additions and 11 deletions

View file

@ -197,7 +197,8 @@ class frontend_elaborator::imp {
/**
\brief Create a metavariable for representing the choice.
*/
expr mk_overload_mvar(buffer<expr> const & f_choices, context const & ctx, expr const & src) {
expr mk_overload_mvar(buffer<expr> & f_choices, context const & ctx, expr const & src) {
std::reverse(f_choices.begin(), f_choices.end());
expr mvar = m_ref.m_menv.mk_metavar(ctx);
m_ref.m_ucs.push_back(mk_choice_constraint(ctx, mvar, f_choices.size(), f_choices.data(),
mk_overload_justification(ctx, src)));

View file

@ -14,6 +14,6 @@ n + x + m
Set: lean::pp::coercion
(nat_to_int n) + x + (nat_to_int m) + (nat_to_int 10)
x + (nat_to_int n) + (nat_to_int m) + (nat_to_int 10)
(nat_to_int (n + m + 10)) + x
(nat_to_int n) + (nat_to_int m) + (nat_to_int 10) + x
Set: lean::pp::notation
Int::add (nat_to_int (Nat::add (Nat::add n m) 10)) x
Int::add (Int::add (Int::add (nat_to_int n) (nat_to_int m)) (nat_to_int 10)) x

View file

@ -6,7 +6,7 @@
Assumed: B'
Assumed: x
x
x = x
Assumed: b
Defined: f
Assumed: H

View file

@ -23,10 +23,4 @@ f a b
f (r2t b) (t2r a)
Assumed: g
f a b
Error (line: 19, pos: 10) ambiguous overloads
Candidates:
g : R → T → R
f : T → R → T
Arguments:
b : R
a : T
f (r2t b) (t2r a)