INF672 Protocol Safety and Verification. Karthik Bhargavan Xavier Rival Thomas Clausen

Size: px
Start display at page:

Download "INF672 Protocol Safety and Verification. Karthik Bhargavan Xavier Rival Thomas Clausen"

Transcription

1 INF672 Protocol Safety and Verication Karthik Bhargavan Xavier Rival Thomas Clausen 1

2 Course Outline Lecture 1 [Today, Sep 15] Introduction, Motivating Examples Lectures 2-4 [Sep 22,29, Oct 6] Network Protocol Verication: Spin Lectures 5-8 [Oct 13, 20, 27, Nov 3] Program Verication: Properties, Tools & Techniques Lecture 9 [Nov 10] Security Protocol Verication: ProVer Lecture 10 [Nov 17] Exam

3 Outline Modeling Protocols Examples in Promela Specying Properties Examples in LTL Verying Models Model-checking with SPIN

4 Protocols as Distributed Programs Protocols are programs that run on a network Reactive to non-deterministic environment Concurrent execution Asynchronous communication Distributed architecture

5 Formal Protocol Analysis How do we ensure that a protocol (and its implementation) achieves its intended goals? Can we formally state a correctness theorem? Can we (semi-)automatically prove such theorems? Can we (semi-)automatically nd counterexamples? Automation is often necessary There are too many cases to consider by hand Proofs and counterexamples should be reproducible

6 Testing vs. Verication Testing distributed programs is hard Dcult to observe events Dcult to control environment, scheduling, timing Too many scenarios and corner cases Verying their design should be easier Model the protocol in a high-level language Compose it with a model of the environment Analyze its traces for desired properties

7 Modeling Protocols Today, we shall very models written in Promela Promela: Process Meta Language [Holzmann 91] A language for communicating nite state machines Originally designed for communications protocols Can be analyzed by the Spin model checker Spin: Model checker for Promela

8 Example: Forwarding in a Network D S Each node runs a forwarding process It consults a static forwarding table It reacts to application requests and network events

9 Forwarder: Reactive, Non-Deterministic proctype forwarder (int me) { int next[nodes]; int ldest,src,dest; mtype m; } do :: net? ldest,dest,m -> :: ldest == me -> :: dest == me -> app_out! src,dest,m net! next[dest],dest,m :: app_in? me,dest,m -> :: dest == me -> skip net! next[dest],dest,m od Syntax: proctype describes a process mtype is an enumeration do/od is a while loop with non-determinism / is a conditional with non-determinism net?x,y,z receives a message on a channel net app_out!x,y,z sends a message on a channel app_out Features: Reactive to messages on multiple channels Non-deterministic, non-terminating

10 Forwarder: Channels and State mtype = {req, resp}; typedef table { } int next[nodes]; table fwd[nodes]; chan app_in[nodes] = [0] of {int, mtype}; chan app_out[nodes] = [0] of {int, int, mtype}; chan net[nodes] = [3] of {int, int, mtype}; Buffered Channel (size 3) Enables asynchronous communication. Synchronous channel proctype forwarder (int me) { int src,dest; mtype m; do :: net[me]? src,dest,m; :: dest == me -> app_out[me]! src,dest,m net[fwd[me].next[dest]]! src,dest,m :: app_in[me]? dest,m; :: dest == me -> skip net[fwd[me].next[dest]]! me,dest,m od }

11 Forwarder: Reactive, Non-Deterministic Control States: {l1,,l7} Does it terminate? Suppose no of nodes = N Global memory: fwd: N * N * N Local memory: me, src, dest: N m: mtype Finite state (rel to N) Non-deterministic Desired Property: forwarder only sends messages for itself on app_out (What kind of property is it?) l1 l2 l3 l4 l5 l6 l7 proctype forwarder (int me) { int src,dest; mtype m; do :: net[me]? src,dest,m; :: dest == me -> app_out[me]! src,dest,m net[fwd[me].next[dest]]! src,dest,m :: app_in[me]? dest,m; :: dest == me -> skip net[fwd[me].next[dest]]! me,dest,m od }

12

13 Modeling the Environment init{ fwd[0].next[0] = 0; fwd[0].next[1] = 1; fwd[0].next[2] = 1; fwd[1].next[0] = 0; fwd[1].next[1] = 1; fwd[1].next[2] = 2; fwd[2].next[0] = 1; fwd[2].next[1] = 1; fwd[2].next[2] = 2; Syntax: Init runs rst and sets up processes in the model arrays must be initialized cell-by-cell run starts a process instance } run forwarder(0); run forwarder(1); run forwarder(2); app_in[0]! 2,req; app_out[2]? 0,2,req; app_in[2]! 0,resp; app_out[0]? 2,0,resp; net net app_in app_in app_out app_out

14 Forwarder: Concurrent Execution proctype forwarder (int me) { int src,dest; mtype m; do :: net[me]? src,dest,m; :: dest == me -> app_out[me]! src,dest,m net[fwd[me].next[dest]]! src,dest,m :: app_in[me]? dest,m; :: dest == me -> skip net[fwd[me].next[dest]]! me,dest,m od } State Space (Set of traces): All possible interleavings of the two processes How large can this get? (Exponential growth!) proctype forwarder (int me) { int src,dest; mtype m; do :: net[me]? src,dest,m; :: dest == me -> app_out[me]! src,dest,m net[fwd[me].next[dest]]! src,dest,m :: app_in[me]? dest,m; :: dest == me -> skip net[fwd[me].next[dest]]! me,dest,m od }

15 Run SPIN to Simulate Execution Generates a random trace, message sequence chart. Veries all assertions in code. Very useful for nding simple bugs in the model.

