Tecniche di Specifica e di Verifica Branching Time Temporal Logics - - PowerPoint PPT Presentation

tecniche di specifica e di verifica
SMART_READER_LITE
LIVE PREVIEW

Tecniche di Specifica e di Verifica Branching Time Temporal Logics - - PowerPoint PPT Presentation

Tecniche di Specifica e di Verifica Branching Time Temporal Logics I 1 Outline CTL ( C omputation T ree L ogic) Branching Time Unwindings --- computation trees Syntax and semantics of CTL. 2 Branching Time Structures


slide-1
SLIDE 1

1

Tecniche di Specifica e di Verifica

Branching Time Temporal Logics I

slide-2
SLIDE 2

2

Outline

  • CTL (Computation Tree Logic)

– Branching Time – Unwindings --- computation trees – Syntax and semantics of CTL.

slide-3
SLIDE 3

3

Branching Time Structures

  • Linear Time:

– A computation at its first state satisfies a property. – Property ---- LTL formula

  • Branching Time

– The computation tree at its root satisfies a property. – Property: CTL (CTL*, µ-calculus) formula. – Computation Tree All computations starting from a state glued together (to form a tree structure).

  • In branching time, the decisions taken during a

run are taken into account.

slide-4
SLIDE 4

4

  • n
  • n

?! Zap Zap

  • ff
  • ff

The TV Example

slide-5
SLIDE 5

5

  • n
  • n

?! Zap Zap

  • ff
  • ff
slide-6
SLIDE 6

6

  • n
  • n

?! Zap Zap

  • ff
  • ff
slide-7
SLIDE 7

7

  • n
  • n

?! Zap Zap

  • ff
  • ff
slide-8
SLIDE 8

8

  • n
  • n

?! Zap Zap

  • ff
  • ff
slide-9
SLIDE 9

9

  • n
  • n
  • ff
  • ff

A Modified Example

slide-10
SLIDE 10

10

For every path π and every state s on that path, there is a path π’ starting from s and a state s’

  • n π’ which is green.
slide-11
SLIDE 11

11

Branching Time Temporal Logic

  • K = (S, S0, R, AP, L)
  • K, s £ ψ -- the computation tree rooted at s

satisfies ψ.

  • K £ ψ iff K, s0 £ ψ for every s0 ∈ S0.
  • Branching Time Temporal Logics:

– CTL – CTL* – (The modal) µ-calculus

slide-12
SLIDE 12

12

Unwinding

  • K = (S, S0, R, AP, L) s ∈ S
  • TR(K, s) --- The computation tree rooted at s.
  • TR(K, s) = (Ss, (s,ε), Rs, AP, Ls).

– (s, ε) ∈ Ss ; – For any (s’, σ) ∈ Ss, s’ ∈ S and σ = s s1 … sn is a path in K leading from s to s’ (i.e. σ.s’ is a path from s to s’); – If (s1, σ) ∈ Ss and R(s1, s2) then (s2, σ.s1) ∈ Ss and Rs((s1, σ), (s2, σ.s1)) ; – L((s1, σ)) = L(s1).

slide-13
SLIDE 13

13

Unwinding

  • TR(K, s) is almost a Kripke structure.

– Ss may be infinite – But Rs is tree-like. – The “graph” of TR(K, s) is a tree rooted at (s, ε).

  • TR(K, s) is the computation tree rooted at s.
slide-14
SLIDE 14

14

  • n

A Modified Example

  • n
  • ff
  • ff

b g r (b, ε) (b, b) (g, b) (r, b) (r, bb) (b, bgg) (?, ?)

slide-15
SLIDE 15

15

Linear time Vs Branching time

  • There are properties that can be expressed in

LTL but which can not be expressed in

  • CTL. (sloppy statement!)
  • There are properties that can be expressed in

CTL but not in LTL.

  • The LTL model checking problem can be

converted into a restricted kind of a CTL* model checking problem.

slide-16
SLIDE 16

16

CTL

  • Syntax

– AP – a finite set of atomic propositions. – p ∈ AP is a formula. – If ψ and ψ’ are formulas then so are ¬ψ and ψ ∨ ψ’. – If ψ is a formula then so is EXψ – If ψ1 and ψ2 are formulas then so are EU(ψ1, ψ2) and AU(ψ1, ψ2).

slide-17
SLIDE 17

17

Formulas

  • EX(p ∨ EU(¬r, AU(p, r)))

EX

p EU ¬ r AU p r

slide-18
SLIDE 18

18

Semantics

  • K = (S, S0, R, AP, L)

– L : S ô 2AP

  • ψ a CTL formula and s ∈ S
  • K, s £ ψ
  • ψ (holds) is satisfied at s.
  • FACT:

