Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford

Similar documents
Introduction to ω-autamata

Lecture 9: LTL and Büchi Automata

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa

Theory of Computation Regular Languages

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Non Deterministic Automata. Formal Languages and Automata - Yonsei CS 1

Formal Methods in Software Engineering

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata

Good-for-Games Automata versus Deterministic Automata.

Non-Deterministic Finite Automata

Non-deterministic Finite Automata

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Chapter 2 Finite Automata

Fundamentals of Computer Science

Deterministic Finite Automata

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

4 Deterministic Büchi Automata

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Non-deterministic Finite Automata

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

On Determinisation of History-Deterministic Automata.

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

Software Engineering using Formal Methods

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

Regular expressions, Finite Automata, transition graphs are all the same!!

Finite-State Automata: Recap

Lecture 08: Feb. 08, 2019

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

CHAPTER 1 Regular Languages. Contents

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

Automata, Games, and Verification

CMSC 330: Organization of Programming Languages

Automata and Languages

Java II Finite Automata I

NFAs continued, Closure Properties of Regular Languages

1.4 Nonregular Languages

Deterministic Finite-State Automata

From LTL to Symbolically Represented Deterministic Automata

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Formal Language and Automata Theory (CS21004)

Myhill-Nerode Theorem

Formal languages, automata, and theory of computation

Lecture 6 Regular Grammars

Nondeterminism and Nodeterministic Automata

Learning Moore Machines from Input-Output Traces

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Minimal DFA. minimal DFA for L starting from any other

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

1.3 Regular Expressions

Worked out examples Finite Automata

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

Lexical Analysis Finite Automate

Coalgebra, Lecture 15: Equations for Deterministic Automata

1 From NFA to regular expression

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Let's start with an example:

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CS 275 Automata and Formal Language Theory

Lecture 09: Myhill-Nerode Theorem

1 Nondeterministic Finite Automata

Relating logic to formal languages

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research

Streamed Validation of XML Documents

Harvard University Computer Science 121 Midterm October 23, 2012

7 Automata and formal languages. 7.1 Formal languages

Convert the NFA into DFA

C. C^mpenu, K. Slom, S. Yu upper boun of mn. So our result is tight only for incomplete DF's. For restricte vlues of m n n we present exmples of DF's

A From LTL to Deterministic Automata A Safraless Compositional Approach

Formal Languages and Automata

Categorical approaches to bisimilarity

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Nondeterministic Biautomata and Their Descriptional Complexity

CS375: Logic and Theory of Computing

Concepts of Concurrent Computation Spring 2015 Lecture 9: Petri Nets

1 Structural induction

1 Structural induction, finite automata, regular expressions

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

FABER Formal Languages, Automata and Models of Computation

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Turing Machines Part One

Probabilistic model checking with PRISM

Homework 3 Solutions

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7

Some Theory of Computation Exercises Week 1

NFAs continued, Closure Properties of Regular Languages

DFA Minimization and Applications

LTL Translation Improvements in Spot

Transcription:

Probbilistic Model Checking Michelms Term 2011 Dr. Dve Prker Deprtment of Computer Science University of Oxford

Long-run properties Lst lecture: regulr sfety properties e.g. messge filure never occurs e.g. n lrm is only ever triggered by n error bd prefixes represented by regulr lnguge property lwys refuted by finite trce/pth Liveness properties e.g. "for every request, n cknowledge eventully follows no finite prefix refutes the property ny finite prefix cn be extended to stisfying trce Firness ssumptions e.g. every process tht is enbled infinitely often is scheduled infinitely often Need properties of infinite pths 2

Overview ω-regulr expressions nd ω-regulr lnguges Nondeterministic Büchi utomt (NBA) Deterministic Büchi utomt (DBA) Deterministic Rbin utomt (DRA) Deterministic ω-utomt nd DTMCs 3

ω-regulr expressions Regulr expressions E over lphbet Σ re given by: E ::= ɛ α E + E E.E E* (where α Σ) An ω-regulr expression tkes the form: G = E 1.(F 1 ) ω + E 2.(F 2 ) ω + + E n.(f n ) ω where E i nd F i re regulr expressions with ɛ L(F i ) The lnguge L(G) Σ ω of n ω-regulr expression G is L(E 1 ).L(F 1 ) ω L(E 2 ).L(F 2 ) ω + + L(E n ).L(F n ) ω where L(E) is the lnguge of regulr expression E nd L(E) ω = { w ω w L(E) } Exmple: (α+β+γ)*(β+γ) ω for Σ = { α, β, γ } 4

ω-regulr lnguges/properties A lnguge L Σ ω over lphbet Σ is n ω-regulr lnguge if nd only if: L = L(G) for some ω-regulr expression G ω-regulr lnguges re: closed under intersection closed under complementtion P (2 AP ) ω is n ω-regulr property if P is n ω-regulr lnguge over 2 AP (where AP is the set of tomic propositions for some model) pth ω stisfies P if trce(ω) P NB: ny regulr sfety property is n ω-regulr property 5

