Grand Challenge Problem: Model Check Concurrent Software Edmund M. Clarke Department of Computer Science Carnegie Mellon University.

Slides:



Advertisements
Similar presentations
Copyright 2000 Cadence Design Systems. Permission is granted to reproduce without modification. Introduction An overview of formal methods for hardware.
Advertisements

Abstraction in Model Checking Nishant Sinha. Model Checking Given a: –Finite transition system M –A temporal property p The model checking problem: –Does.
Auto-Generation of Test Cases for Infinite States Reactive Systems Based on Symbolic Execution and Formula Rewriting Donghuo Chen School of Computer Science.
CS 267: Automated Verification Lecture 2: Linear vs. Branching time. Temporal Logics: CTL, CTL*. CTL model checking algorithm. Counter-example generation.
M ODEL CHECKING -Vasvi Kakkad University of Sydney.
Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides.
SAT Based Abstraction/Refinement in Model-Checking Based on work by E. Clarke, A. Gupta, J. Kukula, O. Strichman (CAV’02)
Verification of Evolving Software Natasha Sharygina Joint work with Sagar Chaki and Nishant Sinha Carnegie Mellon University.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
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.
1 Symbolic Execution for Model Checking and Testing Corina Păsăreanu (Kestrel) Joint work with Sarfraz Khurshid (MIT) and Willem Visser (RIACS)
Verification of Hybrid Systems An Assessment of Current Techniques Holly Bowen.
1 Software Verification Computer Science Club, Steklov Math Institute Lecture 1 Natasha Sharygina The University of Lugano, Carnegie Mellon University.
Symmetry-Aware Predicate Abstraction for Shared-Variable Concurrent Programs Alastair Donaldson, Alexander Kaiser, Daniel Kroening, and Thomas Wahl Computer.
Grand Challenge Problem: Model Check Concurrent Software Edmund M. Clarke Department of Computer Science Carnegie Mellon University.
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:
Tuning SAT-checkers for Bounded Model-Checking A bounded guided tour Ofer Strichman Carnegie Mellon University.
Demonstration Of SPIN By Mitra Purandare
CSEP590 – Model Checking and Software Verification University of Washington Department of Computer Science and Engineering Summer 2003.
Using Statically Computed Invariants Inside the Predicate Abstraction and Refinement Loop Himanshu Jain Franjo Ivančić Aarti Gupta Ilya Shlyakhter Chao.
1 Model Checking, Abstraction- Refinement, and Their Implementation Based on slides by: Orna Grumberg Presented by: Yael Meller June 2008.
1 Model Checking, Abstraction- Refinement, and Their Implementation Orna Grumberg Verification seminar March 2006.
State-Event Software Verification for Branching-Time Specifications Sagar Chaki, Ed Clarke, Joel Ouaknine, Orna Grumberg Natasha Sharygina, Tayssir Touili,
Abstractions. Outline Informal intuition Why do we need abstraction? What is an abstraction and what is not an abstraction A framework for abstractions.
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
1 2-Valued and 3-Valued Abstraction- Refinement Frameworks for Model Checking Orna Grumberg Technion Haifa, Israel Tutorials at ATVA, 2009.
Predicate Abstraction for Software and Hardware Verification Himanshu Jain Model checking seminar April 22, 2005.
Embedded Systems Laboratory Department of Computer and Information Science Linköping University Sweden Formal Verification and Model Checking Traian Pop.
Carnegie Mellon University Symbolic Approaches to Invariant Checking and Automatic Predicate Abstraction Randal E. Bryant.
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.
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Formal verification Marco A. Peña Universitat Politècnica de Catalunya.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
Model Checking for Embedded Systems Edmund Clarke, CMU High-Confidence Embedded Systems Workshop, May 1 st.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
MCAI 2.0 Model Checking in Ten Minutes Edmund Clarke School of Computer Science Carnegie Mellon University.
Lecture 1: Model Checking
Edmund M. Clarke School of Computer Science Carnegie Mellon University Lecture 2: Model Checking My 30 Year Quest to Conquer the State Explosion Problem.
Survey on Trace Analyzer (2) Hong, Shin /34Survey on Trace Analyzer (2) KAIST.
Predicate Abstraction of ANSI-C Programs Using SAT By Edmund Clarke, Daniel Kroening, Natalia Sharygina, Karen Yorav Presented by Yunho Kim Provable Software.
1 Abstractions and Decision Procedures for Effective Software Model Checking Microsoft Summer School, Moscow, July 2011 Lecture 1 Prof. Natasha Sharygina.
Symbolic Execution with Abstract Subsumption Checking Saswat Anand College of Computing, Georgia Institute of Technology Corina Păsăreanu QSS, NASA Ames.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
Author: Alex Groce, Daniel Kroening, and Flavio Lerda Computer Science Department, Carnegie Mellon University Pittsburgh, PA Source: R. Alur and.
Localization and Register Sharing for Predicate Abstraction Himanshu Jain Franjo Ivančić Aarti Gupta Malay Ganai.
Model Checking Overview Edmund M. Clarke, Jr. School of Computer Science Carnegie Mellon University Pittsburgh, PA
Verification & Validation By: Amir Masoud Gharehbaghi
Concrete Model Checking with Abstract Matching and Refinement Corina Păsăreanu QSS, NASA Ames Research Center Radek Pelánek Masaryk University, Brno, Czech.
© 2006 Carnegie Mellon University Introduction to CBMC: Part 1 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel,
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
Bounded Model Checking A. Biere, A. Cimatti, E. Clarke, Y. Zhu, Symbolic Model Checking without BDDs, TACAS’99 Presented by Daniel Choi Provable Software.
CHARME’03 Predicate abstraction with Minimum Predicates Sagar Chaki*, Ed Clarke*, Alex Groce*, Ofer Strichman** * Carnegie Mellon University ** Technion.
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.
© 2006 Carnegie Mellon University Introduction to CBMC: Part 1 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel,
Finding bugs with a constraint solver daniel jackson. mandana vaziri mit laboratory for computer science issta 2000.
© Anvesh Komuravelli Spacer Model Checking with Proofs and Counterexamples Anvesh Komuravelli Carnegie Mellon University Joint work with Arie Gurfinkel,
Counterexample-Guided Abstraction Refinement By Edmund Clarke, Orna Grumberg, Somesh Jha, Yuan Lu, and Helmut Veith Presented by Yunho Kim Provable Software.
SAT for Software Model Checking Introduction to SAT-problem for newbie
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Basic concepts of Model Checking
Formal Methods: Model Checkers and Theorem Provers
SS 2017 Software Verification Bounded Model Checking, Outlook
Introduction to Software Verification
Property Directed Reachability with Word-Level Abstraction
Over-Approximating Boolean Programs with Unbounded Thread Creation
Predicate Abstraction
SAT Based Abstraction/Refinement in Model-Checking
Presentation transcript:

