Go to the documentation of this file.
12 #ifndef CBMC_ABSTRACT_AGGREGATE_OBJECT_H
13 #define CBMC_ABSTRACT_AGGREGATE_OBJECT_H
25 template <
class aggregate_typet,
class aggregate_traitst>
53 const std::vector<abstract_object_pointert> &operands,
57 if(expr.
id() == aggregate_traitst::ACCESS_EXPR_ID())
61 expr, operands, environment, ns);
67 const std::stack<exprt> &stack,
68 const exprt &specifier,
70 bool merging_write)
const override
73 environment, ns, stack, specifier, value, merging_write);
83 aggregate_traitst::get_statistics(
statistics, visited, env, ns);
84 this->
statistics(statistics, visited, env, ns);
96 aggregate_traitst::read_type(expr.
type(),
type()),
105 const std::stack<exprt> &stack,
108 bool merging_write)
const
112 return shared_from_this();
116 return std::make_shared<aggregate_typet>(
type(),
true,
false);
126 template <
class keyt,
typename hash>
133 bool modified =
false;
136 delta_viewt delta_view;
139 for(
auto &item : delta_view)
146 out_map.
replace(item.k, v_new.object);
229 #endif //CBMC_ABSTRACT_AGGREGATE_OBJECT_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void get_delta_view(const sharing_mapt &other, delta_viewt &delta_view, const bool only_common=true) const
Get a delta view of the elements in the map.
sharing_ptrt< class abstract_objectt > abstract_object_pointert
virtual bool is_top() const
Find out if the abstract object is top.
static bool merge_shared_maps(const sharing_mapt< keyt, abstract_object_pointert, false, hash > &map1, const sharing_mapt< keyt, abstract_object_pointert, false, hash > &map2, sharing_mapt< keyt, abstract_object_pointert, false, hash > &out_map, const widen_modet &widen_mode)
A map implemented as a tree where subtrees can be shared between different maps.
The type of an expression, extends irept.
void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns) const override
virtual const typet & type() const
Get the real type of the variable this abstract object is representing.
Base class for all expressions.
virtual void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns) const
static const irep_idt TYPE_ID()
static void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns)
static const irep_idt & ACCESS_EXPR_ID()
abstract_aggregate_objectt(const exprt &expr, const abstract_environmentt &environment, const namespacet &ns)
static void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns)
abstract_aggregate_objectt(const typet &type)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
abstract_aggregate_objectt(const typet &type, bool tp, bool bttm)
typet & type()
Return the type of the expression.
abstract_object_pointert expression_transform(const exprt &expr, const std::vector< abstract_object_pointert > &operands, const abstract_environmentt &environment, const namespacet &ns) const override
Interface for transforms.
static combine_result merge(const abstract_object_pointert &op1, const abstract_object_pointert &op2, const locationt &merge_location, const widen_modet &widen_mode)
static const typet & read_type(const typet &expr_type, const typet &)
virtual abstract_object_pointert read_component(const abstract_environmentt &environment, const exprt &expr, const namespacet &ns) const
virtual abstract_object_pointert abstract_object_factory(const typet &type, const namespacet &ns, bool top, bool bottom) const
Look at the configuration for the sensitivity and create an appropriate abstract_object.
#define PRECONDITION(CONDITION)
static typet read_type(const typet &, const typet &object_type)
const irep_idt & id() const
std::size_t number_of_arrays
std::set< abstract_object_pointert > abstract_object_visitedt
virtual abstract_object_pointert write_component(abstract_environmentt &environment, const namespacet &ns, const std::stack< exprt > &stack, const exprt &expr, const abstract_object_pointert &value, bool merging_write) const
static const irep_idt ACCESS_EXPR_ID()
void replace(const key_type &k, valueU &&m)
Replace element, element must exist in map.
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
static typet read_type(const typet &, const typet &object_type)
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
static const irep_idt TYPE_ID()
std::size_t number_of_structs
static const irep_idt ACCESS_EXPR_ID()
virtual bool is_bottom() const
Find out if the abstract object is bottom.
static const irep_idt & TYPE_ID()
abstract_object_pointert write(abstract_environmentt &environment, const namespacet &ns, const std::stack< exprt > &stack, const exprt &specifier, const abstract_object_pointert &value, bool merging_write) const override
A helper function to evaluate writing to a component of an abstract object.
static void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns)
virtual abstract_object_pointert expression_transform(const exprt &expr, const std::vector< abstract_object_pointert > &operands, const abstract_environmentt &environment, const namespacet &ns) const
Interface for transforms.
const typet & element_type() const
The type of the elements of the array.
virtual void statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns) const =0