Skip to content

Commit ddb0cac

Browse files
committed
Remove unused make_free_bv_expr
This was previously used for encoding `waitfor`, but this is no longer supported in this code base. With the removal of make_free_bv_expr, make_bv_expr became unnecessary, and thereby expressions with id ID_bv_literals can no longer be generated.
1 parent 1cfc93f commit ddb0cac

File tree

3 files changed

+0
-46
lines changed

3 files changed

+0
-46
lines changed

src/solvers/flattening/boolbv.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ bvt boolbvt::convert_bitvector(const exprt &expr)
121121
return convert_bv_typecast(to_typecast_expr(expr));
122122
else if(expr.id()==ID_symbol)
123123
return convert_symbol(to_symbol_expr(expr));
124-
else if(expr.id()==ID_bv_literals)
125-
return convert_bv_literals(expr);
126124
else if(expr.id()==ID_plus || expr.id()==ID_minus ||
127125
expr.id()=="no-overflow-plus" ||
128126
expr.id()=="no-overflow-minus")
@@ -275,27 +273,6 @@ bvt boolbvt::convert_array_comprehension(const array_comprehension_exprt &expr)
275273
return bv;
276274
}
277275

278-
bvt boolbvt::convert_bv_literals(const exprt &expr)
279-
{
280-
std::size_t width=boolbv_width(expr.type());
281-
282-
if(width==0)
283-
return conversion_failed(expr);
284-
285-
bvt bv;
286-
bv.resize(width);
287-
288-
const irept::subt &bv_sub=expr.find(ID_bv).get_sub();
289-
290-
if(bv_sub.size()!=width)
291-
throw "bv_literals with wrong size";
292-
293-
for(std::size_t i=0; i<width; i++)
294-
bv[i].set(unsafe_string2unsigned(id2string(bv_sub[i].id())));
295-
296-
return bv;
297-
}
298-
299276
bvt boolbvt::convert_symbol(const exprt &expr)
300277
{
301278
const typet &type=expr.type();
@@ -530,25 +507,6 @@ void boolbvt::set_to(const exprt &expr, bool value)
530507
SUB::set_to(expr, value);
531508
}
532509

533-
exprt boolbvt::make_bv_expr(const typet &type, const bvt &bv)
534-
{
535-
exprt dest(ID_bv_literals, type);
536-
irept::subt &bv_sub=dest.add(ID_bv).get_sub();
537-
bv_sub.resize(bv.size());
538-
539-
for(std::size_t i=0; i<bv.size(); i++)
540-
bv_sub[i].id(std::to_string(bv[i].get()));
541-
return dest;
542-
}
543-
544-
exprt boolbvt::make_free_bv_expr(const typet &type)
545-
{
546-
const std::size_t width = boolbv_width(type);
547-
PRECONDITION(width != 0);
548-
bvt bv = prop.new_variables(width);
549-
return make_bv_expr(type, bv);
550-
}
551-
552510
bool boolbvt::is_unbounded_array(const typet &type) const
553511
{
554512
if(type.id()!=ID_array)

src/solvers/flattening/boolbv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ class boolbvt:public arrayst
199199
virtual bvt convert_bitreverse(const bitreverse_exprt &expr);
200200
virtual bvt convert_saturating_add_sub(const binary_exprt &expr);
201201

202-
virtual exprt make_bv_expr(const typet &type, const bvt &bv);
203-
virtual exprt make_free_bv_expr(const typet &type);
204-
205202
void convert_with(
206203
const typet &type,
207204
const exprt &op1,

src/util/irep_ids.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ IREP_ID_ONE(KnR)
301301
IREP_ID_TWO(C_KnR, #KnR)
302302
IREP_ID_ONE(constraint_select_one)
303303
IREP_ID_ONE(cond)
304-
IREP_ID_ONE(bv_literals)
305304
IREP_ID_ONE(isfinite)
306305
IREP_ID_ONE(isinf)
307306
IREP_ID_ONE(isnormal)

0 commit comments

Comments
 (0)