Go to the documentation of this file.
19 auto current = std::ref(address_of.
object());
26 if(
const auto index = expr_try_dynamic_cast<index_exprt>(current.get()))
29 current = index->array();
32 if(
const auto member = expr_try_dynamic_cast<member_exprt>(current.get()))
35 current = member->compound();
40 "Unable to find base object of expression: " +
41 current.get().pretty(1, 0));
63 return invalid_pointer_object;
71 object_map.emplace(std::move(null_object_base), std::move(
null_object));
76 std::move(invalid_pointer_object_base), std::move(invalid_pointer_object));
81 const exprt &expression,
86 expression, [&](
const exprt &object_base) ->
void {
87 const auto find_result = object_map.
find(object_base);
88 if(find_result != object_map.cend())
91 INVARIANT(size,
"Objects are expected to have well defined size");
94 object.unique_id = object_map.size();
96 object_map.emplace_hint(find_result, object_base, std::move(
object));
101 const exprt &expression,
104 bool all_objects_tracked =
true;
106 expression, [&](
const exprt &object_base) ->
void {
107 const auto find_result = object_map.
find(object_base);
108 if(find_result != object_map.cend())
110 all_objects_tracked =
false;
112 return all_objects_tracked;
bool can_cast_expr< symbol_exprt >(const exprt &base)
bool can_cast_expr< string_constantt >(const exprt &base)
static decision_procedure_objectt make_null_object()
void track_expression_objects(const exprt &expression, const namespacet &ns, smt_object_mapt &object_map)
Finds all the object expressions in the given expression and adds them to the object map for cases wh...
Information the decision procedure holds about each object.
const irept & find(const irep_idt &name) const
static decision_procedure_objectt make_invalid_pointer_object()
Base class for all expressions.
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 can_cast_expr< code_labelt >(const exprt &base)
The null pointer constant.
pointer_typet pointer_type(const typet &subtype)
exprt find_object_base_expression(const address_of_exprt &address_of)
The model of addresses we use consists of a unique object identifier and an offset.
bool objects_are_already_tracked(const exprt &expression, const smt_object_mapt &object_map)
Finds whether all base object expressions in the given expression are already tracked in the given ob...
exprt null_object(const exprt &pointer)
exprt base_expression
The expression for the root of the object.
std::size_t unique_id
Number which uniquely identifies this particular object.
std::unordered_map< exprt, decision_procedure_objectt, irep_hash > smt_object_mapt
Mapping from an object's base expression to the set of information about it which we track.
optionalt< exprt > size_of_expr(const typet &type, const namespacet &ns)
exprt make_invalid_pointer_expr()
Create the invalid pointer constant.
bool can_cast_expr< constant_exprt >(const exprt &base)
exprt size
Expression which evaluates to the size of the object in bytes.
Operator to return the address of an object.
unsignedbv_typet size_type()
A constant literal expression.
void find_object_base_expressions(const exprt &expression, const output_object_functiont &output_object)
Arbitary expressions passed to the decision procedure may have multiple address of operations as its ...
smt_object_mapt initial_smt_object_map()
Constructs an initial object map containing the null object.