K, s £ ψ iff TR(K, s), (s, ε) £ ψ.

slide-19
SLIDE 19

19

Semantics

  • CTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | AU(ψ1, ψ2)

  • K = (S, S0, R, AP, L) ; L: S ô 2AP ; s ∈ S
  • K, s £ p iff

p ∈ L(s).

  • K, s £ ¬ψ iff not K, s £ ψ
  • K, s £ ψ1 ∨ ψ2 iff

K, s £ ψ1 or K, s £ ψ2.

slide-20
SLIDE 20

20

Semantics

  • CTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | AU(ψ1, ψ2)

  • K = (S, S0, R, AP, L) ; L: S ô 2AP ; s ∈ S
  • K, s £ EX(ψ) iff there exists s’ such that:

– s ô s’ (i.e. R(s, s’)) and K, s’ £ ψ s has a successor state s’ at which ψ holds.

slide-21
SLIDE 21

21

  • n
  • ff
  • n
  • ff

AP = {n, h, uh}

b g r

K, b £ EX(uh) ? K, b £ EX(¬uh) ? K, g £ EX(uh) ? K, r £ EX(h) ?

slide-22
SLIDE 22

22

Semantics

  • K = (S, S0, R, AP, L) ; L: S ô 2AP ; s ∈ S
  • A path from s is a (infinite) sequence of states

π = s0, s1, s2, …,si, si+1, … s.t: – s = s0 – si ô si+1 (i.e. R(si, si+1)) for every i.

  • π(i) = si the i-th element of π.
slide-23
SLIDE 23

23

  • n
  • n
  • ff
  • ff

π = 0 1 2 3 4 5 π(2) π(3)

slide-24
SLIDE 24

24

Semantics

  • CTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | AU(ψ1, ψ2)

  • K = (S, S0, R, AP, L) ; L: S ô 2AP ; s ∈ S
  • K, s £ EU(ψ1, ψ2)

iff there exists a path π = s0, s1, … from s (i.e. s0=s) and k ≥ 0 such that: K, π(k) £ ψ2 K, π(j) £ ψ1 , for all 0 ≤ j < k.

slide-25
SLIDE 25

25

s s1 sj sk

£ ψ2 £ ψ1 £ ψ1 £ ψ1

slide-26
SLIDE 26

26

Semantics

  • CTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | AU(ψ1, ψ2)

  • K = (S, S0, R, AP, L) ; L: S ô 2AP ; s ∈ S
  • K, s £ AU(ψ1, ψ2)

iff for every path π = s0, s1, … from s there exists k ≥ 0 such that: K, π(k) £ ψ2 K, π(j) £ ψ1, for all 0 ≤ j < k.

slide-27
SLIDE 27

27

s s1 sj sk

£ ψ2 £ ψ1 £ ψ1 £ ψ1

s’1 s’h s’z

£ ψ1 £ ψ1 £ ψ2

slide-28
SLIDE 28

28

1 3 5 2 p1 4 7 p1 6 Req1 Req2 Grt1 Grt2 Grt1 Grt2 Req2 Req1 Req2 Req1 Ret1 Ret2 Ret2 Ret1

M, 0 £ EU(T, p1) ?

slide-29
SLIDE 29

29

1 3 5 2 p1 4 7 p1 6 Req1 Req2 Grt1 Grt2 Grt1 Grt2 Req2 Req1 Req2 Req1 Ret1 Ret2 Ret2 Ret1

M, 0 £ AU(T, p1) ?

slide-30
SLIDE 30

30

1 3 5 2 p1 4 p2 7 p1 6 p2 Req1 Req2 Grt1 Grt2 Grt1 Grt2 Req2 Req1 Req2 Req1 Ret1 Ret2 Ret2 Ret1

M, 0 £ AU(T, p1 ∨ p2) ?

slide-31
SLIDE 31

31

1 3 5 2 p1 4 p2 7 p1 6 p2 Req1 Req2 Grt1 Grt2 Grt1 Grt2 Req2 Req1 Req2 Req1 Ret1 Ret2 Ret2 Ret1

M, 0 £ AU(T, EU(T, p1)) ? From s0, all the computations willreach a point, where it is possible for 1 to print eventually.

slide-32
SLIDE 32

32

3 4 Req2 Grt2

M, 0 £ AU(T, EU(T, p1)) ?

Ret1 5 7 p1 Req1 Grt1

slide-33
SLIDE 33

33

Derived Operators

  • AX(ψ) = ¬EX(¬ψ)

– It is not the case there exists a next state at which ψ does not hold. – For every next state ψ holds.

AX(ψ) ψ ψ ψ

slide-34
SLIDE 34

34

Derived Operators

  • K, s £ EF(ψ)
  • EF(ψ) = EU(T, ψ)

– There exists a path π (from s) and k ≥ 0 such that: K, π(k) £ ψ.

slide-35
SLIDE 35

35

EF(ψ) ψ

slide-36
SLIDE 36

36

Derived Operators

  • K, s £ AG(ψ)
  • AG(ψ) = ¬EF(¬ψ)

– It is not the case there exists a path π (from s) and k ≥ 0 such that: K, π(k) £ ψ – For every path π (from s) and every k ≥ 0: K, π(k) £ ψ

slide-37
SLIDE 37

37

AGψ ψ ψ ψ ψ ψ ¬ψ ψ

slide-38
SLIDE 38

38

Derived Operators

  • K, s £ AF(ψ)
  • AF(ψ) = AU(T, ψ)

– For every path π from s, there exists k ≥ 0 such that: K, π(k) £ ψ.

slide-39
SLIDE 39

39

AFψ ψ ψ ψ ψ ¬ψ

slide-40
SLIDE 40

40

Derived Oparators

  • K, s £ EG(ψ)
  • EG(ψ) = ¬AF(¬ψ)

– It is not the case that for every path π from s there is a k ≥ 0 such that K, π(k) £ ψ. – There exists a path π from s such that, for every k ≥ 0: K, π(k) £ ψ.

slide-41
SLIDE 41

41

EGψ ψ ψ ψ ψ ψ

slide-42
SLIDE 42

42

A more convenient CTL

  • NCTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | EG(ψ)

  • CTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | AU(ψ1, ψ2)

  • NCTL is more convenient for model

checking!

  • Clearly NCTL can be defined in terms of

CTL.

slide-43
SLIDE 43

43

A more convenient CTL

  • NCTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | EG(ψ)

  • CTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | AU(ψ1, ψ2)

  • CTL can be defined in terms of NCTL!
  • The semantics of NCTL is given in the
  • bvious way.
slide-44
SLIDE 44

44

A more convenient CTL

  • NCTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | EG(ψ)

  • K, s £ EG(ψ) iff there exists a path π

from s such that for every k ≥ 0: K, π(k) £ ψ

slide-45
SLIDE 45

45

A more convenient CTL

  • NCTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | EG(ψ)

  • CTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | AU(ψ1, ψ2)

  • AU(ψ1, ψ2) = ¬EU(¬ψ2, (¬ψ1 ∧ ¬ψ2)) ∧ ¬EG(¬ψ2)

i.e., along any path: ψ2 must hold eventually and

(¬ψ1 ∧ ¬ψ2) can only happen after ψ2 (recall the before operator of LTL)

slide-46
SLIDE 46

46

A more convenient CTL

AU(ψ1, ψ2) = ¬EU(¬ψ2, (¬ψ1 ∧ ¬ψ2)) ∧ ¬EG(¬ψ2)

ψ1 cannot become false, while ψ2 stays false! ψ2 does not stay false forever! (i.e. ψ2 will eventually become true).

slide-47
SLIDE 47

47

A more convenient CTL

AU(ψ1, ψ2) = ¬EU(¬ψ2, (¬ψ1 ∧ ¬ψ2)) ∧ ¬EG(¬ψ2)

⇒ Assume K, s £ AU(ψ1, ψ2)

– Let π be a path from s. Then there exists k ≥ 0

with: K, s £ ψ2

– Hence, not K, s £ EG(¬ψ2) – Hence, K, s £ ¬EG(¬ψ2)

slide-48
SLIDE 48

48

A more convenient CTL

  • AU(ψ1, ψ2) = NewAU(ψ1, ψ2) =

¬EU(¬ψ2, (¬ψ1 ∧ ¬ψ2)) ∧ ¬EG(¬ψ2)

  • Clearly K, s £ AU(ψ1, ψ2) implies K, s £ ¬EG(¬ψ2)
  • Let K, s £ AU(ψ1, ψ2)

– Suppose now K, s £ EU(¬ψ2, ¬ψ1 ∧ ¬ψ2)

– Let π be any path from s witnessing the above:

– Let now k be the least integer such that: K, π(k) £ ¬ψ1 ∧ ¬ψ2 K, π(j) £ ¬ψ2 for 0 ≤ j < k.

slide-49
SLIDE 49

49

s sk ¬ψ2 ¬ψ2 ¬ψ2 ¬ψ1 Ƭψ2

  • Suppose K, π(m) £ ψ2, required by K, s £ AU(ψ1,ψ2)
  • Take m to be the least such number.
  • Then m > k, since K, s £ EU(¬ψ2, ¬ψ1 ∧ ¬ψ2)
  • But 0 ≤ k < m and K, π(k) £ ¬ψ1
  • Hence not K, s £ AU(ψ1, ψ2). Contradiction!
  • Thus K, s £ AU(ψ1, ψ2) also implies:

– K, s £ ¬EU(¬ψ2, ¬ψ1 ∧ ¬ψ2)

  • So K, s £ AU(ψ1, ψ2) implies K, s £ NewAU(ψ1, ψ2)

sm ψ2

slide-50
SLIDE 50

50

From CTL to NCTL

  • In a similar way we can argue that:

if K, s £ newAU(ψ1, ψ2) then K, s £ AU(ψ1, ψ2).

  • Hence CTL can be expressed in terms of

NCTL.

slide-51
SLIDE 51

51

¬EG¬ψ2 = AFψ2

A more convenient CTL

  • NCTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | EG(ψ)

  • CTL ::= p | ¬ψ | ψ1 ∨ ψ2 | EX(ψ) |

| EU(ψ1, ψ2) | AU(ψ1, ψ2)

  • AU(ψ1, ψ2) = NewAU(ψ1, ψ2) =

¬(EU(¬ψ2, (¬ψ1 ∧ ¬ψ2)) ∧ AF(ψ2)

  • NewAU1 = ¬ EU(¬ψ2, (¬ψ1 ∧ ¬ψ2)
  • NewAU2 = AFψ2
slide-52
SLIDE 52

52

From CTL to NCTL

  • Let K = (S, S0, R, AP, L) and s ∈ S.
  • We need to argue:

– K, s £ AU(ψ1, ψ2) iff K, s £ NewAU1 ∧ NewAU2

  • We already argued that:

– If K, s £ AU(ψ1, ψ2) then K, s £ NewAU1 ∧ NewAU2

slide-53
SLIDE 53

53

From CTL to NCTL

AU(ψ1, ψ2) = ¬EU(¬ψ2, (¬ψ1 ∧ ¬ψ2)) ∧ ¬EG(¬ψ2)

⇐ We need to argue that:

– If K, s £ NewAU1 ∧ NewAU2 then K, s £ AU(ψ1, ψ2)

  • So assume K, s £ NewAU1 ∧ NewAU2.
  • NewAU1 = ¬EU(¬ψ2, (¬ψ1 ∧ ¬ψ2)).
  • NewAU2 = ¬EG¬ψ2 = AFψ2
slide-54
SLIDE 54

54

From CTL to NCTL

  • Let π be some path from s.
  • We need to show that there exists k ≥ 0 such

that: – K, π(k) £ ψ2 – K, π(j) £ ψ1 if 0 ≤ j < k.

  • But K, s £ AF ψ2 implies there along any path

(and also along π) there exists k ≥ 0 such that: – K, π(k) £ ψ2

  • Assume k is the least such number along π.
slide-55
SLIDE 55

55

From CTL to NCTL

Now consider an arbitrary m with 0 ≤ m < k. CLAIM: K, σ(m) £ ψ1

  • If the CLAIM is true then we are done.
  • Suppose instead that K, σ(m) £ ¬ψ1.

– Then K, σ(m) £ ¬ψ1 ∧ ¬ψ2 (m < k) WHY??? – and K, σ(j) £ ¬ψ2 if 0 ≤ j < m, since j < m < k – Hence K, σ(0) £ EU(¬ψ2, ¬ψ1 ∧ ¬ψ2) – Therefore, not K, s £ NewAU1 which is a contradiction!

slide-56
SLIDE 56

56

CTL Model Checking

  • K £ ψ

iff K, s0 £ ψ for every s0 ∈ S0.

  • The CTL model checking problem.

– K = (S, S0, R, AP, L) (system model) – ψ a CTL formula (spec. of the property)

  • Given K and ψ determine whether or not K £ ψ
slide-57
SLIDE 57

57

CTL Model Checking

  • The actual model checking problem:

– Given K = (S, S0, R, AP, L) – Given s ∈ S – Given ψ, an NCTL formula. – Determine whether: K, s £ ψ

slide-58
SLIDE 58

58

The Sub-formulas of ψ

  • SF(ψ) is the least set of formulas satisfying:

– ψ ∈ SF(ψ) – If ¬α ∈ SF(ψ) then α ∈ SF(ψ) . – If α ∨ β ∈ SF(ψ) then α, β ∈ SF(ψ) – If EXα ∈ SF(ψ) then α ∈ SF(ψ) . – If EU(α, β) ∈ SF(ψ) then α, β ∈ SF(ψ) – If EGα ∈ SF(ψ) then α ∈ SF(ψ) .

  • SF(ψ) ---- The set of sub-formulas of ψ.
slide-59
SLIDE 59

59

The Labeling Procedure.

  • K = ( S, S0, R, AP, L)

– s ∈ S – ψ a NCTL formula (built out of AP).

  • Strategy:

– Construct Labels: S ô 2SF(ψ) – 2SF(ψ), the set of subsets of SF(ψ). – Each state of K is assigned a subset of a SF(ψ) by the Labels function.

  • K, s £ ψ

iff ψ ∈ Labels(s).

slide-60
SLIDE 60

60

The Labels function

  • Stage 1:

– For every t ∈ S: – Labels(t) = L(t) (K =(S, S0, R, AP, L))

  • ….

Assume we have done up to stage i.

  • Stage i +1:

– For every t ∈ S: – If α = ¬β then α ∈ Labels(t) iff β ∉ Labels(t).

slide-61
SLIDE 61

61

The Labels function

  • Stage i +1:

– For every t ∈ S: – If α = β1 ∨ β2 then α ∈ Labels(t) iff β1∈Labels(t) or β2 ∈ Labels(t) – If α = EXβ then α ∈ Labels(t) iff there exists s ∈ S such that β ∈ Labels(s) and R(t, s)

slide-62
SLIDE 62

62

The Labels Function

β

α = EX(β) S

slide-63
SLIDE 63

63

Computing the labeling for EX(β)

Algorithm Check_EX(β) T := {s | β ∈ Labels(s)}; while T ≠ ∅ do choose s ∈ T; T := T \{s}; forall t ∈ S such that (t,s) ∈ R do Labels(t) := Labels(t) ∪ {EX β};

Complexity: O(|M|)

slide-64
SLIDE 64

64

The Labels Function

  • Stage i +1:

– For every t ∈ S: – If α = EU(β1,β2) then

α ∈ Labels(t) iff

− β2 ∈ Labels(t) or

− β1 ∈ Labels(t) and EU(β1,β2) ∈ Labels(s) for some s with R(t,s).

slide-65
SLIDE 65

65

The Labels Function

  • Collect in T all the states satisfying β2

– all these states do also satisfy EU(β1,β2).

  • Traverse backward R from states in T and label

with EU(β1,β2) all the states t satisfying β1 and reaching at least a state s labeled with EU(β1,β2). If s ∈ T, t with R(t,s) and β1 ∈ Labels(t) then EU(β1,β2) ∈ Labels(t)

slide-66
SLIDE 66

66

β1 β1 β1 β2 β1 β1 ¬β1 ¬β2 β2

S

β1 β1 β1 β2 β1 β1 ¬β1 ¬β2 β2

T

slide-67
SLIDE 67

67

β1 β1 β1 β2 β1 β1 ¬β1 ¬β2 β2

S

β1 β1 β1

Eβ1Uβ2

β1 β1 ¬β1 ¬β2

Eβ1Uβ2

T

slide-68
SLIDE 68

68

β1 β1 β1 β2 β1 β1 ¬β1 ¬β2 β2

S

β1 β1

Eβ1Uβ2

β1

Eβ1Uβ2 Eβ1Uβ2

β1 β1 ¬β1 ¬β2

Eβ1Uβ2

T

slide-69
SLIDE 69

69

β1 β1 β1 β2 β1 β1 ¬β1 ¬β2 β2

S

Eβ1Uβ2

β1

Eβ1Uβ2

β1

Eβ1Uβ2

β1

Eβ1Uβ2 Eβ1Uβ2

β1

Eβ1Uβ2

β1 ¬β1 ¬β2

Eβ1Uβ2

T

slide-70
SLIDE 70

70

S

Eβ1Uβ2

β1

Eβ1Uβ2

β1

Eβ1Uβ2

β1

Eβ1Uβ2 β2 Eβ1Uβ2

β1

Eβ1Uβ2

β1 ¬β1 ¬β2

Eβ1Uβ2 β2

slide-71
SLIDE 71

71

Computing the labeling for EU(β1,β2)

Algorithm Check_EU(β1,β2) T := {s | β2 ∈ Labels(s)}; forall s ∈ T do Labels(s) := Labels(s) ∪ {EU(β1,β2)}; while T ≠ ∅ do chose s ∈ T; T := T \{s}; forall t ∈ S with (t,s)∈R do if EU(β1,β2) ∉ Labels(t) and β1∈Labels(t) then Labels(t) := Labels(t) ∪ {EU(β1,β2)}; T := T ∪ {t}; Complexity: O(|M|)

slide-72
SLIDE 72

72

  • Stage i +1:

– For every t ∈ S: – If α = EG(β ) then

α ∈ Labels(t) iff

– β ∈ Labels(t) and EG(β) ∈ Labels(s) for

some s with R(t,s).

The Labels Function

slide-73
SLIDE 73

73

Let M’ = (S’,R’,L’) be the sub-graph of M where – S’ = { s | M ,s £ β } – R’ = R|S’× S’ (the restriction of R to S’) – L’ = L|S’ (the restriction of L to S’) Lemma: M,s £ EG(β ) iff

  • 1. s ∈ S’ and
  • 2. there exists a path in M’ leading from s to a

non-trivial strongly connected component C

  • f the graph (S’,R’).

Property of EG(β)

slide-74
SLIDE 74

74

The Labels Function

  • Compute the non-trivial strongly connected

components of the subgraph S’ whose states all satisfy β

– all the states in these components do satisfy EG(β).

  • Traverse backward R and label with EG(β) the

states t reaching at least a state s labeled with EG(β) (note that both t and s must belong to S’). If t ∈ S’ and R(t,s) then EG(β ) ∈ Labels(t)

slide-75
SLIDE 75

75

β β β ¬β β β ¬β β β β β β β β ¬β ¬β

S’ S

slide-76
SLIDE 76

76

T

β β β β β β β β β β β ¬β ¬β β ¬β ¬β

S’ S

slide-77
SLIDE 77

77

β β β β β EGβ EGβ EGβ β β

T

β ¬β ¬β β ¬β ¬β

S’ S

slide-78
SLIDE 78

78

T

β β β β β EGβ EGβ EGβ β EGβ β ¬β ¬β β ¬β ¬β

S’ S

slide-79
SLIDE 79

79

β β β β β EGβ EGβ EGβ EGβ EGβ β ¬β ¬β β ¬β ¬β

T S’ S

slide-80
SLIDE 80

80

EGβ EGβ EGβ EGβ EGβ β ¬β ¬β EGβ EGβ EGβ ¬β EGβ EGβ ¬β β

S S’

slide-81
SLIDE 81

81

Computing the labeling for EG(β)

Algorithm Check_EG(β) S’ := {s | β ∈ Labels(s)}; SCC := {C | C is a non trivial SCC of S’}; T := ∪C∈SCC{s | s ∈ C}; forall s ∈ T do Labels(s) := Labels(s) ∪ {EG(β)}; while T ≠ ∅ do chose s ∈ T; T := T \{s}; forall t ∈ S’ with (t,s)∈R do if EG(β) ∉ Lables(t) then Labels(t) := Labels(t) ∪ {EG(β)}; T := T ∪ {t}; Complexity: O(|M|)

slide-82
SLIDE 82

82

CTL model checking

  • The algorithms just presented show that the

model checking problem for CTL can be solved in time linear in the size of System M and the size of the Property φ, namely: in time O(|M|⋅|φ|) where |M| is the size of the graph underlying M and |φ| is the number of subformulae of φ.

slide-83
SLIDE 83

83

Fixed point characterization

  • We will redefine the labeling function in

terms of fixed point computation.

  • This is a nice and elegant algorithmic

account.

  • It will be used when efficient symbolic

approach will be introduced.

slide-84
SLIDE 84

84

Partial Orders

  • A binary relation m on a set A is a partial
  • rder iff m is reflexive, anti-symmetric and

transitive.

  • The pair <A, m> is called a partially
  • rdered set (or poset).
  • Example: If S is any set and ⊆ is the
  • rdinary subset relation, then <2S,⊆> is a

partially ordered set.

slide-85
SLIDE 85

85

Upper Bounds

Given <A, m> and A’ ⊆ A

  • a∈A is an upper bound of A’ iff ∀a’∈A’, a’ ma
  • a∈A is a least upper bound (lub) of A’, written

+A’, iff

– a is an upper bound of A’ and – ∀a’∈A, if a’ is an upper bound of A’, then a m a’

slide-86
SLIDE 86

86

Lower Bounds

Given <A, m> and A’ ⊆ A

  • a∈A is a lower bound of A’ iff ∀a’∈A’, a m a’
  • a∈A is a greatest lower bound (glb) of A’,

written *A’, iff

– a is a lower bound of A’ and – ∀a’∈A, if a’ is a lower bound of A’, then a’ m a

slide-87
SLIDE 87

87

Complete Lattice

A poset <A, m> is a complete lattice if, for each A’ ⊆ A, the greatest lower bound *A’ and the least upper bound +A’ do exist. A complete lattice <A, m> has a unique greatest element +A=T and also a unique least element *A = ⊥.

slide-88
SLIDE 88

88

Complete Lattice

The poset <2S,⊆> is a complete lattice where intersection ∩ and union ∪ correspond to * and +, respectively. Any two subset of S have a least upper and a greatest lower bound. Example: S={a,b,c,d}. For {a,c} and {b,c} the lub is {c}, while the glb is {a,b,c}. There is a unique greatest element ∪2S = S and a unique least element ∩2S = ∅.

slide-89
SLIDE 89

89

Example of a complete lattice

{p} {r} {q}

⊥=∅

T={pqr} {pq} {pr} {qr}

The complete lattice <2S,⊆ > when S is the set {p,q,r}.

slide-90
SLIDE 90

90

Monotonic functions

  • A function F: A ô A is monotonic if for

each a,b ∈ A, a m b implies F(a) m F(b).

  • In other words, a function F is monotonic if

it preserves the ordering m.

slide-91
SLIDE 91

91

Fixed points

  • Given a function F: A ô A, an element a ∈ A

is a fixed point of F if F(a) = a.

  • a ∈ A is called the least fixed point of F

(µx.F(x)), if for all a’ ∈ A such that F(a’) = a’, then a m a’.

  • a ∈ A is called the greatest fixed point of F

(νx.F(x)), if for all a’ ∈ A such that F(a’) = a’, then a’ m a.

slide-92
SLIDE 92

92

Tarski’s Fixed Point theorem

THEOREM: Let <A, m> be a complete lattice, and F: A ô A a monotonic function. Then F has a least and a greatest fixed point given, respectively, by:

  • µx.F(x) = *{x ∈ A | F(x) m x}
  • νx.F(x) = +{x ∈ A| x m F(x)}
slide-93
SLIDE 93

93

Fixed point in finite lattices

Let <A, m> be a finite complete lattice, and F: A ! A be a monotonic function. Then the least fixed point for F is obtained as µx.F(x) = Fm(⊥) for some m, where F0(⊥) = ⊥, and Fn+1(⊥) = F(Fn(⊥)). Moreover, the greatest fixed point for F is obtained as νx.F(x) = Fk(T) for some k, where F0(T) = T, and Fn+1(T) = F(Fn(T)).

The greatest element of A The least element of A

slide-94
SLIDE 94

94

Generic fixed point algorithm

Algorithm Compute_lfp(F:function) X0 := ⊥; X1 := F(X0); j=1; while Xj ≠ Xj-1 j := j+1; Xj := F(Xj-1); return Xj

slide-95
SLIDE 95

95

CTL and complete lattices

  • Given a Kripke structure M=<S,S0,R,L,AP>.

We will then consider the poset <2S,⊆>.

  • <2S,⊆> is clearly a complete lattice (with

respect to intersection and union).

  • We will identify a CTL formula with the set
  • f states which satisfy it.
  • In this way we can define temporal operators

as functions on the complete lattice <2S,⊆>.

slide-96
SLIDE 96

96

Denotation of a CTL formula

  • Given a formula φ, let us define its denotation

(in M), in symbols |[φ]|, as the set of states satisfying the formula: |[φ]| = { s | M,s £ φ }

  • We could then define the cpo <CTL, m > by:

φ m ψ iff |[φ]| ⊆ |[ψ]|

slide-97
SLIDE 97

97

CTL is closed under conjunction and disjunction, therefore for any pair of formulae the upper and lower bound do exist.

Denotation of a CTL formula

  • Given the denotation of a formula

|[φ]| = { s | M,s £ φ }

  • We could then define the cpo <CTL, m > by:

φ m ψ iff |[φ]| ⊆ |[ψ]|

  • Then |[⊥]| = ∅ ; |[T]| = S ;
  • |[p]| = { s | p ∈ L(s) } ;
  • |[¬φ]| = S \ |[φ]| ;
  • |[φ ∨ ψ]| = |[φ]| ∪ |[ψ]| ;
  • |[φ ∧ ψ]| = |[φ]| ∩ |[ψ]| ;
slide-98
SLIDE 98

98

Denotation of a CTL formula

  • Given a formula φ, let us define its denotation

(in M), in symbols |[φ]|, as the set of states satisfying the formula: |[φ]| = { s | M,s £ φ }

  • ….
  • |[EXφ]| = { s | ∃t. (t ∈ |[φ]| ∩ R(s)) }
  • for the other temporal operators we would

need to use fixed points….

slide-99
SLIDE 99

99

Fixed point characterization of EU(β1,β2)

  • EU(β1,β2) ≡ β2 ∨ ( β1∧ EX EU(β1, β2) )
  • |[EU(β1,β2)]| = µZ.(|[β2]| ∪ (|[β1]| ∩ |[EX Z]|) )
  • |[EU(β1,β2)]| =

µZ.(|[β2]| ∪ (|[β1]| ∩ { s | ∃t ∈ Z ∩ R(s) }) )

slide-100
SLIDE 100

100

Fixed point characterization of EU(β1,β2)

Lemma: Let

F(Z) = (|[β2]|∪ (|[β1]|∩ { s | ∃t ∈ Z ∩ R(s) }))

then F is a monotonic function, i.e.

Z1 ⊆ Z2 implies F(Z1) ⊆ F(Z2)

slide-101
SLIDE 101

101

Fixed point characterization of EU(β1,β2)

Theorem:

|[EU(β1,β2)]| = µZ.(|[β2]|∪ (|[β1]|∩ { s | ∃t ∈ Z ∩ R(s) }))

in other words: µZ.(|[β2]| ∪ (|[β1]| ∩ { s | ∃t ∈ Z ∩ R(s)}) ) ⊆ |[EU(β1,β2)]| and |[EU(β1,β2)]| ⊆ µZ.(|[β2]| ∪ (|[β1]| ∩ { s | ∃t ∈ Z ∩ R(s)}) )

slide-102
SLIDE 102

102

Algorithm Compute_EU(β1,β2) X0 := |[⊥]|; /* i.e. X0 := ∅ */ X1 := |[β2]| ∪ (|[β1]| ∩ X0); /* i.e. X1 := |[β2]| */ j=1; while Xj ≠ Xj-1 j := j+1; Τ := Xj-1; X := ∅ while Τ ≠ ∅ do chose s ∈ Τ; Τ := Τ \{s}; forall t such that s ∈ R(t) do X := X ∪ {t}; Xj := |[β2]| ∪ (|[β1]| ∩ X)

Computing fixed point for EU(β1,β2)

This computes

X = EX Xj-1

slide-103
SLIDE 103

103

Computing fixed point for EU(β1,β2)

To compute |[EU(β1,β2)]| we can construct inductively the set of states Xj as follows:

– X1 = {s j s ∈ |[β2]|}. – Xj+1 = Xj ∪ { s | s ∈ |[β1]| and R(s,t) for some t∈Xj}

|[EU(β1,β2)]| is then the set X such that X = Xn for n such that Xn+1 = Xn. Notice that n must exist by Tarski’s Theorem since Xj ⊆ Xj+1 ⊆ S (and S is finite!)

slide-104
SLIDE 104

104

From X0 to X1

X1 β2 X0 EU(β1, β2) β1 S

slide-105
SLIDE 105

105

From Xj to Xj+1

Xj+1 EU(β1, β2) Xj Xj-1 Xj-2 S β1

slide-106
SLIDE 106

106

Computing fixed point for EU(β1,β2)

Algorithm Compute_EU(β1,β2) X1 := |[β2]|; j=1; repeat j := j+1; Τ := X := Xj-1; while Τ ≠ ∅ do chose s ∈ Τ; Τ := Τ \{s}; forall t such that s ∈ R(t) do if t ∈ |[β1]| then /* t∈|[β1]| ∩ EX Xj-1*/ X := X ∪ {t}; Xj = X ; until Xj-1 = Xj

slide-107
SLIDE 107

107

Fixed point characterization of EG(β)

  • EG(β) ≡ β ∧ EX EG(β)
  • |[EG(β)]| = νZ.(|[β]| ∩ |[EX Z]|) )
  • |[EG(β)]| =

νZ.(|[β]| ∩ { s | ∃t ∈ Z ∩ R(s) })

slide-108
SLIDE 108

108

Computing the fixed point for EG(β)

Algorithm Compute_EG(β) X0 := |[T]|; /* i.e. X0 := S */ X1 := |[β]| ∩ X0; /* i.e. X1 := |[β]| */ j=1; while Xj ≠Xj-1 j := j+1; Τ := Xj-1; X := ∅; while Τ ≠ ∅ do chose s ∈ Τ; Τ := Τ \{s}; forall t such that s ∈ R(t) Xj := Xj ∪ {t}; Xj := |[β]| ∩ Xj X = EX Xj-1

slide-109
SLIDE 109

109

The Labels function

  • To

compute |[EGβ]| we can construct inductively the set of states Xj as follows:

– X1 = |[β]|. – Xj+1 = Xj − { s | s ∈ Xj and there does not exist t ∈ Xj such that R(s, t)}

|[EGβ]| is then the set X such that X = Xn for m such that Xn+1 = Xn.

  • Notice that m must exists by Tarski’s Theorem

since ∅ ⊆ Xj+1 ⊆ Xj

slide-110
SLIDE 110

110

From Y0 to Y1

EGβ Y0 Y1 β S

slide-111
SLIDE 111

111

From Yj to Yj+1

EGβ S Yj-2 Yj-1 Yj Yj+1 β

slide-112
SLIDE 112

112

Computing the fixed point for EG(β)

Algorithm Compute_EG(β) X1 := |[β]|; j=1; repeat j := j+1; Τ := Xj := Xj-1; while Τ ≠ ∅ do chose s ∈ Τ; Τ := Τ \{s}; if for no t ∈ R(s), t ∈ Xj-1 then Xj := Xj - {s}; until Xj = Xj-1;