Over-Approximating Boolean Programs with Unbounded Thread Creation

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

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Modeling issues Book: chapters 4.12, 5.4, 8.4, 10.1.
Abstraction of Source Code (from Bandera lectures and talks)
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Partial Order Reduction: Main Idea
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Verification of Evolving Software Natasha Sharygina Joint work with Sagar Chaki and Nishant Sinha Carnegie Mellon University.
An Introduction to the Model Verifier verds Wenhui Zhang September 15 th, 2010.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Reduction, abstraction, and atomicity: How much can we prove about concurrent programs using them? Serdar Tasiran Koç University Istanbul, Turkey Tayfun.
1 1 Regression Verification for Multi-Threaded Programs Sagar Chaki, SEI-Pittsburgh Arie Gurfinkel, SEI-Pittsburgh Ofer Strichman, Technion-Haifa Originally.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
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.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Hybrid Systems Presented by: Arnab De Anand S. An Intuitive Introduction to Hybrid Systems Discrete program with an analog environment. What does it mean?
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
Efficient Reachability Analysis for Verification of Asynchronous Systems Nishant Sinha.
ISBN Chapter 3 Describing Syntax and Semantics.
Symmetry-Aware Predicate Abstraction for Shared-Variable Concurrent Programs Alastair Donaldson, Alexander Kaiser, Daniel Kroening, and Thomas Wahl Computer.
1 Spin Model Checker Samaneh Navabpour Electrical and Computer Engineering Department University of Waterloo SE-464 Summer 2011.
Thread-modular Abstraction Refinement Tom Henzinger Ranjit Jhala Rupak Majumdar Shaz Qadeer.
Termination Proofs for Systems Code Andrey Rybalchenko, EPFL/MPI joint work with Byron Cook, MSR and Andreas Podelski, MPI PLDI’2006, Ottawa.
Model Checking Lecture 5. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Thread-modular Abstraction Refinement Tom Henzinger Ranjit Jhala Rupak Majumdar [UC Berkeley] Shaz Qadeer [Microsoft Research]
Synergy: A New Algorithm for Property Checking
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
CS 267: Automated Verification Lectures 14: Predicate Abstraction, Counter- Example Guided Abstraction Refinement, Abstract Interpretation Instructor:
Predicate Abstraction for Software and Hardware Verification Himanshu Jain Model checking seminar April 22, 2005.
Software Verification Bertrand Meyer Chair of Software Engineering Lecture 2: Axiomatic semantics.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
Describing Syntax and Semantics
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Part 2: Reachability analysis of stack-based systems.
Model Checking Lecture 5. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
50.530: Software Engineering
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
CS6133 Software Specification and Verification
Predicate Abstraction of ANSI-C Programs Using SAT By Edmund Clarke, Daniel Kroening, Natalia Sharygina, Karen Yorav Presented by Yunho Kim Provable Software.
Model construction and verification for dynamic programming languages Radu Iosif
Proving Non-Termination Gupta, Henzinger, Majumdar, Rybalchenko, Ru-Gang Xu presentation by erkan.
Predicate Abstraction. Abstract state space exploration Method: (1) start in the abstract initial state (2) use to compute reachable states (invariants)
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,
© 2006 Carnegie Mellon University Introduction to CBMC: Part 1 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel,
1 Proving program termination Lecture 5 · February 4 th, 2008 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
/ PSWLAB Thread Modular Model Checking by Cormac Flanagan and Shaz Qadeer (published in Spin’03) Hong,Shin Thread Modular Model.
Today’s Agenda  Quiz 4  Temporal Logic Formal Methods in Software Engineering1.
Verifying Component Substitutability Nishant Sinha Sagar Chaki Edmund Clarke Natasha Sharygina Carnegie Mellon University.
© 2006 Carnegie Mellon University Introduction to CBMC: Part 1 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel,
On Sequentializing Concurrent Programs
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Symbolic model checking with SAT/SMT
Formal methods: Lecture
SS 2017 Software Verification Bounded Model Checking, Outlook
Sequentializing Parameterized Programs
Graph-Based Operational Semantics
Introduction to Software Verification
Lecture 5 Floyd-Hoare Style Verification
Discrete Controller Synthesis
A Refinement Calculus for Promela
50.530: Software Engineering
CS510 Operating System Foundations
Scalability in Model Checking
COMP60621 Designing for Parallelism
Predicate Abstraction
Presentation transcript:

Over-Approximating Boolean Programs with Unbounded Thread Creation Natasha Sharygina Byron Cook, Daniel Kroening

Introduction Counterexample guided abstraction refinement (CECAR) is a successful method to verify programs Initial Abstraction Verification No error or bug found C Program with threads Concurrent Boolean Program Model Checker Property holds Simulation successful Refinement Simulator Bug found

Boolean Programs Expressions Control Flow Assignments assert Usual Boolean operators Non-deterministic choice Control Flow if then else goto Functions Assignments Simultaneous assignments to multiple variables Constrained assignments assert

Boolean Programs with Threads Created by version of SLAM for concurrent programs called SLING (G. Weissenbacher) Threads are marked by special labels Dynamic creation of threads Arbitrary interleavings of the threads

Boolean Programs: Example decl g0; void t1() begin end void t2() begin assert(g0); void main() begin g0:=T; ASYNC_1: t1(); ASYNC_2: t2(); g0:=F; Thread Creation

