• Non ci sono risultati.

Introduction to Formal Methods Chapter 06: Fair CTL Model Checking

N/A
N/A
Protected

Academic year: 2021

Condividi "Introduction to Formal Methods Chapter 06: Fair CTL Model Checking"

Copied!
71
0
0

Testo completo

(1)

Introduction to Formal Methods Chapter 06: Fair CTL Model Checking

Roberto Sebastiani and Stefano Tonetta

DISI, Università di Trento, Italy – roberto.sebastiani@unitn.it URL: http://disi.unitn.it/rseba/DIDATTICA/fm2020/

Teaching assistant: Enrico Magnago – enrico.magnago@unitn.it

CDLM in Informatica, academic year 2019-2020

last update: Monday 18thMay, 2020, 14:48

Copyright notice: some material (text, figures) displayed in these slides is courtesy of R. Alur, M. Benerecetti, A. Cimatti, M.

Di Natale, P. Pandya, M. Pistore, M. Roveri, and S.Tonetta, who detain its copyright. Some exampes displayed in these slides are taken from [Clarke, Grunberg & Peled, “Model Checking”, MIT Press], and their copyright is detained by the authors. All the other material is copyrighted by Roberto Sebastiani. Every commercial use of this material is strictly forbidden by the copyright laws without the authorization of the authors. No copy of these slides can be displayed in public

(2)

Outline

1 Fair CTL Model Checking: Generalities

2 Checking Fair EG (Explicit-State)

3 Checking Fair EG (Symbolic)

(3)

Fair CTL Model Checking: Generalities

Outline

1 Fair CTL Model Checking: Generalities

2 Checking Fair EG (Explicit-State)

3 Checking Fair EG (Symbolic)

(4)

Fair CTL Model Checking: Generalities

Fairness/Justice

An event E occurs infinitely often. Example:

Let R i be true iff the process i is running.

Fairness: every process runs infinitely often.

^

i

GFR i

(It is often used as condition for other properties.) You cannot express the condition in CTL:

GFφ = AGAFφ,

but (GFφ) → ψ 6= (AGAFφ) → ψ, because FGφ

0

6= EFEGφ

0

.

There is no CTL formula equivalent to FGφ

(FGφ 6= AFAGφ and FGφ 6= EFEGφ).

(5)

Fair CTL Model Checking: Generalities

Fairness/Justice

An event E occurs infinitely often. Example:

Let R i be true iff the process i is running.

Fairness: every process runs infinitely often.

^

i

GFR i

(It is often used as condition for other properties.) You cannot express the condition in CTL:

GFφ = AGAFφ,

but (GFφ) → ψ 6= (AGAFφ) → ψ, because FGφ

0

6= EFEGφ

0

.

There is no CTL formula equivalent to FGφ

(FGφ 6= AFAGφ and FGφ 6= EFEGφ).

(6)

Fair CTL Model Checking: Generalities

Fairness/Justice

An event E occurs infinitely often. Example:

Let R i be true iff the process i is running.

Fairness: every process runs infinitely often.

^

i

GFR i

(It is often used as condition for other properties.) You cannot express the condition in CTL:

GFφ = AGAFφ,

but (GFφ) → ψ 6= (AGAFφ) → ψ, because FGφ

0

6= EFEGφ

0

.

There is no CTL formula equivalent to FGφ

(FGφ 6= AFAGφ and FGφ 6= EFEGφ).

(7)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

Let M be the KS M = hS, S 0 , R, L, APi and M f the fair version M f = hS, S 0 , R, L, AP, FT i, FT = {F 1 , ..., F n }.

A path is fair iff it visits every F i infinitely often.

Fair CTL model checking restricts the path quantifiers to fair paths:

M

f

, s

i

|= Aφ iff π |= φ for every fair path π = s

i

, s

i+1

, ...

M

f

, s

i

|= Eφ iff π |= φ for some fair path π = s

i

, s

i+1

, ...

We introduce A f and E f , the restricted versions of the quantifiers A and E:

M

f

, s |= Aφ iff M, s |= A

f

φ M

f

, s |= Eφ iff M, s |= E

f

φ

Fair state: a state from which at least one fair path originates, that

is, a state s is a fair state in M f iff M f , s |= EGtrue.

(8)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

Let M be the KS M = hS, S 0 , R, L, APi and M f the fair version M f = hS, S 0 , R, L, AP, FT i, FT = {F 1 , ..., F n }.

A path is fair iff it visits every F i infinitely often.

Fair CTL model checking restricts the path quantifiers to fair paths:

M

f

, s

i

|= Aφ iff π |= φ for every fair path π = s

i

, s

i+1

, ...

M

f

, s

i

|= Eφ iff π |= φ for some fair path π = s

i

, s

i+1

, ...

We introduce A f and E f , the restricted versions of the quantifiers A and E:

M

f

, s |= Aφ iff M, s |= A

f

φ M

f

, s |= Eφ iff M, s |= E

f

φ

Fair state: a state from which at least one fair path originates, that

is, a state s is a fair state in M f iff M f , s |= EGtrue.

(9)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

Let M be the KS M = hS, S 0 , R, L, APi and M f the fair version M f = hS, S 0 , R, L, AP, FT i, FT = {F 1 , ..., F n }.

A path is fair iff it visits every F i infinitely often.

Fair CTL model checking restricts the path quantifiers to fair paths:

M

f

, s

i

|= Aφ iff π |= φ for every fair path π = s

i

, s

i+1

, ...

M

f

, s

i

|= Eφ iff π |= φ for some fair path π = s

i

, s

i+1

, ...

We introduce A f and E f , the restricted versions of the quantifiers A and E:

M

f

, s |= Aφ iff M, s |= A

f

φ M

f

, s |= Eφ iff M, s |= E

f

φ

Fair state: a state from which at least one fair path originates, that

is, a state s is a fair state in M f iff M f , s |= EGtrue.

(10)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

Let M be the KS M = hS, S 0 , R, L, APi and M f the fair version M f = hS, S 0 , R, L, AP, FT i, FT = {F 1 , ..., F n }.

A path is fair iff it visits every F i infinitely often.

Fair CTL model checking restricts the path quantifiers to fair paths:

M

f

, s

i

|= Aφ iff π |= φ for every fair path π = s

i

, s

i+1

, ...

M

f

, s

i

|= Eφ iff π |= φ for some fair path π = s

i

, s

i+1

, ...

We introduce A f and E f , the restricted versions of the quantifiers A and E:

M

f

, s |= Aφ iff M, s |= A

f

φ M

f

, s |= Eφ iff M, s |= E

f

φ

Fair state: a state from which at least one fair path originates, that

is, a state s is a fair state in M f iff M f , s |= EGtrue.

(11)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

Let M be the KS M = hS, S 0 , R, L, APi and M f the fair version M f = hS, S 0 , R, L, AP, FT i, FT = {F 1 , ..., F n }.

A path is fair iff it visits every F i infinitely often.

Fair CTL model checking restricts the path quantifiers to fair paths:

M

f

, s

i

|= Aφ iff π |= φ for every fair path π = s

i

, s

i+1

, ...

M

f

, s

i

|= Eφ iff π |= φ for some fair path π = s

i

, s

i+1

, ...

We introduce A f and E f , the restricted versions of the quantifiers A and E:

M

f

, s |= Aφ iff M, s |= A

f

φ M

f

, s |= Eφ iff M, s |= E

f

φ

Fair state: a state from which at least one fair path originates, that

is, a state s is a fair state in M f iff M f , s |= EGtrue.

(12)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

In order to solve the fair CTL model checking problem, we must be able to compute:

[E

f

X(ϕ)]

[E

f

(ϕUψ)]

[E

f

Gϕ].

