THEORY OF SYSTEMS MODELING AND ANALYSIS. Henny Sipma Stanford University. Master class Washington University at St Louis November 16, 2006

Similar documents
CS256/Winter 2009 Lecture #1. Zohar Manna. Instructor: Zohar Manna Office hours: by appointment

Automata-Theoretic Model Checking of Reactive Systems

Temporal Logic of Actions

An Introduction to Temporal Logics

Verifying Temporal Properties of Reactive Systems: A STeP Tutorial *

Constraint-Based Static Analysis of Programs

Linear Temporal Logic and Büchi Automata

Temporal Logic. Stavros Tripakis University of California, Berkeley. We have designed a system. We want to check that it is correct.

CS256/Spring 2008 Lecture #11 Zohar Manna. Beyond Temporal Logics

COMP3151/9151 Foundations of Concurrency Lecture 4

Computer-Aided Program Design

Guest lecturer: Prof. Mark Reynolds, The University of Western Australia

PSL Model Checking and Run-time Verification via Testers

Computation Tree Logic (CTL) & Basic Model Checking Algorithms

CS256/Winter 2009 Lecture #6. Zohar Manna

T Reactive Systems: Temporal Logic LTL

Chapter 6: Computation Tree Logic

Abstractions and Decision Procedures for Effective Software Model Checking

Timo Latvala. February 4, 2004

The State Explosion Problem

FORMAL METHODS LECTURE III: LINEAR TEMPORAL LOGIC

Temporal Logic. M φ. Outline. Why not standard logic? What is temporal logic? LTL CTL* CTL Fairness. Ralf Huuck. Kripke Structure

Timo Latvala. March 7, 2004

Diagram-based Formalisms for the Verication of. Reactive Systems. Anca Browne, Luca de Alfaro, Zohar Manna, Henny B. Sipma and Tomas E.

Lecture 16: Computation Tree Logic (CTL)

Linear-time Temporal Logic

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège

MODEL CHECKING. Arie Gurfinkel

Optimal Control of Mixed Logical Dynamical Systems with Linear Temporal Logic Specifications

Formal Verification Techniques. Riccardo Sisto, Politecnico di Torino

Automata-based Verification - III

LTL and CTL. Lecture Notes by Dhananjay Raju

Lecture 11 Safety, Liveness, and Regular Expression Logics

Finite-State Model Checking

FORMAL METHODS LECTURE IV: COMPUTATION TREE LOGIC (CTL)

Introduction. Pedro Cabalar. Department of Computer Science University of Corunna, SPAIN 2013/2014

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

The Polyranking Principle

CIS 842: Specification and Verification of Reactive Systems. Lecture Specifications: Specification Patterns

1 The decision problem for First order logic

IC3 and Beyond: Incremental, Inductive Verification

Temporal Logic Model Checking

Transition Predicate Abstraction and Fair Termination

Verification Using Temporal Logic

Automata, Logic and Games: Theory and Application

Model Checking. Boris Feigin March 9, University College London

Verification. Arijit Mondal. Dept. of Computer Science & Engineering Indian Institute of Technology Patna

From Liveness to Promptness

Automata-based Verification - III

- Introduction to propositional, predicate and higher order logics

CS477 Formal Software Dev Methods

Alternating Time Temporal Logics*

Automata on Infinite words and LTL Model Checking

Lecture 2 Automata Theory

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

Ranking Abstraction as Companion to Predicate Abstraction

Lecture 2 Automata Theory

New Complexity Results for Some Linear Counting Problems Using Minimal Solutions to Linear Diophantine Equations

Time(d) Petri Net. Serge Haddad. Petri Nets 2016, June 20th LSV ENS Cachan, Université Paris-Saclay & CNRS & INRIA

Temporal Logic and Fair Discrete Systems

Introduction to Model Checking. Debdeep Mukhopadhyay IIT Madras

Declarative modelling for timing

CS 267: Automated Verification. Lecture 1: Brief Introduction. Transition Systems. Temporal Logic LTL. Instructor: Tevfik Bultan

LTL is Closed Under Topological Closure

Theoretical Foundations of the UML

Alan Bundy. Automated Reasoning LTL Model Checking

Introduction. Büchi Automata and Model Checking. Outline. Büchi Automata. The simplest computation model for infinite behaviors is the

Helsinki University of Technology Laboratory for Theoretical Computer Science Research Reports 66

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

Chapter 4: Computation tree logic

Temporal & Modal Logic. Acronyms. Contents. Temporal Logic Overview Classification PLTL Syntax Semantics Identities. Concurrency Model Checking

Model Checking: An Introduction

Course Runtime Verification

Dipartimento di Scienze dell Informazione

Introduction to Temporal Logic. The purpose of temporal logics is to specify properties of dynamic systems. These can be either

Reasoning About Bounds In Weighted Transition Systems

State-Space Exploration. Stavros Tripakis University of California, Berkeley

ESE601: Hybrid Systems. Introduction to verification

An On-the-fly Tableau Construction for a Real-Time Temporal Logic

Relations to first order logic

Summary. Computation Tree logic Vs. LTL. CTL at a glance. KM,s =! iff for every path " starting at s KM," =! COMPUTATION TREE LOGIC (CTL)

Model checking, verification of CTL. One must verify or expel... doubts, and convert them into the certainty of YES [Thomas Carlyle]

Model Checking. Temporal Logic. Fifth International Symposium in Programming, volume. of concurrent systems in CESAR. In Proceedings of the

A Sound and Complete Deductive System for CTL* Verification

FAIRNESS FOR INFINITE STATE SYSTEMS

Topics in Verification AZADEH FARZAN FALL 2017

Model checking (III)

CTL Model checking. 1. finite number of processes, each having a finite number of finite-valued variables. Model-Checking

Generating Linear Temporal Logic Formulas for Pattern-Based Specifications

Trace Diagnostics using Temporal Implicants

A brief history of model checking. Ken McMillan Cadence Berkeley Labs

Chapter 3: Linear temporal logic

11.1 Temporal Logic for Specification and Verification

Understanding IC3. Aaron R. Bradley. ECEE, CU Boulder & Summit Middle School. Understanding IC3 1/55

Principles. Model (System Requirements) Answer: Model Checker. Specification (System Property) Yes, if the model satisfies the specification

On simulations and bisimulations of general flow systems

Principles of Knowledge Representation and Reasoning

Software Verification

Formal Verification of the Ricart-Agrawala Algorithm

Transcription:

THEORY OF SYSTEMS MODELING AND ANALYSIS Henny Sipma Stanford University Master class Washington University at St Louis November 16, 2006 1 1

COURSE OUTLINE 8:37-10:00 Introduction -- Computational model Fair transition systems -- Temporal logic 10:07-11:30 Verification methods Rules -- Diagrams -- Abstraction Traditional static analysis methods 1:07-2:30 Constraint-based static analysis methods Real-time and hybrid systems 2:37-4:00 Formalization of middleware services: Event correlation 2 2

My background B.S. Chemistry, Groningen, The Netherlands M.S. Chemical Engineering, idem 7 years as Control Engineer with Shell in The Netherlands, Singapore and Houston, TX M.S. Computer Science, Stanford Ph.D. Computer Science, Stanford Sr. Research Associate at Stanford since 2000 3 3

Research Interests Static Analysis Constraint-based reasoning Runtime Analysis Monitoring of temporal properties Decision Procedures Data structures Formalization of Middleware services Event Correlation Deadlock Avoidance 4 4

I. Introduction 5 5

Reactive Systems time Continuous interaction with the environment Observable throughout its execution 6 6

OBJECTIVE: Analysis of System Behaviors COMPONENTS: Model (+ Specification) METHODS: Deductive and Algorithmic THEORY: Logic + Automata 7 7

FORMAL METHODS - Scope Formal Verification Complex system Model Formal specification Natural-language specification 8 8

FORMAL METHODS - Scope Gene regulatory network Static analysis properties 9 9

FORMALIZATION OF MIDDLEWARE SERVICES Application Application Application ORB Services Event Notification Event Correlation Concurrency Logging Trading Scheduling Deadlock Avoidance Load Balancing ORB Core OS Kernel OS I/O subsystem Network Adapters OS Kernel OS I/O subsystem Network Adapters 10 10