Grand Challenge Problem: Model Check Concurrent Software Edmund M. Clarke Department of Computer Science Carnegie Mellon University

Temporal Logic Model Checking Model checking is an automatic verification technique for finite state concurrent systems. Developed independently by Clarke, Emerson, and Sistla and by Queille and Sifakis in early 1980’s. Specifications are written in propositional temporal logic. Verification procedure is an exhaustive search of the state space of the design.

Advantages of Model Checking No proofs!!! Fast (compared to other rigorous methods such as theorem proving) Diagnostic counterexamples No problem with partial specifications Logics can easily express many concurrency properties

Main Disadvantage State Explosion Problem: Too many processes Complex data structures Much progress has been made on this problem recently!

Basic Temporal Operators Fp - p holds sometime in the future. Gp - p holds globally in the future. Xp - p holds next time. pUq - p holds until q holds. The symbol “p” is an atomic proposition, e.g. “Device Enabled”.

Model Checking Problem Let M be a state-transition graph. Let ƒ be the specification in temporal logic. Find all states s of M such that M, s  ƒ. Efficient Algorithms: CE81, CES83

Combating the State Explosion Problem Binary Decision Diagrams can be used to represent state transition systems more efficiently. SMV The partial order reduction can be used to reduce the number of states that must be enumerated. SPIN Many techniques for alleviating state explosion: –Abstraction. –Compositional reasoning. –Symmetry. –Cone of influence reduction. –Semantic minimization.

Model Checker Performance Model checkers today can routinely handle systems with between 100 and 1000 state variables. Systems with reachable states have been checked. (Compare approx atoms in universe.) By using appropriate abstraction techniques, systems with an essentially unlimited number of states can be checked.

Model Checking Systems There are many successful examples of the use of model checking in hardware and protocol verification. The fact that industry (INTEL, IBM, MOTOROLA) is starting to use model checking is encouraging.

Notable Example- IEEE Futurebus + In 1992 Clarke and his students at CMU used SMV to verify the IEEE Future+ cache coherence protocol. They found a number of previously undetected errors in the design of the protocol. This was the first time that formal methods have been used to find errors in an IEEE standard. Although the development of the protocol began in 1988, all previous attempts to validate it were based entirely on informal techniques.

Grand Challenge: Model Check Software ! What makes Software Model Checking different ?

What Makes Software Model Checking Different ? Large/unbounded base types: int, float, string User-defined types/classes Pointers/aliasing + unbounded #’s of heap-allocated cells Procedure calls/recursion/calls through pointers/dynamic method lookup/overloading Concurrency + unbounded #’s of threads

What Makes Software Model Checking Different ? Templates/generics/include files Interrupts/exceptions/callbacks Use of secondary storage: files, databases Absent source code for: libraries, system calls, mobile code Esoteric features: continuations, self-modifying code Size (e.g., MS Word = 1.4 MLOC)

What Does It Mean to Model Check Software? 1.Combine static analysis and model checking Use static analysis to extract a model K from a boolean abstraction of the program. Then check that f is true in K (K ² f), where f is the specification of the program. ² SLAM (Microsoft) ² Bandera (Kansas State) ² Java PathFinder (NASA Ames) ² MAGIC (CMU)

What Does It Mean to Model Check Software? 2.Simulate program along all paths in computation tree ² Source code + backtracking (e.g., Verisoft) ² Source code + symbolic execution + backtracking (e.g., MS/Intrinsa Prefix) 3.Use finite-state machine to look for patterns in control-flow graph [Engler]

What Does It Mean to Model Check Software? 4. Design with Finite-State Software Models Finite state software models can act as “missing link” between transition graphs and complex software. ² Statecharts ² Esterel

What Does It Mean to Model Check Software? 5. Use Bounded Model Checking and SAT (Kroening) Problem: How to compute set of reachable states? Fixpoint computation is too expensive. Restrict search to states that are reachable from initial state within fixed number n of transitions Implemented by unwinding program and using SAT solver

Key techniques for Software Model Checking Counterexample Guided Abstraction Refinement (Kurshan, Yuan Lu, Ball et al.) Predicate Abstraction (Graf and Saidi, Ball et al, Chaki et al, Kroening)

Transition System Informal Specification Temporal Logic Formula (CTL, LTL, etc.) Safety Property: bad state unreachable: satisfied Initial State Counterexamples Program

Transition System Program Informal Specification Temporal Logic Formula (CTL, LTL, etc.) Initial State Safety Property: bad state unreachable Counterexample Counterexamples

Transition System Program Informal Specification Temporal Logic Formula (CTL, LTL, etc.) Initial State Safety Property: bad state unreachable Counterexample Counterexamples

Existential Abstraction M MhMh Given an abstraction function h : S  S h, the concrete states are grouped and mapped into abstract states : hhh Preservation Theorem ?

Simulation Relation Assume N simulates M (M  N) Let f be a universal CTL* formula (ACTL*) a b c b d a b cd MN N |= fM |= f

Preservation Theorem Atomic formula f respects h if f does not distinguish concrete states within abstract state. Theorem (Clarke, Grumberg, Long) If  is an ACTL* specification where the atomic formulas respect h, then M  M h. Corollary Preservation Theorem applicable: M h |=  implies M |= . Converse implication is not valid !

Spurious Behavior AGAF red “Every path necessarily leads back to red.” Spurious Counterexample:... “red” “go” Artifact of the abstraction !

How to define Abstraction Functions ? Abstraction too fine  State Explosion Abstraction too coarse  Information Loss Automatic Abstraction Methodology

Automatic Abstraction M Original Model Refinement MhMh Initial Abstraction Spurious counterexample Validation or Counterexample Correct !

CEGAR CounterExample-Guided Abstraction Refinement T h is not spurious check if counter- example spurious ThTh stop M h |=  generate counterexample T h M h |=  model check MhMh generate initial abstraction M and  refinement ThTh is spurious

CEGAR Counterexample-Guided Abstraction Refinement T h is not spurious check if counter- example spurious ThTh stop M h |=  generate counterexample T h M h |=  model check MhMh Predicate abstraction C refinement new predicates ThTh is spurious

Predicate Abstraction Use predicate abstraction to prove assertions or safety properties Successfully applied for verification of C programs (SLAM, MAGIC, BLAST) Predicate abstraction produces over-approximation

Example for Predicate Abstraction void main() { int i; i=0; while(even(i)) i++; } + p 1  i=0 p 2  even(i) = void main() { bool p1, p2; p1=TRUE; p2=TRUE; while(p2) { p1=p1?FALSE:nondet(); p2=!p2; } PredicatesC programBoolean program [Graf, Saidi ’97]

Using theorem prover for abstraction p1p1 p2p Predicates i++; Basic BlockFormula Query p’ 1 p’ 

Using theorem prover for abstraction p1p1 p2p Predicates i++; Basic BlockFormula Query p’ 1 p’ … and so on …

Problems with existing tools Large number of expensive theorem prover calls – slow (2 n £ 2 n ) Theorem prover works on natural numbers, but programs uses bit-vectors  false positives Most theorem provers support only few operators (+, -, <, ≤, …), no bitwise operators

Abstraction of a basic block Use a SAT solver for computing abstraction of a basic block Successfully used for abstraction of C programs Create a SAT instance which relates: –Initial value of predicates –Basic block –Final value of predicates

Abstraction of a basic block ++ Computing abstract transitions

Abstract transitions (!p 1 & !p 2 & !p’ 1 & p’ 2 ) 00 ) 01 (!p 1 & !p 2 & p’ 1 & p’ 2 ) 00 ) 11 …………………and so on Equation passed to the SAT solver Satisfying assignments

Use SAT solver! 1.Generate query equation with predicates as free variables 2.Transform equation into CNF using Bit Vector Logic One satisfying assignment matches one abstract transition 3.Obtain all satisfying assignments = most precise abstract transition relation Abstraction of a basic block

Advantages of using SAT Use SAT solver! 1.Generate query equation with predicates as free variables 2.Transform equation into CNF using Bit Vector Logic One satisfying assignment matches one abstract transition 3.Obtain all satisfying assignments = most precise abstract transition relation This solves two problems: 1.Now can do all C operators,including *, /, %, <<, & etc. 2.Bit vector semantics taken into account This solves two problems: 1.Now can do all C operators,including *, /, %, <<, & etc. 2.Bit vector semantics taken into account No more unnecessary spurious counterexamples!

CEGAR Counterexample-Guided Abstraction Refinement T h is not spurious check if counter- example spurious ThTh stop M h |=  generate counterexample T h M h |=  model check MhMh Predicate abstraction C refinement new predicates ThTh is spurious

CEGAR Counterexample-Guided Abstraction Refinement T h is not spurious check if counter- example spurious ThTh stop M h |=  generate counterexample T h M h |=  model check MhMh Predicate abstraction C refinement new predicates ThTh is spurious

CEGAR Counterexample-Guided Abstraction Refinement T h is not spurious check if counter- example spurious ThTh stop M h |=  generate counterexample T h M h |=  model check MhMh Predicate abstraction C refinement new predicates ThTh is spurious

CEGAR Counterexample-Guided Abstraction Refinement T h is not spurious check if counter- example spurious ThTh stop M h |=  generate counterexample T h M h |=  model check MhMh Predicate abstraction C refinement new predicates ThTh is spurious

Future research directions Data Structures Pointers Concurrency Object Oriented Software Scaling up!!

References Counterexample-Guided Abstraction Refinement. CAV’00 & JACM. Modular Verification of Software Components in C. ICSE 2003 Predicate Abstraction with Minimum Predicates. CHARME 2003 Predicate Abstraction of ANSI-C Programs Using SAT. FMSD 2004 A Tool for Checking ANSI-C Programs, TACAS 2004 Joint Work with O. Grumberg, H.Veith, D. Kroening, Sagar Chaki, Natasha Sharygina, Karen Yorav, Himanshu Jain QUESTIONS?