diff --git a/claripy/ast/bool.py b/claripy/ast/bool.py index 6d2aafbfc..65657865c 100644 --- a/claripy/ast/bool.py +++ b/claripy/ast/bool.py @@ -1,14 +1,13 @@ from __future__ import annotations import logging -from contextlib import suppress from functools import lru_cache from typing import TYPE_CHECKING, overload import claripy from claripy import operations from claripy.ast.base import ASTCacheKey, Base, _make_name -from claripy.errors import BackendError, ClaripyTypeError +from claripy.errors import ClaripyTypeError from .bits import Bits @@ -163,17 +162,17 @@ def If(cond, true_value, false_value): Bool.__ror__ = Or -def is_true(e, exact=None): # pylint:disable=unused-argument - with suppress(BackendError): - return claripy.backends.concrete.is_true(e) +def is_true(e): + if e is True or (isinstance(e, Base) and claripy.simplify(e) is true()): + return True log.debug("Unable to tell the truth-value of this expression") return False -def is_false(e, exact=None): # pylint:disable=unused-argument - with suppress(BackendError): - return claripy.backends.concrete.is_false(e) +def is_false(e): + if e is False or (isinstance(e, Base) and claripy.simplify(e) is false()): + return True log.debug("Unable to tell the truth-value of this expression") return False