fix(library/unifier): in the context_check, we should not consider local constants that occur in the type of other constants

This was a performance bug.
We were missing higher-order pattern constraints due to this bug.
This commit is contained in:
Leonardo de Moura 2015-03-02 17:28:56 -08:00
parent 1042bbc06f
commit 7e2f0f9a36

View file

@ -118,9 +118,10 @@ bool context_check(expr const & e, buffer<expr> const & locals) {
for_each(e, [&](expr const & e, unsigned) {
if (failed)
return false;
if (is_local(e) && !contains_local(e, locals)) {
failed = true;
return false;
if (is_local(e)) {
if (!contains_local(e, locals))
failed = true;
return false; // do not visit type
}
if (is_metavar(e))
return false; // do not visit type