CBMC
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
abstract_pointer_objectt Class Referenceabstract

#include <abstract_pointer_object.h>

+ Inheritance diagram for abstract_pointer_objectt:
+ Collaboration diagram for abstract_pointer_objectt:

Public Member Functions

  Start the abstract object at either top or bottom or neither Asserts if both top and bottom are true.
 
 
  Interface for transforms.
 
  A helper function to evaluate writing to a component of an abstract object.
 
 
  A helper function to read elements from an array.
 
  Evaluate writing to a pointer's value.
 
 
 
 
- 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 a constant expression if possible.
 
  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.
 
  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}.
 
  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.
 
 
 
  to_predicate implementation - derived classes will override
 

Private Member Functions

 
 
 

Additional Inherited Members

- Public Types inherited from abstract_objectt
 
 
- 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.
 
- Protected Types inherited from abstract_objectt
template<class T >
using  internal_sharing_ptrt = std::shared_ptr< T >
 
 
- 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.
 
  Create a new abstract object that is the result of the merge, unless the object would be unchanged, then would return itself.
 
  Helper function for base meet.
 
  Helper function to decide if base meet implementation should be used.
 
 
 
 

Detailed Description

Definition at line 20 of file abstract_pointer_object.h.

Constructor & Destructor Documentation

◆  abstract_pointer_objectt() [1/2]

abstract_pointer_objectt::abstract_pointer_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 16 of file abstract_pointer_object.cpp.

◆  abstract_pointer_objectt() [2/2]

abstract_pointer_objectt::abstract_pointer_objectt ( const exprtexpr,
const abstract_environmenttenvironment,
const namespacetns 
)
explicit
Parameters
expr the expression to use as the starting pointer for an abstract object
environment the environment in which the pointer is being created
ns the current namespace

Definition at line 25 of file abstract_pointer_object.cpp.

Member Function Documentation

◆  eval_ptr_comparison()

abstract_object_pointert abstract_pointer_objectt::eval_ptr_comparison ( const exprtexpr,
const std::vector< abstract_object_pointert > &  operands,
const abstract_environmenttenvironment,
const namespacetns 
) const
private

Definition at line 107 of file abstract_pointer_object.cpp.

◆  eval_ptr_diff()

abstract_object_pointert abstract_pointer_objectt::eval_ptr_diff ( const exprtexpr,
const std::vector< abstract_object_pointert > &  operands,
const abstract_environmenttenvironment,
const namespacetns 
) const
private

Definition at line 95 of file abstract_pointer_object.cpp.

◆  expression_transform()

abstract_object_pointert abstract_pointer_objectt::expression_transform ( const exprtexpr,
const std::vector< abstract_object_pointert > &  operands,
const abstract_environmenttenvironment,
const namespacetns 
) const
overridevirtual

Interface for transforms.

Parameters
expr the expression to evaluate and find the result of it. This will be the symbol referred to be op0()
operands an abstract_object (pointer) that represent the possible values of each operand
environment the abstract environment in which the expression is being evaluated
ns the current variable namespace
Returns
Returns the abstract_object representing the result of this expression to the maximum precision available.

To try and resolve different expressions with the maximum level of precision available.

Reimplemented from abstract_objectt.

Definition at line 37 of file abstract_pointer_object.cpp.

◆  get_statistics()

void abstract_pointer_objectt::get_statistics ( abstract_object_statisticststatistics,
const namespacetns 
) const
overridevirtual

Reimplemented from abstract_objectt.

Reimplemented in constant_pointer_abstract_objectt.

Definition at line 70 of file abstract_pointer_object.cpp.

◆  ptr_comparison_expr()

virtual exprt abstract_pointer_objectt::ptr_comparison_expr ( const exprtexpr,
const std::vector< abstract_object_pointert > &  operands,
const abstract_environmenttenvironment,
const namespacetns 
) const
pure virtual

Implemented in constant_pointer_abstract_objectt, two_value_pointer_abstract_objectt, and value_set_pointer_abstract_objectt.

◆  ptr_diff()

virtual abstract_object_pointert abstract_pointer_objectt::ptr_diff ( const exprtexpr,
const std::vector< abstract_object_pointert > &  operands,
const abstract_environmenttenvironment,
const namespacetns 
) const
pure virtual

Implemented in constant_pointer_abstract_objectt, two_value_pointer_abstract_objectt, and value_set_pointer_abstract_objectt.

◆  read_dereference()

virtual abstract_object_pointert abstract_pointer_objectt::read_dereference ( const abstract_environmenttenv,
const namespacetns 
) const
pure virtual

A helper function to read elements from an array.

More precise abstractions may override this to provide more precise results.

Parameters
env the environment
ns the namespace
Returns
An abstract object representing the value being pointed to

Implemented in constant_pointer_abstract_objectt, two_value_pointer_abstract_objectt, and value_set_pointer_abstract_objectt.

◆  typecast()

virtual abstract_object_pointert abstract_pointer_objectt::typecast ( const typetnew_type,
const abstract_environmenttenvironment,
const namespacetns 
) const
pure virtual

Implemented in constant_pointer_abstract_objectt, two_value_pointer_abstract_objectt, and value_set_pointer_abstract_objectt.

◆  typecast_from_void_ptr()

abstract_object_pointert abstract_pointer_objectt::typecast_from_void_ptr ( const exprtexpr,
const std::vector< abstract_object_pointert > &  operands,
const abstract_environmenttenvironment,
const namespacetns 
) const
private

Definition at line 80 of file abstract_pointer_object.cpp.

◆  write()

abstract_object_pointert abstract_pointer_objectt::write ( abstract_environmenttenvironment,
const namespacetns,
const std::stack< exprt > &  stack,
const exprtspecifier,
bool  merging_write 
) const
overridevirtual

A helper function to evaluate writing to a component of an abstract object.

More precise abstractions may override this to update what they are storing for a specific component.

Parameters
environment the abstract environment
ns the current namespace
stack the remaining stack of expressions on the LHS to evaluate
specifier the expression uses to access a specific component
value the value we are trying to write to the component
merging_write if true, this and all future writes will be merged with the current value
Returns
the abstract_objectt representing the result of writing to a specific component.

Reimplemented from abstract_objectt.

Definition at line 59 of file abstract_pointer_object.cpp.

◆  write_dereference()

virtual abstract_object_pointert abstract_pointer_objectt::write_dereference ( abstract_environmenttenvironment,
const namespacetns,
const std::stack< exprt > &  stack,
bool  merging_write 
) const
pure virtual

Evaluate writing to a pointer's value.

More precise abstractions may override this provide more precise results.

Parameters
environment the abstract environment
ns the namespace
stack the remaining stack of expressions on the LHS to evaluate
value the value we are trying to assign to what the pointer is pointing to
merging_write is it a merging write (i.e. we aren't certain we are writing to this particular pointer therefore the value should be merged with whatever is already there or we are certain we are writing to this pointer so therefore the value can be replaced
Returns
A modified abstract object representing this pointer after it has been written to.

Implemented in value_set_pointer_abstract_objectt, constant_pointer_abstract_objectt, and two_value_pointer_abstract_objectt.


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

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