Software Model Checking: Theory and Practice



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

Model Checking: An Introduction

Introduction to Software Verification

Temporal Logics. Computation Tree Logic

Model Checking II Temporal Logic Model Checking

Software Model Checking: Theory and Practice

Traditional Software Development. Model Requirements and JAVA Programs. Formal Verification & Validation. What is a state?

Formal Verification of Software

ENFORCING SAFETY PROPERTIES IN WEB APPLICATIONS USING PETRI NETS

Algorithmic Software Verification

Concurrent Program Synthesis Based on Supervisory Control

The Model Checker SPIN

Introduction to NP-Completeness Written and copyright c by Jie Wang 1

CISC422/853: Formal Methods

Testing LTL Formula Translation into Büchi Automata

Formal Verification by Model Checking

Software Verification and Testing. Lecture Notes: Temporal Logics

1 Gambler s Ruin Problem

Using Patterns and Composite Propositions to Automate the Generation of Complex LTL

Formal Verification and Linear-time Model Checking

Model Checking of Software

T Reactive Systems: Introduction and Finite State Automata

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

Feature Specification and Automated Conflict Detection

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

The Course.

Software Modeling and Verification

Development of dynamically evolving and self-adaptive software. 1. Background

Automata-based Verification - I

LTL Model Checking with Logic Based Petri Nets

Validated Templates for Specification of Complex LTL Formulas

As we have seen, there is a close connection between Legendre symbols of the form

Failure Behavior Analysis for Reliable Distributed Embedded Systems

C-Bus Voltage Calculation

Verification of multiagent systems via ordered binary decision diagrams: an algorithm and its implementation

A computational model for MapReduce job flow

Sage Timberline Office

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

Business Process Verification: The Application of Model Checking and Timed Automata

Risk in Revenue Management and Dynamic Pricing

Load Balancing Mechanism in Agent-based Grid

Multiperiod Portfolio Optimization with General Transaction Costs

Point Location. Preprocess a planar, polygonal subdivision for point location queries. p = (18, 11)

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

Computational Finance The Martingale Measure and Pricing of Derivatives

IETF 94 - NMRG 38 meeting Intent Based Network Modeling (IBNEMO) Bert Wijnen

Design of A Knowledge Based Trouble Call System with Colored Petri Net Models

A Modified Measure of Covert Network Performance

Stochastic Derivation of an Integral Equation for Probability Generating Functions

Principles of Hydrology. Hydrograph components include rising limb, recession limb, peak, direct runoff, and baseflow.

Checking. E. M. Clarke O. Grumberg K. L. McMillan X. Zhao

Software Cognitive Complexity Measure Based on Scope of Variables

6.042/18.062J Mathematics for Computer Science December 12, 2006 Tom Leighton and Ronitt Rubinfeld. Random Walks

Fixed-Point Logics and Computation

Large firms and heterogeneity: the structure of trade and industry under oligopoly

Web Application Scalability: A Model-Based Approach

Software Engineering using Formal Methods

tutorial: hardware and software model checking

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

CABRS CELLULAR AUTOMATON BASED MRI BRAIN SEGMENTATION

A Simple Model of Pricing, Markups and Market. Power Under Demand Fluctuations

Software Model Checking. Equivalence Hierarchy

On the predictive content of the PPI on CPI inflation: the case of Mexico

Interaction Expressions A Powerful Formalism for Describing Inter-Workflow Dependencies

Computing the Most Probable String with a Probabilistic Finite State Machine

Branch-and-Price for Service Network Design with Asset Management Constraints

Program Synthesis is a Game

An important observation in supply chain management, known as the bullwhip effect,

MetaGame: An Animation Tool for Model-Checking Games

Joint Production and Financing Decisions: Modeling and Analysis

A Classification of Model Checking-based Verification Approaches for Software Models

Risk and Return. Sample chapter. e r t u i o p a s d f CHAPTER CONTENTS LEARNING OBJECTIVES. Chapter 7

Fundamentals of Software Engineering

Lectures on the Dirichlet Class Number Formula for Imaginary Quadratic Fields. Tom Weston

Number Theory Naoki Sato

BUBBLES AND CRASHES. By Dilip Abreu and Markus K. Brunnermeier 1

Project Management and. Scheduling CHAPTER CONTENTS

Verifying Real-Time Embedded Software by Means of Automated State-based Online Testing and the SPIN Model Checker Application to RTEdge Models

Static and Dynamic Properties of Small-world Connection Topologies Based on Transit-stub Networks

From Workflow Design Patterns to Logical Specifications

A MOST PROBABLE POINT-BASED METHOD FOR RELIABILITY ANALYSIS, SENSITIVITY ANALYSIS AND DESIGN OPTIMIZATION

Lecture 9 verifying temporal logic

The Online Freeze-tag Problem

Transcription:

Software Model Checking: Theory and Practice Lecture: Secification Checking - Temoral Logic Coyright 2004, Matt Dwyer, John Hatcliff, and Robby. The syllabus and all lectures for this course are coyrighted 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 exress written ermission of one of the coyright holders. During this course, students are rohibited from selling notes to or being aid for taking notes by any erson or commercial firm without the exress written ermission of one Secification of the coyright Checking holders. : Temoral Logic

