Software Model Checking: Theory and Practice



Similar documents
Today s Agenda. Automata and Logic. Quiz 4 Temporal Logic. Introduction Buchi Automata Linear Time Logic Summary

Formal Verification by Model Checking

Algorithmic Software Verification

The Model Checker SPIN

Software Model Checking: Theory and Practice

Testing LTL Formula Translation into Büchi Automata

Software Engineering using Formal Methods

Fundamentals of Software Engineering

tutorial: hardware and software model checking

logic language, static/dynamic models SAT solvers Verified Software Systems 1 How can we model check of a program or system?

T Reactive Systems: Introduction and Finite State Automata

Automata-Based Verification of Temporal Properties on Running Programs Dimitra Giannakopoulou Klaus Havelund

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, School of Informatics University of Edinburgh als@inf.ed.ac.

Formal Verification of Software

INF5140: Specification and Verification of Parallel Systems

Model Checking LTL Properties over C Programs with Bounded Traces

Software Modeling and Verification

Formal Verification and Linear-time Model Checking

CISC422/853: Formal Methods

Software Reliability: Runtime Verification

Runtime Verification - Monitor-oriented Programming - Monitor-based Runtime Reflection

Overview of E0222: Automata and Computability

Omega Automata: Minimization and Learning 1

Monitoring Metric First-order Temporal Properties

Software Verification and Testing. Lecture Notes: Temporal Logics

On Omega-Languages Defined by Mean-Payoff Conditions

A Continuous Truth Domain for Runtime Verification

Verification of hybrid dynamical systems

Combining Software and Hardware Verification Techniques

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Constructing Automata from Temporal Logic Formulas : A Tutorial

6.080/6.089 GITCS Feb 12, Lecture 3

Model Checking: An Introduction

LTL Model Checking with Logic Based Petri Nets

Automata on Infinite Words and Trees

Informatique Fondamentale IMA S8

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:

Deterministic Finite Automata

Validated Templates for Specification of Complex LTL Formulas

Runtime Verification for Real-Time Automotive Embedded Software

Feature Specification and Automated Conflict Detection

Regular Expressions and Automata using Haskell

Fast nondeterministic recognition of context-free languages using two queues

Automata-based Verification - I

Model checking test models. Author: Kevin de Berk Supervisors: Prof. dr. Wan Fokkink, dr. ir. Machiel van der Bijl

Introduction to SPIN. Acknowledgments. Parts of the slides are based on an earlier lecture by Radu Iosif, Verimag. Ralf Huuck. Features PROMELA/SPIN

Intrusion Detection via Static Analysis

An Overview of the Runtime Verification Tool Java PathExplorer

On Winning Conditions of High Borel Complexity in Pushdown Games

Temporal Logics. Computation Tree Logic

The Halting Problem is Undecidable

Program Synthesis is a Game

Semantics and Verification of Software

Fabio Patrizi DIS Sapienza - University of Rome

Theoretical Computer Science (Bridging Course) Complexity

How To Compare A Markov Algorithm To A Turing Machine

Finite Automata. Reading: Chapter 2

On the Modeling and Verification of Security-Aware and Process-Aware Information Systems

Introduction to Software Verification

Workflow Management Models and ConDec

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Fabio Massacci Ida Siahaan

Introduction to Promela and SPIN. LACL, Université Paris 12

Automata and Formal Languages

CHAPTER 7 GENERAL PROOF SYSTEMS

Finite Automata. Reading: Chapter 2

Lecture 9 verifying temporal logic

Model Checking II Temporal Logic Model Checking

Data Structures and Algorithms V Otávio Braga

Copyright 2013 wolfssl Inc. All rights reserved. 2

Automata and Computability. Solutions to Exercises

Journal of Mathematics Volume 1, Number 1, Summer 2006 pp

Büchi Complementation Made Tighter

Introduction to Logic in Computer Science: Autumn 2006

Introduction to Automata Theory. Reading: Chapter 1

First-order definable languages

Formal Verification of Computer Systems - (INFO-F-412)

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

The LIME Interface Specification Language and Runtime Monitoring Tool

Transcription:

Software Model Checking: Theory and Practice Lecture: Specification Checking - LTL Model Checking Copyright 2004, Matt Dwyer, John Hatcliff, and Robby. The syllabus and all lectures for this course are copyrighted materials and may not be used in other course settings outside of Kansas State University and the University of Nebraska in their current form or modified form without the express written permission of one of the copyright holders. During this course, students are prohibited from selling notes to or being paid for taking notes by any person or commercial firm without the express written permission of one of the copyright holders.

Objectives To understand Büchi automata and their relationship to LTL To understand how Büchi acceptance search enables a general LTL model checking algorithm Property Checking : LTL Model Checking 2

Safety Checking For safety properties we automated the instrumentation of checking for acceptance of a regular expression for a violation This involved modifying the DFS algorithm to Calculate states of the property automaton Check to see whether an accept state is reached We will apply the same basic strategy for LTL Property Checking : LTL Model Checking 3

LTL Model Checking From the semantics An LTL formula defines a set of (accepting) traces We can Check for trace containment System Property Property Checking : LTL Model Checking 4

