@@ -21,14 +21,13 @@ bvt boolbvt::convert_add_sub(const exprt &expr)
21
21
22
22
const typet &type = expr.type ();
23
23
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
+ {
31
29
return conversion_failed (expr);
30
+ }
32
31
33
32
std::size_t width=boolbv_width (type);
34
33
@@ -50,9 +49,8 @@ bvt boolbvt::convert_add_sub(const exprt &expr)
50
49
bool no_overflow=(expr.id ()==" no-overflow-plus" ||
51
50
expr.id ()==" no-overflow-minus" );
52
51
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;
56
54
57
55
bv_utilst::representationt rep=
58
56
(arithmetic_type.id ()==ID_signedbv ||
@@ -68,15 +66,16 @@ bvt boolbvt::convert_add_sub(const exprt &expr)
68
66
69
67
const bvt &op = convert_bv (*it, width);
70
68
71
- if (type.id ()==ID_vector || type. id ()== ID_complex)
69
+ if (type.id () == ID_complex)
72
70
{
73
71
std::size_t sub_width =
74
72
boolbv_width (to_type_with_subtype (type).subtype ());
75
73
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" );
77
76
INVARIANT (
78
77
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" );
80
79
81
80
std::size_t size=width/sub_width;
82
81
bv.resize (width);
@@ -149,8 +148,7 @@ bvt boolbvt::convert_saturating_add_sub(const binary_exprt &expr)
149
148
150
149
if (
151
150
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)
154
152
{
155
153
return conversion_failed (expr);
156
154
}
@@ -163,9 +161,8 @@ bvt boolbvt::convert_saturating_add_sub(const binary_exprt &expr)
163
161
164
162
const bool subtract = expr.id () == ID_saturating_minus;
165
163
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;
169
166
170
167
bv_utilst::representationt rep =
171
168
(arithmetic_type.id () == ID_signedbv || arithmetic_type.id () == ID_fixedbv)
@@ -175,15 +172,15 @@ bvt boolbvt::convert_saturating_add_sub(const binary_exprt &expr)
175
172
bvt bv = convert_bv (expr.lhs (), width);
176
173
const bvt &op = convert_bv (expr.rhs (), width);
177
174
178
- if (type.id () != ID_vector && type. id () != ID_complex)
175
+ if (type.id () != ID_complex)
179
176
return bv_utils.saturating_add_sub (bv, op, subtract, rep);
180
177
181
178
std::size_t sub_width = boolbv_width (to_type_with_subtype (type).subtype ());
182
179
183
- INVARIANT (sub_width != 0 , " vector elements shall have nonzero bit width" );
180
+ INVARIANT (sub_width != 0 , " complex elements shall have nonzero bit width" );
184
181
INVARIANT (
185
182
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" );
187
184
188
185
std::size_t size = width / sub_width;
189
186
0 commit comments