Exmples A messge is sent successfully infinitely often (( succ)*.succ) ω Every time the process tries to send messge, it eventully succeeds in sending it (( try)* + try.( succ)*.succ) ω 1 {fil} 0.5 s {try} 0.01 2 s 0 s 1 0.98 0.5 s 3 0.01 {succ} 1 6

Büchi utomt A nondeterministic Büchi utomton (NBA) is tuple A = (Q, Σ, δ, Q 0, F) where: Q is finite set of sttes Σ is n lphbet δ : Q Σ 2 Q is trnsition function Q 0 Q is set of initil sttes F Q is set of ccept sttes i.e. just like nondeterministic finite utomton (NFA) The difference is the ccepting condition 7

Lnguge of n NBA Consider Büchi utomton A = (Q, Σ, δ, Q 0, F) A run of A on n infinite word α 1 α 2 is: n infinite sequence of utomt sttes q 0 q 1 such tht: q 0 Q 0 nd q i+1 δ(q i, α i+1 ) for ll i 0 An ccepting run is run with q i F for infinitely mny i The lnguge L(A) of A is the set of ll infinite words on which there exists n ccepting run of A 8

Exmple Infinitely often q 0 q 1 9

Exmple As in the lst lecture, we use utomt to represent lnguges of the form L (2 AP ) ω So, if AP = {,b}, then: is ctully: q 0 q 1 q 0 q 1, {b} {}, {,b}, {b} {}, {,b} 10

Properties of Büchi utomt ω-regulr lnguges L(A) is n ω-regulr lnguge for ny NBA A ny ω-regulr lnguge cn be represented by n NBA ω-regulr expressions like for finite utomt, cn construct n NBA from n rbitrry ω-regulr expression E 1.(F 1 ) ω + + E n.(f n ) ω i.e. there re opertions on NBAs to: construct NBA ccepting L ω for regulr lnguge L construct NBA from NFA for (regulr) E nd NBA for (ω-regulr) F construct NBA ccepting union L(A 1 ) L(A 2 ) for NBA A 1 nd A 2 11

Büchi utomt nd LTL LTL formule ψ ::= true ψ ψ ψ X ψ ψ U ψ where AP is n tomic proposition Cn convert ny LTL formul ψ into n NBA A over 2 AP i.e. ω ψ trce(ω) L(A) for ny pth ω LTL-to-NBA trnsltion (see e.g. [VW94], [DGV99]) construct generlized NBA (multiple sets of ccept sttes) bsed on decomposition of LTL formul into subformule cn convert GNBA into n equivlent NBA vrious optimistions to the bsic techniques developed not covered here; see e.g. section 5.2 of [BK08] 12

Büchi utomt nd LTL GF ( infinitely often ) q 0 q 1 G( F b) ( b lwys eventully follows ) b q 0 q 1 b b b 13

Deterministic Büchi utomt Like for finite utomt A NBA is deterministic if: Q 0 =1 δ(q, α) 1 for ll q Q nd α Σ i.e. one initil stte nd no nondeterministic successors A deterministic Büchi utomton (DBA) is totl if: δ(q, α) = 1 for ll q Q nd α Σ i.e. unique successor sttes But, NBA cn not lwys be determinised i.e. NBA re strictly more expressive thn DBA 14

NBA nd DBA NBA nd DBA for the LTL formul G b GF NBA: b q 0 q 1 b b b DBA: b q 0 q 1 b b b 15

No DBA possible Consider the ω-regulr expression (α+β)*α ω over Σ={α,β} i.e. words contining only finitely mny instnces of β there is no deterministic Büchi utomt ccepting this In prticulr, tke α = {} nd β =, i.e. Σ=2 AP, AP={} (α+β)*α ω represents the LTL formul FG FG is represented by the following NBA: q 0 q 1 q 2 true But there is no DBA for FG true 16

Deterministic Rbin utomt A deterministic Rbin utomton (DRA) is tuple A = (Q, Σ, δ, q 0, Acc) where: Q is finite set of sttes Σ is n lphbet δ : Q Σ Q is trnsition function q 0 Q is n initil stte Acc 2 Q 2 Q is n cceptnce condition The cceptnce condition is set of pirs of stte sets Acc = { (L i, K i ) 1 i k } 17

Deterministic Rbin utomt A run of word on DRA is ccepting iff: for some pir (L i, K i ), the sttes in L i re visited finitely often nd (some of) the sttes in K i re visited infinitely often or in LTL: Hence: deterministic Büchi utomton is specil cse of deterministic Rbin utomton where Acc = { (, {F}) } 18

FG NBA for FG (no DBA exists) q 0 q 1 q 2 true true DRA for FG q 0 q 1 where cceptnce condition is Acc = { ({q 0 },{q 1 }) } 19

Exmple - DRA Another exmple of DRA (over lphbet 2 {,b} ) q 0 b q 1 b where cceptnce condition is Acc = { ({q 1 },{q 0 }) } In LTL: G( F( b)) FG 20

Properties of DRA Any ω-regulr lnguge cn represented by DRA (nd L(A) is n ω-regulr lnguge for ny DRA A) i.e. DRA nd NBA re eqully expressive (but NBA my be more compct) nd DRA re strictly more expressive thn DBA Any NBA cn be converted to n equivlent DRA [Sf88] size of the resulting DRA is 2 O(nlogn) 21

Deterministic ω-utomt nd DTMCs Let A be DBA or DRA over the lphbet 2 AP i.e. L(A) (2 AP ) ω identifies set of pths in DTMC Let Prob D (s, A) denote the corresponding probbility from stte s in discrete-time Mrkov chin D i.e. Prob D (s, A) = Pr D s { ω Pth(s) trce(ω) L(A) } Like for finite utomt (i.e. DFA), we cn evlute Prob D (s, A) by constructing product of D nd A which records the stte of both the DTMC nd the utomton 22

Product DTMC for DBA For DTMC D = (S, s init, P, L) nd (totl) DBA A = (Q, Σ, δ, q 0, F) The product DTMC D A is: the DTMC (S Q, (s init,q init ), P, L ) where: q init = δ(q 0,L(s init )) L (s,q) = { ccept } if q F nd L (s,q) = otherwise Since A is deterministic unique mppings between pths of D, A nd D A probbilities of pths re preserved 23

Product DTMC for DBA For DTMC D nd DBA A Prob D (s, A) = Prob D A ((s,q s ), GF ccept) where q s = δ(q 0,L(s)) Hence: Prob D (s, A) = Prob D A ((s,q s ), F T GFccept ) where T GFccept = union of D A BSCCs T with T St(ccept) Reduces to computing BSCCs nd rechbility probbilities 24

Compute Prob(s 0, GF ) Exmple property cn be represented s DBA 0.6 0.3 {b} 0.1 0.5 s 0 s 1 s 2 s 3 s 4 s 5 {} 0.2 1 1 0.3 0.9 0.1 {} {} 1 q 0 q 1 Result: 1 25

Exmple 2 Compute Prob(s 0, G b GF ) property cn be represented s DBA 0.6 0.3 0.1 0.5 s 0 s 1 s 2 0.2 1 {b} 0.3 0.9 0.1 {} 1 b q 0 q 1 b b s 3 s 4 s 5 {} 1 {} b Result: 0.75 26

Product DTMC for DRA For DTMC D = (S, s init, P, L) nd (totl) DRA A = (Q, Σ, δ, q 0, Acc) where Acc = { (L i, K i ) 1 i k } The product DTMC D A is: the DTMC (S Q, (s init,q init ), P, L ) where: q init = δ(q 0,L(s init )) l i L (s,q) if q L i nd k i L (s,q) if q K i (i.e. stte sets of cceptnce condition used s lbels) (sme product s for DBA, except for stte lbelling) 27

Product DTMC for DRA For DTMC D nd DRA A Prob D (s, A) = Prob D A ((s,q s ), 1 i k (FG l i GF k i ) where q s = δ(q 0,L(s)) Hence: Prob D (s, A) = Prob D A ((s,q s ), F T Acc ) where T Acc is the union of ll ccepting BSCCs in D A n ccepting BSCC T of D A is such tht, for some 1 i k: q l i for ll (s,q) T nd q k i for some (s,q) T i.e. T (S L i ) = nd T (S K i ) Reduces to computing BSCCs nd rechbility probbilities 28

Compute Prob(s 0, FG ) Exmple 3 property cn be represented s DRA 0.6 0.3 {b} 0.1 0.5 s 0 s 1 s 2 0.2 0.3 s 3 s 4 s 5 {} 1 1 0.9 0.1 {} {} 1 q 0 q 1 Acc = { ({q 0 },{q 1 }) } Result: 0.125 29

Exmple 4 Compute Prob(s 0, G(b F( b )) FG b) property cn be represented s DRA 0.6 0.3 0.1 0.5 s 0 s 1 s 2 0.2 1 {b} 0.3 0.9 0.1 {} s 3 s 4 s 5 1 q 0 b b b q 1 Acc = { ({q 1 },{q 0 }) } b {} 1 {} Result: 1 30

Summing up ω-regulr expressions nd ω-regulr lnguges lnguges of infinite words: E 1.(F 1 ) ω + E 2.(F 2 ) ω + + E n.(f n ) ω Nondeterministic Büchi utomt (NBA) ccepting runs visit stte in F infinitely often cn represent ny ω-regulr lnguge by n NBA cn trnslte ny LTL formul into equivlent NBA Deterministic Büchi utomt (DBA) strictly less expressive thn NBA (e.g. no NBA for FG ) Deterministic Rbin utomt (DRA) generlised cceptnce condition: { (L i, K i ) 1 i k } s expressive s NBA; cn convert ny NBA to DRA Deterministic ω-utomt nd DTMCs product DTMC + BSCC computtion + rechbility 31