|
CBMC
|
Base class for implementing memory models via additional constraints for SSA equations. More...
#include <partial_order_concurrency.h>
Inheritance diagram for partial_order_concurrencyt:
Collaboration diagram for partial_order_concurrencyt:Classes | |
| struct | a_rect |
Public Types | |
| enum | axiomt { AX_SC_PER_LOCATION =1, AX_NO_THINAIR =2, AX_OBSERVATION =4, AX_PROPAGATION =8 } |
| typedef SSA_stept | eventt |
| typedef symex_target_equationt::SSA_stepst | eventst |
| typedef eventst::const_iterator | event_it |
Public Member Functions | |
| partial_order_concurrencyt (const namespacet &_ns) | |
| virtual | ~partial_order_concurrencyt () |
Static Public Member Functions | |
| static irep_idt | rw_clock_id (event_it e, axiomt axiom=AX_PROPAGATION) |
| Build identifier for the read/write clock variable. More... | |
Protected Types | |
| typedef std::vector< event_it > | event_listt |
| typedef std::map< irep_idt, a_rect > | address_mapt |
| typedef std::map< event_it, unsigned > | numberingt |
Protected Member Functions | |
| void | build_event_lists (symex_target_equationt &equation, message_handlert &message_handler) |
| First call add_init_writes then for each shared read/write (or spawn) populate: 1) the address_map (with a list of reads/writes for the address of each event) 2) the numbering map (with per-thread unique number of every event) More... | |
| void | add_init_writes (symex_target_equationt &) |
| For each shared read event and for each shared write event that appears after spawn or has false guard prepend a shared write SSA step with non-deterministic value. More... | |
| irep_idt | address (event_it event) const |
| Produce an address ID for an event. More... | |
| symbol_exprt | clock (event_it e, axiomt axiom) |
| Produce a clock symbol for some event. More... | |
| void | build_clock_type () |
| Initialize the clock_type so that it can be used to number events. More... | |
| void | add_constraint (symex_target_equationt &equation, const exprt &cond, const std::string &msg, const symex_targett::sourcet &source) const |
| Simplify and add a constraint to equation. More... | |
| exprt | before (event_it e1, event_it e2, unsigned axioms) |
Build the partial order constraint for two events: if e1 and e2 are in the same atomic section then constrain with equality between their clocks otherwise constrain with e1 clock being less than e2 clock. More... | |
| virtual exprt | before (event_it e1, event_it e2)=0 |
Static Protected Member Functions | |
| static irep_idt | id (event_it event) |
| Produce the symbol ID for an event. More... | |
Protected Attributes | |
| const namespacet & | ns |
| address_mapt | address_map |
| numberingt | numbering |
| typet | clock_type |
Base class for implementing memory models via additional constraints for SSA equations.
Provides methods for encoding ordering of shared read/write events.
Definition at line 20 of file partial_order_concurrency.h.
|
protected |
Definition at line 58 of file partial_order_concurrency.h.
| typedef eventst::const_iterator partial_order_concurrencyt::event_it |
Definition at line 28 of file partial_order_concurrency.h.
|
protected |
Definition at line 50 of file partial_order_concurrency.h.
Definition at line 27 of file partial_order_concurrency.h.
Definition at line 26 of file partial_order_concurrency.h.
|
protected |
Definition at line 80 of file partial_order_concurrency.h.
| Enumerator | |
|---|---|
| AX_SC_PER_LOCATION | |
| AX_NO_THINAIR | |
| AX_OBSERVATION | |
| AX_PROPAGATION | |
Definition at line 31 of file partial_order_concurrency.h.
|
explicit |
Definition at line 18 of file partial_order_concurrency.cpp.
|
virtual |
Definition at line 23 of file partial_order_concurrency.cpp.
|
protected |
Simplify and add a constraint to equation.
| equation | target equation to be constrained with the cond |
| cond | condition expressing the constraint |
| msg | message for the constraint |
| source | the location of the constraint |
Definition at line 202 of file partial_order_concurrency.cpp.
|
protected |
For each shared read event and for each shared write event that appears after spawn or has false guard prepend a shared write SSA step with non-deterministic value.
| equation | the target equation to be modified |
Definition at line 27 of file partial_order_concurrency.cpp.
Produce an address ID for an event.
| event | SSA step for the event |
Definition at line 94 of file partial_order_concurrency.h.
Implemented in memory_model_sct, and memory_model_tsot.
Build the partial order constraint for two events: if e1 and e2 are in the same atomic section then constrain with equality between their clocks otherwise constrain with e1 clock being less than e2 clock.
| e1 | preceding event |
| e2 | succeeding event |
| axioms | clocks to be included in the resulting constraint |
Definition at line 168 of file partial_order_concurrency.cpp.
|
protected |
Initialize the clock_type so that it can be used to number events.
Definition at line 160 of file partial_order_concurrency.cpp.
|
protected |
First call add_init_writes then for each shared read/write (or spawn) populate: 1) the address_map (with a list of reads/writes for the address of each event) 2) the numbering map (with per-thread unique number of every event)
| equation | the target equation (containing the events to be processed) |
| message_handler | message handler to output statistics |
Definition at line 74 of file partial_order_concurrency.cpp.
|
protected |
Produce a clock symbol for some event.
| e | event is either shared read/write or spawn |
| axiom | clock variable |
Definition at line 137 of file partial_order_concurrency.cpp.
Produce the symbol ID for an event.
| event | SSA step for the event |
Definition at line 86 of file partial_order_concurrency.h.
|
static |
Build identifier for the read/write clock variable.
| e | either shared read or shared write event |
| axiom | the clock variable to be used (as part of the identifier) |
Definition at line 125 of file partial_order_concurrency.cpp.
|
protected |
Definition at line 59 of file partial_order_concurrency.h.
|
protected |
Definition at line 99 of file partial_order_concurrency.h.
|
protected |
Definition at line 48 of file partial_order_concurrency.h.
|
protected |
Definition at line 81 of file partial_order_concurrency.h.