feat(library/elaborator): add extra occurs-check test

The idea is to catch the inconsistency in constraints such as:

    ctx |- ?m[inst:0 v] == fun x, ?m a x

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-12-14 19:47:27 -08:00
parent 160a8379ef
commit bdbf85405a

View file

@ -428,6 +428,10 @@ class elaborator::imp {
return assign(a, b, c, is_lhs) ? Processed : Failed;
}
} else {
if (!is_metavar(b) && has_metavar(b, a)) {
m_conflict = justification(new unification_failure_justification(c));
return Failed;
}
local_entry const & me = head(metavar_lctx(a));
if (me.is_lift()) {
if (!has_free_var(b, me.s(), me.s() + me.n(), m_state.m_menv)) {