Go to the documentation of this file.
9 #ifndef CPROVER_UTIL_POINTER_EXPR_H
10 #define CPROVER_UTIL_POINTER_EXPR_H
51 return type.
id() == ID_pointer;
81 return type.
id() == ID_pointer && type.
subtype().
id() == ID_empty;
94 set(ID_C_reference,
true);
152 ID_object_descriptor,
161 ID_object_descriptor,
203 return base.
id() == ID_object_descriptor;
267 return base.
id() == ID_dynamic_object;
314 expr.
operands().size() == 1,
"is_dynamic_object must have one operand");
324 expr.
operands().size() == 1,
"is_dynamic_object must have one operand");
335 :
unary_exprt(ID_address_of, std::move(
op), std::move(_type))
353 return base.
id() == ID_address_of;
416 "dereference expression must have one operand");
428 return base.
id() == ID_dereference;
534 #endif // CPROVER_UTIL_POINTER_EXPR_H
dynamic_object_exprt(typet type)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const r_or_w_ok_exprt & to_r_or_w_ok_expr(const exprt &expr)
#define DATA_CHECK(vm, condition, message)
This macro takes a condition which denotes a well-formedness criterion on goto programs,...
const typet & subtype() const
bool can_cast_expr< dynamic_object_exprt >(const exprt &base)
bool can_cast_expr< address_of_exprt >(const exprt &base)
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...
w_ok_exprt(exprt pointer, exprt size)
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
The type of an expression, extends irept.
static void check(const typet &type, const validation_modet vm=validation_modet::INVARIANT)
Operator to dereference a pointer.
Representation of heap-allocated objects.
Evaluates to true if the operand is a pointer to a dynamic object.
void validate_operands(const exprt &value, exprt::operandst::size_type number, const char *message, bool allow_more=false)
Split an expression into a base object and a (byte) offset.
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...
bool can_cast_expr< object_descriptor_exprt >(const exprt &base)
address_of_exprt(const exprt &op)
Base class for all expressions.
Generic base class for unary expressions.
dereference_exprt(const exprt &op)
A base class for binary expressions.
const exprt & root_object() const
bool is_rvalue_reference(const typet &type)
Returns if the type is an R value reference.
bool can_cast_type< pointer_typet >(const typet &type)
Check whether a reference to a typet is a pointer_typet.
const exprt & pointer() const
const object_descriptor_exprt & to_object_descriptor_expr(const exprt &expr)
Cast an exprt to an object_descriptor_exprt.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
typet & type()
Return the type of the expression.
bool get_bool(const irep_namet &name) const
unsigned int get_instance() const
address_of_exprt(exprt op, pointer_typet _type)
const exprt & pointer() const
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
The null pointer constant.
void validate_expr(const object_descriptor_exprt &value)
A base class for expressions that are predicates, i.e., Boolean-typed, and that take exactly two argu...
#define PRECONDITION(CONDITION)
pointer_typet(typet _subtype, std::size_t width)
dereference_exprt(exprt op, typet type)
Pre-defined bitvector types.
Fixed-width bit-vector with two's complement interpretation.
bool can_cast_expr< dereference_exprt >(const exprt &base)
null_pointer_exprt(pointer_typet type)
const exprt & valid() const
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
is_dynamic_object_exprt(const exprt &op)
const reference_typet & to_reference_type(const typet &type)
Cast a typet to a reference_typet.
const irep_idt & id() const
const exprt & object() const
reference_typet(typet _subtype, std::size_t _width)
const dynamic_object_exprt & to_dynamic_object_expr(const exprt &expr)
Cast an exprt to a dynamic_object_exprt.
r_ok_exprt(exprt pointer, exprt size)
object_descriptor_exprt(exprt _object)
const r_ok_exprt & to_r_ok_expr(const exprt &expr)
std::size_t get_width() const
reference_typet reference_type(const typet &subtype)
void set_instance(unsigned int instance)
bool is_reference(const typet &type)
Returns true if the type is a reference.
A predicate that indicates that an address range is ok to read.
const exprt & offset() const
Base class of fixed-width bit-vector types.
const irep_idt & get(const irep_namet &name) const
A predicate that indicates that an address range is ok to write.
void set(const irep_namet &name, const irep_idt &value)
A base class for a predicate that indicates that an address range is ok to read or write.
r_or_w_ok_exprt(irep_idt id, exprt pointer, exprt size)
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
bool is_void_pointer(const typet &type)
This method tests, if the given typet is a pointer of type void.
Operator to return the address of an object.
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
object_descriptor_exprt()
const exprt & object() const
The pointer type These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (they ...
A constant literal expression.
const is_dynamic_object_exprt & to_is_dynamic_object_expr(const exprt &expr)
API to expression classes.
const w_ok_exprt & to_w_ok_expr(const exprt &expr)
A base class for expressions that are predicates, i.e., Boolean-typed, and that take exactly one argu...
static void check(const typet &type, const validation_modet vm=validation_modet::INVARIANT)
signedbv_typet difference_type() const
bool can_cast_type< reference_typet >(const typet &type)
Check whether a reference to a typet is a reference_typet.
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
const exprt & size() const