22 expr.
operands().size() == components.size(),
23 "number of operands of a struct expression shall equal the number of"
24 "components as indicated by its type",
30 std::size_t bit_idx = 0;
32 exprt::operandst::const_iterator op_it=expr.
operands().begin();
33 for(
const auto &comp : components)
35 const typet &subtype=comp.type();
36 const exprt &op=*op_it;
40 "type of a struct expression operand shall equal the type of the "
41 "corresponding struct component",
53 bit_idx + op_bv.size() <= width,
"bit index shall be within bounds");
55 for(
const auto &bit : op_bv)
66 bit_idx == width,
"all bits in the bitvector shall have been assigned");
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 std::size_t boolbv_width(const typet &type) const
virtual bvt convert_struct(const struct_exprt &expr)
Base class for all expressions.
const source_locationt & find_source_location() const
Get a source_locationt from the expression or from its operands (non-recursively).
typet & type()
Return the type of the expression.
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
Struct constructor from list of elements.
Structure type, corresponds to C style structs.
const componentst & components() const
std::vector< componentt > componentst
The type of an expression, extends irept.
std::vector< literalt > bvt
#define DATA_INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.