perf(library/type_inferer): improve is_proposition performance

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-12-10 16:18:45 -08:00
parent b270fb0030
commit 1fb526a3d4

View file

@ -240,6 +240,12 @@ public:
}
bool is_proposition(expr const & e, context const & ctx, metavar_env * menv) {
// Catch easy cases
switch (e.kind()) {
case expr_kind::Lambda: case expr_kind::Pi: case expr_kind::Type: return false;
case expr_kind::Eq: return true;
default: break;
}
expr t = operator()(e, ctx, menv, nullptr);
if (is_bool(t))
return true;