fix(library/unifier): simple bug
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
4af474010a
commit
1e40525a0c
1 changed files with 2 additions and 3 deletions
|
@ -1055,8 +1055,7 @@ struct unifier_fn {
|
||||||
Given,
|
Given,
|
||||||
m := a metavariable ?m
|
m := a metavariable ?m
|
||||||
margs := [a_1 ... a_k]
|
margs := [a_1 ... a_k]
|
||||||
We say a unification problem (?m a_1 ... a_k) =?= rhs uses "simple projections" IF
|
We say a unification problem (?m a_1 ... a_k) =?= rhs uses "simple projections" when
|
||||||
rhs is NOT an application.
|
|
||||||
|
|
||||||
If (rhs and a_i are *not* local constants) OR (rhs is a local constant and a_i is a metavariable application),
|
If (rhs and a_i are *not* local constants) OR (rhs is a local constant and a_i is a metavariable application),
|
||||||
then we add the constraints
|
then we add the constraints
|
||||||
|
@ -1073,7 +1072,6 @@ struct unifier_fn {
|
||||||
buffer<constraints> & alts) {
|
buffer<constraints> & alts) {
|
||||||
lean_assert(is_metavar(m));
|
lean_assert(is_metavar(m));
|
||||||
lean_assert(!is_meta(rhs));
|
lean_assert(!is_meta(rhs));
|
||||||
lean_assert(!is_app(rhs));
|
|
||||||
expr const & mtype = mlocal_type(m);
|
expr const & mtype = mlocal_type(m);
|
||||||
unsigned i = margs.size();
|
unsigned i = margs.size();
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
|
@ -1133,6 +1131,7 @@ struct unifier_fn {
|
||||||
alts.push_back(mk_flex_rigid_app_cnstrs(m, margs, mk_var(vidx), rhs, j));
|
alts.push_back(mk_flex_rigid_app_cnstrs(m, margs, mk_var(vidx), rhs, j));
|
||||||
}
|
}
|
||||||
} else if (is_constant(f)) {
|
} else if (is_constant(f)) {
|
||||||
|
add_simple_projections(m, margs, rhs, j, alts);
|
||||||
alts.push_back(mk_flex_rigid_app_cnstrs(m, margs, f, rhs, j));
|
alts.push_back(mk_flex_rigid_app_cnstrs(m, margs, f, rhs, j));
|
||||||
} else {
|
} else {
|
||||||
lean_unreachable(); // LCOV_EXCL_LINE
|
lean_unreachable(); // LCOV_EXCL_LINE
|
||||||
|
|
Loading…
Reference in a new issue