Advanced Logic Linear Temporal Logic Computation Tree Logic - - PowerPoint PPT Presentation

advanced logic linear temporal logic computation tree
SMART_READER_LITE
LIVE PREVIEW

Advanced Logic Linear Temporal Logic Computation Tree Logic - - PowerPoint PPT Presentation

Advanced Logic Linear Temporal Logic Computation Tree Logic Daniel Gebler VU University Amsterdam March 11, 2013 Overview Linear temporal logic (LTL): describes properties of paths (individual executions) no modalities to


slide-1
SLIDE 1

— Advanced Logic — Linear Temporal Logic Computation Tree Logic

Daniel Gebler

VU University Amsterdam

March 11, 2013

slide-2
SLIDE 2

Overview

Linear temporal logic (LTL):

◮ describes properties of paths (individual executions) ◮ no modalities to reason about branching

Computation tree logic (CTL):

◮ is a branching-time logic ◮ time has a tree structure (multiple possible futures) ◮ has modalities for reasoning about the branching structure

slide-3
SLIDE 3

Linear Temporal Logic (LTL)

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ | X φ where p ∈ Ω LTL formulas have meaning on individual computation paths:

◮ let π = s1 → s2 → s3 → . . . a path; write πi for si → si+1 → . . .

The path π satisfies φ, π | = φ, is defined by:

1

π | = p iff s1 ∈ V (p)

2

π | = ⊤; π | = ¬φ iff π | = φ; π | = φ1 ∧ φ2 iff π | = φ1 and π | = φ2

slide-4
SLIDE 4

Linear Temporal Logic (LTL)

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ where p ∈ Ω LTL formulas have meaning on individual computation paths:

◮ let π = s1 → s2 → s3 → . . . a path; write πi for si → si+1 → . . .

The path π satisfies φ, π | = φ, is defined by:

1

π | = p iff s1 ∈ V (p)

2

π | = ⊤; π | = ¬φ iff π | = φ; π | = φ1 ∧ φ2 iff π | = φ1 and π | = φ2

slide-5
SLIDE 5

Linear Temporal Logic (LTL)

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next where p ∈ Ω LTL formulas have meaning on individual computation paths:

◮ let π = s1 → s2 → s3 → . . . a path; write πi for si → si+1 → . . .

The path π satisfies φ, π | = φ, is defined by:

1

π | = p iff s1 ∈ V (p)

2

π | = ⊤; π | = ¬φ iff π | = φ; π | = φ1 ∧ φ2 iff π | = φ1 and π | = φ2

slide-6
SLIDE 6

Linear Temporal Logic (LTL)

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next where p ∈ Ω LTL formulas have meaning on individual computation paths:

◮ let π = s1 → s2 → s3 → . . . a path; write πi for si → si+1 → . . .

The path π satisfies φ, π | = φ, is defined by:

1

π | = p iff s1 ∈ V (p)

2

π | = ⊤; π | = ¬φ iff π | = φ; π | = φ1 ∧ φ2 iff π | = φ1 and π | = φ2

3

π | = φ U ψ (φ is true until ψ is true) φ φ φ φ ψ formally: for some i ≥ 1, πi | = ψ and for all j < i, πj | = φ

slide-7
SLIDE 7

Linear Temporal Logic (LTL)

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next where p ∈ Ω LTL formulas have meaning on individual computation paths:

◮ let π = s1 → s2 → s3 → . . . a path; write πi for si → si+1 → . . .

The path π satisfies φ, π | = φ, is defined by:

1

π | = p iff s1 ∈ V (p)

2

π | = ⊤; π | = ¬φ iff π | = φ; π | = φ1 ∧ φ2 iff π | = φ1 and π | = φ2

3

π | = φ U ψ (φ is true until ψ is true) φ φ φ φ ψ formally: for some i ≥ 1, πi | = ψ and for all j < i, πj | = φ

4

π | = X φ (φ is true in the next moment in time) φ formally: π2 | = φ

slide-8
SLIDE 8

LTL: Extended

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next | F φ | G φ where p ∈ Ω

slide-9
SLIDE 9

LTL: Extended

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next | F φ finally | G φ where p ∈ Ω

slide-10
SLIDE 10

LTL: Extended

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next | F φ finally | G φ globally where p ∈ Ω

slide-11
SLIDE 11

LTL: Extended

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next | F φ finally | G φ globally where p ∈ Ω

1

π | = G φ iff for all i ≥ 1, πi | = φ φ φ φ φ φ φ

slide-12
SLIDE 12

LTL: Extended

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next | F φ finally | G φ globally where p ∈ Ω

1

π | = G φ iff for all i ≥ 1, πi | = φ φ φ φ φ φ φ

2

π | = F φ iff for some i ≥ 1, πi | = φ φ

slide-13
SLIDE 13

LTL: Extended

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next | F φ finally | G φ globally where p ∈ Ω

1

π | = G φ iff for all i ≥ 1, πi | = φ φ φ φ φ φ φ

2

π | = F φ iff for some i ≥ 1, πi | = φ φ The modalities F and G can be defined:

slide-14
SLIDE 14

LTL: Extended

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next | F φ finally | G φ globally where p ∈ Ω

1

π | = G φ iff for all i ≥ 1, πi | = φ φ φ φ φ φ φ

2

π | = F φ iff for some i ≥ 1, πi | = φ φ The modalities F and G can be defined: F = ⊤ U φ G φ = ¬F ¬φ = ¬(⊤ U ¬φ)

slide-15
SLIDE 15

LTL: Extended

Linear temporal logic (LTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ U φ until | X φ next | F φ finally | G φ globally where p ∈ Ω

1

π | = G φ iff for all i ≥ 1, πi | = φ φ φ φ φ φ φ

2

π | = F φ iff for some i ≥ 1, πi | = φ φ The modalities F and G can be defined: F = ⊤ U φ G φ = ¬F ¬φ = ¬(⊤ U ¬φ) Binding strength: ¬, X , F , G stronger than U than ∧, ∨ than →, ↔

slide-16
SLIDE 16

LTL: Examples

◮ F G φ :

slide-17
SLIDE 17

LTL: Examples

◮ F G φ : from some point on, φ holds forever

φ φ φ φ

slide-18
SLIDE 18

LTL: Examples

◮ F G φ : from some point on, φ holds forever

φ φ φ φ

◮ G F φ :

slide-19
SLIDE 19

LTL: Examples

◮ F G φ : from some point on, φ holds forever

φ φ φ φ

◮ G F φ : always eventually φ (in every suffix, at some point φ holds)

φ φ φ

slide-20
SLIDE 20

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state.

slide-21
SLIDE 21

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release

slide-22
SLIDE 22

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? ? | = X extended ? | = F G extended ? | = X X extended ? | = ¬ F G extended ? | = F extended ? | = G (¬extended → X extended) ? | = G extended ? | = G (extended → X ¬extended) ? | = G F extended

slide-23
SLIDE 23

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? M, s1, s3 | = X extended ? | = F G extended ? | = X X extended ? | = ¬ F G extended ? | = F extended ? | = G (¬extended → X extended) ? | = G extended ? | = G (extended → X ¬extended) ? | = G F extended

slide-24
SLIDE 24

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? M, s1, s3 | = X extended ? | = F G extended M, s2, s3 | = X X extended ? | = ¬ F G extended ? | = F extended ? | = G (¬extended → X extended) ? | = G extended ? | = G (extended → X ¬extended) ? | = G F extended

slide-25
SLIDE 25

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? M, s1, s3 | = X extended ? | = F G extended M, s2, s3 | = X X extended ? | = ¬ F G extended M, s1, s2, s3 | = F extended ? | = G (¬extended → X extended) ? | = G extended ? | = G (extended → X ¬extended) ? | = G F extended

slide-26
SLIDE 26

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? M, s1, s3 | = X extended ? | = F G extended M, s2, s3 | = X X extended ? | = ¬ F G extended M, s1, s2, s3 | = F extended ? | = G (¬extended → X extended) M, s3 | = G extended ? | = G (extended → X ¬extended) ? | = G F extended

slide-27
SLIDE 27

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? M, s1, s3 | = X extended ? | = F G extended M, s2, s3 | = X X extended ? | = ¬ F G extended M, s1, s2, s3 | = F extended ? | = G (¬extended → X extended) M, s3 | = G extended ? | = G (extended → X ¬extended) M, s1, s2, s3 | = G F extended

slide-28
SLIDE 28

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? M, s1, s3 | = X extended M, s3 | = F G extended M, s2, s3 | = X X extended ? | = ¬ F G extended M, s1, s2, s3 | = F extended ? | = G (¬extended → X extended) M, s3 | = G extended ? | = G (extended → X ¬extended) M, s1, s2, s3 | = G F extended

slide-29
SLIDE 29

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? M, s1, s3 | = X extended M, s3 | = F G extended M, s2, s3 | = X X extended M, s1, s2, s3 | = ¬ F G extended M, s1, s2, s3 | = F extended ? | = G (¬extended → X extended) M, s3 | = G extended ? | = G (extended → X ¬extended) M, s1, s2, s3 | = G F extended

slide-30
SLIDE 30

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? M, s1, s3 | = X extended M, s3 | = F G extended M, s2, s3 | = X X extended M, s1, s2, s3 | = ¬ F G extended M, s1, s2, s3 | = F extended ? | = G (¬extended → X extended) M, s3 | = G extended ? | = G (extended → X ¬extended) M, s1, s2, s3 | = G F extended Note that: M | = F G extended and M | = ¬ F G extended !

slide-31
SLIDE 31

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? M, s1, s3 | = X extended M, s3 | = F G extended M, s2, s3 | = X X extended M, s1, s2, s3 | = ¬ F G extended M, s1, s2, s3 | = F extended M | = G (¬extended → X extended) M, s3 | = G extended ? | = G (extended → X ¬extended) M, s1, s2, s3 | = G F extended Note that: M | = F G extended and M | = ¬ F G extended !

slide-32
SLIDE 32

LTL: Models

M, s | = φ if φ is satisfied on every path starting at s. M | = φ if φ is satisfied on every path starting from the initial state. s1 s2 extended s3 extended, malfunction pull breaks release Which of the states satisfies the following? M, s1, s3 | = X extended M, s3 | = F G extended M, s2, s3 | = X X extended M, s1, s2, s3 | = ¬ F G extended M, s1, s2, s3 | = F extended M | = G (¬extended → X extended) M, s3 | = G extended M, s1, s2, s3 | = G (extended → X ¬extended) M, s1, s2, s3 | = G F extended Note that: M | = F G extended and M | = ¬ F G extended !

slide-33
SLIDE 33

LTL: Equivalence of Formulas

LTL formulas φ and ψ are semantically equivalent, denoted by φ ≡ ψ, if they are true for the same paths

slide-34
SLIDE 34

LTL: Equivalence of Formulas

LTL formulas φ and ψ are semantically equivalent, denoted by φ ≡ ψ, if they are true for the same paths Which of the following are semantically equivalent? X (φ ∨ ψ) ≡ X φ ∨ X ψ X (φ ∧ ψ) ≡ X φ ∧ X ψ F (φ ∧ ψ) ≡ F φ ∧ F ψ F (φ ∨ ψ) ≡ F φ ∨ F ψ G (φ ∧ ψ) ≡ G φ ∧ F ψ G (φ ∨ ψ) ≡ G φ ∨ F ψ ρ U (φ ∨ ψ) ≡ (ρ U φ) ∨ (ρ U ψ) ρ U (φ ∧ ψ) ≡ (ρ U φ) ∧ (ρ U ψ) F F φ ≡ F φ G G φ ≡ G φ F G φ ≡ G F φ ¬F φ ≡ G ¬φ ¬G φ ≡ F ¬φ F φ ≡ φ ∨ X (F φ) G φ ≡ φ ∧ X (G φ) φ U ψ ≡ φ U (φ U ψ)

slide-35
SLIDE 35

LTL: Equivalence of Formulas

LTL formulas φ and ψ are semantically equivalent, denoted by φ ≡ ψ, if they are true for the same paths Which of the following are semantically equivalent? X (φ ∨ ψ) ≡ X φ ∨ X ψ X (φ ∧ ψ) ≡ X φ ∧ X ψ F (φ ∧ ψ) ≡ F φ ∧ F ψ F (φ ∨ ψ) ≡ F φ ∨ F ψ G (φ ∧ ψ) ≡ G φ ∧ F ψ G (φ ∨ ψ) ≡ G φ ∨ F ψ ρ U (φ ∨ ψ) ≡ (ρ U φ) ∨ (ρ U ψ) ρ U (φ ∧ ψ) ≡ (ρ U φ) ∧ (ρ U ψ) F F φ ≡ F φ G G φ ≡ G φ F G φ ≡ G F φ ¬F φ ≡ G ¬φ ¬G φ ≡ F ¬φ F φ ≡ φ ∨ X (F φ) G φ ≡ φ ∧ X (G φ) φ U ψ ≡ φ U (φ U ψ)

slide-36
SLIDE 36

LTL: Equivalence of Formulas

LTL formulas φ and ψ are semantically equivalent, denoted by φ ≡ ψ, if they are true for the same paths Which of the following are semantically equivalent? X (φ ∨ ψ) ≡ X φ ∨ X ψ X (φ ∧ ψ) ≡ X φ ∧ X ψ F (φ ∧ ψ) ≡ F φ ∧ F ψ F (φ ∨ ψ) ≡ F φ ∨ F ψ G (φ ∧ ψ) ≡ G φ ∧ F ψ G (φ ∨ ψ) ≡ G φ ∨ F ψ ρ U (φ ∨ ψ) ≡ (ρ U φ) ∨ (ρ U ψ) ρ U (φ ∧ ψ) ≡ (ρ U φ) ∧ (ρ U ψ) F F φ ≡ F φ G G φ ≡ G φ F G φ ≡ G F φ ¬F φ ≡ G ¬φ ¬G φ ≡ F ¬φ F φ ≡ φ ∨ X (F φ) G φ ≡ φ ∧ X (G φ) φ U ψ ≡ φ U (φ U ψ)

slide-37
SLIDE 37

LTL: Equivalence of Formulas

LTL formulas φ and ψ are semantically equivalent, denoted by φ ≡ ψ, if they are true for the same paths Which of the following are semantically equivalent? X (φ ∨ ψ) ≡ X φ ∨ X ψ X (φ ∧ ψ) ≡ X φ ∧ X ψ F (φ ∧ ψ) ≡ F φ ∧ F ψ F (φ ∨ ψ) ≡ F φ ∨ F ψ G (φ ∧ ψ) ≡ G φ ∧ F ψ G (φ ∨ ψ) ≡ G φ ∨ F ψ ρ U (φ ∨ ψ) ≡ (ρ U φ) ∨ (ρ U ψ) ρ U (φ ∧ ψ) ≡ (ρ U φ) ∧ (ρ U ψ) F F φ ≡ F φ G G φ ≡ G φ F G φ ≡ G F φ ¬F φ ≡ G ¬φ ¬G φ ≡ F ¬φ F φ ≡ φ ∨ X (F φ) G φ ≡ φ ∧ X (G φ) φ U ψ ≡ φ U (φ U ψ)

slide-38
SLIDE 38

LTL: Equivalence of Formulas

LTL formulas φ and ψ are semantically equivalent, denoted by φ ≡ ψ, if they are true for the same paths Which of the following are semantically equivalent? X (φ ∨ ψ) ≡ X φ ∨ X ψ X (φ ∧ ψ) ≡ X φ ∧ X ψ F (φ ∧ ψ) ≡ F φ ∧ F ψ F (φ ∨ ψ) ≡ F φ ∨ F ψ G (φ ∧ ψ) ≡ G φ ∧ F ψ G (φ ∨ ψ) ≡ G φ ∨ F ψ ρ U (φ ∨ ψ) ≡ (ρ U φ) ∨ (ρ U ψ) ρ U (φ ∧ ψ) ≡ (ρ U φ) ∧ (ρ U ψ) F F φ ≡ F φ G G φ ≡ G φ F G φ ≡ G F φ ¬F φ ≡ G ¬φ ¬G φ ≡ F ¬φ F φ ≡ φ ∨ X (F φ) G φ ≡ φ ∧ X (G φ) φ U ψ ≡ φ U (φ U ψ)

slide-39
SLIDE 39

Mutual Exclusion

◮ multiple processes ◮ a shared resource that can only be used by one process at a time

process P process Q shared resource

slide-40
SLIDE 40

Mutual Exclusion

◮ multiple processes ◮ a shared resource that can only be used by one process at a time

process P process Q shared resource P non critical . . . CP critical section . . . non critical Q non critical . . . CQ critical section . . . non critical To solve conflicts: processes agree on a negotiation protocol.

◮ mutual exclusion: never more than one process in the critical section

slide-41
SLIDE 41

Mutual Exclusion

◮ multiple processes ◮ a shared resource that can only be used by one process at a time

process P process Q shared resource P non critical . . . CP critical section . . . non critical Q non critical . . . CQ critical section . . . non critical To solve conflicts: processes agree on a negotiation protocol.

◮ mutual exclusion: never more than one process in the critical section

G ¬(CQ ∧ CP)

slide-42
SLIDE 42

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1

slide-43
SLIDE 43

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1

slide-44
SLIDE 44

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0

slide-45
SLIDE 45

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0

slide-46
SLIDE 46

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0

slide-47
SLIDE 47

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0 p1,q2,1

slide-48
SLIDE 48

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0 p1,q2,1 p1,CQ,0

slide-49
SLIDE 49

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0 p1,q2,1 p1,CQ,0 p1,q4,0

slide-50
SLIDE 50

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0 p1,q2,1 p1,CQ,0 p1,q4,0

slide-51
SLIDE 51

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0 p1,q2,1 p1,CQ,0 p1,q4,0

slide-52
SLIDE 52

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0 p1,q2,1 p1,CQ,0 p1,q4,0 p2,q2,1

slide-53
SLIDE 53

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0 p1,q2,1 p1,CQ,0 p1,q4,0 p2,q2,1 p2,CQ,0

slide-54
SLIDE 54

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0 p1,q2,1 p1,CQ,0 p1,q4,0 p2,q2,1 p2,CQ,0 CP,CQ,0

slide-55
SLIDE 55

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0 p1,q2,1 p1,CQ,0 p1,q4,0 p2,q2,1 p2,CQ,0 CP,CQ,0 CP,q2,0

slide-56
SLIDE 56

Mutual Exclusion: Attempt 1

◮ boolean variable free = 1

P loop forever p1: wait for free = 1 p2: free = 0 CP: critical section p4: free = 1 Q loop forever q1: wait for free = 1 q2: free = 0 CQ: critical section q4: free = 1 For such a program we compute the state space:

p1,q1,1 p2,q1,1 CP,q1,0 p4,q1,0 p1,q2,1 p1,CQ,0 p1,q4,0 p2,q2,1 p2,CQ,0 CP,CQ,0 CP,q2,0 p2,q4,0 p4,q2,0 CP,q4,0 p4,CQ,0 p4,q4,0

slide-57
SLIDE 57

Model Checking

1

Formalize the system design

2

Formalize the validation requirements

3

Validate: system meets requirements

System Reqs LTL SPIN engine Req1 Req2 . . . Reqn System design Promela or Embedded C Verification process

slide-58
SLIDE 58

Mutual Exclusion: Peterson

◮ boolean variables x = 0, y = 0, t = 0

P loop forever p1: x = 1 p2: turn = 1 p3: wait for y = 0 or t = 0 CP: critical section p4: x = 0 Q loop forever q1: y = 1 q2: turn = 0 q3: wait for x = 0 or t = 1 CQ: critical section q4: y = 0

slide-59
SLIDE 59

LTL: Applications

Safety properties

◮ “nothing bad ever happens”

G ¬(reactor temperature > 1000)

◮ invariant: “a is always false”

Liveness properties

◮ “something good will eventually happen”

G (ordered → F delivered)

◮ termination: “the system will eventually terminate” ◮ response: “if action a occurs then b eventually will occur”

Deadlock freeness

◮ deadlock state: “a state where no actions are possible” ◮ no deadlocks: there is always some next state

G (¬terminated → X ⊤)

slide-60
SLIDE 60

Industrial Case Studies I

Figure: After Flood Disaster (1953), Maeslant Barrier (Maeslantkering)

slide-61
SLIDE 61

Industrial Case Studies: Flood Control

Verification of the interface between BOS and BESW:

◮ Beslis- en Ondersteunend Systeem (BOS) ◮ BEsturingsSysteem Waterweg (BESW) ◮ BOS takes the decision to move the barrier ◮ BESW performs this task

Even deadlocks were found in BESW!

slide-62
SLIDE 62

Industrial Case Studies II

Figure: NASA Mission Critical Software: Cassini, Mars Rovers, Deep Impact

slide-63
SLIDE 63

Industrial Case Studies III

slide-64
SLIDE 64

State Space Explosion

slide-65
SLIDE 65

State Space Explosion

◮ Assume A1, A2, . . . are a processes each having 10 states

slide-66
SLIDE 66

State Space Explosion

◮ Assume A1, A2, . . . are a processes each having 10 states ◮ Then A1 and A2 together have 100 states.

slide-67
SLIDE 67

State Space Explosion

◮ Assume A1, A2, . . . are a processes each having 10 states ◮ Then A1 and A2 together have 100 states. ◮ Then A1, . . . , An together have 10n states.

slide-68
SLIDE 68

State Space Explosion

◮ Assume A1, A2, . . . are a processes each having 10 states ◮ Then A1 and A2 together have 100 states. ◮ Then A1, . . . , An together have 10n states.

This is the state space explosion problem.

slide-69
SLIDE 69

State Space Explosion

◮ Assume A1, A2, . . . are a processes each having 10 states ◮ Then A1 and A2 together have 100 states. ◮ Then A1, . . . , An together have 10n states.

This is the state space explosion problem.

slide-70
SLIDE 70

Computation Tree Logic (CTL)

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ where p ∈ Ω The formula φ holds model M at state s, M, s | = φ, is defined by:

1

as usual: M, s | = ⊤, M, s | = p, M, s | = ¬φ, M, s | = φ1 ∧ φ2

slide-71
SLIDE 71

Computation Tree Logic (CTL)

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ exists until | EG φ | EX φ where p ∈ Ω The formula φ holds model M at state s, M, s | = φ, is defined by:

1

as usual: M, s | = ⊤, M, s | = p, M, s | = ¬φ, M, s | = φ1 ∧ φ2

slide-72
SLIDE 72

Computation Tree Logic (CTL)

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ exists until | EG φ exists globally | EX φ where p ∈ Ω The formula φ holds model M at state s, M, s | = φ, is defined by:

1

as usual: M, s | = ⊤, M, s | = p, M, s | = ¬φ, M, s | = φ1 ∧ φ2

slide-73
SLIDE 73

Computation Tree Logic (CTL)

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ exists until | EG φ exists globally | EX φ exists next where p ∈ Ω The formula φ holds model M at state s, M, s | = φ, is defined by:

1

as usual: M, s | = ⊤, M, s | = p, M, s | = ¬φ, M, s | = φ1 ∧ φ2

slide-74
SLIDE 74

Computation Tree Logic (CTL)

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ exists until | EG φ exists globally | EX φ exists next where p ∈ Ω The formula φ holds model M at state s, M, s | = φ, is defined by:

1

as usual: M, s | = ⊤, M, s | = p, M, s | = ¬φ, M, s | = φ1 ∧ φ2

2

M, s | = φ EU ψ (φ until ψ holds on some path starting from s)

slide-75
SLIDE 75

Computation Tree Logic (CTL)

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ exists until | EG φ exists globally | EX φ exists next where p ∈ Ω The formula φ holds model M at state s, M, s | = φ, is defined by:

1

as usual: M, s | = ⊤, M, s | = p, M, s | = ¬φ, M, s | = φ1 ∧ φ2

2

M, s | = φ EU ψ (φ until ψ holds on some path starting from s) iff there is a path s = s1 → s2 → . . ., such that for some i ≥ 1, M, si | = ψ and for all j < i, M, sj | = φ

slide-76
SLIDE 76

Computation Tree Logic (CTL)

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ exists until | EG φ exists globally | EX φ exists next where p ∈ Ω The formula φ holds model M at state s, M, s | = φ, is defined by:

1

as usual: M, s | = ⊤, M, s | = p, M, s | = ¬φ, M, s | = φ1 ∧ φ2

2

M, s | = φ EU ψ (φ until ψ holds on some path starting from s) iff there is a path s = s1 → s2 → . . ., such that for some i ≥ 1, M, si | = ψ and for all j < i, M, sj | = φ

3

M, s | = EG φ (φ holds globally on some path starting from s)

slide-77
SLIDE 77

Computation Tree Logic (CTL)

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ exists until | EG φ exists globally | EX φ exists next where p ∈ Ω The formula φ holds model M at state s, M, s | = φ, is defined by:

1

as usual: M, s | = ⊤, M, s | = p, M, s | = ¬φ, M, s | = φ1 ∧ φ2

2

M, s | = φ EU ψ (φ until ψ holds on some path starting from s) iff there is a path s = s1 → s2 → . . ., such that for some i ≥ 1, M, si | = ψ and for all j < i, M, sj | = φ

3

M, s | = EG φ (φ holds globally on some path starting from s) iff there is a path s = s1 → s2 → . . . such that for all i ≥ 1, M, si | = φ

slide-78
SLIDE 78

Computation Tree Logic (CTL)

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ exists until | EG φ exists globally | EX φ exists next where p ∈ Ω The formula φ holds model M at state s, M, s | = φ, is defined by:

1

as usual: M, s | = ⊤, M, s | = p, M, s | = ¬φ, M, s | = φ1 ∧ φ2

2

M, s | = φ EU ψ (φ until ψ holds on some path starting from s) iff there is a path s = s1 → s2 → . . ., such that for some i ≥ 1, M, si | = ψ and for all j < i, M, sj | = φ

3

M, s | = EG φ (φ holds globally on some path starting from s) iff there is a path s = s1 → s2 → . . . such that for all i ≥ 1, M, si | = φ

4

M, s | = EX φ (φ holds in some next state)

slide-79
SLIDE 79

Computation Tree Logic (CTL)

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ exists until | EG φ exists globally | EX φ exists next where p ∈ Ω The formula φ holds model M at state s, M, s | = φ, is defined by:

1

as usual: M, s | = ⊤, M, s | = p, M, s | = ¬φ, M, s | = φ1 ∧ φ2

2

M, s | = φ EU ψ (φ until ψ holds on some path starting from s) iff there is a path s = s1 → s2 → . . ., such that for some i ≥ 1, M, si | = ψ and for all j < i, M, sj | = φ

3

M, s | = EG φ (φ holds globally on some path starting from s) iff there is a path s = s1 → s2 → . . . such that for all i ≥ 1, M, si | = φ

4

M, s | = EX φ (φ holds in some next state) iff (M, s2) | = φ for some s2 such that s → s2

slide-80
SLIDE 80

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ | AG φ | AX φ where p ∈ Ω

slide-81
SLIDE 81

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ | AX φ where p ∈ Ω

slide-82
SLIDE 82

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ where p ∈ Ω

slide-83
SLIDE 83

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ always next where p ∈ Ω

slide-84
SLIDE 84

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ always next where p ∈ Ω

1

M, s | = AG φ (φ holds globally on all paths starting from s)

slide-85
SLIDE 85

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ always next where p ∈ Ω

1

M, s | = AG φ (φ holds globally on all paths starting from s) iff for all paths s = s1 → s2 → . . . we have: for all i ≥ 1, M, si | = φ

slide-86
SLIDE 86

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ always next where p ∈ Ω

1

M, s | = AG φ (φ holds globally on all paths starting from s) iff for all paths s = s1 → s2 → . . . we have: for all i ≥ 1, M, si | = φ AG φ = ¬EF ¬φ

slide-87
SLIDE 87

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ always next where p ∈ Ω

1

M, s | = AG φ (φ holds globally on all paths starting from s) iff for all paths s = s1 → s2 → . . . we have: for all i ≥ 1, M, si | = φ AG φ = ¬EF ¬φ

2

M, s | = AX φ (φ holds in all next states)

slide-88
SLIDE 88

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ always next where p ∈ Ω

1

M, s | = AG φ (φ holds globally on all paths starting from s) iff for all paths s = s1 → s2 → . . . we have: for all i ≥ 1, M, si | = φ AG φ = ¬EF ¬φ

2

M, s | = AX φ (φ holds in all next states) iff (M, s2) | = φ for all s2 such that s → s2

slide-89
SLIDE 89

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ always next where p ∈ Ω

1

M, s | = AG φ (φ holds globally on all paths starting from s) iff for all paths s = s1 → s2 → . . . we have: for all i ≥ 1, M, si | = φ AG φ = ¬EF ¬φ

2

M, s | = AX φ (φ holds in all next states) iff (M, s2) | = φ for all s2 such that s → s2 AX φ = ¬EX ¬φ

slide-90
SLIDE 90

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ always next where p ∈ Ω

1

M, s | = AG φ (φ holds globally on all paths starting from s) iff for all paths s = s1 → s2 → . . . we have: for all i ≥ 1, M, si | = φ AG φ = ¬EF ¬φ

2

M, s | = AX φ (φ holds in all next states) iff (M, s2) | = φ for all s2 such that s → s2 AX φ = ¬EX ¬φ

3

M, s | = φ AU ψ (φ until ψ holds on all paths starting from s)

slide-91
SLIDE 91

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ always next where p ∈ Ω

1

M, s | = AG φ (φ holds globally on all paths starting from s) iff for all paths s = s1 → s2 → . . . we have: for all i ≥ 1, M, si | = φ AG φ = ¬EF ¬φ

2

M, s | = AX φ (φ holds in all next states) iff (M, s2) | = φ for all s2 such that s → s2 AX φ = ¬EX ¬φ

3

M, s | = φ AU ψ (φ until ψ holds on all paths starting from s) iff for all paths s = s1 → s2 → . . . we have: for some i ≥ 1, M, si | = ψ and for all j < i, M, sj | = φ

slide-92
SLIDE 92

CTL: Extensions

Computation Tree Logic (CTL) is defined by: φ ::= p | ⊤ | ¬φ | φ ∧ φ | φ EU φ | EG φ | EX φ | φ AU φ always until | AG φ always globally | AX φ always next where p ∈ Ω

1

M, s | = AG φ (φ holds globally on all paths starting from s) iff for all paths s = s1 → s2 → . . . we have: for all i ≥ 1, M, si | = φ AG φ = ¬EF ¬φ

2

M, s | = AX φ (φ holds in all next states) iff (M, s2) | = φ for all s2 such that s → s2 AX φ = ¬EX ¬φ

3

M, s | = φ AU ψ (φ until ψ holds on all paths starting from s) iff for all paths s = s1 → s2 → . . . we have: for some i ≥ 1, M, si | = ψ and for all j < i, M, sj | = φ φ AU ψ = ¬(¬ψ EU (¬φ ∧ ¬ψ)) ∧ ¬EG ¬ψ

slide-93
SLIDE 93

CTL: Examples

s1 r s2 p, t, r s3 p, q s4 q, r Which of the states satisfies the following? ? | = AF t ? | = ¬EG r ? | = t EU q ? | = EX q ? | = AX q ? | = EF q

slide-94
SLIDE 94

CTL: Examples

s1 r s2 p, t, r s3 p, q s4 q, r Which of the states satisfies the following? M, s2, s3, s4 | = AF t ? | = ¬EG r ? | = t EU q ? | = EX q ? | = AX q ? | = EF q

slide-95
SLIDE 95

CTL: Examples

s1 r s2 p, t, r s3 p, q s4 q, r Which of the states satisfies the following? M, s2, s3, s4 | = AF t M, s3 | = ¬EG r ? | = t EU q ? | = EX q ? | = AX q ? | = EF q

slide-96
SLIDE 96

CTL: Examples

s1 r s2 p, t, r s3 p, q s4 q, r Which of the states satisfies the following? M, s2, s3, s4 | = AF t M, s3 | = ¬EG r M, s2, s3, s4 | = t EU q ? | = EX q ? | = AX q ? | = EF q

slide-97
SLIDE 97

CTL: Examples

s1 r s2 p, t, r s3 p, q s4 q, r Which of the states satisfies the following? M, s2, s3, s4 | = AF t M, s3 | = ¬EG r M, s2, s3, s4 | = t EU q M, s1, s2, s3 | = EX q ? | = AX q ? | = EF q

slide-98
SLIDE 98

CTL: Examples

s1 r s2 p, t, r s3 p, q s4 q, r Which of the states satisfies the following? M, s2, s3, s4 | = AF t M, s3 | = ¬EG r M, s2, s3, s4 | = t EU q M, s1, s2, s3 | = EX q M, s2, s3 | = AX q ? | = EF q

slide-99
SLIDE 99

CTL: Examples

s1 r s2 p, t, r s3 p, q s4 q, r Which of the states satisfies the following? M, s2, s3, s4 | = AF t M, s3 | = ¬EG r M, s2, s3, s4 | = t EU q M, s1, s2, s3 | = EX q M, s2, s3 | = AX q M, s1, s2, s3, s4 | = EF q

slide-100
SLIDE 100

CTL: Examples

s1 r s2 q s3 p s4 q, r s5 p Which of the states satisfies the following? ? | = AG (EF p) ? | = AG ((q ∨ r) AU p) ? | = AG (EF (q ∧ r))

slide-101
SLIDE 101

CTL: Examples

s1 r s2 q s3 p s4 q, r s5 p Which of the states satisfies the following? M, s1, s2, s3, s4, s5 | = AG (EF p) ? | = AG ((q ∨ r) AU p) ? | = AG (EF (q ∧ r))

slide-102
SLIDE 102

CTL: Examples

s1 r s2 q s3 p s4 q, r s5 p Which of the states satisfies the following? M, s1, s2, s3, s4, s5 | = AG (EF p) M, s3 | = AG ((q ∨ r) AU p) ? | = AG (EF (q ∧ r))

slide-103
SLIDE 103

CTL: Examples

s1 r s2 q s3 p s4 q, r s5 p Which of the states satisfies the following? M, s1, s2, s3, s4, s5 | = AG (EF p) M, s3 | = AG ((q ∨ r) AU p) M, s2, s4, s5 | = AG (EF (q ∧ r))

slide-104
SLIDE 104

CTL vs LTL

slide-105
SLIDE 105

CTL vs LTL

◮ a CTL formula necessitating E cannot be expressed in LTL

EX p s1 s2 s3 p

slide-106
SLIDE 106

CTL vs LTL

◮ a CTL formula necessitating E cannot be expressed in LTL

EX p s1 s2 s3 p

◮ the CTL formula AF AG p cannot be expressed in LTL

s1 p s2 s3 p

slide-107
SLIDE 107

CTL vs LTL

◮ a CTL formula necessitating E cannot be expressed in LTL

EX p s1 s2 s3 p

◮ the CTL formula AF AG p cannot be expressed in LTL

s1 p s2 s3 p

◮ the LTL formula G F p → F q cannot be expressed in CTL