• Non ci sono risultati.

Introduction to Formal Methods Chapter 07: LTL Symbolic Model Checking

N/A
N/A
Protected

Academic year: 2021

Condividi "Introduction to Formal Methods Chapter 07: LTL Symbolic Model Checking"

Copied!
143
0
0

Testo completo

(1)

Introduction to Formal Methods

Chapter 07: LTL Symbolic Model Checking

Roberto Sebastiani

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 18

th

May, 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

without containing this copyright notice.

(2)

Outline

1 The problem

2 The general algorithm Compute the tableau T ψ Compute the product M × T ψ Check the emptiness of L(M × T ψ )

3 An example

4 Exercises

(3)

Outline

1 The problem

2 The general algorithm Compute the tableau T ψ Compute the product M × T ψ Check the emptiness of L(M × T ψ )

3 An example

4 Exercises

(4)

The problem

Given a Kripke structure M and an LTL specification ϕ, does M satisfy ϕ?:

M |= ϕ

Equivalent to the CTL M.C. problem:

M |=

Dual CTL M.C. problem:

M |= E¬ϕ

(5)

The problem

Given a Kripke structure M and an LTL specification ϕ, does M satisfy ϕ?:

M |= ϕ

Equivalent to the CTL M.C. problem:

M |=

Dual CTL M.C. problem:

M |= E¬ϕ

(6)

The problem

Given a Kripke structure M and an LTL specification ϕ, does M satisfy ϕ?:

M |= ϕ

Equivalent to the CTL M.C. problem:

M |=

Dual CTL M.C. problem:

M |= E¬ϕ

(7)

LTL Symbolic M.C.

Let M be a Kripke model and ϕ be an LTL formula:

M |= (CTL )

⇐⇒ M |= ϕ (LTL)

⇐⇒ L(M) ⊆ L(ϕ)

⇐⇒ L(M) ∩ L(ϕ) = ∅

⇐⇒ L(M) ∩ L(¬ϕ) = ∅

⇐⇒ L(M) ∩ L(T ¬ϕ ) = ∅

⇐⇒ L(M × T ¬ϕ ) = ∅

⇐⇒ M × T ¬ϕ 6|= EGtrue

T ¬ϕ is a fair Kripke structure, called Tableau, which represents all and only the paths that satisfy ¬ϕ (do not satisfy ϕ)

=⇒ M × T ¬ϕ represents all and only the paths appearing in M and not

in ϕ.

(8)

LTL Symbolic M.C.

Let M be a Kripke model and ϕ be an LTL formula:

M |= (CTL )

⇐⇒ M |= ϕ (LTL)

⇐⇒ L(M) ⊆ L(ϕ)

⇐⇒ L(M) ∩ L(ϕ) = ∅

⇐⇒ L(M) ∩ L(¬ϕ) = ∅

⇐⇒ L(M) ∩ L(T ¬ϕ ) = ∅

⇐⇒ L(M × T ¬ϕ ) = ∅

⇐⇒ M × T ¬ϕ 6|= EGtrue

T ¬ϕ is a fair Kripke structure, called Tableau, which represents all and only the paths that satisfy ¬ϕ (do not satisfy ϕ)

=⇒ M × T ¬ϕ represents all and only the paths appearing in M and not

in ϕ.

(9)

LTL Symbolic M.C.

Let M be a Kripke model and ϕ be an LTL formula:

M |= (CTL )

⇐⇒ M |= ϕ (LTL)

⇐⇒ L(M) ⊆ L(ϕ)

⇐⇒ L(M) ∩ L(ϕ) = ∅

⇐⇒ L(M) ∩ L(¬ϕ) = ∅

⇐⇒ L(M) ∩ L(T ¬ϕ ) = ∅

⇐⇒ L(M × T ¬ϕ ) = ∅

⇐⇒ M × T ¬ϕ 6|= EGtrue

T ¬ϕ is a fair Kripke structure, called Tableau, which represents all and only the paths that satisfy ¬ϕ (do not satisfy ϕ)

=⇒ M × T ¬ϕ represents all and only the paths appearing in M and not

in ϕ.

(10)

LTL Symbolic M.C.

Let M be a Kripke model and ϕ be an LTL formula:

M |= (CTL )

⇐⇒ M |= ϕ (LTL)

⇐⇒ L(M) ⊆ L(ϕ)

⇐⇒ L(M) ∩ L(ϕ) = ∅

⇐⇒ L(M) ∩ L(¬ϕ) = ∅

⇐⇒ L(M) ∩ L(T ¬ϕ ) = ∅

⇐⇒ L(M × T ¬ϕ ) = ∅

⇐⇒ M × T ¬ϕ 6|= EGtrue

T ¬ϕ is a fair Kripke structure, called Tableau, which represents all and only the paths that satisfy ¬ϕ (do not satisfy ϕ)

=⇒ M × T ¬ϕ represents all and only the paths appearing in M and not

in ϕ.

(11)

LTL Symbolic M.C.

Let M be a Kripke model and ϕ be an LTL formula:

M |= (CTL )

⇐⇒ M |= ϕ (LTL)

⇐⇒ L(M) ⊆ L(ϕ)

⇐⇒ L(M) ∩ L(ϕ) = ∅

⇐⇒ L(M) ∩ L(¬ϕ) = ∅

⇐⇒ L(M) ∩ L(T ¬ϕ ) = ∅

⇐⇒ L(M × T ¬ϕ ) = ∅

⇐⇒ M × T ¬ϕ 6|= EGtrue

T ¬ϕ is a fair Kripke structure, called Tableau, which represents all and only the paths that satisfy ¬ϕ (do not satisfy ϕ)

=⇒ M × T ¬ϕ represents all and only the paths appearing in M and not

in ϕ.

(12)

LTL Symbolic M.C.

Let M be a Kripke model and ϕ be an LTL formula:

M |= (CTL )

⇐⇒ M |= ϕ (LTL)

⇐⇒ L(M) ⊆ L(ϕ)

⇐⇒ L(M) ∩ L(ϕ) = ∅

⇐⇒ L(M) ∩ L(¬ϕ) = ∅

⇐⇒ L(M) ∩ L(T ¬ϕ ) = ∅

⇐⇒ L(M × T ¬ϕ ) = ∅

⇐⇒ M × T ¬ϕ 6|= EGtrue

T ¬ϕ is a fair Kripke structure, called Tableau, which represents all and only the paths that satisfy ¬ϕ (do not satisfy ϕ)

=⇒ M × T ¬ϕ represents all and only the paths appearing in M and not

in ϕ.

(13)

LTL Symbolic M.C.

Let M be a Kripke model and ϕ be an LTL formula:

M |= (CTL )

⇐⇒ M |= ϕ (LTL)

⇐⇒ L(M) ⊆ L(ϕ)

⇐⇒ L(M) ∩ L(ϕ) = ∅

⇐⇒ L(M) ∩ L(¬ϕ) = ∅

⇐⇒ L(M) ∩ L(T ¬ϕ ) = ∅

⇐⇒ L(M × T ¬ϕ ) = ∅

⇐⇒ M × T ¬ϕ 6|= EGtrue

T ¬ϕ is a fair Kripke structure, called Tableau, which represents all and only the paths that satisfy ¬ϕ (do not satisfy ϕ)

=⇒ M × T ¬ϕ represents all and only the paths appearing in M and not

in ϕ.

(14)

LTL Symbolic M.C.

Let M be a Kripke model and ϕ be an LTL formula:

M |= (CTL )

⇐⇒ M |= ϕ (LTL)

⇐⇒ L(M) ⊆ L(ϕ)

⇐⇒ L(M) ∩ L(ϕ) = ∅

⇐⇒ L(M) ∩ L(¬ϕ) = ∅

⇐⇒ L(M) ∩ L(T ¬ϕ ) = ∅

⇐⇒ L(M × T ¬ϕ ) = ∅