Objectives Understand why temoral logic can be a useful formalism for secifying roerties of concurrent/reactive systems. Understand the intuition behind Comutation Tree Logic (CTL) the secification logic used e.g., in the well-known SMV model-checker. Be able to confidently aly Linear Temoral Logic (LTL) the secification logic used in e.g., Bogor and SPIN to secify simle roerties of systems. Understand the formal semantics of LTL. Secification Checking : Temoral Logic

Outline CTL by examle LTL by examle LTL formal definition Common roerties to be stated for concurrent systems and how they can be secified using LTL Bogor s suort for LTL Secification Checking : Temoral Logic

To Do Show never claims being generated from LTL formula For you to do s Secification Checking : Temoral Logic

Reasoning about Executions 0.1 0.2 0.3 1.1 0.4 1.1 2.1 0.3 1.2 1.1 2.1 0.4 1.2 2.1 0.4 1.1 2.2 0.4 1.2 2.1 0.4 1.3 2.1 We want to reason about execution trees tree node = sna shot of the rogram s state Reasoning consists of two layers defining redicates on the rogram states (control oints, variable values) exressing temoral relationshis between those redicates Secification Checking : Temoral Logic

Why Use Temoral Logic? Requirements of concurrent, distributed, and reactive systems are often hrased as constraints on sequences of events or states or constraints on execution aths. Temoral logic rovides a formal, exressive, and comact notation for realizing such requirements. The temoral logics we consider are also strongly tied to various comutational frameworks (e.g., automata theory) which rovides a foundation for building verification tools. Secification Checking : Temoral Logic

Comutational Tree Logic (CTL) Syntax Φ ::= P rimitive roositions!φ Φ && Φ Φ Φ Φ -> Φ roositional connectives AG Φ EG Φ AF Φ EF Φ temoral oerators AX Φ EX Φ A[Φ U Φ] E[Φ U Φ] Secification Checking : Temoral Logic

Comutational Tree Logic (CTL) Syntax Φ ::= P rimitive roositions!φ Φ && Φ Φ Φ Φ -> Φ roositional connectives AG Φ EG Φ AF Φ EF Φ temoral oerators AX Φ EX Φ A[Φ U Φ] E[Φ U Φ] Semantic Intuition AG along All aths holds Globally ath quantifier temoral oerator EG AF EF there Exists a ath where holds Globally along All aths holds at some state in the Future there Exists a ath where holds at some state in the Future Secification Checking : Temoral Logic

Comutational Tree Logic (CTL) Syntax Φ ::= P rimitive roositions!φ Φ && Φ Φ Φ Φ -> Φ roositional connectives AG Φ EG Φ AF Φ EF Φ temoral oerators AX Φ EX Φ A[Φ U Φ] E[Φ U Φ] Semantic Intuition AX along All aths, holds in the next state EX there Exists a ath where holds in the next state A[ U q] along All aths, holds Until q holds E[ U q] there Exists a ath where holds Until q holds Secification Checking : Temoral Logic

Comutation Tree Logic AG Secification Checking : Temoral Logic

Comutation Tree Logic EG Secification Checking : Temoral Logic

Comutation Tree Logic AF Secification Checking : Temoral Logic

Comutation Tree Logic EF Secification Checking : Temoral Logic

Comutation Tree Logic AX Secification Checking : Temoral Logic

Comutation Tree Logic EX Secification Checking : Temoral Logic

Comutation Tree Logic A[ U q] q q q q Secification Checking : Temoral Logic

Comutation Tree Logic E[ U q] q q q q q Secification Checking : Temoral Logic

Examle CTL Secifications For any state, a request (e.g., for some resource) will eventually be acknowledged AG(requested -> AF acknowledged) Secification Checking : Temoral Logic

Examle CTL Secifications From any state, it is ossible to get to a restart state AG(EF restart) Secification Checking : Temoral Logic

Examle CTL Secifications An uwards travelling elevator at the second floor does not changes its direction when it has assengers waiting to go to the fifth floor AG((floor=2 && direction=u && button5ressed) -> A[direction=u U floor=5]) Secification Checking : Temoral Logic

Semantics for CTL (excerts) For AP: s = L(s) s = L(s) s = f g s = f and s = g s = f g s = f or s = g s = EXf π=s 0 s 1... from s: s 1 = f s = E(f U g) π=s 0 s 1... from s j 0 [ s j = g and i : 0 i <j [s i = f ] ] s = EGf π=s 0 s 1... from s i 0: s i = f Secification Checking : Temoral Logic Source: Orna Grumberg

