CS6133 Software Specification and Verification

Slides:



Advertisements
Similar presentations
Tintu David Joy. Agenda Motivation Better Verification Through Symmetry-basic idea Structural Symmetry and Multiprocessor Systems Mur ϕ verification system.
Advertisements

Algorithmic Software Verification VII. Computation tree logic and bisimulations.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Partial Order Reduction: Main Idea
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
1 Model checking. 2 And now... the system How do we model a reactive system with an automaton ? It is convenient to model systems with Transition systems.
An Introduction to the Model Verifier verds Wenhui Zhang September 15 th, 2010.
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
1 MODULE name (parameters) “Ontology” “Program” “Properties” The NuSMV language A module can contain modules Top level: parameters less module Lower level.
Temporal Logic and the NuSMV Model Checker CS 680 Formal Methods Jeremy Johnson.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
UPPAAL Introduction Chien-Liang Chen.
Hybrid Systems Presented by: Arnab De Anand S. An Intuitive Introduction to Hybrid Systems Discrete program with an analog environment. What does it mean?
CS 290C: Formal Models for Web Software Lecture 4: Implementing and Verifying Statecharts Specifications Using the Spin Model Checker Instructor: Tevfik.
Process Synchronization Continued 7.2 The Critical-Section Problem.
1 Partial Order Reduction. 2 Basic idea P1P1 P2P2 P3P3 a1a1 a2a2 a3a3 a1a1 a1a1 a2a2 a2a2 a2a2 a2a2 a3a3 a3a3 a3a3 a3a3 a1a1 a1a1 3 independent processes.
Verification of Hybrid Systems An Assessment of Current Techniques Holly Bowen.
SYMBOLIC MODEL CHECKING: STATES AND BEYOND J.R. Burch E.M. Clarke K.L. McMillan D. L. Dill L. J. Hwang Presented by Rehana Begam.
CS 267: Automated Verification Lecture 7: SMV Symbolic Model Checker, Partitioned Transition Systems, Counter-example Generation in Symbolic Model Checking.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Model-based Testing and Automated Test Case Generation
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
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 Introduction to SMV Arie Gurfinkel (SEI/CMU) based on material by Prof. Clarke and others.
FMuOS: Formal verification of critical program parts NuSMV system Prepared by: Alan Jović, Ph.D. Acad. year: 2014/2015.
1 Model Checking, Abstraction- Refinement, and Their Implementation Based on slides by: Orna Grumberg Presented by: Yael Meller June 2008.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
Review of the automata-theoretic approach to model-checking.
Embedded Systems Laboratory Department of Computer and Information Science Linköping University Sweden Formal Verification and Model Checking Traian Pop.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
2/18/20051 Introduction to SMV. 2/18/20052 Symbolic Model Verifier Ken McMillan, Symbolic Model Checking: An Approach to the State Explosion Problem,
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Propositional Calculus Math Foundations of Computer Science.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Verification technique on SA applications using Incremental Model Checking 컴퓨터학과 신영주.
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
Introduction to Software Testing Chapter 9.4 Model-Based Grammars Paul Ammann & Jeff Offutt
1 Introduction to SMV and Model Checking Mostly by: Ken McMillan Cadence Berkeley Labs Small parts by: Brandon Eames ISIS/Vanderbilt.
UPPAAL Ghaith Haddad. Introduction UPPAAL is a tool for modeling, validation and verification of real-time systems. Appropriate for systems that can be.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
Pattern-directed inference systems
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CS5270 Lecture 41 Timed Automata I CS 5270 Lecture 4.
2/19/20031 Introduction to SMV. 2/19/20032 Useful Links CMU Model checking homepage SMV windows version
Advanced Topics in Software Engineering Marjan Sirjani Tehran University Faculty of Engineering ECE Department Tehran,
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for August 6, 2003.
Mathematical Preliminaries
CSE Winter 2008 Introduction to Program Verification January 15 tautology checking.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
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.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Model Checking Lecture 1. Model checking, narrowly interpreted: Decision procedures for checking if a given Kripke structure is a model for a given formula.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
Presented by: Belgi Amir Seminar in Distributed Algorithms Designing correct concurrent algorithms Spring 2013.
Model Checking Lecture 1: Specification Tom Henzinger.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CS5270 Lecture 41 Timed Automata I CS 5270 Lecture 4.
Counterexample-Guided Abstraction Refinement By Edmund Clarke, Orna Grumberg, Somesh Jha, Yuan Lu, and Helmut Veith Presented by Yunho Kim Provable Software.
Complexity of Compositional Model Checking of Computation Tree Logic on Simple Structures Krishnendu Chatterjee Pallab Dasgupta P.P. Chakrabarti IWDC 2004,
Basic concepts of Model Checking
Formal methods: Lecture
Propositional Calculus: Boolean Algebra and Simplification
Over-Approximating Boolean Programs with Unbounded Thread Creation
Formal Methods in software development
Introduction to SMV 2/19/2003.
Lecture 9: SMV: An Introduction
Presentation transcript:

CS6133 Software Specification and Verification Lecture 5 Model Checking