Reactive Systems time Behavior: sequences of states Specification: temporal logic 11 11

Verification process System description Fair transition system System specification Temporal logic formula Verification techniques Proof Counterexample 12 12

Static analysis (traditional) System description Fair transition system abstract domain Symbolic simulation Invariants 13 13

Static analysis (constraint-based) System description Fair transition system template property System of constraints temporal properties Invariants Proof of termination 14 14

Extension to real-time and hybrid systems System description Real-time/hybrid transition system System specification Fair transition system Temporal logic formula Nonzenoness checking Verification techniques Proof 15 Counterexample 15

Verification techniques (1) Algorithmic: exhaustive search for counterexamples Issues: state space explosion problem efficient representations applicable to finite-state systems only 16 16

Verification techniques (2) Deductive: theorem proving system formula Verification techniques Proof 17 17

Verification techniques (2) Deductive: theorem proving system formula Verification techniques 100s/1000s/10,000s of first-order verification conditions Decision procedures 18 18

II. COMPUTATIONAL MODEL Fair transition systems Temporal logic: LTL Reference: Zohar Manna, Amir Pnueli, Temporal Verification of Reactive Systems: Safety, Springer-Verlag, 1995. 19 19

States V: Vocabulary -- set of typed variables expression over V assertion over V {x,y: integer, b: boolean} x+y x>y s: state -- interpretation of all variables extends to expressions and assertions {x:2,y:3,b:true} s[x]=2,s[y]=3,s[b]=true s[x+y]=5 s[x>y]=false Σ: set of all states Z Z {true,false} 20 20

System Description: Fair transition systems Set of typed variables Example: {x,y} Fairness condition F T Φ: < V, Θ, T, F > Initial condition: first-order formula Example: x=0 y=0 Set of transitions Compact first-order representation of all sequences of states that can be generated by a system 21 21

Transitions T: finite set of transitions τ T: Σ 2 Σ Example: ρ τ : x =x+1 x =x+2 Σ τ(s): τ-successors of s τ(<x:2>) = {<x:3>,<x:4>} s. represented by a transition relation ρ τ (V,V ) V : values of variables in the current state V : values of variables in the next state 22 22

Runs and Computations Infinite sequence of states σ: s 0 s 1 s 2 s 3 s 4... is a run of Φ if Initiality: s 0 Θ Consecution: for all i > 0 s i+1 is a τ-successor of s i for some τ T (s 0 is an initial state) τ τ τ τ s 0 s 1 s 2 s 3... 23 23

Runs and Computations Infinite sequence of states σ: s 0 s 1 s 2 s 3 s 4... is a computation of Φ if σ is a run Justice: for each τ F if τ is enabled infinitely often in σ it is taken infinitely often in σ τ is enabled on S i : τ(s i ) τ is taken on s i : s i+1 τ(s i ) 24 24