CTL Notes Invented by E. Clarke and E. A. Emerson (early 1980 s) Secification language for Symbolic Model Verifier (SMV) model-checker SMV is a symbolic model-checker instead of an exlicit-state model-checker Symbolic model-checking uses Binary Decision Diagrams (BDDs) to reresent boolean functions (both transition system and secification Secification Checking : Temoral Logic

Linear Time Logic Restrict ath quantification to ALL (no EXISTS ) Secification Checking : Temoral Logic

Linear Time Logic Restrict ath quantification to ALL (no EXISTS ) Reason in terms of branching traces instead of branching trees Secification Checking : Temoral Logic

Linear Time Logic (LTL) Syntax Φ ::= P rimitive roositions!φ Φ && Φ Φ Φ Φ -> Φ roositional connectives []Φ <>Φ Φ U Φ X Φ temoral oerators Semantic Intuition []Φ always Φ ΦΦΦΦΦΦΦΦΦΦΦΦΦΦ <>Φ eventually Φ Φ Φ Φ U Γ Φ until Γ ΦΦΦΦΦΦΓ Φ Γ Secification Checking : Temoral Logic

Linear Time Logic []<> Along all aths, it must be the case that globally (I.e., in each state we come to) eventually will hold Exresses a form of fairness must occur infinitely often along the ath To check Φ under the assumtion of fair traces, check []<> -> Φ Secification Checking : Temoral Logic

Linear Time Logic <>[] Along all aths, eventually it is the case that holds at each state) (i.e., eventually ermanently ) Any ath contains only finitely many! states Secification Checking : Temoral Logic

Linear Time Logic W q = [] ( U q) q q q q q q q q q unless q, or waiting for q, or weak-until q Secification Checking : Temoral Logic

Semantics for LTL Semantics of LTL is given with resect to a (usually infinite) ath or trace π = s 1 s 2 s 3 We write π i for the suffix starting at s i, e.g., π 3 = s 3 s 4 s 5 A system satisfies an LTL formula f if each ath through the system satisfies f. Secification Checking : Temoral Logic

Semantics of LTL For AP: π = L(s 1 ) π = L(s 1 ) π = f g π = f and π = g π = f g π = f or π = g π = Xf π 2 = f π = <>f i >= 1. π i = f π = []f i >= 1. π i = f π = (f U g) i >= 1. π i = g and j : 1 j < i-1. π j = f Secification Checking : Temoral Logic

LTL Notes Invented by Prior (1960 s), and first use to reason about concurrent systems by A. Pnueli, Z. Manna, etc. LTL model-checkers are usually exlicitstate checkers due to connection between LTL and automata theory Most oular LTL-based checker is SPIN (G. Holzman) Secification Checking : Temoral Logic

Comaring LTL and CTL CTL* CTL LTL CTL is not strictly more exression than LTL (and vice versa) CTL* invented by Emerson and Halern in 1986 to unify CTL and LTL We believe that almost all roerties that one wants to exress about software lie in intersection of LTL and CTL Secification Checking : Temoral Logic

Bogor Suort As for regular roerties, Bogor defines an extension for LTL roerties Proerty extension is the same LTL extension Imlemented by bogor.module.roerty.ltl.lineartemorallogicmodule Suorts Atomic roositions and literals (e.g., true/false) Proositional connectives (e.g., and, or) Temoral oerators (e.g., always, eventually) Secification Checking : Temoral Logic

LTL extension extension LTL for edu.ksu.cis.rojects.bogor.module.roerty.ltl.lineartemorallogicmodule { tyedef Formula; exdef LTL.Formula ro(string); exdef LTL.Formula literal(boolean); exdef LTL.Formula always(ltl.formula); exdef LTL.Formula eventually(ltl.formula); exdef LTL.Formula negation(ltl.formula); exdef LTL.Formula until(ltl.formula, LTL.Formula); exdef LTL.Formula release(ltl.formula, LTL.Formula); exdef LTL.Formula equivalence(ltl.formula, LTL.Formula); exdef LTL.Formula imlication(ltl.formula, LTL.Formula); exdef LTL.Formula conjunction(ltl.formula, LTL.Formula); exdef LTL.Formula disjunction(ltl.formula, LTL.Formula); } exdef boolean temoralproerty(proerty.observabledictionary, LTL.Formula); Secification Checking : Temoral Logic

An Examle Mutual exclusion in ReadersWriters fun mutualexclusion() returns boolean = LTL.temoralProerty( Proerty.createObservableDictionary( Proerty.createObservableKey( "somereading", activereaders>0), Proerty.createObservableKey( "somewriting", activewriters>0) ), LTL.always( LTL.imlication( LTL.ro("someReading"), LTL.negation(LTL.ro("someWriting")) ) ) ); Secification Checking : Temoral Logic

Bogor Configuration Use the defaults excet for these settings edu.ksu.cis.rojects.bogor.module.istatefactory= edu.ksu.cis.rojects.bogor.module.roerty.fsa.fsastatefactory edu.ksu.cis.rojects.bogor.ast.transform.isystemtransformer= edu.ksu.cis.rojects.bogor.module.roerty.ltl.ltlsystemtransformer edu.ksu.cis.rojects.bogor.module.isearcher= edu.ksu.cis.rojects.bogor.module.roerty.buechi.nestedfsasearcher edu.ksu.cis.rojects.bogor.module.istatemanager.stateaugmenter= edu.ksu.cis.rojects.bogor.module.roerty.fsa.fsastateaugmenter ltlfunid=mutualexclusion Secification Checking : Temoral Logic