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

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

 
 
 
typedef eventst::const_iterator  event_it
 

Public Member Functions

 
 

Static Public Member Functions

  Build identifier for the read/write clock variable.
 

Protected Types

typedef std::vector< event_itevent_listt
 
 
 

Protected Member Functions

  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)
 
  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.
 
  Produce an address ID for an event.
 
  Produce a clock symbol for some event.
 
  Initialize the clock_type so that it can be used to number events.
 
  Simplify and add a constraint to equation.
 
  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.
 
 

Static Protected Member Functions

  Produce the symbol ID for an event.
 

Protected Attributes

 
 
 
 

Detailed Description

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.

Member Typedef Documentation

◆  address_mapt

Definition at line 58 of file partial_order_concurrency.h.

◆  event_it

Definition at line 28 of file partial_order_concurrency.h.

◆  event_listt

Definition at line 50 of file partial_order_concurrency.h.

◆  eventst

◆  eventt

◆  numberingt

Member Enumeration Documentation

◆  axiomt

Enumerator
AX_SC_PER_LOCATION 
AX_NO_THINAIR 
AX_OBSERVATION 
AX_PROPAGATION 

Definition at line 31 of file partial_order_concurrency.h.

Constructor & Destructor Documentation

◆  partial_order_concurrencyt()

partial_order_concurrencyt::partial_order_concurrencyt ( const namespacet_ns )
explicit

Definition at line 18 of file partial_order_concurrency.cpp.

◆  ~partial_order_concurrencyt()

partial_order_concurrencyt::~partial_order_concurrencyt ( )
virtual

Definition at line 23 of file partial_order_concurrency.cpp.

Member Function Documentation

◆  add_constraint()

void partial_order_concurrencyt::add_constraint ( symex_target_equationtequation,
const exprtcond,
const std::string &  msg,
) const
protected

Simplify and add a constraint to equation.

Parameters
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 200 of file partial_order_concurrency.cpp.

◆  add_init_writes()

void partial_order_concurrencyt::add_init_writes ( symex_target_equationtequation )
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.

Parameters
equation the target equation to be modified

Definition at line 27 of file partial_order_concurrency.cpp.

◆  address()

irep_idt partial_order_concurrencyt::address ( event_it  event ) const
inlineprotected

Produce an address ID for an event.

Parameters
event SSA step for the event
Returns
L1-renamed identifier

Definition at line 94 of file partial_order_concurrency.h.

◆  before() [1/2]

virtual exprt partial_order_concurrencyt::before ( event_it  e1,
event_it  e2 
)
protectedpure virtual

Implemented in memory_model_sct, and memory_model_tsot.

◆  before() [2/2]

exprt partial_order_concurrencyt::before ( event_it  e1,
event_it  e2,
unsigned  axioms 
)
protected

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.

Parameters
e1 preceding event
e2 succeeding event
axioms clocks to be included in the resulting constraint
Returns
conjunction of constraints (one of each clock)

Definition at line 166 of file partial_order_concurrency.cpp.

◆  build_clock_type()

void partial_order_concurrencyt::build_clock_type ( )
protected

Initialize the clock_type so that it can be used to number events.

Definition at line 158 of file partial_order_concurrency.cpp.

◆  build_event_lists()

void partial_order_concurrencyt::build_event_lists ( symex_target_equationtequation,
message_handlertmessage_handler 
)
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)

Parameters
equation the target equation (containing the events to be processed)
message_handler message handler to output statistics

Definition at line 72 of file partial_order_concurrency.cpp.

◆  clock()

symbol_exprt partial_order_concurrencyt::clock ( event_it  e,
axiomt  axiom 
)
protected

Produce a clock symbol for some event.

Parameters
e event is either shared read/write or spawn
axiom clock variable
Returns
symbol of type clock_type with id from rw_clock_id

Definition at line 135 of file partial_order_concurrency.cpp.

◆  id()

static irep_idt partial_order_concurrencyt::id ( event_it  event )
inlinestaticprotected

Produce the symbol ID for an event.

Parameters
event SSA step for the event
Returns
identifier

Definition at line 86 of file partial_order_concurrency.h.

◆  rw_clock_id()

irep_idt partial_order_concurrencyt::rw_clock_id ( event_it  e,
axiomt  axiom = AX_PROPAGATION  
)
static

Build identifier for the read/write clock variable.

Parameters
e either shared read or shared write event
axiom the clock variable to be used (as part of the identifier)
Returns
identifier representing the clock variable of the event

Definition at line 123 of file partial_order_concurrency.cpp.

Member Data Documentation

◆  address_map

address_mapt partial_order_concurrencyt::address_map
protected

Definition at line 59 of file partial_order_concurrency.h.

◆  clock_type

typet partial_order_concurrencyt::clock_type
protected

Definition at line 99 of file partial_order_concurrency.h.

◆  ns

const namespacet& partial_order_concurrencyt::ns
protected

Definition at line 48 of file partial_order_concurrency.h.

◆  numbering

numberingt partial_order_concurrencyt::numbering
protected

Definition at line 81 of file partial_order_concurrency.h.


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

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