Runs and Computations: Example V: {x:integer} Θ: x=0 T: {τ 1, τ 2, τ 3 } with F: {τ 1, τ 2 } { ρτ3 ρ τ1 : x =x+1 x =x+3 ρ τ2 : x =x+2 x =2x : x =x σ 1 : 0, 1, 2, 3, 4, 5, 6, 7,... σ 2 : 0, 0, 0, 0, 0, 0, 0, 0... σ 3 : 0, 2, 4, 8, 16, 32,... σ 4 : 0, 1, 1, 3, 3, 5, 5, 7, 7,... σ 5 : 1, 2, 3, 5, 6, 8, 9, 11,... Run? Computation? 25 25

Runs and Computations: Example V: {x:integer} Θ: x=0 T: {τ 1, τ 2, τ 3 } with F: {τ 1, τ 2 } { ρτ3 ρ τ1 : (x=0 x=1) (x =x+1 x =x+3) ρ τ2 : x =x+2 x =2x : x =x σ 1 : 0, 1, 2, 3, 4, 5, 6, 7,... σ 2 : 0, 0, 0, 0, 0, 0, 0, 0... σ 3 : 0, 2, 4, 8, 16, 32,... σ 4 : 0, 1, 1, 3, 3, 5, 5, 7, 7,... σ 5 : 1, 2, 3, 5, 6, 8, 9, 11,... Run? Computation? 26 26

System Description: Summary Fair transition system: Φ: < V, Θ, T, F > Run: Initiality + Consecution Computation: Run + Justice L(Φ): all computations of Φ Behavior of the program (all sequences of states that satisfy Initiality, Consecution and Justice) 27 27

Reachable state space state s is Φ-reachable if it appears in some Φ-computation σ: s 0 s 1 s 2 s 3 s 4... system Φ is finite-state if the set of Φ-reachable states is finite Notation: Σ : state space Σ Φ : Φ-reachable state space Example: V: {b 1, b 2 } Θ: b 1 b 2 Σ = {<t,t>,<t,f>,<f,t>,<f,f>} Σ Φ = {<t,t>,<f,f>} T: {τ} with ρ τ : b 1 = b 1 b 2 = b 2 28 28

Reachable state space state s is Φ-reachable if it appears in some Φ-computation σ: s 0 s 1 s 2 s 3 s 4... system Φ is finite-state if the set of Φ-reachable states is finite Notation: Σ : state space Σ Φ : Φ-reachable state space Example: V: {x} Θ: x=0 T: {τ} with ρ τ : x=0 x =x+1 Σ = N Σ Φ = {x:0, x:1} 29 29

Reachable state space state s is Φ-reachable if it appears in some Φ-computation σ: s 0 s 1 s 2 s 3 s 4... system Φ is finite-state if the set of Φ-reachable states is finite Notation: Σ : state space Σ Φ : Φ-reachable state space Example: V: {x} Θ: 0 x M T: {τ 1,τ 2 } with ρ τ1 : odd(x) x =3x+1 ρ τ2 : even(x) x =x/2 Σ = N Σ Φ =? 30 30

Reachable state space vs Computations System Φ may have any combination of finite state space infinite state space finite # of computations infinite # of computations 31 31

II. COMPUTATIONAL MODEL Fair transition systems Temporal logic: LTL Reference: Zohar Manna, Amir Pnueli, Temporal Verification of Reactive Systems: Safety, Springer-Verlag, 1995. 32 32

Temporal Logic Language that specifies the behavior of a reactive system System Φ ---------------------------- System behavior: L(Φ) Temporal formula φ --- Sequences of states that satisfy φ: L(φ) System Φ satisfies specification φ if L(Φ) L(φ) Φ φ 33 33

Temporal logic Σ L(φ) L(Φ) System Φ satisfies specification φ if L(Φ) L(φ) Φ φ 34 34

First-order logic --- Temporal logic First-order logic Temporal logic models are states models are sequences of states <x:3,y:1> x > y <s 0 s 1 s 2 s 3...> φ assertion p represents the set of states for which p is true temporal formula φ represents the set of sequences of states for which φ is true 35 35

Temporal logic: underlying assertion language Assertion language A: first-order language over system variables (+ theories for their domains) Formulas in A: state formulas (aka assertions) evaluated over a single state s p iff s[p] = true p holds at s s satisfies s s is a p-state Example: s: <x:4, y:1> s x=0 y=1 s x > y s x = y+3 s odd(x) 36 36

Temporal logic: underlying assertion language Assertions represent sets of states Σ x>0 x>5 x 2 < 100 37 37

Temporal logic: underlying assertion language assertion p is state-satisfiable if s p for some state s Σ Example: x>0 assertion p is state-valid if s p for all states s Σ Example: x>y x+1 > y 38 38

Temporal logic assertions + temporal operators first-order formulas describing the properties of a single state always eventually U until W wait for next 39 39

Temporal logic: safety versus liveness Safety property: nothing bad will happen it will not happen that the train is in the crossing while the gates are open Liveness property: something good will happen the train will eventually be able to pass the crossing 40 40

Temporal logic -- informal puq p p p p p p p p p p p p p p p p p p p p p p p p p q p present 41 41

Temporal logic: syntax every assertion is a temporal formula if φ and ψ are temporal formulas, so are boolean combinations: φ φ ψ φ ψ φ ψ temporal combinations: φ φ φ φuψ φwψ Examples: x=0 (x>0)) puq q 42 42

Temporal logic: semantics Temporal formulas are evaluated over infinite sequences of states: σ: s 0 s 1 s 2 s 3 s 4... The truth value of a temporal formula φ over σ at position j in the sequence is (σ,j) φ (φ holds at position j in σ) 43 43

Temporal logic: semantics if φ is a state formula p (σ,j) φ iff s j p Example: σ<x>: 4, 3, 1, 7, 5, 8, 0, 0, 0, 0 (σ,3) x > 6 (σ,6) x=0 <x:7> x > 6 if φ is a temporal formula of the form (boolean operators) (σ,j) ψ iff (σ,j) ψ (σ,j) ψ χ iff (σ,j) ψ or (σ,j) χ 44 44

Temporal logic: semantics if φ is a temporal formula of the form (temporal operators) (σ,j) ψ iff for all k j, (σ,j) ψ ψ ψ ψ ψ ψ ψ ψ j (σ,j) ψ iff for some k j, (σ,j) ψ ψ j 45 45

Temporal logic: semantics if φ is a temporal formula of the form (temporal operators) (σ,j) ψu iff for some k j, (σ,j) and for all i, j i<k, (σ,j) ψ ψ ψ ψ ψ ψ ψ j k (σ,j) ψw iff (σ,j) ψu (σ,j) ψ (σ,j) ψ iff (σ,j+1) ψ ψ j j+1 46 46

Temporal logic: semantics A sequence of states σ satisfies a temporal formula φ σ φ iff (σ,0) φ 47 47

Temporal logic formulas: examples p q p q if initially p then eventually q p q) every p is eventually followed by a q p p p q p q p q p p) once p, always p p p p p p p p p p p p p p p 48 48