16 Forwarder: Deadlock Freedom proctype forwarder (int me) { int src,dest; mtype m; do :: net[me]? src,dest,m; :: dest == me -> app_out[me]! src,dest,m net[fwd[me].next[dest]]! src,dest,m :: app_in[me]? dest,m; :: dest == me -> skip net[fwd[me].next[dest]]! me,dest,m od } Desired Property: Forwarders do not get stuck (What kind of property is it?) proctype forwarder (int me) { int src,dest; mtype m; do :: net[me]? src,dest,m; :: dest == me -> app_out[me]! src,dest,m net[fwd[me].next[dest]]! src,dest,m :: app_in[me]? dest,m; :: dest == me -> skip net[fwd[me].next[dest]]! me,dest,m od }

17 Preventing the Deadlock proctype forwarder (int me) { int src,dest; mtype m; do :: net[me]? src,dest,m; :: dest == me -> app_out[me]! src,dest,m net[fwd[me].next[dest]]! src,dest,m :: app_in[me]? dest,m; :: dest == me -> skip :: net[fwd[me].next[dest]]! me,dest,m; :: full(net[fwd[me].next[dest]]) -> skip; od } Desired Property: Forwarders do not get stuck (What kind of property is it?) Blocking statements: Reading from an empty channel Writing to a full channel Waiting on synchronous channel for input/output Modeling choices: Drop packets when network channel is full Guarantee that environment won t send too many requests

18 Modeling Network Errors Protocols operate on a faulty network Packets may get lost, or re-ordered Network links (edges) might go down Forwarders (nodes) might go down New links and nodes may (re-)appear proctype lossynetwork() { int src,dest; mtype m; end: do :: net[0]? src,dest,m :: net[1]? src,dest,m :: net[2]? src,dest,m od}

19 Specying and Verying Properties

20 Deadlock Freedom proctype forwarder (int me) { int src,dest; mtype m; end: do :: net[me]? src,dest,m; :: dest == me -> app_out[me]! src,dest,m net[fwd[me].next[dest]]! src,dest,m :: app_in[me]? dest,m; :: dest == me -> skip :: net[fwd[me].next[dest]]! me,dest,m; :: full(net[fwd[me].next[dest]]) -> skip; od } Desired Property: Forwarders do not get stuck (What kind of property is it?) Processes must either terminate or should visit innitely often an end state A notion of non-termination for reactive programs Cannot get stuck in a branch Must always return to the toplevel process loop Automatically veried by SPIN Analyzes all reachable (nite) traces of the top-level process

21 Partial Correctness proctype application () { int src, dest; mtype m; do :: app_in[0]! 2,req :: app_out[0]? 2,0, resp :: app_in[2]! 0, resp :: app_out[0]? 2,0, resp :: app_in[1]! 0, req :: app_out[0]? 1,0,req :: app_in[1]! 2,req :: app_out[2]? 1,2,req :: app_out[0]? src,dest,m -> assert(dest==0); :: app_out[1]? src,dest,m -> assert(dest==1); :: app_out[2]? src,dest,m -> assert(dest==2); od } Promela code may have assertions that get checked during verication An assert must hold in all states of all runs of the program Desired Property: forwarder only sends messages for itself on app_out (What kind of property is it?)

22 Eventual Delivery bit sent; bit received; proctype application () { int src, dest; mtype m; app_in[0]! 2,req; sent = 1; app_out[2]? 2,0, req; received = 1; app_in[2]! 0, resp app_out[0]? 2,0, resp } ltl deliver {always (sent implies eventually received)}; Every packet that is sent is eventually delivered Not really true on a lossy network; so we disable loss To avoid channel deadlocks, we restrict the application to a xed number of messages The goal is written in PTL (LTL) Whenever a message is sent, it is eventually received always == G, eventually == E

23 Properties for Routing Suppose we extend forwarder with a router process that computes and updates the forwarding table We can specy its goals using PTL X Loop Freedom: an invariant (safety property) that the table does not contain loops always!(fwd[0].next[2] == 1 && fwd[1].next[2] == 0) always is used to encode invariants PTL does not have quantiers so we must write separate invariants for each node

24 Properties for Routing Suppose we extend forwarder with a router process that computes and updates the forwarding table We can specy its goals using PTL Convergence: a total correctness (liveness) property that the table eventually converges to the correct values always eventually (fwd[0].next[2] == 1) always eventually (fwd[1].next[2] == 2)

25 How does SPIN work?

26 Explicit State Model Checking Promela is given a formal trace semantics: Each state consists of: 1. control state of each active process 2. values assigned to each local and global variable 3. messages waiting in each channel Every line of the Promela model translates to a transition relation between states Some transitions are disabled: e.g. 1 == 0, in? x (when in is empty), out! x (when out is full) Others may lead to new states: e.grun creates a processes, out creates a message, assignments change state,

27 Explicit State Model Checking Spin compiles a Promela model to a C program that enumerates all the traces of the model It checks that each property holds for each trace Simple brute-force method Number of reachable states is bounded Number of nite traces is bounded Number of innite traces is unbounded, but for the properties we are trying to prove (PTL), we only need innite traces that end in a loop Memory- and time-intensive but decidable In reality, quite a bit more sophisticated

28 Enumerating Traces The Promela semantics yields a state transition graph for each model Spin performs depth rst search (DFS) through this graph Find rst enabled transition, add it to the current trace, move to the next state If there is no enabled transition, backtrack to previous state and continue with next enabled transition Advantages of DFS: When verying a property, Spin can stop at the rst trace that violates that property Easy to construct a counterexample a property fails Requires less memory than BFS

29 State Space Explosion Number of states can be exponential grows very fast with the number of processes Suppose we have two linear processes, each with a single trace with m transitions What is the total number of traces of their parallel composition? Can you calculate the number of interleavings? (2m!) / (m!) 2 It is exponential in m (at the very least) Other causes for exponential growth PTL formulas translated to automata Non-deterministic processes determinized

30 Trace Enumeration Optimizations The total number of traces is often infeasible to enumerate for realistic protocols Many optimizations Partial Order Reduction: Not all interleavings need to be considered since many are equivalent Abstraction: Sets of states can be considered as an equivalence class with respect to some properties Symbolic State Representation: Sets of explicit states can be efciently represented and manipulated using symbolic data structures like Binary Decision Diagrams