Boolean Programs: Example decl g0; void t1() begin end void t2() begin assert(g0); void main() begin g0:=T; ASYNC_1: t1(); ASYNC_2: t2(); g0:=F; STATE g0 F

Boolean Programs: Example decl g0; void t1() begin end void t2() begin assert(g0); void main() begin g0:=T; ASYNC_1: t1(); ASYNC_2: t2(); g0:=F; STATE g0 T

Boolean Programs: Example decl g0; void t1() begin end void t2() begin assert(g0); void main() begin g0:=T; ASYNC_1: t1(); ASYNC_2: t2(); g0:=F; STATE g0 F

Boolean Programs: Example decl g0; void t1() begin end void t2() begin assert(g0); void main() begin g0:=T; ASYNC_1: t1(); ASYNC_2: t2(); g0:=F; STATE g0 F Alternative Schedule

Boolean Programs: Example decl g0; void t1() begin end void t2() begin assert(g0); void main() begin g0:=T; ASYNC_1: t1(); ASYNC_2: t2(); g0:=F; STATE g0 T Alternative Schedule

Boolean Programs: Example decl g0; void t1() begin end void t2() begin assert(g0); void main() begin g0:=T; ASYNC_1: t1(); ASYNC_2: t2(); g0:=F; STATE g0 F  Alternative Schedule

Available Model Checkers With translator: NuSMV SPIN Zing BOPPO – partial order reduction + QBF [Spin 2005] Fixed number of threads

Unbounded Thread Creation Actual number of threads always finite May be very large Actual number usually lost during predicate abstraction Must check abstract program with unbounded number of threads Checking the abstract model is now undecidable! Must give up Soundness or Completeness

Our Approach Other tools (SPIN, ZING) won’t terminate Not a good fit for the CEGAR loop Our approach: Over-approximating reachability in Boolean programs with unbounded thread creation

Our Approach Guarantees termination Initial Abstraction Verification No error or bug found C Program with threads Concurrent Boolean Program Model Checker Property holds Simulation successful Refinement Simulator Bug found Guarantees termination If no bug is found, the loop terminates Otherwise, provide a “helpful trace”to CEGAR loop to make progress

Thread States Explicit State,  : Triple (n, pc, ) with n   - number of threads pc : {1,…,n}  L – vector of program locations  : ({1,…,n}  Vl)  Vg  B – valuation of program variables Thread State, : Tuple (PC, ) with PC  L  : V  B Let S denote the set of explicit states and denote a set of thread states

Execution Semantics A scheduler picks a thread to execute an instruction The transition relation of a thread is defined by a case-split on the instruction (i.e., goto, assume, start_thread, lock, unlock, etc.) Current thread state Next thread state

Execution Semantics The set of all reachable states is The property to check: reachability of states with particular locations

Projection from a state to the value of the pc of thread t Thread Projection Projection from a state to the value of the pc of thread t Thread Projection Function Maps an explicit state of the full state space to the state visible to a thread t  {1,…,.n} Projection from a state to the values of the program variables of thread t

Thread-Visible States  1 2 3 4 5 *()

Thread-Visible States The set of thread-visible states reachable in i transitions is We compute an over-approximation of This is sufficient to prove reachability properties that are expressed in terms of thread visible states Example: assertions

Over-Approximating Relation

Over-Approximating Relation 1 2 ‘ ‘

Over-Approximation

Approximation Algorithm

Mapping from a set of variables into a set of formulae Making it Symbolic Mapping from a set of variables into a set of formulae

Represents the guard of the state symbolically Making it Symbolic Represents the guard of the state symbolically

Symbolic States Guard and values of variables are stored as Boolean formulae with sharing No blowup – linear space in number of transitions Assertions are checked symbolically by checking satisfiability of SAT instances

Fixpoint Detection with QBF Did we get a new thread state? Fixpoint Detection easy for explicit state (hash-table) Symbolic case: a set of explicit thread states is represented by a symbolic thread state Give that to QBF solver (e.g., Quantor)

Refinement Imprecision caused by over-approximating relation might lead to traces that are spurious within the abstract model Can be ruled out by adding more predicates (i.e., classical refinement)

Recursion Reachability already undecidable with only two threads Our algorithm can be extended to handle recursion Idea: replace recursive calls by thread creation

Experimental Results Ran on many sequential programs generated by SLAM a few concurrent programs generated by SLING Using MiniSAT for assertions Quantor for fixpoint detection

Experimental Results

Tool for Experimentation BOPPO with support for unbounded thread creation is available for download http://www.verify.ethz.ch/boppo/

Related Work Zing: restricted form of recursion and unbounded thread creation Qadeer and Rehof, TACAS05: unsounded approach for bounding the number of context switches Flanagan and Qadeer, SPIN03: loosely coupled multhreaded programs: thread states in order of programs with little interaction.

Questions?

Modeling Recursion For function f(p1,…,pk) | p1,…pk Vl are the parameters of the function p1,…,pk := e1,…ek A new global variable is introduced for synchronization of the function return Function call is replaced by start_thread ,  - the first program location of f After the function call, is inserted and set to false When f returns, it sets  to true. The return values are passed by means of global variables

Over-approximating recursive calls Over-approximation of a recursive call f(e1,e2) with thread creation

Partial Order Reduction with SAT Implemented in GETSUCCESSORS Computes subset of threads that are considered for symbolic execution in a particular state Commonly used in explicit state model checkers, BOPPO does it symbolically