@@ -21,14 +21,13 @@ bvt boolbvt::convert_add_sub(const exprt &expr)
2121
2222 const typet &type = expr.type ();
2323
24- if (type.id ()!=ID_unsignedbv &&
25- type.id ()!=ID_signedbv &&
26- type.id ()!=ID_fixedbv &&
27- type.id ()!=ID_floatbv &&
28- type.id ()!=ID_range &&
29- type.id ()!=ID_complex &&
30- type.id ()!=ID_vector)
24+ if (
25+ type.id () != ID_unsignedbv && type.id () != ID_signedbv &&
26+ type.id () != ID_fixedbv && type.id () != ID_floatbv &&
27+ type.id () != ID_range && type.id () != ID_complex)
28+ {
3129 return conversion_failed (expr);
30+ }
3231
3332 std::size_t width=boolbv_width (type);
3433
@@ -50,9 +49,8 @@ bvt boolbvt::convert_add_sub(const exprt &expr)
5049 bool no_overflow=(expr.id ()==" no-overflow-plus" ||
5150 expr.id ()==" no-overflow-minus" );
5251
53- typet arithmetic_type = (type.id () == ID_vector || type.id () == ID_complex)
54- ? to_type_with_subtype (type).subtype ()
55- : type;
52+ typet arithmetic_type =
53+ type.id () == ID_complex ? to_type_with_subtype (type).subtype () : type;
5654
5755 bv_utilst::representationt rep=
5856 (arithmetic_type.id ()==ID_signedbv ||
@@ -68,15 +66,16 @@ bvt boolbvt::convert_add_sub(const exprt &expr)
6866
6967 const bvt &op = convert_bv (*it, width);
7068
71- if (type.id ()==ID_vector || type. id ()== ID_complex)
69+ if (type.id () == ID_complex)
7270 {
7371 std::size_t sub_width =
7472 boolbv_width (to_type_with_subtype (type).subtype ());
7573
76- INVARIANT (sub_width != 0 , " vector elements shall have nonzero bit width" );
74+ INVARIANT (
75+ sub_width != 0 , " complex elements shall have nonzero bit width" );
7776 INVARIANT (
7877 width % sub_width == 0 ,
79- " total vector bit width shall be a multiple of the element bit width" );
78+ " total complex bit width shall be a multiple of the element bit width" );
8079
8180 std::size_t size=width/sub_width;
8281 bv.resize (width);
@@ -149,8 +148,7 @@ bvt boolbvt::convert_saturating_add_sub(const binary_exprt &expr)
149148
150149 if (
151150 type.id () != ID_unsignedbv && type.id () != ID_signedbv &&
152- type.id () != ID_fixedbv && type.id () != ID_complex &&
153- type.id () != ID_vector)
151+ type.id () != ID_fixedbv && type.id () != ID_complex)
154152 {
155153 return conversion_failed (expr);
156154 }
@@ -163,9 +161,8 @@ bvt boolbvt::convert_saturating_add_sub(const binary_exprt &expr)
163161
164162 const bool subtract = expr.id () == ID_saturating_minus;
165163
166- typet arithmetic_type = (type.id () == ID_vector || type.id () == ID_complex)
167- ? to_type_with_subtype (type).subtype ()
168- : type;
164+ typet arithmetic_type =
165+ type.id () == ID_complex ? to_type_with_subtype (type).subtype () : type;
169166
170167 bv_utilst::representationt rep =
171168 (arithmetic_type.id () == ID_signedbv || arithmetic_type.id () == ID_fixedbv)
@@ -175,15 +172,15 @@ bvt boolbvt::convert_saturating_add_sub(const binary_exprt &expr)
175172 bvt bv = convert_bv (expr.lhs (), width);
176173 const bvt &op = convert_bv (expr.rhs (), width);
177174
178- if (type.id () != ID_vector && type. id () != ID_complex)
175+ if (type.id () != ID_complex)
179176 return bv_utils.saturating_add_sub (bv, op, subtract, rep);
180177
181178 std::size_t sub_width = boolbv_width (to_type_with_subtype (type).subtype ());
182179
183- INVARIANT (sub_width != 0 , " vector elements shall have nonzero bit width" );
180+ INVARIANT (sub_width != 0 , " complex elements shall have nonzero bit width" );
184181 INVARIANT (
185182 width % sub_width == 0 ,
186- " total vector bit width shall be a multiple of the element bit width" );
183+ " total complex bit width shall be a multiple of the element bit width" );
187184
188185 std::size_t size = width / sub_width;
189186
0 commit comments