22 const auto &index = expr.
index();
25 if(index.is_constant())
30 if(index_as_integer < 0 || index_as_integer >= src_bv.size())
33 return src_bv[numeric_cast_v<std::size_t>(index_as_integer)];
37 expr.
src().
type().
id() == ID_verilog_signedbv ||
38 expr.
src().
type().
id() == ID_verilog_unsignedbv)
41 "extractbit expression not implemented for verilog integers in "
49 if(src_bv_width == 0 || index_bv_width == 0)
52 std::size_t index_width =
56 const auto index_casted =
65 for(std::size_t i = 0; i < src_bv.size(); i++)
78 for(std::size_t i = 0; i < src_bv.size(); i++)
API to expression classes for bitvectors.
Pre-defined bitvector types.
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 literalt convert_extractbit(const extractbit_exprt &expr)
virtual std::size_t boolbv_width(const typet &type) const
virtual literalt equality(const exprt &e1, const exprt &e2)
typet & type()
Return the type of the expression.
const irep_idt & id() const
literalt convert(const exprt &expr) override
Convert a Boolean expression and return the corresponding literal.
virtual literalt convert_rest(const exprt &expr)
void l_set_to_true(literalt a)
virtual literalt limplies(literalt a, literalt b)=0
virtual literalt lselect(literalt a, literalt b, literalt c)=0
virtual literalt new_variable()=0
virtual literalt lequal(literalt a, literalt b)=0
virtual bool has_set_to() const
static exprt conditional_cast(const exprt &expr, const typet &type)
Fixed-width bit-vector with unsigned binary interpretation.
Thrown when we encounter an instruction, parameters to an instruction etc.
std::vector< literalt > bvt
API to expression classes.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.