Go to the documentation of this file.
33 expr.
id() == ID_byte_update_little_endian ||
34 expr.
id() == ID_byte_update_big_endian);
35 const bool little_endian = expr.
id() == ID_byte_update_little_endian;
40 std::size_t update_width=value_bv.size();
41 std::size_t byte_width=8;
43 if(update_width>bv.size())
44 update_width=bv.size();
48 const auto index = numeric_cast<mp_integer>(offset_expr);
54 if(offset+update_width>
mp_integer(bv.size()) || offset<0)
63 const std::size_t offset_i = numeric_cast_v<std::size_t>(offset);
65 for(std::size_t i = 0; i < update_width; i++)
67 size_t index_op = map_op.
map_bit(offset_i + i);
68 size_t index_value = map_value.
map_bit(i);
71 index_op < bv.size(),
"bit vector index shall be within bounds");
73 index_value < value_bv.size(),
74 "bit vector index shall be within bounds");
76 bv[index_op] = value_bv[index_value];
84 for(std::size_t offset=0; offset<bv.size(); offset+=byte_width)
94 for(std::size_t bit=0; bit<update_width; bit++)
95 if(offset+bit<bv.size())
97 std::size_t bv_o=map_op.
map_bit(offset+bit);
98 std::size_t value_bv_o=map_value.
map_bit(bit);
100 bv[bv_o]=
prop.
lselect(equal, value_bv[value_bv_o], bv[bv_o]);
virtual bvt convert_byte_update(const byte_update_exprt &expr)
Expression corresponding to op() where the bytes starting at position offset (given in number of byte...
bool is_unbounded_array(const typet &type) const override
std::vector< literalt > bvt
const exprt & offset() const
static exprt lower_byte_update(const byte_update_exprt &src, const exprt &value_as_byte_array, const optionalt< exprt > &non_const_update_bound, const namespacet &ns)
Apply a byte update src using the byte array value_as_byte_array as update value.
Base class for all expressions.
typet & type()
Return the type of the expression.
Expression classes for byte-level operators.
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...
#define PRECONDITION(CONDITION)
size_t map_bit(size_t bit) const
const irep_idt & id() const
literalt convert(const exprt &expr) override
Convert a Boolean expression and return the corresponding literal.
const exprt & value() const
Maps a big-endian offset to a little-endian offset.
virtual endianness_mapt endianness_map(const typet &type, bool little_endian) const
virtual literalt lselect(literalt a, literalt b, literalt c)=0
virtual literalt equality(const exprt &e1, const exprt &e2)