⇐⇒ M × T ¬ϕ 6|= EGtrue

T ¬ϕ is a fair Kripke structure, called Tableau, which represents all and only the paths that satisfy ¬ϕ (do not satisfy ϕ)

=⇒ M × T ¬ϕ represents all and only the paths appearing in M and not

in ϕ.

(15)

LTL Symbolic M.C.

Let M be a Kripke model and ϕ be an LTL formula:

M |= (CTL )

⇐⇒ M |= ϕ (LTL)

⇐⇒ L(M) ⊆ L(ϕ)

⇐⇒ L(M) ∩ L(ϕ) = ∅

⇐⇒ L(M) ∩ L(¬ϕ) = ∅

⇐⇒ L(M) ∩ L(T ¬ϕ ) = ∅

⇐⇒ L(M × T ¬ϕ ) = ∅

⇐⇒ M × T ¬ϕ 6|= EGtrue

T ¬ϕ is a fair Kripke structure, called Tableau, which represents all and only the paths that satisfy ¬ϕ (do not satisfy ϕ)

=⇒ M × T ¬ϕ represents all and only the paths appearing in M and not

in ϕ.

(16)

LTL Symbolic M.C. (dual version)

Let M be a Kripke model and ψ = ¬ϕ def be an LTL formula:

M |=

⇐⇒ M 6|= A¬ψ

⇐⇒ ...

⇐⇒ L(M × T ψ ) 6= ∅

⇐⇒ M × T ψ |= EGtrue

T ψ is a fair Kripke structure, called Tableau, which represents all and only the paths that satisfy the LTL formula ψ

=⇒ M × T ψ represents all and only the paths appearing in both M and

T ψ .

(17)

LTL Symbolic Model Checking

Three steps:

(i) Compute the tableau T ψ (T ψ is a fair Kripke structure) (ii) Compute the product M × T ψ

(M × T ψ is a fair Kripke structure) (iii) Check the emptiness of L(M × T ψ )

(e.i., check that M × T ψ 6|= EGTrue)

(18)

LTL Symbolic Model Checking

Three steps:

(i) Compute the tableau T ψ (T ψ is a fair Kripke structure) (ii) Compute the product M × T ψ

(M × T ψ is a fair Kripke structure) (iii) Check the emptiness of L(M × T ψ )

(e.i., check that M × T ψ 6|= EGTrue)

(19)

LTL Symbolic Model Checking

Three steps:

(i) Compute the tableau T ψ (T ψ is a fair Kripke structure) (ii) Compute the product M × T ψ

(M × T ψ is a fair Kripke structure) (iii) Check the emptiness of L(M × T ψ )

(e.i., check that M × T ψ 6|= EGTrue)

(20)

LTL Symbolic Model Checking

Three steps:

(i) Compute the tableau T ψ (T ψ is a fair Kripke structure) (ii) Compute the product M × T ψ

(M × T ψ is a fair Kripke structure) (iii) Check the emptiness of L(M × T ψ )

(e.i., check that M × T ψ 6|= EGTrue)

(21)

Outline

1 The problem

2 The general algorithm Compute the tableau T ψ Compute the product M × T ψ Check the emptiness of L(M × T ψ )

3 An example

4 Exercises

(22)

Outline

1 The problem

2 The general algorithm Compute the tableau T ψ Compute the product M × T ψ Check the emptiness of L(M × T ψ )

3 An example

4 Exercises

(23)

Building the tableau T ψ for ψ: the set of states

Elementary subformulas of ψ: el(ψ) el(p) := {p}

el(¬ϕ 1 ) := el(ϕ 1 )

el(ϕ 1 ∧ ϕ 2 ) := el(ϕ 1 ) ∪ el(ϕ 2 ) el(Xϕ 1 ) = {Xϕ 1 } ∪ el(ϕ 1 )

el(ϕ 1 2 ) := {X(ϕ 1 2 )} ∪ el(ϕ 1 ) ∪ el(ϕ 2 )

Intuition: el(ψ) is the set of propositions and X-formulas occurring ψ 0 , ψ 0 being the result of applying recursively the tableau

expansion rules to ψ

The set of states S T ψ of T ψ is given by 2 el(ψ)

The labeling function L T ψ of T ψ comes straightforwardly

(the label is the Boolean component of each state)

(24)

Building the tableau T ψ for ψ: the set of states

Elementary subformulas of ψ: el(ψ) el(p) := {p}

el(¬ϕ 1 ) := el(ϕ 1 )

el(ϕ 1 ∧ ϕ 2 ) := el(ϕ 1 ) ∪ el(ϕ 2 ) el(Xϕ 1 ) = {Xϕ 1 } ∪ el(ϕ 1 )

el(ϕ 1 2 ) := {X(ϕ 1 2 )} ∪ el(ϕ 1 ) ∪ el(ϕ 2 )

Intuition: el(ψ) is the set of propositions and X-formulas occurring ψ 0 , ψ 0 being the result of applying recursively the tableau

expansion rules to ψ

The set of states S T ψ of T ψ is given by 2 el(ψ)

The labeling function L T ψ of T ψ comes straightforwardly

(the label is the Boolean component of each state)

(25)

Building the tableau T ψ for ψ: the set of states

Elementary subformulas of ψ: el(ψ) el(p) := {p}

el(¬ϕ 1 ) := el(ϕ 1 )

el(ϕ 1 ∧ ϕ 2 ) := el(ϕ 1 ) ∪ el(ϕ 2 ) el(Xϕ 1 ) = {Xϕ 1 } ∪ el(ϕ 1 )

el(ϕ 1 2 ) := {X(ϕ 1 2 )} ∪ el(ϕ 1 ) ∪ el(ϕ 2 )

Intuition: el(ψ) is the set of propositions and X-formulas occurring ψ 0 , ψ 0 being the result of applying recursively the tableau

expansion rules to ψ

The set of states S T ψ of T ψ is given by 2 el(ψ)

The labeling function L T ψ of T ψ comes straightforwardly

(the label is the Boolean component of each state)

(26)

Building the tableau T ψ for ψ: the set of states

Elementary subformulas of ψ: el(ψ) el(p) := {p}

el(¬ϕ 1 ) := el(ϕ 1 )

el(ϕ 1 ∧ ϕ 2 ) := el(ϕ 1 ) ∪ el(ϕ 2 ) el(Xϕ 1 ) = {Xϕ 1 } ∪ el(ϕ 1 )

el(ϕ 1 2 ) := {X(ϕ 1 2 )} ∪ el(ϕ 1 ) ∪ el(ϕ 2 )

Intuition: el(ψ) is the set of propositions and X-formulas occurring ψ 0 , ψ 0 being the result of applying recursively the tableau

expansion rules to ψ

The set of states S T ψ of T ψ is given by 2 el(ψ)

The labeling function L T ψ of T ψ comes straightforwardly

(the label is the Boolean component of each state)

(27)

Example: ψ := pUq

