23.12.2013 Views

Automata-Theoretic LTL Model Checking - Faculty of Computer ...

Automata-Theoretic LTL Model Checking - Faculty of Computer ...

Automata-Theoretic LTL Model Checking - Faculty of Computer ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Formal Methods<br />

Lecture VIII: <strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong><br />

<strong>Checking</strong><br />

Vladislav Ryzhikov<br />

ryzhikov@inf.unibz.it<br />

http://www.inf.unibz.it/∼ryzhikov<br />

Slides taken from University <strong>of</strong> Trento Formal Methods Course by<br />

R.Sebastiani.<br />

<strong>Faculty</strong> <strong>of</strong> <strong>Computer</strong> Science – Free University <strong>of</strong> Bolzano<br />

1


Summary<br />

unibz.it<br />

The Problem<br />

<strong>Automata</strong> on Finite Words<br />

<strong>Automata</strong> on Infinite Words<br />

From Kripke Structures to Büchi <strong>Automata</strong><br />

From <strong>LTL</strong> Formulas to Büchi <strong>Automata</strong><br />

<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong><br />

2


The Problem<br />

unibz.it<br />

Given a Kripke structure M and an <strong>LTL</strong> specification ψ, does<br />

M satisfy ψ?<br />

M |= ψ<br />

3


<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong><br />

unibz.it<br />

M |= ψ<br />

(<strong>LTL</strong>)<br />

⇐⇒ M |= ✷ p ψ (on all paths ψ)<br />

⇐⇒ L(M) ⊆ L(ψ)<br />

⇐⇒ L(M) ∩ L(¬ψ) = {}<br />

⇐⇒ L(A M ) ∩ L(A ¬ψ ) = {}<br />

⇐⇒ L(A M × A ¬ψ ) = {}<br />

A M is a Büchi Automaton equivalent to M (which<br />

represents all and only the executions <strong>of</strong> M)<br />

A ¬ψ is a Büchi Automaton which represents all and<br />

only the paths that satisfy ¬ψ (do not satisfy ψ)<br />

=⇒ A M × A ¬ψ represents all and only the paths<br />

appearing in M and not in ψ.<br />

4


<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong><br />

unibz.it<br />

Four steps:<br />

1 Compute A M<br />

2 Compute A ϕ<br />

3 Compute the product A M × A ϕ<br />

4 Check the emptiness <strong>of</strong> L(A M × A ϕ )<br />

5


Summary<br />

unibz.it<br />

The Problem<br />

<strong>Automata</strong> on Finite Words<br />

<strong>Automata</strong> on Infinite Words<br />

From Kripke Structures to Büchi <strong>Automata</strong><br />

From <strong>LTL</strong> Formulas to Büchi <strong>Automata</strong><br />

<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong><br />

6


Finite Word Languages<br />

unibz.it<br />

Example<br />

An alphabet Σ is a collection <strong>of</strong> symbols (letters).<br />

E.g. Σ = {a, b}.<br />

A finite word is a finite sequence <strong>of</strong> letters. (E.g. aabb.)<br />

The set <strong>of</strong> all finite words is denoted by Σ ∗ .<br />

A language U is a set <strong>of</strong> words, i.e. U ⊆ Σ ∗ .<br />

Words over Σ = {a, b} with equal number <strong>of</strong> a’s and b’s. (E.g.<br />

aabb or abba.)<br />

Language recognition problem. Determine whether a word belongs<br />

to a language.<br />

<strong>Automata</strong> are computational devices able to solve language<br />

recognition problems.<br />

7


Finite State <strong>Automata</strong><br />

unibz.it<br />

Basic model <strong>of</strong> computational systems with finite memory.<br />

Widely applicable<br />

Embedded System Controllers.<br />

Languages: Ester-el, Lustre, Verilog.<br />

Synchronous Circuits.<br />

Regular Expression Pattern Matching<br />

Grep, Lex, Emacs.<br />

Protocols<br />

Network Protocols<br />

Architecture: Bus, Cache Coherence, Telephony,...<br />

8


Notation<br />

unibz.it<br />

a, b ∈ Σ finite alphabet.<br />

u, v, w ∈ Σ ∗ finite words.<br />

λ empty word.<br />

u.v catenation.<br />

u i = u.u. .u repeated i-times.<br />

U, V ⊆ Σ ∗ finite word languages.<br />

9


FSA Definition<br />

unibz.it<br />

Definition (Nondeterministic Finite State Automaton (NFA))<br />

NFA is (Q, Σ, δ, I , F ) where<br />

Q finite set <strong>of</strong> states<br />

I ⊆ Q set <strong>of</strong> initial states<br />

F ⊆ Q set <strong>of</strong> final states<br />

→⊆ Q × Σ × Q transition relation (edges)<br />

We use q<br />

a −→ q ′ to denote (q, a, q ′ ) ∈ δ.<br />

Definition (Deterministic Finite State Automaton (DFA))<br />

DFA is NFA with<br />

δ : Q × Σ → Q a total function<br />

Single initial state I = {q 0 }<br />

10


Regular Languages<br />

unibz.it<br />

A run <strong>of</strong> NFA A on u = a 0 , a 1 , . . . , a n−1 is a finite sequence<br />

a<br />

<strong>of</strong> states q 0 , q 1 , . . . , q n s.t. q 0 ∈ I and q<br />

i<br />

i −→ qi+1 for<br />

0 ≤ i < n.<br />

An accepting run is one where the last state q n ∈ F .<br />

The language accepted by A<br />

L(A) = {u ∈ Σ ∗ | A has an accepting run on u}<br />

The languages accepted by a NFA are called regular<br />

languages.<br />

11


Finite State <strong>Automata</strong><br />

unibz.it<br />

Let Σ = {a, b}<br />

Example<br />

DFA A 1 recognizes words which do not end in b<br />

a b b<br />

Example<br />

s 1<br />

s 2<br />

a<br />

NFA A 2 recognizes words which end in b<br />

a,b<br />

b<br />

s 1<br />

s 2<br />

b<br />

12


Determinisation<br />

unibz.it<br />

Theorem (Determinisation)<br />

Given a NFA A we can construct a DFA A ′ s.t. L(A) = L(A ′ ).<br />

Size |A ′ | = 2 O(|A|) .<br />

13


Determinisation [cont.]<br />

unibz.it<br />

Example<br />

NFA A 2 : Words which end in b.<br />

a,b<br />

b<br />

s 1<br />

s<br />

b 2<br />

A 2 can be determinised into the automaton DA 2 below.<br />

a b b<br />

s 1<br />

s 1<br />

,s 2<br />

a<br />

Study Topic There are NFA’s <strong>of</strong> size n for which the size <strong>of</strong> the<br />

minimum sized DFA must have size O(2 n ).<br />

14


Closure Properties<br />

unibz.it<br />

Theorem (Boolean Closure)<br />

Given NFA A 1 , A 2 over Σ we can construct NFA A over Σ s.t.<br />

L(A) = L(A 1 ) (Complement). |A| = 2 O(|A1|) .<br />

L(A) = L(A 1 ) ∪ L(A 2 ) (Union). |A| = |A 1 | + |A 2 |.<br />

L(A) = L(A 1 ) ∩ L(A 2 ) (Intersection). |A| = |A 1 | · |A 2 |.<br />

15


Complementation <strong>of</strong> a NFA<br />

unibz.it<br />

A NFA A = (Q, Σ, δ, I , F ) is complemented by:<br />

determinizing it into a DFA A ′ = (Q ′ , Σ ′ , δ ′ , I ′ , F ′ )<br />

complementing it: A ′ = (Q ′ , Σ ′ , δ ′ , I ′ , F ′ )<br />

|A ′ | = |A ′ | = 2 O(|A 1|)<br />

16


Union <strong>of</strong> two NFA’s<br />

unibz.it<br />

Two NFA’s A 1 = (Q 1 , Σ 1 , δ 1 , I 1 , F 1 ), A 2 = (Q 2 , Σ 2 , δ 2 , I 2 , F 2 ),<br />

A = A 1 ∪ A 2 = (Q, Σ, δ, I , F ) is defined as follows<br />

Q := Q 1 ∪ Q 2 , I := I 1 ∪ I 2 , F := F 1 ∪ F 2<br />

A is an automaton which just runs nondeterministically either<br />

A 1 or A 2<br />

L(A) = L(A 1 ) ∪ L(A 2 )<br />

|A| = |A 1 | + |A 2 |<br />

17


Synchronous Product Construction<br />

unibz.it<br />