LTL Model Checking From the semantics The negation of an LTL formula defines a set of (violating) traces We can Check for non-empty language intersection Negation of Property System Property Checking : LTL Model Checking 5

Emptiness Check LTL is closed under complement L(φ) = L( φ) where the language of a formula defines a set of infinite traces A Büchi automaton accepts a set of infinite traces Property Checking : LTL Model Checking 6

Büchi Automata A Büchi automaton is a quadruple (R,I,δ,F) S is a set of states I R is a set of initial states δ : R P(R) is a transition relation F is a set of accepting states Unlike FSAs, Büchi automata are always nondeterministic set of initial states multiple transitions from a state Property Checking : LTL Model Checking 7

Büchi Automata Automaton states are labeled with atomic propositions of the formula λ : R P(A) where A are the set of observables for the program λ(r) is the set of observables for a property state Note that the meaning of the automata is defined via this mapping plays the role of alphabet in FSA Property Checking : LTL Model Checking 8

Example : Büchi Automaton S = {r 0, r 1, r 2 } I = {r 0 } δ = {(r 0,{r 0,r 1 }),(r 1,{r 2 }),(r 2,{r 2 })} F = {r 2 } λ = {(r 0,cruire}),(r 1,{off}),(r 2,{})} cruise off true r 0 r 1 r 2 Property Checking : LTL Model Checking 9

Büchi Automata Semantics An infinite trace σ = r 0, r 1, is accepted by a Büchi automaton iff r 0 I starting in an initial state i 0 : r i+1 δ(r i ) trace corresponds to transition relation i 0 j i : r j F can reach a final state from end of all prefixes Property Checking : LTL Model Checking 10

Büchi Trace Containment Assume each system state (S) is labeled (Λ) with set of observables (A) A Büchi automaton accepts a system trace s 0, s 1, r 0 I : λ(r 0 ) Λ(s 0 ) i 0 r i+1 δ(r i ) : λ(r i+1 ) Λ(s i+1 ) i 0 j i : r j F Property Checking : LTL Model Checking 11

Example : Büchi Automaton cruise cruise off off accel accel cruise cruise cruise accel cruise off accel cruise off true r o r 1 r 2 Property Checking : LTL Model Checking 12

LTL and Büchi Automata Every LTL formula has a Büchi automaton that accepts its language (not vice versa) L(φ) L(BA) L(φ) L(BA) Büchi automata cannot be determinized i.e., there is no canonical deterministic automaton that accepts the same language Büchi automata are closed under the standard set operations Property Checking : LTL Model Checking 13

Example : Büchi Automaton What LTL property does this correspond to? cruise off true r o r 1 r 2 cruise U off Property Checking : LTL Model Checking 14

Example : Büchi Automaton What LTL property does this correspond to? true off true r o r 1 r 2 off Property Checking : LTL Model Checking 15

LTL Model Checking Apply same strategy as before Generate Büchi automaton for the negation of the LTL property Explore state space of the product of the automaton and the system Check for emptiness Violation are indicated by accepting traces Look for cycles containing an accept state Use nested depth-first search Property Checking : LTL Model Checking 16

LTL Model Checking errors := {} seen := {} for each r I do seen := seen U {(s 0, r)} stack := [(s 0, r)] DFS((s 0, r)) pop(stack) For each initial property state initialize DFS data structures perform search of initial product state Property Checking : LTL Model Checking 17

LTL Model Checking DFS ((s,r)) workset := enabled (s ) for each α workset do s := α (s ) for each r δ(r) do if λ(r ) Λ(s ) then if (s,r ) seen then seen := seen {(s,r )} push (stack, (s,r )) DFS((s,r )) if r A then seen := {(s,r )} stack := [(s,r )] NDFS((s,r ),(s,r )) pop(stack ) pop(stack) end DFS For each transition check if state labels match Only launch a cycle search from property accept states Property Checking : LTL Model Checking 18

LTL Model Checking NDFS ((s,r), seed) workset := enabled (s ) for each α workset do s := α (s ) for each r δ(r) do For each transition check if state labels match if λ(r ) Λ(s ) then if (s,r ) = eed then errors := errors U {(stack,stack )} continue if (s,r ) seen then seen := seen {(s,r )} push (stack, (s,r )) NDFS((s,r ), seed) pop(stack ) end NDFS Same logic as for progress checking Property Checking : LTL Model Checking 19

Fairness Liveness states that the system should eventually do something Often times in real systems threads rely on a schedule to give them a chance to run Abstracting scheduling to non-deterministic choice introduces severe approximation There are many forms of fairness The intuition is that we restrict the systems behaviors to only those on which each process gets a chance to execute Property Checking : LTL Model Checking 20

Fairness in LTL LTL is expressive enough to state fairness properties directly []<> (Phil1.eating Phil2.eating) ([]<>Phil1.eating) && ([]<>Phil2.eating) Fairness formula can be used to filter the behaviors that are checked as follows Fairness -> Property If not Fairness then whole thing is true Property checked only when Fairness holds Property Checking : LTL Model Checking 21