31 Justying bounded (nite) models Is it ok to very TCP for 10 messages or a routing protocol for 3 routers? Yes, the goal is to nd bugs Model checking is primarily a bug-hunting tool Coq is better for doing precise proofs Yes, we can prove that the bounded model is a sound abstraction of the full unbounded model This is sometimes possible (e.g. see FDR) Yes, your verication problem obeys the small model hypothesis: for every flaw in the protocol, there exists a small instance that exhibits the flaw This is more or less folklore in some elds, best not to rely on it for critical properties

32 Trace Enumeration Optimizations The total number of traces is often infeasible to enumerate for realistic protocols Many optimizations Partial Order Reduction: Not all interleavings need to be considered since many are equivalent Abstraction: Sets of states can be considered as an equivalence class with respect to some properties Symbolic State Representation: Sets of explicit states can be efciently represented and manipulated using symbolic data structures like Binary Decision Diagrams More detailed algorithms in next lecture

33 Summary We looked at modeling and verying protocols in Promela and Spin Today s TD: Using SPIN. Download You have been given the SPIN models for the forwarding examples. Try them out. You have been given a partial model of TCP (just the client). Write the server and prove some properties. Can you write a simple routing process?

34 Routing Information Protocol (RIP) Each node n maintains a routing table hops D : number of hops to D (no weighted edges) next D : next router on the path to D Global progress: Initially: All nodes know their neighbors (hops = 1) Finally: All nodes know distance & successor to all other nodes Local processes: Periodically send routing table to all neighbors Locally update hops D to 1 + min(received hops D ) Optional: Use timeouts to detect link breakage Verication goals: Loop freedom: a safety property Convergence: a liveness property

4/6/2011. Model Checking. Encoding test specifications. Model Checking. Encoding test specifications. Model Checking CS 4271

4/6/2011. Model Checking. Encoding test specifications. Model Checking. Encoding test specifications. Model Checking CS 4271 Mel Checking LTL Property System Mel Mel Checking CS 4271 Mel Checking OR Abhik Roychoudhury http://www.comp.nus.edu.sg/~abhik Yes No, with Counter-example trace 2 Recap: Mel Checking for mel-based testing

More information

Computer Lab 1: Model Checking and Logic Synthesis using Spin (lab)

Computer Lab 1: Model Checking and Logic Synthesis using Spin (lab) Computer Lab 1: Model Checking and Logic Synthesis using Spin (lab) Richard M. Murray Nok Wongpiromsarn Ufuk Topcu Calornia Institute of Technology AFRL, 25 April 2012 Outline Spin model checker: modeling

More information

Copyright 2008 CS655 System Modeling and Analysis. Korea Advanced Institute of Science and Technology

Copyright 2008 CS655 System Modeling and Analysis. Korea Advanced Institute of Science and Technology The Spin Model Checker : Part I Copyright 2008 CS655 System Korea Advanced Institute of Science and Technology System Spec. In Promela Req. Spec. In LTL Overview of the Spin Architecture Spin Model pan.c

More information

Research Collection. Formal background and algorithms. Other Conference Item. ETH Library. Author(s): Biere, Armin. Publication Date: 2001

Research Collection. Formal background and algorithms. Other Conference Item. ETH Library. Author(s): Biere, Armin. Publication Date: 2001 Research Collection Other Conference Item Formal background and algorithms Author(s): Biere, Armin Publication Date: 2001 Permanent Link: https://doi.org/10.3929/ethz-a-004239730 Rights / License: In Copyright

More information

The Spin Model Checker : Part I/II

The Spin Model Checker : Part I/II The Spin Model Checker : Part I/II Moonzoo Kim CS Dept. KAIST Korea Advanced Institute of Science and Technology Motivation: Tragic Accidents Caused by SW Bugs 2 Cost of Software Errors June 2002 Software

More information

Distributed Systems Programming (F21DS1) Formal Verification

Distributed Systems Programming (F21DS1) Formal Verification Distributed Systems Programming (F21DS1) Formal Verification Andrew Ireland Department of Computer Science School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Overview Focus on

More information

What is SPIN(Simple Promela Interpreter) Elements of Promela. Material About SPIN. Basic Variables and Types. Typical Structure of Promela Model

What is SPIN(Simple Promela Interpreter) Elements of Promela. Material About SPIN. Basic Variables and Types. Typical Structure of Promela Model What is SPIN(Simple Promela Interpreter) Lecture XX SPIN and Promela A tool for analyzing mels of reactive systems Mels described in Promela Language with concurrent processes, Communication via channels,

More information

LTL Reasoning: How It Works

LTL Reasoning: How It Works Distributed Systems rogramming F21DS1 LTL Reasoning: How It Works Andrew Ireland School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Distributed Systems rogramming F21DS1 2 Overview

More information

Tool demonstration: Spin

Tool demonstration: Spin Tool demonstration: Spin 1 Spin Spin is a model checker which implements the LTL model-checking procedure described previously (and much more besides). Developed by Gerard Holzmann of Bell Labs Has won

More information

Design of Internet Protocols:

Design of Internet Protocols: CSCI 234 Design of Internet Protocols: George Blankenship George Blankenship 1 Outline Verication and Validation History and motivation Spin Promela language Promela model George Blankenship 2 Verication

More information

What is SPIN(Simple Promela Interpreter) Material About SPIN. Elements of Promela. Basic Variables and Types. Typical Structure of Promela Model

What is SPIN(Simple Promela Interpreter) Material About SPIN. Elements of Promela. Basic Variables and Types. Typical Structure of Promela Model What is SPIN(Simple Promela Interpreter) Lecture 3 SPIN and Promela A tool for analyzing mels of reactive systems Mels described in Promela Language with concurrent processes, Communication via channels,

