• Non ci sono risultati.

Verification of infinite state systems Gabriele Puppis

N/A
N/A
Protected

Academic year: 2021

Condividi "Verification of infinite state systems Gabriele Puppis"

Copied!
25
0
0

Testo completo

(1)

Verification of infinite state systems

Gabriele Puppis

LaBRI / CNRS

(2)

Outline of the course

1 Warm-up

(transition systems, automata, logics)

2 First-order theories

(undecidability, Presburger logic, automatic structures)

3 The monadic theory of one successor

(contraction and composition methods, factorization forests)

4 The monadic theory of two successors (Rabin’s complementation, application examples)

5 The transformational approach

(interpretations, context-free and prefix-rewriting graphs, unfoldings, Caucal hierarchy, recursive program schemes)

6 Reachability via saturation

(pushdown systems, VAS / Petri nets, lossy counter machines)

(3)

Goal

Automatic verification of properties of systems.

which properties?

safety “something bad never happens”

liveness “something good eventually happens”

⎫⎪

⎪⎪

reachability

fairness “if something happens infinitely often then something else eventually happens” formulas “ ∀t. ∃t. t ≤ t∧a(t)”

which systems?

reactive “transitions enabled on the basis of input”

infinite

⎧⎪

⎪⎪

⎪⎪

⎪⎪

⎪⎪

⎪⎩

stacks (or recursion) variables

queues lists

(4)

Goal

Automatic verification of properties of systems.

which properties?

safety “something bad never happens”

liveness “something good eventually happens”

⎫⎪

⎪⎪

reachability

fairness “if something happens infinitely often then something else eventually happens”

formulas “ ∀t. ∃t. t ≤ t∧a(t)”

which systems?

reactive “transitions enabled on the basis of input”

infinite

⎧⎪

⎪⎪

⎪⎪

⎪⎪

⎪⎪

⎪⎩

stacks (or recursion) variables

queues lists

(5)

Goal

Automatic verification of properties of systems.

which properties?

safety “something bad never happens”

liveness “something good eventually happens”

⎫⎪

⎪⎪

reachability

fairness “if something happens infinitely often then something else eventually happens”

formulas “ ∀t. ∃t. t ≤ t∧a(t)” which systems?

reactive “transitions enabled on the basis of input”

infinite

⎧⎪

⎪⎪

⎪⎪

⎪⎪

⎪⎪

⎪⎩

stacks (or recursion) variables

queues lists

(6)

A ∶ repeat forever do atomically

produce produce produce

count ∶= count + 1 count ∶= count + 1 count ∶= count + 1

B ∶ repeat forever do atomically

if count > 0 then if count > 0 then if count > 0 then

consume consume consume

count ∶= count − 1 count ∶= count − 1 count ∶= count − 1

Definition

A transition system is a graph G = ((VVVaaa)a∈ Σ, (EEEbbb)b∈ ∆)where vertices are associated with labels from a finite alphabet Σ edges are associated with labels from a finite alphabet ∆

A, 0 A, 1 A, 2 . . .

B, 0 B, 1 B, 2 . . .

ε ε ε

produce produce produce

consume consume consume

(7)

A ∶ repeat forever do atomically

produce produce produce

count ∶= count + 1 count ∶= count + 1 count ∶= count + 1

B ∶ repeat forever do atomically

if count > 0 then if count > 0 then if count > 0 then

consume consume consume

count ∶= count − 1 count ∶= count − 1 count ∶= count − 1

Definition

A transition system is a graph G = ((VVVaaa)a∈ Σ, (EEEbbb)b∈ ∆)where vertices are associated with labels from a finite alphabet Σ edges are associated with labels from a finite alphabet ∆

A, 0 A, 1 A, 2 . . .

B, 0 B, 1 B, 2 . . .

ε ε ε

produce produce produce

consume consume consume

(8)

B

Bαβ

Bβα

Bββ . . .

. . .

. . .

. . . ε

ε

ε

ε

ε

ε

ε A

Aαβ

Aβα

Aββ . . .

. . .

. . .

. . . pop

α

pop β

popα

pop β

popα

popβ push

α

push β

pushα

push β

pushα

pushβ

(9)

Automata = finite transition systems

but mostly used as representations of languages

Definition

A finite state automaton is a tuple A = (Q, Σ, ∆, I , F ), where Q is a finite set of control states

Σ is a finite alphabet for transition labels

∆ ⊆ Q × Σ × Q is a finite set of transition rules I ⊆ Q is a set of initial states

F ⊆ Q is a set of final states

Example

q0 qf

a a

L (A) = a (a a)

(10)

Automata = finite transition systems

but mostly used as representations of languages

Definition

