Basics of model checking Paul Gastin LIAFA (Paris) and LSV (Cachan) - - PowerPoint PPT Presentation

basics of model checking
SMART_READER_LITE
LIVE PREVIEW

Basics of model checking Paul Gastin LIAFA (Paris) and LSV (Cachan) - - PowerPoint PPT Presentation

Basics of model checking Paul Gastin LIAFA (Paris) and LSV (Cachan) Paul.Gastin@liafa.jussieu.fr Paul.Gastin@lsv.ens-cachan.fr MOVEP, Dec. 2004 1/71 Outline Introduction 1 Models 2 Specification 3 Linear Time Specifications Branching


slide-1
SLIDE 1

1/71

Basics of model checking

Paul Gastin

LIAFA (Paris) and LSV (Cachan) Paul.Gastin@liafa.jussieu.fr Paul.Gastin@lsv.ens-cachan.fr

MOVEP, Dec. 2004

slide-2
SLIDE 2

2/71

Outline

1

Introduction

2

Models

3

Specification Linear Time Specifications Branching Time Specifications

slide-3
SLIDE 3

3/71

Need for formal verifications methods

Critical systems

◮ Transport ◮ Energy ◮ Medicine ◮ Communication ◮ Finance ◮ Embedded systems ◮ . . .

Complementary approaches

◮ Theorem prover ◮ Model checking ◮ Test

slide-4
SLIDE 4

3/71

Need for formal verifications methods

Critical systems

◮ Transport ◮ Energy ◮ Medicine ◮ Communication ◮ Finance ◮ Embedded systems ◮ . . .

Complementary approaches

◮ Theorem prover ◮ Model checking ◮ Test

slide-5
SLIDE 5

4/71

Model Checking

3 steps

◮ Constructing the model M (transition systems) ◮ Formalizing the specification ϕ (temporal logics) ◮ Checking whether M |

= ϕ (algorithmics)

Main difficulties

◮ Size of models (combinatorial explosion) ◮ Expressivity of models or logics ◮ Decidability and complexity of the model-checking problem ◮ Efficiency of tools

Challenges

◮ Extend models and algorithms to cope with more systems.

Infinite systems, parameterized systems, probabilistic systems, concurrent systems, timed systems, hybrid systems, . . .

◮ Scale current tools to cope with real-size systems.

Needs for modularity, abstractions, symmetries, . . .

slide-6
SLIDE 6

4/71

Model Checking

3 steps

◮ Constructing the model M (transition systems) ◮ Formalizing the specification ϕ (temporal logics) ◮ Checking whether M |

= ϕ (algorithmics)

Main difficulties

◮ Size of models (combinatorial explosion) ◮ Expressivity of models or logics ◮ Decidability and complexity of the model-checking problem ◮ Efficiency of tools

Challenges

◮ Extend models and algorithms to cope with more systems.

Infinite systems, parameterized systems, probabilistic systems, concurrent systems, timed systems, hybrid systems, . . .

◮ Scale current tools to cope with real-size systems.

Needs for modularity, abstractions, symmetries, . . .

slide-7
SLIDE 7

4/71

Model Checking

3 steps

◮ Constructing the model M (transition systems) ◮ Formalizing the specification ϕ (temporal logics) ◮ Checking whether M |

= ϕ (algorithmics)

Main difficulties

◮ Size of models (combinatorial explosion) ◮ Expressivity of models or logics ◮ Decidability and complexity of the model-checking problem ◮ Efficiency of tools

Challenges

◮ Extend models and algorithms to cope with more systems.

Infinite systems, parameterized systems, probabilistic systems, concurrent systems, timed systems, hybrid systems, . . .

◮ Scale current tools to cope with real-size systems.

Needs for modularity, abstractions, symmetries, . . .

slide-8
SLIDE 8

5/71

References

◮ The Temporal Logic of Reactive and Concurrent Systems: Specification.

  • Z. Manna and A. Pnueli. Springer, 1991.

◮ Temporal Verification of Reactive Systems: Safety. Z. Manna and A. Pnueli.

Springer, 1995.

◮ Model Checking. E.M. Clarke, O. Grumberg, D.A. Peled. MIT Press, 1999. ◮ Systems and Software Verification. Model-Checking Techniques and Tools.

  • B. B´

erard, M. Bidoit, A. Finkel, F. Laroussinie, A. Petit, L. Petrucci, and

  • Ph. Schnoebelen. Springer, 2001.
slide-9
SLIDE 9

6/71

Outline

1

Introduction

2

Models

3

Specification Linear Time Specifications Branching Time Specifications

slide-10
SLIDE 10

7/71

Constructing the model

Example : Men, Wolf, Goat, Cabbage Model = Transition system

◮ State = who is on which side of the river ◮ Transition = crossing the river

slide-11
SLIDE 11

7/71

Constructing the model

Example : Men, Wolf, Goat, Cabbage Model = Transition system

◮ State = who is on which side of the river ◮ Transition = crossing the river

slide-12
SLIDE 12

8/71

Transition system

MWGC WC MG MWC G C MWG W MGC MGC W MWG C G MWC MG WC MWGC

slide-13
SLIDE 13

9/71

Kripke structure

M = (S, A, T, I, AP, ℓ)

◮ S: set of states (often finite) ◮ T ⊆ S × A × S: set of transitions ◮ I ⊆ S: set of initial states ◮ AP: set of atomic propositions ◮ ℓ : S → 2AP: labelling function.

Digicode Pb: How can we easily describe big systems?

slide-14
SLIDE 14

9/71

Kripke structure

M = (S, A, T, I, AP, ℓ)

◮ S: set of states (often finite) ◮ T ⊆ S × A × S: set of transitions ◮ I ⊆ S: set of initial states ◮ AP: set of atomic propositions ◮ ℓ : S → 2AP: labelling function.

Digicode

1 2 3 4 OPEN A B A B, C A C B, C

Pb: How can we easily describe big systems?

slide-15
SLIDE 15

9/71

Kripke structure

M = (S, A, T, I, AP, ℓ)

◮ S: set of states (often finite) ◮ T ⊆ S × A × S: set of transitions ◮ I ⊆ S: set of initial states ◮ AP: set of atomic propositions ◮ ℓ : S → 2AP: labelling function.

Digicode

1 2 3 4 OPEN A B A B, C A C B, C

Pb: How can we easily describe big systems?

slide-16
SLIDE 16

10/71

Using variables

Digicode

1 2 3 4 OPEN A B A cpt < n B, C cpt++ cpt < n A cpt++ cpt < n C cpt++ cpt < n B, C cpt++ 5 ERROR cpt = n B, C cpt++ cpt = n A, C cpt++ cpt = n B, C cpt++

slide-17
SLIDE 17

11/71

Kripke structures with variables

M = (S, A, V, T, I, AP, ℓ)

◮ V: set of (typed) variables, e.g., boolean, [0..4], . . . ◮ Condition: formula involving variables ◮ Update: modification of variables ◮ Transition: p

condition,label,update

− − − − − − − − − − − − − − → q

Programs = Kripke structures with variables

◮ Program counter = states ◮ Instructions = transitions ◮ Variables = variables

slide-18
SLIDE 18

11/71

Kripke structures with variables

M = (S, A, V, T, I, AP, ℓ)

◮ V: set of (typed) variables, e.g., boolean, [0..4], . . . ◮ Condition: formula involving variables ◮ Update: modification of variables ◮ Transition: p

condition,label,update

− − − − − − − − − − − − − − → q

Programs = Kripke structures with variables

◮ Program counter = states ◮ Instructions = transitions ◮ Variables = variables

slide-19
SLIDE 19

12/71

Expanding variables (n = 2)

Digicode

1,0 2,0 3,0 4,0 OPEN A B A 1,1 2,1 3,1 4,1 OPEN A B A B, C C B, C A 1,2 2,2 3,2 4,2 OPEN A B A B, C C B, C A 5,3 ERROR B, C A, C B, C

slide-20
SLIDE 20

13/71

Symbolic representation

Logical representation

1 2 3 4 OPEN A B A cpt < n B, C cpt++ cpt < n A cpt++ cpt < n C cpt++ cpt < n B, C cpt++ 5 ERROR cpt = n B, C cpt++ cpt = n A, C cpt++ cpt = n B, C cpt++

δB = s = 1 ∧ cpt < n ∧ s′ = 1 ∧ cpt′ = cpt + 1 ∨ s = 1 ∧ cpt = n ∧ s′ = 5 ∧ cpt′ = cpt + 1 ∨ s = 2 ∧ s′ = 3 ∧ cpt′ = cpt ∨ s = 3 ∧ cpt < n ∧ s′ = 1 ∧ cpt′ = cpt + 1 ∨ s = 3 ∧ cpt = n ∧ s′ = 5 ∧ cpt′ = cpt + 1

slide-21
SLIDE 21

14/71

Modular description of concurrent systems

Elevator

◮ Cabin:

1 2

◮ Door for level i:

Closed Opened

◮ Call for level i:

False True The actual system is a synchronized product of all these automata. It consists of (at most) 3 × 23 × 23 = 192 states.

slide-22
SLIDE 22

14/71

Modular description of concurrent systems

Elevator

◮ Cabin:

1 2

◮ Door for level i:

Closed Opened

◮ Call for level i:

False True The actual system is a synchronized product of all these automata. It consists of (at most) 3 × 23 × 23 = 192 states.

slide-23
SLIDE 23

15/71

Synchronized products

General product

◮ Components: Mi = (Si, Ai, Ti, Ii, APi, ℓi) ◮ Product: M = (S, A, T, I, AP, ℓ) with

S =

i Si,

A =

i(Ai ∪ {ε}),

and I =

i Ii

T = {(p1, . . . , pn)

(a1,...,an)

− − − − − − → (q1, . . . , qn) | for all i, (pi, ai, qi) ∈ Ti or pi = qi and ai = ε} AP =

i APi and ℓ(p1, . . . , pn) = i ℓ(pi)

Synchronized products are restrictions of the general product.

◮ Synchronous: Async = i Ai ◮ Asynchronous: Async = i Ai ◮ By states: Ssync ⊆ S ◮ By labels: Async ⊆ A ◮ By transitions: Tsync ⊆ T

slide-24
SLIDE 24

15/71

Synchronized products

General product

◮ Components: Mi = (Si, Ai, Ti, Ii, APi, ℓi) ◮ Product: M = (S, A, T, I, AP, ℓ) with

S =

i Si,

A =

i(Ai ∪ {ε}),

and I =

i Ii

T = {(p1, . . . , pn)

(a1,...,an)

− − − − − − → (q1, . . . , qn) | for all i, (pi, ai, qi) ∈ Ti or pi = qi and ai = ε} AP =

i APi and ℓ(p1, . . . , pn) = i ℓ(pi)

Synchronized products are restrictions of the general product.

◮ Synchronous: Async = i Ai ◮ Asynchronous: Async = i Ai ◮ By states: Ssync ⊆ S ◮ By labels: Async ⊆ A ◮ By transitions: Tsync ⊆ T

slide-25
SLIDE 25

15/71

Synchronized products

General product

◮ Components: Mi = (Si, Ai, Ti, Ii, APi, ℓi) ◮ Product: M = (S, A, T, I, AP, ℓ) with

S =

i Si,

A =

i(Ai ∪ {ε}),

and I =

i Ii

T = {(p1, . . . , pn)

(a1,...,an)

− − − − − − → (q1, . . . , qn) | for all i, (pi, ai, qi) ∈ Ti or pi = qi and ai = ε} AP =

i APi and ℓ(p1, . . . , pn) = i ℓ(pi)

Synchronized products are restrictions of the general product.

◮ Synchronous: Async = i Ai ◮ Asynchronous: Async = i Ai ◮ By states: Ssync ⊆ S ◮ By labels: Async ⊆ A ◮ By transitions: Tsync ⊆ T

slide-26
SLIDE 26

15/71

Synchronized products

General product

◮ Components: Mi = (Si, Ai, Ti, Ii, APi, ℓi) ◮ Product: M = (S, A, T, I, AP, ℓ) with

S =

i Si,

A =

i(Ai ∪ {ε}),

and I =

i Ii

T = {(p1, . . . , pn)

(a1,...,an)

− − − − − − → (q1, . . . , qn) | for all i, (pi, ai, qi) ∈ Ti or pi = qi and ai = ε} AP =

i APi and ℓ(p1, . . . , pn) = i ℓ(pi)

Synchronized products are restrictions of the general product.

◮ Synchronous: Async = i Ai ◮ Asynchronous: Async = i Ai ◮ By states: Ssync ⊆ S ◮ By labels: Async ⊆ A ◮ By transitions: Tsync ⊆ T

slide-27
SLIDE 27

15/71

Synchronized products

General product

◮ Components: Mi = (Si, Ai, Ti, Ii, APi, ℓi) ◮ Product: M = (S, A, T, I, AP, ℓ) with

S =

i Si,

A =

i(Ai ∪ {ε}),

and I =

i Ii

T = {(p1, . . . , pn)

(a1,...,an)

− − − − − − → (q1, . . . , qn) | for all i, (pi, ai, qi) ∈ Ti or pi = qi and ai = ε} AP =