Let A 1 = (Q 1 , Σ, δ 1 , I 1 , F 1 ) and A 2 = (Q 2 , Σ, δ 2 , I 2 , F 2 ). Then,<br />

A 1 × A 2 = (Q, Σ, δ, I , F ) where<br />

Q = Q 1 × Q 2 . I = I 1 × I 2 .<br />

F = F 1 × F 2 .<br />

< p, q > −→< a p ′ , q ′ > iff p<br />

a −→ p ′ and q<br />

a −→ q ′ .<br />

Theorem<br />

L(A 1 × A 2 ) = L(A 1 ) ∩ L(A 2 )<br />

18


Synchronous Product Construction (Cont.)<br />

unibz.it<br />

Example<br />

a<br />

b<br />

s 0<br />

t 0<br />

b b b a a<br />

b<br />

a t 1<br />

s 1<br />

a<br />

A 1 recognizes words with A 2 recognizes words with<br />

an even number <strong>of</strong> b a number <strong>of</strong> a mod 3 = 0<br />

t 2<br />

The Product Automaton A 1 × A 2 with F = {s 0 , t 0 }.<br />

b<br />

s s t 0<br />

t 0<br />

1 0<br />

b<br />

a a a a<br />

a<br />

s0 t<br />

s 0<br />

t a<br />

1<br />

t 1<br />

2<br />

s1 t s 1 2<br />

b<br />

b<br />

b<br />

b<br />

19


Decision Problems<br />

unibz.it<br />

Theorem (Emptiness)<br />

Given a NFA A we can decide whether L(A) = ∅.<br />

Method: Forward/Backward Reachability <strong>of</strong> acceptance states in<br />

Automaton graph. Complexity is O(|Q| + |δ|).<br />

Theorem (Language Containment)<br />

Given NFA A 1 and A 2 we can decide whether L(A 1 ) ⊆ L(A 2 ).<br />

Method: L(A 1 ) ⊆ L(A 2 ) iff L(A 1 ) ∩ L(A 2 ) = ∅. Complexity is<br />

O(|A 1 | · 2 |A 2| ).<br />

20


Regular Expressions<br />

unibz.it<br />

Syntax: ∅ | ɛ | a | reg 1 .reg 2 | reg 1 + reg 2 | reg ∗ .<br />

Every regular expression reg denotes a language L(reg).<br />

Example<br />

