On Sequentializing Concurrent Programs

Slides:



Advertisements
Similar presentations
Bounded Model Checking of Concurrent Data Types on Relaxed Memory Models: A Case Study Sebastian Burckhardt Rajeev Alur Milo M. K. Martin Department of.
Advertisements

Ermenegildo Tomasco University of Southampton, UK Omar Inverso University of Southampton, UK Bernd Fischer Stellenbosch University, South Africa Salvatore.
Gennaro Parlato (LIAFA, Paris, France) Joint work with P. Madhusudan Xiaokang Qie University of Illinois at Urbana-Champaign.
Gennaro Parlato (LIAFA, Paris, France) Joint work with P. Madhusudan Xiaokang Qie University of Illinois at Urbana-Champaign.
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Α ϒ ʎ …… Reachability Modulo Theories Akash Lal Shaz Qadeer, Shuvendu Lahiri Microsoft Research.
1 Symbolic Execution for Model Checking and Testing Corina Păsăreanu (Kestrel) Joint work with Sarfraz Khurshid (MIT) and Willem Visser (RIACS)
1/20 Generalized Symbolic Execution for Model Checking and Testing Charngki PSWLAB Generalized Symbolic Execution for Model Checking and Testing.
Background for “KISS: Keep It Simple and Sequential” cs264 Ras Bodik spring 2005.
Reducing Context-bounded Concurrent Reachability to Sequential Reachability Gennaro Parlato University of Illinois at Urbana-Champaign Salvatore La Torre.
Iterative Context Bounding for Systematic Testing of Multithreaded Programs Madan Musuvathi Shaz Qadeer Microsoft Research.
Requirements on the Execution of Kahn Process Networks Marc Geilen and Twan Basten 11 April 2003 /e.
The Tree-Width of auxiliary storage Gennaro Parlato (University of Southampton, UK) Joint work: P. Madhusudan – UIUC, USA.
The Language Theory of Bounded Context-Switching Gennaro Parlato (U. of Illinois, U.S.A.) Joint work with: Salvatore La Torre (U. of Salerno, Italy) P.
On Sequentializing Concurrent Programs Ahmed Bouajjani LIAFA, University of Paris 7, France LIAFA, University of Paris 7, France Michael Emmi LIAFA, University.
The Tree-Width of automata with auxiliary storage Gennaro Parlato (LIAFA, CNRS, Paris, France) joint work with P. Madhusudan (Univ of Illinois at Urbana-Champaign,
Lazy-CSeq A Lazy Sequentialization Tool for C Omar Inverso University of Southampton, UK Ermenegildo Tomasco University of Southampton, UK Bernd Fischer.
Static Analysis of Embedded C Code John Regehr University of Utah Joint work with Nathan Cooprider.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Kernel language semantics Carlos Varela RPI Adapted with permission.
1/25 Context-Bounded Analysis of Concurrent Queue Systems Gennaro Parlato University of Illinois at Urbana-Champaign Università degli Studi di Salerno.
Invisible Invariants: Underapproximating to Overapproximate Ken McMillan Cadence Research Labs TexPoint fonts used in EMF: A A A A A.
Verifying Concurrent Programs by Memory Unwinding Ermenegildo Tomasco University of Southampton, UK Omar Inverso University of Southampton, UK Bernd Fischer.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Scope-Bounded Pushdown Languages Salvatore La Torre Università degli Studi di Salerno joint work with Margherita Napoli Università degli Studi di Salerno.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
The Tree-Width of Decidable Problems 1 Gennaro Parlato (U. Southampton, UK) joint work with: P. Madhusudan (UIUC, USA) Salvatore La Torre (U. Salerno,
Scope-bounded Multistack Pushdown Systems: - fixed-point - sequentialization - tree-width 1 Salvatore La Torre Gennaro Parlato (U. Salerno, Italy) (U.
On Sequentializing Concurrent Programs Gennaro Parlato University of Southampton, UK UPMARC 7 th Summer School on Multicore Computing, June 8-10, 2015.
1 Causal-Consistent Reversible Debugging Ivan Lanese Focus research group Computer Science and Engineering Department University of Bologna/INRIA Bologna,
On Sequentializing Concurrent Programs (Bounded Model Checking) Gennaro Parlato University of Southampton, UK UPMARC 7 th Summer School on Multicore Computing,
ICFEM 2002, Shanghai Reasoning about Hardware and Software Memory Models Abhik Roychoudhury School of Computing National University of Singapore.
1 Approximate XML Query Answers Presenter: Hongyu Guo Authors: N. polyzotis, M. Garofalakis, Y. Ioannidis.
Compositionality Entails Sequentializability Pranav Garg, P. Madhusudan University of Illinois at Urbana-Champaign.
Getting Rid of Store-Buffers in TSO Analysis Mohamed Faouzi Atig Uppsala University, Sweden Ahmed Bouajjani LIAFA, University of Paris 7, France LIAFA,
Bounded Model Checking of Multi-Threaded C Programs via Lazy Sequentialization Omar Inverso University of Southampton, UK Ermenegildo Tomasco University.
Quantified Data Automata on Skinny Trees: an Abstract Domain for Lists Pranav Garg 1, P. Madhusudan 1 and Gennaro Parlato 2 1 University of Illinois at.
KISS: K EEP I T S IMPLE AND S EQUENTIAL Guy Martin, OSLab, GNU09 Shaz Qadeer Microsoft Research One Microsoft Way Redmond, WA Dinghao Wu Department.
Sub-fields of computer science. Sub-fields of computer science.
Advanced Algorithms Analysis and Design
Introduction to Optimization
Lazy Sequentialization via Shared Memory Abstractions
Verification for Concurrent Programs
Hybrid BDD and All-SAT Method for Model Checking
SS 2017 Software Verification Bounded Model Checking, Outlook
Opeoluwa Matthews, Jesse Bingham, Daniel Sorin
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Processes and Threads Processes and their scheduling
Boundary Element Analysis of Systems Using Interval Methods
Sequentializing Parameterized Programs
Sequentialization by Read-implicit Coarse-grained Memory Unwindings
Graph-Based Operational Semantics
Ermenegildo Tomasco1, Truc L
Declarative Computation Model Kernel language semantics (Non-)Suspendable statements (VRH ) Carlos Varela RPI October 11, 2007 Adapted with.
Symbolic Implementation of the Best Transformer
Introduction to Optimization
Objective of This Course
Chapter 26 Concurrency and Thread
Over-Approximating Boolean Programs with Unbounded Thread Creation
Thanyapat Sakunkonchak Masahiro Fujita
Lazy Sequentialization Unbounded Concurrent Programs
Introduction to Optimization
Operating Systems : Overview
An explicit state model checker
Functional Program Verification
A Refinement Calculus for Promela
A Lazy Sequentialization Tool for Unbounded Context Switches
Operating Systems : Overview
Non-preemptive Semantics for Data-race-free Programs
Presentation transcript:

On Sequentializing Concurrent Programs Ahmed Bouajjani LIAFA, University of Paris 7, France Michael Emmi Gennaro Parlato ✓ University of Southampton, UK

What is this talk about? Use of verification tools for sequential programs to analyze concurrent programs Write a sequential program that simulates the concurrent program Kiss: Keep It Simple and Sequential [Qadeer, Wu— PLDI’04] Many efficient solutions have been developed for sequential programs: SMT-based Bounded Model-Checkers, BDD-based model-checkers, approximation techniques, deductive verification, … Why don’t we exploit them?

code-to-code translation as a plug-in for sequential tools shared vars (SC semantics) Sequ. tool Concsequ tranlsation Instrumentation for the Sequ. tool Concurrent Program T1 T2 Tn SC tools: Bounded model checking: ESBMC (FSE’11) Poirot (by MSR) Storm (CAV’09) … Boolean Programs: Boom, Boppo GETAFIX (PLDI’09) jMoped [SPIN’08] CHESS (MSR) Sequentialization + sequ. tools … Sequ. program A convenient way to get new tools for conc. programs …

What would it be a good sequential simulation? First attempt: Tracking state: C1 X C2 X … Ci … X Cn X Shared Simulation: at each step simulate one move of a thread State space explosion ! Q: Can we avoid such an explosion (cross product of locals)? Yes, if we consider at most 2 context-switches [Qadeer, Wu—PLDI’04] Q: Can we avoid such an explosion (cross product of locals)? A: YES, for certain under-approximation Q: What about complete simulations ? A: NO! (for theoretical reasons) 2 3 3 1 2 1

Related works Up 2 context-switches [Qadeer, Wu—PLDI’04] Many concurrency errors manifest themselves within few context- switches [Musuvathi, Qadeer—PLDI`07] Any fixed # context-switches (finite # of threads) Eager [Lal, Reps—CAV`08] Lazy [La Torre, Parlato, Madhusudan—CAV`09] Round-Robin schedules & parametrized programs Lazy [La Torre, Parlato, Madhusudan—CAV`10] Delay-bounded schedules (thread creation) [Emmi, Qadeer, Rakamaric—POPL`11] Over-approximation [Garg, Madhusudan, TACAS`11]

Proposed sequentializations common characteristics Avoid cross product (compositional) 1 stack for the simulation 1 local state, fixed # of shared states Conc. & Sequ. Programs are in the same class i.e. no additional data structures to simulate parallelism Example: Boolean conc. programs  Boolean (sequential) program Parametrized: increasing the parameter more and more behaviors are captured at the expense of more computational resources Explore as many behaviors as possible Goal

Our contribution General mechanism enabling compositional sequentializations Under-approximations Captures at least or more behaviors than existing sequentializations Existing sequentializations can be seen as a restrictions of ours

Our Concurrent  Sequential Translation - Compositional semantics - Thread interfaces - Bounded semantics (restricted compositional semantics)

Compositional Semantics (code-to-code translation to sequ. programs) P ::= var g:T H H ::= proc p (var l:T ) s s ::= s; s | x := e | skip | assume e | if e then s else s | while e do s | call x := p e | return e | post p e | yield //Concurrent stmt x ::= g | l T1 T2 Tn shared vars (SC semantics) … Main idea of the sequentialization Transform each thread creation into a procedure call: post p e  call g:=p e Only one interaction Solution (return all possible interactions) post p e  call INTERFACE:=p e

Key concept: Thread interface s1 s1’ Thread interface An interface of a thread T in an execution captures the interactions (shared states) of T and all its sub-threads with the remaining threads involved in the execution s2 s2’ s3 s3’ s4 s4’ s5 s5’

How to compute Thread interface Every thread creation is transformed into a procedure call A thread procedure computes an interface of the thread by simulating its code The thread procedure keeps the following data structure to compute the interface EXP: Interface to export BAG: Interfaces imported from posted threads

Updating the interface data-structure: initialization EXP: Interface to export BAG: Interfaces imported from posted threads s1 ∅ The procedure that simulates a thread first initializes the interface data- structure: interface to export is initialized with one round ( s1, s1 ) ( s1 is a guessed shared state) bag of imported interfaces is empty

Updating the interface data-structure: thread creation (post) EXP: Interface to export BAG: Interfaces imported from posted threads At any thread creation: post p e  transformed interface := call thread-p e; Add( BAG, interface );

Updating the interface data-structure context-switch (yield) EXP: Interface to export BAG: Interfaces imported from posted threads a b b At any yield point non deterministically either interact at least once with internal threads, or interact with an external thread

Updating the interface data-structure context-switch (yield) EXP: Interface to export BAG: Interfaces imported from posted threads a At any yield point non deterministically either interact at least once with internal threads, or interact with an external thread Add a new round (a,a) to the interface to export ( a is guessed )

Sequential semantics for conc. programs We’ve obtained a sequential program that simulates the conc. program by computing interfaces Each Thread code p is replaced by the procedure thread-p: Variables: Locals + Interface data-structure Initialize the interface data-structure The code of the original thread is attached Only post, and yield statement are replaced with new code (simulating the operations presented previously) At yield a yield statement (or return) return the exported interface interface data-structure is unbounded

Bounding & Compressing An interface as a list: a b c d e f g h a c e g b d f h

Bounding & Compressing Bound the # nodes in the interface data structure Compress the bag of exported interface as a DAG We merge two node (x, y) and (y,z) into (x,z) x y z Ex 1. Ex 2. x y z

Our Sequentialization Compositional Semantics + Bounding & Compressing

All existing sequentializations can be simulated - Up 2 context-switches [Qadeer, Wu—PLDI’04] - Any fixed # context-switches (finite # of threads) - Eager [Lal, Reps—CAV`08] - Lazy [La Torre, Parlato, Madhusudan—CAV`09] - Round-Robin schedules & parametrized programs - Lazy [La Torre, Parlato, Madhusudan—CAV`10] - Delay bounded schedules (thread creation) [Emmi, Qadeer, Rakamaric—POPL`11]

Sequ. for any fixed # context-switches (finite # of threads) [Lal, Reps—CAV`08] initial shared state T1 T2 Tn round 1 round 2 round k 3 1 2

Conclusions

Thanks! Conclusions: Future works: We have presented a general mechanism enabling compositional sequentializations of concurrent programs (under SC) parameterized (bounding & compressing the # of nodes in the interfaces) more behaviors than existing sequentializations Thread creation, parameterized programs, finite # threads All existing sequentializations can be explained within our framework Weak Memory models: Translation TSO  SC [Atig, Bouajjani, Parlato—CAV`11] TSO  SC  sequential Future works: Experimental evaluation Sequentializations for distributed programs (FIFO channels) ? The Tree-width of Auxiliary Storage [Madhusudan, Parlato—POPL`11] Lazy transformation of our sequentialization [La Torre, Madhusudan, Parlato—CAV`09, CAV`10] Thanks!