p Temporal logic formulas: examples p p p p p p p every position is eventually followed by a p infinitely often p p p p p p p p p p p p p p eventually always p p q if there are infinitely many p s then there are infinitely many q s 49 49

Temporal logic formulas: examples Nested waiting-for formulas: q 1 W(q 2 W(q 3 Wq 4 )) intervals of continuous q i : q 1 q 1 q 1 q 1 q 2 q 2 q 2 q 3 q 3 q 3 q 3 q 4 possibly empty interval: q 1 q 1 q 1 q 1 q 3 q 3 q 3 q 3 q 3 q 3 q 3 q 4 possibly infinite interval: q 1 q 1 q 1 q 1 q 2 q 2 q 2 q 3 q 3 q 3 q 3 q 3 q 3 q 3 q 3 q 3 q 3 q 3 q 3 50 50

Temporal logic: summary For temporal formula φ, sequence of states σ, position j 0: (σ,j) φ φ holds at position j in σ σ satisfies φ at j j is a φ-position in σ For temporal formula φ and sequence of states σ φ holds on σ σ φ iff (σ,0) φ σ satisfies φ 51 51

Temporal logic: satisfiability and validity For temporal formula φ φ is satisfiable if σ φ for some sequence of states σ φ is valid if σ φ for all sequences of states σ Σ x>0) (x>5) (x>0)u(x>5) 52 52

Temporal logic: satisfiability/validity examples (x=0) (x=0) (x 0) satisfiable? valid? (x=0) (x 0) (x=0) (x=1) (x=0) (x=1) p p p p pu(q r) ( 53 53

Temporal logic: Equivalences Temporal formulas φ, ψ are congruent φ ψ if φ ψ) is valid φ and ψ have the same truth value at all positions in all models congruent? (p q) (p q) pu(q r) pu(q r) p q p q puq pur puq pur 54 54

Temporal logic: Expansions φ φ φ φ φ φ φuψ ψ (φ (φuψ)) Used in checking temporal formulas in model checking 55 55

Expressiveness Some properties cannot be expressed in LTL: p is true, if at all, only at even positions Not specified by p ( p p ) or p ( p p ) requires quantification t ( t (t t) (p t) ) 56 56

Temporal logic vs First-order logic Temporal formula p ( r q ) ) can be expressed in first-order logic as ( t 1 0) [ p(t 1) ( t 2 )[ t 1 t 2 r(t 2 ) ] ] ( t 3 )( t 2 t 3 q(t 3 ) 57 57