el(pUq) = el((q ∨ (p ∧ X(pUq))) = {p, q, X(pUq)}

=⇒ S T ψ = {

1 : {p, q, X(pUq)}, [pUq]

2 : {¬p, q, X(pUq)}, [pUq]

3 : {p, ¬q, X(pUq)}, [pUq]

4 : {¬p, q, ¬X(pUq)}, [pUq]

5 : {¬p, ¬q, X(pUq)}, [¬pUq]

6 : {p, q, ¬X(pUq)}, [pUq]

7 : {p, ¬q, ¬X(pUq)}, [¬pUq]

8 : {¬p, ¬q, ¬X(pUq)} [¬pUq]

}

(28)

Example: ψ := pUq

el(pUq) = el((q ∨ (p ∧ X(pUq))) = {p, q, X(pUq)}

=⇒ S T ψ = {

1 : {p, q, X(pUq)}, [pUq]

2 : {¬p, q, X(pUq)}, [pUq]

3 : {p, ¬q, X(pUq)}, [pUq]

4 : {¬p, q, ¬X(pUq)}, [pUq]

5 : {¬p, ¬q, X(pUq)}, [¬pUq]

6 : {p, q, ¬X(pUq)}, [pUq]

7 : {p, ¬q, ¬X(pUq)}, [¬pUq]

8 : {¬p, ¬q, ¬X(pUq)} [¬pUq]

}

(29)

Example: ψ := pUq [cont.]

−Xψ −Xψ

−Xψ −Xψ

3

4

5 6

7 8

2

1 p q −p p −q

−p q −p −q p q

p −q −p −q

q

(30)

Building the tableau T ψ for ψ: sat()

Set of states in S T ψ satisfying ϕ i : sat(ϕ i ) sat(ϕ 1 ) := {s | ϕ 1 ∈ s}, ϕ 1 ∈ el(ψ) sat(¬ϕ 1 ) := S T

ψ

/sat(ϕ 1 )

sat(ϕ 1 ∧ ϕ 2 ) := sat(ϕ 1 ) ∩ sat(ϕ 2 )

sat(ϕ 1 2 ) := sat(ϕ 2 ) ∪ (sat(ϕ 1 ) ∩ sat(X(ϕ 1 2 )))

intuition: sat() establishes in which states subformulas are true

(31)

Building the tableau T ψ for ψ: sat()

Set of states in S T ψ satisfying ϕ i : sat(ϕ i ) sat(ϕ 1 ) := {s | ϕ 1 ∈ s}, ϕ 1 ∈ el(ψ) sat(¬ϕ 1 ) := S T

ψ

/sat(ϕ 1 )

sat(ϕ 1 ∧ ϕ 2 ) := sat(ϕ 1 ) ∩ sat(ϕ 2 )

sat(ϕ 1 2 ) := sat(ϕ 2 ) ∪ (sat(ϕ 1 ) ∩ sat(X(ϕ 1 2 )))

intuition: sat() establishes in which states subformulas are true

(32)

Example: ψ := pUq [cont.]

−Xψ −Xψ

−Xψ −Xψ

3

4

5 6

7 8

2

1 p q −p p −q

−p q −p −q p q

p −q −p −q

q

ψ ψ ψ

ψ −ψ ψ

−ψ −ψ

(33)

Building the tableau T ψ for ψ: initial states and transition relation

Set of states in S T ψ satisfying ϕ i : sat(ϕ i ) sat(ϕ 1 ) := {s | ϕ 1 ∈ s}, ϕ 1 ∈ el(ψ) sat(¬ϕ 1 ) := S T

ψ

/sat(ϕ 1 )

sat(ϕ 1 ∧ ϕ 2 ) := sat(ϕ 1 ) ∩ sat(ϕ 2 )

sat(ϕ 1 2 ) := sat(ϕ 2 ) ∪ (sat(ϕ 1 ) ∩ sat(X(ϕ 1 2 )))

Intuition: sat() establishes in which states subformulas are true The set of initial states I T ψ is defined as

I T ψ = sat(ψ)

The transition relation R T ψ is defined as R T ψ (s, s 0 ) = \

i ∈el(ψ)

(s, s 0 ) | s ∈ sat(Xϕ i ) ⇔ s 0 ∈ sat(ϕ i )

(34)

Building the tableau T ψ for ψ: initial states and transition relation

Set of states in S T ψ satisfying ϕ i : sat(ϕ i ) sat(ϕ 1 ) := {s | ϕ 1 ∈ s}, ϕ 1 ∈ el(ψ) sat(¬ϕ 1 ) := S T

ψ

/sat(ϕ 1 )

sat(ϕ 1 ∧ ϕ 2 ) := sat(ϕ 1 ) ∩ sat(ϕ 2 )

sat(ϕ 1 2 ) := sat(ϕ 2 ) ∪ (sat(ϕ 1 ) ∩ sat(X(ϕ 1 2 )))

Intuition: sat() establishes in which states subformulas are true The set of initial states I T ψ is defined as

I T ψ = sat(ψ)

The transition relation R T ψ is defined as R T ψ (s, s 0 ) = \

i ∈el(ψ)

(s, s 0 ) | s ∈ sat(Xϕ i ) ⇔ s 0 ∈ sat(ϕ i )

(35)

Building the tableau T ψ for ψ: initial states and transition relation

Set of states in S T ψ satisfying ϕ i : sat(ϕ i ) sat(ϕ 1 ) := {s | ϕ 1 ∈ s}, ϕ 1 ∈ el(ψ) sat(¬ϕ 1 ) := S T

ψ

/sat(ϕ 1 )

sat(ϕ 1 ∧ ϕ 2 ) := sat(ϕ 1 ) ∩ sat(ϕ 2 )

sat(ϕ 1 2 ) := sat(ϕ 2 ) ∪ (sat(ϕ 1 ) ∩ sat(X(ϕ 1 2 )))

Intuition: sat() establishes in which states subformulas are true The set of initial states I T ψ is defined as

I T ψ = sat(ψ)

The transition relation R T ψ is defined as R T ψ (s, s 0 ) = \

i ∈el(ψ)

(s, s 0 ) | s ∈ sat(Xϕ i ) ⇔ s 0 ∈ sat(ϕ i )

(36)

Building the tableau T ψ for ψ: initial states and transition relation

Set of states in S T ψ satisfying ϕ i : sat(ϕ i ) sat(ϕ 1 ) := {s | ϕ 1 ∈ s}, ϕ 1 ∈ el(ψ) sat(¬ϕ 1 ) := S T

ψ

/sat(ϕ 1 )

sat(ϕ 1 ∧ ϕ 2 ) := sat(ϕ 1 ) ∩ sat(ϕ 2 )

sat(ϕ 1 2 ) := sat(ϕ 2 ) ∪ (sat(ϕ 1 ) ∩ sat(X(ϕ 1 2 )))

Intuition: sat() establishes in which states subformulas are true The set of initial states I T ψ is defined as

I T ψ = sat(ψ)

The transition relation R T ψ is defined as R T ψ (s, s 0 ) = \

i ∈el(ψ)

(s, s 0 ) | s ∈ sat(Xϕ i ) ⇔ s 0 ∈ sat(ϕ i )

(37)

Example: ψ := pUq [cont.]

−Xψ −Xψ

−Xψ −Xψ

3

4

5 6

7 8

2 1 p q

ψ

−p p −q

−p q −p −q p q

p −q −p −q

ψ

ψ −ψ ψ

−ψ

−ψ

q

ψ

(38)

Problems with U-subformulas

R T ψ does not guarantee that the U-subformulas are fulfilled Example: state 3 {p, ¬q, X(pUq)}:

although state 3 belongs to

sat(pUq) := sat(q) ∪ (sat(p) ∩ sat(X(pUq))),

the path which loops forever in state 3 does not satisfy pUq, as q

never holds in that path.

(39)

Problems with U-subformulas

R T ψ does not guarantee that the U-subformulas are fulfilled Example: state 3 {p, ¬q, X(pUq)}:

although state 3 belongs to

sat(pUq) := sat(q) ∪ (sat(p) ∩ sat(X(pUq))),

the path which loops forever in state 3 does not satisfy pUq, as q

never holds in that path.

(40)

Problems with U-subformulas

R T ψ does not guarantee that the U-subformulas are fulfilled Example: state 3 {p, ¬q, X(pUq)}:

although state 3 belongs to

sat(pUq) := sat(q) ∪ (sat(p) ∩ sat(X(pUq))),

the path which loops forever in state 3 does not satisfy pUq, as q

never holds in that path.

(41)

Tableaux rules: a quote

“After all... tomorrow is another day."

[Scarlett O’Hara, “Gone with the Wind”]

(42)

Fairness conditions for every U-subformula

it must never happen that we get into a state s 0 from which we can enter a path π 0 in which ϕ 1 2 holds forever and ϕ 2 never holds.

In CTL*: ¬EFEG((ϕ 1 2 ) ∧ ¬ϕ 2 ) (“bad loop”)

ϕ1Uϕ2 ϕ1Uϕ2

−ϕ2

ϕ1Uϕ2 ϕ1Uϕ2

−ϕ2 . . . .

−ϕ2 −ϕ2

=⇒ For every [positive] U-subformula ϕ 1 2 of ψ, we must add a fairness CTL* condition AGAF(¬(ϕ 1 2 ) ∨ ϕ 2 )

(in LTL: GF(¬(ϕ 1 2 ) ∨ ϕ 2 ))

If no [positive] U-subformulas, then add one fairness condition AGAF>.

=⇒ We restrict the admissible paths of T ψ to those which verify the fairness condition: T ψ := hS T ψ , I T ψ , R T ψ , L T ψ , F T ψ i

F T ψ := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

(43)

Fairness conditions for every U-subformula

it must never happen that we get into a state s 0 from which we can enter a path π 0 in which ϕ 1 2 holds forever and ϕ 2 never holds.

In CTL*: ¬EFEG((ϕ 1 2 ) ∧ ¬ϕ 2 ) (“bad loop”)

ϕ1Uϕ2 ϕ1Uϕ2

−ϕ2

ϕ1Uϕ2 ϕ1Uϕ2

−ϕ2 . . . .

−ϕ2 −ϕ2

=⇒ For every [positive] U-subformula ϕ 1 2 of ψ, we must add a fairness CTL* condition AGAF(¬(ϕ 1 2 ) ∨ ϕ 2 )

(in LTL: GF(¬(ϕ 1 2 ) ∨ ϕ 2 ))

If no [positive] U-subformulas, then add one fairness condition AGAF>.

=⇒ We restrict the admissible paths of T ψ to those which verify the fairness condition: T ψ := hS T ψ , I T ψ , R T ψ , L T ψ , F T ψ i

F T ψ := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

(44)

Fairness conditions for every U-subformula

it must never happen that we get into a state s 0 from which we can enter a path π 0 in which ϕ 1 2 holds forever and ϕ 2 never holds.

In CTL*: ¬EFEG((ϕ 1 2 ) ∧ ¬ϕ 2 ) (“bad loop”)

ϕ1Uϕ2 ϕ1Uϕ2

−ϕ2

ϕ1Uϕ2 ϕ1Uϕ2

−ϕ2 . . . .

−ϕ2 −ϕ2

=⇒ For every [positive] U-subformula ϕ 1 2 of ψ, we must add a fairness CTL* condition AGAF(¬(ϕ 1 2 ) ∨ ϕ 2 )

(in LTL: GF(¬(ϕ 1 2 ) ∨ ϕ 2 ))

If no [positive] U-subformulas, then add one fairness condition AGAF>.

=⇒ We restrict the admissible paths of T ψ to those which verify the fairness condition: T ψ := hS T ψ , I T ψ , R T ψ , L T ψ , F T ψ i

F T ψ := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

(45)

Fairness conditions for every U-subformula

it must never happen that we get into a state s 0 from which we can enter a path π 0 in which ϕ 1 2 holds forever and ϕ 2 never holds.

In CTL*: ¬EFEG((ϕ 1 2 ) ∧ ¬ϕ 2 ) (“bad loop”)

ϕ1Uϕ2 ϕ1Uϕ2

−ϕ2

ϕ1Uϕ2 ϕ1Uϕ2

−ϕ2 . . . .

−ϕ2 −ϕ2

=⇒ For every [positive] U-subformula ϕ 1 2 of ψ, we must add a fairness CTL* condition AGAF(¬(ϕ 1 2 ) ∨ ϕ 2 )

(in LTL: GF(¬(ϕ 1 2 ) ∨ ϕ 2 ))

If no [positive] U-subformulas, then add one fairness condition AGAF>.

=⇒ We restrict the admissible paths of T ψ to those which verify the fairness condition: T ψ := hS T ψ , I T ψ , R T ψ , L T ψ , F T ψ i

F T ψ := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

(46)

Example: ψ := pUq [cont.]

−Xψ −Xψ

−Xψ −Xψ

3

4

5 6

7 8

2 1 p q

ψ

−p p −q

−p q −p −q p q

p −q −p −q

ψ

ψ −ψ ψ

−ψ

−ψ

q

ψ

(47)

Symbolic representation of T ψ

State variables: one Boolean variable for each formula in el(ψ) EX: p, q and x and primed versions p 0 , q 0 and x 0

[ x is a Boolean label for X(pUq) ] sat(ϕ i ):

sat(p) := p, s.t. p Boolean state variable sat(¬ϕ 1 ) := ¬sat(ϕ 1 )

sat(ϕ 1 ∧ ϕ 2 ) := sat(ϕ 1 ) ∧ sat(ϕ 2 )

sat(Xϕ i ) := x [Xϕ

i

] , s.t. x [Xϕ

i

] Boolean state variable sat(ϕ 1 2 ) := sat(ϕ 2 ) ∨ (sat(ϕ 1 ) ∧ sat(X(ϕ 1 2 )))

=⇒ sat(ϕ 1 2 ) := sat(ϕ 2 ) ∨ (sat(ϕ 1 ) ∧ x [Xϕ

1

2

] )

...

(48)

Symbolic representation of T ψ

State variables: one Boolean variable for each formula in el(ψ) EX: p, q and x and primed versions p 0 , q 0 and x 0

[ x is a Boolean label for X(pUq) ] sat(ϕ i ):

sat(p) := p, s.t. p Boolean state variable sat(¬ϕ 1 ) := ¬sat(ϕ 1 )

sat(ϕ 1 ∧ ϕ 2 ) := sat(ϕ 1 ) ∧ sat(ϕ 2 )

sat(Xϕ i ) := x [Xϕ

i

] , s.t. x [Xϕ

i

] Boolean state variable sat(ϕ 1 2 ) := sat(ϕ 2 ) ∨ (sat(ϕ 1 ) ∧ sat(X(ϕ 1 2 )))

=⇒ sat(ϕ 1 2 ) := sat(ϕ 2 ) ∨ (sat(ϕ 1 ) ∧ x [Xϕ

1

2

] )

...

(49)

Symbolic representation of T ψ [cont.]

...

Initial states: I T ψ = sat(ψ) EX: I(p, q, x ) = q ∨ (p ∧ x ) Transition Relation:

R T ψ (s, s 0 ) = T

i ∈el(ψ) {(s, s 0 ) | s ∈ sat(Xϕ i ) ⇔ s 0 ∈ sat(ϕ i )}

R T

ψ

= V

i

∈el(ψ) (sat(Xϕ i ) ↔ sat 0i )) where sat 0i ) is sat(ϕ i ) on primed variables EX: R T

