CBMC
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
value_set_abstract_objectt Class Reference

#include <value_set_abstract_object.h>

+ Inheritance diagram for value_set_abstract_objectt:
+ Collaboration diagram for value_set_abstract_objectt:

Public Member Functions

  Start the abstract object at either top or bottom or neither Asserts if both top and bottom are true.
 
 
 
 
  Converts to a constant expression if possible.
 
 
 
  Getter for the set of stored abstract objects.
 
void  output (std::ostream &out, const ai_baset &ai, const namespacet &ns) const override
 
- Public Member Functions inherited from abstract_value_objectt
 
 
 
 
  Interface for transforms.
 
  A helper function to evaluate writing to a component of an abstract object.
 
- Public Member Functions inherited from abstract_objectt
  Start the abstract object at either top or bottom or neither Asserts if both top and bottom are true.
 
  Construct an abstract object from the expression.
 
 
  Get the real type of the variable this abstract object is representing.
 
  Find out if the abstract object is top.
 
  Find out if the abstract object is bottom.
 
  Verify the internal structure of an abstract_object is correct.
 
 
  Converts to an invariant expression.
 
virtual void  output (std::ostream &out, const class ai_baset &ai, const namespacet &ns) const
  Print the value of the abstract object.
 
  Determine whether 'this' abstract_object has been modified in comparison to a previous 'before' state.
 
  Update the write location context for an abstract object.
 
  Update the merge location context for an abstract object.
 
 
 
 
  Apply a visitor operation to all sub elements of this abstract_object.
 
 
 

Static Public Member Functions

 
- Static Public Member Functions inherited from abstract_objectt
static void  dump_map (std::ostream out, const shared_mapt &m)
 
  Dump all elements in m1 that are different or missing in m2.
 
 
 
  Interface method for the meet operation.
 

Static Public Attributes

  The threshold size for value-sets: past this threshold the object is either converted to interval or marked as top.
 

Protected Member Functions

 
 
 
  to_predicate implementation - derived classes will override
 
- Protected Member Functions inherited from abstract_value_objectt
  Attempts to do a value/value merge if both are constants, otherwise falls back to the parent merge.
 
  Base implementation of the meet operation: only used if no more precise abstraction can be used, can only result in {TOP, BOTTOM, one of the original objects}.
 
 
- Protected Member Functions inherited from abstract_objectt
  Create a new abstract object that is the result of the merge, unless the object would be unchanged, then would return itself.
 
  To detect the cases where the base merge is sufficient to do a merge We can't do if this->is_bottom() since we want the specific.
 
  Helper function for base meet.
 
  Helper function to decide if base meet implementation should be used.
 
 
 
 

Private Member Functions

  Setter for updating the stored values.
 
  Update the set of stored values to new_values.
 
 

Private Attributes

 

Additional Inherited Members

- Public Types inherited from abstract_objectt
 
 
- Protected Types inherited from abstract_value_objectt
 
- Protected Types inherited from abstract_objectt
template<class T >
using  internal_sharing_ptrt = std::shared_ptr< T >
 
 

Detailed Description

Definition at line 18 of file value_set_abstract_object.h.

Constructor & Destructor Documentation

◆  value_set_abstract_objectt() [1/2]

value_set_abstract_objectt::value_set_abstract_objectt ( const typettype,
bool  top,
bool  bottom 
)

Start the abstract object at either top or bottom or neither Asserts if both top and bottom are true.

Parameters
type the type the abstract_object is representing
top is the abstract_object starting as top
bottom is the abstract_object starting as bottom

Definition at line 129 of file value_set_abstract_object.cpp.

◆  value_set_abstract_objectt() [2/2]

value_set_abstract_objectt::value_set_abstract_objectt ( const exprtexpr,
const abstract_environmenttenvironment,
const namespacetns 
)

Definition at line 139 of file value_set_abstract_object.cpp.

Member Function Documentation

◆  constrain()

abstract_value_pointert value_set_abstract_objectt::constrain ( const exprtlower,
const exprtupper 
) const
overridevirtual

Implements abstract_value_objectt.

Definition at line 309 of file value_set_abstract_object.cpp.

◆  get_values()

const abstract_object_sett & value_set_abstract_objectt::get_values ( ) const
inlineoverridevirtual

Getter for the set of stored abstract objects.

