Chapter 4: Regular Properties Principles of Model Checking Christel - - PowerPoint PPT Presentation

chapter 4 regular properties
SMART_READER_LITE
LIVE PREVIEW

Chapter 4: Regular Properties Principles of Model Checking Christel - - PowerPoint PPT Presentation

Chapter 4: Regular Properties Principles of Model Checking Christel Baier and Joost-Pieter Katoen 1 Overview Automata on finite words Regular safety propertys bad prefixes constitute a regular language that can be recognized as a


slide-1
SLIDE 1

1

Chapter 4: Regular Properties Principles of Model Checking

Christel Baier and Joost-Pieter Katoen

slide-2
SLIDE 2

Overview

 Automata on finite words

 Regular safety property’s bad prefixes constitute a regular language that can be recognized as a finite automaton (NFA or DFA)

 Model-checking regular safety properties

 Reduce the safety property check problem to the invariant- checking problem in a product construction of TS with a finite automaton that recognized the bad prefixes of the safety property

 Automata on infinite words

 Generalize the verification algorithm to a larger class of linear time properties: ω-regular properties

 Model-checking ω-regular properties

 ω-regular properties can be represented by Buchi automata that is the key concept to verify ω-regular properties via a reduction to persistence checking

2

slide-3
SLIDE 3

Overview

 Automata on finite words

 Regular safety property’s bad prefixes constitute a regular language that can be recognized as a finite automaton (NFA or DFA)

 Model-checking regular safety properties

 Reduce the safety property check problem to the invariant- checking problem in a product construction of TS with a finite automaton that recognized the bad prefixes of the safety property

 Automata on infinite words

 Generalize the verification algorithm to a larger class of linear time properties: ω-regular properties

 Model-checking ω-regular properties

 ω-regular properties can be represented by Buchi automata that is the key concept to verify ω-regular properties via a reduction to persistence checking

3

slide-4
SLIDE 4

Automata on Finite Words

Definition 4.1. Nondeterministic Finite Automaton (NFA) A nondeterministic finite automaton (NFA) A is a tuple A = (Q,Σ, δ,Q0, F) where 

  • Q is a finite set of states,

  • Σ is an alphabet,

  • δ : Q × Σ →

is a transition function, 

  • Q0 ⊆ Q is a set of initial states, and

  • F ⊆ Q is a set of accept (or: final) states.

4

Q

2

slide-5
SLIDE 5

An Example of a Finite-State Automaton

 Q = { q0, q1, q2 }, Σ = {A,B},  Q0 = { q0 }, F = { q2 },  The transition function δ is defined by δ(q0,A) = {q0}, δ(q0,B) = { q0, q1 }, δ(q1,A) = {q2}, δ(q1,B) = { q2 }, δ(q2,A) = ∅, δ(q2,B) = ∅

5

slide-6
SLIDE 6

Automata on Finite Words

6

slide-7
SLIDE 7

Runs and Accepted Words

7

Runs Words q0 ε q0 q0 q0 q0 ABA, BBA, ABA, BBB, AAA… q0 q1 q2 BA, BB q0 q0 q1 q2 ABB, ABA, BBA, BBB…

slide-8
SLIDE 8

Runs and Accepted Words

8

 Accepting runs: runs that finish in the final state. (e.g., q0q1q2)  Accepting words: words that can be represented by accepting runs. (e.g., ABA, BBB)  Accepting words belong to the accepted language L(A) that is given by the regular expression (A+B)*B(A+B).

slide-9
SLIDE 9

Alternative Characterization of the Accepted Language

9

slide-10
SLIDE 10

Properties in NFA

10

slide-11
SLIDE 11

Deterministic Finite Automaton (DFA)

11

Let A = (Q,Σ, δ,Q0, F) be an NFA. A is called deterministic if |Q0| <= 1 and |δ(q,A)| <= 1 for all states q ∈ Q and all symbols A ∈ Σ. We will use the abbreviation DFA for a deterministic finite automaton. DFA A is called total if |Q0| = 1 and |δ(q,A)| = 1 for all q ∈ Q and all A ∈ Σ.

slide-12
SLIDE 12

Powerset Construction

12

slide-13
SLIDE 13

Overview

 Automata on finite words

 Regular safety property’s bad prefixes constitute a regular language that can be recognized as a finite automaton (NFA or DFA)

 Model-checking regular safety properties

 Reduce the safety property check problem to the invariant- checking problem in a product construction of TS with a finite automaton that recognized the bad prefixes of the safety property

 Automata on infinite words

 Generalize the verification algorithm to a larger class of linear time properties: ω-regular properties

 Model-checking ω-regular properties

 ω-regular properties can be represented by Buchi automata that is the key concept to verify ω-regular properties via a reduction to persistence checking

13

slide-14
SLIDE 14

Regular Safety Properties

14

Every trace that violates a safety property has a bad prefix that causes a refutation. The set of bad prefixes constitutes a language of finite words

  • ver the alphabet Σ= .

The input symbols A ∈ Σ of the NFA are now sets of atomic propositions AP . E.g., AP={a, b}, then Σ={{}, {a}, {b}, {a, b}}

AP

2

slide-15
SLIDE 15

Regular Safety Property

15

safe

P

AP