ψ

(p, q, x , p 0 , q 0 , x 0 ) = x ↔ (q 0 ∨ (p 0 ∧ x 0 )) Fairness Conditions:

F T ψ := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

EX: F T

ψ

(p, q, x ) = ¬(q ∨ (p ∧ x )) ∨ q = ... = ¬p ∨ ¬x ∨ q

(50)

Symbolic representation of T ψ [cont.]

...

Initial states: I T ψ = sat(ψ) EX: I(p, q, x ) = q ∨ (p ∧ x ) Transition Relation:

R T ψ (s, s 0 ) = T

i ∈el(ψ) {(s, s 0 ) | s ∈ sat(Xϕ i ) ⇔ s 0 ∈ sat(ϕ i )}

R T

ψ

= V

i

∈el(ψ) (sat(Xϕ i ) ↔ sat 0i )) where sat 0i ) is sat(ϕ i ) on primed variables EX: R T

ψ

(p, q, x , p 0 , q 0 , x 0 ) = x ↔ (q 0 ∨ (p 0 ∧ x 0 )) Fairness Conditions:

F T ψ := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

EX: F T

ψ

(p, q, x ) = ¬(q ∨ (p ∧ x )) ∨ q = ... = ¬p ∨ ¬x ∨ q

(51)

Symbolic representation of T ψ [cont.]

...

Initial states: I T ψ = sat(ψ) EX: I(p, q, x ) = q ∨ (p ∧ x ) Transition Relation:

R T ψ (s, s 0 ) = T

i ∈el(ψ) {(s, s 0 ) | s ∈ sat(Xϕ i ) ⇔ s 0 ∈ sat(ϕ i )}

R T

ψ

= V

i

∈el(ψ) (sat(Xϕ i ) ↔ sat 0i )) where sat 0i ) is sat(ϕ i ) on primed variables EX: R T

ψ

(p, q, x , p 0 , q 0 , x 0 ) = x ↔ (q 0 ∨ (p 0 ∧ x 0 )) Fairness Conditions:

F T ψ := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

EX: F T

ψ

(p, q, x ) = ¬(q ∨ (p ∧ x )) ∨ q = ... = ¬p ∨ ¬x ∨ q

(52)

Symbolic representation of T ψ : examples

I T ψ (p, q, x ) = q ∨ (p ∧ x ) 1 : {p, q, x } |= I T ψ 3 : {p, ¬q, x } |= I T ψ 6 5 : {¬p, ¬q, x} 6|= I T ψ R T ψ (p, q, x , p 0 , q 0 , x 0 ) = x ↔ (q 0 ∨ (p 0 ∧ x 0 ))

1 ⇒ 1 : {p, q, x , p 0 , q 0 , x 0 } |= R T ψ 6 ⇒ 7 : {p, q, ¬x , p 0 , ¬q 0 , ¬x 0 } |= R T ψ 6 6⇒ 1 : {p, q, ¬x , p 0 , q 0 , x 0 } 6|= R T ψ F T ψ (p, q, x ) = ¬p ∨ ¬x ∨ q

1 : {p, q, x } |= F T ψ 5 : {¬p, ¬q, x } |= F T ψ 6 3 : {p, ¬q, x} 6|= F T ψ

−Xψ −Xψ

−Xψ −Xψ

3

4

5 6

7 8

2 1 pq

ψ

−p p−q

−p q −p−q p q

p −q −p −q

ψ

ψ −ψ ψ

−ψ

−ψ

q ψ

(53)

Symbolic representation of T ψ : examples

I T ψ (p, q, x ) = q ∨ (p ∧ x ) 1 : {p, q, x } |= I T ψ 3 : {p, ¬q, x } |= I T ψ 6 5 : {¬p, ¬q, x} 6|= I T ψ R T ψ (p, q, x , p 0 , q 0 , x 0 ) = x ↔ (q 0 ∨ (p 0 ∧ x 0 ))

1 ⇒ 1 : {p, q, x , p 0 , q 0 , x 0 } |= R T ψ 6 ⇒ 7 : {p, q, ¬x , p 0 , ¬q 0 , ¬x 0 } |= R T ψ 6 6⇒ 1 : {p, q, ¬x , p 0 , q 0 , x 0 } 6|= R T ψ F T ψ (p, q, x ) = ¬p ∨ ¬x ∨ q

1 : {p, q, x } |= F T ψ 5 : {¬p, ¬q, x } |= F T ψ 6 3 : {p, ¬q, x} 6|= F T ψ

−Xψ −Xψ

−Xψ −Xψ

3

4

5 6

7 8

2 1 pq

ψ

−p p−q

−p q −p−q p q

p −q −p −q

ψ

ψ −ψ ψ

−ψ

−ψ

q ψ

(54)

Symbolic representation of T ψ : examples

I T ψ (p, q, x ) = q ∨ (p ∧ x ) 1 : {p, q, x } |= I T ψ 3 : {p, ¬q, x } |= I T ψ 6 5 : {¬p, ¬q, x} 6|= I T ψ R T ψ (p, q, x , p 0 , q 0 , x 0 ) = x ↔ (q 0 ∨ (p 0 ∧ x 0 ))

1 ⇒ 1 : {p, q, x , p 0 , q 0 , x 0 } |= R T ψ 6 ⇒ 7 : {p, q, ¬x , p 0 , ¬q 0 , ¬x 0 } |= R T ψ 6 6⇒ 1 : {p, q, ¬x , p 0 , q 0 , x 0 } 6|= R T ψ F T ψ (p, q, x ) = ¬p ∨ ¬x ∨ q

1 : {p, q, x } |= F T ψ 5 : {¬p, ¬q, x } |= F T ψ 6 3 : {p, ¬q, x} 6|= F T ψ

−Xψ −Xψ

−Xψ −Xψ

3

4

5 6

7 8

2 1 pq

ψ

−p p−q

−p q −p−q p q

p −q −p −q

ψ

ψ −ψ ψ

−ψ

−ψ

q ψ

(55)

Symbolic representation of T ψ : examples

I T ψ (p, q, x ) = q ∨ (p ∧ x ) 1 : {p, q, x } |= I T ψ 3 : {p, ¬q, x } |= I T ψ 6 5 : {¬p, ¬q, x} 6|= I T ψ R T ψ (p, q, x , p 0 , q 0 , x 0 ) = x ↔ (q 0 ∨ (p 0 ∧ x 0 ))

1 ⇒ 1 : {p, q, x , p 0 , q 0 , x 0 } |= R T ψ 6 ⇒ 7 : {p, q, ¬x , p 0 , ¬q 0 , ¬x 0 } |= R T ψ 6 6⇒ 1 : {p, q, ¬x , p 0 , q 0 , x 0 } 6|= R T ψ F T ψ (p, q, x ) = ¬p ∨ ¬x ∨ q

1 : {p, q, x } |= F T ψ 5 : {¬p, ¬q, x } |= F T ψ 6 3 : {p, ¬q, x} 6|= F T ψ

−Xψ −Xψ

−Xψ −Xψ

3

4

5 6

7 8

2 1 pq

ψ

−p p−q

−p q −p−q p q

p −q −p −q

ψ

ψ −ψ ψ

−ψ

−ψ

q ψ

(56)

Outline

1 The problem

2 The general algorithm Compute the tableau T ψ Compute the product M × T ψ Check the emptiness of L(M × T ψ )

3 An example

4 Exercises

(57)

Computing the product P := T ψ × M

Given M := hS M , I M , R M , L M i and T ψ := hS T ψ , I T ψ , R T ψ , L T ψ , F T ψ i, we compute the product P := T ψ × M = hS, I, R, L, F i as follows:

S := {(s, s 0 ) | s ∈ S T

ψ

, s 0 ∈ S M and L M (s 0 )| ψ = L T

ψ

(s)}

I := {(s, s 0 ) | s ∈ I T

ψ

, s 0 ∈ I M and L M (s 0 )| ψ = L T

ψ

(s)}

Given (s, s 0 ), (t, t 0 ) ∈ S, ((s, s 0 ), (t, t 0 )) ∈ R iff (s, t) ∈ R T

ψ

and (s 0 , t 0 ) ∈ R M

L((s, s 0 )) = L T

ψ

(s) ∪ L M (s 0 ) Extension of sat() and F T ψ to P:

(s, s 0 ) ∈ sat(ψ) ⇐⇒ s ∈ sat(ψ)

F := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 ) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

(58)

Computing the product P := T ψ × M

Given M := hS M , I M , R M , L M i and T ψ := hS T ψ , I T ψ , R T ψ , L T ψ , F T ψ i, we compute the product P := T ψ × M = hS, I, R, L, F i as follows:

S := {(s, s 0 ) | s ∈ S T

ψ

, s 0 ∈ S M and L M (s 0 )| ψ = L T

ψ

(s)}

I := {(s, s 0 ) | s ∈ I T

ψ

, s 0 ∈ I M and L M (s 0 )| ψ = L T

ψ

(s)}

Given (s, s 0 ), (t, t 0 ) ∈ S, ((s, s 0 ), (t, t 0 )) ∈ R iff (s, t) ∈ R T

ψ

and (s 0 , t 0 ) ∈ R M

L((s, s 0 )) = L T

ψ

(s) ∪ L M (s 0 ) Extension of sat() and F T ψ to P:

(s, s 0 ) ∈ sat(ψ) ⇐⇒ s ∈ sat(ψ)

F := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 ) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

(59)

Computing the product P := T ψ × M

Given M := hS M , I M , R M , L M i and T ψ := hS T ψ , I T ψ , R T ψ , L T ψ , F T ψ i, we compute the product P := T ψ × M = hS, I, R, L, F i as follows:

S := {(s, s 0 ) | s ∈ S T

ψ

, s 0 ∈ S M and L M (s 0 )| ψ = L T

ψ

(s)}

I := {(s, s 0 ) | s ∈ I T

ψ

, s 0 ∈ I M and L M (s 0 )| ψ = L T

ψ

(s)}

Given (s, s 0 ), (t, t 0 ) ∈ S, ((s, s 0 ), (t, t 0 )) ∈ R iff (s, t) ∈ R T

ψ

and (s 0 , t 0 ) ∈ R M

L((s, s 0 )) = L T

ψ

(s) ∪ L M (s 0 ) Extension of sat() and F T ψ to P:

(s, s 0 ) ∈ sat(ψ) ⇐⇒ s ∈ sat(ψ)

F := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 ) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

(60)

Computing the product P := T ψ × M

Given M := hS M , I M , R M , L M i and T ψ := hS T ψ , I T ψ , R T ψ , L T ψ , F T ψ i, we compute the product P := T ψ × M = hS, I, R, L, F i as follows:

S := {(s, s 0 ) | s ∈ S T

ψ

, s 0 ∈ S M and L M (s 0 )| ψ = L T

ψ

(s)}

I := {(s, s 0 ) | s ∈ I T

ψ

, s 0 ∈ I M and L M (s 0 )| ψ = L T

ψ

(s)}

Given (s, s 0 ), (t, t 0 ) ∈ S, ((s, s 0 ), (t, t 0 )) ∈ R iff (s, t) ∈ R T

ψ

and (s 0 , t 0 ) ∈ R M

L((s, s 0 )) = L T

ψ

(s) ∪ L M (s 0 ) Extension of sat() and F T ψ to P:

(s, s 0 ) ∈ sat(ψ) ⇐⇒ s ∈ sat(ψ)

F := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 ) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

(61)

Computing the product P := T ψ × M

Given M := hS M , I M , R M , L M i and T ψ := hS T ψ , I T ψ , R T ψ , L T ψ , F T ψ i, we compute the product P := T ψ × M = hS, I, R, L, F i as follows:

S := {(s, s 0 ) | s ∈ S T

ψ

, s 0 ∈ S M and L M (s 0 )| ψ = L T

ψ

(s)}

I := {(s, s 0 ) | s ∈ I T

ψ

, s 0 ∈ I M and L M (s 0 )| ψ = L T

ψ

(s)}

Given (s, s 0 ), (t, t 0 ) ∈ S, ((s, s 0 ), (t, t 0 )) ∈ R iff (s, t) ∈ R T

ψ

and (s 0 , t 0 ) ∈ R M

L((s, s 0 )) = L T

ψ

(s) ∪ L M (s 0 ) Extension of sat() and F T ψ to P:

(s, s 0 ) ∈ sat(ψ) ⇐⇒ s ∈ sat(ψ)

F := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 ) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

(62)

Computing the product P := T ψ × M

Given M := hS M , I M , R M , L M i and T ψ := hS T ψ , I T ψ , R T ψ , L T ψ , F T ψ i, we compute the product P := T ψ × M = hS, I, R, L, F i as follows:

S := {(s, s 0 ) | s ∈ S T

ψ

, s 0 ∈ S M and L M (s 0 )| ψ = L T

ψ

(s)}

I := {(s, s 0 ) | s ∈ I T

ψ

, s 0 ∈ I M and L M (s 0 )| ψ = L T

ψ

(s)}

Given (s, s 0 ), (t, t 0 ) ∈ S, ((s, s 0 ), (t, t 0 )) ∈ R iff (s, t) ∈ R T

ψ

and (s 0 , t 0 ) ∈ R M

L((s, s 0 )) = L T

ψ

(s) ∪ L M (s 0 ) Extension of sat() and F T ψ to P:

(s, s 0 ) ∈ sat(ψ) ⇐⇒ s ∈ sat(ψ)

F := {sat(¬(ϕ 1 2 ) ∨ ϕ 2 ) s.t. (ϕ 1 2 ) occurs [positively ]in ψ}

(63)

Computing the product P := T ψ × M symbolically

Let V , W be the array of Boolean state variables of T ψ and M respectively:

Initial states: I(V ∪ W ) = I T ψ (V ) ∧ I M (W )

Transition Relation: R(V ∪ W , V 0 ∪ W 0 ) = R T ψ (V , V 0 ) ∧ R M (W , W 0 ) Fairness conditions:

{F 1 (V ∪ W ), ..., F k (V ∪ W )} = {F T ψ 1 (V ), ..., F T ψ k (V )}

(64)

Computing the product P := T ψ × M symbolically

Let V , W be the array of Boolean state variables of T ψ and M respectively:

Initial states: I(V ∪ W ) = I T ψ (V ) ∧ I M (W )

Transition Relation: R(V ∪ W , V 0 ∪ W 0 ) = R T ψ (V , V 0 ) ∧ R M (W , W 0 ) Fairness conditions:

{F 1 (V ∪ W ), ..., F k (V ∪ W )} = {F T ψ 1 (V ), ..., F T ψ k (V )}

(65)

Computing the product P := T ψ × M symbolically

Let V , W be the array of Boolean state variables of T ψ and M respectively:

Initial states: I(V ∪ W ) = I T ψ (V ) ∧ I M (W )

Transition Relation: R(V ∪ W , V 0 ∪ W 0 ) = R T ψ (V , V 0 ) ∧ R M (W , W 0 ) Fairness conditions:

{F 1 (V ∪ W ), ..., F k (V ∪ W )} = {F T ψ 1 (V ), ..., F T ψ k (V )}

(66)

Computing the product P := T ψ × M symbolically

Let V , W be the array of Boolean state variables of T ψ and M respectively:

Initial states: I(V ∪ W ) = I T ψ (V ) ∧ I M (W )

Transition Relation: R(V ∪ W , V 0 ∪ W 0 ) = R T ψ (V , V 0 ) ∧ R M (W , W 0 ) Fairness conditions:

{F 1 (V ∪ W ), ..., F k (V ∪ W )} = {F T ψ 1 (V ), ..., F T ψ k (V )}

(67)

Outline

1 The problem

2 The general algorithm Compute the tableau T ψ Compute the product M × T ψ Check the emptiness of L(M × T ψ )

3 An example

4 Exercises

(68)

Main theorem [Clarke, Grumberg & Hamaguchi; 94]

Theorem

THEOREM: M.s 0 |= Eψ iff there is a state s in T ψ s.t. (s, s 0 ) ∈ sat(ψ) and T ψ × M, (s, s 0 ) |= EGtrue under the fairness conditions:

{sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs in ψ}.

=⇒ M |= Eψ iff T ψ × M |= E f Gtrue

=⇒ M |= ¬ψ iff T ψ × M 6|= E f Gtrue LTL M.C. reduced to Fair CTL M.C.!!!

Symbolic OBDD-based techniques apply.

Note

The transition relation R of T ψ × M may not be total.

=⇒ Check_FairEG does not need to consider states without

successors, restricting R to the remaining states.

(69)

