Thomas Ball, Rupak Majumdar, Todd Millstein, Sriram K. Rajamani Presented by Yifan Li November 22nd In PLDI 01: Programming Language.

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

Copyright 2000 Cadence Design Systems. Permission is granted to reproduce without modification. Introduction An overview of formal methods for hardware.
The Static Driver Verifier Research Platform
Formal Methods and Testing Goal: software reliability Use software engineering methodologies to develop the code. Use formal methods during code development.
Catching Bugs in Software Rajeev Alur Systems Design Research Lab University of Pennsylvania
M ODEL CHECKING -Vasvi Kakkad University of Sydney.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Verification of Evolving Software Natasha Sharygina Joint work with Sagar Chaki and Nishant Sinha Carnegie Mellon University.
50.530: Software Engineering Sun Jun SUTD. Week 10: Invariant Generation.
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
1 Thorough Static Analysis of Device Drivers Byron Cook – Microsoft Research Joint work with: Tom Ball, Vladimir Levin, Jakob Lichtenberg,
Chair of Software Engineering Software Verification Stephan van Staden Lecture 10: Model Checking.
Automatic Predicate Abstraction of C-Programs T. Ball, R. Majumdar T. Millstein, S. Rajamani.
Verification of parameterised systems
The Software Model Checker BLAST by Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala and Rupak Majumdar Presented by Yunho Kim Provable Software Lab, KAIST.
State-Event Software Verification for Branching-Time Specifications Sagar Chaki, Ed Clarke, Joel Ouaknine, Orna Grumberg Natasha Sharygina, Tayssir Touili,
Software Engineering: Where are we? And where do we go from here? V Software Engineering Lecture 23 Clark Barrett New York University 4/17/2006.
Lazy Abstraction Thomas A. Henzinger Ranjit Jhala Rupak Majumdar Grégoire Sutre UC Berkeley.
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.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
CS 267: Automated Verification Lectures 14: Predicate Abstraction, Counter- Example Guided Abstraction Refinement, Abstract Interpretation Instructor:
Automatically Validating Temporal Safety Properties of Interfaces Thomas Ball and Sriram K. Rajamani Software Productivity Tools, Microsoft Research Presented.
Witness and Counterexample Li Tan Oct. 15, 2002.
Software Reliability Methods Sorin Lerner. Software reliability methods: issues What are the issues?
Predicate Abstraction for Software and Hardware Verification Himanshu Jain Model checking seminar April 22, 2005.
Review of the automata-theoretic approach to model-checking.
Witness and Counterexample Li Tan Oct. 15, 2002.
Automata and Formal Lanugages Büchi Automata and Model Checking Ralf Möller based on slides by Chang-Beom Choi Provable Software Lab, KAIST.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Lazy Abstraction Tom Henzinger Ranjit Jhala Rupak Majumdar Grégoire Sutre.
Automatic Predicate Abstraction of C Programs Thomas BallMicrosoft Rupak MajumdarUC Berkeley Todd MillsteinU Washington Sriram K. RajamaniMicrosoft
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.
By D. Beyer et. al. Simon Fraser University (Spring 09) Presentation By: Pashootan Vaezipoor.
MCAI 2.0 Model Checking in Ten Minutes Edmund Clarke School of Computer Science Carnegie Mellon University.
Verification technique on SA applications using Incremental Model Checking 컴퓨터학과 신영주.
CSC2108 Lazy Abstraction on Software Model Checking Wai Sum Mong.
Lecture 1: Model Checking
50.530: Software Engineering
Introduction to Software Testing Chapter 9.4 Model-Based Grammars Paul Ammann & Jeff Offutt
Towards Scalable Modular Checking of User-defined Properties Thomas Ball, MSR Brian Hackett, Mozilla Shuvendu Lahiri, MSR Shaz Qadeer, MSR Julien Vanegue,
Static and Dynamic Analysis at JPL Klaus Havelund.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 3: Modular Verification with Magic, Predicate Abstraction.
Rule Checking SLAM Checking Temporal Properties of Software with Boolean Programs Thomas Ball, Sriram K. Rajamani Microsoft Research Presented by Okan.
CS6133 Software Specification and Verification
Aditya V. Nori, Sriram K. Rajamani Microsoft Research India.
Parameterized Verification of Thread-safe Libraries Thomas Ball Sagar Chaki Sriram K. Rajamani.
Thomas Ball Sriram K. Rajamani
Automatically Validating Temporal Safety Properties of Interfaces Thomas Ball, Sriram K. MSR Presented by Xin Li.
Convergence of Model Checking & Program Analysis Philippe Giabbanelli CMPT 894 – Spring 2008.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Validation - Formal verification -
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
Verification & Validation By: Amir Masoud Gharehbaghi
The Yogi Project Software property checking via static analysis and testing Aditya V. Nori, Sriram K. Rajamani, Sai Deep Tetali, Aditya V. Thakur Microsoft.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
Synergy: A New Algorithm for Property Checking Bhargav S. Gulavani (IIT Bombay)‏ Yamini Kannan (Microsoft Research India)‏ Thomas A. Henzinger (EPFL)‏
1 Automatically Validating Temporal Safety Properties of Interfaces - Overview of SLAM Parts of the slides are from
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Formal verification in SPIN
IS 2935: Developing Secure Systems
Formal Methods in software development
50.530: Software Engineering
Predicate Abstraction
Course: CS60030 Formal Systems
Presentation transcript:

Thomas Ball, Rupak Majumdar, Todd Millstein, Sriram K. Rajamani Presented by Yifan Li November 22nd In PLDI 01: Programming Language Design and Imple- mentation, 2001

“Can software help programmers write better software?”

Outline  What is model checking  Why it is important  Current state of the art  Challenges in applying model checking to C programs  SLAM project

Outline  What is model checking  Why it is important  Current state of the art  Challenges in applying model checking to C programs  SLAM project

Model Checking  A specific technique of formal verification  Given a model of a system, test automatically whether this model meets a given specification

Formal Verification  Formal Verification Formal verification is the act of proving or disproving the correctness of intended algorithms underlying a system with respect to a certain formal specification or property  To help mathematically prove the correctness of a software or hardware system

The Model checking problem  Let M be a Kripke structure (i.e., state- transition graph)  Let f be a formula of temporal logic (i.e., the specification)  Find all states s of M such that M,s ├ f

A typical model checking system Figure 1. A typical model checking system

Kripke Structure  A Kripke structure is a type of nondeterministic finite state machine proposed by Saul Kripke, used in model checking Let the set of atomic propositions AP = {p,q}. p and q can model arbitrary boolean properties of the system that the Kripke structure is modelling M may produce a path ρ = s 1,s 2,s 1,s 2,s 3, s 3,s 3,... (potentially infinite) Figure 2. Kripke Structure

How to model-check  Basic Procedure: 1. Describe the system as a finite state model 2. Express properties in temporal logic 3. Formal Verification by automatic exhaustive search over the state space  Use a model checker to check properties

Temporal logic  Used to describe any system of rules for representing propositions in terms of time  Statements in temporal logic: "I am always hungry“ "I will eventually be hungry“ "I will be hungry until I eat something“  Temporal logics describe the ordering of events in time without introducing time explicitly.  The meaning of a temporal logic formula is determined with respect to a labeled state- transition graph or Kripke structure.

Abstraction of model  What if the model is infinite-like ? Using abstraction  Any effort to model check software must first construct an abstract model of the software  Predicate Abstraction- A promising approach to construct abstractions automatically (which will be covered later)

What is a model checker A model checker is a software tool that  given a description of a Kripke model M... ... and a property φ  decides whether M ├ φ  returns “yes” if the property is satisfied,  otherwise returns “no”, and provides a counterexample

What is a model checker Figure 3. The model Checker

Outline  What is model checking  Why it is important  Current state of the art  Challenges in applying model checking to C programs  SLAM project

Why it is important  software bugs are so common that their cost to the American economy alone is $60 billion a year or about 0.6% of gross domestic product (NIST)

Why it is important? Some errors in software systems are expensive:  Space Mission Failed: A bug caused 370- million dollar failure in 1996, which is $514 to $686 million in 2010 (Flight 501) While some are pretty annoying:  “Bill Gates: 5% of Windows Machines Crash More Than Twice A Day”

Outline  What is model checking  Why it is important  Current state of the art  Challenges in applying model checking to C programs  SLAM project

A wide Variety of model checkers Name a few: For C programs:  BLAST (Berkeley)  CMBC (Carnegie Mellon)  CPA checker(U of Passau, Germany)  SLAM(Microsoft Research) Others:  SPIN (Bell Lab, System Software Award-2001)

SLAM  “software (specifications), programming languages, abstraction, and model checking”  SLAM is a program-analysis engine of the SDV tool used to check if clients of an API follow the API’s stateful usage rules  SLAM toolkit, include C2BP, BEBOP, NEWTON is the analysis engine of the SDV tool

SLAM2  The improved version of SLAM  With under 4% false alarms

SDV Static Driver Verifier (SDV): Compile-time verification tool Ships with Windows 7 Driver Kit (WDK) Less than 4% false alarms on real drivers Supports many driver APIs (WDM, KMDF, NDIS, …) Uses SLAM as the verification engine Based on CEGAR loop Boolean abstraction of input C programs API-specific components: environment model API rules in SLIC language

Driver’s Source Code in C Precise API Usage Rules (SLIC) Defects 100% path coverage Rules Static Driver Verifier Environment model Static Driver Verifier Figure 4. SDV

Usage  SDV 2.0 is applied as an automatic and required quality gate for Windows 7 device drivers  SLAM is distributed as part of the Windows Driver Development Kit

Outline  What is model checking  Why it is important  Current state of the art  Challenges in applying model checking to C programs  SLAM project

Challenges in applying model checking to C program  Pointers (alias problem)  Procedures( signature)  unknown values (*)  Lots of predicate states

Outline  What is model checking  Why it is important  Current state of the art  Challenges in applying model checking to C program  SLAM project

SLAM Project SLIC C Program P Instrumented C program P’ C2BP Boolean Program BP(E,P’) Bebop Error Path Feasible No, refine the Predicate, gen- erate new BP Yes, An error found Program Bug Figure 5. The SLAM realization of CEGAR loop

CEGAR  In theory, counterexample-guided abstraction refinement (CEGAR) uses spurious counterexamples to refine overapproximations so as to eliminate provably false alarms

SLIC  SLIC: Specification Language for Interface Checking  SLIC is a subset of the C language augmented with elements that identify the events of interest.  Next slide, an example of a SLIC language and the instructed C program based on that

Figure 6. To check that a spinlock cannot be acquired without it first being released, and that a spinlock cannot be released twice

Figure 7. The BP of the instructed C program. The first and second iterations of Bebop and Newton

Figure 8. Slic Specification for Proper Usage of Spin Locks, and (b) Its Compilation into C Code. Example 2

Figure 9. (a) A snippet of device driver code P, and (b) program P0 resulting from instrumentation of program P due to Slic specification in Figure 8

Figure 10. The C code of the Slic specification from Figure 1(b) compiled by C2bp into a boolean program.

Figure 11. The two boolean programs created while checking the code from Figure 9 (b)

How well it works Experience of SLAM works on device drivers that have hundred's or thousand’s lines of codes

How well it works There are true errors found in the device driver when running SLAM on them

Conclusion  Slam toolkit outcomes the challenges in applying model checking to C programs  Slam is appropriate to use on large scale C programs and on device drivers written in C  The SDV tool has already been used in model checking device drivers for Windows 7 before they come to market

References  Measure the buying power of US dollar at different times  Bill Gates Talk hines_Crash_More_Than_Twice_A_Day  Symbolic Model Checking  Building a better bug-trap  The SLAM project

Thank you!