More information

The SPIN Model Checker

The SPIN Model Checker The SPIN Model Checker Metodi di Verifica del Software Andrea Corradini Lezione 1 2013 Slides liberamente adattate da Logic Model Checking, per gentile concessione di Gerard J. Holzmann http://spinroot.com/spin/doc/course/

More information

System Correctness. EEC 421/521: Software Engineering. System Correctness. The Problem at Hand. A system is correct when it meets its requirements

System Correctness. EEC 421/521: Software Engineering. System Correctness. The Problem at Hand. A system is correct when it meets its requirements System Correctness EEC 421/521: Software Engineering A Whirlwind Intro to Software Model Checking A system is correct when it meets its requirements a design without requirements cannot be right or wrong,

More information

Design and Analysis of Distributed Interacting Systems

Design and Analysis of Distributed Interacting Systems Design and Analysis of Distributed Interacting Systems Lecture 5 Linear Temporal Logic (cont.) Prof. Dr. Joel Greenyer May 2, 2013 (Last Time:) LTL Semantics (Informally) LTL Formulae are interpreted on

More information

Formal Verification by Model Checking

Formal Verification by Model Checking Formal Verication by Model Checking Jonathan Aldrich Carnegie Mellon University Based on slides developed by Natasha Sharygina 17-654/17-754: Analysis of Software Artacts Spring 2006 1 CTL Model Checking

More information

Formal Methods in Software Engineering. Lecture 07

Formal Methods in Software Engineering. Lecture 07 Formal Methods in Software Engineering Lecture 07 What is Temporal Logic? Objective: We describe temporal aspects of formal methods to model and specify concurrent systems and verify their correctness

More information

Computer Aided Verification 2015 The SPIN model checker

Computer Aided Verification 2015 The SPIN model checker Computer Aided Verification 2015 The SPIN model checker Grigory Fedyukovich Universita della Svizzera Italiana March 11, 2015 Material borrowed from Roberto Bruttomesso Outline 1 Introduction 2 PROcess

More information

Model checking Timber program. Paweł Pietrzak

Model checking Timber program. Paweł Pietrzak Model checking Timber program Paweł Pietrzak 1 Outline Background on model checking (spam?) The SPIN model checker An exercise in SPIN - model checking Timber Deriving finite models from Timber programs

More information

Formal Specification and Verification

Formal Specification and Verification Formal Specification and Verification Introduction to Promela Bernhard Beckert Based on a lecture by Wolfgang Ahrendt and Reiner Hähnle at Chalmers University, Göteborg Formal Specification and Verification:

More information

Distributed Systems Programming (F21DS1) SPIN: Formal Analysis II

Distributed Systems Programming (F21DS1) SPIN: Formal Analysis II Distributed Systems Programming (F21DS1) SPIN: Formal Analysis II Andrew Ireland Department of Computer Science School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Overview Introduce

More information

Lecture 3 SPIN and Promela

Lecture 3 SPIN and Promela Lecture 3 SPIN and Promela 1 What is SPIN(Simple Promela INterpreter) A tool for analyzing mels of concurrent systems Mels described in Promela Language with concurrent processes Communication via shared

More information

Software Engineering using Formal Methods

Software Engineering using Formal Methods Software Engineering using Formal Methods Introduction to Promela Wolfgang Ahrendt 03 September 2015 SEFM: Promela /GU 150903 1 / 36 Towards Model Checking System Model Promela Program byte n = 0; active

More information

Cover Page. The handle holds various files of this Leiden University dissertation

Cover Page. The handle   holds various files of this Leiden University dissertation Cover Page The handle http://hdl.handle.net/1887/22891 holds various files of this Leiden University dissertation Author: Gouw, Stijn de Title: Combining monitoring with run-time assertion checking Issue

More information

Network Protocol Design and Evaluation

Network Protocol Design and Evaluation Network Protocol Design and Evaluation 05 - Validation, Part III Stefan Rührup Summer 2009 Overview In the first parts of this chapter: Validation models in Promela Defining and checking correctness claims

More information

Introduction to Model Checking

Introduction to Model Checking Introduction to Model Checking René Thiemann Institute of Computer Science University of Innsbruck WS 2007/2008 RT (ICS @ UIBK) week 4 1/23 Outline Promela - Syntax and Intuitive Meaning Promela - Formal

More information

Promela and SPIN. Mads Dam Dept. Microelectronics and Information Technology Royal Institute of Technology, KTH. Promela and SPIN

Promela and SPIN. Mads Dam Dept. Microelectronics and Information Technology Royal Institute of Technology, KTH. Promela and SPIN Promela and SPIN Mads Dam Dept. Microelectronics and Information Technology Royal Institute of Technology, KTH Promela and SPIN Promela (Protocol Meta Language): Language for modelling discrete, event-driven

More information

Software Engineering using Formal Methods

Software Engineering using Formal Methods Software Engineering using Formal Methods Introduction to Promela Wolfgang Ahrendt & Richard Bubel & Reiner Hähnle & Wojciech Mostowski 31 August 2011 SEFM: Promela /GU 110831 1 / 35 Towards Model Checking

More information

SPIN: Part /614 Bug Catching: Automated Program Verification. Sagar Chaki November 12, Carnegie Mellon University

SPIN: Part /614 Bug Catching: Automated Program Verification. Sagar Chaki November 12, Carnegie Mellon University SPIN: Part 1 15-414/614 Bug Catching: Automated Program Verification Sagar Chaki November 12, 2012 What is This All About? Spin On-the-fly verifier developed at Bell-labs by Gerard Holzmann and others

More information

Patrick Trentin Formal Methods Lab Class, March 03, 2017

Patrick Trentin  Formal Methods Lab Class, March 03, 2017 Spin: Introduction Patrick Trentin patrick.trentin@unitn.it http://disi.unitn.it/trentin Formal Methods Lab Class, March 03, 2017 These slides are derived from those by Stefano Tonetta, Alberto Griggio,

