Symbolic Model Checking of Software Nishant Sinha with Edmund Clarke, Flavio Lerda, Michael Theobald Carnegie Mellon University.

Slides:



Advertisements
Similar presentations
Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
Advertisements

The SPIN System. What is SPIN? Model-checker. Based on automata theory. Allows LTL or automata specification Efficient (on-the-fly model checking, partial.
Tintu David Joy. Agenda Motivation Better Verification Through Symmetry-basic idea Structural Symmetry and Multiprocessor Systems Mur ϕ verification system.
Openflow App Testing Chao SHI, Stephen Duraski. Motivation Network is still a complex stuff ! o Distributed mechanism o Complex protocol o Large state.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Translation-Based Compositional Reasoning for Software Systems Fei Xie and James C. Browne Robert P. Kurshan Cadence Design Systems.
Partial Order Reduction: Main Idea
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.
1 Partial Order Reduction. 2 Basic idea P1P1 P2P2 P3P3 a1a1 a2a2 a3a3 a1a1 a1a1 a2a2 a2a2 a2a2 a2a2 a3a3 a3a3 a3a3 a3a3 a1a1 a1a1 3 independent processes.
Model Checker In-The-Loop Flavio Lerda, Edmund M. Clarke Computer Science Department Jim Kapinski, Bruce H. Krogh Electrical & Computer Engineering MURI.
ESP: A Language for Programmable Devices Sanjeev Kumar, Yitzhak Mandelbaum, Xiang Yu, Kai Li Princeton University.
Efficient Reachability Analysis for Verification of Asynchronous Systems Nishant Sinha.
CS 267: Automated Verification Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking.
1 Temporal Claims A temporal claim is defined in Promela by the syntax: never { … body … } never is a keyword, like proctype. The body is the same as for.
CS 267: Automated Verification Lecture 7: SMV Symbolic Model Checker, Partitioned Transition Systems, Counter-example Generation in Symbolic Model Checking.
Ashish Kundu CS590F Purdue 02/12/07 Language-Based Information Flow Security Andrei Sabelfield, Andrew C. Myers Presentation: Ashish Kundu
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
Fast Paths in Concurrent Programs Wen Xu, Princeton University Sanjeev Kumar, Intel Labs. Kai Li, Princeton University.
Weizmann Institute Deciding equality formulas by small domain instantiations O. Shtrichman The Weizmann Institute Joint work with A.Pnueli, Y.Rodeh, M.Siegel.
Spin Tutorial (some verification options). Assertion is always executable and has no other effect on the state of the system than to change the local.
Specification and Encoding of Transaction Interaction Properties Divjyot Sethi Yogesh Mahajan Sharad Malik Princeton University Hardware Verification Workshop.
Model Checking. Used in studying behaviors of reactive systems Typically involves three steps: Create a finite state model (FSM) of the system design.
1 Carnegie Mellon UniversitySPINFlavio Lerda SPIN An explicit state model checker.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
Sanjit A. Seshia and Randal E. Bryant Computer Science Department
Partial Order Reduction for Scalable Testing of SystemC TLM Designs Sudipta Kundu, University of California, San Diego Malay Ganai, NEC Laboratories America.
Synthesis of Interface Specifications for Java Classes Rajeev Alur University of Pennsylvania Joint work with P. Cerny, G. Gupta, P. Madhusudan, W. Nam,
Efficient Hybrid Reachability Analysis for Asynchronous Concurrent Systems E. Pastor and M.A. Peña Department of Computer Architecture Technical University.
Word Level Predicate Abstraction and Refinement for Verifying RTL Verilog Himanshu Jain Daniel Kroening Natasha Sharygina Edmund Clarke Carnegie Mellon.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
The Parallel PV Model-checker Robert Palmer and Ganesh Gopalakrishnan School of Computing University of Utah.
Formal Techniques for Verification Using SystemC By Nasir Mahmood.
Model Checking and Related Techniques
Maria-Cristina Marinescu Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology A Synthesis Algorithm for Modular Design of.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
7/13/2003BMC A SAT-Based Approach to Abstraction Refinement in Model Checking Bing Li, Chao Wang and Fabio Somenzi University of Colorado at Boulder.
Using Model-Checking to Debug Device Firmware Sanjeev Kumar Microprocessor Research Labs, Intel Kai Li Princeton University.
Scientific Computing By: Fatima Hallak To: Dr. Guy Tel-Zur.
CS6133 Software Specification and Verification
Cost-Optimal Symbolic Pattern Database Planning with State Trajectory and Preference Constraints Stefan Edelkamp University of Dortmund.
Model construction and verification for dynamic programming languages Radu Iosif
Model Checking Java Programs using Structural Heuristics
Symbolic Execution with Abstract Subsumption Checking Saswat Anand College of Computing, Georgia Institute of Technology Corina Păsăreanu QSS, NASA Ames.
1 Checking Interaction Consistency in MARMOT Component Refinements Yunja Choi School of Electrical Engineering and Computer Science Kyungpook National.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for August 6, 2003.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
1 Model Checking of Robotic Control Systems Presenting: Sebastian Scherer Authors: Sebastian Scherer, Flavio Lerda, and Edmund M. Clarke.
Verification & Validation By: Amir Masoud Gharehbaghi
Model Checking Linearizability via Refinement 1 ICFEM 2008 Model Checking Linearizability via Refinement Yang LIU, Wei CHEN, Yanhong A. LIU, and Jun SUN.
/ PSWLAB S PIN Search Optimization from “THE SPIN MODEL CHECKER” by G. Holzmann Presented by Hong,Shin 23 th Nov SPIN Search.
Parallel and Distributed Systems Laboratory Paradise: A Toolkit for Building Reliable Concurrent Systems Trace Verification for Parallel Systems Vijay.
1 Distributed BDD-based Model Checking Orna Grumberg Technion, Israel Joint work with Tamir Heyman, Nili Ifergan, and Assaf Schuster CAV00, FMCAD00, CAV01,
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
Automated Formal Verification of PLC (Programmable Logic Controller) Programs
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
MOPS: an Infrastructure for Examining Security Properties of Software Authors Hao Chen and David Wagner Appears in ACM Conference on Computer and Communications.
Today’s Agenda  Quiz 5 (end of the class)  Quick Review  Finish Search Algorithms Formal Methods in Software Engineering1.
Compositional Verification for System-on-Chip Designs SRC Student Symposium Paper 16.5 Nishant Sinha Edmund Clarke Carnegie Mellon University.
Verifying Component Substitutability Nishant Sinha Sagar Chaki Edmund Clarke Natasha Sharygina Carnegie Mellon University.
Reachability Testing of Concurrent Programs1 Reachability Testing of Concurrent Programs Richard Carver, GMU Yu Lei, UTA.
Complexity Relief Techniques for Model Checking METU, Aug SOFTWARE VERIFICATION WORKSHOP Hüsnü Yenigün Sabanci University Informatics Institute,
24 September 2002© Willem Visser Partial-Order Reductions Reduce the number of interleavings of independent concurrent transitions x := 1 || y :=
Regression Testing with its types
Hybrid BDD and All-SAT Method for Model Checking
Formal verification in SPIN
An explicit state model checker
Producing short counterexamples using “crucial events”
A Refinement Calculus for Promela
Presentation transcript:

Symbolic Model Checking of Software Nishant Sinha with Edmund Clarke, Flavio Lerda, Michael Theobald Carnegie Mellon University

Symbolic Model Checking of Software Goal: –Use BDD-based Symbolic Model Checker for the verification of concurrent software Motivation: – Very successful for large state spaces in hardware Challenges: –Generating the models (language -> SMV) –Adding Partial-Order Reduction –Optimized BDD-operations (e.g., generation and storage) This Talk: –Focus on Partial-Order Reduction

Outline Background –Modeling language –Partial-order reduction –Twophase algorithm New Approach: ImProviso –Basic formulation –Extensions –Experimental results Related Work Future Work Conclusions

Background: Software Verification Concurrent software –Asynchronous execution, unlike hardware –Huge state space, e.g. large variable ranges Partial-order reduction (POR) –Attacks the state-space explosion problem –Very effective in explicit-state model checking –Symbolic Model Checking yet to benefit

Background: Modeling Language Process-oriented modeling language –Each process maintains local variables –Each process has a program counter System –Concurrent processes –Global variables –Point-to-point channels Each process is specified as statements –Statements are formalized as transition functions –Multiple statements per pc value allowed, i.e. non-determinism Example: Promela

Background: Partial-Order Reduction s0s0’ s0s1’ s1s0’ s1s1’ x = 1 y = 2 Choose a representative set of paths

Background: Partial-Order Reduction Two kinds of state-expansion –Full Expansion generate next states for all enabled transitions –Partial Expansion expand only a subset of enabled transitions, postponing all others Challenges: –How to choose such subset? (-> deterministic) –How to avoid transitions being postponed indefinitely? (-> proviso)

Background: Deterministic States Which subset of enabled transitions to choose? Deterministic state for a process P: –Only one transition t of P enabled at that state –Can be taken without affecting property to be verified Partial Expansions of deterministic states –Do not need to consider all interleavings A state s is deterministic for a process P iff:  only one transition t of P is enabled in s  t commutes with transitions that can be executed by other processes  executing t does not disable transitions of other processes  executing a transition of another process cannot disable or enable any transition of P A state s is deterministic for a process P iff:  only one transition t of P is enabled in s  t commutes with transitions that can be executed by other processes  executing t does not disable transitions of other processes  executing a transition of another process cannot disable or enable any transition of P

Background: Partial-Order Reduction Avoiding transitions being postponed indefinitely: Proviso SPIN: In-Stack Proviso –Partial Expansion should not generate a state in stack –Otherwise, must do Full Expansion S1S1 S2S2 S3S3 S4S4 t1t1 t1t1 t1t1 t2t2 t2t2 t2t2 t0t0 t3t3 t4t4 t5t5

Combining POR with Symbolic Model Checking POR developed for explicit-state –DFS –Stack: for proviso check Whereas symbolic verification –Involves a BFS-like algorithm –No stack exists –Only frontier at hand

Twophase Partial-Order Algorithm Nalumasu, Gopalakrishnan [1997] –Modified proviso check –Alternating phases Phase 1: Do for each process in sequence expand if in deterministic state Phase 2: Full expansion of the current state Proviso check: S1S1 S2S2 S3S3 S4S4 P1P1 P1P1 P1P1 P2P2 (a) S5S5 S6S6 S7S7 S8S8 P1P1 P1P1 P2P2 P2P2 (b) Suits the symbolic case

New Approach: ImProviso Implicit Proviso check –Employs BDDs Motivation –Based on Twophase (explicit-state) –Observation: can be formulated in an implicit way –Crucial point: more efficient proviso than previous techniques New Contributions: –Defining the transition relation –Implicit formulation –Dropping the determinism –Additional fixpoint computation Automated and incorporated into NuSMV

ImProviso: Defining the Transition Relation Two transition relations: –TR1: all transitions from deterministic states (Phase 1) –TR2: entire system (Phase 2) TR1 is further partitioned: – one transition relation for each process P i Example: –Statement reads from a channel into a local variable –States in which the channel is not empty are deterministic –TR1 := channel is not empty => TR-stmt

ImProviso: Dropping the Determinism Twophase: –Only one transition in Phase 1 may be enabled –Simplifies Twophase implementation –Not necessary for correctness ImProviso allows non-determinism in Phase 1 –Multiple enabled transitions in each process –Each enabled transition must fulfill other conditions of a deterministic state BFS search, i.e. enabled transitions expanded at the same time

ImProviso: Pseudo-Code

ImProviso: Illustration rec: d=0 1 send: a!1 1 rec: a?x 1 p1: c=1 2 p2: c=0 2 p1: c=0 2 p2: c=1 2 rec: a?x bool c=-1; chan a = [1] of {int}; active proctype rec() { int x=0; bool d; d=0; a?x; } active proctype send() { a!1; } active proctype p1() { c=0;... } active proctype p2() { c=1;... }

ImProviso: Illustration bool c=-1; chan a = [1] of {int}; active proctype rec() { int x=0; bool d; d=0; a?x; } active proctype send() { a!1; } active proctype p1() { c=0;... } active proctype p2() { c=1;... } Phase1: Fixed Point p1: c=0 2 p2: c=1 2 rec: d=0 1 send: a!1 1 rec: a?x 1 1

ImProviso: Implicit Formulation Implicit formulation of the algorithm –conceptually simple but… not so easy to get right Reason: paths may have different lengths –BFS instead of DFS ImProviso: ‘tighter’ over-approximation than previous symbolic methods –Problem: visited vs. in-stack phase-1 only Cycles -> local check Larger than phase-1 -> no issue!

Related Work Two other approaches combine PO and Symbolic Model Checking: –Kurshan et al.: Preprocess the model –Alur et al.: BDD-based Alur’s approach Stack P1P1 P1P1 P2P2 P1P1 Current Image ImProviso

Implementation Automated Model Checking framework –ImProviso implemented in NuSMV Current examples translated from Promela Considerable effort to compare with explicit state model checkers –e.g., atomic construct in Spin Promela2SMV translator NuSMV + ImProviso Promela Specifications Add Phase 1 and Phase 2 information

Comparison: NuSMV vs. NuSMV-ImProviso #states: significant reduction Time: significant reduction Memory: No reduction

Comparison: NuSMV-ImProviso, PV, and SPIN SPIN and PV faster, if they can handle example NuSMV-ImProviso can handle more examples NuSMV-ImProviso matches PV, SPIN on Best, Worst

Comparison: Leader Election Protocol Models of same size in SMV and Promela Same reduction SPIN, PV faster until…

Leader with Non-deterministic Initial State

Future Work Reduce memory and run time –BDD blowup problem –BDD algorithms optimized for Concurrent Software Verification of both safety and liveness properties –Only safety now Flexible input languages –Only Promela now

Conclusions Novel Partial Order Reduction algorithm for Symbolic Model Checking –Incorporated into NuSMV Illustrated the effectiveness with several benchmark examples Current focus is on tackling large run-time and memory problems Symbolic Model Checking of Software, Software Model Checking Workshop CAV’03