(a ∗ .(b + bb).a ∗ . The words with either 1 b or 2 consecutive b’s<br />

Theorem<br />

For every regular expression reg we can construct a language<br />

equivalent NFA <strong>of</strong> size O(|reg|).<br />

Theorem<br />

For every DFA A we can construct a language equivalent regular<br />

expression reg(A).<br />

21


Infinite Word Languages<br />

unibz.it<br />

<strong>Model</strong>ing infinite computations <strong>of</strong> reactive systems.<br />

Example<br />

An ω-word α over Σ is infinite sequence<br />

a 0 , a 1 , a 2 . . ..<br />

Formally, α : N ↦→ Σ.<br />

The set <strong>of</strong> all infinite words is denoted by Σ ω .<br />

A ω-language L is collection <strong>of</strong> ω-words, i.e. L ⊆ Σ ω .<br />

All words over {a, b} with infinitely many a’s.<br />

Notation:<br />

omega words α, β, γ ∈ Σ ω .<br />

omega-languages L, L 1 ⊆ Σ ω<br />

For u ∈ Σ + , let u ω = u.u.u . . .<br />

22


Summary<br />

unibz.it<br />

The Problem<br />

<strong>Automata</strong> on Finite Words<br />

<strong>Automata</strong> on Infinite Words<br />

From Kripke Structures to Büchi <strong>Automata</strong><br />

From <strong>LTL</strong> Formulas to Büchi <strong>Automata</strong><br />

<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong><br />

23


Omega-<strong>Automata</strong><br />

unibz.it<br />

We consider automaton runs over infinite words.<br />

Example<br />

a,b<br />

s 1<br />

s 2<br />

b<br />

b<br />

Let α = aabbbb . . .. There are several possible runs.<br />

Run ρ 1 = s 1 , s 1 , s 1 , s 1 , s 2 , s 2 . . .<br />

Run ρ 2 = s 1 , s 1 , s 1 , s 1 , s 1 , s 1 . . .<br />

Acceptance Conditions: Büchi, (Muller, Rabin, Street).<br />

Acceptance is based on states occurring infinitely<br />

<strong>of</strong>ten<br />

Notation: Let ρ ∈ Q ω . Then,<br />

Inf (ρ) = {s ∈ Q | ∃ ∞ i ∈ N. ρ(i) = s}.<br />

24


Büchi <strong>Automata</strong><br />

unibz.it<br />

Definition (Nondeterministic Büchi Automaton)<br />

A = (Q, Σ, δ, I , F ), where F ⊆ Q is the set <strong>of</strong> accepting states.<br />

A run ρ <strong>of</strong> A on omega word α is an infinite sequence<br />

a<br />

ρ = q o , q 1 , q 2 , . . . s.t. q 0 ∈ I and q<br />

i<br />

i −→ qi+1 for 0 ≤ i.<br />

The run ρ is accepting if<br />

Inf (ρ) ∩ F ≠ ∅.<br />

The language accepted by A<br />

L(A) = {α ∈ Σ ω | A has an accepting run on α}<br />

25


Büchi Automaton: Example<br />

unibz.it<br />

Let Σ = {a, b}.<br />

Example<br />

Deterministic Büchi Automaton (DBA) A 1<br />

a b b<br />

s 1<br />

s 2<br />

With F = {s 1 } the automaton recognizes words with<br />

infinitely many a’s.<br />

a<br />

26


Büchi Automaton: Example (2)<br />

unibz.it<br />

Example<br />

NBA A 2<br />

a,b<br />

b<br />

s 1<br />

s 2<br />

b<br />

With F = {s 2 }, automaton A 2 recognizes words with finitely<br />

many a.<br />

Thus, L(A 2 ) = L(A 1 ).<br />

27


Deterministic vs. Nondeterministic Büchi <strong>Automata</strong><br />

unibz.it<br />

Theorem<br />

DBA’s are strictly less powerful than NBA’s.<br />

28


Closure Properties<br />

unibz.it<br />

Theorem (union, intersection)<br />

For the NBA’s A 1 , A 2 we can construct<br />

– the NBA A s.t. L(A) = L(A 1 ) ∪ L(A 2 ). |A| = |A 1 | + |A 2 |<br />

– the NBA A s.t. L(A) = L(A 1 ) ∩ L(A 2 ). |A| = |A 1 | · |A 2 | · 2.<br />

29


Union <strong>of</strong> two NBA’s<br />

unibz.it<br />

Two NBA’s A 1 = (Q 1 , Σ 1 , δ 1 , I 1 , F 1 ), A 2 = (Q 2 , Σ 2 , δ 2 , I 2 , F 2 ),<br />

A = A 1 ∪ A 2 = (Q, Σ, δ, I , F ) is defined as follows<br />

Q := Q 1 ∪ Q 2 , I := I 1 ∪ I 2 , F := F 1 ∪ F 2<br />

A is an automaton which just runs nondeterministically either<br />

A 1 or A 2<br />

L(A) = L(A 1 ) ∪ L(A 2 )<br />

|A| = |A 1 | + |A 2 |<br />

(same construction as with ordinary automata)<br />

30


Synchronous Product <strong>of</strong> NBA’s<br />

unibz.it<br />

Let A 1 = (Q 1 , Σ, δ 1 , I 1 , F 1 ) and A 2 = (Q 2 , Σ, δ 2 , I 2 , F 2 ).<br />

Then, A 1 × A 2 = (Q, Σ, δ, I , F ), where<br />

Q = Q 1 × Q 2 × {1, 2}.<br />

I = I 1 × I 2 × {1}.<br />

F = F 1 × Q 2 × {1}.<br />

< p, q, 1 > −→< a p ′ , q ′ , 1 > iff p −→ a p ′ and q −→ a q ′ and p ∉ F 1 .<br />

< p, q, 1 > −→< a p ′ , q ′ , 2 > iff p −→ a p ′ and q −→ a q ′ and p ∈ F 1 .<br />

< p, q, 2 > −→< a p ′ , q ′ , 2 > iff p −→ a p ′ and q −→ a q ′ and q ∉ F 2 .<br />

< p, q, 2 > −→< a p ′ , q ′ , 1 > iff p −→ a p ′ and q −→ a q ′ and q ∈ F 2 .<br />

Theorem<br />

L(A 1 × A 2 ) = L(A 1 ) ∩ L(A 2 )<br />

31


Product <strong>of</strong> NBA’s: Intuition<br />

unibz.it<br />

The automaton remembers two tracks, one for each source<br />

NBA, and it points to one <strong>of</strong> the two tracks<br />

As soon as it goes through an accepting state <strong>of</strong> the current<br />

track, it switches to the other track<br />

thus to visit infinitely <strong>of</strong>ten a state in F (i.e., F 1 ), it must visit<br />

infinitely <strong>of</strong>ten some state also in F 2<br />

Important subcase: If F 2 = Q 2 , then<br />

Q = Q 1 × Q 2 .<br />

I = I 1 × I 2 .<br />

F = F 1 × Q 2 .<br />

32


Product <strong>of</strong> NBA’s: Example<br />

a<br />

b<br />

unibz.it<br />

s 0<br />

t 0<br />

b b b a a<br />

b<br />

a t 1<br />

s 1<br />

a<br />

t 2<br />

s s t 0<br />

t 0 1<br />

1 0 1<br />

b<br />

b<br />

a a<br />

s0 t s 0<br />

t a<br />

1 1 s1 1 s 1<br />

t 1 1<br />

21<br />

t 2<br />

1 to 2<br />

2 to 1<br />

a<br />

a<br />

b<br />

s 0<br />

t 0 2<br />

a<br />

b<br />

b<br />

s 1<br />

t 0<br />

a<br />

a<br />

a<br />

a<br />

s0 t s 0<br />

t a<br />

1<br />

t 1<br />

22<br />

2 s1 t s 1 2<br />

2 2<br />

b<br />

b<br />

b<br />

b<br />

b<br />

b<br />

b TRACK 1<br />

a<br />

TRACK 2<br />

2<br />

33


Closure Properties (2)<br />

unibz.it<br />

Theorem (Complementation)<br />

For the NBA A 1 we can construct an NBA A 2 such that<br />

L(A 2 ) = L(A 1 ).<br />

Corollary<br />

|A 2 | = O(2 |A 1|·log(|A 1 |) )<br />

Method:<br />

1 Convert a Büchi automaton into a Non-Deterministic Rabin<br />

automaton.<br />

2 Determinize and Complement the Rabin automaton<br />

3 Convert the Rabin automaton into a Büchi automaton<br />

34


Generalized Büchi Automaton<br />

unibz.it<br />

A Generalized Büchi Automaton is A := (Q, Σ, δ, I , FT ) where<br />

FT = < F 1 , F 2 , . . . , F k > with F i ⊆ Q.<br />

A run ρ <strong>of</strong> A is accepting if Inf (ρ) ∩ F i ≠ ∅ for each 1 ≤ i ≤ k.<br />

Theorem<br />

For every Generalized Büchi Automaton (A, FT ) we can construct<br />

a language equivalent Büchi Automaton (A ′ , G ′ ).<br />

Pro<strong>of</strong>.<br />

(Construction) Let Q ′ = Q × {1, . . . , k}.<br />

Automaton remains in i phase till it visits a state in F i . Then, it<br />

moves to i + 1 mode. After phase k it moves to phase 1.<br />

Size: |A ′ | ≤ |A| · k.<br />

35


Omega Regular Expressions<br />

unibz.it<br />

A language is called ω-regular if it has the form ∪ n i=1<br />

where U i , V i are regular languages.<br />

Theorem<br />

A language L is ω-regular iff it is NBA-recognizable.<br />

U i.(V i ) ω<br />

36


Decision Problem<br />

unibz.it<br />

Theorem (Emptiness)<br />

For a NBA A, it is decidable whether L(A) = ∅.<br />

Method<br />

Find the maximal strongly connected components (MSCC) in<br />

the graph <strong>of</strong> A (disregarding the edge labels).<br />

A MSCC C is called non-trivial if C ∩ F ≠ ∅ and C has at<br />

least one edge.<br />

Find all nodes from which there is a path to a non-trivial<br />

SCC. Call the set <strong>of</strong> these nodes as N.<br />

L(A) = ∅ iff N ∩ I = ∅.<br />

Time Complexity: O(|Q| + |δ|).<br />

37


Summary<br />

unibz.it<br />

The Problem<br />

<strong>Automata</strong> on Finite Words<br />

<strong>Automata</strong> on Infinite Words<br />

From Kripke Structures to Büchi <strong>Automata</strong><br />

From <strong>LTL</strong> Formulas to Büchi <strong>Automata</strong><br />

<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong><br />

38


Computing a NBA from a Kripke Structure<br />

unibz.it<br />

Transforming a K.S. M = 〈S, S 0 , R, L, AP〉 into an NBA<br />

A M = 〈Q, Σ, δ, I , F 〉 s.t.:<br />

States: Q := S ∪ {init}, init being a new initial state<br />

Alphabet: Σ := 2 AP<br />

Initial State: I := {init}<br />

Accepting States: F := Q = S ∪ {init}<br />

Transitions:<br />

δ : q −→ a<br />

q ′ iff (q, q ′ ) ∈ R and L(q ′ ) = a<br />

a<br />

init −→ q iff q ∈ S 0 and L(q) = a<br />

L(A M ) = L(M)<br />

|A M | = |M| + 1<br />

39


Computing a NBA from a Kripke Structure: Example<br />

unibz.it<br />

Substantially, add one initial state, move labels from states to<br />

incoming edges, set all states as accepting states<br />

40


Computing a NBA from a Fair Kripke Structure<br />

unibz.it<br />

Transforming a fair K.S. M = 〈S, S 0 , R, L, AP, FT 〉,<br />

FT = {F 1 , ..., F n }, into an NBA A M = 〈Q, Σ, δ, I , F 〉 s.t.:<br />

States: Q := S ∪ {init}, init being a new initial state<br />

Alphabet: Σ := 2 AP<br />

Initial State: I := {init}<br />

Accepting States: F := FT<br />

Transitions:<br />

δ : q −→ a<br />

q ′ iff (a, a ′ ) ∈ R and L(q ′ ) = a<br />

a<br />

init −→ q iff q ∈ S 0 and L(q ′ ) = a<br />

L(A M ) = L(M)<br />

|A M | = |M| + 1<br />

41


Summary<br />

unibz.it<br />

The Problem<br />

<strong>Automata</strong> on Finite Words<br />

<strong>Automata</strong> on Infinite Words<br />

From Kripke Structures to Büchi <strong>Automata</strong><br />

From <strong>LTL</strong> Formulas to Büchi <strong>Automata</strong><br />

<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong><br />

42


Paths as ω-words<br />

unibz.it<br />

NB We consider <strong>LTL</strong> formulas with operators ¬, ∨, ○, U only.<br />

Let ϕ be an <strong>LTL</strong> formula.<br />

Example<br />

Var(ϕ) denotes the set <strong>of</strong> free variables <strong>of</strong> ϕ.<br />

E.g. Var(p ∧ (¬q U q)) = {p, q}.<br />

Let Σ := 2 Var(ϕ) .<br />

⇒ a model for ϕ is an ω-word α = a 0 , a 1 , . . . in Σ ω .<br />

We can define α, i |= ϕ. Also, α |= ϕ iff α, 0 |= ϕ.<br />

A model <strong>of</strong> p ∧ (¬q U q) is the ω-word<br />

{p}, {}, {q}, {p, q} ω .<br />

N.B.: correspondence between ω-words and paths in Kripke<br />

structures:<br />

α, i |= ϕ ⇐⇒ π, s i |= ϕ, α, 0 |= ϕ ⇐⇒ π, s 0 |= ϕ<br />

43


<strong>Automata</strong> for <strong>LTL</strong> model checking<br />

unibz.it<br />

Let Mod(ϕ) denote the set <strong>of</strong> models <strong>of</strong> ϕ.<br />

Theorem<br />

For any <strong>LTL</strong> formula ϕ, the set Mod(ϕ) is omega-regular.<br />

Pro<strong>of</strong>.<br />

Construct a NBA A ϕ such that Mod(ϕ) = L(A ϕ ).<br />

44


Closures<br />

unibz.it<br />

Closure Given ϕ ∈ <strong>LTL</strong>, let CL ′ (ϕ) be the smallest set s.t.<br />

ϕ ∈ CL ′ (ϕ).<br />

If ¬ϕ 1 ∈ CL ′ (ϕ) then ϕ 1 ∈ CL ′ (ϕ).<br />

If ϕ 1 ∨ ϕ 2 ∈ CL ′ (ϕ) then ϕ 1 , ϕ 2 ∈ CL ′ (ϕ).<br />

If ○ϕ 1 ∈ CL ′ (ϕ) then ϕ 1 ∈ CL ′ (ϕ).<br />

If (ϕ 1 U ϕ 2 ) ∈ CL ′ (ϕ) then ϕ 1 , ϕ 2 ∈ CL ′ (ϕ) and<br />

○(ϕ 1 U ϕ 2 ) ∈ CL ′ (ϕ)<br />

CL(ϕ) := {ϕ 1 , ¬ϕ 1 | ϕ 1 ∈ CL ′ (ϕ)} (we identify ¬¬ϕ 1 with ϕ 1 .)<br />

N.B.: |CL(ϕ)| = O(|ϕ|).<br />

45


Atoms<br />

unibz.it<br />

An Atom is a maximal consistent subset <strong>of</strong> CL(ϕ).<br />

Definition<br />

A set A ⊆ CL(ϕ) is called an atom if<br />

For all ϕ 1 ∈ CL(ϕ), we have ϕ 1 ∈ A iff ¬ϕ 1 /∈ A.<br />

For all ϕ 1 ∨ ϕ 2 ∈ CL(ϕ), we have ϕ 1 ∨ ϕ 2 ∈ A iff ϕ 1 ∈ A or<br />

ϕ 2 ∈ A (or both).<br />

For all (ϕ 1 U ϕ 2 ) ∈ CL(ϕ), we have (ϕ 1 U ϕ 2 ) ∈ A iff ϕ 2 ∈ A<br />

or (ϕ 1 ∈ A and ○(ϕ 1 U ϕ 2 ) ∈ A).<br />

Essentially, an atom is a consistent truth assignment to the<br />

elementary subformulas <strong>of</strong> ϕ<br />

We call Atoms(ϕ) the set <strong>of</strong> all atoms <strong>of</strong> ϕ.<br />

46


Definition <strong>of</strong> A ϕ<br />

unibz.it<br />

For an <strong>LTL</strong> formula ϕ, we construct a Generalized NBA<br />

A ϕ = (Q, Σ, δ, Q 0 , FT ) as follows:<br />

Σ = 2 vars(ϕ)<br />

Q = Atoms(ϕ), the set <strong>of</strong> atoms.<br />

δ is s.t., for q, q ′ ∈ Atoms(ϕ) and a ∈ Σ, q −→ a q ′ holds in δ<br />

iff<br />

q ∩ Var(ϕ) = a,<br />

for all ○ϕ 1 ∈ CL(ϕ), we have ○ϕ 1 ∈ q iff ϕ 1 ∈ q ′ .<br />

Q 0<br />

= {q ∈ Atoms(ϕ) | ϕ ∈ q}.<br />

FT = (F 1 , F 2 , . . . , F k ) where, for all (ψ i U ϕ i ) occurring<br />

positively in ϕ,<br />

F i = {q ∈ Atoms(ϕ) | (ψ i U ϕ i ) /∈ q or ϕ i ∈ q}.<br />

47


Definition <strong>of</strong> A ϕ [cont.]<br />

unibz.it<br />

Theorem<br />

Let α = a 0 , a 1 , . . . ∈ Σ ω . Then, α |= ϕ iff α ∈ L(A ϕ ).<br />

Size: |A ϕ | = O(2 |ϕ| ).<br />

48


Example<br />

Let φ = p U q, then<br />

CL ′ = {p, q, p U q, ○(p U q)<br />

CL = {p, q, p U q, ○(p U q), ¬p, ¬q, ¬p U q, ¬○(p U q)<br />

Atoms = {1 :{p, q, p U q, ○(p U q)},<br />

2 :{¬p, q, p U q, ○(p U q)},<br />

3 :{p, ¬q, p U q, ○(p U q)},<br />

4 :{¬p, ¬q, p U q, ¬○(p U q)},<br />

5 :{¬p, ¬q, ¬p U q, ○(p U q)},<br />

6 :{p, q, p U q, ¬○(p U q)},<br />

7 :{p, ¬q, ¬p U q, ¬○(p U q)},<br />

8 :{¬p, ¬q, ¬p U q, ¬○(p U q)}}<br />

unibz.it<br />

Q 0 = {s | (p U q) ∈ s} = {1, 2, 3, 4, 6}<br />

σ ∋{φ p , φ q , φ pUq , ○(p U q)} {φp,φq}<br />

−→ {ψ p , ψ q , p U q, ψ ○(pUq) },<br />

{φ p , φ q , φ pUq , ¬○(p U q)} {φp,φq}<br />

−→ {ψ p , ψ q , ¬p U q, ψ ○(pUq) }<br />

F 1 = {s | (p U q) ∉ s or q ∈ s} = {1, 2, 4, 5, 6, 7, 8}<br />

49


Example (cont.)<br />

unibz.it<br />

50


Role <strong>of</strong> Acceptance Conditions<br />

unibz.it<br />

Example<br />

σ alone does not guarantee that p U q is “fulfilled”<br />

State 3 with {p, ¬q, p U q, ○(p U q)}<br />

Although p U q holds in state 3, the path which loops forever<br />

in state 3 does not satisfy φ = p U q as q never holds in that<br />

path<br />

That’s why 3 is not an accepting state in F 1 . But any path<br />

going infinitely through a state in F 1 “fulfills” p U q<br />

51


Summary<br />

unibz.it<br />

The Problem<br />

<strong>Automata</strong> on Finite Words<br />

<strong>Automata</strong> on Infinite Words<br />

From Kripke Structures to Büchi <strong>Automata</strong><br />

From <strong>LTL</strong> Formulas to Büchi <strong>Automata</strong><br />

<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong><br />

52


<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong><br />

unibz.it<br />

Four steps:<br />

1 Compute A M<br />

2 Compute A ϕ<br />

3 Compute the product A M × A ϕ<br />

4 Check the emptiness <strong>of</strong> L(A M × A ϕ )<br />

53


<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong>: complexity<br />

unibz.it<br />

Four steps:<br />

1 Compute A M : |A M | = O(|M|)<br />

2 Compute A ϕ<br />

3 Compute the product A M × A ϕ<br />

4 Check the emptiness <strong>of</strong> L(A M × A ϕ )<br />

54


<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong>: complexity [cont.]<br />

Four steps:<br />

1 Compute A M : |A M | = O(|M|)<br />

2 Compute A ϕ : |A ϕ | = O(2 |ϕ| )<br />

3 Compute the product A M × A ϕ<br />

4 Check the emptiness <strong>of</strong> L(A M × A ϕ )<br />

55


<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong>: complexity [cont.]<br />

Four steps:<br />

1 Compute A M : |A M | = O(|M|)<br />

2 Compute A ϕ : |A ϕ | = O(2 |ϕ| )<br />

3 Compute the product A M × A ϕ :<br />

|A M × A ϕ | = |A M | · |A ϕ | = O(|M| · 2 |ϕ| )<br />

4 Check the emptiness <strong>of</strong> L(A M × A ϕ )<br />

56


<strong>Automata</strong>-<strong>Theoretic</strong> <strong>LTL</strong> <strong>Model</strong> <strong>Checking</strong>: complexity [cont.]<br />

Four steps:<br />

1 Compute A M : |A M | = O(|M|)<br />

2 Compute A ϕ : |A ϕ | = O(2 |ϕ| )<br />

3 Compute the product A M × A ϕ :<br />

|A M × A ϕ | = |A M | · |A ϕ | = O(|M| · 2 |ϕ| )<br />

4 Check the emptiness <strong>of</strong> L(A M × A ϕ ):<br />

O(|A M × A ϕ |) = O(|M| · 2 |ϕ| )<br />

⇒ the complexity <strong>of</strong> <strong>LTL</strong> M.C. grows linearly wrt. the size <strong>of</strong> the<br />

model M and exponentially wrt. the size <strong>of</strong> the property ϕ<br />

57


Final Remarks<br />

unibz.it<br />

Büchi automata are in general more expressive than <strong>LTL</strong>!<br />

Some tools (e.g., Spin, ObjectGEODE) allow specifications to<br />

be expressed directly as NBA’s<br />

for every <strong>LTL</strong> formula, there are many possible equivalent<br />

NBA’s<br />

lots <strong>of</strong> research for finding “the best” conversion algorithm<br />

performing the product and checking emptiness very relevant<br />

lots <strong>of</strong> techniques developed (e.g., partial order reduction)<br />

lots on ongoing research<br />

58

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!