21 DATA_INVARIANT(!operands.empty(),
"multiplication must have operands");
27 "multiplication operands should have same type as expression");
29 if(expr.
type().
id()==ID_fixedbv)
33 std::size_t fraction_bits=
36 for(exprt::operandst::const_iterator it=operands.begin()+1;
37 it!=operands.end(); it++)
40 it->type() == expr.
type(),
41 "multiplication operands should have same type as expression");
53 bv.erase(bv.begin(), bv.begin()+fraction_bits);
58 else if(expr.
type().
id()==ID_unsignedbv ||
59 expr.
type().
id()==ID_signedbv)
67 for(exprt::operandst::const_iterator it=operands.begin()+1;
68 it!=operands.end(); it++)
71 it->type() == expr.
type(),
72 "multiplication operands should have same type as expression");
Pre-defined bitvector types.
const fixedbv_typet & to_fixedbv_type(const typet &type)
Cast a typet to a fixedbv_typet.
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_mult(const mult_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 signed_multiplier(const bvt &op0, const bvt &op1)
bvt multiplier(const bvt &op0, const bvt &op1, representationt rep)
static bvt sign_extension(const bvt &bv, std::size_t new_size)
Base class for all expressions.
std::vector< exprt > operandst
typet & type()
Return the type of the expression.
std::size_t get_fraction_bits() const
const irep_idt & id() const
Binary multiplication Associativity is not specified.
std::vector< literalt > bvt
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...