More information

The Spin Model Checker : Part I. Moonzoo Kim KAIST

The Spin Model Checker : Part I. Moonzoo Kim KAIST The Spin Model Checker : Part I Moonzoo Kim KAIST Hierarchy of SW Coverage Criteria Complete Value Coverage CVC (SW) Model checking Complete Path Coverage CPC Concolic testing All-DU-Paths Coverage ADUP

More information

Network Protocol Design and Evaluation

Network Protocol Design and Evaluation Network Protocol Design and Evaluation 05 - Validation, Part I Stefan Rührup Summer 2009 Overview In the last lectures: Specification of protocols and data/message formats In this chapter: Building a validation

More information

Computer Lab 1: Model Checking and Logic Synthesis using Spin (lab)

Computer Lab 1: Model Checking and Logic Synthesis using Spin (lab) Computer Lab 1: Model Checking and Logic Synthesis using Spin (lab) Richard M. Murray Nok Wongpiromsarn Ufuk Topcu California Institute of Technology EECI 19 Mar 2013 Outline Spin model checker: modeling

More information

Model-Checking Concurrent Systems. The Model Checker Spin. The Model Checker Spin. Wolfgang Schreiner

Model-Checking Concurrent Systems. The Model Checker Spin. The Model Checker Spin. Wolfgang Schreiner Model-Checking Concurrent Systems Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at 1.

More information

Applications of Formal Verification

Applications of Formal Verification Applications of Formal Verification Model Checking: Introduction to PROMELA Bernhard Beckert Mattias Ulbrich SS 2017 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State of Baden-Württemberg

More information

THE MODEL CHECKER SPIN

THE MODEL CHECKER SPIN THE MODEL CHECKER SPIN Shin Hong, KAIST 17 th April,2007 1/33 Contents Introduction PROMELA Linear Temporal Logic Automata-theoretic software verification Example : Simple Elevator 2 SPIN is a software

More information

Proving Dekker with SPIN and PROMELA

Proving Dekker with SPIN and PROMELA 15-410...fairness disabled... Proving Dekker with SPIN and PROMELA Joshua Wise With help from Greg Hartman L36_SPIN 1 Synchronization Project 4 due Wednesday Everyone having fun? Kernel interviews If you

More information

Petri Nets ee249 Fall 2000

Petri Nets ee249 Fall 2000 Petri Nets ee249 Fall 2000 Marco Sgroi Most slides borrowed from Luciano Lavagno s lecture ee249 (1998) 1 Models Of Computation for reactive systems Main MOCs: Communicating Finite State Machines Dataflow

More information

Applications of Formal Verification

Applications of Formal Verification Applications of Formal Verification Model Checking: Introduction to PROMELA Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov SS 2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State

More information

Applications of Formal Verification

Applications of Formal Verification Applications of Formal Verification Model Checking: Introduction to PROMELA Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov SS 2012 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State

More information

Model Checking with Automata An Overview

Model Checking with Automata An Overview Model Checking with Automata An Overview Vanessa D Carson Control and Dynamical Systems, Caltech Doyle Group Presentation, 05/02/2008 VC 1 Contents Motivation Overview Software Verification Techniques

More information

Enhancement of Feedback Congestion Control Mechanisms by Deploying Active Congestion Control

Enhancement of Feedback Congestion Control Mechanisms by Deploying Active Congestion Control Enhancement of Feedback Congestion Control Mechanisms by Deploying Active Congestion Control Yoganandhini Janarthanan Aug 30,2001 Committee : Dr.Gary Minden Dr. Joseph Evans Dr.Perry Alexander Introduction

More information

FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY

FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY Pamela Zave AT&T Laboratories Research Florham Park, New Jersey, USA

More information

The UPPAAL Model Checker. Julián Proenza Systems, Robotics and Vision Group. UIB. SPAIN

The UPPAAL Model Checker. Julián Proenza Systems, Robotics and Vision Group. UIB. SPAIN The UPPAAL Model Checker Julián Proenza Systems, Robotics and Vision Group. UIB. SPAIN The aim of this presentation Introduce the basic concepts of model checking from a practical perspective Describe

More information

Distributed Systems Programming (F21DS1) SPIN: Formal Analysis I

Distributed Systems Programming (F21DS1) SPIN: Formal Analysis I Distributed Systems Programming (F21DS1) SPIN: Formal Analysis I Andrew Ireland Department of Computer Science School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Overview Introduce

More information

Formal Methods for Software Development

Formal Methods for Software Development Formal Methods for Software Development Model Checking with Temporal Logic Wolfgang Ahrendt 21st September 2018 FMSD: Model Checking with Temporal Logic /GU 180921 1 / 37 Model Checking Check whether a

More information

Distributed Systems Programming (F21DS1) SPIN: Simple Promela INterpreter

Distributed Systems Programming (F21DS1) SPIN: Simple Promela INterpreter Distributed Systems Programming (F21DS1) SPIN: Simple Promela INterpreter Andrew Ireland Department of Computer Science School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Overview

More information

CS477 Formal Software Development Methods / 32

CS477 Formal Software Development Methods / 32 CS477 Formal Software Development Methods 2112 SC, UIUC egunter@illinois.edu http://courses.engr.illinois.edu/cs477 SPIN Beginners Tutorial April 13, 2018 Assertion Violation: mutextwrong1.pml bit flag;

More information

CS477 Formal Software Development Methods / 39

CS477 Formal Software Development Methods / 39 CS477 Formal Software Development Methods 2112 SC, UIUC egunter@illinois.edu http://courses.engr.illinois.edu/cs477 SPIN Beginners Tutorial April 11, 2018 Hello World /* A "Hello World" Promela model for

More information

want turn==me wait req2==0

want turn==me wait req2==0 Uppaal2k: Small Tutorial Λ 16 October 2002 1 Introduction This document is intended to be used by new comers to Uppaal and verification. Students or engineers with little background in formal methods should

