SlideShare a Scribd company logo
1 of 74
Download to read offline
Can we efficiently verify concurrent
programs under relaxed memory
models in Maude?
Yehia Abd Arrahman, Marina Andric,
Alessandro Beggiato, and Alberto Lluch Lafuente
WRLA 2014, 5-6 April 2014, Grenoble
I would say yes.
Worth investigating
Can we efficiently verify concurrent programs
under relaxed memory models in Maude?
SOME
MOTIVATIONS
x := 1;
if y == 0 then
u := 1
else
skip
y := 1;
if x == 0 then
v := 1
else
skip
A SIMPLE PROGRAM
u v
===
0 0
0 1
1 0
1 1
What are the possible outcomes for u and v?
x := 1;
if y == 0 then
u := 1
else
skip
y := 1;
if x == 0 then
v := 1
else
skip
A SIMPLE PROGRAM
u v
===
0 0
0 1
1 0
1 1
✓
???
✓
✓
What are the possible outcomes for u and v?
✓
MORE ANNOYANCES...
x := 1
Maude> search P =>* Q .
...
States: 10!?
x := 2P =
while true do
x := 0
Maude> search P =>* Q .
Zzz...
P =
MORE ANNOYANCES...
THE FREE LUNCH IS OVER
Herb Sutter. “The free lunch is over”, Dr. Dobb's Journal, 30(3), March 2005 and C/C++
Users Journal, 23(2), February 2005.
<
“some optimizations are
actually far more than
optimizations, in that they can
change the meaning of
programs and cause visible
effects that can break
reasonable programmer
expectations.
CPU designers are generally
sane and well-adjusted folks
but they are under so much
pressure that they'll risk
changing the meaning of your
program, and possibly break it,
in order to make it run faster. “
Dekker Peterson Lamport Szymanski
0
100
200
300
400
500
600
700
800
900
1000
Sequentially Consistent
Relaxed (incorrect)
Relaxed (corrected)
STATE SPACE SIZE: SC vs RMM
Dekker Peterson Lamport Szymanski
0
200
400
600
800
1000
1200
No reduction
Some approximation
Some other approximation
Partial-Order-Reduction
Some combination
REDUCTIONS (verification)
Dekker Peterson Lamport Szymanski
0
50
100
150
200
250
300
350
400
450
Breadth-First Search
Best-First with some heuristic
Best-First with some other heuristic
Best-First with yet another heuristic
REDUCTIONS (bug-finding)
RELAXED
MEMORY MODELS
SEQUENTIAL CONSISTENCY
“A multiprocessor system is sequentially consistent if
the result of any execution is the same as if the
operations of all the processors were executed in
some sequential order, and the operations of each
individual processor appear in this sequence in the
order specified by its program.”
- Leslie Lamport, "How to Make a Multiprocessor Computer That
Correctly Executes Multiprocess Programs", IEEE Trans. Comput, 1979
Program order: among operations from
individual processors
Atomicity: memory operations must execute
atomically with respect to each other
RELAXING CONSISTENCY
Relaxing program order:

Write-to-Read

Write-to-Write

Read-to-Read

Read-to-Write
Relaxing atomicity:

Read own write early

Read others’ write early
HIERARCHY OF RELAXATIONS
SC
TSO IBM-370
PC
RCsc
PowerPC
WO Alpha
RCPc
RMO
PSO
Write-to-Read
Write-to-Write
Read-to-Read
Read-to-Write
source: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_506_Spring_2013/10c_ks
TOTAL STORE ORDERING (TSO)
Relaxations:

Write-to-Read

Read own write early
Why?

Mitigate write latency

Some programs may still be “correct”
(e.g. sequentially consistent)
TSO “AXIOMATICALLY”
TSO-executions are sequences of reads and writes
r(x,u) < r(y,v) < w(z,w) < ...
TSO “AXIOMATICALLY”
TSO-executions are sequences of reads and writes
r(x,u) < r(y,v) < w(z,w) < ...
such that
r <p r' => r < r' [r-r preserved]
r <p w' => r < w' [r-w preserved]
w <p w' => w < w' [w-w preserved]
w-r allowed
TSO “AXIOMATICALLY”
TSO-executions are sequences of reads and writes
r(x,u) < r(y,v) < w(z,w) < ...
such that
r <p r' => r < r' [r-r preserved]
r <p w' => r < w' [r-w preserved]
w <p w' => w < w' [w-w preserved]
and
r(x,u) are such that
(1) v if s(x,v) is the max wrt. < among all s(x,v) s.t.
s(x,v) < r(x,u) or
s(x,v) <p r(x,u)
(2) x0 (initial value for x) if there is no s(x,v) above.
(read own's write early)
w-r allowed
TSO “OPERATIONALLY”
SHARED MEMORY
THREAD THREAD
TSO “OPERATIONALLY”
SHARED MEMORY
THREAD THREAD
WRITE BUFFER WRITE BUFFER
Formalization of memory models
 Axiomatic [Adve, Alglage, Sewel, Owens, Higham,...]
 Operational [Boudol, Petri, Atig, Bouajjani, Burckhardt,...]
 Adequacy, generality, etc.
Correctness criteria
 Sequential consistency, linearizability, serializability,
quiescent/eventual consistency... [Herlihy, Shavit, Shapiro,...]
 “Fundamental property” (data-race free programs are
sequential consistent) [Saraswat et al.]
Portability of programs
 Check whether P/SC ≈ P/RMM
 Otherwise repair P e.g. inserting fences [Wolper, Bouajjani...]
SOME KEY ISSUES
Verification approaches
 Directly use SC verification tools
e.g. for programs that are linearizable even under
RMMs [Burckhardt, Cohen, Owens]
 Program Transformation and then SC tools
e.g. [Alglave, Bouajjani]
 Ad-hoc verification under RMMs.
e.g. Some... (see later)
Some tools
 CBMC [Alglave et al]
 CheckFence [Burckhardt et al]
 DFENCE [Lui et al]
SOME KEY ISSUES
THIS TALK's
PERSPECTIVE
OUR SPIRIT HERE
 Language designers prototyping new RMM-
aware languages with Maude (the natural
framework!).
 Interested in “search” for P/RMM (for checking
properties, for fence insertions, etc.).
 Willing to make search efficient but not willing
to modify the Maude engine.
A SIMPLE
MULTI-THREADED
LANGUAGE
A SIMPLE LANGUAGE
CONFIGURATIONS
MEMORIES AND VIEWS
Memory updates
Local to Global
In the following abbreviates
SEMANTICS: thread interleaving
sorry...
SEMANTICS: skip
SEMANTICS: assignments
SEMANTICS: fences
SEMANTICS: sequential composition
SEMANTICS: branches
SEMANTICS: loops
SEMANTICS: wait
SEMANTICS: buffer commits
MORE ANNOYANCES...
x := 1
Maude> search P =>* Q .
...
States: 10!?
x := 2P =
x|->0
===============
||
---------------
x:=1; || x:=2;
x|->0
===============
x|->1 ||
---------------
skip || x:=2;
x|->0
===============
|| x|->2
---------------
x:=1 || skip
x|->0
===============
x|->1 || x|->2
---------------
skip || skip
x|->1
===============
||
---------------
skip || x:=2;
x|->2
===============
||
---------------
x:=1 || skip
x|->1
===============
|| x|->2
---------------
skip || skip
x|->1
===============
||
---------------
skip || skip
x|->2
===============
x|->1 ||
---------------
skip || skip
x:=1;
x:=1;
x:=1;
x:=2;
x:=2;
x:=2;
commit commit
commit commit
commitcommit
x|->2
===============
||
---------------
skip || skip
state
Shared memory
Thread buffer
Thread program
x|->0
===============
||
---------------
x:=1; || x:=2;
x|->0
===============
x|->1 ||
---------------
skip || x:=2;
x|->0
===============
|| x|->2
---------------
x:=1 || skip
x|->0
===============
x|->1 || x|->2
---------------
skip || skip
x|->1
===============
||
---------------
skip || x:=2;
x|->2
===============
||
---------------
x:=1 || skip
x|->1
===============
|| x|->2
---------------
skip || skip
x|->1
===============
||
---------------
skip || skip
x|->2
===============
x|->1 ||
---------------
skip || skip
x:=1;
x:=1;
x:=1;
x:=2;
x:=2;
x:=2;
commit commit
commit commit
commitcommit
x|->2
===============
||
---------------
skip || skip
state
Shared memory
Thread buffer
Thread program
Usual state
space with SC
while true do
x := 0
Maude> search P =>* Q .
Zzz...
P =
MORE ANNOYANCES...
x|->0
====================
--------------------
while(true) do x:=0
x|->0
====================
--------------------
x:=0;
while(true) do x:=0
while(true)
x:=0;
x|->0
====================
x|->0
--------------------
while(true) do x:=0
x|->0
====================
x|->0
--------------------
x:=0;
while(true) do x:=0
while(true)
x|->0
====================
x|->0
x|->0
--------------------
while(true) do x:=0
while(true)
x:=0;
commit
commit
commit
...
SOME
REDUCTION
TECHNIQUES
Partial Order Reduction Techniques
 Partial Orders [Alglave et al. @ CAV 2013]
 Persistent Sets [Linden&Wolper @ TACAS 2013]
 Ample sets (via SPIN) [Jonson @ CAN2009]
Approximation/abstraction techniques
 Predicate abstraction [Dan et al. @ SAS 2013]
 Bounded context-switches [Abdulla et al. @ TACAS 2012]
 Single-buffer semantics [Atig et al. @ CAV 2011]
 Buffers-as-sets abstraction [Kuperstein et al. @ PLDI 2011]
 Bounded buffers [Kuperstein et al. @ FMCAD 2011]
Other
 SAT/BMC [Burckhardt et al @ CAV 6/7/8, Gopalakrishnan et al. @ CAV 04]
 Buffer automata [Linden&Wolper @ SPIN2010, TACAS 2013]
 Monitors [Burnim et al. @ TACAS 2011, Burckhardt&Musuvathi @ CAV 2008]
TEN+ YEARS OF RESEARCH
Equational abstractions? [Meseguer&Palomino&Martí-Oliet @ TCS 2008]
Partial-order reduction? [Farzan&Meseguer @ TERMGRAPH 2006]
Search strategies? [Martí-Oliet&Meseguer&Verdejo @ WRLA 2004]
SOME SIMPLE
APPROXIMATIONS
FOR TSO
Disclaimer: proof-of-concepts, for the
“good” ones see the above cited papers.
ONE OF OUR ANOYANCES
while true do
x := 0
Maude> search P =>* Q .
Zzz..
BUFFERS AS SETS OF UPDATES
Abstract buffers as sets of updates:
 Make ACI1 (i.e. buffer becomes sets of updates);
 Make commit non-deterministic (usual+no effect);
 Make evaluation of expressions non-deterministic.
You get an over-approximation:
 Finite state space;
 Preservation of reachability properties.
 (Possibly) some “spurious” behaviours;
Dekker Peterson Lamport Szymanski
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
No reduction
Buffers-as-Sets
Buffers-as-Ordered-Maps
Force-Flush
MORE STATES
BUFFERS AS ORDERED MAPS
Approximation that
 Guarantees finite state space;
 Introduces some executions;
 Preserves some reachability properties???
(under investigation)
“SPURIOUS” EXECUTIONS
x:=1;
y:=1;
x:=2
wait x=0 & y=1
x|->0 , y |->0
===============
||
---------------
x:=1; || wait(...)
y:=1; ||
x:=2 ||
x|->0 , y |->0
===============
x|->1 ||
---------------
y:=1; || wait(...)
x:=2; ||
x|->0 , y |->0
===============
x|->1 ||
y|->1 ||
---------------
x:=2; || wait(...)
x|->0 , y |->0
===============
x|->1 ||
y|->1 ||
x|->2 ||
---------------
skip || wait(...)
x|->1 , y |->0
===============
||
---------------
y:=1; || wait(...)
x:=2; ||
x|->1 , y |->0
===============
y|->1 ||
---------------
x:=2; || wait(...)
x|->1 , y |->0
===============
y|->1 ||
x|->2 ||
---------------
skip || wait(...)
x|->1 , y |->1
===============
||
---------------
x:=2; || wait(...)
x|->1 , y |->1
===============
x|->2 ||
---------------
skip || wait(...)
x|->2 , y |->1
===============
||
---------------
skip || wait(...)
commit
commitcommit
commit
commit
commit
x|->0 , y |->0
===============
y|->1 ||
x|->2 ||
---------------
skip || wait(...)
wait!
ONE “SPURIOUS”
EXECUTION
x|->0 , y |->1
===============
y|->1 ||
---------------
skip || wait(...)
commit
Dekker Peterson Lamport Szymanski
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
No reduction
Buffers-as-Sets
Buffers-as-Ordered-Maps
Force-Flush
REDUCTIONS
FORCE-FLUSH APPROXIMATION
Under-approximation that
 Does not guarantee finite state space ;
 Some behaviours may be lost;
 Does not introduce spurious behaviours.
(up to some equivalence: stuttering and
depending on the state observations).
M
===============
x|->u ||
... ||
x|->v ||
---------------
S || T
M ◦ x|->u
===============
... ||
x|->v ||
---------------
S || T
NO “SPURIOUS” EXECUTION
M
===============
x|->u ||
... ||
||
---------------
x:=v; S || T
M ◦ x|->u
===============
... ||
||
---------------
x:=v; S || T
commit
x:=v x:=v
(up to some equivalence: stuttering and
depending on the state observations).
Dekker Peterson Lamport Szymanski
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
No reduction
Buffers-as-Sets
Buffers-as-Ordered-Maps
Force-Flush
REDUCTIONS
PARTIAL-ORDER
REDUCTION
FOR RMMs
AMPLE SETS
Main idea
 Explore only a subset ample(s) of the succesors of s...
 ...such that ample(s):
C0: ample(s) empty only if s is a deadlock;
C1: ample(s) contains invisible actions;
C2: no transition that is dependent on a transition in
ample(s) occurs in the original system without a
transition in ample(s) occurring first;
C3: no action outside ample(s) is delayed forever.
 You will get a stutter equivalent transition system.
SIMPLE POR FOR TSO
Simple heuristic: assignments
x := u
are independent of actions of other threads
since their effect is local (on the buffer).
They are also invisible unless one wants to
observe buffers or programs.
Dekker Peterson Lamport Szymanski
0
100
200
300
400
500
600
700
800
900
1000
No reduction
Partial-Order Reduction
REDUCTIONS (verification)
SEARCH
STRATEGIES
FOR RMMs
DIRECTED MODEL CHECKING
Main idea
 Replace the exploration algorithm (NDFS/BFS)
by a “guided” algorithm (A*, Best-First, etc.)
 Domain/property-based “heuristic” functions
to rank states or executions
“Heuristics for model checking Java” [Groce&Visser]
 Promote interleavings (we think “sequentially”)
 Promote code coverage
Done for JPF, SPIN, etc.
x|->0 , y|->0
===============
||
---------------
x:=1; || y:=1;
y==0? || x==0?
x|->0 , y|->0
===============
x->1 ||
---------------
y==0? || y:=1;
|| x==0?
x|->0 , y|->0
===============
|| y->1
---------------
x:=1 || x==0?
y==0? ||
x|->0 , y|->0
===============
x->1 || y->1
---------------
y==0? || x==0?
x|->1 , y|->0
===============
||
---------------
y==0? || y:=1;
|| x==0?
x|->0 , y|->1
===============
||
---------------
X:=1 || x==0?
y==0? ||
x:=1;
x:=1;
y:=1;
y:=1;flush flush
... ...
x|->0 , y|->0
===============
x->1 || y->1
---------------
cs || x==0?
x|->0 , y|->0
===============
x->1 || y->1
---------------
y==0? || cs
x|->0 , y|->0
===============
||
---------------
x:=1; || y:=1;
y==0? || x==0?
x|->0 , y|->0
===============
x->1 ||
---------------
y==0? || y:=1;
|| x==0?
x|->0 , y|->0
===============
|| y->1
---------------
x:=1 || x==0?
y==0? ||
x|->0 , y|->0
===============
x->1 || y->1
---------------
y==0? || x==0?
x|->1 , y|->0
===============
||
---------------
y==0? || y:=1;
|| x==0?
x|->0 , y|->1
===============
||
---------------
X:=1 || x==0?
y==0? ||
x:=1;
x:=1;
y:=1;
y:=1;flush flush
0
0
0
2
1
0
0
0
1
... ...
x|->0 , y|->0
===============
x->1 || y->1
---------------
cs || x==0?
x|->0 , y|->0
===============
x->1 || y->1
---------------
y==0? || cs
2 2
Count number of
non-empty buffers
Dekker Peterson Lamport Szymanski
0
50
100
150
200
250
300
350
400
450
Breadth-First Search
Best-First + "number of non-empty buffers" heuristic
Best-First + "number of pending writes" heuristic
Best-First + "number of inconsistent pending writes" heuristic
REDUCTIONS (bug-finding)
CONCLUDING
REMARKS
I would say yes.
Worth investigating
Can we efficiently verify concurrent programs
under relaxed memory models in Maude?
Beyond TSO: PSO, RMO, etc.1
2
FUTURE WORK?
Other languages/primitives: see e.g.
KernelC/x86-TSO in K [Serbanuta]
3 Proof techniques (with Maude)
TAHNSK!
REFERENCES
[Linden&Wolper @ TACAS 2013]
Alexander Linden, Pierre Wolper: A Verification-Based Approach to Memory Fence
Insertion in PSO Memory Systems. TACAS 2013: 339-353
[Dan&MMeshman&Vechev&Yahav @ SAS 2013]
Andrei Marian Dan, Yuri Meshman, Martin T. Vechev, Eran Yahav: Predicate
Abstraction for Relaxed Memory Models. SAS 2013: 84-104
[Alglave et al. @ CAV 2013]
Jade Alglave, Daniel Kroening, Michael Tautschnig: Partial Orders for Efficient
Bounded Model Checking of Concurrent Software. CAV 2013: 141-157
[Abdulla&Atig&Chen&Leonardsson&Rezine @ TACAS 2012]
Abdulla, P.A., Atig, M.F., Chen, Y.-F., Leonardsson, C., Rezine, A.: Counter- Example
Guided Fence Insertion under TSO. In: TACAS 2012. LNCS, vol. 7214 (2012)
[Atig&Bouajjani&Parlato @ CAV 2011]
Atig, M.F., Bouajjani, A., Parlato, G.: Getting Rid of Store-Buffers in TSO Analysis. In:
Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806 (2011)
[Kuperstein&Vechev&Yahav @ PLDI 2011]
Kuperstein, M., Vechev, M., Yahav, E.: Partial-coherence abstractions for relaxed
memory models. In: PLDI 2011 (2011)
REFERENCES (1)
[Burnim&Sen&Stergiou @ TACAS 2011]
Jacob Burnim, Koushik Sen, Christos Stergiou: Sound and Complete Monitoring of
Sequential Consistency for Relaxed Memory Models. TACAS 2011: 11-25
[Burnim&Sen& C. Stergiou @ TACAS 2011]
J. Burnim, K. Sen, and C. Stergiou. Sound and complete monitoring of sequential
consistency in relaxed memory models. In TACAS, 2011.
[Kuperstein&Vechev&Yahav @ FMCAD 2011]
M. Kuperstein, M. Vechev, and E. Yahav. Automatic inference of memory fences. In
FMCAD, 2011.
[Linedn&Wolper @ SPIN 2010] A. Linden and P. Wolper. An automata-based symbolic
approach for verifying programs on relaxed memory models. In SPIN, 2010.
[Jonson @ CAN2009]
Jonsson, B.: State-space exploration for concurrent algorithms under weak memory
orderings: (preliminary version). SIGARCH Comput. Archit. News 36, 65–71 (2009)
[Burckhardt&Musuvathi @ CAV 2008]
Burckhardt,S.,Musuvathi,M.: Effective Program Verification for Relaxed Memory
Models. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 107–120.
Springer, Heidelberg (2008)
REFERENCES (2)
[Burckhardt&Alur&Martin @ CAV 2007]
Burckhardt, S., Alur, R., Martin, M.M.K.: Checkfence: checking consistency of
concurrent data types on relaxed memory models. In: ACM SIGPLAN 2007
Conference on Programming Lan- guage Design and Implementation (2007)
[Burckhardt&Alur&Martin @ CAV 2006]
Burckhardt,S.,Alur,R.,Martin,M.M.K.: Bounded Model Checking of Concurrent Data
Types on Relaxed Memory Models: A Case Study. In: CAV 2006. LNCS 4144. (2006)
[Gopalakrishnan&Yang&Sivaraj @ CAV 2004]
Gopalakrishnan, G., Yang, Y., Sivaraj, H.: QB or not QB: An efficient execution
verification tool for memory orderings. In: CAV 2004. LNCS, vol. 3114 (2004)
[Park&Dill @ PAA 1995]
Park, S., Dill, D.L.: An executable specification, analyzer and verifier for rmo (relaxed
memory order). In: SPAA 1995: Proceedings of the Seventh Annual ACM Symposium
on Parallel Algorithms and Architectures, pp. 34–41. ACM, New York (1995)
REFERENCES (3)
[Meseguer&Palomino&Martí-Oliet @ TCS 2008]
José Meseguer, Miguel Palomino, Narciso Martí-Oliet: Equational abstractions. Theor.
Comput. Sci. 403(2-3): 239-264 (2008)
[Farzan&Meseguer @ TERMGRAPH 2006]
Azadeh Farzan, José Meseguer: Partial Order Reduction for Rewriting Semantics of
Programming Languages. Electr. Notes Theor. Comput. Sci. 176(4): 61-78 (2007)
[Rodríguez 2009 @ WRLA 2009]
Rodríguez, D.E.: Combining techniques to reduce state space and prove strong
properties. In: WRLA. Volume 238(3) of ENTCS. (2009) 267 – 280
[Lluch&Meseguer&Vandin @ ICFEM 2012]
Alberto Lluch-Lafuente, José Meseguer, Andrea Vandin: State Space c-Reductions of
Concurrent Systems in Rewriting Logic. ICFEM 2012: 430-446
[Martí-Oliet&Meseguer&Verdejo @ WRLA 2004]
Narciso Martí-Oliet, José Meseguer, Alberto Verdejo: Towards a Strategy Language
for Maude. Electr. Notes Theor. Comput. Sci. 117: 417-441 (2005)
[Groce&Visser @ STTT 2004]
Alex Groce, Willem Visser: Heuristics for model checking Java programs. STTT 6(4):
260-276 (2004)
REFERENCES (4)

More Related Content

Similar to Can we efficiently verify concurrent programs under relaxed memory models in Maude?

Sulthan's_JAVA_Material_for_B.Sc-CS.pdf
Sulthan's_JAVA_Material_for_B.Sc-CS.pdfSulthan's_JAVA_Material_for_B.Sc-CS.pdf
Sulthan's_JAVA_Material_for_B.Sc-CS.pdfSULTHAN BASHA
 
DevOps for absolute beginners
DevOps for absolute beginnersDevOps for absolute beginners
DevOps for absolute beginnersAhmed Misbah
 
Product! - The road to production deployment
Product! - The road to production deploymentProduct! - The road to production deployment
Product! - The road to production deploymentFilippo Zanella
 
Python Programming - III. Controlling the Flow
Python Programming - III. Controlling the FlowPython Programming - III. Controlling the Flow
Python Programming - III. Controlling the FlowRanel Padon
 
Scaling and Embracing Failure: Clustering Docker with Mesos
Scaling and Embracing Failure: Clustering Docker with MesosScaling and Embracing Failure: Clustering Docker with Mesos
Scaling and Embracing Failure: Clustering Docker with MesosRob Gulewich
 
Sql server baselines
Sql server baselinesSql server baselines
Sql server baselinesMike Walsh
 
DevOps feedback loops
DevOps feedback loopsDevOps feedback loops
DevOps feedback loopsPaul Peissner
 
Lesson 1 of c programming algorithms and flowcharts.pptx
Lesson 1 of c programming algorithms and flowcharts.pptxLesson 1 of c programming algorithms and flowcharts.pptx
Lesson 1 of c programming algorithms and flowcharts.pptxAlinaMishra7
 
Aug NYC July 12 event
Aug NYC July 12 eventAug NYC July 12 event
Aug NYC July 12 eventAUGNYC
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningArul ChristhuRaj Alphonse
 

Similar to Can we efficiently verify concurrent programs under relaxed memory models in Maude? (20)

Sulthan's_JAVA_Material_for_B.Sc-CS.pdf
Sulthan's_JAVA_Material_for_B.Sc-CS.pdfSulthan's_JAVA_Material_for_B.Sc-CS.pdf
Sulthan's_JAVA_Material_for_B.Sc-CS.pdf
 
DevOps@Morpho in 2014
DevOps@Morpho in 2014DevOps@Morpho in 2014
DevOps@Morpho in 2014
 
DevOps for absolute beginners
DevOps for absolute beginnersDevOps for absolute beginners
DevOps for absolute beginners
 
Product! - The road to production deployment
Product! - The road to production deploymentProduct! - The road to production deployment
Product! - The road to production deployment
 
Pmp memory-sheets
Pmp memory-sheetsPmp memory-sheets
Pmp memory-sheets
 
Report hospital
Report hospitalReport hospital
Report hospital
 
Python Programming - III. Controlling the Flow
Python Programming - III. Controlling the FlowPython Programming - III. Controlling the Flow
Python Programming - III. Controlling the Flow
 
OOP Java
OOP JavaOOP Java
OOP Java
 
WoMakersCode 2016 - Shit Happens
WoMakersCode 2016 -  Shit HappensWoMakersCode 2016 -  Shit Happens
WoMakersCode 2016 - Shit Happens
 
PARADIGM IT.pptx
PARADIGM IT.pptxPARADIGM IT.pptx
PARADIGM IT.pptx
 
Scaling and Embracing Failure: Clustering Docker with Mesos
Scaling and Embracing Failure: Clustering Docker with MesosScaling and Embracing Failure: Clustering Docker with Mesos
Scaling and Embracing Failure: Clustering Docker with Mesos
 
Sql server baselines
Sql server baselinesSql server baselines
Sql server baselines
 
Cse
CseCse
Cse
 
RTOS - Real Time Operating Systems
RTOS - Real Time Operating SystemsRTOS - Real Time Operating Systems
RTOS - Real Time Operating Systems
 
FRC Reporting Beginner Course
FRC Reporting Beginner CourseFRC Reporting Beginner Course
FRC Reporting Beginner Course
 
Oracle Fusion Financial Report Centre Reporting Beginner course
Oracle Fusion Financial Report Centre Reporting Beginner courseOracle Fusion Financial Report Centre Reporting Beginner course
Oracle Fusion Financial Report Centre Reporting Beginner course
 
DevOps feedback loops
DevOps feedback loopsDevOps feedback loops
DevOps feedback loops
 
Lesson 1 of c programming algorithms and flowcharts.pptx
Lesson 1 of c programming algorithms and flowcharts.pptxLesson 1 of c programming algorithms and flowcharts.pptx
Lesson 1 of c programming algorithms and flowcharts.pptx
 
Aug NYC July 12 event
Aug NYC July 12 eventAug NYC July 12 event
Aug NYC July 12 event
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
 

More from Alberto Lluch Lafuente

Many-to-Many Information Flow Policies
Many-to-Many Information Flow PoliciesMany-to-Many Information Flow Policies
Many-to-Many Information Flow PoliciesAlberto Lluch Lafuente
 
Aggregate Programming through a Soft Modal Logic
Aggregate Programming through a Soft Modal LogicAggregate Programming through a Soft Modal Logic
Aggregate Programming through a Soft Modal LogicAlberto Lluch Lafuente
 
Collaborative Task Execution In Volunteer Clouds (or how to choose a sub-revi...
Collaborative Task Execution In Volunteer Clouds (or how to choose a sub-revi...Collaborative Task Execution In Volunteer Clouds (or how to choose a sub-revi...
Collaborative Task Execution In Volunteer Clouds (or how to choose a sub-revi...Alberto Lluch Lafuente
 
State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013
State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013
State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013Alberto Lluch Lafuente
 
Adaptable Transition Systems @ ASCENS Meeting Prague 2013
Adaptable Transition Systems @ ASCENS Meeting Prague 2013Adaptable Transition Systems @ ASCENS Meeting Prague 2013
Adaptable Transition Systems @ ASCENS Meeting Prague 2013Alberto Lluch Lafuente
 
White Box Adaptation @ CINA Meeting 2013
White Box Adaptation @ CINA Meeting 2013White Box Adaptation @ CINA Meeting 2013
White Box Adaptation @ CINA Meeting 2013Alberto Lluch Lafuente
 
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...Alberto Lluch Lafuente
 
State Space c-Reductions of Concurrent Systems in Rewriting Logic @ ETAPS Wor...
State Space c-Reductions of Concurrent Systems in Rewriting Logic @ ETAPS Wor...State Space c-Reductions of Concurrent Systems in Rewriting Logic @ ETAPS Wor...
State Space c-Reductions of Concurrent Systems in Rewriting Logic @ ETAPS Wor...Alberto Lluch Lafuente
 
A conceptual framework for behavioural adaptation @ Leicester 2011
A conceptual framework for behavioural adaptation @ Leicester 2011A conceptual framework for behavioural adaptation @ Leicester 2011
A conceptual framework for behavioural adaptation @ Leicester 2011Alberto Lluch Lafuente
 
Evaluating the performance of model transformation styles with Maude @ Sympos...
Evaluating the performance of model transformation styles with Maude @ Sympos...Evaluating the performance of model transformation styles with Maude @ Sympos...
Evaluating the performance of model transformation styles with Maude @ Sympos...Alberto Lluch Lafuente
 
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011Alberto Lluch Lafuente
 
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009A Graph Syntax for Processes and Services @ Workshop WS-FM 2009
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009Alberto Lluch Lafuente
 

More from Alberto Lluch Lafuente (16)

Many-to-Many Information Flow Policies
Many-to-Many Information Flow PoliciesMany-to-Many Information Flow Policies
Many-to-Many Information Flow Policies
 
Aggregate Programming through a Soft Modal Logic
Aggregate Programming through a Soft Modal LogicAggregate Programming through a Soft Modal Logic
Aggregate Programming through a Soft Modal Logic
 
A Semiring-valued Temporal Logic
A Semiring-valued Temporal LogicA Semiring-valued Temporal Logic
A Semiring-valued Temporal Logic
 
Collaborative Task Execution In Volunteer Clouds (or how to choose a sub-revi...
Collaborative Task Execution In Volunteer Clouds (or how to choose a sub-revi...Collaborative Task Execution In Volunteer Clouds (or how to choose a sub-revi...
Collaborative Task Execution In Volunteer Clouds (or how to choose a sub-revi...
 
State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013
State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013
State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013
 
Adaptable Transition Systems @ ASCENS Meeting Prague 2013
Adaptable Transition Systems @ ASCENS Meeting Prague 2013Adaptable Transition Systems @ ASCENS Meeting Prague 2013
Adaptable Transition Systems @ ASCENS Meeting Prague 2013
 
White Box Adaptation @ CINA Meeting 2013
White Box Adaptation @ CINA Meeting 2013White Box Adaptation @ CINA Meeting 2013
White Box Adaptation @ CINA Meeting 2013
 
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
 
State Space c-Reductions of Concurrent Systems in Rewriting Logic @ ETAPS Wor...
State Space c-Reductions of Concurrent Systems in Rewriting Logic @ ETAPS Wor...State Space c-Reductions of Concurrent Systems in Rewriting Logic @ ETAPS Wor...
State Space c-Reductions of Concurrent Systems in Rewriting Logic @ ETAPS Wor...
 
A conceptual framework for behavioural adaptation @ Leicester 2011
A conceptual framework for behavioural adaptation @ Leicester 2011A conceptual framework for behavioural adaptation @ Leicester 2011
A conceptual framework for behavioural adaptation @ Leicester 2011
 
Evaluating the performance of model transformation styles with Maude @ Sympos...
Evaluating the performance of model transformation styles with Maude @ Sympos...Evaluating the performance of model transformation styles with Maude @ Sympos...
Evaluating the performance of model transformation styles with Maude @ Sympos...
 
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
 
Maude .:° ASCENS 2011
Maude .:° ASCENS 2011Maude .:° ASCENS 2011
Maude .:° ASCENS 2011
 
IMT Welcome Day 2011
IMT Welcome Day 2011IMT Welcome Day 2011
IMT Welcome Day 2011
 
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009A Graph Syntax for Processes and Services @ Workshop WS-FM 2009
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009
 
An Algebra of Hierarchical Graphs
An Algebra of Hierarchical GraphsAn Algebra of Hierarchical Graphs
An Algebra of Hierarchical Graphs
 

Recently uploaded

pumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit flypumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit flyPRADYUMMAURYA1
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPirithiRaju
 
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...dkNET
 
GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)Areesha Ahmad
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxRizalinePalanog2
 
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryFAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryAlex Henderson
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Monika Rani
 
Zoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfZoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfSumit Kumar yadav
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICEayushi9330
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformationAreesha Ahmad
 
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Servicenishacall1
 
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 60009654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000Sapana Sha
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .Poonam Aher Patil
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learninglevieagacer
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptxAlMamun560346
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)Areesha Ahmad
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bSérgio Sacani
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLkantirani197
 

Recently uploaded (20)

pumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit flypumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit fly
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
 
GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
 
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryFAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
 
CELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdfCELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdf
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
 
Zoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfZoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdf
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
 
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
 
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 60009654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
 

Can we efficiently verify concurrent programs under relaxed memory models in Maude?

  • 1. Can we efficiently verify concurrent programs under relaxed memory models in Maude? Yehia Abd Arrahman, Marina Andric, Alessandro Beggiato, and Alberto Lluch Lafuente WRLA 2014, 5-6 April 2014, Grenoble
  • 2. I would say yes. Worth investigating Can we efficiently verify concurrent programs under relaxed memory models in Maude?
  • 4. x := 1; if y == 0 then u := 1 else skip y := 1; if x == 0 then v := 1 else skip A SIMPLE PROGRAM u v === 0 0 0 1 1 0 1 1 What are the possible outcomes for u and v?
  • 5. x := 1; if y == 0 then u := 1 else skip y := 1; if x == 0 then v := 1 else skip A SIMPLE PROGRAM u v === 0 0 0 1 1 0 1 1 ✓ ??? ✓ ✓ What are the possible outcomes for u and v? ✓
  • 6. MORE ANNOYANCES... x := 1 Maude> search P =>* Q . ... States: 10!? x := 2P =
  • 7. while true do x := 0 Maude> search P =>* Q . Zzz... P = MORE ANNOYANCES...
  • 8. THE FREE LUNCH IS OVER Herb Sutter. “The free lunch is over”, Dr. Dobb's Journal, 30(3), March 2005 and C/C++ Users Journal, 23(2), February 2005. < “some optimizations are actually far more than optimizations, in that they can change the meaning of programs and cause visible effects that can break reasonable programmer expectations. CPU designers are generally sane and well-adjusted folks but they are under so much pressure that they'll risk changing the meaning of your program, and possibly break it, in order to make it run faster. “
  • 9. Dekker Peterson Lamport Szymanski 0 100 200 300 400 500 600 700 800 900 1000 Sequentially Consistent Relaxed (incorrect) Relaxed (corrected) STATE SPACE SIZE: SC vs RMM
  • 10. Dekker Peterson Lamport Szymanski 0 200 400 600 800 1000 1200 No reduction Some approximation Some other approximation Partial-Order-Reduction Some combination REDUCTIONS (verification)
  • 11. Dekker Peterson Lamport Szymanski 0 50 100 150 200 250 300 350 400 450 Breadth-First Search Best-First with some heuristic Best-First with some other heuristic Best-First with yet another heuristic REDUCTIONS (bug-finding)
  • 13. SEQUENTIAL CONSISTENCY “A multiprocessor system is sequentially consistent if the result of any execution is the same as if the operations of all the processors were executed in some sequential order, and the operations of each individual processor appear in this sequence in the order specified by its program.” - Leslie Lamport, "How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs", IEEE Trans. Comput, 1979 Program order: among operations from individual processors Atomicity: memory operations must execute atomically with respect to each other
  • 14. RELAXING CONSISTENCY Relaxing program order:  Write-to-Read  Write-to-Write  Read-to-Read  Read-to-Write Relaxing atomicity:  Read own write early  Read others’ write early
  • 15. HIERARCHY OF RELAXATIONS SC TSO IBM-370 PC RCsc PowerPC WO Alpha RCPc RMO PSO Write-to-Read Write-to-Write Read-to-Read Read-to-Write source: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_506_Spring_2013/10c_ks
  • 16. TOTAL STORE ORDERING (TSO) Relaxations:  Write-to-Read  Read own write early Why?  Mitigate write latency  Some programs may still be “correct” (e.g. sequentially consistent)
  • 17. TSO “AXIOMATICALLY” TSO-executions are sequences of reads and writes r(x,u) < r(y,v) < w(z,w) < ...
  • 18. TSO “AXIOMATICALLY” TSO-executions are sequences of reads and writes r(x,u) < r(y,v) < w(z,w) < ... such that r <p r' => r < r' [r-r preserved] r <p w' => r < w' [r-w preserved] w <p w' => w < w' [w-w preserved] w-r allowed
  • 19. TSO “AXIOMATICALLY” TSO-executions are sequences of reads and writes r(x,u) < r(y,v) < w(z,w) < ... such that r <p r' => r < r' [r-r preserved] r <p w' => r < w' [r-w preserved] w <p w' => w < w' [w-w preserved] and r(x,u) are such that (1) v if s(x,v) is the max wrt. < among all s(x,v) s.t. s(x,v) < r(x,u) or s(x,v) <p r(x,u) (2) x0 (initial value for x) if there is no s(x,v) above. (read own's write early) w-r allowed
  • 21. TSO “OPERATIONALLY” SHARED MEMORY THREAD THREAD WRITE BUFFER WRITE BUFFER
  • 22. Formalization of memory models  Axiomatic [Adve, Alglage, Sewel, Owens, Higham,...]  Operational [Boudol, Petri, Atig, Bouajjani, Burckhardt,...]  Adequacy, generality, etc. Correctness criteria  Sequential consistency, linearizability, serializability, quiescent/eventual consistency... [Herlihy, Shavit, Shapiro,...]  “Fundamental property” (data-race free programs are sequential consistent) [Saraswat et al.] Portability of programs  Check whether P/SC ≈ P/RMM  Otherwise repair P e.g. inserting fences [Wolper, Bouajjani...] SOME KEY ISSUES
  • 23. Verification approaches  Directly use SC verification tools e.g. for programs that are linearizable even under RMMs [Burckhardt, Cohen, Owens]  Program Transformation and then SC tools e.g. [Alglave, Bouajjani]  Ad-hoc verification under RMMs. e.g. Some... (see later) Some tools  CBMC [Alglave et al]  CheckFence [Burckhardt et al]  DFENCE [Lui et al] SOME KEY ISSUES
  • 25. OUR SPIRIT HERE  Language designers prototyping new RMM- aware languages with Maude (the natural framework!).  Interested in “search” for P/RMM (for checking properties, for fence insertions, etc.).  Willing to make search efficient but not willing to modify the Maude engine.
  • 29. MEMORIES AND VIEWS Memory updates Local to Global In the following abbreviates
  • 39. MORE ANNOYANCES... x := 1 Maude> search P =>* Q . ... States: 10!? x := 2P =
  • 40. x|->0 =============== || --------------- x:=1; || x:=2; x|->0 =============== x|->1 || --------------- skip || x:=2; x|->0 =============== || x|->2 --------------- x:=1 || skip x|->0 =============== x|->1 || x|->2 --------------- skip || skip x|->1 =============== || --------------- skip || x:=2; x|->2 =============== || --------------- x:=1 || skip x|->1 =============== || x|->2 --------------- skip || skip x|->1 =============== || --------------- skip || skip x|->2 =============== x|->1 || --------------- skip || skip x:=1; x:=1; x:=1; x:=2; x:=2; x:=2; commit commit commit commit commitcommit x|->2 =============== || --------------- skip || skip state Shared memory Thread buffer Thread program
  • 41. x|->0 =============== || --------------- x:=1; || x:=2; x|->0 =============== x|->1 || --------------- skip || x:=2; x|->0 =============== || x|->2 --------------- x:=1 || skip x|->0 =============== x|->1 || x|->2 --------------- skip || skip x|->1 =============== || --------------- skip || x:=2; x|->2 =============== || --------------- x:=1 || skip x|->1 =============== || x|->2 --------------- skip || skip x|->1 =============== || --------------- skip || skip x|->2 =============== x|->1 || --------------- skip || skip x:=1; x:=1; x:=1; x:=2; x:=2; x:=2; commit commit commit commit commitcommit x|->2 =============== || --------------- skip || skip state Shared memory Thread buffer Thread program Usual state space with SC
  • 42. while true do x := 0 Maude> search P =>* Q . Zzz... P = MORE ANNOYANCES...
  • 43. x|->0 ==================== -------------------- while(true) do x:=0 x|->0 ==================== -------------------- x:=0; while(true) do x:=0 while(true) x:=0; x|->0 ==================== x|->0 -------------------- while(true) do x:=0 x|->0 ==================== x|->0 -------------------- x:=0; while(true) do x:=0 while(true) x|->0 ==================== x|->0 x|->0 -------------------- while(true) do x:=0 while(true) x:=0; commit commit commit ...
  • 45. Partial Order Reduction Techniques  Partial Orders [Alglave et al. @ CAV 2013]  Persistent Sets [Linden&Wolper @ TACAS 2013]  Ample sets (via SPIN) [Jonson @ CAN2009] Approximation/abstraction techniques  Predicate abstraction [Dan et al. @ SAS 2013]  Bounded context-switches [Abdulla et al. @ TACAS 2012]  Single-buffer semantics [Atig et al. @ CAV 2011]  Buffers-as-sets abstraction [Kuperstein et al. @ PLDI 2011]  Bounded buffers [Kuperstein et al. @ FMCAD 2011] Other  SAT/BMC [Burckhardt et al @ CAV 6/7/8, Gopalakrishnan et al. @ CAV 04]  Buffer automata [Linden&Wolper @ SPIN2010, TACAS 2013]  Monitors [Burnim et al. @ TACAS 2011, Burckhardt&Musuvathi @ CAV 2008] TEN+ YEARS OF RESEARCH Equational abstractions? [Meseguer&Palomino&Martí-Oliet @ TCS 2008] Partial-order reduction? [Farzan&Meseguer @ TERMGRAPH 2006] Search strategies? [Martí-Oliet&Meseguer&Verdejo @ WRLA 2004]
  • 46. SOME SIMPLE APPROXIMATIONS FOR TSO Disclaimer: proof-of-concepts, for the “good” ones see the above cited papers.
  • 47. ONE OF OUR ANOYANCES while true do x := 0 Maude> search P =>* Q . Zzz..
  • 48. BUFFERS AS SETS OF UPDATES Abstract buffers as sets of updates:  Make ACI1 (i.e. buffer becomes sets of updates);  Make commit non-deterministic (usual+no effect);  Make evaluation of expressions non-deterministic. You get an over-approximation:  Finite state space;  Preservation of reachability properties.  (Possibly) some “spurious” behaviours;
  • 49. Dekker Peterson Lamport Szymanski 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 No reduction Buffers-as-Sets Buffers-as-Ordered-Maps Force-Flush MORE STATES
  • 50. BUFFERS AS ORDERED MAPS Approximation that  Guarantees finite state space;  Introduces some executions;  Preserves some reachability properties??? (under investigation)
  • 52. x|->0 , y |->0 =============== || --------------- x:=1; || wait(...) y:=1; || x:=2 || x|->0 , y |->0 =============== x|->1 || --------------- y:=1; || wait(...) x:=2; || x|->0 , y |->0 =============== x|->1 || y|->1 || --------------- x:=2; || wait(...) x|->0 , y |->0 =============== x|->1 || y|->1 || x|->2 || --------------- skip || wait(...) x|->1 , y |->0 =============== || --------------- y:=1; || wait(...) x:=2; || x|->1 , y |->0 =============== y|->1 || --------------- x:=2; || wait(...) x|->1 , y |->0 =============== y|->1 || x|->2 || --------------- skip || wait(...) x|->1 , y |->1 =============== || --------------- x:=2; || wait(...) x|->1 , y |->1 =============== x|->2 || --------------- skip || wait(...) x|->2 , y |->1 =============== || --------------- skip || wait(...) commit commitcommit commit commit commit x|->0 , y |->0 =============== y|->1 || x|->2 || --------------- skip || wait(...) wait! ONE “SPURIOUS” EXECUTION x|->0 , y |->1 =============== y|->1 || --------------- skip || wait(...) commit
  • 53. Dekker Peterson Lamport Szymanski 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 No reduction Buffers-as-Sets Buffers-as-Ordered-Maps Force-Flush REDUCTIONS
  • 54. FORCE-FLUSH APPROXIMATION Under-approximation that  Does not guarantee finite state space ;  Some behaviours may be lost;  Does not introduce spurious behaviours. (up to some equivalence: stuttering and depending on the state observations).
  • 55. M =============== x|->u || ... || x|->v || --------------- S || T M ◦ x|->u =============== ... || x|->v || --------------- S || T NO “SPURIOUS” EXECUTION M =============== x|->u || ... || || --------------- x:=v; S || T M ◦ x|->u =============== ... || || --------------- x:=v; S || T commit x:=v x:=v (up to some equivalence: stuttering and depending on the state observations).
  • 56. Dekker Peterson Lamport Szymanski 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 No reduction Buffers-as-Sets Buffers-as-Ordered-Maps Force-Flush REDUCTIONS
  • 58. AMPLE SETS Main idea  Explore only a subset ample(s) of the succesors of s...  ...such that ample(s): C0: ample(s) empty only if s is a deadlock; C1: ample(s) contains invisible actions; C2: no transition that is dependent on a transition in ample(s) occurs in the original system without a transition in ample(s) occurring first; C3: no action outside ample(s) is delayed forever.  You will get a stutter equivalent transition system.
  • 59. SIMPLE POR FOR TSO Simple heuristic: assignments x := u are independent of actions of other threads since their effect is local (on the buffer). They are also invisible unless one wants to observe buffers or programs.
  • 60. Dekker Peterson Lamport Szymanski 0 100 200 300 400 500 600 700 800 900 1000 No reduction Partial-Order Reduction REDUCTIONS (verification)
  • 62. DIRECTED MODEL CHECKING Main idea  Replace the exploration algorithm (NDFS/BFS) by a “guided” algorithm (A*, Best-First, etc.)  Domain/property-based “heuristic” functions to rank states or executions “Heuristics for model checking Java” [Groce&Visser]  Promote interleavings (we think “sequentially”)  Promote code coverage Done for JPF, SPIN, etc.
  • 63. x|->0 , y|->0 =============== || --------------- x:=1; || y:=1; y==0? || x==0? x|->0 , y|->0 =============== x->1 || --------------- y==0? || y:=1; || x==0? x|->0 , y|->0 =============== || y->1 --------------- x:=1 || x==0? y==0? || x|->0 , y|->0 =============== x->1 || y->1 --------------- y==0? || x==0? x|->1 , y|->0 =============== || --------------- y==0? || y:=1; || x==0? x|->0 , y|->1 =============== || --------------- X:=1 || x==0? y==0? || x:=1; x:=1; y:=1; y:=1;flush flush ... ... x|->0 , y|->0 =============== x->1 || y->1 --------------- cs || x==0? x|->0 , y|->0 =============== x->1 || y->1 --------------- y==0? || cs
  • 64. x|->0 , y|->0 =============== || --------------- x:=1; || y:=1; y==0? || x==0? x|->0 , y|->0 =============== x->1 || --------------- y==0? || y:=1; || x==0? x|->0 , y|->0 =============== || y->1 --------------- x:=1 || x==0? y==0? || x|->0 , y|->0 =============== x->1 || y->1 --------------- y==0? || x==0? x|->1 , y|->0 =============== || --------------- y==0? || y:=1; || x==0? x|->0 , y|->1 =============== || --------------- X:=1 || x==0? y==0? || x:=1; x:=1; y:=1; y:=1;flush flush 0 0 0 2 1 0 0 0 1 ... ... x|->0 , y|->0 =============== x->1 || y->1 --------------- cs || x==0? x|->0 , y|->0 =============== x->1 || y->1 --------------- y==0? || cs 2 2 Count number of non-empty buffers
  • 65. Dekker Peterson Lamport Szymanski 0 50 100 150 200 250 300 350 400 450 Breadth-First Search Best-First + "number of non-empty buffers" heuristic Best-First + "number of pending writes" heuristic Best-First + "number of inconsistent pending writes" heuristic REDUCTIONS (bug-finding)
  • 67. I would say yes. Worth investigating Can we efficiently verify concurrent programs under relaxed memory models in Maude?
  • 68. Beyond TSO: PSO, RMO, etc.1 2 FUTURE WORK? Other languages/primitives: see e.g. KernelC/x86-TSO in K [Serbanuta] 3 Proof techniques (with Maude)
  • 71. [Linden&Wolper @ TACAS 2013] Alexander Linden, Pierre Wolper: A Verification-Based Approach to Memory Fence Insertion in PSO Memory Systems. TACAS 2013: 339-353 [Dan&MMeshman&Vechev&Yahav @ SAS 2013] Andrei Marian Dan, Yuri Meshman, Martin T. Vechev, Eran Yahav: Predicate Abstraction for Relaxed Memory Models. SAS 2013: 84-104 [Alglave et al. @ CAV 2013] Jade Alglave, Daniel Kroening, Michael Tautschnig: Partial Orders for Efficient Bounded Model Checking of Concurrent Software. CAV 2013: 141-157 [Abdulla&Atig&Chen&Leonardsson&Rezine @ TACAS 2012] Abdulla, P.A., Atig, M.F., Chen, Y.-F., Leonardsson, C., Rezine, A.: Counter- Example Guided Fence Insertion under TSO. In: TACAS 2012. LNCS, vol. 7214 (2012) [Atig&Bouajjani&Parlato @ CAV 2011] Atig, M.F., Bouajjani, A., Parlato, G.: Getting Rid of Store-Buffers in TSO Analysis. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806 (2011) [Kuperstein&Vechev&Yahav @ PLDI 2011] Kuperstein, M., Vechev, M., Yahav, E.: Partial-coherence abstractions for relaxed memory models. In: PLDI 2011 (2011) REFERENCES (1)
  • 72. [Burnim&Sen&Stergiou @ TACAS 2011] Jacob Burnim, Koushik Sen, Christos Stergiou: Sound and Complete Monitoring of Sequential Consistency for Relaxed Memory Models. TACAS 2011: 11-25 [Burnim&Sen& C. Stergiou @ TACAS 2011] J. Burnim, K. Sen, and C. Stergiou. Sound and complete monitoring of sequential consistency in relaxed memory models. In TACAS, 2011. [Kuperstein&Vechev&Yahav @ FMCAD 2011] M. Kuperstein, M. Vechev, and E. Yahav. Automatic inference of memory fences. In FMCAD, 2011. [Linedn&Wolper @ SPIN 2010] A. Linden and P. Wolper. An automata-based symbolic approach for verifying programs on relaxed memory models. In SPIN, 2010. [Jonson @ CAN2009] Jonsson, B.: State-space exploration for concurrent algorithms under weak memory orderings: (preliminary version). SIGARCH Comput. Archit. News 36, 65–71 (2009) [Burckhardt&Musuvathi @ CAV 2008] Burckhardt,S.,Musuvathi,M.: Effective Program Verification for Relaxed Memory Models. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 107–120. Springer, Heidelberg (2008) REFERENCES (2)
  • 73. [Burckhardt&Alur&Martin @ CAV 2007] Burckhardt, S., Alur, R., Martin, M.M.K.: Checkfence: checking consistency of concurrent data types on relaxed memory models. In: ACM SIGPLAN 2007 Conference on Programming Lan- guage Design and Implementation (2007) [Burckhardt&Alur&Martin @ CAV 2006] Burckhardt,S.,Alur,R.,Martin,M.M.K.: Bounded Model Checking of Concurrent Data Types on Relaxed Memory Models: A Case Study. In: CAV 2006. LNCS 4144. (2006) [Gopalakrishnan&Yang&Sivaraj @ CAV 2004] Gopalakrishnan, G., Yang, Y., Sivaraj, H.: QB or not QB: An efficient execution verification tool for memory orderings. In: CAV 2004. LNCS, vol. 3114 (2004) [Park&Dill @ PAA 1995] Park, S., Dill, D.L.: An executable specification, analyzer and verifier for rmo (relaxed memory order). In: SPAA 1995: Proceedings of the Seventh Annual ACM Symposium on Parallel Algorithms and Architectures, pp. 34–41. ACM, New York (1995) REFERENCES (3)
  • 74. [Meseguer&Palomino&Martí-Oliet @ TCS 2008] José Meseguer, Miguel Palomino, Narciso Martí-Oliet: Equational abstractions. Theor. Comput. Sci. 403(2-3): 239-264 (2008) [Farzan&Meseguer @ TERMGRAPH 2006] Azadeh Farzan, José Meseguer: Partial Order Reduction for Rewriting Semantics of Programming Languages. Electr. Notes Theor. Comput. Sci. 176(4): 61-78 (2007) [Rodríguez 2009 @ WRLA 2009] Rodríguez, D.E.: Combining techniques to reduce state space and prove strong properties. In: WRLA. Volume 238(3) of ENTCS. (2009) 267 – 280 [Lluch&Meseguer&Vandin @ ICFEM 2012] Alberto Lluch-Lafuente, José Meseguer, Andrea Vandin: State Space c-Reductions of Concurrent Systems in Rewriting Logic. ICFEM 2012: 430-446 [Martí-Oliet&Meseguer&Verdejo @ WRLA 2004] Narciso Martí-Oliet, José Meseguer, Alberto Verdejo: Towards a Strategy Language for Maude. Electr. Notes Theor. Comput. Sci. 117: 417-441 (2005) [Groce&Visser @ STTT 2004] Alex Groce, Willem Visser: Heuristics for model checking Java programs. STTT 6(4): 260-276 (2004) REFERENCES (4)