Main theorem [Clarke, Grumberg & Hamaguchi; 94]

Theorem

THEOREM: M.s 0 |= Eψ iff there is a state s in T ψ s.t. (s, s 0 ) ∈ sat(ψ) and T ψ × M, (s, s 0 ) |= EGtrue under the fairness conditions:

{sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs in ψ}.

=⇒ M |= Eψ iff T ψ × M |= E f Gtrue

=⇒ M |= ¬ψ iff T ψ × M 6|= E f Gtrue LTL M.C. reduced to Fair CTL M.C.!!!

Symbolic OBDD-based techniques apply.

Note

The transition relation R of T ψ × M may not be total.

=⇒ Check_FairEG does not need to consider states without

successors, restricting R to the remaining states.

(70)

Main theorem [Clarke, Grumberg & Hamaguchi; 94]

Theorem

THEOREM: M.s 0 |= Eψ iff there is a state s in T ψ s.t. (s, s 0 ) ∈ sat(ψ) and T ψ × M, (s, s 0 ) |= EGtrue under the fairness conditions:

{sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs in ψ}.

=⇒ M |= Eψ iff T ψ × M |= E f Gtrue

=⇒ M |= ¬ψ iff T ψ × M 6|= E f Gtrue LTL M.C. reduced to Fair CTL M.C.!!!

Symbolic OBDD-based techniques apply.

Note

The transition relation R of T ψ × M may not be total.

=⇒ Check_FairEG does not need to consider states without

successors, restricting R to the remaining states.

(71)

Main theorem [Clarke, Grumberg & Hamaguchi; 94]

Theorem

THEOREM: M.s 0 |= Eψ iff there is a state s in T ψ s.t. (s, s 0 ) ∈ sat(ψ) and T ψ × M, (s, s 0 ) |= EGtrue under the fairness conditions:

{sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs in ψ}.

=⇒ M |= Eψ iff T ψ × M |= E f Gtrue

=⇒ M |= ¬ψ iff T ψ × M 6|= E f Gtrue LTL M.C. reduced to Fair CTL M.C.!!!

Symbolic OBDD-based techniques apply.

Note

The transition relation R of T ψ × M may not be total.

=⇒ Check_FairEG does not need to consider states without

successors, restricting R to the remaining states.

(72)

Main theorem [Clarke, Grumberg & Hamaguchi; 94]

Theorem

THEOREM: M.s 0 |= Eψ iff there is a state s in T ψ s.t. (s, s 0 ) ∈ sat(ψ) and T ψ × M, (s, s 0 ) |= EGtrue under the fairness conditions:

{sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs in ψ}.

=⇒ M |= Eψ iff T ψ × M |= E f Gtrue

=⇒ M |= ¬ψ iff T ψ × M 6|= E f Gtrue LTL M.C. reduced to Fair CTL M.C.!!!

Symbolic OBDD-based techniques apply.

Note

The transition relation R of T ψ × M may not be total.

=⇒ Check_FairEG does not need to consider states without

successors, restricting R to the remaining states.

(73)

Main theorem [Clarke, Grumberg & Hamaguchi; 94]

Theorem

THEOREM: M.s 0 |= Eψ iff there is a state s in T ψ s.t. (s, s 0 ) ∈ sat(ψ) and T ψ × M, (s, s 0 ) |= EGtrue under the fairness conditions:

{sat(¬(ϕ 1 2 ) ∨ ϕ 2 )) s.t. (ϕ 1 2 ) occurs in ψ}.

=⇒ M |= Eψ iff T ψ × M |= E f Gtrue

=⇒ M |= ¬ψ iff T ψ × M 6|= E f Gtrue LTL M.C. reduced to Fair CTL M.C.!!!

Symbolic OBDD-based techniques apply.

Note

The transition relation R of T ψ × M may not be total.

=⇒ Check_FairEG does not need to consider states without

successors, restricting R to the remaining states.

(74)

Outline

1 The problem

2 The general algorithm Compute the tableau T ψ Compute the product M × T ψ Check the emptiness of L(M × T ψ )

3 An example

4 Exercises

(75)

A microwave oven

4 variables: start, close, heat, error

Actions (implicit): start_oven,open_door, close_door, reset, warmup, start_cooking, cook, done

Error situation: if oven is started while the door is open

Represented as a Kripke structure (and hence as a OBDD’s)

(76)

A microwave oven [cont.]

1

2 3 4

5 6 7

−start

−close

−heat

−error

−close

−heat

−start

−heat

−error

−start

−error

−error

−heat

−error

−heat start

error

close close

heat

start close error

start close

start close heat start_owen open_door

close_door

open_door

open_door

close_door reset start_owen start_cooking

warmup done

cook

(77)

A microwave oven: symbolic representation

Initial states: I M (s, c, h, e) = ¬s ∧ ¬h ∧ ¬e

Transition relation: R M (s, c, h, e, s 0 , c 0 , h 0 , e 0 ) = [a simplification of]

( ¬s∧¬c∧¬h∧¬e∧¬s 0 ∧ c 0 ∧¬h 0 ∧¬e 0 ) ∨ (close_door , no error ) ( s∧¬c∧¬h∧ e∧ s 0 ∧ c 0 ∧¬h 0 ∧ e 0 ) ∨ (close_door , error ) ( ¬s∧ c ∧¬e∧¬s 0 ∧¬c 0 ∧¬h 0 ∧¬e 0 ) ∨ (open_door , no error ) ( s∧ c∧¬h∧ e∧ s 0 ∧¬c 0 ∧¬h 0 ∧ e 0 ) ∨ (open_door , error ) ( ¬s∧ c∧¬h∧¬e∧ s 0 ∧ c 0 ∧¬h 0 ∧¬e 0 ) ∨ (start_oven, no error ) ( ¬s∧¬c∧¬h∧¬e∧ s 0 ∧¬c 0 ∧¬h 0 ∧ e 0 ) ∨ (start_oven, error ) ( s∧ c∧¬h∧ e∧¬s 0 ∧ c 0 ∧¬h 0 ∧¬e 0 ) ∨ (reset)

( s∧ c∧¬h∧¬e∧ s 0 ∧ c 0 ∧ h 0 ∧¬e 0 ) ∨ (warmup) ( s∧ c∧ h∧¬e∧¬s 0 ∧ c 0 ∧ h 0 ∧¬e 0 ) ∨ (start_cooking) ( ¬s∧ c∧ h∧¬e∧¬s 0 ∧ c 0 ∧ h 0 ∧¬e 0 ) ∨ (cook )

( ¬s∧ c∧ h∧¬e∧¬s 0 ∧ c 0 ∧¬h 0 ∧¬e 0 ) (done)

Note: the third row represents two transitions: 3 → 1 and 4 → 1.

(78)

A microwave oven: symbolic representation

Initial states: I M (s, c, h, e) = ¬s ∧ ¬h ∧ ¬e

Transition relation: R M (s, c, h, e, s 0 , c 0 , h 0 , e 0 ) = [a simplification of]

( ¬s∧¬c∧¬h∧¬e∧¬s 0 ∧ c 0 ∧¬h 0 ∧¬e 0 ) ∨ (close_door , no error ) ( s∧¬c∧¬h∧ e∧ s 0 ∧ c 0 ∧¬h 0 ∧ e 0 ) ∨ (close_door , error ) ( ¬s∧ c ∧¬e∧¬s 0 ∧¬c 0 ∧¬h 0 ∧¬e 0 ) ∨ (open_door , no error ) ( s∧ c∧¬h∧ e∧ s 0 ∧¬c 0 ∧¬h 0 ∧ e 0 ) ∨ (open_door , error ) ( ¬s∧ c∧¬h∧¬e∧ s 0 ∧ c 0 ∧¬h 0 ∧¬e 0 ) ∨ (start_oven, no error ) ( ¬s∧¬c∧¬h∧¬e∧ s 0 ∧¬c 0 ∧¬h 0 ∧ e 0 ) ∨ (start_oven, error ) ( s∧ c∧¬h∧ e∧¬s 0 ∧ c 0 ∧¬h 0 ∧¬e 0 ) ∨ (reset)

