Skip to content

Commit d4abbea

Browse files
author
Daniel Kroening
committed
smt2 implementation for popcount_exprt
1 parent e8fa1c9 commit d4abbea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/solvers/smt2/smt2_conv.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ Author: Daniel Kroening, [email protected]
2929
#include <util/string_constant.h>
3030

3131
#include <solvers/flattening/boolbv_width.h>
32-
#include <solvers/flattening/flatten_byte_operators.h>
3332
#include <solvers/flattening/c_bit_field_replacement_type.h>
33+
#include <solvers/flattening/flatten_byte_operators.h>
3434
#include <solvers/floatbv/float_bv.h>
35+
#include <solvers/lowering/expr_lowering.h>
3536

3637
// Mark different kinds of error condition
3738
// General
@@ -1866,6 +1867,11 @@ void smt2_convt::convert_expr(const exprt &expr)
18661867

18671868
out << ')'; // let bswap_op
18681869
}
1870+
else if(expr.id() == ID_popcount)
1871+
{
1872+
exprt lowered = lower_popcount(to_popcount_expr(expr), ns);
1873+
convert_expr(lowered);
1874+
}
18691875
else
18701876
UNEXPECTEDCASE(
18711877
"smt2_convt::convert_expr: `"+expr.id_string()+"' is unsupported");

0 commit comments

Comments
 (0)