CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
data_dependency_context.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: analyses variable-sensitivity data_dependency_context
4
5Author: Diffblue Ltd
6
7\*******************************************************************/
8
14#ifndef CPROVER_ANALYSES_VARIABLE_SENSITIVITY_DATA_DEPENDENCY_CONTEXT_H
15#define CPROVER_ANALYSES_VARIABLE_SENSITIVITY_DATA_DEPENDENCY_CONTEXT_H
16
18
20{
21public:
22 // These constructors mirror those in the base abstract_objectt, but with
23 // the addition of an extra argument which is the abstract_objectt to wrap.
32
35 const exprt &expr,
36 const abstract_environmentt &environment,
37 const namespacet &ns)
38 : write_location_contextt(child, expr, environment, ns)
39 {
40 }
41
43 abstract_environmentt &environment,
44 const namespacet &ns,
45 const std::stack<exprt> &stack,
46 const exprt &specifier,
47 const abstract_object_pointert &value,
48 bool merging_write) const override;
49
50 bool has_been_modified(const abstract_object_pointert &before) const override;
51
52 std::set<goto_programt::const_targett, goto_programt::target_less_than>
54 std::set<goto_programt::const_targett, goto_programt::target_less_than>
55 get_data_dominators() const;
56
57 void output(std::ostream &out, const class ai_baset &ai, const namespacet &ns)
58 const override;
59
60protected:
62
64 const abstract_object_pointert &other,
65 const widen_modet &widen_mode) const override;
67 meet(const abstract_object_pointert &other) const override;
68
70 const abstract_object_pointert &other) const override;
71
72private:
74 std::shared_ptr<const data_dependency_contextt>;
75
78 const data_dependency_context_ptrt &parent) const;
79
81 {
82 public:
86 {
87 return instruction->location_number > other_instruction->location_number;
88 }
89 };
90 typedef std::set<goto_programt::const_targett, location_ordert> dependenciest;
93
95 insert_data_deps(const dependenciest &dependencies) const;
96
99
102};
103
104#endif // CPROVER_ANALYSES_VARIABLE_SENSITIVITY_DATA_DEPENDENCY_CONTEXT_H
#define CLONE
sharing_ptrt< class abstract_objectt > abstract_object_pointert
This is the basic interface of the abstract interpreter with default implementations of the core func...
Definition ai.h:117
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
std::shared_ptr< context_abstract_objectt > context_abstract_object_ptrt
std::set< locationt, goto_programt::target_less_than > locationst
const typet & type() const override
Get the real type of the variable this abstract object is representing.
bool operator()(goto_programt::const_targett instruction, goto_programt::const_targett other_instruction) const
std::set< goto_programt::const_targett, goto_programt::target_less_than > get_data_dominators() const
Return the set of data dominators associated with this node.
abstract_object_pointert merge(const abstract_object_pointert &other, const widen_modet &widen_mode) const override
Create a new abstract object that is the result of merging this abstract object with a given abstract...
data_dependency_contextt(const abstract_object_pointert child, const typet &type, bool top, bool bottom)
bool has_been_modified(const abstract_object_pointert &before) const override
Determine whether 'this' abstract_object has been modified in comparison to a previous 'before' state...
void output(std::ostream &out, const class ai_baset &ai, const namespacet &ns) const override
Output a representation of the value of this abstract object.
data_dependency_contextt(const abstract_object_pointert child, const exprt &expr, const abstract_environmentt &environment, const namespacet &ns)
abstract_object_pointert insert_data_deps(const dependenciest &dependencies) const
Insert the given set of data dependencies into the data dependencies set for this data_dependency_con...
std::set< goto_programt::const_targett, goto_programt::target_less_than > get_data_dependencies() const
Return the set of data dependencies associated with this node.
abstract_object_pointert abstract_object_merge_internal(const abstract_object_pointert &other) const override
Helper function for abstract_objectt::abstract_object_merge to perform any additional actions after t...
std::shared_ptr< const data_dependency_contextt > data_dependency_context_ptrt
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.
context_abstract_object_ptrt update_location_context_internal(const locationst &locations) const override
abstract_object_pointert combine(const data_dependency_context_ptrt &other, const data_dependency_context_ptrt &parent) const
void set_data_deps(const locationst &locations)
Set the given set of data dependencies for from the locations.
abstract_object_pointert meet(const abstract_object_pointert &other) const override
Base implementation of the meet operation: only used if no more precise abstraction can be used,...
std::set< goto_programt::const_targett, location_ordert > dependenciest
Base class for all expressions.
Definition expr.h:56
instructionst::const_iterator const_targett
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
The type of an expression, extends irept.
Definition type.h:29
General implementation of an abstract_objectt which tracks the last written locations for a given abs...
Maintain a context in the variable sensitvity domain that records write locations for a given abstrac...