diff --git a/src/util/expr.cpp b/src/util/expr.cpp index 7f77a06457c..b317b434e41 100644 --- a/src/util/expr.cpp +++ b/src/util/expr.cpp @@ -245,18 +245,9 @@ Function: exprt::is_true bool exprt::is_true() const { - if(is_constant()) - { - if(type().id()==ID_bool) - return get(ID_value)!=ID_false; - else if(type().id()==ID_c_bool) - { - mp_integer i; - to_integer(*this, i); - return i!=mp_integer(0); - } - } - return false; + return is_constant() && + type().id()==ID_bool && + get(ID_value)!=ID_false; } /*******************************************************************\ @@ -273,14 +264,9 @@ Function: exprt::is_false bool exprt::is_false() const { - if(is_constant()) - { - if(type().id()==ID_bool) - return get(ID_value)==ID_false; - else if(type().id()==ID_c_bool) - return !is_true(); - } - return false; + return is_constant() && + type().id()==ID_bool && + get(ID_value)==ID_false; } /*******************************************************************\