12#ifndef CBMC_ABSTRACT_AGGREGATE_OBJECT_H
13#define CBMC_ABSTRACT_AGGREGATE_OBJECT_H
28template <
class aggregate_typet,
class aggregate_traitst>
42 type.id() == aggregate_traitst::TYPE_ID());
53 ID_struct == aggregate_traitst::TYPE_ID());
56 ID_union == aggregate_traitst::TYPE_ID());
59 expr.
type().
id() == aggregate_traitst::TYPE_ID());
64 const std::vector<abstract_object_pointert> &operands,
68 if(expr.
id() == aggregate_traitst::ACCESS_EXPR_ID())
72 expr, operands, environment, ns);
78 const std::stack<exprt> &stack,
94 aggregate_traitst::get_statistics(
statistics, visited,
env, ns);
107 aggregate_traitst::read_type(expr.
type(),
type()),
116 const std::stack<exprt> &stack,
127 return std::make_shared<aggregate_typet>(
type(),
true,
false);
137 template <
class keyt,
typename hash>
144 bool modified =
false;
An abstract version of a program environment.
abstract_objectt is the top of the inheritance heirarchy of objects used to represent individual vari...
std::set< abstract_object_pointert > abstract_object_visitedt
sharing_ptrt< class abstract_objectt > abstract_object_pointert
Statistics gathering for the variable senstivity domain.
abstract_aggregate_objectt(const typet &type, bool tp, bool bttm)
virtual abstract_object_pointert read_component(const abstract_environmentt &environment, const exprt &expr, const namespacet &ns) const
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)
void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns) const override
abstract_aggregate_objectt(const exprt &expr, const abstract_environmentt &environment, const namespacet &ns)
virtual void statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns) const =0
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.
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.
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
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.
virtual bool is_top() const
Find out if the abstract object is top.
virtual bool is_bottom() const
Find out if the abstract object is bottom.
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.
static combine_result merge(const abstract_object_pointert &op1, const abstract_object_pointert &op2, const locationt &merge_location, const widen_modet &widen_mode)
virtual void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns) const
virtual const typet & type() const
Get the real type of the variable this abstract object is representing.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
const irep_idt & id() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
The type of an expression, extends irept.
#define PRECONDITION(CONDITION)
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
std::size_t number_of_structs
std::size_t number_of_arrays
static typet read_type(const typet &, const typet &object_type)
static void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns)
static const irep_idt TYPE_ID()
static const irep_idt ACCESS_EXPR_ID()
static const typet & read_type(const typet &expr_type, const typet &)
static void get_statistics(abstract_object_statisticst &statistics, abstract_object_visitedt &visited, const abstract_environmentt &env, const namespacet &ns)
static const irep_idt & TYPE_ID()
static const irep_idt & ACCESS_EXPR_ID()
static typet read_type(const typet &, const typet &object_type)
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()