02291: System Integration Kripke Structure and Computational Tree - - PowerPoint PPT Presentation

02291 system integration
SMART_READER_LITE
LIVE PREVIEW

02291: System Integration Kripke Structure and Computational Tree - - PowerPoint PPT Presentation

02291: System Integration Kripke Structure and Computational Tree Logic (CTL) Hubert Baumeister huba@dtu.dk DTU Compute Technical University of Denmark Spring 2020 Model checking Prove: in our model of the train and signals it never


slide-1
SLIDE 1

02291: System Integration

Kripke Structure and Computational Tree Logic (CTL) Hubert Baumeister

huba@dtu.dk

DTU Compute Technical University of Denmark

Spring 2020

slide-2
SLIDE 2

Model checking

Prove: ”in our model of the train and signals it never happens that both trains are

  • n the bridge”

M | = φ ◮ Models M are Kripke structures ◮ Formulas φ are Computational Tree Logic (CTL) formulas ◮ Proving: Model checking

slide-3
SLIDE 3

Example of a Kripke structure

◮ Kripke structure: Set of states + relation between states ◮ The Kripke structure of the railroad crossing system has 36 states (2 × 2 × 3 × 3)

1 7 [s1=red s2=green t1=onBridge t2=onBridge] 1 6 [s1=green s2=green t1=onBridge t2=onBridge] 1 5 [s1=green s2=red t1=onBridge t2=onBridge] 1 0 [s1=red s2=red t1=onBridge t2=onBridge] 3 [s1=green s2=red t1=atSignal t2=enroute] 4 [s1=green s2=red t1=onBridge t2=enroute] 5 [s1=red s2=red t1=onBridge t2=enroute] 2 [s1=red s2=red t1=atSignal t2=enroute] 1 [s1=red s2=red t1=enroute t2=enroute] 8 [s1=green s2=red t1=onBridge t2=atSignal] 7 [s1=green s2=red t1=atSignal t2=atSignal] 6 [s1=red s2=red t1=atSignal t2=atSignal] 1 1 [s1=red s2=red t1=enroute t2=onBridge] 1 2 [s1=red s2=green t1=enroute t2=onBridge] 1 3 [s1=red s2=green t1=enroute t2=atSignal] 9 [s1=red s2=red t1=onBridge t2=atSignal] .... .... .... 1 4 [s1=red s2=red t1=enroute t2=atSignal]

slide-4
SLIDE 4

Kripke structure: Definition

M | = φ

Kripke structure (nondeterministic finite state machine)

A Kripke structure M = (S, I, R, λ): ◮ Set of states S, e.g., S = {1, 2, . . . , 36} ◮ Initial states I ⊆ S, e.g., I = {1} ⊆ S ◮ Transition relation R ⊆ S × S, e.g., R = {(1, 2), (2, 3) . . .} ◮ Propositions V, e.g., V = {s1 is red, s1 is green, s2 is red, s2 is green, t1 is on bridge, t1 is at signal, t1 is enroute, t2 is on bridge, t2 is at signal, t2 is enroute} ◮ Set of true propositions in a state λ : S → 2V, e.g.,

λ(1) = {s1 is red, s2 is red, t1 is on bridge, t2 is on bridge} λ(2) = {s1 is red, s2 is red, t1 is at signal, t2 is on bridge} . . .

slide-5
SLIDE 5

Computation Tree

Unfolding of a Kripke structure

slide-6
SLIDE 6

Computation Tree

Unfolding of a Kripke structure

slide-7
SLIDE 7

Computation Tree

Unfolding of a Kripke structure

slide-8
SLIDE 8

Computation Tree

Unfolding of a Kripke structure

slide-9
SLIDE 9

Computation Tree

Unfolding of a Kripke structure

slide-10
SLIDE 10

Logical formulae: CTL

M | = φ if and only if ∀s0 ∈ I : M, s0 | = φ

Satisfaction

◮ M, s0 | = φ: the formula φ holds starting from state s0

CTL: Computation Tree Logic formulae (1/4)

◮ p ∈ V: p is a basic proposition ◮ ¬φ, φ ∧ ψ, φ = ⇒ ψ, . . . : the usual boolean connectors . . .

Satisfaction: simple formulae

◮ M, s0 | = p iff p ∈ λ(s0) ◮ M, s0 | = φ ∧ ψ iff M, s0 | = φ and M, s0 | = ψ . . .

slide-11
SLIDE 11

Example

1 7 [s1=red s2=green t1=onBridge t2=onBridge] 1 6 [s1=green s2=green t1=onBridge t2=onBridge] 1 5 [s1=green s2=red t1=onBridge t2=onBridge] 1 0 [s1=red s2=red t1=onBridge t2=onBridge] 3 [s1=green s2=red t1=atSignal t2=enroute] 4 [s1=green s2=red t1=onBridge t2=enroute] 5 [s1=red s2=red t1=onBridge t2=enroute] 2 [s1=red s2=red t1=atSignal t2=enroute] 1 [s1=red s2=red t1=enroute t2=enroute] 8 [s1=green s2=red t1=onBridge t2=atSignal] 7 [s1=green s2=red t1=atSignal t2=atSignal] 6 [s1=red s2=red t1=atSignal t2=atSignal] 1 1 [s1=red s2=red t1=enroute t2=onBridge] 1 2 [s1=red s2=green t1=enroute t2=onBridge] 1 3 [s1=red s2=green t1=enroute t2=atSignal] 9 [s1=red s2=red t1=onBridge t2=atSignal] .... .... .... 1 4 [s1=red s2=red t1=enroute t2=atSignal]

M, 1 | = s1 = red M, 5 | = s1 = green M, 3 | = s1 = green ∧ t1 = atSignal

slide-12
SLIDE 12

Logical formulae: CTL

M, s0 | = QTφ ◮ Q: for all paths (A), or there exists one path (E) ◮ T: for the next state of one path (X), for some state of one path (F), for all states on one path (G)

CTL: Computation Tree Logic (2/4)

. . . ◮ EX φ,AX φ: formula φ holds in one successor state or in all successor states . . .

slide-13
SLIDE 13

Logical formulae: CTL

CTL: Computation Tree Logic (3/4)

. . . ◮ EF φ, AF φ: formula φ holds eventually in one state in one path or eventually in one state in all paths ◮ EG φ, AG φ: formula φ holds in every state of one path or in every state of every path . . .

slide-14
SLIDE 14

CTL example

slide-15
SLIDE 15

Please stop the video and try to find the answer Continue with the video to see the solution

slide-16
SLIDE 16

CTL example

slide-17
SLIDE 17

Railway crossing example

◮ Safety property: Both trains are not at the same time on the bridge ◮ The following states are not reachable:

[s1=? s2=? t1=onBridge t2=onBridge]

slide-18
SLIDE 18

Please stop the video and try to find the answer Continue with the video to see the solution

slide-19
SLIDE 19

Railway crossing example

◮ Safety property: Both trains are not at the same time on the bridge ◮ The following states are not reachable:

[s1=? s2=? t1=onBridge t2=onBridge]