41 "bitvector representation of type needs to have at least one bit");
44 width % sub_width == 0,
45 "total bitvector width needs to be a multiple of the component bitvector "
50 for(std::size_t sub_idx = 0; sub_idx < width; sub_idx += sub_width)
54 const auto sub_it = std::next(op_bv.begin(), sub_idx);
55 std::copy_n(sub_it, sub_width, std::back_inserter(tmp_op));
57 if(subtype.
id() == ID_floatbv)
60 tmp_op = float_utils.
negate(tmp_op);
66 tmp_op.size() == sub_width,
67 "bitvector after negation shall have same bit width");
69 std::copy(tmp_op.begin(), tmp_op.end(), std::back_inserter(bv));
81 return float_utils.
negate(op_bv);
Pre-defined bitvector types.
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a typet to a floatbv_typet.
bvtypet get_bvtype(const typet &type)
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...
virtual bvt convert_unary_minus(const unary_minus_exprt &expr)
bvt conversion_failed(const exprt &expr)
Print that the expression of x has failed conversion, then return a vector of x's width.
virtual std::size_t boolbv_width(const typet &type) const
bvt negate(const bvt &op)
Base class for all expressions.
typet & type()
Return the type of the expression.
const irep_idt & id() const
const typet & subtype() const
The type of an expression, extends irept.
The unary minus expression.
std::vector< literalt > bvt
const type_with_subtypet & to_type_with_subtype(const typet &type)