week11
week11
Week 11
Hubert Baumeister
[email protected]
DTU Compute
Technical University of Denmark
Spring 2018
Contents
Model checking
Course Summary
Train 1:
[t1=enroute] [t1=onBridge]
[s1=green]
[t1=atSignal]
Train 2
[t2=enroute] [t2=onBridge]
[s2=green]
[t2=atSignal]
Railway crossing example
Signal 1
[t1=atSignal & (t2=enroute | t2=atSignal)]
[s1=green] [s1=red]
Signal 2
[t2=atSignal & t1=enroute]
[s2=green] [s2=red]
Railway Crossing
1 2 3 4 5 10
[s1=red [s1=red [s1=green [s1=green [s1=red [s1=red
s2=red s2=red s2=red s2=red s2=red s2=red
t1=enroute t1=atSignal t1=atSignal t1=onBridge t1=onBridge t1=onBridge
t2=enroute] t2=enroute] t2=enroute] t2=enroute] t2=enroute] t2=onBridge]
.... ....
.... 17
6 7 8 9
[s1=red
[s1=red [s1=green [s1=green [s1=red s2=green
s2=red s2=red s2=red s2=red
t1=onBridge
t1=atSignal t1=atSignal t1=onBridge t1=onBridge
t2=onBridge]
t2=atSignal] t2=atSignal] t2=atSignal] t2=atSignal]
11 12 13 14 15 16
[s1=red [s1=red [s1=red [s1=red [s1=green [s1=green
s2=red s2=green s2=green s2=red s2=red s2=green
t1=enroute t1=enroute t1=enroute t1=enroute t1=onBridge t1=onBridge
t2=onBridge] t2=onBridge] t2=atSignal] t2=atSignal] t2=onBridge] t2=onBridge]
Kripke structure: Definition
M |= φ
1 2 3 4 5 10
[s1=red [s1=red [s1=green [s1=green [s1=red [s1=red
s2=red s2=red s2=red s2=red s2=red s2=red
t1=enroute t1=atSignal t1=atSignal t1=onBridge t1=onBridge t1=onBridge
t2=enroute] t2=enroute] t2=enroute] t2=enroute] t2=enroute] t2=onBridge]
.... ....
.... 17
6 7 8 9
[s1=red
[s1=red [s1=green [s1=green [s1=red
s2=green
s2=red s2=red s2=red s2=red
t1=onBridge
t1=atSignal t1=atSignal t1=onBridge t1=onBridge
t2=onBridge]
t2=atSignal] t2=atSignal] t2=atSignal] t2=atSignal]
11 12 13 14 15 16
[s1=red [s1=red [s1=red [s1=red [s1=green [s1=green
s2=red s2=green s2=green s2=red s2=red s2=green
t1=enroute t1=enroute t1=enroute t1=enroute t1=onBridge t1=onBridge
t2=onBridge] t2=onBridge] t2=atSignal] t2=atSignal] t2=onBridge] t2=onBridge]
M, 1 |= s1 = red
M, 5 6|= s1 = green
M, 3 |= s1 = green ∧ t1 = atSignal
Logical formulae: CTL
M, s0 |= QT φ
[s1=?
s2=?
t1=onBridge
t2=onBridge]
Railway crossing example
[s1=?
s2=?
t1=onBridge
t2=onBridge]
Compute
[|φ|] = {s | M, s |= φ}
Then
M |= φ if and only if I ⊆ [|φ|]
How to compute [|φ|]?
∃S ⊆ N : S = S ∩ {3}
Least Fixpoint
∃S ⊆ N : S = S ∪ {3}
Example: EG y
π0 = S
Example: EG y : 1. Iteration
π 1 = [|y |] ∩ R −1 (π 0 )
Example: EG y : 1. Iteration
π 1 = [|y |] ∩ R −1 (π 0 )
Example: EG y : 1. Iteration
π 1 = [|y |] ∩ R −1 (π 0 )
Example: EG y : 1. Iteration
π 1 = [|y |] ∩ R −1 (π 0 )
Example: EG y : 2. Iteration
π 2 = [|y |] ∩ R −1 (π 1 )
Example: EG y : 2. Iteration
π 2 = [|y |] ∩ R −1 (π 1 )
Example: EG y : 2. Iteration
π 2 = [|y |] ∩ R −1 (π 1 )
Example: EG y : 2. Iteration
π 2 = [|y |] ∩ R −1 (π 1 )
Example: EG y : 3. Iteration
π 3 = [|y |] ∩ R −1 (π 2 )
Example: EG y : 3. Iteration
π 3 = [|y |] ∩ R −1 (π 2 )
Example: EG y : 3. Iteration
π 3 = [|y |] ∩ R −1 (π 2 )
Example: EG y : 3. Iteration
π 3 = [|y |] ∩ R −1 (π 2 )
Example: EG y : Conclusion
Model checking
Course Summary
I Modelling notations
I One system, several views: Use case realizations
I Views: Component-, Class-, State-Machine-, Use Case-,
Activity-, and Sequence diagram; OCL constraints
I Requirements
I Use cases: use case diagrams, detailed use cases, user
stories, glossary
I Design
I CRC cards, High cohesion/low coupling, layered
architecture, object-orientation
I Development Process
I Agile modeling, agile project planning, MDA
I Verification / Validation
I Test, Model checking
Tips
subcomponents or classes
→ Classes implement provided interfaces of ports and use
required interfaces of ports
I Extend OCL constraints / object life cycle state machines of
classes
I Check that the use case scenario can be realized with your
system
→ Report structure is not the same as the structure of the
development process
Contents
Model checking
Course Summary