Suppose we have a procedure Check_FairEG to compute [E f Gϕ].

Let fair = E f Gtrue. (M, s |= E f Gtrue if s is a fair state.) if ϕ is Boolean, then M f , s |= ϕ iff M, s |= (ϕ ∧ fair ) We can rewrite all the other fair operators:

E

f

X(ϕ) ≡ EX(ϕ ∧ fair )

E

f

(ϕUψ) ≡ E(ϕU(ψ ∧ fair ))

(13)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

In order to solve the fair CTL model checking problem, we must be able to compute:

[E

f

X(ϕ)]

[E

f

(ϕUψ)]

[E

f

Gϕ].

Suppose we have a procedure Check_FairEG to compute [E f Gϕ].

Let fair = E f Gtrue. (M, s |= E f Gtrue if s is a fair state.) if ϕ is Boolean, then M f , s |= ϕ iff M, s |= (ϕ ∧ fair ) We can rewrite all the other fair operators:

E

f

X(ϕ) ≡ EX(ϕ ∧ fair )

E

f

(ϕUψ) ≡ E(ϕU(ψ ∧ fair ))

(14)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

In order to solve the fair CTL model checking problem, we must be able to compute:

[E

f

X(ϕ)]

[E

f

(ϕUψ)]

[E

f

Gϕ].

Suppose we have a procedure Check_FairEG to compute [E f Gϕ].

Let fair = E f Gtrue. (M, s |= E f Gtrue if s is a fair state.) if ϕ is Boolean, then M f , s |= ϕ iff M, s |= (ϕ ∧ fair ) We can rewrite all the other fair operators:

E

f

X(ϕ) ≡ EX(ϕ ∧ fair )

E

f

(ϕUψ) ≡ E(ϕU(ψ ∧ fair ))

(15)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

In order to solve the fair CTL model checking problem, we must be able to compute:

[E

f

X(ϕ)]

[E

f

(ϕUψ)]

[E

f

Gϕ].

Suppose we have a procedure Check_FairEG to compute [E f Gϕ].

Let fair = E f Gtrue. (M, s |= E f Gtrue if s is a fair state.) if ϕ is Boolean, then M f , s |= ϕ iff M, s |= (ϕ ∧ fair ) We can rewrite all the other fair operators:

E

f

X(ϕ) ≡ EX(ϕ ∧ fair )

E

f

(ϕUψ) ≡ E(ϕU(ψ ∧ fair ))

(16)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

In order to solve the fair CTL model checking problem, we must be able to compute:

[E

f

X(ϕ)]

[E

f

(ϕUψ)]

[E

f

Gϕ].

Suppose we have a procedure Check_FairEG to compute [E f Gϕ].

Let fair = E f Gtrue. (M, s |= E f Gtrue if s is a fair state.) if ϕ is Boolean, then M f , s |= ϕ iff M, s |= (ϕ ∧ fair ) We can rewrite all the other fair operators:

E

f

X(ϕ) ≡ EX(ϕ ∧ fair )

E

f

(ϕUψ) ≡ E(ϕU(ψ ∧ fair ))

(17)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

E f X(ϕ) ≡ EX(ϕ ∧ fair ):

fair F

ϕ

E f (ϕUψ) ≡ E(ϕU(ψ ∧ fair )):

(18)

Fair CTL Model Checking: Generalities

Fair CTL Model Checking

E f X(ϕ) ≡ EX(ϕ ∧ fair ):

fair F

ϕ

E f (ϕUψ) ≡ E(ϕU(ψ ∧ fair )):

ϕ ϕ ϕ ϕ ϕ ϕ

F

ψ fair

(19)

Checking FairEG (Explicit-State)

Outline

1 Fair CTL Model Checking: Generalities

2 Checking Fair EG (Explicit-State)

3 Checking Fair EG (Symbolic)

(20)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG

A Strongly Connected Component (SCC) of a directed graph is a maximal subgraph s.t. all its nodes are reachable from each other.

