34 exprt::operandst::const_iterator
next_it=it;
47 std::sort(operands.begin(), operands.end());
113 for(
unsigned i=0; !
saj_entry.type_ids[i].empty(); i++)
150 for(
const auto &op :
as_const(expr).operands())
161 for(
const auto &op :
as_const(expr).operands())
163 if(op.id() == expr.
id())
167 for(
const auto &
sub_op : op.operands())
197 const std::string &bits,
223 bits.find(
'1') == std::string::npos)
230 std::string
tmp = bits;
231 for(std::string::size_type i = 0; i < bits.size(); ++i)
234 std::reverse(
tmp.begin(),
tmp.end());
269 if(components.empty() && bits.empty())
313 if(!
comp.has_value())
315 result.add_to_operands(std::move(*
comp));
320 return std::move(result);
359 result.add_to_operands(std::move(*
el));
362 return std::move(result);
379 for(std::size_t i = 0; i <
n_el; ++i)
386 result.add_to_operands(std::move(*
el));
389 return std::move(result);
404 if(!real.has_value() || !imag.has_value())
413std::optional<std::string>
433 std::string result(width,
' ');
435 for(std::string::size_type i = 0; i < width; ++i)
474 for(
const auto &op : expr.
operands())
479 result +=
tmp.value();
488std::optional<std::reference_wrapper<const array_exprt>>
525 return std::optional<std::reference_wrapper<const array_exprt>>(
char_seq);
const T & as_const(T &value)
Return a reference to the same object but ensures the type is const.
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a typet to a bitvector_typet.
const c_enum_typet & to_c_enum_type(const typet &type)
Cast a typet to a c_enum_typet.
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a typet to a c_enum_tag_typet.
const union_typet & to_union_type(const typet &type)
Cast a typet to a union_typet.
const union_tag_typet & to_union_tag_type(const typet &type)
Cast a typet to a union_tag_typet.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Array constructor from list of elements.
Complex constructor from a pair of numbers.
Complex numbers made of pair of given subtype.
struct configt::ansi_ct ansi_c
A constant literal expression.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Union constructor to support unions without any member (a GCC/Clang feature).
Maps a big-endian offset to a little-endian offset.
size_t map_bit(size_t bit) const
Base class for all expressions.
std::vector< exprt > operandst
bool has_operands() const
Return true if there is at least one operand.
void reserve_operands(operandst::size_type n)
bool is_constant() const
Return whether the expression is a constant.
typet & type()
Return the type of the expression.
const irep_idt & id() const
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
The null pointer constant.
Struct constructor from list of elements.
Structure type, corresponds to C style structs.
std::vector< componentt > componentst
The type of an expression, extends irept.
Union constructor from single element.
Vector constructor from list of elements.
#define forall_expr(it, expr)
bool is_null_pointer(const constant_exprt &expr)
Returns true if expr has a pointer type and a value NULL; it also returns true when expr has value ze...
Deprecated expression utility functions.
const mp_integer binary2integer(const std::string &n, bool is_signed)
convert binary string representation to mp_integer
API to expression classes for Pointers.
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
std::optional< mp_integer > pointer_offset_bits(const typet &type, const namespacet &ns)
struct saj_tablet saj_table[]
bool sort_operands(exprt::operandst &operands)
sort operands of an expression according to ordering defined by operator<
static const struct saj_tablet & get_sort_and_join_table_entry(const irep_idt &id, const irep_idt &type_id)
static bool is_associative_and_commutative_for_type(const struct saj_tablet &saj_entry, const irep_idt &type_id)
std::optional< exprt > bits2expr(const std::string &bits, const typet &type, bool little_endian, const namespacet &ns)
std::optional< std::string > expr2bits(const exprt &expr, bool little_endian, const namespacet &ns)
static bool sort_and_join(exprt &expr, bool do_sort)
std::optional< std::reference_wrapper< const array_exprt > > try_get_string_data_array(const exprt &content, const namespacet &ns)
Get char sequence from content field of a refined string expression.
bool join_operands(exprt &expr)
#define CHECK_RETURN(CONDITION)
#define PRECONDITION(CONDITION)
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
API to expression classes.
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
const array_exprt & to_array_expr(const exprt &expr)
Cast an exprt to an array_exprt.
const union_exprt & to_union_expr(const exprt &expr)
Cast an exprt to a union_exprt.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const vector_typet & to_vector_type(const typet &type)
Cast a typet to a vector_typet.
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
const complex_typet & to_complex_type(const typet &type)
Cast a typet to a complex_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const string_constantt & to_string_constant(const exprt &expr)
produce canonical ordering for associative and commutative binary operators
const irep_idt type_ids[10]