Go to the documentation of this file.
34 (type.
id()==ID_vector || type.
id()==ID_complex))
42 "bitvector representation of type needs to have at least one bit");
45 width % sub_width == 0,
46 "total bitvector width needs to be a multiple of the component bitvector "
51 for(std::size_t sub_idx = 0; sub_idx < width; sub_idx += sub_width)
55 const auto sub_it = std::next(op_bv.begin(), sub_idx);
56 std::copy_n(sub_it, sub_width, std::back_inserter(tmp_op));
58 if(subtype.
id() == ID_floatbv)
61 tmp_op = float_utils.
negate(tmp_op);
67 tmp_op.size() == sub_width,
68 "bitvector after negation shall have same bit width");
70 std::copy(tmp_op.begin(), tmp_op.end(), std::back_inserter(bv));
82 return float_utils.
negate(op_bv);
The type of an expression, extends irept.
std::vector< literalt > bvt
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a typet to a floatbv_typet.
const type_with_subtypet & to_type_with_subtype(const typet &type)
bvtypet get_bvtype(const typet &type)
Base class for all expressions.
typet & type()
Return the type of the expression.
virtual std::size_t boolbv_width(const typet &type) const
virtual const bvt & convert_bv(const exprt &expr, const optionalt< std::size_t > expected_width={})
Convert expression to vector of literalts, using an internal cache to speed up conversion if availabl...
The unary minus expression.
const irep_idt & id() const
bvt negate(const bvt &op)
const typet & subtype() const
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.