Given a fair Kripke model M, a fair non-trivial SCC is an SCC with at least one edge that contains at least one state for every fair condition

=⇒ all states in a fair (non-trivial) SCC are fair states

(21)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG

A Strongly Connected Component (SCC) of a directed graph is a maximal subgraph s.t. all its nodes are reachable from each other.

Given a fair Kripke model M, a fair non-trivial SCC is an SCC with at least one edge that contains at least one state for every fair condition

=⇒ all states in a fair (non-trivial) SCC are fair states

F3

F2

F1

(22)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG

A Strongly Connected Component (SCC) of a directed graph is a maximal subgraph s.t. all its nodes are reachable from each other.

Given a fair Kripke model M, a fair non-trivial SCC is an SCC with at least one edge that contains at least one state for every fair condition

=⇒ all states in a fair (non-trivial) SCC are fair states

F3

F2

F1

(23)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG (cont.)

Check_FairEG([φ]):

(i) restrict the graph of M to [φ];

(ii) find all fair non-trivial SCCs C i

(iii) build C := ∪ i C i ;

(iv) compute the states that can reach C (Check_EU([φ],C)).

(24)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG (cont.)

Check_FairEG([φ]):

(i) restrict the graph of M to [φ];

(ii) find all fair non-trivial SCCs C i

(iii) build C := ∪ i C i ;

(iv) compute the states that can reach C (Check_EU([φ],C)).

(25)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG (cont.)

Check_FairEG([φ]):

(i) restrict the graph of M to [φ];

(ii) find all fair non-trivial SCCs C i

(iii) build C := ∪ i C i ;

(iv) compute the states that can reach C (Check_EU([φ],C)).

(26)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG (cont.)

Check_FairEG([φ]):

(i) restrict the graph of M to [φ];

(ii) find all fair non-trivial SCCs C i

(iii) build C := ∪ i C i ;

(iv) compute the states that can reach C (Check_EU([φ],C)).

(27)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG (cont.)

Check_FairEG([φ]):

(i) restrict the graph of M to [φ];

(ii) find all fair non-trivial SCCs C i

(iii) build C := ∪ i C i ;

(iv) compute the states that can reach C (Check_EU([φ],C)).

(28)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

(29)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

Check_FairEG(¬C 1 ): 1. compute [¬C 1 ]

(30)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

Check_FairEG(¬C 1 ): 2. restrict the graph to [¬C 1 ]

(31)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

Check_FairEG(¬C 1 ): 3. find all fair non-trivial SCC’s

(32)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

Check_FairEG(¬C 1 ): 4. build the union C of all SCC’s

(33)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

Check_FairEG(¬C 1 ): 5. compute the states which can reach it

(34)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

(35)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

Check_FairEU(>, ϕ) = Check_EU(>, ϕ ∧ fair )

(36)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

fair=Check_FairEG(>)

(37)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

Check_FairEU(>, ϕ) = Check_EU(>, ϕ ∧ fair )

(38)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

(39)

Checking FairEG (Explicit-State)

Example: Check_FairEG