i APi and ℓ(p1, . . . , pn) = i ℓ(pi)

Synchronized products are restrictions of the general product.

◮ Synchronous: Async = i Ai ◮ Asynchronous: Async = i Ai ◮ By states: Ssync ⊆ S ◮ By labels: Async ⊆ A ◮ By transitions: Tsync ⊆ T

slide-28
SLIDE 28

15/71

Synchronized products

General product

◮ Components: Mi = (Si, Ai, Ti, Ii, APi, ℓi) ◮ Product: M = (S, A, T, I, AP, ℓ) with

S =

i Si,

A =

i(Ai ∪ {ε}),

and I =

i Ii

T = {(p1, . . . , pn)

(a1,...,an)

− − − − − − → (q1, . . . , qn) | for all i, (pi, ai, qi) ∈ Ti or pi = qi and ai = ε} AP =

i APi and ℓ(p1, . . . , pn) = i ℓ(pi)

Synchronized products are restrictions of the general product.

◮ Synchronous: Async = i Ai ◮ Asynchronous: Async = i Ai ◮ By states: Ssync ⊆ S ◮ By labels: Async ⊆ A ◮ By transitions: Tsync ⊆ T

slide-29
SLIDE 29

15/71

Synchronized products

General product

◮ Components: Mi = (Si, Ai, Ti, Ii, APi, ℓi) ◮ Product: M = (S, A, T, I, AP, ℓ) with

S =

i Si,

A =

i(Ai ∪ {ε}),

and I =

i Ii

T = {(p1, . . . , pn)

(a1,...,an)

− − − − − − → (q1, . . . , qn) | for all i, (pi, ai, qi) ∈ Ti or pi = qi and ai = ε} AP =

i APi and ℓ(p1, . . . , pn) = i ℓ(pi)

Synchronized products are restrictions of the general product.

◮ Synchronous: Async = i Ai ◮ Asynchronous: Async = i Ai ◮ By states: Ssync ⊆ S ◮ By labels: Async ⊆ A ◮ By transitions: Tsync ⊆ T

slide-30
SLIDE 30

16/71

Example: Printer manager

Synchronization by states: (P, P) is forbidden

Idle Wait Print Idle Wait Print I, I I, W I, P W, I W, W W, P P, I P, W

slide-31
SLIDE 31

17/71

Example: Elevator

Synchronization by actions

Cabin: 1 2 ?up !leave0 !reach1 ?up !leave1 !reach2 ?up ?down !leave2 !reach1 ?down !leave1 !reach0 ?down Door for level i: Closed Opened ?reachi ?reachi ?leavei ?leavei

slide-32
SLIDE 32

18/71

Example: digicode

Synchronization by transitions

1 2 3 4 OPEN A B A B, C A C B, C 1,0 2,0 3,0 4,0 OPEN A B A 1,1 2,1 3,1 4,1 OPEN A B A B, C C B, C A 1,2 2,2 3,2 4,2 OPEN A B A B, C C B, C A 5,3 ERROR B, C A, C B, C 1 2 3 ERROR

slide-33
SLIDE 33

19/71

Example: Peterson’s algorithm (1981)

Synchronization by shared variables

1 2 3 4 req[i]:=true turn:=1-i if turn=i if req[1-i]=false req[i]:=false else The global state is a 5-tuple: (state0, state1, req[0], req[1], turn)

slide-34
SLIDE 34

19/71

Example: Peterson’s algorithm (1981)

Synchronization by shared variables

1 2 3 4 req[i]:=true turn:=1-i if turn=i if req[1-i]=false req[i]:=false else The global state is a 5-tuple: (state0, state1, req[0], req[1], turn)

slide-35
SLIDE 35

20/71

High-level descriptions

◮ Sequential programs = transition system with variables ◮ Concurrent programs with shared variables ◮ Concurrent programs with Rendez-vous ◮ Concurrent programs with FIFO communication ◮ Petri net ◮ . . .

slide-36
SLIDE 36

21/71

Models: expressivity versus decidability

(Un)decidability

◮ Automata with 2 integer variables = Turing powerful

Restriction to variables taking values in finite sets

◮ Asynchronous communication: unbounded fifo channels = Turing powerful

Restriction to bounded channels

Some infinite state models are decidable

◮ Petri nets. Several unbounded integer variables but no zero-test. ◮ Pushdown automata. Model for recursive procedure calls. ◮ Timed automata. ◮ . . .

slide-37
SLIDE 37

21/71

Models: expressivity versus decidability

(Un)decidability

◮ Automata with 2 integer variables = Turing powerful

Restriction to variables taking values in finite sets

◮ Asynchronous communication: unbounded fifo channels = Turing powerful

Restriction to bounded channels

Some infinite state models are decidable

◮ Petri nets. Several unbounded integer variables but no zero-test. ◮ Pushdown automata. Model for recursive procedure calls. ◮ Timed automata. ◮ . . .

slide-38
SLIDE 38

22/71

Outline

1

Introduction

2

Models

3

Specification Linear Time Specifications Branching Time Specifications

slide-39
SLIDE 39

23/71

Static and dynamic properties

Static properties

Example: Mutual exclusion Most safety properties are static. They can be reduced to reachability.

Dynamic properties

Example: Every request should be eventually granted.

  • i

∀t, (Calli(t) − → ∃t′ ≥ t, (atLeveli(t′) ∧ openDoori(t′))) The elevator should not cross a level for which a call is pending without stopping.

  • i

∀t∀t′, (Calli(t) ∧ t ≤ t′ ∧ atLeveli(t′)) − → ∃t ≤ t′′ ≤ t′, (atLeveli(t′′) ∧ openDoori(t′′)))

slide-40
SLIDE 40

23/71

Static and dynamic properties

Static properties

Example: Mutual exclusion Most safety properties are static. They can be reduced to reachability.

Dynamic properties

Example: Every request should be eventually granted.

  • i

∀t, (Calli(t) − → ∃t′ ≥ t, (atLeveli(t′) ∧ openDoori(t′))) The elevator should not cross a level for which a call is pending without stopping.

  • i

∀t∀t′, (Calli(t) ∧ t ≤ t′ ∧ atLeveli(t′)) − → ∃t ≤ t′′ ≤ t′, (atLeveli(t′′) ∧ openDoori(t′′)))

slide-41
SLIDE 41

24/71

First Order specifications

First order logic

◮ These specifications can be written in FO(<). ◮ FO(<) has a good expressive power.

. . . but FO(<)-formulas are not easy to write and to understand.

◮ FO(<) is decidable.

. . . but satisfiability and model checking are non elementary.

Temporal logics

◮ no variables: time is implicit. ◮ quantifications and variables are replaced by modalities. ◮ Usual specifications are easy to write and read. ◮ Good complexity for satisfiability and model checking problems.

slide-42
SLIDE 42

24/71

First Order specifications

First order logic

◮ These specifications can be written in FO(<). ◮ FO(<) has a good expressive power.

. . . but FO(<)-formulas are not easy to write and to understand.

◮ FO(<) is decidable.

. . . but satisfiability and model checking are non elementary.

Temporal logics

◮ no variables: time is implicit. ◮ quantifications and variables are replaced by modalities. ◮ Usual specifications are easy to write and read. ◮ Good complexity for satisfiability and model checking problems.

slide-43
SLIDE 43

25/71

Linear versus Branching

Let M = (S, T, I, AP, ℓ) be a Kripke structure.

Linear specifications

Example: The printer manager is fair. On each run, whenever some process requests the printer, it eventually gets it. Execution sequences (runs): σ = s0 → s1 → s2 → · · · with si → si+1 ∈ T Two Kripke structures having the same execution sequences satisfy the same linear specifications. Actually, linear specifications only depend on the label of the execution sequence ℓ(σ) = ℓ(s0) → ℓ(s1) → ℓ(s2) → · · ·

Branching specifications

Example: Each process has the possibility to print first. Such properties depend on the execution tree. Execution tree = unfolding of the transition system

slide-44
SLIDE 44

25/71

Linear versus Branching

Let M = (S, T, I, AP, ℓ) be a Kripke structure.

Linear specifications

Example: The printer manager is fair. On each run, whenever some process requests the printer, it eventually gets it. Execution sequences (runs): σ = s0 → s1 → s2 → · · · with si → si+1 ∈ T Two Kripke structures having the same execution sequences satisfy the same linear specifications. Actually, linear specifications only depend on the label of the execution sequence ℓ(σ) = ℓ(s0) → ℓ(s1) → ℓ(s2) → · · ·

Branching specifications

Example: Each process has the possibility to print first. Such properties depend on the execution tree. Execution tree = unfolding of the transition system

slide-45
SLIDE 45

26/71

Outline

1

Introduction

2

Models

3

Specification Linear Time Specifications Branching Time Specifications

slide-46
SLIDE 46

27/71

Linear Temporal Logic (Pnueli 1977)

Syntax: LTL(AP, X, U)

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | X ϕ | ϕ U ϕ

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = p if p ∈ λ(x) t, x | = ¬ϕ if t, x | = ϕ t, x | = ϕ ∨ ψ if t, x | = ϕ or t, x | = ψ t, x | = X ϕ if ∃y. x ⋖ y & t, y | = ϕ t, x | = ϕ U ψ if ∃z. x ≤ z & t, z | = ψ & ∀y. (x ≤ y < z) → t, y | = ϕ

Example

slide-47
SLIDE 47

27/71

Linear Temporal Logic (Pnueli 1977)

Syntax: LTL(AP, X, U)

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | X ϕ | ϕ U ϕ

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = p if p ∈ λ(x) t, x | = ¬ϕ if t, x | = ϕ t, x | = ϕ ∨ ψ if t, x | = ϕ or t, x | = ψ t, x | = X ϕ if ∃y. x ⋖ y & t, y | = ϕ t, x | = ϕ U ψ if ∃z. x ≤ z & t, z | = ψ & ∀y. (x ≤ y < z) → t, y | = ϕ

Example

p ∅ p, q p q ∅ p, r q, r q · · ·

slide-48
SLIDE 48

27/71

Linear Temporal Logic (Pnueli 1977)

Syntax: LTL(AP, X, U)

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | X ϕ | ϕ U ϕ

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = p if p ∈ λ(x) t, x | = ¬ϕ if t, x | = ϕ t, x | = ϕ ∨ ψ if t, x | = ϕ or t, x | = ψ t, x | = X ϕ if ∃y. x ⋖ y & t, y | = ϕ t, x | = ϕ U ψ if ∃z. x ≤ z & t, z | = ψ & ∀y. (x ≤ y < z) → t, y | = ϕ

Example

slide-49
SLIDE 49

27/71

Linear Temporal Logic (Pnueli 1977)

Syntax: LTL(AP, X, U)

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | X ϕ | ϕ U ϕ

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = p if p ∈ λ(x) t, x | = ¬ϕ if t, x | = ϕ t, x | = ϕ ∨ ψ if t, x | = ϕ or t, x | = ψ t, x | = X ϕ if ∃y. x ⋖ y & t, y | = ϕ t, x | = ϕ U ψ if ∃z. x ≤ z & t, z | = ψ & ∀y. (x ≤ y < z) → t, y | = ϕ

Example

X ϕ ϕ · · ·

slide-50
SLIDE 50

27/71

Linear Temporal Logic (Pnueli 1977)

Syntax: LTL(AP, X, U)

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | X ϕ | ϕ U ϕ

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = p if p ∈ λ(x) t, x | = ¬ϕ if t, x | = ϕ t, x | = ϕ ∨ ψ if t, x | = ϕ or t, x | = ψ t, x | = X ϕ if ∃y. x ⋖ y & t, y | = ϕ t, x | = ϕ U ψ if ∃z. x ≤ z & t, z | = ψ & ∀y. (x ≤ y < z) → t, y | = ϕ

Example

ϕ U ψ ϕ ϕ · · · ϕ ψ · · ·

slide-51
SLIDE 51

28/71

Linear Temporal Logic (Pnueli 1977)

Macros:

◮ Eventually:

F ϕ = ⊤ U ϕ F ϕ · · · ϕ · · ·

◮ Always:

G ϕ = ¬ F ¬ϕ

◮ Weak until: ϕ W ψ = G ϕ ∨ ϕ U ψ ◮

¬(ϕ U ψ) = (G ¬ψ) ∨ (¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ψ W (¬ϕ ∧ ¬ψ)

◮ Release:

ϕ R ψ = ψ W (ϕ ∧ ψ) = ¬(¬ϕ U ¬ψ)

◮ Next until:

ϕ XU ψ = X(ϕ U ψ)

X ψ = ⊥ XU ψ and ϕ U ψ = ψ ∨ (ϕ ∧ ϕ XU ψ).

slide-52
SLIDE 52

28/71

Linear Temporal Logic (Pnueli 1977)

Macros:

◮ Eventually:

F ϕ = ⊤ U ϕ F ϕ · · · ϕ · · ·

◮ Always:

G ϕ = ¬ F ¬ϕ G ϕ ϕ ϕ · · · ϕ ϕ ϕ · · ·

◮ Weak until: ϕ W ψ = G ϕ ∨ ϕ U ψ ◮

¬(ϕ U ψ) = (G ¬ψ) ∨ (¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ψ W (¬ϕ ∧ ¬ψ)

◮ Release:

ϕ R ψ = ψ W (ϕ ∧ ψ) = ¬(¬ϕ U ¬ψ)

◮ Next until:

ϕ XU ψ = X(ϕ U ψ)

X ψ = ⊥ XU ψ and ϕ U ψ = ψ ∨ (ϕ ∧ ϕ XU ψ).

slide-53
SLIDE 53

28/71

Linear Temporal Logic (Pnueli 1977)

Macros:

◮ Eventually:

F ϕ = ⊤ U ϕ F ϕ · · · ϕ · · ·

◮ Always:

G ϕ = ¬ F ¬ϕ G ϕ ϕ ϕ · · · ϕ ϕ ϕ · · ·

◮ Weak until: ϕ W ψ = G ϕ ∨ ϕ U ψ ◮

¬(ϕ U ψ) = (G ¬ψ) ∨ (¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ψ W (¬ϕ ∧ ¬ψ)

◮ Release:

ϕ R ψ = ψ W (ϕ ∧ ψ) = ¬(¬ϕ U ¬ψ)

◮ Next until:

ϕ XU ψ = X(ϕ U ψ)

X ψ = ⊥ XU ψ and ϕ U ψ = ψ ∨ (ϕ ∧ ϕ XU ψ).

slide-54
SLIDE 54

28/71

Linear Temporal Logic (Pnueli 1977)

Macros:

◮ Eventually:

F ϕ = ⊤ U ϕ F ϕ · · · ϕ · · ·

◮ Always:

G ϕ = ¬ F ¬ϕ G ϕ ϕ ϕ · · · ϕ ϕ ϕ · · ·

◮ Weak until: ϕ W ψ = G ϕ ∨ ϕ U ψ ◮

¬(ϕ U ψ) = (G ¬ψ) ∨ (¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ψ W (¬ϕ ∧ ¬ψ)

◮ Release:

ϕ R ψ = ψ W (ϕ ∧ ψ) = ¬(¬ϕ U ¬ψ)

◮ Next until:

ϕ XU ψ = X(ϕ U ψ)

X ψ = ⊥ XU ψ and ϕ U ψ = ψ ∨ (ϕ ∧ ϕ XU ψ).

slide-55
SLIDE 55

28/71

Linear Temporal Logic (Pnueli 1977)

Macros:

◮ Eventually:

F ϕ = ⊤ U ϕ F ϕ · · · ϕ · · ·

◮ Always:

G ϕ = ¬ F ¬ϕ G ϕ ϕ ϕ · · · ϕ ϕ ϕ · · ·

◮ Weak until: ϕ W ψ = G ϕ ∨ ϕ U ψ ◮

¬(ϕ U ψ) = (G ¬ψ) ∨ (¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ψ W (¬ϕ ∧ ¬ψ)

◮ Release:

ϕ R ψ = ψ W (ϕ ∧ ψ) = ¬(¬ϕ U ¬ψ)

◮ Next until:

ϕ XU ψ = X(ϕ U ψ)

X ψ = ⊥ XU ψ and ϕ U ψ = ψ ∨ (ϕ ∧ ϕ XU ψ).

slide-56
SLIDE 56

28/71

Linear Temporal Logic (Pnueli 1977)

Macros:

◮ Eventually:

F ϕ = ⊤ U ϕ F ϕ · · · ϕ · · ·

◮ Always:

G ϕ = ¬ F ¬ϕ G ϕ ϕ ϕ · · · ϕ ϕ ϕ · · ·

◮ Weak until: ϕ W ψ = G ϕ ∨ ϕ U ψ ◮

¬(ϕ U ψ) = (G ¬ψ) ∨ (¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ψ W (¬ϕ ∧ ¬ψ)

◮ Release:

ϕ R ψ = ψ W (ϕ ∧ ψ) = ¬(¬ϕ U ¬ψ)

◮ Next until:

ϕ XU ψ = X(ϕ U ψ) ϕ XU ψ ϕ · · · ϕ ψ · · ·

X ψ = ⊥ XU ψ and ϕ U ψ = ψ ∨ (ϕ ∧ ϕ XU ψ).

slide-57
SLIDE 57

28/71

Linear Temporal Logic (Pnueli 1977)

Macros:

◮ Eventually:

F ϕ = ⊤ U ϕ F ϕ · · · ϕ · · ·

◮ Always:

G ϕ = ¬ F ¬ϕ G ϕ ϕ ϕ · · · ϕ ϕ ϕ · · ·

◮ Weak until: ϕ W ψ = G ϕ ∨ ϕ U ψ ◮

¬(ϕ U ψ) = (G ¬ψ) ∨ (¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ψ W (¬ϕ ∧ ¬ψ)

◮ Release:

ϕ R ψ = ψ W (ϕ ∧ ψ) = ¬(¬ϕ U ¬ψ)

◮ Next until:

ϕ XU ψ = X(ϕ U ψ) ϕ XU ψ ϕ · · · ϕ ψ · · ·

X ψ = ⊥ XU ψ and ϕ U ψ = ψ ∨ (ϕ ∧ ϕ XU ψ).

slide-58
SLIDE 58

29/71

Linear Temporal Logic (Pnueli 1977)

Specifications:

◮ Safety:

G good

◮ MutEx:

¬ F(crit1 ∧ crit2)

◮ Liveness:

G F active

◮ Response:

G(request → F grant)

◮ Response’:

G(request → X(¬request U grant))

◮ Release:

reset R alarm

◮ Strong fairness:

G F request → G F grant

◮ Weak fairness:

F G request → G F grant

slide-59
SLIDE 59

29/71

Linear Temporal Logic (Pnueli 1977)

Specifications:

◮ Safety:

G good

◮ MutEx:

¬ F(crit1 ∧ crit2)

◮ Liveness:

G F active

◮ Response:

G(request → F grant)

◮ Response’:

G(request → X(¬request U grant))

◮ Release:

reset R alarm

◮ Strong fairness:

G F request → G F grant

◮ Weak fairness:

F G request → G F grant

slide-60
SLIDE 60

29/71

Linear Temporal Logic (Pnueli 1977)

Specifications:

◮ Safety:

G good

◮ MutEx:

¬ F(crit1 ∧ crit2)

◮ Liveness:

G F active

◮ Response:

G(request → F grant)

◮ Response’:

G(request → X(¬request U grant))

◮ Release:

reset R alarm

◮ Strong fairness:

G F request → G F grant

◮ Weak fairness:

F G request → G F grant

slide-61
SLIDE 61

29/71

Linear Temporal Logic (Pnueli 1977)

Specifications:

◮ Safety:

G good

◮ MutEx:

¬ F(crit1 ∧ crit2)

◮ Liveness:

G F active

◮ Response:

G(request → F grant)

◮ Response’:

G(request → X(¬request U grant))

◮ Release:

reset R alarm

◮ Strong fairness:

G F request → G F grant

◮ Weak fairness:

F G request → G F grant

slide-62
SLIDE 62

29/71

Linear Temporal Logic (Pnueli 1977)

Specifications:

◮ Safety:

G good

◮ MutEx:

¬ F(crit1 ∧ crit2)

◮ Liveness:

G F active

◮ Response:

G(request → F grant)

◮ Response’:

G(request → X(¬request U grant))

◮ Release:

reset R alarm

◮ Strong fairness:

G F request → G F grant

◮ Weak fairness:

F G request → G F grant

slide-63
SLIDE 63

29/71

Linear Temporal Logic (Pnueli 1977)

Specifications:

◮ Safety:

G good

◮ MutEx:

¬ F(crit1 ∧ crit2)

◮ Liveness:

G F active

◮ Response:

G(request → F grant)

◮ Response’:

G(request → X(¬request U grant))

◮ Release:

reset R alarm

◮ Strong fairness:

G F request → G F grant

◮ Weak fairness:

F G request → G F grant

slide-64
SLIDE 64

29/71

Linear Temporal Logic (Pnueli 1977)

Specifications:

◮ Safety:

G good

◮ MutEx:

¬ F(crit1 ∧ crit2)

◮ Liveness:

G F active

◮ Response:

G(request → F grant)

◮ Response’:

G(request → X(¬request U grant))

◮ Release:

reset R alarm

◮ Strong fairness:

G F request → G F grant

◮ Weak fairness:

F G request → G F grant

slide-65
SLIDE 65

29/71

Linear Temporal Logic (Pnueli 1977)

Specifications:

◮ Safety:

G good

◮ MutEx:

¬ F(crit1 ∧ crit2)

◮ Liveness:

G F active

◮ Response:

G(request → F grant)

◮ Response’:

G(request → X(¬request U grant))

◮ Release:

reset R alarm

◮ Strong fairness:

G F request → G F grant

◮ Weak fairness:

F G request → G F grant

slide-66
SLIDE 66

30/71

Linear Temporal Logic (Pnueli 1977)

Examples

Every elevator request should be eventually satisfied.

  • i

G(Calli → F(atLeveli ∧ openDoori)) The elevator should not cross a level for which a call is pending without stopping.

  • i

G(Calli → ¬atLeveli W (atLeveli ∧ openDoori)

slide-67
SLIDE 67

30/71

Linear Temporal Logic (Pnueli 1977)

Examples

Every elevator request should be eventually satisfied.

  • i

G(Calli → F(atLeveli ∧ openDoori)) The elevator should not cross a level for which a call is pending without stopping.

  • i

G(Calli → ¬atLeveli W (atLeveli ∧ openDoori)

slide-68
SLIDE 68

31/71

Past LTL

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = Y ϕ if ∃y. y ⋖ x & t, y | = ϕ t, x | = ϕ S ψ if ∃z. z ≤ x & t, z | = ψ & ∀y. (z < y ≤ x) → t, y | = ϕ

Example

ϕ Y ϕ · · ·

LTL versus PLTL

G(grant → Y(¬grant S request)) = (request R ¬grant) ∧ G(grant → (request ∨ X(request R ¬grant)))

Theorem (Laroussinie & Markey & Schnoebelen 2002)

PLTL may be exponentially more succinct than LTL.

slide-69
SLIDE 69

31/71

Past LTL

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = Y ϕ if ∃y. y ⋖ x & t, y | = ϕ t, x | = ϕ S ψ if ∃z. z ≤ x & t, z | = ψ & ∀y. (z < y ≤ x) → t, y | = ϕ

Example

ψ ϕ · · · ϕ ϕ S ψ ϕ · · ·

LTL versus PLTL

G(grant → Y(¬grant S request)) = (request R ¬grant) ∧ G(grant → (request ∨ X(request R ¬grant)))

Theorem (Laroussinie & Markey & Schnoebelen 2002)

PLTL may be exponentially more succinct than LTL.

slide-70
SLIDE 70

31/71

Past LTL

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = Y ϕ if ∃y. y ⋖ x & t, y | = ϕ t, x | = ϕ S ψ if ∃z. z ≤ x & t, z | = ψ & ∀y. (z < y ≤ x) → t, y | = ϕ

Example

r g r r g

LTL versus PLTL

G(grant → Y(¬grant S request)) = (request R ¬grant) ∧ G(grant → (request ∨ X(request R ¬grant)))

Theorem (Laroussinie & Markey & Schnoebelen 2002)

PLTL may be exponentially more succinct than LTL.

slide-71
SLIDE 71

31/71

Past LTL

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = Y ϕ if ∃y. y ⋖ x & t, y | = ϕ t, x | = ϕ S ψ if ∃z. z ≤ x & t, z | = ψ & ∀y. (z < y ≤ x) → t, y | = ϕ

Example

r g r r g ¬g ¬g

LTL versus PLTL

G(grant → Y(¬grant S request)) = (request R ¬grant) ∧ G(grant → (request ∨ X(request R ¬grant)))

Theorem (Laroussinie & Markey & Schnoebelen 2002)

PLTL may be exponentially more succinct than LTL.

slide-72
SLIDE 72

31/71

Past LTL

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = Y ϕ if ∃y. y ⋖ x & t, y | = ϕ t, x | = ϕ S ψ if ∃z. z ≤ x & t, z | = ψ & ∀y. (z < y ≤ x) → t, y | = ϕ

Example

r g r r g ¬g ¬g ¬g r

LTL versus PLTL

G(grant → Y(¬grant S request)) = (request R ¬grant) ∧ G(grant → (request ∨ X(request R ¬grant)))

Theorem (Laroussinie & Markey & Schnoebelen 2002)

PLTL may be exponentially more succinct than LTL.

slide-73
SLIDE 73

31/71

Past LTL

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = Y ϕ if ∃y. y ⋖ x & t, y | = ϕ t, x | = ϕ S ψ if ∃z. z ≤ x & t, z | = ψ & ∀y. (z < y ≤ x) → t, y | = ϕ

Example

r g r r g ¬g ¬g ¬g r ¬g r ¬g

LTL versus PLTL

G(grant → Y(¬grant S request)) = (request R ¬grant) ∧ G(grant → (request ∨ X(request R ¬grant)))

Theorem (Laroussinie & Markey & Schnoebelen 2002)

PLTL may be exponentially more succinct than LTL.

slide-74
SLIDE 74

31/71

Past LTL

Semantics: t = [N, ≤, λ] with λ : N → Σ = 2AP and x ∈ N

t, x | = Y ϕ if ∃y. y ⋖ x & t, y | = ϕ t, x | = ϕ S ψ if ∃z. z ≤ x & t, z | = ψ & ∀y. (z < y ≤ x) → t, y | = ϕ

Example

r g r r g ¬g ¬g ¬g r ¬g r ¬g

LTL versus PLTL

G(grant → Y(¬grant S request)) = (request R ¬grant) ∧ G(grant → (request ∨ X(request R ¬grant)))

Theorem (Laroussinie & Markey & Schnoebelen 2002)

PLTL may be exponentially more succinct than LTL.

slide-75
SLIDE 75

32/71

Expressivity

Theorem (Kamp 68)

LTL(Y, S, X, U) = FOΣ(≤)

Separation Theorem (Gabbay, Pnueli, Shelah & Stavi 80)

For all ϕ ∈ LTL(Y, S, X, U) there exist ← − ϕi ∈ LTL(Y, S) and − → ϕi ∈ LTL(X, U) such that for all w ∈ Σω and k ≥ 0, w, k | = ϕ ⇐ ⇒ w, k | =

  • i

← − ϕi ∧ − → ϕi

Corollary: LTL(Y, S, X, U) = LTL(X, U)

For all ϕ ∈ LTL(Y, S, X, U) there exist − → ϕ ∈ LTL(X, U) such that for all w ∈ Σω, w, 0 | = ϕ ⇐ ⇒ w, 0 | = − → ϕ Elegant algebraic proof of LTL(X, U) = FOΣ(≤) due to Wilke 98.

slide-76
SLIDE 76

32/71

Expressivity

Theorem (Kamp 68)

LTL(Y, S, X, U) = FOΣ(≤)

Separation Theorem (Gabbay, Pnueli, Shelah & Stavi 80)

For all ϕ ∈ LTL(Y, S, X, U) there exist ← − ϕi ∈ LTL(Y, S) and − → ϕi ∈ LTL(X, U) such that for all w ∈ Σω and k ≥ 0, w, k | = ϕ ⇐ ⇒ w, k | =

  • i

← − ϕi ∧ − → ϕi

Corollary: LTL(Y, S, X, U) = LTL(X, U)

For all ϕ ∈ LTL(Y, S, X, U) there exist − → ϕ ∈ LTL(X, U) such that for all w ∈ Σω, w, 0 | = ϕ ⇐ ⇒ w, 0 | = − → ϕ Elegant algebraic proof of LTL(X, U) = FOΣ(≤) due to Wilke 98.

slide-77
SLIDE 77

32/71

Expressivity

Theorem (Kamp 68)

LTL(Y, S, X, U) = FOΣ(≤)

Separation Theorem (Gabbay, Pnueli, Shelah & Stavi 80)

For all ϕ ∈ LTL(Y, S, X, U) there exist ← − ϕi ∈ LTL(Y, S) and − → ϕi ∈ LTL(X, U) such that for all w ∈ Σω and k ≥ 0, w, k | = ϕ ⇐ ⇒ w, k | =

  • i

← − ϕi ∧ − → ϕi

Corollary: LTL(Y, S, X, U) = LTL(X, U)

For all ϕ ∈ LTL(Y, S, X, U) there exist − → ϕ ∈ LTL(X, U) such that for all w ∈ Σω, w, 0 | = ϕ ⇐ ⇒ w, 0 | = − → ϕ Elegant algebraic proof of LTL(X, U) = FOΣ(≤) due to Wilke 98.

slide-78
SLIDE 78

32/71

Expressivity

Theorem (Kamp 68)

LTL(Y, S, X, U) = FOΣ(≤)

Separation Theorem (Gabbay, Pnueli, Shelah & Stavi 80)

For all ϕ ∈ LTL(Y, S, X, U) there exist ← − ϕi ∈ LTL(Y, S) and − → ϕi ∈ LTL(X, U) such that for all w ∈ Σω and k ≥ 0, w, k | = ϕ ⇐ ⇒ w, k | =

  • i

← − ϕi ∧ − → ϕi

Corollary: LTL(Y, S, X, U) = LTL(X, U)

For all ϕ ∈ LTL(Y, S, X, U) there exist − → ϕ ∈ LTL(X, U) such that for all w ∈ Σω, w, 0 | = ϕ ⇐ ⇒ w, 0 | = − → ϕ Elegant algebraic proof of LTL(X, U) = FOΣ(≤) due to Wilke 98.

slide-79
SLIDE 79

33/71

Satisfiability for LTL

Let AP be the set of atomic propositions and Σ = 2AP.

(Initial) Satisfiability problem

Input: A formula ϕ ∈ LTL(Y, S, X, U) Question: Existence of w ∈ Σω such that w, 0 | = ϕ.

Theorem (Sistla & Clarke 85, Lichtenstein et. al 85)

The satisfiability problem for LTL is PSPACE-complete

slide-80
SLIDE 80

33/71

Satisfiability for LTL

Let AP be the set of atomic propositions and Σ = 2AP.

(Initial) Satisfiability problem

Input: A formula ϕ ∈ LTL(Y, S, X, U) Question: Existence of w ∈ Σω such that w, 0 | = ϕ.

Theorem (Sistla & Clarke 85, Lichtenstein et. al 85)

The satisfiability problem for LTL is PSPACE-complete

slide-81
SLIDE 81

34/71

Model checking for LTL

Model checking problem

Input: A Kripke structure M = (S, T, I, AP, ℓ) and a formula ϕ ∈ LTL Question: Does M | = ϕ ?

◮ Universal MC:

M | = ϕ if ℓ(σ), 0 | = ϕ for all initial infinite run of M.

◮ Existential MC:

M | = ϕ if ℓ(σ), 0 | = ϕ for some initial infinite run of M.

Theorem (Sistla & Clarke 85, Lichtenstein et. al 85)

The Model checking problem for LTL is PSPACE-complete

slide-82
SLIDE 82

34/71

Model checking for LTL

Model checking problem

Input: A Kripke structure M = (S, T, I, AP, ℓ) and a formula ϕ ∈ LTL Question: Does M | = ϕ ?

◮ Universal MC:

M | = ϕ if ℓ(σ), 0 | = ϕ for all initial infinite run of M.

◮ Existential MC:

M | = ϕ if ℓ(σ), 0 | = ϕ for some initial infinite run of M.

Theorem (Sistla & Clarke 85, Lichtenstein et. al 85)

The Model checking problem for LTL is PSPACE-complete

slide-83
SLIDE 83

34/71

Model checking for LTL

Model checking problem

Input: A Kripke structure M = (S, T, I, AP, ℓ) and a formula ϕ ∈ LTL Question: Does M | = ϕ ?

◮ Universal MC:

M | = ϕ if ℓ(σ), 0 | = ϕ for all initial infinite run of M.

◮ Existential MC:

M | = ϕ if ℓ(σ), 0 | = ϕ for some initial infinite run of M.

Theorem (Sistla & Clarke 85, Lichtenstein et. al 85)

The Model checking problem for LTL is PSPACE-complete

slide-84
SLIDE 84

35/71

MC(X, U) ≤P SAT(X, U) (Sistla & Clarke 85)

Let M = (S, T, I, AP, ℓ) be a Kripke structure and ϕ ∈ LTL(X, U) Introduce new atomic propositions: APS = {ats | s ∈ S} Define AP′ = AP ⊎ APS Σ′ = 2AP′ π : Σ′ω → Σω by π(a) = a ∩ AP. Let w ∈ Σ′ω. We have w | = ϕ iff π(w) | = ϕ Define ψM =

  • s∈I

ats

  • ∧ G

 

s∈S

 ats ∧

  • t=s

¬att ∧

  • p∈ℓ(s)

p ∧

  • p/

∈ℓ(s)

¬p ∧

  • t∈T (s)

X att     We have w | = ψM iff π(w) = ℓ(σ) for some initial infinite run σ of M. Therefore, M | = ϕ iff ℓ(σ) | = ¬ϕ for some initial infinite run σ of M iff w | = ψM ∧ ¬ϕ for some w ∈ Σ′ω iff ψM ∧ ¬ϕ is satisfiable

slide-85
SLIDE 85

35/71

MC(X, U) ≤P SAT(X, U) (Sistla & Clarke 85)

Let M = (S, T, I, AP, ℓ) be a Kripke structure and ϕ ∈ LTL(X, U) Introduce new atomic propositions: APS = {ats | s ∈ S} Define AP′ = AP ⊎ APS Σ′ = 2AP′ π : Σ′ω → Σω by π(a) = a ∩ AP. Let w ∈ Σ′ω. We have w | = ϕ iff π(w) | = ϕ Define ψM =

  • s∈I

ats

  • ∧ G

 

s∈S

 ats ∧

  • t=s

¬att ∧

  • p∈ℓ(s)

p ∧

  • p/

∈ℓ(s)

¬p ∧

  • t∈T (s)

X att     We have w | = ψM iff π(w) = ℓ(σ) for some initial infinite run σ of M. Therefore, M | = ϕ iff ℓ(σ) | = ¬ϕ for some initial infinite run σ of M iff w | = ψM ∧ ¬ϕ for some w ∈ Σ′ω iff ψM ∧ ¬ϕ is satisfiable

slide-86
SLIDE 86

35/71

MC(X, U) ≤P SAT(X, U) (Sistla & Clarke 85)

Let M = (S, T, I, AP, ℓ) be a Kripke structure and ϕ ∈ LTL(X, U) Introduce new atomic propositions: APS = {ats | s ∈ S} Define AP′ = AP ⊎ APS Σ′ = 2AP′ π : Σ′ω → Σω by π(a) = a ∩ AP. Let w ∈ Σ′ω. We have w | = ϕ iff π(w) | = ϕ Define ψM =

  • s∈I

ats

  • ∧ G

 

s∈S

 ats ∧

  • t=s

¬att ∧

  • p∈ℓ(s)

p ∧

  • p/

∈ℓ(s)

¬p ∧

  • t∈T (s)

X att     We have w | = ψM iff π(w) = ℓ(σ) for some initial infinite run σ of M. Therefore, M | = ϕ iff ℓ(σ) | = ¬ϕ for some initial infinite run σ of M iff w | = ψM ∧ ¬ϕ for some w ∈ Σ′ω iff ψM ∧ ¬ϕ is satisfiable

slide-87
SLIDE 87

36/71

QBF ≤P MC(X, U) (Sistla & Clarke 85)

Let γ = Q1x1 · · · Qnxn

  • 1≤i≤m
  • 1≤j≤ki

aij with Qi ∈ {∀, ∃} and consider the KS M: e0 s1 xt

1

xf

1

e1 s2 xt

2

xf

2

e2 · · · sn xt

n

xf

n

en f0 a11 a12 . . . a1k1 f1 a21 a22 . . . a2k2 f2 · · · fm−1 am1 am2 . . . amkm fm Let ψij =

  • G(xf

k → ¬aij W sk)

if aij = xk G(xt

k → ¬aij W sk)

if aij = ¬xk and ψ =

  • i,j

ψij. Let ϕj = G(ej−1 → (¬sj−1 U xt

j) ∧ (¬sj−1 U xf j )

and ϕ =

  • j|Qj=∀

ϕj. Then, γ is valid iff M | = ¬(ϕ ∧ ψ) iff σ | = ϕ ∧ ψ for some run σ.

slide-88
SLIDE 88

36/71

QBF ≤P MC(X, U) (Sistla & Clarke 85)

Let γ = Q1x1 · · · Qnxn

  • 1≤i≤m
  • 1≤j≤ki

aij with Qi ∈ {∀, ∃} and consider the KS M: e0 s1 xt

1

xf

1

e1 s2 xt

2

xf

2

e2 · · · sn xt

n

xf

n

en f0 a11 a12 . . . a1k1 f1 a21 a22 . . . a2k2 f2 · · · fm−1 am1 am2 . . . amkm fm Let ψij =

  • G(xf

k → ¬aij W sk)

if aij = xk G(xt

k → ¬aij W sk)

if aij = ¬xk and ψ =

  • i,j

ψij. Let ϕj = G(ej−1 → (¬sj−1 U xt

j) ∧ (¬sj−1 U xf j )

and ϕ =

  • j|Qj=∀

ϕj. Then, γ is valid iff M | = ¬(ϕ ∧ ψ) iff σ | = ϕ ∧ ψ for some run σ.

slide-89
SLIDE 89

36/71

QBF ≤P MC(X, U) (Sistla & Clarke 85)

Let γ = Q1x1 · · · Qnxn

  • 1≤i≤m
  • 1≤j≤ki

aij with Qi ∈ {∀, ∃} and consider the KS M: e0 s1 xt

1

xf

1

e1 s2 xt

2

xf

2

e2 · · · sn xt

n

xf

n

en f0 a11 a12 . . . a1k1 f1 a21 a22 . . . a2k2 f2 · · · fm−1 am1 am2 . . . amkm fm Let ψij =

  • G(xf

k → ¬aij W sk)

if aij = xk G(xt

k → ¬aij W sk)

if aij = ¬xk and ψ =

  • i,j

ψij. Let ϕj = G(ej−1 → (¬sj−1 U xt

j) ∧ (¬sj−1 U xf j )

and ϕ =

  • j|Qj=∀

ϕj. Then, γ is valid iff M | = ¬(ϕ ∧ ψ) iff σ | = ϕ ∧ ψ for some run σ.

slide-90
SLIDE 90

36/71

QBF ≤P MC(X, U) (Sistla & Clarke 85)

Let γ = Q1x1 · · · Qnxn

  • 1≤i≤m
  • 1≤j≤ki

aij with Qi ∈ {∀, ∃} and consider the KS M: e0 s1 xt

1

xf

1

e1 s2 xt

2

xf

2

e2 · · · sn xt

n

xf

n

en f0 a11 a12 . . . a1k1 f1 a21 a22 . . . a2k2 f2 · · · fm−1 am1 am2 . . . amkm fm Let ψij =

  • G(xf

k → ¬aij W sk)

if aij = xk G(xt

k → ¬aij W sk)

if aij = ¬xk and ψ =

  • i,j

ψij. Let ϕj = G(ej−1 → (¬sj−1 U xt

j) ∧ (¬sj−1 U xf j )

and ϕ =

  • j|Qj=∀

ϕj. Then, γ is valid iff M | = ¬(ϕ ∧ ψ) iff σ | = ϕ ∧ ψ for some run σ.

slide-91
SLIDE 91

37/71

Decision procedure for LTL

The core

From an LTL formula ϕ, construct a B¨ uchi automaton Aϕ such that L(A) = L(ϕ) = {w ∈ Σω | w, 0 | = ϕ}.

Satisfiability (initial)

Check the B¨ uchi automaton Aϕ for emptiness.

Model checking

Construct the product B = M × A¬ϕ so that the successful runs of B correspond to the successful run of A satisfying ¬ϕ. Then, check B for emptiness.

slide-92
SLIDE 92

37/71

Decision procedure for LTL

The core

From an LTL formula ϕ, construct a B¨ uchi automaton Aϕ such that L(A) = L(ϕ) = {w ∈ Σω | w, 0 | = ϕ}.

Satisfiability (initial)

Check the B¨ uchi automaton Aϕ for emptiness.

Model checking

Construct the product B = M × A¬ϕ so that the successful runs of B correspond to the successful run of A satisfying ¬ϕ. Then, check B for emptiness.

slide-93
SLIDE 93

37/71

Decision procedure for LTL

The core

From an LTL formula ϕ, construct a B¨ uchi automaton Aϕ such that L(A) = L(ϕ) = {w ∈ Σω | w, 0 | = ϕ}.

Satisfiability (initial)

Check the B¨ uchi automaton Aϕ for emptiness.

Model checking

Construct the product B = M × A¬ϕ so that the successful runs of B correspond to the successful run of A satisfying ¬ϕ. Then, check B for emptiness.

slide-94
SLIDE 94

38/71

B¨ uchi automata

Definition

A = (Q, Σ, I, T, F) where

◮ Q: finite set of states ◮ Σ: finite set of labels ◮ I ⊆ Q: set of initial states ◮ T ⊆ Q × Σ × Q: transitions ◮ F ⊆ Q: set of accepting states (repeated, final)

Example

A = 1 2 a b b a L(A) = {w ∈ {a, b}ω | |w|a = ω}

slide-95
SLIDE 95

38/71

B¨ uchi automata

Definition

A = (Q, Σ, I, T, F) where

◮ Q: finite set of states ◮ Σ: finite set of labels ◮ I ⊆ Q: set of initial states ◮ T ⊆ Q × Σ × Q: transitions ◮ F ⊆ Q: set of accepting states (repeated, final)

Example

A = 1 2 a b b a L(A) = {w ∈ {a, b}ω | |w|a = ω}

slide-96
SLIDE 96

39/71

B¨ uchi automata for some LTL formulas

Definition

Recall that Σ = 2AP. For p, q ∈ AP, we let

◮ Σp = {a ∈ Σ | p ∈ a}

and Σ¬p = Σ \ Σp

◮ Σp∧q = Σp ∩ Σq

and Σp∨q = Σp ∪ Σq

◮ Σp∧¬q = Σp \ Σq

. . .

Examples

F p: 1 2 Σ Σ Σp

  • r

X X p: G p:

slide-97
SLIDE 97

39/71

B¨ uchi automata for some LTL formulas

Definition

Recall that Σ = 2AP. For p, q ∈ AP, we let

◮ Σp = {a ∈ Σ | p ∈ a}

and Σ¬p = Σ \ Σp

◮ Σp∧q = Σp ∩ Σq

and Σp∨q = Σp ∪ Σq

◮ Σp∧¬q = Σp \ Σq

. . .

Examples

F p: 1 2 Σ Σ Σp

  • r

1 2 Σ¬p Σ Σp X X p: G p:

slide-98
SLIDE 98

39/71

B¨ uchi automata for some LTL formulas

Definition

Recall that Σ = 2AP. For p, q ∈ AP, we let

◮ Σp = {a ∈ Σ | p ∈ a}

and Σ¬p = Σ \ Σp

◮ Σp∧q = Σp ∩ Σq

and Σp∨q = Σp ∪ Σq

◮ Σp∧¬q = Σp \ Σq

. . .

Examples

F p: 1 2 Σ Σ Σp

  • r

1 2 Σ¬p Σ Σp X X p: 1 2 3 4 Σ Σ Σp Σ G p:

slide-99
SLIDE 99

39/71

B¨ uchi automata for some LTL formulas

Definition

Recall that Σ = 2AP. For p, q ∈ AP, we let

◮ Σp = {a ∈ Σ | p ∈ a}

and Σ¬p = Σ \ Σp

◮ Σp∧q = Σp ∩ Σq

and Σp∨q = Σp ∪ Σq

◮ Σp∧¬q = Σp \ Σq

. . .

Examples

F p: 1 2 Σ Σ Σp

  • r

1 2 Σ¬p Σ Σp X X p: 1 2 3 4 Σ Σ Σp Σ G p: 1 Σp

slide-100
SLIDE 100

40/71

B¨ uchi automata for some LTL formulas

Examples

F G p: 1 2 Σ Σp Σp no deterministic B¨ uchi automaton. G F p: deterministic B¨ uchi automaton are not closed under complement. G(p → F q):

slide-101
SLIDE 101

40/71

B¨ uchi automata for some LTL formulas

Examples

F G p: 1 2 Σ Σp Σp no deterministic B¨ uchi automaton. G F p: deterministic B¨ uchi automaton are not closed under complement. G(p → F q):

slide-102
SLIDE 102

40/71

B¨ uchi automata for some LTL formulas

Examples

F G p: 1 2 Σ Σp Σp no deterministic B¨ uchi automaton. G F p: 1 2 Σ¬p Σp Σp Σ¬p deterministic B¨ uchi automaton are not closed under complement. G(p → F q):

slide-103
SLIDE 103

40/71

B¨ uchi automata for some LTL formulas

Examples

F G p: 1 2 Σ Σp Σp no deterministic B¨ uchi automaton. G F p: 1 2 Σ¬p Σp Σp Σ¬p deterministic B¨ uchi automaton are not closed under complement. G(p → F q):

slide-104
SLIDE 104

40/71

B¨ uchi automata for some LTL formulas

Examples

F G p: 1 2 Σ Σp Σp no deterministic B¨ uchi automaton. G F p: 1 2 Σ¬p Σp Σp Σ¬p deterministic B¨ uchi automaton are not closed under complement. G(p → F q): 1 2 Σ¬p∨q Σ¬q Σp∧¬q Σq

slide-105
SLIDE 105

41/71

B¨ uchi automata for some LTL formulas

Examples

p U q: 1 2 Σp Σq Σ

  • r

1 2 Σp∧¬q Σq Σ p W q:

  • r

p R q:

  • r
slide-106
SLIDE 106

41/71

B¨ uchi automata for some LTL formulas

Examples

p U q: 1 2 Σp Σq Σ

  • r

1 2 Σp∧¬q Σq Σ p W q: 1 2 Σp Σq Σ

  • r

1 2 Σp∧¬q Σq Σ p R q:

  • r
slide-107
SLIDE 107

41/71

B¨ uchi automata for some LTL formulas

Examples

p U q: 1 2 Σp Σq Σ

  • r

1 2 Σp∧¬q Σq Σ p W q: 1 2 Σp Σq Σ

  • r

1 2 Σp∧¬q Σq Σ p R q: 1 2 Σq Σp∧q Σ

  • r

1 2 Σq∧¬p Σp∧q Σ

slide-108
SLIDE 108

42/71

B¨ uchi automata

Properties

B¨ uchi automata are closed under union, intersection, complement.

◮ Union: trivial ◮ Intersection: easy (exercice) ◮ complement: hard

Let ϕ = F((p ∧ Xn ¬p) ∨ (¬p ∧ Xn p)) Σ 1 Σp 1 Σ · · · n Σ n + 1 Σ¬p Σ 1’ Σ¬p 2’ Σ · · · n Σ Σp Any non deterministic B¨ uchi automaton for ¬ϕ has at least 2n states.

slide-109
SLIDE 109

43/71

B¨ uchi automata

Exercice

Given B¨ uchi automata for ϕ and ψ,

◮ Construct a B¨

uchi automaton for X ϕ (trivial)

◮ Construct a B¨

uchi automaton for ϕ U ψ This gives an inductive construction of Aϕ from ϕ ∈ LTL(X, U) . . . . . . but the size of Aϕ might be non-elementary in the size of ϕ.

slide-110
SLIDE 110

43/71

B¨ uchi automata

Exercice

Given B¨ uchi automata for ϕ and ψ,

◮ Construct a B¨

uchi automaton for X ϕ (trivial)

◮ Construct a B¨

uchi automaton for ϕ U ψ This gives an inductive construction of Aϕ from ϕ ∈ LTL(X, U) . . . . . . but the size of Aϕ might be non-elementary in the size of ϕ.

slide-111
SLIDE 111

43/71

B¨ uchi automata

Exercice

Given B¨ uchi automata for ϕ and ψ,

◮ Construct a B¨

uchi automaton for X ϕ (trivial)

◮ Construct a B¨

uchi automaton for ϕ U ψ This gives an inductive construction of Aϕ from ϕ ∈ LTL(X, U) . . . . . . but the size of Aϕ might be non-elementary in the size of ϕ.

slide-112
SLIDE 112

44/71

Generalized B¨ uchi automata

Definition: acceptance on states

A = (Q, Σ, I, T, F1, . . . , Fn) with Fi ⊆ Q. An infinite run σ is successful if it visits infinitely often each Fi. G F p ∧ G F q: Σ Σp Σ Σq Σ

Definition: acceptance on transitions

A = (Q, Σ, I, T, T1, . . . , Tn) with Ti ⊆ T . An infinite run σ is successful if it uses infinitely many transitions from each Ti. G F p ∧ G F q:

slide-113
SLIDE 113

44/71

Generalized B¨ uchi automata

Definition: acceptance on states

A = (Q, Σ, I, T, F1, . . . , Fn) with Fi ⊆ Q. An infinite run σ is successful if it visits infinitely often each Fi. G F p ∧ G F q: Σ Σp Σ Σq Σ

Definition: acceptance on transitions

A = (Q, Σ, I, T, T1, . . . , Tn) with Ti ⊆ T . An infinite run σ is successful if it uses infinitely many transitions from each Ti. G F p ∧ G F q: Σ Σp Σq

slide-114
SLIDE 114

45/71

GBA to BA

Synchronized product with

1 T1 2 T2 · · · n Tn

slide-115
SLIDE 115

46/71

Negative normal form

Syntax (p ∈ AP)

ϕ ::= ⊥ | p | ¬p | ϕ ∨ ϕ | ϕ ∧ ϕ | X ϕ | ϕ U ϕ | ϕ R ϕ

Any formula can be transformed in NNF

◮ ¬ X ϕ = X ¬ϕ ◮ ¬(ϕ U ψ) = (¬ϕ) R (¬ψ) ◮ ¬(ϕ R ψ) = (¬ϕ) U (¬ψ) ◮ ¬(ϕ ∨ ψ) = (¬ϕ) ∧ (¬ψ) ◮ ¬(ϕ ∧ ψ) = (¬ϕ) ∨ (¬ψ)

Note that this does not increase the number of Temporal subformulas.

slide-116
SLIDE 116

46/71

Negative normal form

Syntax (p ∈ AP)

ϕ ::= ⊥ | p | ¬p | ϕ ∨ ϕ | ϕ ∧ ϕ | X ϕ | ϕ U ϕ | ϕ R ϕ

Any formula can be transformed in NNF

◮ ¬ X ϕ = X ¬ϕ ◮ ¬(ϕ U ψ) = (¬ϕ) R (¬ψ) ◮ ¬(ϕ R ψ) = (¬ϕ) U (¬ψ) ◮ ¬(ϕ ∨ ψ) = (¬ϕ) ∧ (¬ψ) ◮ ¬(ϕ ∧ ψ) = (¬ϕ) ∨ (¬ψ)

Note that this does not increase the number of Temporal subformulas.

slide-117
SLIDE 117

47/71

Reduction graph

Definition

Z ⊆ NNF is reduced if

◮ formulas in Z are of the form p, ¬p, or X β, ◮ ⊥ /

∈ Z and {p, ¬p} ⊆ Z for all p ∈ AP.

Reduction graph

◮ Vertices: subsets of NNF ◮ Edges: Let Y ⊆ NNF and let α ∈ Y maximal not reduced.

If α = α1 ∨ α2: Y → Y \ {α} ∪ {α1}, Y → Y \ {α} ∪ {α2}, If α = α1 ∧ α2: Y → Y \ {α} ∪ {α1, α2}, If α = α1 R α2: Y → Y \ {α} ∪ {α1, α2}, Y → Y \ {α} ∪ {α2, X α}, If α = α1 U α2: Y → Y \ {α} ∪ {α2}, Y

α

− → Y \ {α} ∪ {α1, X α}. Note the mark α on the last edge

slide-118
SLIDE 118

48/71

Reduction graph

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) State = set of obligations. Reduce obligations to litterals and next-formulas. Note again the mark F q on the last edge

slide-119
SLIDE 119

48/71

Reduction graph

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ State = set of obligations. Reduce obligations to litterals and next-formulas. Note again the mark F q on the last edge

slide-120
SLIDE 120

48/71

Reduction graph

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ State = set of obligations. Reduce obligations to litterals and next-formulas. Note again the mark F q on the last edge

slide-121
SLIDE 121

48/71

Reduction graph

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ q, X ϕ X F q, X ϕ F q State = set of obligations. Reduce obligations to litterals and next-formulas. Note again the mark F q on the last edge

slide-122
SLIDE 122

48/71

Reduction graph

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ q, X ϕ X F q, X ϕ F q State = set of obligations. Reduce obligations to litterals and next-formulas. Note again the mark F q on the last edge

slide-123
SLIDE 123

49/71

Automaton Aϕ

Definition: For Y ⊆ NNF, let

◮ Red(Y ) = {Z reduced | Y

− → Z}

◮ Redα(Y ) = {Z reduced | Y

− → Z without using an edge marked with α}

Definition: For Z ⊆ NNF reduced, define

◮ next(Z) = {α | X α ∈ Z} ◮ ΣZ =

  • p∈Z

Σp ∩

  • ¬p∈Z

Σ¬p

Automaton Aϕ

◮ States: Q = 2sub(ϕ),

I = {ϕ}

◮ Transitions: T = {Y

ΣZ

− − → next(Z) | Y ∈ Q and Z ∈ Red(Y )}

◮ Acceptance: Tα = {Y

ΣZ

− − → next(Z) | Y ∈ Q and Z ∈ Redα(Y )} for each α = α1 U α2 ∈ sub(ϕ).

slide-124
SLIDE 124

49/71

Automaton Aϕ

Definition: For Y ⊆ NNF, let

◮ Red(Y ) = {Z reduced | Y

− → Z}

◮ Redα(Y ) = {Z reduced | Y

− → Z without using an edge marked with α}

Definition: For Z ⊆ NNF reduced, define

◮ next(Z) = {α | X α ∈ Z} ◮ ΣZ =

  • p∈Z

Σp ∩

  • ¬p∈Z

Σ¬p

Automaton Aϕ

◮ States: Q = 2sub(ϕ),

I = {ϕ}

◮ Transitions: T = {Y

ΣZ

− − → next(Z) | Y ∈ Q and Z ∈ Red(Y )}

◮ Acceptance: Tα = {Y

ΣZ

− − → next(Z) | Y ∈ Q and Z ∈ Redα(Y )} for each α = α1 U α2 ∈ sub(ϕ).

slide-125
SLIDE 125

49/71

Automaton Aϕ

Definition: For Y ⊆ NNF, let

◮ Red(Y ) = {Z reduced | Y

− → Z}

◮ Redα(Y ) = {Z reduced | Y

− → Z without using an edge marked with α}

Definition: For Z ⊆ NNF reduced, define

◮ next(Z) = {α | X α ∈ Z} ◮ ΣZ =

  • p∈Z

Σp ∩

  • ¬p∈Z

Σ¬p

Automaton Aϕ

◮ States: Q = 2sub(ϕ),

I = {ϕ}

◮ Transitions: T = {Y

ΣZ

− − → next(Z) | Y ∈ Q and Z ∈ Red(Y )}

◮ Acceptance: Tα = {Y

ΣZ

− − → next(Z) | Y ∈ Q and Z ∈ Redα(Y )} for each α = α1 U α2 ∈ sub(ϕ).

slide-126
SLIDE 126

50/71

Automaton Aϕ

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ q, X ϕ X F q, X ϕ F q

Transition = check litterals and move forward. Simplification

slide-127
SLIDE 127

50/71

Automaton Aϕ

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ q, X ϕ X F q, X ϕ F q ¬p q F q, ϕ ⊤

Transition = check litterals and move forward. Simplification

slide-128
SLIDE 128

50/71

Automaton Aϕ

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ q, X ϕ X F q, X ϕ F q ¬p q F q, ϕ ⊤ F q, ¬p ∨ F q, X ϕ

Transition = check litterals and move forward. Simplification

slide-129
SLIDE 129

50/71

Automaton Aϕ

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ q, X ϕ X F q, X ϕ F q ¬p q F q, ϕ ⊤ F q, ¬p ∨ F q, X ϕ F q, ¬p, X ϕ

Transition = check litterals and move forward. Simplification

slide-130
SLIDE 130

50/71

Automaton Aϕ

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ q, X ϕ X F q, X ϕ F q ¬p q F q, ϕ ⊤ F q, ¬p ∨ F q, X ϕ F q, ¬p, X ϕ X F q, ¬p, X ϕ q, ¬p, X ϕ F q

Transition = check litterals and move forward. Simplification

slide-131
SLIDE 131

50/71

Automaton Aϕ

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ q, X ϕ X F q, X ϕ F q ¬p q F q, ϕ ⊤ F q, ¬p ∨ F q, X ϕ F q, ¬p, X ϕ X F q, ¬p, X ϕ q, ¬p, X ϕ F q ¬p ¬p ∧ q

Transition = check litterals and move forward. Simplification

slide-132
SLIDE 132

50/71

Automaton Aϕ

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ q, X ϕ X F q, X ϕ F q ¬p q F q, ϕ ⊤ F q, ¬p ∨ F q, X ϕ F q, ¬p, X ϕ X F q, ¬p, X ϕ q, ¬p, X ϕ F q ¬p ¬p ∧ q 1 2 ⊤ q ¬p ∧ q ¬p ∨ q ⊤ ¬p

Transition = check litterals and move forward. Simplification

slide-133
SLIDE 133

50/71

Automaton Aϕ

Example: ϕ = G(p → F q)

ϕ = G(¬p ∨ F q) ¬p ∨ F q, X ϕ ¬p, X ϕ F q, X ϕ q, X ϕ X F q, X ϕ F q ¬p q F q, ϕ ⊤ F q, ¬p ∨ F q, X ϕ F q, ¬p, X ϕ X F q, ¬p, X ϕ q, ¬p, X ϕ F q ¬p ¬p ∧ q 1 2 ⊤ q ¬p ∨ q ⊤

Transition = check litterals and move forward. Simplification

slide-134
SLIDE 134

51/71

Automaton Aϕ

Theorem L(Aϕ) = L(ϕ)

◮ |Q| ≤ 2|ϕ| ◮ number of acceptance tables = number of until sub-formulas.

Corollary

Satisfiability and Model Checking are decidable in PSPACE.

Remark

An efficient construction is based on Very Weak Alternating Automata. (Gastin & Oddoux, CAV’01) The domain is still very active.

slide-135
SLIDE 135

51/71

Automaton Aϕ

Theorem L(Aϕ) = L(ϕ)

◮ |Q| ≤ 2|ϕ| ◮ number of acceptance tables = number of until sub-formulas.

Corollary

Satisfiability and Model Checking are decidable in PSPACE.

Remark

An efficient construction is based on Very Weak Alternating Automata. (Gastin & Oddoux, CAV’01) The domain is still very active.

slide-136
SLIDE 136

51/71

Automaton Aϕ

Theorem L(Aϕ) = L(ϕ)

◮ |Q| ≤ 2|ϕ| ◮ number of acceptance tables = number of until sub-formulas.

Corollary

Satisfiability and Model Checking are decidable in PSPACE.

Remark

An efficient construction is based on Very Weak Alternating Automata. (Gastin & Oddoux, CAV’01) The domain is still very active.

slide-137
SLIDE 137

52/71

Original References

◮ Sistla & Clarke 85. Complexity of propositional temporal logics. JACM 32(3),

  • p. 733–749.

◮ Lichtenstein & Pnueli 85. Checking that finite state concurrent programs

satisfy their linear specification. ACM Symp. PoPL’85, p. 97–107.

◮ Gabbay, Pnueli, Shelah & Stavi 80. On the temporal analysis of fairness.

ACM Symp. PoPL’80, p. 163–173.

◮ Gabbay 87. The declarative past and imperative future: Executable temporal

logics for interactive systems. conf. on Temporal Logics in Specifications, April 87. LNCS 398, p. 409–448, 1989.

slide-138
SLIDE 138

53/71

Outline

1

Introduction

2

Models

3

Specification Linear Time Specifications Branching Time Specifications

slide-139
SLIDE 139

54/71

Possibility is not expressible in LTL

Example

ϕ: Whenever p holds, it is possible to reach a state where q holds. ϕ cannot be expressed in LTL. Consider the two models: M1: 1 p, q 2 p 3 q 4 and M2: 1 p, q 2 p 2’ p 3 q 4 M1 | = ϕ but M2 | = ϕ M1 and M2 satisfy the same LTL formulas.

slide-140
SLIDE 140

55/71

Quantification on runs

Example

ϕ: Whenever p holds, it is possible to reach a state where q holds. ϕ = AG(p → EF q)

◮ E: for some infinite run ◮ A: for all infinite run

Some specifications

◮ EF ϕ: ϕ is possible ◮ AG ϕ: ϕ is an invariant ◮ AF ϕ: ϕ is unavoidable ◮ EG ϕ: ϕ holds globally along some path

slide-141
SLIDE 141

55/71

Quantification on runs

Example

ϕ: Whenever p holds, it is possible to reach a state where q holds. ϕ = AG(p → EF q)

◮ E: for some infinite run ◮ A: for all infinite run

Some specifications

◮ EF ϕ: ϕ is possible ◮ AG ϕ: ϕ is an invariant ◮ AF ϕ: ϕ is unavoidable ◮ EG ϕ: ϕ holds globally along some path

slide-142
SLIDE 142

56/71

CTL∗ (Emerson & Halpern 86)

Syntax: CTL∗: Computation Tree Logic

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | X ϕ | ϕ U ϕ | E ϕ | A ϕ

Semantics:

Let M = (S, T, I, AP, ℓ) be a Kripke structure and σ an infinte run of M. σ, i | = Eϕ if σ′, 0 | = ϕ for some infinite run σ′ such that σ′(0) = σ(i) σ, i | = Aϕ if σ′, 0 | = ϕ for all infinite runs σ′ such that σ′(0) = σ(i)

State formulas

A formula of the form p or E ϕ or A ϕ only depends on the current state. State formulas are closed under boolean connectives. If ϕ is a state formula, define S(ϕ) = {s ∈ S | s | = ϕ}

slide-143
SLIDE 143

56/71

CTL∗ (Emerson & Halpern 86)

Syntax: CTL∗: Computation Tree Logic

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | X ϕ | ϕ U ϕ | E ϕ | A ϕ

Semantics:

Let M = (S, T, I, AP, ℓ) be a Kripke structure and σ an infinte run of M. σ, i | = Eϕ if σ′, 0 | = ϕ for some infinite run σ′ such that σ′(0) = σ(i) σ, i | = Aϕ if σ′, 0 | = ϕ for all infinite runs σ′ such that σ′(0) = σ(i)

State formulas

A formula of the form p or E ϕ or A ϕ only depends on the current state. State formulas are closed under boolean connectives. If ϕ is a state formula, define S(ϕ) = {s ∈ S | s | = ϕ}

slide-144
SLIDE 144

56/71

CTL∗ (Emerson & Halpern 86)

Syntax: CTL∗: Computation Tree Logic

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | X ϕ | ϕ U ϕ | E ϕ | A ϕ

Semantics:

Let M = (S, T, I, AP, ℓ) be a Kripke structure and σ an infinte run of M. σ, i | = Eϕ if σ′, 0 | = ϕ for some infinite run σ′ such that σ′(0) = σ(i) σ, i | = Aϕ if σ′, 0 | = ϕ for all infinite runs σ′ such that σ′(0) = σ(i)

State formulas

A formula of the form p or E ϕ or A ϕ only depends on the current state. State formulas are closed under boolean connectives. If ϕ is a state formula, define S(ϕ) = {s ∈ S | s | = ϕ}

slide-145
SLIDE 145

57/71

Model checking of CTL∗

Model checking problem

Input: A Kripke structure M = (S, T, I, AP, ℓ) and a formula ϕ ∈ CTL∗ Question: Does M | = ϕ ?

Remark

M | = ϕ iff ℓ(σ), 0 | = ϕ for all initial infinite run of M. iff I ⊆ S(A ϕ)

Theorem

The model checking problem for CTL∗ is PSPACE-complete

Proof

PSPACE-hardness: follows from LTL ⊆ CTL∗. PSPACE-easiness: inductively compute S(ψ) for all state formulas.

slide-146
SLIDE 146

57/71

Model checking of CTL∗

Model checking problem

Input: A Kripke structure M = (S, T, I, AP, ℓ) and a formula ϕ ∈ CTL∗ Question: Does M | = ϕ ?

Remark

M | = ϕ iff ℓ(σ), 0 | = ϕ for all initial infinite run of M. iff I ⊆ S(A ϕ)

Theorem

The model checking problem for CTL∗ is PSPACE-complete

Proof

PSPACE-hardness: follows from LTL ⊆ CTL∗. PSPACE-easiness: inductively compute S(ψ) for all state formulas.

slide-147
SLIDE 147

58/71

Computing S(ψ)

State formulas

S(p) = {s ∈ S | p ∈ ℓ(s)},

S(¬ψ) = S \ S(ψ),

S(ψ1 ∧ ψ2) = S(ψ1) ∩ S(ψ2),

S(ψ1 ∨ ψ2) = S(ψ1) ∪ S(ψ2),

S(E ψ) = ? Compute Aψ, replacing state subformulas of ψ by new atomic propositions. To check whether s ∈ S(E ψ), check for emptiness the synchronized product

  • f Aψ and M with initial state s.

A ψ = ¬ E ¬ψ

Model checking

M | = ϕ iff I ⊆ S(A ϕ).

slide-148
SLIDE 148

58/71

Computing S(ψ)

State formulas

S(p) = {s ∈ S | p ∈ ℓ(s)},

S(¬ψ) = S \ S(ψ),

S(ψ1 ∧ ψ2) = S(ψ1) ∩ S(ψ2),

S(ψ1 ∨ ψ2) = S(ψ1) ∪ S(ψ2),

S(E ψ) = ? Compute Aψ, replacing state subformulas of ψ by new atomic propositions. To check whether s ∈ S(E ψ), check for emptiness the synchronized product

  • f Aψ and M with initial state s.

A ψ = ¬ E ¬ψ

Model checking

M | = ϕ iff I ⊆ S(A ϕ).

slide-149
SLIDE 149

58/71

Computing S(ψ)

State formulas

S(p) = {s ∈ S | p ∈ ℓ(s)},

S(¬ψ) = S \ S(ψ),

S(ψ1 ∧ ψ2) = S(ψ1) ∩ S(ψ2),

S(ψ1 ∨ ψ2) = S(ψ1) ∪ S(ψ2),

S(E ψ) = ? Compute Aψ, replacing state subformulas of ψ by new atomic propositions. To check whether s ∈ S(E ψ), check for emptiness the synchronized product

  • f Aψ and M with initial state s.

A ψ = ¬ E ¬ψ

Model checking

M | = ϕ iff I ⊆ S(A ϕ).

slide-150
SLIDE 150

58/71

Computing S(ψ)

State formulas

S(p) = {s ∈ S | p ∈ ℓ(s)},

S(¬ψ) = S \ S(ψ),

S(ψ1 ∧ ψ2) = S(ψ1) ∩ S(ψ2),

S(ψ1 ∨ ψ2) = S(ψ1) ∪ S(ψ2),

S(E ψ) = ? Compute Aψ, replacing state subformulas of ψ by new atomic propositions. To check whether s ∈ S(E ψ), check for emptiness the synchronized product

  • f Aψ and M with initial state s.

A ψ = ¬ E ¬ψ

Model checking

M | = ϕ iff I ⊆ S(A ϕ).

slide-151
SLIDE 151

59/71

CTL (Clarke & Emerson 81)

Syntax: CTL: Computation Tree Logic

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | EX ϕ | AX ϕ | E ϕ U ϕ | A ϕ U ϕ

Remarks

The semantics is inherited from CTL∗. All CTL-formulas are state formulas. Hence, we have a simpler semantics.

Semantics: only state formulas

Let M = (S, T, I, AP, ℓ) be a Kripke structure and let s ∈ S. s | = p if p ∈ ℓ(s) s | = EX ϕ if ∃s = s0 → s1 → s2 → · · · with s1 | = ϕ s | = AX ϕ if ∀s = s0 → s1 → s2 → · · · , we have s1 | = ϕ s | = E ϕ U ψ if ∃s = s0 → s1 → s2 → · · · , ∃j ≥ 0 with sj | = ψ and sk | = ϕ for all 0 ≤ k < j s | = A ϕ U ψ if ∀s = s0 → s1 → s2 → · · · , ∃j ≥ 0 with sj | = ψ and sk | = ϕ for all 0 ≤ k < j

slide-152
SLIDE 152

59/71

CTL (Clarke & Emerson 81)

Syntax: CTL: Computation Tree Logic

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | EX ϕ | AX ϕ | E ϕ U ϕ | A ϕ U ϕ

Remarks

The semantics is inherited from CTL∗. All CTL-formulas are state formulas. Hence, we have a simpler semantics.

Semantics: only state formulas

Let M = (S, T, I, AP, ℓ) be a Kripke structure and let s ∈ S. s | = p if p ∈ ℓ(s) s | = EX ϕ if ∃s = s0 → s1 → s2 → · · · with s1 | = ϕ s | = AX ϕ if ∀s = s0 → s1 → s2 → · · · , we have s1 | = ϕ s | = E ϕ U ψ if ∃s = s0 → s1 → s2 → · · · , ∃j ≥ 0 with sj | = ψ and sk | = ϕ for all 0 ≤ k < j s | = A ϕ U ψ if ∀s = s0 → s1 → s2 → · · · , ∃j ≥ 0 with sj | = ψ and sk | = ϕ for all 0 ≤ k < j

slide-153
SLIDE 153

59/71

CTL (Clarke & Emerson 81)

Syntax: CTL: Computation Tree Logic

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | EX ϕ | AX ϕ | E ϕ U ϕ | A ϕ U ϕ

Remarks

The semantics is inherited from CTL∗. All CTL-formulas are state formulas. Hence, we have a simpler semantics.

Semantics: only state formulas

Let M = (S, T, I, AP, ℓ) be a Kripke structure and let s ∈ S. s | = p if p ∈ ℓ(s) s | = EX ϕ if ∃s = s0 → s1 → s2 → · · · with s1 | = ϕ s | = AX ϕ if ∀s = s0 → s1 → s2 → · · · , we have s1 | = ϕ s | = E ϕ U ψ if ∃s = s0 → s1 → s2 → · · · , ∃j ≥ 0 with sj | = ψ and sk | = ϕ for all 0 ≤ k < j s | = A ϕ U ψ if ∀s = s0 → s1 → s2 → · · · , ∃j ≥ 0 with sj | = ψ and sk | = ϕ for all 0 ≤ k < j

slide-154
SLIDE 154

60/71

CTL (Clarke & Emerson 81)

Semantics: only state formulas

Let M = (S, T, I, AP, ℓ) be a Kripke structure without deadlocks and let s ∈ S. s | = p if p ∈ ℓ(s) s | = EX ϕ if ∃s → s′ with s′ | = ϕ s | = AX ϕ if ∀s → s′ we have s′ | = ϕ s | = E ϕ U ψ if ∃s = s0 → s1 → s2 → · · · sj, with sj | = ψ and sk | = ϕ for all 0 ≤ k < j s | = A ϕ U ψ if ∀s = s0 → s1 → s2 → · · · , ∃j ≥ 0 with sj | = ψ and sk | = ϕ for all 0 ≤ k < j

Macros

◮ EF ϕ = E ⊤ U ϕ

and AF ϕ = A ⊤ U ϕ F ϕ = ⊤ U ϕ.

◮ EG ϕ = ¬ AF ¬ϕ

and AG ϕ = ¬ EF ¬ϕ

slide-155
SLIDE 155

60/71

CTL (Clarke & Emerson 81)

Semantics: only state formulas

Let M = (S, T, I, AP, ℓ) be a Kripke structure without deadlocks and let s ∈ S. s | = p if p ∈ ℓ(s) s | = EX ϕ if ∃s → s′ with s′ | = ϕ s | = AX ϕ if ∀s → s′ we have s′ | = ϕ s | = E ϕ U ψ if ∃s = s0 → s1 → s2 → · · · sj, with sj | = ψ and sk | = ϕ for all 0 ≤ k < j s | = A ϕ U ψ if ∀s = s0 → s1 → s2 → · · · , ∃j ≥ 0 with sj | = ψ and sk | = ϕ for all 0 ≤ k < j

Macros

◮ EF ϕ = E ⊤ U ϕ

and AF ϕ = A ⊤ U ϕ F ϕ = ⊤ U ϕ.

◮ EG ϕ = ¬ AF ¬ϕ

and AG ϕ = ¬ EF ¬ϕ

slide-156
SLIDE 156

61/71

CTL (Clarke & Emerson 81)

Example

1 2 3 4 5 6 7 8 q p, q q r p, r p, r p, q

Compute

S(EX p) = S(AX p) = S(EF p) = S(AF p) = S(E q U r) = S(A q U r) =

slide-157
SLIDE 157

61/71

CTL (Clarke & Emerson 81)

Example

1 2 3 4 5 6 7 8 q p, q q r p, r p, r p, q

Compute

S(EX p) = {1, 2, 3, 5, 6} S(AX p) = S(EF p) = S(AF p) = S(E q U r) = S(A q U r) =

slide-158
SLIDE 158

61/71

CTL (Clarke & Emerson 81)

Example

1 2 3 4 5 6 7 8 q p, q q r p, r p, r p, q

Compute

S(EX p) = {1, 2, 3, 5, 6} S(AX p) = {3, 6} S(EF p) = S(AF p) = S(E q U r) = S(A q U r) =

slide-159
SLIDE 159

61/71

CTL (Clarke & Emerson 81)

Example

1 2 3 4 5 6 7 8 q p, q q r p, r p, r p, q

Compute

S(EX p) = {1, 2, 3, 5, 6} S(AX p) = {3, 6} S(EF p) = {1, 2, 3, 4, 5, 6, 7, 8} S(AF p) = S(E q U r) = S(A q U r) =

slide-160
SLIDE 160

61/71

CTL (Clarke & Emerson 81)

Example

1 2 3 4 5 6 7 8 q p, q q r p, r p, r p, q

Compute

S(EX p) = {1, 2, 3, 5, 6} S(AX p) = {3, 6} S(EF p) = {1, 2, 3, 4, 5, 6, 7, 8} S(AF p) = {2, 3, 5, 6, 7} S(E q U r) = S(A q U r) =

slide-161
SLIDE 161

61/71

CTL (Clarke & Emerson 81)

Example

1 2 3 4 5 6 7 8 q p, q q r p, r p, r p, q

Compute

S(EX p) = {1, 2, 3, 5, 6} S(AX p) = {3, 6} S(EF p) = {1, 2, 3, 4, 5, 6, 7, 8} S(AF p) = {2, 3, 5, 6, 7} S(E q U r) = {1, 2, 3, 4, 5, 6} S(A q U r) =

slide-162
SLIDE 162

61/71

CTL (Clarke & Emerson 81)

Example

1 2 3 4 5 6 7 8 q p, q q r p, r p, r p, q

Compute

S(EX p) = {1, 2, 3, 5, 6} S(AX p) = {3, 6} S(EF p) = {1, 2, 3, 4, 5, 6, 7, 8} S(AF p) = {2, 3, 5, 6, 7} S(E q U r) = {1, 2, 3, 4, 5, 6} S(A q U r) = {2, 3, 4, 5, 6}

slide-163
SLIDE 163

62/71

CTL (Clarke & Emerson 81)

Equivalent formulas

◮ AX ϕ = ¬ EX ¬ϕ, ◮

A ϕ U ψ = ¬ E ¬(ϕ U ψ) = ¬ E(G ¬ψ ∧ ¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ EG ¬ψ ∨ ¬ E ¬ψ U (¬ϕ ∧ ¬ψ)

◮ A G(req → F grant) = AG(req → AF grant) ◮ A G F ϕ = AG AF ϕ

infinitely often

◮ E F G ϕ = EF EG ϕ

ultimately

◮ EG EF ϕ = E G F ϕ ◮ AF AG ϕ = A F G ϕ ◮ EG EX ϕ = E G X ϕ

slide-164
SLIDE 164

62/71

CTL (Clarke & Emerson 81)

Equivalent formulas

◮ AX ϕ = ¬ EX ¬ϕ, ◮

A ϕ U ψ = ¬ E ¬(ϕ U ψ) = ¬ E(G ¬ψ ∧ ¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ EG ¬ψ ∨ ¬ E ¬ψ U (¬ϕ ∧ ¬ψ)

◮ A G(req → F grant) = AG(req → AF grant) ◮ A G F ϕ = AG AF ϕ

infinitely often

◮ E F G ϕ = EF EG ϕ

ultimately

◮ EG EF ϕ = E G F ϕ ◮ AF AG ϕ = A F G ϕ ◮ EG EX ϕ = E G X ϕ

slide-165
SLIDE 165

62/71

CTL (Clarke & Emerson 81)

Equivalent formulas

◮ AX ϕ = ¬ EX ¬ϕ, ◮

A ϕ U ψ = ¬ E ¬(ϕ U ψ) = ¬ E(G ¬ψ ∧ ¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ EG ¬ψ ∨ ¬ E ¬ψ U (¬ϕ ∧ ¬ψ)

◮ A G(req → F grant) = AG(req → AF grant) ◮ A G F ϕ = AG AF ϕ

infinitely often

◮ E F G ϕ = EF EG ϕ

ultimately

◮ EG EF ϕ = E G F ϕ ◮ AF AG ϕ = A F G ϕ ◮ EG EX ϕ = E G X ϕ

slide-166
SLIDE 166

62/71

CTL (Clarke & Emerson 81)

Equivalent formulas

◮ AX ϕ = ¬ EX ¬ϕ, ◮

A ϕ U ψ = ¬ E ¬(ϕ U ψ) = ¬ E(G ¬ψ ∧ ¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ EG ¬ψ ∨ ¬ E ¬ψ U (¬ϕ ∧ ¬ψ)

◮ A G(req → F grant) = AG(req → AF grant) ◮ A G F ϕ = AG AF ϕ

infinitely often

◮ E F G ϕ = EF EG ϕ

ultimately

◮ EG EF ϕ = E G F ϕ ◮ AF AG ϕ = A F G ϕ ◮ EG EX ϕ = E G X ϕ

slide-167
SLIDE 167

62/71

CTL (Clarke & Emerson 81)

Equivalent formulas

◮ AX ϕ = ¬ EX ¬ϕ, ◮

A ϕ U ψ = ¬ E ¬(ϕ U ψ) = ¬ E(G ¬ψ ∧ ¬ψ U (¬ϕ ∧ ¬ψ)) = ¬ EG ¬ψ ∨ ¬ E ¬ψ U (¬ϕ ∧ ¬ψ)

◮ A G(req → F grant) = AG(req → AF grant) ◮ A G F ϕ = AG AF ϕ

infinitely often

◮ E F G ϕ = EF EG ϕ

ultimately

◮ EG EF ϕ = E G F ϕ ◮ AF AG ϕ = A F G ϕ

1 2 3 ¬ϕ ϕ ¬ϕ

◮ EG EX ϕ = E G X ϕ

slide-168
SLIDE 168

63/71

Model checking of CTL

Model checking problem

Input: A Kripke structure M = (S, T, I, AP, ℓ) and a formula ϕ ∈ CTL Question: Does M | = ϕ ?

Remark

M | = ϕ iff I ⊆ S(ϕ)

Theorem

The model checking problem for CTL is decidable in time O(|M| · |ϕ|)

Proof

Marking algorithm.

slide-169
SLIDE 169

63/71

Model checking of CTL

Model checking problem

Input: A Kripke structure M = (S, T, I, AP, ℓ) and a formula ϕ ∈ CTL Question: Does M | = ϕ ?

Remark

M | = ϕ iff I ⊆ S(ϕ)

Theorem

The model checking problem for CTL is decidable in time O(|M| · |ϕ|)

Proof

Marking algorithm.

slide-170
SLIDE 170

64/71

Model checking of CTL

procedure mark(ϕ)

case ϕ = p ∈ AP for all s ∈ S do s.ϕ := (p ∈ ℓ(s)); case ϕ = ¬ϕ1 mark(ϕ1); for all s ∈ S do s.ϕ := ¬ s.ϕ1; case ϕ = ϕ1 ∨ ϕ2 mark(ϕ1); mark(ϕ2); for all s ∈ S do s.ϕ := s.ϕ1 ∨ s.ϕ2; case ϕ = EXϕ1 mark(ϕ1); for all s ∈ S do s.ϕ := false; for all (t, s) ∈ T do if s.ϕ1 then t.ϕ := true; case ϕ = AXϕ1 mark(ϕ1); for all s ∈ S do s.ϕ := true; for all (t, s) ∈ T do if ¬ s.ϕ1 then t.ϕ := false;

slide-171
SLIDE 171

65/71

Model checking of CTL

procedure mark(ϕ)

case ϕ = Eϕ1 U ϕ2 mark(ϕ1); mark(ϕ2); L := ∅; for all s ∈ S do s.ϕ := s.ϕ2; if s.ϕ then L := L ∪ {s}; while L = ∅ do take s ∈ L; L := L \ {s}; for all t ∈ S with (t, s) ∈ T do if t.ϕ1 ∧ ¬ t.ϕ then t.ϕ := true; L := L ∪ {t};

slide-172
SLIDE 172

66/71

Model checking of CTL

procedure mark(ϕ)

case ϕ = Aϕ1 U ϕ2 mark(ϕ1); mark(ϕ2); L := ∅; for all s ∈ S do s.ϕ := s.ϕ2; s.nb := degree(s); if s.ϕ then L := L ∪ {s}; while L = ∅ do take s ∈ L; L := L \ {s}; for all t ∈ S with (t, s) ∈ T do t.nb := t.nb − 1; if t.nb = 0 ∧ t.ϕ1 ∧ ¬ t.ϕ then t.ϕ := true; L := L ∪ {t};

slide-173
SLIDE 173

67/71

fairness

Fairness

Only fair runs are of interest

◮ Each process is enabled infinitely often:

  • i

G F runi

◮ No process stays ultimately in the critical section:

  • i

¬ F G CSi =

  • i

G F ¬CSi

Fair Kripke structure

M = (S, T, I, AP, ℓ, F) where F = {F1, . . . , Fn} with Fi ⊆ S. An infinite run σ is fair if it visits infinitely often each Fi

Fair quantifications

Ef ϕ = E(fair ∧ ϕ) and Af ϕ = A(fair → ϕ) where fair =

  • i

G F Fi

slide-174
SLIDE 174

67/71

fairness

Fairness

Only fair runs are of interest

◮ Each process is enabled infinitely often:

  • i

G F runi

◮ No process stays ultimately in the critical section:

  • i

¬ F G CSi =

  • i

G F ¬CSi

Fair Kripke structure

M = (S, T, I, AP, ℓ, F) where F = {F1, . . . , Fn} with Fi ⊆ S. An infinite run σ is fair if it visits infinitely often each Fi

Fair quantifications

Ef ϕ = E(fair ∧ ϕ) and Af ϕ = A(fair → ϕ) where fair =

  • i

G F Fi

slide-175
SLIDE 175

67/71

fairness

Fairness

Only fair runs are of interest

◮ Each process is enabled infinitely often:

  • i

G F runi

◮ No process stays ultimately in the critical section:

  • i

¬ F G CSi =

  • i

G F ¬CSi

Fair Kripke structure

M = (S, T, I, AP, ℓ, F) where F = {F1, . . . , Fn} with Fi ⊆ S. An infinite run σ is fair if it visits infinitely often each Fi

Fair quantifications

Ef ϕ = E(fair ∧ ϕ) and Af ϕ = A(fair → ϕ) where fair =

  • i

G F Fi

slide-176
SLIDE 176

68/71

fair CTL

Syntax of fair-CTL

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | Ef X ϕ | Af X ϕ | Ef ϕ U ϕ | Af ϕ U ϕ

Lemma: CTLf cannot be expressed in CTL

Consider the Kripke structure Mk defined by:

◮ Mk, 2k |

= E G F p but Mk, 2k − 2 | = E G F p

◮ If ϕ ∈ CTL and |ϕ| ≤ m ≤ k then Mk, 2k |

= ϕ iff Mk, 2m | = ϕ If the fairness condition is ℓ−1(p) then Ef F ⊤ cannot be expressed in CTL.

slide-177
SLIDE 177

68/71

fair CTL

Syntax of fair-CTL

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | Ef X ϕ | Af X ϕ | Ef ϕ U ϕ | Af ϕ U ϕ

Lemma: CTLf cannot be expressed in CTL

Consider the Kripke structure Mk defined by:

2k 2k − 1 2k − 2 2k − 3 · · · 4 3 2 1 p p p p ¬p ¬p ¬p ¬p

◮ Mk, 2k |

= E G F p but Mk, 2k − 2 | = E G F p

◮ If ϕ ∈ CTL and |ϕ| ≤ m ≤ k then Mk, 2k |

= ϕ iff Mk, 2m | = ϕ If the fairness condition is ℓ−1(p) then Ef F ⊤ cannot be expressed in CTL.

slide-178
SLIDE 178

68/71

fair CTL

Syntax of fair-CTL

ϕ ::= ⊥ | p (p ∈ AP) | ¬ϕ | ϕ ∨ ϕ | Ef X ϕ | Af X ϕ | Ef ϕ U ϕ | Af ϕ U ϕ

Lemma: CTLf cannot be expressed in CTL

Consider the Kripke structure Mk defined by:

2k 2k − 1 2k − 2 2k − 3 · · · 4 3 2 1 p p p p ¬p ¬p ¬p ¬p

◮ Mk, 2k |

= E G F p but Mk, 2k − 2 | = E G F p

◮ If ϕ ∈ CTL and |ϕ| ≤ m ≤ k then Mk, 2k |

= ϕ iff Mk, 2m | = ϕ If the fairness condition is ℓ−1(p) then Ef F ⊤ cannot be expressed in CTL.

slide-179
SLIDE 179

69/71

Model checking of CTLf

First step: Computation of Fair = {s ∈ S | M, s | = Ef F ⊤}

Compute the SCC of M with Tarjan’s algorithm (in linear time). Let S′ be the union of the SCCs which intersect each Fi. Then, Fair is the set of states that can reach S′. Note that reachability can be computed in linear time.

Reductions

Ef X ϕ = E X(Fair ∧ ϕ) and Ef ϕ U ψ = E ϕ U (Fair ∧ ψ) It remains to deal with Af ϕ U ψ. Recall that A ϕ U ψ = ¬ EG ¬ψ ∨ ¬ E ¬ψ U (¬ϕ ∧ ¬ψ) This formula also holds for the fair quantifications. Hence, we only need to compute the semantics of Ef G ϕ.

slide-180
SLIDE 180

69/71

Model checking of CTLf

First step: Computation of Fair = {s ∈ S | M, s | = Ef F ⊤}

Compute the SCC of M with Tarjan’s algorithm (in linear time). Let S′ be the union of the SCCs which intersect each Fi. Then, Fair is the set of states that can reach S′. Note that reachability can be computed in linear time.

Reductions

Ef X ϕ = E X(Fair ∧ ϕ) and Ef ϕ U ψ = E ϕ U (Fair ∧ ψ) It remains to deal with Af ϕ U ψ. Recall that A ϕ U ψ = ¬ EG ¬ψ ∨ ¬ E ¬ψ U (¬ϕ ∧ ¬ψ) This formula also holds for the fair quantifications. Hence, we only need to compute the semantics of Ef G ϕ.

slide-181
SLIDE 181

69/71

Model checking of CTLf

First step: Computation of Fair = {s ∈ S | M, s | = Ef F ⊤}

Compute the SCC of M with Tarjan’s algorithm (in linear time). Let S′ be the union of the SCCs which intersect each Fi. Then, Fair is the set of states that can reach S′. Note that reachability can be computed in linear time.

Reductions

Ef X ϕ = E X(Fair ∧ ϕ) and Ef ϕ U ψ = E ϕ U (Fair ∧ ψ) It remains to deal with Af ϕ U ψ. Recall that A ϕ U ψ = ¬ EG ¬ψ ∨ ¬ E ¬ψ U (¬ϕ ∧ ¬ψ) This formula also holds for the fair quantifications. Hence, we only need to compute the semantics of Ef G ϕ.

slide-182
SLIDE 182

70/71

Model checking of CTLf

Computation of Ef G ϕ

Let Mϕ be the restriction of M to Sf(ϕ). Compute the SCC of Mϕ with Tarjan’s algorithm (in linear time). Let S′ be the union of the SCCs of Mϕ which intersect each Fi. Then, M, s | = Ef G ϕ iff M, s | = E ϕ U S′ iff Mϕ | = EF S′. This is again a reachability problem which can be done in linear time.

Theorem

The model checking problem for CTLf is decidable in time O(|M| · |ϕ|)

slide-183
SLIDE 183

70/71

Model checking of CTLf

Computation of Ef G ϕ

Let Mϕ be the restriction of M to Sf(ϕ). Compute the SCC of Mϕ with Tarjan’s algorithm (in linear time). Let S′ be the union of the SCCs of Mϕ which intersect each Fi. Then, M, s | = Ef G ϕ iff M, s | = E ϕ U S′ iff Mϕ | = EF S′. This is again a reachability problem which can be done in linear time.

Theorem

The model checking problem for CTLf is decidable in time O(|M| · |ϕ|)

slide-184
SLIDE 184

71/71

Missing in this talk

◮ Symbolic model checking for CTL using BDDs. ◮ µ- calculus ◮ . . .