CBMC
|
Storage for symbolic execution paths to be resumed later. More...
#include <path_storage.h>
Classes | |
struct | patht |
Information saved at a conditional goto to resume execution. More... | |
Public Member Functions | |
virtual | ~path_storaget ()=default |
patht & | peek () |
Reference to the next path to resume. More... | |
virtual void | clear ()=0 |
Clear all saved paths. More... | |
virtual void | push (const patht &)=0 |
Add a path to resume to the storage. More... | |
void | pop () |
Remove the next path to resume from the storage. More... | |
virtual std::size_t | size () const =0 |
How many paths does this storage contain? More... | |
bool | empty () const |
Is this storage empty? More... | |
std::size_t | get_unique_l1_index (const irep_idt &id, std::size_t minimum_index) |
Provide a unique L1 index for a given id , starting from minimum_index . More... | |
std::size_t | get_unique_l2_index (const irep_idt &id) |
void | add_function_loops (const irep_idt &identifier, const goto_programt &body) |
Generates a loop analysis for the instructions in goto_programt and keys it against function ID. More... | |
std::shared_ptr< lexical_loopst > | get_loop_analysis (const irep_idt &function_id) |
Public Attributes | |
symex_nondet_generatort | build_symex_nondet |
Counter for nondet objects, which require unique names. More... | |
std::unordered_map< irep_idt, local_safe_pointerst > | safe_pointers |
Map function identifiers to local_safe_pointerst instances. More... | |
incremental_dirtyt | dirty |
Local variables are considered 'dirty' if they've had an address taken and therefore may be referred to by a pointer. More... | |
Private Types | |
typedef std::unordered_map< irep_idt, std::size_t > | name_index_mapt |
Private Member Functions | |
virtual patht & | private_peek ()=0 |
virtual void | private_pop ()=0 |
std::size_t | get_unique_index (name_index_mapt &unique_index_map, const irep_idt &id, std::size_t minimum_index) |
Private Attributes | |
std::unordered_map< irep_idt, std::shared_ptr< lexical_loopst > > | loop_analysis_map |
name_index_mapt | l1_indices |
Storage used by get_unique_index. More... | |
name_index_mapt | l2_indices |
Storage for symbolic execution paths to be resumed later.
This data structure supports saving partially-executed symbolic execution paths so that their execution can be halted and resumed later. The choice of which path should be resumed next is implemented by subtypes of this abstract class.
Definition at line 37 of file path_storage.h.
|
private |
Definition at line 145 of file path_storage.h.
|
virtualdefault |
|
inline |
Generates a loop analysis for the instructions in goto_programt and keys it against function ID.
Definition at line 120 of file path_storage.h.
|
pure virtual |
Clear all saved paths.
This is typically used because we want to terminate symbolic execution early. It doesn't matter too much in terms of memory usage since CBMC typically exits soon after we do that, however it's nice to have tests that check that the worklist is always empty when symex finishes.
Implemented in path_fifot, and path_lifot.
|
inline |
Is this storage empty?
Definition at line 88 of file path_storage.h.
|
inline |
Definition at line 131 of file path_storage.h.
|
inlineprivate |
Definition at line 147 of file path_storage.h.
|
inline |
Provide a unique L1 index for a given id
, starting from minimum_index
.
Definition at line 104 of file path_storage.h.
|
inline |
Definition at line 109 of file path_storage.h.
|
inline |
Reference to the next path to resume.
Definition at line 60 of file path_storage.h.
|
inline |
Remove the next path to resume from the storage.
Definition at line 78 of file path_storage.h.
|
privatepure virtual |
Implemented in path_fifot, and path_lifot.
|
privatepure virtual |
Implemented in path_fifot, and path_lifot.
|
pure virtual |
Add a path to resume to the storage.
Implemented in path_fifot, and path_lifot.
|
pure virtual |
How many paths does this storage contain?
Implemented in path_fifot, and path_lifot.
symex_nondet_generatort path_storaget::build_symex_nondet |
Counter for nondet objects, which require unique names.
Definition at line 94 of file path_storage.h.
incremental_dirtyt path_storaget::dirty |
Local variables are considered 'dirty' if they've had an address taken and therefore may be referred to by a pointer.
Definition at line 116 of file path_storage.h.
|
private |
Storage used by get_unique_index.
Definition at line 161 of file path_storage.h.
|
private |
Definition at line 162 of file path_storage.h.
|
private |
Definition at line 138 of file path_storage.h.
std::unordered_map<irep_idt, local_safe_pointerst> path_storaget::safe_pointers |
Map function identifiers to local_safe_pointerst instances.
This is to identify derferences that are guaranteed to be safe in a given execution context, thus helping to avoid symex to follow spurious error-handling paths.
Definition at line 100 of file path_storage.h.