A finite state automaton is a tuple A = (Q, Σ, ∆, I , F ), where Q is a finite set of control states

Σ is a finite alphabet for transition labels

∆ ⊆ Q × Σ × Q is a finite set of transition rules I ⊆ Q is a set of initial states

F ⊆ Q is a set of final states

Example

q0 qf

a a

L (A) = a (a a)

(11)

Automata = finite transition systems

but mostly used as representations of languages

Definition

A finite state automaton is a tuple A = (Q, Σ, ∆, I , F ), where Q is a finite set of control states

Σ is a finite alphabet for transition labels

∆ ⊆ Q × Σ × Q is a finite set of transition rules I ⊆ Q is a set of initial states

F ⊆ Q is a set of final states

Example

q0 qf

a a

L (A) = a (a a)

(12)

Different types of automata:

deterministic q q1

q2 a

a implies q1 = q2

with ε-transitions q ε q

complete ∀a∀a∀a. ∀q. ∃q. q a q

B¨uchi/parity conditions q0 b qf

a, b b

(13)

Language theoretic operations on automata

union concatenation complementation

ε ε

ε

intersection projection subset construction

a b

a

a, b

a a

b

aa

×a f (a )

b b b

×f(b)

q q1

q2

a a

q

q1 q2

⋮ a

(14)

Language theoretic operations on automata

union concatenation complementation

ε ε

ε

intersection projection subset construction

a b

a

a, b

a a

b

aa

×a f (a )

b b b

×f(b)

q q1

q2

a a

q

q1 q2

⋮ a

(15)

Language theoretic operations on automata

union concatenation complementation

ε ε

ε

intersection projection subset construction

a b

a

a, b

a a

b

aa

×a f (a )

b b b

×f(b)

q q1

q2

a a

q

q1 q2

⋮ a

(16)

Problems on automata Non-emptiness L (A) ≠ ∅ iff

there is a pathfrominitial ... to finalstates

Universality

L (A) = Σ iff L (AC) = ∅ Containment

L (A) ⊆ L (B) iff L (A) ∩ L (BC) = ∅

These are simple graph search problems!

(17)

Logics for specification of properties Propositional logic

b ∨ ¬b

First-order logic

a(xxx000) ∧ ∀x .∀x .∀x . (a(x ) → b(x )) → b(x0)

Monadic second-order logic

∃Z

∃Z

∃Z . ∀x . ∃y . (Z (y )Z (y )Z (y ) ∧ y = x + 1)

(18)

Logics for specification of properties Propositional logic

b ∨ ¬b

First-order logic

a(xxx000) ∧ ∀x .∀x .∀x . (a(x ) → b(x )) → b(x0)

Monadic second-order logic

∃Z

∃Z

∃Z . ∀x . ∃y . (Z (y )Z (y )Z (y ) ∧ y = x + 1)

(19)

Logics for specification of properties Propositional logic

b ∨ ¬b

First-order logic

a(xxx000) ∧ ∀x .∀x .∀x . (a(x ) → b(x )) → b(x0)

Monadic second-order logic

∃Z

∃Z

∃Z . ∀x . ∃y . (Z (y )Z (y )Z (y ) ∧ y = x + 1)

(20)

Examples of sentences and formulas

ψdense = ∀x , y . ∃z . (x < y → x < z ∧ z < y )

´¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¸¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¶

FO[<] over Q FO[<] over Q FO[<] over Q

ψconnected = ∀Z . (∃x , y . Z (x ) ∧ ¬Z (y )) →

(∃x , y . Z (x ) ∧ ¬Z (y ) ∧ E (x , y ))

´¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¸¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¶

MSO[E] over G=(V ,E) MSO[E] over G=(V ,E) MSO[E] over G=(V ,E)

ψpath(x , y ) = ∀Z . Z (x ) ∧

∀x, y. (Z (x) ∧E (x, y) →Z (y)) → Z (y )

´¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¸¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¶

MSO[E] over G=(V ,E) MSO[E] over G=(V ,E) MSO[E] over G=(V ,E)

The underlying signature and domain are important! MSO[+1] over N

MSO[+1] over N

MSO[+1] over N = MSO[<] over NMSO[<] over NMSO[<] over N FO[0, 1, +] = Presburger arithmetic FO[0, 1, +] = Presburger arithmetic FO[0, 1, +] = Presburger arithmetic MSO over N

MSO over N

MSO over N = FO[⊆] over 2FO[⊆] over 2FO[⊆] over 2NNN

FO[∈] over models of Zermelo–Fraenkel set theory... FO[∈] over models of Zermelo–Fraenkel set theory... FO[∈] over models of Zermelo–Fraenkel set theory...