F := {{ not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

=⇒ Property Verified

(40)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG - Drawbacks

SCCs computation requires a linear (O(#nodes + #edges) ) DFS (Tarjan).

The DFS manipulates the states explicitly, storing information for every state.

A DFS is not suitable for symbolic model checking where we manipulate sets of states.

We want an algorithm based on the preimage computation.

(41)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG - Drawbacks

SCCs computation requires a linear (O(#nodes + #edges) ) DFS (Tarjan).

The DFS manipulates the states explicitly, storing information for every state.

A DFS is not suitable for symbolic model checking where we manipulate sets of states.

We want an algorithm based on the preimage computation.

(42)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG - Drawbacks

SCCs computation requires a linear (O(#nodes + #edges) ) DFS (Tarjan).

The DFS manipulates the states explicitly, storing information for every state.

A DFS is not suitable for symbolic model checking where we manipulate sets of states.

We want an algorithm based on the preimage computation.

(43)

Checking FairEG (Explicit-State)

SCC-based Check_FairEG - Drawbacks

SCCs computation requires a linear (O(#nodes + #edges) ) DFS (Tarjan).

The DFS manipulates the states explicitly, storing information for every state.

A DFS is not suitable for symbolic model checking where we manipulate sets of states.

We want an algorithm based on the preimage computation.

(44)

Checking FairEG (Symbolic)

Outline

1 Fair CTL Model Checking: Generalities

2 Checking Fair EG (Explicit-State)

3 Checking Fair EG (Symbolic)

(45)

Checking FairEG (Symbolic)

Emerson-Lei Algorithm

Recall the fixpoint characterization of EG:

[EGφ] = νZ .([φ] ∩ [EXZ ])

The greatest set Z s.t. every state z in Z satisfies φ and reaches another state in Z in one step.

We can characterize E f G similarly:

[E f Gφ] = νZ .([φ] ∩ T

F

i

∈FT [EX E(Z U(Z ∩ F i ))])

The greatest set Z s.t. every state z in Z satisfies φ and, for every set F i ∈ FT, z reaches a state in F i ∩ Z by means of a non-trivial path that lies in Z.

[EG ] φ

Z [φ]

(46)

Checking FairEG (Symbolic)

Emerson-Lei Algorithm

Recall the fixpoint characterization of EG:

[EGφ] = νZ .([φ] ∩ [EXZ ])

The greatest set Z s.t. every state z in Z satisfies φ and reaches another state in Z in one step.

We can characterize E f G similarly:

[E f Gφ] = νZ .([φ] ∩ T

F

i

∈FT [EX E(Z U(Z ∩ F i ))])

The greatest set Z s.t. every state z in Z satisfies φ and, for every set F i ∈ FT, z reaches a state in F i ∩ Z by means of a non-trivial path that lies in Z.

[EG ] φ

Z [φ]

[E G ]

f

φ

F1 F2

Fn

Z

F3

[φ]

(47)

Checking FairEG (Symbolic)

Emerson-Lei Algorithm

Recall: [E f Gφ] = νZ .([φ] ∩ T

F

i

∈FT [EX E(Z U(Z ∩ F i ))]) state_set Check_FairEG( state_set [φ]) {

Z’:= [φ];

repeat Z:= Z’;

for each Fi in FT

Y:= Check_EU(Z,Fi∩Z);

Z’:= Z’ ∩ PreImage(Y));

end for;

until (Z’ = Z);

return Z;

}

Implementation of the above formula

(48)

Checking FairEG (Symbolic)

Emerson-Lei Algorithm

Recall: [E f Gφ] = νZ .([φ] ∩ T

F

i

∈FT [EX E(Z U(Z ∩ F i ))]) state_set Check_FairEG( state_set [φ]) {

Z’:= [φ];

repeat Z:= Z’;

for each Fi in FT

Y:= Check_EU(Z’,Fi∩Z’);

Z’:= Z’ ∩ PreImage(Y));

end for;

until (Z’ = Z);

return Z;

}

Slight improvement: do not consider states in Z \ Z 0

(49)

Checking FairEG (Symbolic)

Emerson-Lei Algorithm (symbolic version)

Recall: [E f Gφ] = νZ .([φ] ∩ T

F

i

∈FT [EX E(Z U(Z ∧ F i ))]) Obdd Check_FairEG( Obdd φ) {

Z’:= φ;

repeat Z:= Z’;

for each Fi in FT

Y:= Check_EU(Z’,Fi∧Z’);

Z’:= Z’ ∧ PreImage(Y));

end for;

until (Z’ ↔ Z);

return Z;

}

Symbolic version.

(50)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1 ∧ EG¬C 1 )

(51)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1EG¬C 1 )

EGg = νZ .g ∧ EXZ

(52)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1EG¬C 1 )

EGg = νZ .g ∧ EXZ

(53)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1EG¬C 1 )

EGg = νZ .g ∧ EXZ

(54)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1 ∧ EG¬C 1 )

(55)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1 ∧ EG¬C 1 )

EFg = E(>Ug) = µZ .g ∨ (> ∧ EXZ ) = µZ .g ∨ EXZ

(56)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1 ∧ EG¬C 1 )

