Skip to content

Commit baa45f1

Browse files
committed
Remove "no-overflow-mult" expression
1 parent d6017bd commit baa45f1

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

src/solvers/flattening/boolbv.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,8 @@ bvt boolbvt::convert_bitvector(const exprt &expr)
224224
expr.id()=="no-overflow-plus" ||
225225
expr.id()=="no-overflow-minus")
226226
return convert_add_sub(expr);
227-
else if(expr.id()==ID_mult ||
228-
expr.id()=="no-overflow-mult")
229-
return convert_mult(expr);
227+
else if(expr.id() == ID_mult)
228+
return convert_mult(to_mult_expr(expr));
230229
else if(expr.id()==ID_div)
231230
return convert_div(to_div_expr(expr));
232231
else if(expr.id()==ID_mod)

src/solvers/flattening/boolbv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class boolbvt:public arrayst
152152
virtual bvt convert_union(const union_exprt &expr);
153153
virtual bvt convert_bv_typecast(const typecast_exprt &expr);
154154
virtual bvt convert_add_sub(const exprt &expr);
155-
virtual bvt convert_mult(const exprt &expr);
155+
virtual bvt convert_mult(const mult_exprt &expr);
156156
virtual bvt convert_div(const div_exprt &expr);
157157
virtual bvt convert_mod(const mod_exprt &expr);
158158
virtual bvt convert_floatbv_op(const exprt &expr);

src/solvers/flattening/boolbv_mult.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ Author: Daniel Kroening, [email protected]
1010

1111
#include <util/std_types.h>
1212

13-
bvt boolbvt::convert_mult(const exprt &expr)
13+
bvt boolbvt::convert_mult(const mult_exprt &expr)
1414
{
15-
PRECONDITION(expr.id() == ID_mult || expr.id() == "no-overflow-mult");
16-
1715
std::size_t width=boolbv_width(expr.type());
1816

1917
if(width==0)
@@ -27,8 +25,6 @@ bvt boolbvt::convert_mult(const exprt &expr)
2725

2826
const exprt &op0=expr.op0();
2927

30-
bool no_overflow=expr.id()=="no-overflow-mult";
31-
3228
DATA_INVARIANT(
3329
op0.type() == expr.type(),
3430
"multiplication operands should have same type as expression");
@@ -80,10 +76,7 @@ bvt boolbvt::convert_mult(const exprt &expr)
8076

8177
const bvt &op = convert_bv(*it, width);
8278

83-
if(no_overflow)
84-
bv=bv_utils.multiplier_no_overflow(bv, op, rep);
85-
else
86-
bv=bv_utils.multiplier(bv, op, rep);
79+
bv = bv_utils.multiplier(bv, op, rep);
8780
}
8881

8982
return bv;

src/solvers/refinement/bv_refinement.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class bv_refinementt:public bv_pointerst
5151
void post_process_arrays() override;
5252

5353
// Refine arithmetic
54-
bvt convert_mult(const exprt &expr) override;
54+
bvt convert_mult(const mult_exprt &expr) override;
5555
bvt convert_div(const div_exprt &expr) override;
5656
bvt convert_mod(const mod_exprt &expr) override;
5757
bvt convert_floatbv_op(const exprt &expr) override;

src/solvers/refinement/refine_arithmetic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ bvt bv_refinementt::convert_floatbv_op(const exprt &expr)
5050
return bv;
5151
}
5252

53-
bvt bv_refinementt::convert_mult(const exprt &expr)
53+
bvt bv_refinementt::convert_mult(const mult_exprt &expr)
5454
{
5555
if(!config_.refine_arithmetic || expr.type().id()==ID_fixedbv)
5656
return SUB::convert_mult(expr);
@@ -65,7 +65,7 @@ bvt bv_refinementt::convert_mult(const exprt &expr)
6565
PRECONDITION(operands.size()>=2);
6666

6767
if(operands.size()>2)
68-
return convert_mult(make_binary(expr)); // make binary
68+
return convert_mult(to_mult_expr(make_binary(expr))); // make binary
6969

7070
// we keep multiplication by a constant for integers
7171
if(type.id()!=ID_floatbv)

0 commit comments

Comments
 (0)