18 const std::size_t _distance)
33 const std::size_t _index,
42 const std::size_t _index,
47 std::move(_new_value))
82 const auto new_value_width =
88 return index >= new_value_width;
125 const std::size_t new_width = numeric_cast_v<std::size_t>(
power(2, bits));
127 const bool need_typecast =
128 new_width > x_width || x.
type().
id() != ID_unsignedbv;
134 for(std::size_t shift = 1; shift < new_width; shift <<= 1)
141 std::string bitstring;
142 bitstring.reserve(new_width);
143 for(std::size_t i = 0; i < new_width / (2 * shift); ++i)
144 bitstring += std::string(shift,
'0') + std::string(shift,
'1');
169 const std::size_t new_width = numeric_cast_v<std::size_t>(
power(2, bits));
171 const bool need_typecast =
172 new_width > x_width || x.
type().
id() != ID_unsignedbv;
178 for(std::size_t shift = 1; shift < new_width; shift <<= 1)
211 result_bits.reserve(int_width);
214 for(std::size_t i = 0; i < int_width; ++i)
223 if(
lhs().
type().
id() == ID_unsignedbv)
226 if(
rhs().
type().
id() == ID_unsignedbv)
229 std::size_t ssize = std::max(lhs_ssize, rhs_ssize) + 1;
242 if(
lhs().
type().
id() == ID_unsignedbv)
245 if(
rhs().
type().
id() == ID_unsignedbv)
248 std::size_t ssize = std::max(lhs_ssize, rhs_ssize) + 1;
261 if(
lhs().
type().
id() == ID_unsignedbv)
264 if(
rhs().
type().
id() == ID_unsignedbv)
267 std::size_t ssize = lhs_ssize + rhs_ssize;
299 if(new_width > old_width)
315 more_than_one_seen_disjuncts.reserve(width);
317 for(std::size_t i = 0; i < width; i++)
320 more_than_one_seen_disjuncts.push_back(
and_exprt{bit, one_seen});
324 auto more_than_one_seen =
disjunction(more_than_one_seen_disjuncts);
static exprt onehot_lowering(const exprt &expr)
API to expression classes for bitvectors.
Pre-defined bitvector types.
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a typet to a bitvector_typet.
A base class for binary expressions.
A base class for expressions that are predicates, i.e., Boolean-typed, and that take exactly two argu...
Bit-wise negation of bit-vectors.
exprt lower() const
Lower a bitreverse_exprt to arithmetic and logic expressions.
std::size_t get_width() const
Fixed-width bit-vector without numerical interpretation.
constant_exprt all_zeros_expr() const
Concatenation of bit-vector operands.
A constant literal expression.
The count leading zeros (counting the number of zero bits starting from the most-significant bit) exp...
exprt lower() const
Lower a count_leading_zeros_exprt to arithmetic and logic expressions.
exprt lower() const
Lower a count_trailing_zeros_exprt to arithmetic and logic expressions.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
Base class for all expressions.
std::vector< exprt > operandst
typet & type()
Return the type of the expression.
void add_to_operands(const exprt &expr)
Add the given argument to the end of exprt's operands.
The Boolean constant false.
exprt lower() const
Lower a find_first_set_exprt to arithmetic and logic expressions.
Unbounded, signed integers (mathematical integers, not bitvectors)
const irep_idt & id() const
exprt lower() const
Lower a minus_overflow_exprt to arithmetic and logic expressions.
Binary multiplication Associativity is not specified.
exprt lower() const
Lower a mult_overflow_exprt to arithmetic and logic expressions.
exprt lower() const
lowering to extractbit
exprt lower() const
lowering to extractbit
The plus expression Associativity is not specified.
exprt lower() const
Lower a plus_overflow_exprt to arithmetic and logic expressions.
The popcount (counting the number of bits set to 1) expression.
exprt lower() const
Lower a popcount_exprt to arithmetic and logic expressions.
shift_exprt(exprt _src, const irep_idt &_id, exprt _distance)
Fixed-width bit-vector with two's complement interpretation.
Expression to hold a symbol (variable)
Semantic type conversion.
static exprt conditional_cast(const exprt &expr, const typet &type)
The type of an expression, extends irept.
Fixed-width bit-vector with unsigned binary interpretation.
Replaces a sub-range of a bit-vector operand.
update_bit_exprt(exprt _src, exprt _index, exprt _new_value)
Replaces the bit [_index] from _src to produce a result of the same type as _src.
exprt lower() const
A lowering to masking, shifting, or.
exprt lower() const
A lowering to masking, shifting, or.
zero extension The operand is converted to the given type by either a) truncating if the new type is ...
const mp_integer binary2integer(const std::string &n, bool is_signed)
convert binary string representation to mp_integer
#define CHECK_RETURN(CONDITION)
exprt disjunction(const exprt::operandst &op)
1) generates a disjunction for two or more operands 2) for one operand, returns the operand 3) return...