More information

INF5140: Specification and Verification of Parallel Systems

INF5140: Specification and Verification of Parallel Systems INF5140: Specification and Verification of Parallel Systems Lecture 09 Defining Correctness Claims Gerar Schneider Department of Informatics University of Oslo INF5140, Spring 2007 Gerar Schneider (Ifi,

More information

Model-Checking Concurrent Systems

Model-Checking Concurrent Systems Model-Checking Concurrent Systems Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at Wolfgang

More information

Spin: Overview of PROMELA

Spin: Overview of PROMELA Spin: Overview of PROMELA Patrick Trentin patrick.trentin@unitn.it http://disi.unitn.it/trentin Formal Methods Lab Class, March 10, 2017 These slides are derived from those by Stefano Tonetta, Alberto

More information

SPIN part 2. Verification with LTL. Jaime Ramos. Departamento de Matemática, Técnico, ULisboa

SPIN part 2. Verification with LTL. Jaime Ramos. Departamento de Matemática, Técnico, ULisboa SPIN part 2 Verification with LTL Jaime Ramos Departamento de Matemática, Técnico, ULisboa Borrowed from slides by David Henriques, Técnico, ULisboa LTL model checking How Spin works Checks non-empty intersection

More information

FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY

FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY Pamela Zave AT&T Laboratories Research Florham Park, New Jersey, USA

More information

Outline. Petri nets. Introduction Examples Properties Analysis techniques. 1 EE249Fall04

Outline. Petri nets. Introduction Examples Properties Analysis techniques. 1 EE249Fall04 Outline Petri nets Introduction Examples Properties Analysis techniques 1 Petri Nets (PNs) Model introduced by C.A. Petri in 1962 Ph.D. Thesis: Communication with Automata Applications: distributed computing,

More information

Analyzing Singularity Channel Contracts

Analyzing Singularity Channel Contracts Analyzing Singularity Channel Contracts Zachary Stengel and Tevfik Bultan Computer Science Department University of Calornia Santa Barbara, CA 93106, USA {zss,bultan@cs.ucsb.edu ABSTRACT This paper presents

More information

More on Verification and Model Checking

More on Verification and Model Checking More on Verification and Model Checking Wednesday Oct 07, 2015 Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se 1/60 Course fair! 2/60 Exam st October 21, 8:00 13:00 If you want to participate,

More information

A Verification Approach for GALS Integration of Synchronous Components

A Verification Approach for GALS Integration of Synchronous Components GALS 2005 Preliminary Version A Verification Approach for GALS Integration of Synchronous Components F. Doucet, M. Menarini, I. H. Krüger and R. Gupta 1 Computer Science and Engineering University of California,

More information

SPIN vs. VIS: A Case Study on the Formal Verification of the ATMR Protocol

SPIN vs. VIS: A Case Study on the Formal Verification of the ATMR Protocol SPIN vs. VIS: A Case Study on the Formal Verication of the ATMR Protocol Hong Peng, Soène Tahar and Ferhat Khendek Dept. of Electrical & Computer Engineering, Concordia University 1455 de Maisonneuve W.,

More information

Multi-Threaded System int x, y, r; int *p, *q, *z; int **a; EEC 421/521: Software Engineering. Thread Interleaving SPIN. Model Checking using SPIN

Multi-Threaded System int x, y, r; int *p, *q, *z; int **a; EEC 421/521: Software Engineering. Thread Interleaving SPIN. Model Checking using SPIN EEC 421/521: Software Engineering Model Checking using SPIN 4/29/08 EEC 421/521: Software Engineering 1 Multi-Threaded System int x, y, r; int *p, *q, *z; int **a; thread_1(void) /* initialize p, q, and

More information

Automated Reasoning. Model Checking with SPIN (II)

Automated Reasoning. Model Checking with SPIN (II) Automated Reasoning Model Checking with SPIN (II) Alan Bundy page 1 Verifying Global Properties Assertions can be used to verify a property locally For example, place assert(memreturned) at the end of

More information

Directed Model Checking for PROMELA with Relaxation-Based Distance Functions

Directed Model Checking for PROMELA with Relaxation-Based Distance Functions Directed Model Checking for PROMELA with Relaxation-Based Distance Functions Ahmad Siyar Andisha and Martin Wehrle 2 and Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany {andishaa,westphal}@informatik.uni-freiburg.de

More information

SPIN: Introduction and Examples

SPIN: Introduction and Examples SPIN: Introduction and Examples Alessandra Giordani agiordani@disi.unitn.it http://disi.unitn.it/~agiordani Formal Methods Lab Class, September 28, 2014 *These slides are derived from those by Stefano

More information

Formal Methods for Software Development

Formal Methods for Software Development Formal Methods for Software Development Verification with Spin Wolfgang Ahrendt 07 September 2018 FMSD: Spin /GU 180907 1 / 34 Spin: Previous Lecture vs. This Lecture Previous lecture Spin appeared as

More information

Asynchronous Models. Chapter Asynchronous Processes States, Inputs, and Outputs

Asynchronous Models. Chapter Asynchronous Processes States, Inputs, and Outputs Chapter 3 Asynchronous Models 3.1 Asynchronous Processes Like a synchronous reactive component, an asynchronous process interacts with other processes via inputs and outputs, and maintains an internal

More information

SPIN, PETERSON AND BAKERY LOCKS

SPIN, PETERSON AND BAKERY LOCKS Concurrent Programs reasoning about their execution proving correctness start by considering execution sequences CS4021/4521 2018 jones@scss.tcd.ie School of Computer Science and Statistics, Trinity College

More information

Patrick Trentin Formal Methods Lab Class, Feb 26, 2016

Patrick Trentin  Formal Methods Lab Class, Feb 26, 2016 Spin: Introduction Patrick Trentin patrick.trentin@unitn.it http://disi.unitn.it/~trentin Formal Methods Lab Class, Feb 26, 2016 These slides are derived from those by Stefano Tonetta, Alberto Griggio,

More information

Static program checking and verification

Static program checking and verification Chair of Software Engineering Software Engineering Prof. Dr. Bertrand Meyer March 2007 June 2007 Slides: Based on KSE06 With kind permission of Peter Müller Static program checking and verification Correctness

More information

Model Requirements and JAVA Programs MVP 2 1

Model Requirements and JAVA Programs MVP 2 1 Model Requirements and JAVA Programs MVP 2 1 Traditional Software The Waterfall Model Problem Area Development Analysis REVIEWS Design Implementation Costly wrt time and money. Errors are found too late

More information

By: Chaitanya Settaluri Devendra Kalia

By: Chaitanya Settaluri Devendra Kalia By: Chaitanya Settaluri Devendra Kalia What is an embedded system? An embedded system Uses a controller to perform some function Is not perceived as a computer Software is used for features and flexibility

More information

Using Model Checking with Symbolic Execution for the Verification of Data-Dependent Properties of MPI-Based Parallel Scientific Software

Using Model Checking with Symbolic Execution for the Verification of Data-Dependent Properties of MPI-Based Parallel Scientific Software Using Model Checking with Symbolic Execution for the Verification of Data-Dependent Properties of MPI-Based Parallel Scientific Software Anastasia Mironova Problem It is hard to create correct parallel

More information

Cyber Physical System Verification with SAL

Cyber Physical System Verification with SAL Cyber Physical System Verification with July 22, 2013 Cyber Physical System Verification with Outline 1 2 3 4 5 Cyber Physical System Verification with Table of Contents 1 2 3 4 5 Cyber Physical System

More information

MINIX 3 Process Analysis

MINIX 3 Process Analysis Xander Damen Albert Gerritsen Eelis van der Weegen 2010-01-18 Introduction Our project: process analysis of MINIX 3. Outline: 1 methodology 2 subsystem & tool selection 3 the MINIX 3 scheduler 4 the model

More information

Double Header. Two Lectures. Flying Boxes. Some Key Players: Model Checking Software Model Checking SLAM and BLAST

Double Header. Two Lectures. Flying Boxes. Some Key Players: Model Checking Software Model Checking SLAM and BLAST Model Checking #1 Double Header Two Lectures Model Checking Software Model Checking SLAM and BLAST Flying Boxes It is traditional to describe this stuff (especially SLAM and BLAST) with high-gloss animation

More information

Verifying Concurrent Programs

Verifying Concurrent Programs Verifying Concurrent Programs Daniel Kroening 8 May 1 June 01 Outline Shared-Variable Concurrency Predicate Abstraction for Concurrent Programs Boolean Programs with Bounded Replication Boolean Programs

More information

Logic Model Checking

Logic Model Checking Logic Model Checking Lecture Notes 17:18 Caltech 101b.2 January-March 2005 Course Text: The Spin Model Checker: Primer and Reference Manual Addison-Wesley 2003, ISBN 0-321-22862-6, 608 pgs. checking omega

More information

CS5232 Formal Specification and Design Techniques. Using PAT to verify the Needham-Schroeder Public Key Protocol

CS5232 Formal Specification and Design Techniques. Using PAT to verify the Needham-Schroeder Public Key Protocol CS5232 Formal Specification and Design Techniques Using PAT to verify the Needham-Schroeder Public Key Protocol Semester 2, AY 2008/2009 1/37 Table of Contents 1. Project Introduction 3 2. Building the

More information

Network Verification: Reflections from Electronic Design Automation (EDA)

Network Verification: Reflections from Electronic Design Automation (EDA) Network Verification: Reflections from Electronic Design Automation (EDA) Sharad Malik Princeton University MSR Faculty Summit: 7/8/2015 $4 Billion EDA industry EDA Consortium $350 Billion Semiconductor

More information

Verifying C & C++ with ESBMC

Verifying C & C++ with ESBMC Verifying C & C++ with ESBMC Denis A Nicole dan@ecs.soton.ac.uk CyberSecuritySoton.org [w] @CybSecSoton [fb & tw] ESBMC ESBMC, the Efficient SMT-Based Context-Bounded Model Checker was originally developed

More information

Distributed Memory LTL Model Checking

Distributed Memory LTL Model Checking ! " #$ %& D E ')(+*,.-0/132?@ACB 46587:9= F GH Faculty of Informatics Masaryk University Brno Distributed Memory LTL Model Checking Ph.D. Thesis Jiří Barnat September 2004 Abstract Distribution and

More information

Verification of Intelligent Software

Verification of Intelligent Software Verification of Intelligent Software Charles Pecheur (RIACS / NASA Ames) Charles Pecheur 2003 1 Contents Model Checking for Intelligent Software Why? Intelligent software, how to verify it? What? A bird's-eye

More information

Linear Temporal Logic. Model Checking and. Based on slides developed by Natasha Sharygina. Carnegie Mellon University.

Linear Temporal Logic. Model Checking and. Based on slides developed by Natasha Sharygina. Carnegie Mellon University. Model Checking and Linear Temporal Logic Jonathan Aldrich Carnegie Mellon University Based on slides developed by Natasha Sharygina 17-654: Analysis of Software Artifacts 1 Formal Verification by Model

More information

A Tutorial on Model Checker SPIN

A Tutorial on Model Checker SPIN A Tutorial on Model Checker SPIN Instructor: Hao Zheng Department of Computer Science and Engineering University of South Florida Tampa, FL 33620 Email: haozheng@usf.edu Phone: (813)974-4757 Fax: (813)974-5456

More information

Xuandong Li. BACH: Path-oriented Reachability Checker of Linear Hybrid Automata

Xuandong Li. BACH: Path-oriented Reachability Checker of Linear Hybrid Automata BACH: Path-oriented Reachability Checker of Linear Hybrid Automata Xuandong Li Department of Computer Science and Technology, Nanjing University, P.R.China Outline Preliminary Knowledge Path-oriented Reachability

More information

Context-Switch-Directed Verification in DIVINE

Context-Switch-Directed Verification in DIVINE Context-Switch-Directed Verification in DIVINE MEMICS 2014 Vladimír Štill Petr Ročkai Jiří Barnat Faculty of Informatics Masaryk University, Brno October 18, 2014 Vladimír Štill et al. Context-Switch-Directed

More information

Introduction & Formal Methods

Introduction & Formal Methods Introduction & Formal Methods http://d3s.mff.cuni.cz Jan Kofroň CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Introduction to dependable systems NSWE 002 What you learn: Dependable systems

More information

Model Checking for Autonomy Software

Model Checking for Autonomy Software Model Checking for Autonomy Software Charles Pecheur RIACS / ASE Group, NASA Ames Charles Pecheur, RIACS / NASA Ames 1 Contents Model Checking for Autonomy Software Why? Autonomy software, how to verify

More information

Diagnostic Information for Control-Flow Analysis of Workflow Graphs (aka Free-Choice Workflow Nets)

Diagnostic Information for Control-Flow Analysis of Workflow Graphs (aka Free-Choice Workflow Nets) Diagnostic Information for Control-Flow Analysis of Workflow Graphs (aka Free-Choice Workflow Nets) Cédric Favre(1,2), Hagen Völzer(1), Peter Müller(2) (1) IBM Research - Zurich (2) ETH Zurich 1 Outline

More information

Model Checking. Automatic Verification Model Checking. Process A Process B. when not possible (not AI).

Model Checking. Automatic Verification Model Checking. Process A Process B. when not possible (not AI). Sérgio Campos scampos@dcc.ufmg.br Why? Imagine the implementation of a complex hardware or software system: A 100K gate ASIC perhaps 100 concurrent modules; A flight control system dozens of concurrent

More information

Modeling a Cache Coherence Protocol with the Guarded Action Language

Modeling a Cache Coherence Protocol with the Guarded Action Language Modeling a Cache Coherence Protocol with the Guarded Action Language Quentin Meunier, Yann Thierry-Mieg, Emmanuelle Encrenaz Laboratoire d Informatique de Paris 6, Sorbonne Université, Paris. The TeraScale

More information

MP 6 Modeling in Promela and SPIN

MP 6 Modeling in Promela and SPIN MP 6 Modeling in Promela and SPIN CS 477 Spring 2018 Revision 1.0 Assigned April 23, 2018 Due May 2, 2018, 9:00 PM Extension 48 hours (penalty 20% of total points possible) 1 Change Log 1.0 Initial Release.

More information

Lecture 2: Symbolic Model Checking With SAT

Lecture 2: Symbolic Model Checking With SAT Lecture 2: Symbolic Model Checking With SAT Edmund M. Clarke, Jr. School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 (Joint work over several years with: A. Biere, A. Cimatti, Y.

More information

GUI for model checkers

GUI for model checkers GUI for model checkers by Bo Wang THESIS MASTER OF SCIENCE Department of Computer Science Faculty of EEMCS Delft University of Technology June, 2006 Colophon Author: Bo Wang Student id: 1235931 E-mail:

More information

Software Model Checking: Theory and Practice

Software Model Checking: Theory and Practice Software Model Checking: Theory and Practice Lecture: Specification Checking - Specification Patterns Copyright 2004, Matt Dwyer, John Hatcliff, and Robby. The syllabus and all lectures for this course

More information

Spin: Overview of PROMELA

Spin: Overview of PROMELA Spin: Overview of PROMELA Patrick Trentin patrick.trentin@unitn.it http://disi.unitn.it/~trentin Formal Methods Lab Class, Mar 04, 2016 These slides are derived from those by Stefano Tonetta, Alberto Griggio,

More information

Semantic Subtyping. Alain Frisch (ENS Paris) Giuseppe Castagna (ENS Paris) Véronique Benzaken (LRI U Paris Sud)

Semantic Subtyping.  Alain Frisch (ENS Paris) Giuseppe Castagna (ENS Paris) Véronique Benzaken (LRI U Paris Sud) Semantic Subtyping Alain Frisch (ENS Paris) Giuseppe Castagna (ENS Paris) Véronique Benzaken (LRI U Paris Sud) http://www.cduce.org/ Semantic Subtyping - Groupe de travail BD LRI p.1/28 CDuce A functional

More information

COMP 763. Eugene Syriani. Ph.D. Student in the Modelling, Simulation and Design Lab School of Computer Science. McGill University

COMP 763. Eugene Syriani. Ph.D. Student in the Modelling, Simulation and Design Lab School of Computer Science. McGill University Eugene Syriani Ph.D. Student in the Modelling, Simulation and Design Lab School of Computer Science McGill University 1 OVERVIEW In the context In Theory: Timed Automata The language: Definitions and Semantics

More information

that may be shared by process types, and system level critical requirements. There is a process specication for each process type declared in the glob

that may be shared by process types, and system level critical requirements. There is a process specication for each process type declared in the glob Using the ASTRAL Model Checker for Cryptographic Protocol Analysis Zhe Dang Richard A. Kemmerer Reliable Software Group Department of Computer Science University of California Santa Barbara, CA 93106 August

More information

CS2 Language Processing note 3

CS2 Language Processing note 3 CS2 Language Processing note 3 CS2Ah 5..4 CS2 Language Processing note 3 Nondeterministic finite automata In this lecture we look at nondeterministic finite automata and prove the Conversion Theorem, which

More information

Finite State Verification. CSCE Lecture 21-03/28/2017

Finite State Verification. CSCE Lecture 21-03/28/2017 Finite State Verification CSCE 747 - Lecture 21-03/28/2017 So, You Want to Perform Verification... You have a property that you want your program to obey. Great! Let s write some tests! Does testing guarantee

More information