2

slide-16
SLIDE 16

Regular Safety Property

16

slide-17
SLIDE 17

Example: Regular Safety Property for Mutual Exclusion Algorithms

17

Consider a mutual exclusion algorithm such as the semaphore- based one or Peterson’s algorithm. The bad prefixes of the safety property P_mutex (“there is always at most one process in its critical section”) constitute the language of all finite words A0 A1 . . .An such that { crit1, crit2} ⊆ Ai for some index i with 0 <= i <= n. A regular expression representing all bad prefixes is (~(crit1^crit2))*(crit1^crit2).

slide-18
SLIDE 18

Example: Regular Safety Property for the Traffic Light

18

Consider a traffic light with three possible colors: red, yellow and green. The property “a red phase must be preceded immediately by a yellow phase” is specified by the set of infinite words ζ = A0 A1 . . . with Ai ⊆ {red, yellow } such that for all i >= 0 we have that red ∈ Ai implies i > 0 and yellow ∈ Ai−1. A NFA recognizing all bad prefixes of the property is shown as below:

slide-19
SLIDE 19

A Nonregular Safety Property

19

Not all safety properties are regular. As an example of a nonregular safety property, consider: “The number of inserted coins is always at least the number of dispensed drinks.” Let the set of propositions be { pay, drink }. Minimal bad prefixes for this safety property constitute the language which is not a regular, but a context-free language.

slide-20
SLIDE 20

Verifying Regular Safety Properties

20

Let be a regular safety property over the atomic propositions AP and A an NFA recognizing the bad prefixes of .

safe

P

safe

P

To check whether the NFAs A1 and A2 do intersect, it suffices to consider their product automaton, so Therefore, we need to check whether

slide-21
SLIDE 21

Verifying Regular Safety Properties

21

slide-22
SLIDE 22

Example: a product automaton

22

Consider a German traffic light, AP = { red, yellow } indicating the corresponding light phases. The labeling is defined as follows: L(red) = { red }, L(yellow) = { yellow }, L(green) = ∅ = L(red+yellow). The language of the minimal bad prefixes of the safety property “each red light phase is preceded by a yellow light phase” is accepted by the DFA A indicated here.

slide-23
SLIDE 23

Example: a product automaton

23

slide-24
SLIDE 24

Verifying Regular Safety Properties

24

slide-25
SLIDE 25

Example: a product automaton

25

slide-26
SLIDE 26

Verifying Regular Safety Properties

26

slide-27
SLIDE 27

Overview

 Automata on finite words

 Regular safety property’s bad prefixes constitute a regular language that can be recognized as a finite automaton (NFA or DFA)

 Model-checking regular safety properties

 Reduce the safety property check problem to the invariant- checking problem in a product construction of TS with a finite automaton that recognized the bad prefixes of the safety property

 Automata on infinite words

 Generalize the verification algorithm to a larger class of linear time properties: ω-regular properties

 Model-checking ω-regular properties

 ω-regular properties can be represented by Buchi automata that is the key concept to verify ω-regular properties via a reduction to persistence checking

27

slide-28
SLIDE 28

ω-Regular Languages and Properties

28

Infinite words over the alphabet Σ are infinite sequences A0 A1 A2 . . . of symbols Ai ∈ Σ. denotes the set of all infinite words over Σ. Any subset of is called a language of infinite words, called an ω-language. For instance, the infinite repetition of the finite word AB yields the infinite word ABABABABAB. . . (ad infinitum) and is denoted by . For the special case of the empty word, we have = ε. For an infinite word, infinite repetition has no effect, that is, = ζ if ζ ∈ .

slide-29
SLIDE 29

ω-Regular Expression

slide-30
SLIDE 30

ω-Regular Language

slide-31
SLIDE 31

ω-Regular Properties

slide-32
SLIDE 32

Example: Mutual Exclusion

An example of an ω-regular property is the property given by the informal statement “process P visits its critical section infinitely

  • ften” which, for AP = { wait, crit }, can be formalized by the ω-

regular expression: Starvation freedom in the sense of “whenever process P is waiting then it will enter its critical section eventually later” is an ω- regular property as it can be described by

slide-33
SLIDE 33

Nondeterministic Buchi Automata

slide-34
SLIDE 34

NFA v.s. NBA

Syntax differences between NFA and NBA : None Semantics differences between NFA and NBA: the accepted language of an NFA A is a language of finite words, whereas the accepted language of NBA A is an ω-language. The intuitive meaning of the acceptance criterion named after Buchi is that the accept set of A has to be visited infinitely often. Thus, the accepted language Lω(A) consists of all infinite words that have a run in which some accept state is visited infinitely often.

slide-35
SLIDE 35

Example: Infinitely Often Green

Let AP = { green, red } or any other set containing the proposition

  • green. The language of words ζ = A0 A1 . . . ∈

satisfying the LT property “infinitely often green” is accepted by the NBA A depicted below. Accepting runs: , … Non accepting runs: , …

W

q q ) 1 (

n

q q ) 1 (

w

q1

W

q1

W

q0

slide-36
SLIDE 36

NBA Properties

slide-37
SLIDE 37

Constructing a NBA from a NFA

slide-38
SLIDE 38

Constructing a NBA from a NFA