fix(frontends/lean/elaborator): fix bugs and adjust tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
bbc265ded4
commit
a7f94b55db
4 changed files with 6 additions and 11 deletions
|
@ -197,7 +197,8 @@ class frontend_elaborator::imp {
|
||||||
/**
|
/**
|
||||||
\brief Create a metavariable for representing the choice.
|
\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);
|
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(),
|
m_ref.m_ucs.push_back(mk_choice_constraint(ctx, mvar, f_choices.size(), f_choices.data(),
|
||||||
mk_overload_justification(ctx, src)));
|
mk_overload_justification(ctx, src)));
|
||||||
|
|
|
@ -14,6 +14,6 @@ n + x + m
|
||||||
Set: lean::pp::coercion
|
Set: lean::pp::coercion
|
||||||
(nat_to_int n) + x + (nat_to_int m) + (nat_to_int 10)
|
(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)
|
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
|
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
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
Assumed: B'
|
Assumed: B'
|
||||||
Assumed: x
|
Assumed: x
|
||||||
x
|
x
|
||||||
⊤
|
x = x
|
||||||
Assumed: b
|
Assumed: b
|
||||||
Defined: f
|
Defined: f
|
||||||
Assumed: H
|
Assumed: H
|
||||||
|
|
|
@ -23,10 +23,4 @@ f a b
|
||||||
f (r2t b) (t2r a)
|
f (r2t b) (t2r a)
|
||||||
Assumed: g
|
Assumed: g
|
||||||
f a b
|
f a b
|
||||||
Error (line: 19, pos: 10) ambiguous overloads
|
f (r2t b) (t2r a)
|
||||||
Candidates:
|
|
||||||
g : R → T → R
|
|
||||||
f : T → R → T
|
|
||||||
Arguments:
|
|
||||||
b : R
|
|
||||||
a : T
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue