Algorithms for CTL B. Srivathsan Chennai Mathematical Institute - - PowerPoint PPT Presentation

algorithms for ctl
SMART_READER_LITE
LIVE PREVIEW

Algorithms for CTL B. Srivathsan Chennai Mathematical Institute - - PowerPoint PPT Presentation

Algorithms for CTL B. Srivathsan Chennai Mathematical Institute Model Checking and Systems Verification January - April 2016 1 / 22 Module 1: Adequate CTL formulae 2 / 22 Recap of CTL State formulae := true | p i | 1 2 | 1


slide-1
SLIDE 1

Algorithms for CTL

  • B. Srivathsan

Chennai Mathematical Institute

Model Checking and Systems Verification January - April 2016

1/22

slide-2
SLIDE 2

Module 1: Adequate CTL formulae

2/22

slide-3
SLIDE 3

Recap of CTL

State formulae

φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula

Path formulae

α := X φ1 | φ1 U φ2 | F φ1 | G φ1

3/22

slide-4
SLIDE 4

Transition system satisfies CTL state formula φ if its computation tree satisfies φ

s0 s1 s3 s2 s3 s2 s3 s3 s2 s3 s2 s3

. . . . . . . . . . . . . . .

s0 s1 s2 s3 {p1} {p2} {p2} {p1,p3} 4/22

slide-5
SLIDE 5

A tree satisfies CTL state formula φ if its root satisfies φ

. . . . . . . . . . . . . . .

5/22

slide-6
SLIDE 6

A state s in a transition system satisfies a CTL formula φ if the computation tree starting at s satisfies φ

s0 s1 s2 s3 {p1} {p2} {p2} {p1,p3}

6/22

slide-7
SLIDE 7

Above transition system satisfies E X red

7/22

slide-8
SLIDE 8

Above transition system satisfies E blue U red

8/22

slide-9
SLIDE 9

Above transition system satisfies E G red

9/22

slide-10
SLIDE 10

Above transition system satisfies E G red It does not satisfy A F blue

9/22

slide-11
SLIDE 11

Mutual exclusion

non-crit wait crit exiting y>0:y:=y-1 y:=y+1 non-crit wait crit exiting y>0:y:=y-1 y:=y+1

|||

Atomic propositions AP = { p1,p2,p3,p4 } p1: pr1.location=crit p2: pr1.location=wait p3: pr2.location=crit p4: pr2.location=wait Above system satisfies A G ¬ (p1 ∧ p3)

10/22

slide-12
SLIDE 12

Goal of this unit

Design an algorithm: INPUT: A transition system M and a CTL formula φ OUTPUT: Does M satisfy φ?

11/22

slide-13
SLIDE 13

Goal of this unit

Design an algorithm: INPUT: A transition system M and a CTL formula φ OUTPUT: Does M satisfy φ? We will answer a more general question: Given M and φ, find all the states of M that satisfy φ

11/22

slide-14
SLIDE 14

First step

State formulae

φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula

Path formulae

α := X φ1 | φ1 U φ2 | F φ1 | G φ1

Rewrite A in terms of E

12/22

slide-15
SLIDE 15

A X ( red ) equivalent to ¬ E X ( ¬ red ) . . . . . . . . . . . . . . .

13/22

slide-16
SLIDE 16

A X ( red ) equivalent to ¬ E X ( ¬ red ) . . . . . . . . . . . . . . . A X φ ≡ ¬ E X ¬ φ

13/22

slide-17
SLIDE 17

Can we rewrite A (φ U ψ) as ¬ E ¬ (φ U ψ) ?

14/22

slide-18
SLIDE 18

Can we rewrite A (φ U ψ) as ¬ E ¬ (φ U ψ) ? No: ¬ E ¬ (φ U ψ) is not a CTL formula

State formulae

φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula

Path formulae

α := X φ1 | φ1 U φ2 | F φ1 | G φ1

14/22

slide-19
SLIDE 19

Can we rewrite A (φ U ψ) as ¬ E ¬ (φ U ψ) ? No: ¬ E ¬ (φ U ψ) is not a CTL formula

State formulae

φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula

Path formulae

α := X φ1 | φ1 U φ2 | F φ1 | G φ1

CTL does not allow negation of path formula!

14/22

slide-20
SLIDE 20

Coming next: Rewrite A U in terms of E U and E G

15/22

slide-21
SLIDE 21

¬ (blue U red)

16/22

slide-22
SLIDE 22

¬ (blue U red) ...

16/22

slide-23
SLIDE 23

¬ (blue U red) ... G ¬ red

16/22

slide-24
SLIDE 24

¬ (blue U red) ... G ¬ red

  • r

16/22

slide-25
SLIDE 25

¬ (blue U red) ... G ¬ red

  • r

...

16/22

slide-26
SLIDE 26

¬ (blue U red) ... G ¬ red

  • r

... (¬ red) U (¬ blue ∧ ¬ red )

16/22

slide-27
SLIDE 27

¬ (blue U red) ... G ¬ red

  • r

... (¬ red) U (¬ blue ∧ ¬ red ) ¬ (φ U ψ) ≡ G ¬ ψ ∨ ( ¬ψ U (¬φ ∧ ¬ψ ) )

16/22

slide-28
SLIDE 28

A (φ U ψ)

17/22

slide-29
SLIDE 29

A (φ U ψ) ≡ ¬ E ¬ (φ U ψ)

17/22

slide-30
SLIDE 30

A (φ U ψ) ≡ ¬ E ¬ (φ U ψ)

(Not a CTL formula)

17/22

slide-31
SLIDE 31

A (φ U ψ) ≡ ¬ E ¬ (φ U ψ)

(Not a CTL formula)

≡ ¬ ( E G ¬ ψ ∨ E (¬ψ U (¬ψ ∧ ¬ φ)) )

17/22

slide-32
SLIDE 32

A (φ U ψ) ≡ ¬ E ¬ (φ U ψ)

(Not a CTL formula)

≡ ¬ ( E G ¬ ψ ∨ E (¬ψ U (¬ψ ∧ ¬ φ)) )

(A CTL formula!)

17/22

slide-33
SLIDE 33

A G ( red ) equivalent to ¬ E F ( ¬ red ) . . . . . . . . . . . . . . .

18/22

slide-34
SLIDE 34

A F ( red ) equivalent to ¬ E G ( ¬ red ) . . . . . . . . . . . . . . .

19/22

slide-35
SLIDE 35

First step

State formulae

φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula

Path formulae

α := X φ1 | φ1 U φ2 | F φ1 | G φ1

Rewrite A in terms of E

20/22

slide-36
SLIDE 36

First step

State formulae

φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula

Path formulae

α := X φ1 | φ1 U φ2 | F φ1 | G φ1

Rewrite A in terms of E Done!

20/22

slide-37
SLIDE 37

All CTL formulas can be written in terms of E X , E U , E G and E F

21/22

slide-38
SLIDE 38

All CTL formulas can be written in terms of E X , E U , E G and E F Moreover E F φ ≡ E ( true U φ )

21/22

slide-39
SLIDE 39

All CTL formulas can be written in terms of E X , E U , E G and E F Moreover E F φ ≡ E ( true U φ ) E X, E U and E G are adequate to describe all CTL formulas

21/22

slide-40
SLIDE 40

Existential Normal Form (ENF) for CTL

State formulae

φ := true | pi | φ1 ∧ φ2 | ¬φ | E X φ | E (φ1 U φ2) | E G φ pi ∈ AP φ,φ1,φ2 : State formulae

22/22

slide-41
SLIDE 41

Existential Normal Form (ENF) for CTL

State formulae

φ := true | pi | φ1 ∧ φ2 | ¬φ | E X φ | E (φ1 U φ2) | E G φ pi ∈ AP φ,φ1,φ2 : State formulae

Theorem For every CTL formula there exists an equivalent CTL formula in ENF

22/22

slide-42
SLIDE 42

Module 2: EX, EU and EG

2/16

slide-43
SLIDE 43

CTL model-checking problem

Given transition system M and a CTL formula φ, find all states of M that satisfy φ

3/16

slide-44
SLIDE 44

CTL model-checking problem

Given transition system M and a CTL formula φ, find all states of M that satisfy φ In this unit: Special case when φ is either E X, E U or E G

3/16

slide-45
SLIDE 45

Part 1:

Algorithm for E X

4/16

slide-46
SLIDE 46

E X (p1 ∧ p2)

s1 s2 s3 s4 s5 { } {p1,p2} {p2} {p1,p2} {p1}

5/16

slide-47
SLIDE 47

E X (p1 ∧ p2)

s1 s2 s3 s4 s5 { } {p1,p2} {p2} {p1,p2} {p1} p1 ∧ p2 p1 ∧ p2

5/16

slide-48
SLIDE 48

E X (p1 ∧ p2)

s1 s2 s3 s4 s5 { } {p1,p2} {p2} {p1,p2} {p1} p1 ∧ p2 p1 ∧ p2 E X (p1 ∧ p2)

5/16

slide-49
SLIDE 49

E X (p1 ∧ p2)

s1 s2 s3 s4 s5 { } {p1,p2} {p2} {p1,p2} {p1} p1 ∧ p2 p1 ∧ p2 E X (p1 ∧ p2) E X (p1 ∧ p2)

5/16

slide-50
SLIDE 50

E X (p1 ∧ p2)

s1 s2 s3 s4 s5 { } {p1,p2} {p2} {p1,p2} {p1} p1 ∧ p2 p1 ∧ p2 E X (p1 ∧ p2) E X (p1 ∧ p2) E X (p1 ∧ p2)

5/16

slide-51
SLIDE 51

E X (p1 ∧ ¬p2)

s1 s2 s3 s4 {} {p2} {p1,p2} {p1}

6/16

slide-52
SLIDE 52

E X (p1 ∧ ¬p2)

s1 s2 s3 s4 {} {p2} {p1,p2} {p1} p1 ∧ ¬p2

6/16

slide-53
SLIDE 53

E X (p1 ∧ ¬p2)

s1 s2 s3 s4 {} {p2} {p1,p2} {p1} p1 ∧ ¬p2 E X (p1 ∧ ¬p2)

6/16

slide-54
SLIDE 54

E X (p1 ∧ ¬p2)

s1 s2 s3 s4 {} {p2} {p1,p2} {p1} p1 ∧ ¬p2 E X (p1 ∧ ¬p2) E X (p1 ∧ ¬p2)

6/16

slide-55
SLIDE 55

E X (p1 ∧ ¬p2)

s1 s2 s3 s4 {} {p2} {p1,p2} {p1} p1 ∧ ¬p2 E X (p1 ∧ ¬p2) E X (p1 ∧ ¬p2) E X (p1 ∧ ¬p2)

6/16

slide-56
SLIDE 56

Algorithm for E X φ

s

7/16

slide-57
SLIDE 57

Algorithm for E X φ

s φ Suppose states satisfying φ have been labelled

7/16

slide-58
SLIDE 58

Algorithm for E X φ

s φ E X φ Suppose states satisfying φ have been labelled State s is labelled with E X φ if there exists a successor which is labelled φ

7/16

slide-59
SLIDE 59

Part 2:

Algorithm for E U

8/16

slide-60
SLIDE 60

E (p1 U p2)

s1 s2 s3 s4 s5 s6 {p1} { } {p1} {p1} {p2} {p1}

9/16

slide-61
SLIDE 61

E (p1 U p2)

s1 s2 s3 s4 s5 s6 {p1} { } {p1} {p1} {p2} {p1} E p1 U p2

9/16

slide-62
SLIDE 62

E (p1 U p2)

s1 s2 s3 s4 s5 s6 {p1} { } {p1} {p1} {p2} {p1} E p1 U p2 E p1 U p2 E p1 U p2

9/16

slide-63
SLIDE 63

E (p1 U p2)

s1 s2 s3 s4 s5 s6 {p1} { } {p1} {p1} {p2} {p1} E p1 U p2 E p1 U p2 E p1 U p2 E p1 U p2

9/16

slide-64
SLIDE 64

E (p1 U p2)

s1 s2 s3 s4 s5 s6 {p1} { } {p1} {p1} {p2} {p1} E p1 U p2 E p1 U p2 E p1 U p2 E p1 U p2 E p1 U p2

9/16

slide-65
SLIDE 65

E (¬ p1 U ¬ p2)

s1 s2 s3 s4 s5 s6 {p2} {p2} { } {p2} {p1} {p1}

10/16

slide-66
SLIDE 66

E (¬ p1 U ¬ p2)

s1 s2 s3 s4 s5 s6 {p2} {p2} { } {p2} {p1} {p1} ¬p1 ¬p1 ¬p2 ¬p1,¬p2 ¬p2 ¬p1

10/16

slide-67
SLIDE 67

E (¬ p1 U ¬ p2)

s1 s2 s3 s4 s5 s6 {p2} {p2} { } {p2} {p1} {p1} ¬p1 ¬p1 ¬p2 ¬p1,¬p2 ¬p2 ¬p1 E (¬p1 U ¬p2) E (¬p1 U ¬p2) E (¬p1 U ¬p2)

10/16

slide-68
SLIDE 68

E (¬ p1 U ¬ p2)

s1 s2 s3 s4 s5 s6 {p2} {p2} { } {p2} {p1} {p1} ¬p1 ¬p1 ¬p2 ¬p1,¬p2 ¬p2 ¬p1 E (¬p1 U ¬p2) E (¬p1 U ¬p2) E (¬p1 U ¬p2) E (¬p1 U ¬p2) E (¬p1 U ¬p2)

10/16

slide-69
SLIDE 69

E (¬ p1 U ¬ p2)

s1 s2 s3 s4 s5 s6 {p2} {p2} { } {p2} {p1} {p1} ¬p1 ¬p1 ¬p2 ¬p1,¬p2 ¬p2 ¬p1 E (¬p1 U ¬p2) E (¬p1 U ¬p2) E (¬p1 U ¬p2) E (¬p1 U ¬p2) E (¬p1 U ¬p2) E (¬p1 U ¬p2)

10/16

slide-70
SLIDE 70

Algorithm for E (φ1 U φ2)

s

… If any state is labelled with φ2, label it with E (φ1 U φ2) … Repeat:

Label any state with E (φ1 U φ2) if it is labelled with φ1 and at least

  • ne successor is labelled with E (φ1 U φ2)

until no change

11/16

slide-71
SLIDE 71

Algorithm for E (φ1 U φ2)

s

E (φ1 U φ2) φ1 … If any state is labelled with φ2, label it with E (φ1 U φ2) … Repeat:

Label any state with E (φ1 U φ2) if it is labelled with φ1 and at least

  • ne successor is labelled with E (φ1 U φ2)

until no change

11/16

slide-72
SLIDE 72

Algorithm for E (φ1 U φ2)

s

E (φ1 U φ2) φ1 E (φ1 U φ2) … If any state is labelled with φ2, label it with E (φ1 U φ2) … Repeat:

Label any state with E (φ1 U φ2) if it is labelled with φ1 and at least

  • ne successor is labelled with E (φ1 U φ2)

until no change

11/16

slide-73
SLIDE 73

Part 3:

Algorithm for E G

12/16

slide-74
SLIDE 74

E G p1

s1 s2 s3 s4 s5 s6 s7 s8 {p1} {p1} {p1} { } {p1} {p1} {p1} { }

13/16

slide-75
SLIDE 75

E G p1

s1 s2 s3 s4 s5 s6 s7 s8 {p1} {p1} {p1} { } {p1} {p1} {p1} { } E G p1 E G p1 E G p1 E G p1 E G p1 E G p1 E G p1 E G p1

13/16

slide-76
SLIDE 76

E G p1

s1 s2 s3 s4 s5 s6 s7 s8 {p1} {p1} {p1} { } {p1} {p1} {p1} { } E G p1 E G p1 E G p1 E G p1 E G p1 E G p1

13/16

slide-77
SLIDE 77

E G p1

s1 s2 s3 s4 s5 s6 s7 s8 {p1} {p1} {p1} { } {p1} {p1} {p1} { } E G p1 E G p1 E G p1 E G p1 E G p1

13/16

slide-78
SLIDE 78

E G p1

s1 s2 s3 s4 s5 s6 s7 s8 {p1} {p1} {p1} { } {p1} {p1} {p1} { } E G p1 E G p1 E G p1

13/16

slide-79
SLIDE 79

E G p1

s1 s2 s3 s4 s5 s6 s7 s8 {p1} {p1} {p1} { } {p1} {p1} {p1} { } E G p1

13/16

slide-80
SLIDE 80

E G p1

s1 s2 s3 s4 s5 s6 s7 s8 {p1} {p1} {p1} { } {p1} {p1} {p1} { }

13/16

slide-81
SLIDE 81

E G p1

s1 s2 s3 s4 s5 s6 s7 s8 {p1} {p1} {p1} { } {p1} {p1} {p1} { } No state of the above transition system satisfies E G p1

13/16

slide-82
SLIDE 82

E G p1

s1 s2 s3 s4 s5 s6 {p1} {p2} {p1} {p1} { } {p1}

14/16

slide-83
SLIDE 83

E G p1

s1 s2 s3 s4 s5 s6 {p1} {p2} {p1} {p1} { } {p1} E G p1 E G p1 E G p1 E G p1 E G p1 E G p1

14/16

slide-84
SLIDE 84

E G p1

s1 s2 s3 s4 s5 s6 {p1} {p2} {p1} {p1} { } {p1} E G p1 E G p1 E G p1 E G p1

14/16

slide-85
SLIDE 85

E G p1

s1 s2 s3 s4 s5 s6 {p1} {p2} {p1} {p1} { } {p1} E G p1 E G p1 E G p1

14/16

slide-86
SLIDE 86

Algorithm for E G φ

15/16

slide-87
SLIDE 87

Algorithm for E G φ

… Label all states with E G φ

15/16

slide-88
SLIDE 88

Algorithm for E G φ

… Label all states with E G φ … If any state is not labelled with φ, delete the label E G φ

15/16

slide-89
SLIDE 89

Algorithm for E G φ

… Label all states with E G φ … If any state is not labelled with φ, delete the label E G φ … Repeat:

Delete the label E G φ from a state if none of its successors is labelled with E G φ until no change

15/16

slide-90
SLIDE 90

Algorithm for E G φ

… Label all states with E G φ … If any state is not labelled with φ, delete the label E G φ

s

E G φ E G φ E G φ E G φ … Repeat:

Delete the label E G φ from a state if none of its successors is labelled with E G φ until no change

15/16

slide-91
SLIDE 91

Algorithm for E G φ

… Label all states with E G φ … If any state is not labelled with φ, delete the label E G φ

s

E G φ … Repeat:

Delete the label E G φ from a state if none of its successors is labelled with E G φ until no change

15/16

slide-92
SLIDE 92

Algorithm for E G φ

… Label all states with E G φ … If any state is not labelled with φ, delete the label E G φ

s

… Repeat:

Delete the label E G φ from a state if none of its successors is labelled with E G φ until no change

15/16

slide-93
SLIDE 93

Summary

Algorithms

EX, EU, EG

16/16

slide-94
SLIDE 94

Module 3: Final algorithm

2/8

slide-95
SLIDE 95

CTL model-checking problem

Given transition system M and a CTL formula φ, find all states of M that satisfy φ

3/8

slide-96
SLIDE 96

CTL model-checking problem

Given transition system M and a CTL formula φ, find all states of M that satisfy φ

… Module 1: Every CTL formula can be written using EX, EU, EG … Module 2: Labelling algorithms for EX, EU, EG

3/8

slide-97
SLIDE 97

Coming next: Generic algorithm for a CTL formula

State formulae

φ := true | pi | φ1 ∧ φ2 | ¬φ | E X φ | E (φ1 U φ2) | E G φ pi ∈ AP φ,φ1,φ2 : State formulae

4/8

slide-98
SLIDE 98

E X E G (p1 ∧ p2)

s0 s1 s2 s3 s4 s5 s6 s7 {p1} {p1,p2} {p1,p2} {p1,p2} {p1,p2} {p2} {p1,p2} {p1,p2}

5/8

slide-99
SLIDE 99

E X E G (p1 ∧ p2)

s0 s1 s2 s3 s4 s5 s6 s7 {p1} {p1,p2} {p1,p2} {p1,p2} {p1,p2} {p2} {p1,p2} {p1,p2}

p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2

5/8

slide-100
SLIDE 100

E X E G (p1 ∧ p2)

s0 s1 s2 s3 s4 s5 s6 s7 {p1} {p1,p2} {p1,p2} {p1,p2} {p1,p2} {p2} {p1,p2} {p1,p2}

p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2)

5/8

slide-101
SLIDE 101

E X E G (p1 ∧ p2)

s0 s1 s2 s3 s4 s5 s6 s7 {p1} {p1,p2} {p1,p2} {p1,p2} {p1,p2} {p2} {p1,p2} {p1,p2}

p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2)

5/8

slide-102
SLIDE 102

E X E G (p1 ∧ p2)

s0 s1 s2 s3 s4 s5 s6 s7 {p1} {p1,p2} {p1,p2} {p1,p2} {p1,p2} {p2} {p1,p2} {p1,p2}

p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2)

5/8

slide-103
SLIDE 103

E X E G (p1 ∧ p2)

s0 s1 s2 s3 s4 s5 s6 s7 {p1} {p1,p2} {p1,p2} {p1,p2} {p1,p2} {p2} {p1,p2} {p1,p2}

p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2)

5/8

slide-104
SLIDE 104

E X E G (p1 ∧ p2)

s0 s1 s2 s3 s4 s5 s6 s7 {p1} {p1,p2} {p1,p2} {p1,p2} {p1,p2} {p2} {p1,p2} {p1,p2}

p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 p1 ∧ p2 E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E G (p1 ∧ p2) E X E G (p1 ∧ p2) E X E G (p1 ∧ p2) E X E G (p1 ∧ p2) E X E G (p1 ∧ p2) E X E G (p1 ∧ p2)

5/8

slide-105
SLIDE 105

E p1 U (E G p2)

s1 s2 s3 s4 s5 s6 {p1} {p1} {p1} {p2} {p2} {p2}

6/8

slide-106
SLIDE 106

E p1 U (E G p2)

s1 s2 s3 s4 s5 s6 {p1} {p1} {p1} {p2} {p2} {p2}

E G p2 E G p2 E G p2 E G p2 E G p2 E G p2

6/8

slide-107
SLIDE 107

E p1 U (E G p2)

s1 s2 s3 s4 s5 s6 {p1} {p1} {p1} {p2} {p2} {p2}

E G p2 E G p2 E G p2

6/8

slide-108
SLIDE 108

E p1 U (E G p2)

s1 s2 s3 s4 s5 s6 {p1} {p1} {p1} {p2} {p2} {p2}

E G p2 E G p2

6/8

slide-109
SLIDE 109

E p1 U (E G p2)

s1 s2 s3 s4 s5 s6 {p1} {p1} {p1} {p2} {p2} {p2}

E G p2

6/8

slide-110
SLIDE 110

E p1 U (E G p2)

s1 s2 s3 s4 s5 s6 {p1} {p1} {p1} {p2} {p2} {p2}

E G p2

E p1 U (E G p2) 6/8

slide-111
SLIDE 111

E p1 U (E G p2)

s1 s2 s3 s4 s5 s6 {p1} {p1} {p1} {p2} {p2} {p2}

E G p2

E p1 U (E G p2) E p1 U (E G p2) 6/8

slide-112
SLIDE 112

E p1 U (E G p2)

s1 s2 s3 s4 s5 s6 {p1} {p1} {p1} {p2} {p2} {p2}

E G p2

E p1 U (E G p2) E p1 U (E G p2) E p1 U (E G p2) 6/8

slide-113
SLIDE 113

E p1 U (E G p2)

s1 s2 s3 s4 s5 s6 {p1} {p1} {p1} {p2} {p2} {p2}

E G p2

E p1 U (E G p2) E p1 U (E G p2) E p1 U (E G p2) E p1 U (E G p2) 6/8

slide-114
SLIDE 114

function SAT(φ)

/* Input: Transition system M with state set S, CTL formula φ in ENF */ /* Output: Set of states satisfying φ */

end function

7/8

slide-115
SLIDE 115

function SAT(φ)

/* Input: Transition system M with state set S, CTL formula φ in ENF */ /* Output: Set of states satisfying φ */

case end case end function

7/8

slide-116
SLIDE 116

function SAT(φ)

/* Input: Transition system M with state set S, CTL formula φ in ENF */ /* Output: Set of states satisfying φ */

case φ is true : return S end case end function

7/8

slide-117
SLIDE 117

function SAT(φ)

/* Input: Transition system M with state set S, CTL formula φ in ENF */ /* Output: Set of states satisfying φ */

case φ is true : return S φ is pi : return {states containing pi } end case end function

7/8

slide-118
SLIDE 118

function SAT(φ)

/* Input: Transition system M with state set S, CTL formula φ in ENF */ /* Output: Set of states satisfying φ */

case φ is true : return S φ is pi : return {states containing pi } φ is φ1 ∧ φ2 : return SAT(φ1) ∩ SAT(φ2) end case end function

7/8

slide-119
SLIDE 119

function SAT(φ)

/* Input: Transition system M with state set S, CTL formula φ in ENF */ /* Output: Set of states satisfying φ */

case φ is true : return S φ is pi : return {states containing pi } φ is ¬φ1 : return S − SAT(φ1) φ is φ1 ∧ φ2 : return SAT(φ1) ∩ SAT(φ2) end case end function

7/8

slide-120
SLIDE 120

function SAT(φ)

/* Input: Transition system M with state set S, CTL formula φ in ENF */ /* Output: Set of states satisfying φ */

case φ is true : return S φ is pi : return {states containing pi } φ is ¬φ1 : return S − SAT(φ1) φ is φ1 ∧ φ2 : return SAT(φ1) ∩ SAT(φ2) φ is E X φ1 : return SATEX(φ1) /* procedure seen in Module 2 */ end case end function

7/8

slide-121
SLIDE 121

function SAT(φ)

/* Input: Transition system M with state set S, CTL formula φ in ENF */ /* Output: Set of states satisfying φ */

case φ is true : return S φ is pi : return {states containing pi } φ is ¬φ1 : return S − SAT(φ1) φ is φ1 ∧ φ2 : return SAT(φ1) ∩ SAT(φ2) φ is E X φ1 : return SATEX(φ1) /* procedure seen in Module 2 */ φ is E (φ1 U φ2) : return SATEU(φ1,φ2) /* procedure seen in Module 2 */ end case end function

7/8

slide-122
SLIDE 122

function SAT(φ)

/* Input: Transition system M with state set S, CTL formula φ in ENF */ /* Output: Set of states satisfying φ */

case φ is true : return S φ is pi : return {states containing pi } φ is ¬φ1 : return S − SAT(φ1) φ is φ1 ∧ φ2 : return SAT(φ1) ∩ SAT(φ2) φ is E X φ1 : return SATEX(φ1) /* procedure seen in Module 2 */ φ is E (φ1 U φ2) : return SATEU(φ1,φ2) /* procedure seen in Module 2 */ φ is E G φ1 : return SATEG(φ1) /* procedure seen in Module 2 */ end case end function

7/8

slide-123
SLIDE 123

CTL model-checking algorithm

Reference: Logic in Computer Science, by Huth and Ryan - Section 3.6.1

8/8