(21)

Examples of sentences and formulas

ψdense = ∀x , y . ∃z . (x < y → x < z ∧ z < y )

´¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¸¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¶

FO[<] over Q FO[<] over Q FO[<] over Q

ψconnected = ∀Z . (∃x , y . Z (x ) ∧ ¬Z (y )) →

(∃x , y . Z (x ) ∧ ¬Z (y ) ∧ E (x , y ))

´¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¸¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¶

MSO[E] over G=(V ,E) MSO[E] over G=(V ,E) MSO[E] over G=(V ,E)

ψpath(x , y ) = ∀Z . Z (x ) ∧

∀x, y. (Z (x) ∧E (x, y) →Z (y)) → Z (y )

´¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¸¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¶

MSO[E] over G=(V ,E) MSO[E] over G=(V ,E) MSO[E] over G=(V ,E)

The underlying signature and domain are important!

MSO[+1] over N MSO[+1] over N

MSO[+1] over N = MSO[<] over NMSO[<] over NMSO[<] over N FO[0, 1, +] = Presburger arithmetic FO[0, 1, +] = Presburger arithmetic FO[0, 1, +] = Presburger arithmetic MSO over N

MSO over N

MSO over N = FO[⊆] over 2FO[⊆] over 2FO[⊆] over 2NNN

FO[∈] over models of Zermelo–Fraenkel set theory...

FO[∈] over models of Zermelo–Fraenkel set theory...

FO[∈] over models of Zermelo–Fraenkel set theory...

(22)

Other examples of MSO properties

ψ3-colorability = ∃X , Y , Z . ∀v . (X (v ) ∨ Y (v ) ∨ Z (v ))

∀u, v . E (u, v ) → ¬( X (u) ∧ X (v ) ) ∧

¬(Y (u) ∧ Y (v )) ∧

¬(Z (u) ∧ Z (v ) )

ψK5(x1, ..., x5) =

i≠j(xi ≠xj ∧ ψpath(xi, xj)) ψK3,3(x1, ..., x3, y1, ..., y3) =

i≠j(xi ≠xj ∧yi ≠yj) ∧

i ,j ψpath(xi, yj) ψplanar = ¬∃x1, ..., x5. ψK5(x1, ..., x5) ∧

¬∃x1, ..., x3, y1, ..., y3. ψK33(x1, ..., x3, y1, ..., y3)

(23)

A real example

let Foo(g, h) = g(h)

if if

if [user hits key] thenthenthen g ⋅ closecloseclose(h)

else else else

Foo(g ⋅ writewritewrite, h) Foo(openopenopen, aaa)

ifif if openopenopen close close close

a a a

if ifif openopenopen write write write close close close

aa a

if ifif

⋮ ⋮

One may want to verify that all sequences of write operations occur between open and close operations:

∀Z path. ∀z ∈ Z . writewritewrite(z ) → ∃x , y ∈ Z . x < z < y ∧

openopenopen(x ) ∧ closecloseclose(y )

(24)

A real example

let Foo(g, h) = g(h)

if if

if [user hits key] thenthenthen g ⋅ closecloseclose(h)

else else else

Foo(g ⋅ writewritewrite, h) Foo(openopenopen, aaa)

ifif if openopenopen close close close

a a a

if ifif openopenopen write write write close close close

aa a

if ifif

⋮ ⋮

One may want to verify that all sequences of write operations occur between open and close operations:

∀Z path. ∀z ∈ Z . writewritewrite(z ) → ∃x , y ∈ Z . x < z < y ∧

openopenopen(x ) ∧ closecloseclose(y )

(25)

Next

Riferimenti

Documenti correlati

In this thesis we deal with two main questions concerning discrete-time polynomial dynamical systems: 1) the reachability computation problem, i.e, given a set of initial conditions

Abstract Weighted labelled transition systems (WLTSs) are an estab- lished (meta-)model aiming to provide general results and tools for a wide range of systems such

The conjecture is known to be true in its full generality in dimension 1 by Gruson-Lazarsfeld-Peskine and Giaimo; in dimension 2, it is true for smooth surfaces by Lazarsfeld;

Consequences (Church ’36, Turing ’37, Trakhtenbrot ’50, ...) The FO theory of the class of all finite structures is undecidable (provided that signature contains a binary

We can recursively factorize factors until we get single characters only a few nested factorizations a few nested factorizations a few nested factorizations (linear in ∣S ∣,

Need of non-determinism and stronger acceptance

The graphs that can be defined in the binary tree using rational restrictions and inverse finite / rational mappings are context-free / prefix-recognizable.... We just

A path connecting two sets, if exists, can be found in finitely many steps..