35 if(expr.
id() == ID_index)
43 if(sub_size.has_value())
56 else if(expr.
id() == ID_member)
71 expr.
id() == ID_byte_extract_little_endian ||
72 expr.
id() == ID_byte_extract_big_endian)
85 else if(expr.
id() == ID_typecast)
93 else if(
const auto deref = expr_try_dynamic_cast<dereference_exprt>(expr))
96 if(
const auto address_of = expr_try_dynamic_cast<address_of_exprt>(pointer))
98 dest.
object() = address_of->object();
102 else if(
const auto address_of = expr_try_dynamic_cast<address_of_exprt>(expr))
105 if(
const auto deref = expr_try_dynamic_cast<dereference_exprt>(
object))
107 dest.
object() = deref->pointer();
119 if(
offset().
id() == ID_unknown)
141 set(ID_identifier,
object.get_identifier());
153 :
unary_exprt(ID_field_address, std::move(compound_ptr), std::move(_type))
188 const exprt *p = &expr;
192 if(p->
id() == ID_member)
194 else if(p->
id() == ID_index)
219 const typet &type_of_operand = dereference_expr.pointer().type();
222 type_try_dynamic_cast<pointer_typet>(type_of_operand);
227 "dereference expression's operand must have a pointer type");
232 "dereference expression's type must match the base type of the type of its "
Expression classes for byte-level operators.
const byte_extract_exprt & to_byte_extract_expr(const exprt &expr)
pointer_typet pointer_type(const typet &subtype)
bitvector_typet c_index_type()
address_of_exprt(const exprt &op)
A base class for binary expressions.
A base class for relations, i.e., binary predicates whose two operands have the same type.
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
static void validate(const exprt &expr, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
Check that the dereference expression has the right number of operands, refers to something with a po...
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
unsigned int get_instance() const
void set_instance(unsigned int instance)
Operator to return the address of an array element relative to a base address.
element_address_exprt(const exprt &base, exprt index)
constructor for element addresses.
Base class for all expressions.
typet & type()
Return the type of the expression.
const typet & compound_type() const
const irep_idt & component_name() const
field_address_exprt(exprt base, const irep_idt &component_name, pointer_typet type)
constructor for field addresses.
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
Extract member of struct or union.
const exprt & compound() const
const exprt & struct_op() const
Binary multiplication Associativity is not specified.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
An expression without operands.
Operator to return the address of an object.
symbol_exprt object_expr() const
const pointer_typet & type() const
irep_idt object_identifier() const
object_address_exprt(const symbol_exprt &)
Split an expression into a base object and a (byte) offset.
void build(const exprt &expr, const namespacet &ns)
Given an expression expr, attempt to find the underlying object it represents by skipping over type c...
const exprt & root_object() const
The plus expression Associativity is not specified.
The pointer type These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (they ...
const typet & base_type() const
The type of the data what we point to.
const exprt & dead_ptr() const
const exprt & deallocated_ptr() const
exprt lower(const namespacet &ns) const
A predicate that indicates that an address range is ok to read.
const exprt & dead_ptr() const
exprt lower(const namespacet &ns) const
Lower an r_or_w_ok_exprt to arithmetic and logic expressions.
const exprt & size() const
const exprt & pointer() const
const exprt & deallocated_ptr() const
A predicate that indicates that an address range is ok to read.
Expression to hold a symbol (variable)
Semantic type conversion.
static exprt conditional_cast(const exprt &expr, const typet &type)
The type of an expression, extends irept.
Generic base class for unary expressions.
const exprt & skip_typecast(const exprt &expr)
find the expression nested inside typecasts, if any
Deprecated expression utility functions.
const std::string & id2string(const irep_idt &d)
static void build_object_descriptor_rec(const namespacet &ns, const exprt &expr, object_descriptor_exprt &dest)
Build an object_descriptor_exprt from a given expr.
API to expression classes for Pointers.
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
std::optional< exprt > size_of_expr(const typet &type, const namespacet &ns)
std::optional< exprt > member_offset_expr(const member_exprt &member_expr, const namespacet &ns)
exprt pointer_offset(const exprt &pointer)
exprt object_upper_bound(const exprt &pointer, const exprt &access_size)
exprt same_object(const exprt &p1, const exprt &p2)
exprt null_object(const exprt &pointer)
exprt object_lower_bound(const exprt &pointer, const exprt &offset)
Various predicates over pointers in programs.
bool simplify(exprt &expr, const namespacet &ns)
#define CHECK_RETURN(CONDITION)
#define PRECONDITION(CONDITION)
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
#define DATA_CHECK(vm, condition, message)
This macro takes a condition which denotes a well-formedness criterion on goto programs,...