( s∧ c∧¬h∧¬e∧ s 0 ∧ c 0 ∧ h 0 ∧¬e 0 ) ∨ (warmup) ( s∧ c∧ h∧¬e∧¬s 0 ∧ c 0 ∧ h 0 ∧¬e 0 ) ∨ (start_cooking) ( ¬s∧ c∧ h∧¬e∧¬s 0 ∧ c 0 ∧ h 0 ∧¬e 0 ) ∨ (cook )

( ¬s∧ c∧ h∧¬e∧¬s 0 ∧ c 0 ∧¬h 0 ∧¬e 0 ) (done)

Note: the third row represents two transitions: 3 → 1 and 4 → 1.

(79)

LTL specification

“necessarily, the oven’s door eventually closes and, till there, the oven does not heat”:

M |= A(¬heat U close), i.e.,

M |= ¬E¬(¬heat U close)

(80)

Tableau construction for ψ = ¬(¬heat U close)

ϕ := ¬ψ = (¬heat U close) Tableaux expansion:

ψ = ¬(¬heat U close) = ¬(close ∨ (¬heat ∧ X(¬heat U close))) el(ψ) = el(ϕ) = {heat, close, Xϕ} ({h, c, Xϕ})

States:

1 := {¬h, c, Xϕ}, 2 := {h, c, Xϕ}, 3 := {¬h, ¬c, Xϕ},

4 := {h, c, ¬Xϕ}, 5 := {h, ¬c, Xϕ}, 6 := {¬h, c, ¬Xϕ},

7 := {¬h, ¬c, ¬Xϕ}, 8 := {h, ¬c, ¬Xϕ}

(81)

Tableau construction for ψ = ¬(¬heat U close)

ϕ := ¬ψ = (¬heat U close) Tableaux expansion:

ψ = ¬(¬heat U close) = ¬(close ∨ (¬heat ∧ X(¬heat U close))) el(ψ) = el(ϕ) = {heat, close, Xϕ} ({h, c, Xϕ})

States:

1 := {¬h, c, Xϕ}, 2 := {h, c, Xϕ}, 3 := {¬h, ¬c, Xϕ},

4 := {h, c, ¬Xϕ}, 5 := {h, ¬c, Xϕ}, 6 := {¬h, c, ¬Xϕ},

7 := {¬h, ¬c, ¬Xϕ}, 8 := {h, ¬c, ¬Xϕ}

(82)

Tableau construction for ψ = ¬(¬heat U close)

ϕ := ¬ψ = (¬heat U close) Tableaux expansion:

ψ = ¬(¬heat U close) = ¬(close ∨ (¬heat ∧ X(¬heat U close))) el(ψ) = el(ϕ) = {heat, close, Xϕ} ({h, c, Xϕ})

States:

1 := {¬h, c, Xϕ}, 2 := {h, c, Xϕ}, 3 := {¬h, ¬c, Xϕ},

4 := {h, c, ¬Xϕ}, 5 := {h, ¬c, Xϕ}, 6 := {¬h, c, ¬Xϕ},

7 := {¬h, ¬c, ¬Xϕ}, 8 := {h, ¬c, ¬Xϕ}

(83)

Tableau construction for ψ = ¬(¬heat U close)

ϕ := ¬ψ = (¬heat U close) Tableaux expansion:

ψ = ¬(¬heat U close) = ¬(close ∨ (¬heat ∧ X(¬heat U close))) el(ψ) = el(ϕ) = {heat, close, Xϕ} ({h, c, Xϕ})

States:

1 := {¬h, c, Xϕ}, 2 := {h, c, Xϕ}, 3 := {¬h, ¬c, Xϕ},

4 := {h, c, ¬Xϕ}, 5 := {h, ¬c, Xϕ}, 6 := {¬h, c, ¬Xϕ},

7 := {¬h, ¬c, ¬Xϕ}, 8 := {h, ¬c, ¬Xϕ}

(84)

Tableau construction for ψ = ¬(¬heat U close) [cont.]

−Xϕ −Xϕ

−Xϕ −Xϕ

−h

−h

−h

−h h

h h

h

c c −c

−c

c c

−c −c

2 3 1

4

5 6

7 8

. .

.

.

(85)

Tableau construction for ψ = ¬(¬heat U close)

...

States:

1 := {¬h, c, Xϕ}, 2 := {h, c, Xϕ}, 3 := {¬h, ¬c, Xϕ}, 4 := {h, c, ¬Xϕ}, 5 := {h, ¬c, Xϕ}, 6 := {¬h, c, ¬Xϕ}, 7 := {¬h, ¬c, ¬Xϕ}, 8 := {h, ¬c, ¬Xϕ}

sat():

sat(h) = {2, 4, 5, 8} =⇒ sat(¬h) = {1, 3, 6, 7}, sat(c) = {1, 2, 4, 6} =⇒ sat(¬c) = {3, 5, 7, 8}, sat(Xϕ) = {1, 2, 3, 5} =⇒ sat(¬Xϕ) = {4, 6, 7, 8},

sat(ϕ) = sat(c) ∪ (sat(¬h) ∩ sat(X(¬h U c))) = {1, 2, 3, 4, 6}

=⇒ sat(ψ) = sat(¬ϕ) = {5, 7, 8}

(86)

Tableau construction for ψ = ¬(¬heat U close)

...

States:

1 := {¬h, c, Xϕ}, 2 := {h, c, Xϕ}, 3 := {¬h, ¬c, Xϕ}, 4 := {h, c, ¬Xϕ}, 5 := {h, ¬c, Xϕ}, 6 := {¬h, c, ¬Xϕ}, 7 := {¬h, ¬c, ¬Xϕ}, 8 := {h, ¬c, ¬Xϕ}

sat():

sat(h) = {2, 4, 5, 8} =⇒ sat(¬h) = {1, 3, 6, 7}, sat(c) = {1, 2, 4, 6} =⇒ sat(¬c) = {3, 5, 7, 8}, sat(Xϕ) = {1, 2, 3, 5} =⇒ sat(¬Xϕ) = {4, 6, 7, 8},

sat(ϕ) = sat(c) ∪ (sat(¬h) ∩ sat(X(¬h U c))) = {1, 2, 3, 4, 6}

=⇒ sat(ψ) = sat(¬ϕ) = {5, 7, 8}

(87)

Tableau construction for ψ = ¬(¬heat U close) [cont.]

−Xϕ −Xϕ

−Xϕ −Xϕ

−h

−h

−h

−h h

h h

h

c c −c

−c

c c

−c −c

2 3 1

4

5 6

7 8

. .

. .

sat(−h)

sat(−h)

sat(−h)

sat(h)

(88)

Tableau construction for ψ = ¬(¬heat U close) [cont.]

−Xϕ −Xϕ

−Xϕ −Xϕ

−h

−h

−h

−h h

h h

h

c c −c

−c

c c

−c −c

2 3 1

4

5 6

7 8

. .

. .

sat(−h)

sat(−h)

sat(−h)

sat(h)

sat(c)

sat(c)

Riferimenti

Documenti correlati

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..

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)

Example: although state 3 belongs to sat(¬heat Uclose), the path which loops forever in 3 does not satisfy ¬heatUclose, as close never holds in that path. We restrict the

Given the following generalized Büchi automaton A def = hQ, Σ, δ, I, FT i, with two sets of accepting states FT def = {F 1, F 2} s.t.. Ex:

From LTL Formulas to Büchi Automata: generalities On-the-fly construction of Bu¨chi Automata from LTL Complexity..

limited sensitivity: one good setting, does not require expert users much higher capacity (more variables) than BDD based techniques Various techniques: Bounded Model