perf(library/type_inferer): improve is_proposition performance
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
b270fb0030
commit
1fb526a3d4
1 changed files with 6 additions and 0 deletions
|
@ -240,6 +240,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_proposition(expr const & e, context const & ctx, metavar_env * menv) {
|
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);
|
expr t = operator()(e, ctx, menv, nullptr);
|
||||||
if (is_bool(t))
|
if (is_bool(t))
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue