© 2011 Carnegie Mellon University SPIN: Part 1 15-414/614 Bug Catching: Automated Program Verification Sagar Chaki April 21, 2014.

Slides:



Advertisements
Similar presentations
Generating test cases specifications for BPEL compositions of web services using SPIN José García-Fanjul, Javier Tuya, and Claudio de la Riva Pointner.
Advertisements

Model Checking for an Executable Subset of UML Fei Xie 1, Vladimir Levin 2, and James C. Browne 1 1 Dept. of Computer Sciences, UT at Austin 2 Bell Laboratories,
Masahiro Fujita Yoshihisa Kojima University of Tokyo May 2, 2008
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
© 2006 Carnegie Mellon University Combining Predicate and Numeric Abstraction for Software Model Checking Software Engineering Institute Carnegie Mellon.
Formalization of Health Information Portability and Accountability Act (HIPAA) Simon Berring, Navya Rehani, Dina Thomas.
CS 290C: Formal Models for Web Software Lecture 3: Verification of Navigation Models with the Spin Model Checker Instructor: Tevfik Bultan.
Verification of Evolving Software Natasha Sharygina Joint work with Sagar Chaki and Nishant Sinha Carnegie Mellon University.
The cardiac pacemaker – SystemJ versus Safety Critical Java Heejong Park, Avinash Malik, Muhammad Nadeem, and Zoran Salcic. University of Auckland, NZ.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
CS 290C: Formal Models for Web Software Lecture 4: Implementing and Verifying Statecharts Specifications Using the Spin Model Checker Instructor: Tevfik.
© 2011 Carnegie Mellon University SPIN: Part /614 Bug Catching: Automated Program Verification Sagar Chaki April 21, 2014.
Formal verification in SPIN Karthikeyan Bhargavan, Davor Obradovic CIS573, Fall 1999.
/ PSWLAB P ROMELA Semantics from “THE SPIN MODEL CHECKER” by G. J. Holzmann Presented by Hong,Shin 5 th Oct :021PROMELA Semantics.
An Overview of PROMELA. A protocol Validation Language –A notation for the specification and verification of procedure rules. –A partial description of.
The model checker SPIN1 The Model Checker SPIN. The model checker SPIN2 SPIN & Promela SPIN(=Simple Promela Interpreter) –tool for analyzing the logical.
ESP: A Language for Programmable Devices Sanjeev Kumar, Yitzhak Mandelbaum, Xiang Yu, Kai Li Princeton University.
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.
The Spin Model Checker Promela Introduction Nguyen Tuan Duc Shogo Sawai.
1 Spin Model Checker Samaneh Navabpour Electrical and Computer Engineering Department University of Waterloo SE-464 Summer 2011.
An Automata-based Approach to Testing Properties in Event Traces H. Hallal, S. Boroday, A. Ulrich, A. Petrenko Sophia Antipolis, France, May 2003.
© 2013 Carnegie Mellon University Static Analysis of Real-Time Embedded Systems with REK Arie Gurfinkel 1 joint work with Sagar Chaki 1, Ofer Strichman.
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.
© 2011 Carnegie Mellon University Binary Decision Diagrams Part Bug Catching: Automated Program Verification and Testing Sagar Chaki September.
© 2011 Carnegie Mellon University SPIN: Part Bug Catching: Automated Program Verification and Testing Sagar Chaki November 2, 2011.
© 2011 Carnegie Mellon University Binary Decision Diagrams Part Bug Catching: Automated Program Verification and Testing Sagar Chaki September.
© 2011 Carnegie Mellon University SPIN: Part Bug Catching: Automated Program Verification and Testing Sagar Chaki October 31, 2011.
1 Carnegie Mellon UniversitySPINFlavio Lerda SPIN An explicit state model checker.
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.
Developing Verifiable Concurrent Software Tevfik Bultan Department of Computer Science University of California, Santa Barbara
OOTI Workshop on Model Checking and Static Analysis Day 2 Dragan Bošnački Eindhoven University of Technology The Netherlands.
The Rare Glitch Project: Verification Tools for Embedded Systems Carnegie Mellon University Pittsburgh, PA Ed Clarke, David Garlan, Bruce Krogh, Reid Simmons,
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
CS 290C: Formal Models for Web Software Lecture 4: Model Checking Navigation Models with Spin Instructor: Tevfik Bultan.
1 Carnegie Mellon UniversitySPINFlavio Lerda Bug Catching SPIN An explicit state model checker.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
© 2013 Carnegie Mellon University Verifying Periodic Programs with Priority Inheritance Locks Sagar Chaki 1, Arie Gurfinkel 1, Ofer Strichman 2 FMCAD,
Rebecca Modeling Language Mahdieh Ahmadi Verification of Reactive Systems March 2014.
Scientific Computing By: Fatima Hallak To: Dr. Guy Tel-Zur.
Tufts Wireless Laboratory School Of Engineering Tufts University “Verifying Noninterference in a Cyber-Physical System – The Advanced Electric Power Grid”
Institute e-Austria in Timisoara 1 Author: prep. eng. Calin Jebelean Verification of Communication Protocols using SDL ( )
1 Introduction Modules  Most computer programs solve much larger problem than the examples in last sessions.  The problem is more manageable and easy.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
Chapter 6 Programming Languages (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Dynamic Analysis of Multithreaded Java Programs Dr. Abhik Roychoudhury National University of Singapore.
Verifying Autonomous Planning Systems Even the best laid plans need to be verified Prepared for the 2005 Software Assurance Symposium (SAS) DS1 MSL EO1.
MODEL CHECKING WITH SPIN MODELING AND VERIFICATION WITH SPIN ANDREA ORLANDINI – ISTC (CNR) TexPoint fonts used in EMF. Read the TexPoint manual before.
Fault-Tolerant Parallel and Distributed Computing for Software Engineering Undergraduates Ali Ebnenasir and Jean Mayo {aebnenas, Department.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for August 6, 2003.
Temporal Logic Model-checking with SPIN
CS533 – Spring Jeanie M. Schwenk Experiences and Processes and Monitors with Mesa What is Mesa? “Mesa is a strongly typed, block structured programming.
IT System Administration Lesson 3 Dr Jeffrey A Robinson.
Lecture 4 Introduction to Promela. Promela and Spin Promela - process meta language G. Holzmann, Bell Labs (Lucent) C-like language + concurrency dyamic.
© 2006 Carnegie Mellon University Introduction to CBMC: Part 1 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel,
Developing a Framework for Simulation, Verification and Testing of SDL Specifications Olga Shumsky Lawrence Henschen Northwestern University
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
© 2006 Carnegie Mellon University Introduction to CBMC: Part 1 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel,
Symbolic Model Checking of Software Nishant Sinha with Edmund Clarke, Flavio Lerda, Michael Theobald Carnegie Mellon University.
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Reasoning About Exceptions Using Model Checking
Formal verification in SPIN
CSE 503 – Software Engineering
An explicit state model checker
An explicit state model checker
A Refinement Calculus for Promela
Verifying Periodic Programs with Priority Inheritance Locks
CSE 555 Protocol Engineering
CSE 503 – Software Engineering
Presentation transcript:

© 2011 Carnegie Mellon University SPIN: Part /614 Bug Catching: Automated Program Verification Sagar Chaki April 21, 2014

2 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University What is This All About? Spin On-the-fly verifier developed at Bell-labs by Gerard Holzmann and others Promela Modeling language for SPIN Targeted at asynchronous systems – Switching protocols

3 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University History Work leading to Spin started in 1980 First bug found on Nov 21, 1980 by Pan One-pass verifier for safety properties Succeeded by Pandora (82), Trace (83), SuperTrace (84), SdlValid (88), Spin (89) Spin covered omega-regular properties

4 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Spin Capabilities Interactive simulation For a particular path For a random path Exhaustive verification Generate C code for verifier Compile the verifier and execute Returns counter-example Lots of options for fine-tuning

5 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Spin Overall Structure GUI Front-end GUI Front-end Promela Parser Promela Parser LTL Parser and Translator LTL Parser and Translator Syntax Error Reports Syntax Error Reports Interactive Simulation Interactive Simulation Verifier Generator Verifier Generator Optimized Model Checker (ANSI C) Optimized Model Checker (ANSI C) Executable O-T-F Verifier Executable O-T-F Verifier Counter Example

6 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Promela Stands for Process Meta Language Language for asynchronous programs Dynamic process creation Processes execute asynchronously Communicate via shared variables and message channels – Races must be explicitly avoided – Channels can be queued or rendezvous C like syntax

7 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Executability

8 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Delimitors

9 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Data Types

10 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Process Definition Only definitions. Need a “main” function to run

11 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Process Instantiation run can be used anywhere. Dynamic Process Creation. Sample 1

12 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Process Parameterization Data arrays or processes cannot be passed Sample 2

13 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Race Condition Sample 3

14 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Deadlock Sample 4

15 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Atomic sequences Sample 5

16 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Message passing

17 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Message passing More parameters sent Extra parameters dropped More parameters received Extra parameters undefined Fewer parameters sent Extra parameters undefined Fewer parameters received Extra parameters dropped

18 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Message passing Sample 6

19 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Message passing

20 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Executability

21 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Composite conditions

22 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Time for example 1

23 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Rendezvous Channel of size 0 defines a rendezvous port Can be used by two processed for a synchronous handshake No queueing The first process blocks Handshake occurs after the second process arrives

24 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Example Sample 7

25 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Control flow We have already seen some Concatenation of statements, parallel execution, atomic sequences There are a few more Case selection, repetition, unconditional jumps

26 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Case selection

27 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Time for example 2

28 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Repetition

29 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Repetition

30 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Unconditional jumps

31 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Procedures and Recursion Procedures can be modeled as processes Even recursive ones Return values can be passed back to the calling process via a global variable or a message

32 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Time for example 3

33 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Timeouts

34 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Assertions

35 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Time for example 4

36 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University References labs.com/cm/cs/what/spin/Man/Manual.html labs.com/cm/cs/what/spin/Man/Quick.html

37 SPIN – Part 1 Sagar Chaki, April 21, 2014 © 2011 Carnegie Mellon University Questions? Sagar Chaki Senior Member of Technical Staff RTSS Program Telephone: U.S. Mail Software Engineering Institute Customer Relations 4500 Fifth Avenue Pittsburgh, PA USA Web Customer Relations Telephone: SEI Phone: SEI Fax: