CBMC
value_set_abstract_object.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3  Module: analyses variable-sensitivity
4 
5  Author: diffblue
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_ANALYSES_VARIABLE_SENSITIVITY_VALUE_SET_ABSTRACT_OBJECT_H
13 #define CPROVER_ANALYSES_VARIABLE_SENSITIVITY_VALUE_SET_ABSTRACT_OBJECT_H
14 
17 
19  public value_set_tag
20 {
21 public:
23  value_set_abstract_objectt(const typet &type, bool top, bool bottom);
24 
26  const exprt &expr,
27  const abstract_environmentt &environment,
28  const namespacet &ns);
29 
31  make_value_set(const abstract_object_sett &initial_values);
32 
34  index_range_implementation(const namespacet &ns) const override;
35 
37 
39  exprt to_constant() const override;
40  constant_interval_exprt to_interval() const override;
41 
43  constrain(const exprt &lower, const exprt &upper) const override;
44 
47  const abstract_object_sett &get_values() const override
48  {
49  return values;
50  }
51 
54  static const size_t max_value_set_size = 10;
55 
56  void output(std::ostream &out, const ai_baset &ai, const namespacet &ns)
57  const override;
58 
59 protected:
61 
63  const abstract_value_pointert &other,
64  const widen_modet &widen_mode) const override;
65 
67  meet_with_value(const abstract_value_pointert &other) const override;
68 
69  exprt to_predicate_internal(const exprt &name) const override;
70 
71 private:
74  void set_values(const abstract_object_sett &other_values);
75 
82  resolve_values(const abstract_object_sett &new_values) const;
83 
84  void set_top_internal() override;
85 
86  // data
88 };
89 
90 #endif // CPROVER_ANALYSES_VARIABLE_SENSITIVITY_VALUE_SET_ABSTRACT_OBJECT_H
#define CLONE
sharing_ptrt< class abstract_objectt > abstract_object_pointert
an unordered set of value objects
Common behaviour for abstract objects modelling values - constants, intervals, etc.
std::unique_ptr< index_range_implementationt > index_range_implementation_ptrt
std::unique_ptr< value_range_implementationt > value_range_implementation_ptrt
virtual const typet & type() const
Get the real type of the variable this abstract object is representing.
sharing_ptrt< const abstract_value_objectt > abstract_value_pointert
This is the basic interface of the abstract interpreter with default implementations of the core func...
Definition: ai.h:117
Represents an interval of values.
Definition: interval.h:52
Base class for all expressions.
Definition: expr.h:56
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:94
The type of an expression, extends irept.
Definition: type.h:29
void set_values(const abstract_object_sett &other_values)
Setter for updating the stored values.
abstract_object_pointert resolve_values(const abstract_object_sett &new_values) const
Update the set of stored values to new_values.
void output(std::ostream &out, const ai_baset &ai, const namespacet &ns) const override
abstract_object_pointert merge_with_value(const abstract_value_pointert &other, const widen_modet &widen_mode) const override
abstract_object_pointert meet_with_value(const abstract_value_pointert &other) const override
constant_interval_exprt to_interval() const override
value_set_abstract_objectt(const typet &type, bool top, bool bottom)
Start the abstract object at either top or bottom or neither Asserts if both top and bottom are true.
const abstract_object_sett & get_values() const override
Getter for the set of stored abstract objects.
abstract_value_pointert constrain(const exprt &lower, const exprt &upper) const override
static const size_t max_value_set_size
The threshold size for value-sets: past this threshold the object is either converted to interval or ...
value_range_implementation_ptrt value_range_implementation() const override
exprt to_predicate_internal(const exprt &name) const override
to_predicate implementation - derived classes will override
static abstract_object_pointert make_value_set(const abstract_object_sett &initial_values)
index_range_implementation_ptrt index_range_implementation(const namespacet &ns) const override
exprt to_constant() const override
Converts to a constant expression if possible.