Averest


WeakMemory Module

Types

Type Description

Action

Actions (lbl,act,var,val) consist of a label, an action (which is either read or write, a variable var and a value read from or written to that variable

ActionRel

Functions and values

Function or value Description

CacheConsistency (threadL, constrL)

Full Usage: CacheConsistency (threadL, constrL)

Parameters:
    threadL : ('a * (string * string * string * int) list) list
    constrL : (string * string) list

cache consistency: one has to check whether for each variable, the actions of all threads on that variable can be brought into a sequential order

threadL : ('a * (string * string * string * int) list) list
constrL : (string * string) list

CausalConsistency (threadL, constrL)

Full Usage: CausalConsistency (threadL, constrL)

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : (string * string) list

Causal consistency is PRAM consistency computed with the transitive hull of the usual relation induced by the threads.

threadL : (string * (string * string * string * int) list) list
constrL : (string * string) list

GDO_Consistency (threadL, constrL)

Full Usage: GDO_Consistency (threadL, constrL)

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : (string * string) list

GDO consistency

threadL : (string * (string * string * string * int) list) list
constrL : (string * string) list

GPOGDOGWO_Consistency (threadL, constrL)

Full Usage: GPOGDOGWO_Consistency (threadL, constrL)

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : (string * string) list

GPO+GDO+GWO consistency

threadL : (string * (string * string * string * int) list) list
constrL : (string * string) list

GPOGDO_Consistency (threadL, constrL)

Full Usage: GPOGDO_Consistency (threadL, constrL)

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : (string * string) list

GPO+GDO consistency

threadL : (string * (string * string * string * int) list) list
constrL : (string * string) list

GPOGWO_Consistency (threadL, constrL)

Full Usage: GPOGWO_Consistency (threadL, constrL)

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : (string * string) list

GPO+GWO consistency

threadL : (string * (string * string * string * int) list) list
constrL : (string * string) list

GPO_Consistency (threadL, constrL)

Full Usage: GPO_Consistency (threadL, constrL)

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : (string * string) list

GPO consistency

threadL : (string * (string * string * string * int) list) list
constrL : (string * string) list

GWO_Consistency (threadL, constrL)

Full Usage: GWO_Consistency (threadL, constrL)

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : (string * string) list

GWO consistency

threadL : (string * (string * string * string * int) list) list
constrL : (string * string) list

PRAMConsistency (threadL, constrL)

Full Usage: PRAMConsistency (threadL, constrL)

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : (string * string) list

PRAM consistency: one has to check whether for each thread, the writes of all threads plus all actions of the considered thread can be sequentialized

threadL : (string * (string * string * string * int) list) list
constrL : (string * string) list

SequentialConsistency (threadL, constrL)

Full Usage: SequentialConsistency (threadL, constrL)

Parameters:
    threadL : ('a * (string * string * string * int) list) list
    constrL : (string * string) list

Sequential consistency demands that all actions can be ordered into a single thread such that all WR-constraints are respected and that all actions of each thread are kept in order. To this end, the following function tries to topologically sort the thereby defined partial order.

threadL : ('a * (string * string * string * int) list) list
constrL : (string * string) list

Sequentialize actions rel constrWR

Full Usage: Sequentialize actions rel constrWR

Parameters:
Returns: (string * string * string * int) list
actions : Set<string * string * string * int>
rel : ActionRel
constrWR : ActionRel
Returns: (string * string * string * int) list

SlowConsistency (threadL, constrL)

Full Usage: SlowConsistency (threadL, constrL)

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : (string * string) list

slow consistency: one has to check whether for each thread and each variable, the writes of all threads on that variable plus all actions on that variable of the considered thread can be brought into a sequential order

threadL : (string * (string * string * string * int) list) list
constrL : (string * string) list

SteinkeNuttConsistency (threadL, constrL) cname relX

Full Usage: SteinkeNuttConsistency (threadL, constrL) cname relX

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : 'a
    cname : string
    relX : Set<(string * string * string * int) * (string * string * string * int)>

check Steinke-Nutt definition for restricted relations relX

threadL : (string * (string * string * string * int) list) list
constrL : 'a
cname : string
relX : Set<(string * string * string * int) * (string * string * string * int)>

TransHull rel

Full Usage: TransHull rel

Parameters:
    rel : Set<'a * 'a>

Returns: Set<'a * 'a>
rel : Set<'a * 'a>
Returns: Set<'a * 'a>

WeakMemoryTool qscoll

Full Usage: WeakMemoryTool qscoll

Parameters:

the cgi program

qscoll : NameValueCollection

computeDataOrder (threadL, constrL)

Full Usage: computeDataOrder (threadL, constrL)

Parameters:
    threadL : ('a * (string * string * string * 'b) list) list
    constrL : (string * string) list

Returns: Set<(string * string * string * 'b) * (string * string * string * 'b)>
threadL : ('a * (string * string * string * 'b) list) list
constrL : (string * string) list
Returns: Set<(string * string * string * 'b) * (string * string * string * 'b)>

computeDataOrderOfOneVariable relP relR

Full Usage: computeDataOrderOfOneVariable relP relR

Parameters:
    relP : Set<('a * string * 'b * 'c) * ('a * string * 'b * 'c)>
    relR : Set<('a * string * 'b * 'c) * ('a * string * 'b * 'c)>

Returns: Set<('a * string * 'b * 'c) * ('a * string * 'b * 'c)>

compute Steinke-Nutt data order relation; it is the least relation relD with (1) relP is a subset of relD (2) relR is a subset of relD (3) rw(x,v1) <=P read(x,v2) >=R write(x,v2) with v1!=v2 implies rw(x,v1)<=D write(x,v2) (4) relD is transitive

relP : Set<('a * string * 'b * 'c) * ('a * string * 'b * 'c)>
relR : Set<('a * string * 'b * 'c) * ('a * string * 'b * 'c)>
Returns: Set<('a * string * 'b * 'c) * ('a * string * 'b * 'c)>

computeWriteReadWriteOrder relP relR

Full Usage: computeWriteReadWriteOrder relP relR

Parameters:
    relP : Set<'a * (string * string * 'b * 'c)>
    relR : Set<(string * 'd * 'e * 'f) * 'a>

Returns: Set<(string * 'd * 'e * 'f) * (string * string * 'b * 'c)>

compute Steinke-Nutt write-read-write relation

relP : Set<'a * (string * string * 'b * 'c)>
relR : Set<(string * 'd * 'e * 'f) * 'a>
Returns: Set<(string * 'd * 'e * 'f) * (string * string * 'b * 'c)>

constructThreadRelations (threadL, constrL)

Full Usage: constructThreadRelations (threadL, constrL)

Parameters:
    threadL : ('a * (string * 'b * 'c * 'd) list) list
    constrL : (string * string) list

Returns: Set<(string * 'b * 'c * 'd) * (string * 'b * 'c * 'd)> * Set<(string * 'b * 'c * 'd) * (string * 'b * 'c * 'd)>

construct the successor relations of the threads and the WR constraints

threadL : ('a * (string * 'b * 'c * 'd) list) list
constrL : (string * string) list
Returns: Set<(string * 'b * 'c * 'd) * (string * 'b * 'c * 'd)> * Set<(string * 'b * 'c * 'd) * (string * 'b * 'c * 'd)>

getActionsOfThread (threadL, constrL) tname

Full Usage: getActionsOfThread (threadL, constrL) tname

Parameters:
    threadL : ('a * 'b list) list
    constrL : 'c
    tname : 'a

Returns: Set<'b>

compute the set of actions of thread with name tname

threadL : ('a * 'b list) list
constrL : 'c
tname : 'a
Returns: Set<'b>

getActionsOnVariable (threadL, constrL) y

Full Usage: getActionsOnVariable (threadL, constrL) y

Parameters:
    threadL : ('a * ('b * 'c * 'd * 'e) list) list
    constrL : 'f
    y : 'd

Returns: Set<'b * 'c * 'd * 'e>

compute the set of actions on variable x

threadL : ('a * ('b * 'c * 'd * 'e) list) list
constrL : 'f
y : 'd
Returns: Set<'b * 'c * 'd * 'e>

getWriteActions (threadL, constrL)

Full Usage: getWriteActions (threadL, constrL)

Parameters:
    threadL : ('a * ('b * string * 'c * 'd) list) list
    constrL : 'e

Returns: Set<'b * string * 'c * 'd>

compute the set of all write actions

threadL : ('a * ('b * string * 'c * 'd) list) list
constrL : 'e
Returns: Set<'b * string * 'c * 'd>

parseExecutionFile testSequence

Full Usage: parseExecutionFile testSequence

Parameters:
    testSequence : string

Returns: (string * (string * string * string * int) list) list * (string * string) list
testSequence : string
Returns: (string * (string * string * string * int) list) list * (string * string) list

restrict rel actions

Full Usage: restrict rel actions

Parameters:
    rel : Set<'a * 'a>
    actions : Set<'a>

Returns: Set<'a * 'a>

compute the restriction of a relation on a set of actions

rel : Set<'a * 'a>
actions : Set<'a>
Returns: Set<'a * 'a>

sequentialize mem actions blocked rel constrWR

Full Usage: sequentialize mem actions blocked rel constrWR

Parameters:
Returns: (string * string * string * int) list

Function sequentialize aims at scheduling the given actions into a sequence that is consistent with the partial order relation rel, the WR-constraints, and that is read-write consistent (i.e. read actions read the latest written value). To this end, mem represents the current state of the main memory, so that only read actions can be scheduled that read a value that is currently in the memory. "blocked" is a set of pairs (x,l) that are added whenever a write action is scheduled with a WR-constraint to a read with label l. This means that no write operations writing to variable x can be scheduled until the read with label l has been scheduled (which unblocks the pair (x,l)). "rel" is the partial order relation imposed by the reduced threads and their WR-constraints, and constrWR are the WR-constraints. The sequentialization works as follows: We first compute the set of actions that do not have a predecessor action in rel (otherwise the predecessor must be scheduled first). We then remove all read actions that are not consistent with the current content of the main memory, since these can obviously not scheduled at this stage. Moreover, we remove all write actions that write to a variable x that contains a pair (x,l) in blocked. The remaining actions can all be scheduled, so that we can select any one of these. We may prefer read operations, since these may unblock write actions, and may no longer be scheduled if a write in chosen instead, however, for completeness, we should try all possibilities.

mem : Map<string, int>
actions : Set<Action>
blocked : Set<string * string>
rel : ActionRel
constrWR : ActionRel
Returns: (string * string * string * int) list

writeActList actL

Full Usage: writeActList actL

Parameters:
    actL : (string * string * string * int) list

actL : (string * string * string * int) list

writeExecution (threadL, constrL)

Full Usage: writeExecution (threadL, constrL)

Parameters:
    threadL : (string * (string * string * string * int) list) list
    constrL : (string * string) list

threadL : (string * (string * string * string * int) list) list
constrL : (string * string) list