Model Checking CS6133

What is Model Checking Model checking is a method for formally verifying finite-state concurrent systems. Finite models are Kripke structures Specifications (i.e., desired properties) about the system are expressed as temporal logic formulas Model checking algorithms traverse the model and check if the specification holds against the model A counterexample is a trace of the system that violates the property CS6133

Why Use Model Checking Model checking is fully automated No proofs have to be devised manually No human interaction is needed The counterexample can help you to debug your model or property specification The model can be partial However, model checking suffers from state explosion problem : many techniques have been developed to alleviate this problem CS6133

Kripke Structure A Kripke structure is a labeled state-transition graph Formally, let AP be a set atomic propositions. A finite Kripke structure over AP is a 4 tuple M = <S, S0, R, L>, where S is the finite set of states S0  S is the set of initial states R  S X S is the transition relation L: S  2AP is the labeling function maps each state to a set of atomic propositions true in that state CS6133

Kripke Structure Example CS6133

Basic Model Checking Algorithm CS6133

Basic Model Checking Algorithm CS6133

Basic Model Checking Algorithm CS6133

What is NuSMV NuSMV (New Symbolic Model Verifier) is an open source software system NuSMV or SMV is a symbolic model checker, which provides a language for describing models SMV language: Communicating finite state machines Finite state machines with variables of finite types Finite state machines execute concurrently (in parallel or interleaving) Properties are specified as Temporal Logic formulas CS6133

SMV Module A SMV model consists of one or more modules, one of the modules must be called main as in C or Java Each module has variable declarations and assignment statements Assignments can be of the following forms DEFINE x:= y+5; ASSIGN init(x) := 0; next(x) := y+5; CS6133

SMV Module Composition Synchronous composition (parallel) All modules’ assignments are executed in parallel A single step of the resulting model corresponds to a step in each of the components Asynchronous composition (interleaving) A step of the composition is a step by exactly one process (assignments within the process execute in parallel) Variables that are not assigned in that process are left unchanged CS6133

Example Input to NuSMV MODULE main VAR request : boolean; status : {ready, busy}; ASSIGN init(status) := ready; next(status) := case request : busy; 1 : {ready, busy}; esac; LTLSPEC G(request  F(status =busy)) CS6133

SMV Variables Variables must be of finite types Variables can be boolean, enumerated types, integer subranges, user-defined modules, or an array of any of these var1 : {on, off}; var2 : array 2..5 of {on, off}; var3 : array 1..10 of array 2..5 of boolean; var4 : Inverter(1); --Inverter() is a module var5 : array on..off of boolean; -- error var6 : {enabled, active, off}; -- error var7 : 0..6; CS6133

Variables Enumerated values must be distinct from each other Boolean values Constants are 0 and 1 (FALSE and TRUE) Operations are: ~ (not), & (and), | (or), ˆ (xor), −> (implies), <−> (iff) Array subscripts must evaluate to integers CS6133

Variables Each state variable is Either controlled by the system, i.e., SMV model explicitly assigns values to the variable VAR x: 1..20; ASSIGN init(x) := 0; next(x) := x+2; Or controlled by the environment, i.e., input variable y: boolean; CS6133

Derived Variables Each derived variable defines a macro p: boolean; q: boolean; DEFINE z:= p ->q; each occurrence of z is replaced by p ->q Derived variables don’t contribute to the state space CS6133

Execution Model Round-based execution: initialization round followed by a sequence of update rounds In each round Environment-controlled variables non-deterministically change values System executes its parallel assignment statements to state variables Result is a new system state (an assignment of values to state variables) CS6133

Example Input to NuSMV MODULE main VAR request : boolean; status : {ready, busy}; ASSIGN init(status) := ready; next(status) := case request : busy; 1 : {ready, busy}; esac; LTLSPEC G(request  F(status =busy)) CS6133

Statements Simple parallel assignments, e.g., next (x) := 1; next (y) := x+1; Conditional assignments If-then-else next(y) := (a | b) ? x : x+1; Case next(k) := case c1: x; c2: y; 1: 0; esac; CS6133

Case Statements Case statements are evaluated sequentially If the guard condition on the left hand side evaluates to true, the case statement returns the value of the corresponding expression on the right hand side If none of the guard condition evaluates to true, it returns numeric value 1 Guards may not be mutually exclusive CS6133

Nondeterminism Non-determinism occurs while more than one result is possible Unassigned variable: model unconstrained input Non-deterministic assignment, e.g., next (x) := {1, 2, 3, 4}; Undefined assignment of a variable may take on any value in its type, e.g., next (x) := c1? y; or conjunction of case guard expressions is not a tautology CS6133

Common Errors Single Assignment Rule: only have one assignment statement for each variable, e.g., the following is invalid next(x) := y; next(x) := z; or x := y + 5; CS6133

Common Errors Cannot have a cycle of dependencies all of whose assignments take effect simultaneously. That is, the system can’t have a set of variables whose next values depends on the next values of each other and vice versa. e.g., next(x) := next(y); next(y) := next(z); next(z) := next(x); CS6133