File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,7 @@ static exprt simplify_json_expr(const exprt &src)
5151 // simplify expressions of the form &member(object, @class_identifier)
5252 return simplify_json_expr (object);
5353 }
54- else if (
55- object.id () == ID_index && to_index_expr (object).index ().is_constant () &&
56- to_constant_expr (to_index_expr (object).index ()).value_is_zero_string ())
54+ else if (object.id () == ID_index && to_index_expr (object).index () == 0 )
5755 {
5856 // simplify expressions of the form &array[0]
5957 return simplify_json_expr (to_index_expr (object).array ());
Original file line number Diff line number Diff line change @@ -782,7 +782,7 @@ simplify_exprt::simplify_bitwise(const multi_ary_exprt &expr)
782782 }
783783 else if (
784784 it->is_constant () && it->type ().id () == ID_bv &&
785- to_constant_expr ( *it). value_is_zero_string () &&
785+ *it == to_bv_type (it-> type ()). all_zeros_expr () &&
786786 new_expr.operands ().size () > 1 )
787787 {
788788 it = new_expr.operands ().erase (it);
Original file line number Diff line number Diff line change @@ -3133,8 +3133,6 @@ class constant_exprt : public nullary_exprt
31333133 set (ID_value, value);
31343134 }
31353135
3136- bool value_is_zero_string () const ;
3137-
31383136 // / Returns true if \p expr has a pointer type and a value NULL; it also
31393137 // / returns true when \p expr has value zero and NULL_is_zero is true; returns
31403138 // / false in all other cases.
@@ -3166,6 +3164,9 @@ class constant_exprt : public nullary_exprt
31663164 {
31673165 check (expr, vm);
31683166 }
3167+
3168+ protected:
3169+ bool value_is_zero_string () const ;
31693170};
31703171
31713172template <>
Original file line number Diff line number Diff line change @@ -173,8 +173,7 @@ SCENARIO(
173173 const symbol_exprt object_symbol =
174174 to_symbol_expr (object_descriptor->object ());
175175 REQUIRE (object_symbol.get_identifier () == " int_value!0" );
176- REQUIRE (to_constant_expr (object_descriptor->offset ())
177- .value_is_zero_string ());
176+ REQUIRE (object_descriptor->offset () == 0 );
178177 }
179178 THEN (" The target equations are unchanged" )
180179 {
You can’t perform that action at this time.
0 commit comments