CBMC
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
context_abstract_objectt Class Referenceabstract

#include <context_abstract_object.h>

+ Inheritance diagram for context_abstract_objectt:
+ Collaboration diagram for context_abstract_objectt:

Public Member Functions

 
 
 
  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.
 
  Converts to a constant expression if possible.
 
  Try to resolve an expression with the maximum level of precision available.
 
  Update the location context for an abstract object.
 
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.
 
 
 
 
 
- 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.
 
 
  Verify the internal structure of an abstract_object is correct.
 
  Converts to an invariant expression.
 
  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 merge location context for an abstract object.
 
 
 
  Apply a visitor operation to all sub elements of this abstract_object.
 
 
 

Protected Types

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

Protected Member Functions

 
 
 
  A helper function to evaluate writing to a component of an abstract object.
 
  Determine whether 'this' abstract_object has been modified in comparison to a previous 'before' state.
 
  to_predicate implementation - derived classes will override
 
 
- 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.
 
 
 
 

Protected Attributes

 

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.
 

Detailed Description

Definition at line 21 of file context_abstract_object.h.

Member Typedef Documentation

◆  context_abstract_object_ptrt

Definition at line 102 of file context_abstract_object.h.

◆  locationst

Definition at line 127 of file context_abstract_object.h.

Constructor & Destructor Documentation

◆  context_abstract_objectt() [1/2]

context_abstract_objectt::context_abstract_objectt ( const abstract_object_pointert  child,
const typettype,
bool  top,
bool  bottom 
)
inline

Definition at line 26 of file context_abstract_object.h.

◆  context_abstract_objectt() [2/2]

context_abstract_objectt::context_abstract_objectt ( const abstract_object_pointert  child,
const exprtexpr,
const abstract_environmenttenvironment,
const namespacetns 
)
inlineexplicit

Definition at line 36 of file context_abstract_object.h.

◆  ~context_abstract_objectt()

virtual context_abstract_objectt::~context_abstract_objectt ( )
inlinevirtual

Definition at line 46 of file context_abstract_object.h.

Member Function Documentation

◆  envelop()

abstract_object_pointert context_abstract_objectt::envelop ( abstract_object_pointertchild ) const

Definition at line 120 of file context_abstract_object.cpp.

◆  expression_transform()

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

Try to resolve an expression with the maximum level of precision available.

Parameters
expr the expression to evaluate and find the result of. This will be the symbol referred to be op0()
operands the operands to use instead of expr.operands()
environment the abstract environment in which to resolve 'expr'
ns the current namespace
Returns
the resolved expression

Reimplemented from abstract_objectt.

Definition at line 83 of file context_abstract_object.cpp.

◆  get_child()

abstract_object_pointert context_abstract_objectt::get_child ( ) const

Definition at line 15 of file context_abstract_object.cpp.

◆  get_statistics()

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

Reimplemented from abstract_objectt.

Definition at line 179 of file context_abstract_object.cpp.

◆  has_been_modified()

bool context_abstract_objectt::has_been_modified ( const abstract_object_pointertbefore ) const
overrideprotectedvirtual

Determine whether 'this' abstract_object has been modified in comparison to a previous 'before' state.

Parameters
before The abstract_object_pointert to use as a reference to compare against
Returns
true if 'this' is considered to have been modified in comparison to 'before', false otherwise.

Reimplemented from abstract_objectt.

Reimplemented in data_dependency_contextt, and write_location_contextt.

Definition at line 157 of file context_abstract_object.cpp.

◆  is_bottom()

bool context_abstract_objectt::is_bottom ( ) const
inlineoverridevirtual

Find out if the abstract object is bottom.

Returns
Returns true if the abstract object is representing the bottom.

Reimplemented from abstract_objectt.

Definition at line 60 of file context_abstract_object.h.

◆  is_top()

bool context_abstract_objectt::is_top ( ) const
inlineoverridevirtual

Find out if the abstract object is top.

Returns
Returns true if the abstract object is representing the top (i.e. we don't know anything about the value).

Reimplemented from abstract_objectt.

Definition at line 55 of file context_abstract_object.h.

◆  output()

void context_abstract_objectt::output ( std::ostream &  out,
const class ai_basetai,
const namespacetns 
) const
overridevirtual

Output a representation of the value of this abstract object.

Parameters
out the stream to write to
ai the abstract interpreter that contains the abstract domain (that contains the object ... )
ns the current namespace

Reimplemented from abstract_objectt.

Reimplemented in data_dependency_contextt, liveness_contextt, and write_location_contextt.

Definition at line 141 of file context_abstract_object.cpp.

◆  set_child()

void context_abstract_objectt::set_child ( const abstract_object_pointertchild )
protected

Definition at line 20 of file context_abstract_object.cpp.

◆  set_not_top_internal()

void context_abstract_objectt::set_not_top_internal ( )
overrideprotectedvirtual

Reimplemented from abstract_objectt.

Definition at line 31 of file context_abstract_object.cpp.

◆  set_top_internal()

void context_abstract_objectt::set_top_internal ( )
overrideprotectedvirtual

Reimplemented from abstract_objectt.

Definition at line 25 of file context_abstract_object.cpp.

◆  to_constant()

exprt context_abstract_objectt::to_constant ( ) const
inlineoverridevirtual

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 65 of file context_abstract_object.h.

◆  to_predicate_internal()

exprt context_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 174 of file context_abstract_object.cpp.

◆  type()

const typet & context_abstract_objectt::type ( ) const
inlineoverridevirtual

Get the real type of the variable this abstract object is representing.

Returns
The program type this abstract object represents

Reimplemented from abstract_objectt.

Definition at line 50 of file context_abstract_object.h.

◆  unwrap_context()

abstract_object_pointert context_abstract_objectt::unwrap_context ( ) const
overridevirtual

Reimplemented from abstract_objectt.

Definition at line 169 of file context_abstract_object.cpp.

◆  update_location_context_internal()

virtual context_abstract_object_ptrt context_abstract_objectt::update_location_context_internal ( const locationstlocations ) const
protectedpure virtual

Implemented in data_dependency_contextt, liveness_contextt, and write_location_contextt.

◆  write()

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

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.

Reimplemented in data_dependency_contextt, liveness_contextt, and write_location_contextt.

Definition at line 53 of file context_abstract_object.cpp.

◆  write_location_context()

abstract_object_pointert context_abstract_objectt::write_location_context ( const locationtlocation ) const
overridevirtual

Update the location context for an abstract object.

Parameters
location the location to be updated
Returns
a clone of this abstract object with its location context updated

Reimplemented from abstract_objectt.

Definition at line 108 of file context_abstract_object.cpp.

Member Data Documentation

◆  child_abstract_object

abstract_object_pointert context_abstract_objectt::child_abstract_object
protected

Definition at line 106 of file context_abstract_object.h.


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

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