@@ -35,11 +35,7 @@ exprt boolbvt::get(const exprt &expr) const
35
35
// the mapping
36
36
PRECONDITION (expr.type () == typet () || expr.type () == map_entry.type );
37
37
38
- std::vector<bool > unknown =
39
- std::vector<bool >(map_entry.literal_map .size (), false );
40
-
41
- return bv_get_rec (
42
- expr, map_entry.literal_map , unknown, 0 , map_entry.type );
38
+ return bv_get_rec (expr, map_entry.literal_map , 0 , map_entry.type );
43
39
}
44
40
}
45
41
@@ -49,30 +45,23 @@ exprt boolbvt::get(const exprt &expr) const
49
45
exprt boolbvt::bv_get_rec (
50
46
const exprt &expr,
51
47
const bvt &bv,
52
- const std::vector<bool > &unknown,
53
48
std::size_t offset,
54
49
const typet &type) const
55
50
{
56
51
std::size_t width=boolbv_width (type);
57
52
58
- assert (bv.size ()==unknown.size ());
59
53
assert (bv.size ()>=offset+width);
60
54
61
55
if (type.id ()==ID_bool)
62
56
{
63
- if (!unknown[offset])
57
+ // clang-format off
58
+ switch (prop.l_get (bv[offset]).get_value ())
64
59
{
65
- // clang-format off
66
- switch (prop.l_get (bv[offset]).get_value ())
67
- {
68
- case tvt::tv_enumt::TV_FALSE: return false_exprt ();
69
- case tvt::tv_enumt::TV_TRUE: return true_exprt ();
70
- case tvt::tv_enumt::TV_UNKNOWN: return false_exprt (); // default
71
- }
72
- // clang-format on
60
+ case tvt::tv_enumt::TV_FALSE: return false_exprt ();
61
+ case tvt::tv_enumt::TV_TRUE: return true_exprt ();
62
+ case tvt::tv_enumt::TV_UNKNOWN: return false_exprt (); // default
73
63
}
74
-
75
- return false_exprt{}; // default
64
+ // clang-format on
76
65
}
77
66
78
67
bvtypet bvtype=get_bvtype (type);
@@ -98,8 +87,7 @@ exprt boolbvt::bv_get_rec(
98
87
{
99
88
const index_exprt index {
100
89
expr, from_integer (new_offset / sub_width, index_type ())};
101
- op.push_back (
102
- bv_get_rec (index , bv, unknown, offset + new_offset, subtype));
90
+ op.push_back (bv_get_rec (index , bv, offset + new_offset, subtype));
103
91
}
104
92
105
93
exprt dest=exprt (ID_array, type);
@@ -113,15 +101,15 @@ exprt boolbvt::bv_get_rec(
113
101
}
114
102
else if (type.id ()==ID_struct_tag)
115
103
{
116
- exprt result = bv_get_rec (
117
- expr, bv, unknown , offset, ns.follow_tag (to_struct_tag_type (type)));
104
+ exprt result =
105
+ bv_get_rec ( expr, bv, offset, ns.follow_tag (to_struct_tag_type (type)));
118
106
result.type () = type;
119
107
return result;
120
108
}
121
109
else if (type.id ()==ID_union_tag)
122
110
{
123
- exprt result = bv_get_rec (
124
- expr, bv, unknown , offset, ns.follow_tag (to_union_tag_type (type)));
111
+ exprt result =
112
+ bv_get_rec ( expr, bv, offset, ns.follow_tag (to_union_tag_type (type)));
125
113
result.type () = type;
126
114
return result;
127
115
}
@@ -138,8 +126,7 @@ exprt boolbvt::bv_get_rec(
138
126
const typet &subtype = c.type ();
139
127
140
128
const member_exprt member{expr, c.get_name (), subtype};
141
- op.push_back (
142
- bv_get_rec (member, bv, unknown, offset + new_offset, subtype));
129
+ op.push_back (bv_get_rec (member, bv, offset + new_offset, subtype));
143
130
144
131
std::size_t sub_width = boolbv_width (subtype);
145
132
if (sub_width!=0 )
@@ -164,7 +151,7 @@ exprt boolbvt::bv_get_rec(
164
151
expr, components[component_nr].get_name (), subtype};
165
152
return union_exprt (
166
153
components[component_nr].get_name (),
167
- bv_get_rec (member, bv, unknown, offset, subtype),
154
+ bv_get_rec (member, bv, offset, subtype),
168
155
union_type);
169
156
}
170
157
else if (type.id ()==ID_vector)
@@ -182,7 +169,7 @@ exprt boolbvt::bv_get_rec(
182
169
{
183
170
const index_exprt index {expr, from_integer (i, index_type ())};
184
171
value.operands ().push_back (
185
- bv_get_rec (index , bv, unknown, i * sub_width, subtype));
172
+ bv_get_rec (index , bv, i * sub_width, subtype));
186
173
}
187
174
188
175
return std::move (value);
@@ -196,10 +183,8 @@ exprt boolbvt::bv_get_rec(
196
183
if (sub_width!=0 && width==sub_width*2 )
197
184
{
198
185
const complex_exprt value (
199
- bv_get_rec (
200
- complex_real_exprt{expr}, bv, unknown, 0 * sub_width, subtype),
201
- bv_get_rec (
202
- complex_imag_exprt{expr}, bv, unknown, 1 * sub_width, subtype),
186
+ bv_get_rec (complex_real_exprt{expr}, bv, 0 * sub_width, subtype),
187
+ bv_get_rec (complex_imag_exprt{expr}, bv, 1 * sub_width, subtype),
203
188
to_complex_type (type));
204
189
205
190
return value;
@@ -213,16 +198,14 @@ exprt boolbvt::bv_get_rec(
213
198
for (std::size_t bit_nr=offset; bit_nr<offset+width; bit_nr++)
214
199
{
215
200
char ch = ' 0' ;
216
- if (!unknown[bit_nr])
201
+ // clang-format off
202
+ switch (prop.l_get (bv[bit_nr]).get_value ())
217
203
{
218
- switch (prop.l_get (bv[bit_nr]).get_value ())
219
- {
220
- case tvt::tv_enumt::TV_FALSE: ch=' 0' ; break ;
221
- case tvt::tv_enumt::TV_TRUE: ch=' 1' ; break ;
222
- case tvt::tv_enumt::TV_UNKNOWN: ch=' 0' ; break ;
223
- default : UNREACHABLE;
224
- }
204
+ case tvt::tv_enumt::TV_FALSE: ch = ' 0' ; break ;
205
+ case tvt::tv_enumt::TV_TRUE: ch = ' 1' ; break ;
206
+ case tvt::tv_enumt::TV_UNKNOWN: ch = ' 0' ; break ;
225
207
}
208
+ // clang-format on
226
209
227
210
value=ch+value;
228
211
}
@@ -279,9 +262,7 @@ exprt boolbvt::bv_get_rec(
279
262
280
263
exprt boolbvt::bv_get (const bvt &bv, const typet &type) const
281
264
{
282
- std::vector<bool > unknown;
283
- unknown.resize (bv.size (), false );
284
- return bv_get_rec (nil_exprt{}, bv, unknown, 0 , type);
265
+ return bv_get_rec (nil_exprt{}, bv, 0 , type);
285
266
}
286
267
287
268
exprt boolbvt::bv_get_cache (const exprt &expr) const
0 commit comments