CBMC
|
General implementation of an abstract_objectt which tracks the last written locations for a given abstract_objectt. More...
#include <liveness_context.h>
Protected Member Functions | |
internal_abstract_object_pointert | mutable_clone () const override |
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_object. | |
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 the base abstract_object_merge has completed it's actions but immediately prior to it returning. | |
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. | |
![]() | |
internal_abstract_object_pointert | mutable_clone () const override |
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_object. | |
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, can only result in {TOP, BOTTOM, one of the original objects}. | |
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 the base abstract_object_merge has completed its actions but immediately prior to it returning. | |
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. | |
virtual locationst | get_last_written_locations () const |
void | set_last_written_locations (const locationst &locations) |
Sets the last written locations for this context. | |
![]() | |
void | set_child (const abstract_object_pointert &child) |
void | set_top_internal () override |
void | set_not_top_internal () override |
exprt | to_predicate_internal (const exprt &name) const override |
to_predicate implementation - derived classes will override | |
![]() | |
abstract_object_pointert | abstract_object_merge (const abstract_object_pointert &other) const |
Create a new abstract object that is the result of the merge, unless the object would be unchanged, then would return itself. | |
bool | should_use_base_merge (const abstract_object_pointert &other) const |
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. | |
abstract_object_pointert | abstract_object_meet (const abstract_object_pointert &other) const |
Helper function for base meet. | |
bool | should_use_base_meet (const abstract_object_pointert &other) const |
Helper function to decide if base meet implementation should be used. | |
void | set_top () |
void | set_not_top () |
void | set_not_bottom () |
Private Types | |
using | liveness_context_ptrt = std::shared_ptr< const liveness_contextt > |
Private Member Functions | |
abstract_object_pointert | reset_location_on_merge (const liveness_context_ptrt &merged) const |
context_abstract_object_ptrt | update_location_context_internal (const locationst &locations) const override |
bool | has_location () const |
void | set_location (const locationt &location) |
Private Attributes | |
std::optional< locationt > | assign_location |
General implementation of an abstract_objectt which tracks the last written locations for a given abstract_objectt.
Instances of this class are constructed with an abstract_object_pointert, to which most operations are delegated, while at the same time this class handles the tracking of the 'last_written_location' information.
Instances of this class are best constructed via the templated version of this, 'context_abstract_objectt<T>' which provides the same constructors as the standard 'abstract_objectt' class.
Definition at line 33 of file liveness_context.h.
|
private |
Definition at line 81 of file liveness_context.h.
|
inline |
Definition at line 36 of file liveness_context.h.
|
inlineexplicit |
Definition at line 45 of file liveness_context.h.
|
overrideprotectedvirtual |
Helper function for abstract_objectt::abstract_object_merge to perform any additional actions after the base abstract_object_merge has completed it's actions but immediately prior to it returning.
As such, this function gives the ability to perform additional work for a merge.
This default implementation just returns itself.
other | the object to merge with this |
Reimplemented from abstract_objectt.
Definition at line 88 of file liveness_context.cpp.
abstract_objectt::locationt liveness_contextt::get_location | ( | ) | const |
Definition at line 16 of file liveness_context.cpp.
|
private |
Definition at line 11 of file liveness_context.cpp.
|
overrideprotectedvirtual |
Create a new abstract object that is the result of merging this abstract object with a given abstract_object.
other | the abstract object to merge with |
widen_mode | Indicates if this is a widening merge |
Reimplemented from abstract_objectt.
Definition at line 72 of file liveness_context.cpp.
|
overridevirtual |
Update the merge location context for an abstract object.
location | the location to be updated |
Reimplemented from abstract_objectt.
Definition at line 145 of file liveness_context.cpp.
|
inlineoverrideprotectedvirtual |
Reimplemented from abstract_objectt.
Definition at line 63 of file liveness_context.h.
|
overridevirtual |
Output a representation of the value of this abstract object.
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 context_abstract_objectt.
Definition at line 131 of file liveness_context.cpp.
|
private |
Definition at line 96 of file liveness_context.cpp.
Definition at line 118 of file liveness_context.cpp.
|
overrideprivatevirtual |
Implements context_abstract_objectt.
Definition at line 109 of file liveness_context.cpp.
|
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.
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 |
Reimplemented from context_abstract_objectt.
Definition at line 37 of file liveness_context.cpp.
|
private |
Definition at line 86 of file liveness_context.h.