EFg = E(>Ug) = µZ .g ∨ (> ∧ EXZ ) = µZ .g ∨ EXZ

(57)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1 ∧ EG¬C 1 )

EFg = E(>Ug) = µZ .g ∨ (> ∧ EXZ ) = µZ .g ∨ EXZ

(58)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1 ∧ EG¬C 1 )

EFg = E(>Ug) = µZ .g ∨ (> ∧ EXZ ) = µZ .g ∨ EXZ

(59)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1 ∧ EG¬C 1 )

EFg = E(>Ug) = µZ .g ∨ (> ∧ EXZ ) = µZ .g ∨ EXZ

(60)

Checking FairEG (Symbolic)

Example: normal Check_EG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= AG(T 1 → AFC 1 ) = ¬EF(T 1 ∧ EG¬C 1 )

=⇒ Property not verified

(61)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

(62)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

(63)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

E f Gg = νZ .g ∧ EXE(Z U(Z ∧ F 1 )) ∧ EXE(Z U(Z ∧ F 2 ))

(64)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

E f Gg = νZ .g ∧ EXE(Z U(Z ∧ F 1 )) ∧ EXE(Z U(Z ∧ F 2 ))

(65)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

E f Gg = νZ .g ∧ EXE(Z U(Z ∧ F 1 )) ∧ EXE(Z U(Z ∧ F 2 ))

(66)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

E f Gg = νZ .g ∧ EXE(Z U(Z ∧ F 1 )) ∧ EXE(Z U(Z ∧ F 2 ))

(67)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

E f Gg = νZ .g ∧ EXE(Z U(Z ∧ F 1 )) ∧ EXE(Z U(Z ∧ F 2 ))

(68)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1E f G¬C 1 )

Fixpoint reached

(69)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

(70)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

(71)

Checking FairEG (Symbolic)

Example: Check_FairEG

F := { { not C1},{not C2}}

turn=1

turn=2

turn=2 turn=2

turn=1 turn=1

turn=1

turn=2

T1, C2 N1, C2 T1, T2

T1, T2

N1, T2

C1, T2 C1, N2

T1, N2

N1, N2 turn=0

not C1 not C2

M |= A f G(T 1 → A f FC 1 ) = ¬E f F(T 1 ∧ E f G¬C 1 )

=⇒ Property verified

Riferimenti

Documenti correlati

Obiettivo principe di questo elaborato è dunque quello di studiare come, attraverso lo sfruttamento di diverse voci di ricavi e costi, una azienda calcistica possa

As a result, edges generated by C and D are parallel (since moving in opposite directions we have constant utility ratio across players) but length of C is larger than length of D

> il manager etico ® è in grado di operare nell’ambito della progettazione etica, della gestione e della rendicontazione etica, della finanza etica e del microcredito in

handle temporal operators AX, EX by computing pre-images handle temporal operators AG, EG, AF, EF, AU, EU, by (implicitly) applying tableaux rules, until a fixpoint is

handle temporal operators AX, EX by computing pre-images handle temporal operators AG, EG, AF, EF, AU, EU, by (implicitly) applying tableaux rules, until a fixpoint is reached..

Kripke structure encoded as Boolean formulas (OBDDs) All operations handled as (quantified) Boolean operations Avoids building the state graph explicitly. reduces dramatically the

(E.g., 300 Boolean vars =⇒ up to 2 300 ≈ 10 100 states!) State Space Explosion:.. too much

Copyright notice: some material (text, figures) displayed in these slides is courtesy of R..