cprover
Loading...
Searching...
No Matches
boolbv_popcount.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module:
4
5
Author: Michael Tautschnig
6
7
\*******************************************************************/
8
9
#include <
util/bitvector_expr.h
>
10
11
#include "
boolbv.h
"
12
13
bvt
boolbvt::convert_popcount
(
const
popcount_exprt
&expr)
14
{
15
const
std::size_t width =
boolbv_width
(expr.
type
());
16
17
bvt
op =
convert_bv
(expr.
op
());
18
19
return
bv_utils
.zero_extension(
bv_utils
.popcount(op), width);
20
}
bitvector_expr.h
API to expression classes for bitvectors.
boolbv.h
boolbvt::convert_bv
virtual const bvt & convert_bv(const exprt &expr, const std::optional< std::size_t > expected_width={})
Convert expression to vector of literalts, using an internal cache to speed up conversion if availabl...
Definition
boolbv.cpp:39
boolbvt::convert_popcount
virtual bvt convert_popcount(const popcount_exprt &expr)
Definition
boolbv_popcount.cpp:13
boolbvt::bv_utils
bv_utilst bv_utils
Definition
boolbv.h:119
boolbvt::boolbv_width
virtual std::size_t boolbv_width(const typet &type) const
Definition
boolbv.h:104
exprt::type
typet & type()
Return the type of the expression.
Definition
expr.h:85
popcount_exprt
The popcount (counting the number of bits set to 1) expression.
Definition
bitvector_expr.h:959
unary_exprt::op
const exprt & op() const
Definition
std_expr.h:391
bvt
std::vector< literalt > bvt
Definition
literal.h:201
solvers
flattening
boolbv_popcount.cpp
Generated by
1.15.0