Returns
the values represented by this abstract object

Implements value_set_tag.

Definition at line 47 of file value_set_abstract_object.h.

◆  index_range_implementation()

index_range_implementation_ptrt value_set_abstract_objectt::index_range_implementation ( const namespacetns ) const
overridevirtual

Implements abstract_value_objectt.

Definition at line 167 of file value_set_abstract_object.cpp.

◆  make_value_set()

abstract_object_pointert value_set_abstract_objectt::make_value_set ( const abstract_object_settinitial_values )
static

Definition at line 150 of file value_set_abstract_object.cpp.

◆  meet_with_value()

abstract_object_pointert value_set_abstract_objectt::meet_with_value ( const abstract_value_pointertother ) const
overrideprotectedvirtual

Implements abstract_value_objectt.

Definition at line 236 of file value_set_abstract_object.cpp.

◆  merge_with_value()

abstract_object_pointert value_set_abstract_objectt::merge_with_value ( const abstract_value_pointertother,
const widen_modetwiden_mode 
) const
overrideprotectedvirtual

Implements abstract_value_objectt.

Definition at line 209 of file value_set_abstract_object.cpp.

◆  mutable_clone()

internal_abstract_object_pointert value_set_abstract_objectt::mutable_clone ( ) const
inlineoverrideprotectedvirtual

Reimplemented from abstract_objectt.

Definition at line 60 of file value_set_abstract_object.h.

◆  output()

void value_set_abstract_objectt::output ( std::ostream &  out,
const ai_basetai,
const namespacetns 
) const
override

Definition at line 352 of file value_set_abstract_object.cpp.

◆  resolve_values()

abstract_object_pointert value_set_abstract_objectt::resolve_values ( const abstract_object_settnew_values ) const
private

Update the set of stored values to new_values.

Build a new abstract object of the right type if necessary.

Parameters
new_values potentially new set of values
Returns
the abstract object representing new_values (either 'this' or something new)

Definition at line 274 of file value_set_abstract_object.cpp.

◆  set_top_internal()

void value_set_abstract_objectt::set_top_internal ( )
overrideprivatevirtual

Reimplemented from abstract_objectt.

Definition at line 285 of file value_set_abstract_object.cpp.

◆  set_values()

void value_set_abstract_objectt::set_values ( const abstract_object_settother_values )
private

Setter for updating the stored values.

Parameters
other_values the new (non-empty) set of values

Definition at line 292 of file value_set_abstract_object.cpp.

◆  to_constant()

exprt value_set_abstract_objectt::to_constant ( ) const
overridevirtual

Converts to a constant expression if possible.

Returns
Returns an exprt representing the value if the value is known and constant. Otherwise returns the nil expression

If abstract element represents a single value, then that value, otherwise nil. E.G. if it is an interval then this will be x if it is [x,x] This is the (sort of) dual to the constant_exprt constructor that allows an object to be built from a value.

Reimplemented from abstract_objectt.

Definition at line 190 of file value_set_abstract_object.cpp.

◆  to_interval()

constant_interval_exprt value_set_abstract_objectt::to_interval ( ) const
overridevirtual

Implements abstract_value_objectt.

Definition at line 204 of file value_set_abstract_object.cpp.

◆  to_predicate_internal()

exprt value_set_abstract_objectt::to_predicate_internal ( const exprtname ) const
overrideprotectedvirtual

to_predicate implementation - derived classes will override

Parameters
name - the variable name to substitute into the expression
Returns
Returns an exprt representing the object as an invariant.

Reimplemented from abstract_objectt.

Definition at line 333 of file value_set_abstract_object.cpp.

◆  value_range_implementation()

value_range_implementation_ptrt value_set_abstract_objectt::value_range_implementation ( ) const
overridevirtual

Implements abstract_value_objectt.

Definition at line 185 of file value_set_abstract_object.cpp.

Member Data Documentation

◆  max_value_set_size

const size_t value_set_abstract_objectt::max_value_set_size = 10
static

The threshold size for value-sets: past this threshold the object is either converted to interval or marked as top.

Definition at line 54 of file value_set_abstract_object.h.

◆  values

abstract_object_sett value_set_abstract_objectt::values
private

Definition at line 87 of file value_set_abstract_object.h.


The documentation for this class was generated from the following files:

AltStyle によって変換されたページ (->オリジナル) /