© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
5.4 TCAS – Model Checking large scale software systems
Modellbasierte Softwareentwicklung
26.01.2015
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
TCAS • Traffic Alert and Collision Avoidance System • Planes crossing the USA with more than 10 people must be equipped with TCAS • Integrated with other systems in the cockpit • Informs pilots about the relative position and speed of other planes • Alerts the pilot, if other planes are coming to close (Traffic Advisory (TA)) • Gives evasive maneuvers (Resolution Advisory (RA)) ⇒ Safety critical program 2
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Model Checking TCAS
W. Chan, R. J. Anderson, P. Beame, S. Burns, F. Modugno, D. Notkin, and J. D. Reese. 1998. Model Checking Large Software Specifications. IEEE Trans. Softw. Eng. 24, 7 (July 1998), 498-520. 3
RSML Sys Alt-Layer t1: u[alt ≥ 9950]/w
t3: u[alt ≤ 2050]/w
High
t6: u[alt > 2050]/w
Low
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
t5: u[alt < 9950]/w
t4: u[alt > 10050]/w
t7: u[alt < 1950]/w
Mid
• Requirement State Machine Language • Statechart (after Harel)
t2: u[1950 ≤ alt ≤ 10050]/w
Alarm t8: u[switch=up]
Shutdown
t14: u[switch=test]
Operating Mode t10: w[c] On
Off t11: w[¬in Low]
t9: u[switch=down]
Volume
t12: v
1
2 t13: v
4
RSML Sys Alt-Layer t1: u[alt ≥ 9950]/w
t3: u[alt ≤ 2050]/w
High
t6: u[alt > 2050]/w
Sys
Low
t5: u[alt < 9950]/w
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Alt-Layer t4: u[alt > 10050]/w
Alarm
t7: u[alt < 1950]/w
Mid
High Mid Low Shutdown Operating t2: u[1950 ≤ alt ≤ 10050]/w
Alarm t8: u[switch=up]
Shutdown
t14: u[switch=test]
Operating Mode t10: w[c] On
Mode Off
t11: w[¬in Low] t9: u[switch=down]
Volume
Volume
Off On
1 2
t12: v
1
2 t13: v
5
RSML Sys Alt-Layer t1: u[alt ≥ 9950]/w
t3: u[alt ≤ 2050]/w
High
t6: u[alt > 2050]/w
Low
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
t5: u[alt < 9950]/w
t4: u[alt > 10050]/w
t7: u[alt < 1950]/w
Mid t2: u[1950 ≤ alt ≤ 10050]/w
Alarm t8: u[switch=up]
Shutdown
t14: u[switch=test]
Inputs from the environment: • alt – variable saving the flight level • switch – alert control
Operating Mode t10: w[c] On
Off t11: w[¬in Low]
t9: u[switch=down]
Volume
t12: v
1
2 t13: v
6
RSML Sys Alt-Layer t1: u[alt ≥ 9950]/w
t3: u[alt ≤ 2050]/w
High
t6: u[alt > 2050]/w
Low
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
t5: u[alt < 9950]/w
t4: u[alt > 10050]/w
t7: u[alt < 1950]/w
Mid t2: u[1950 ≤ alt ≤ 10050]/w
Alarm t8: u[switch=up]
Shutdown
t14: u[switch=test]
Operating Mode t10: w[c] On
Off
Synchronization by events: • u – external event, raised perdiodically • v – external event, raised, if the pilot changes volume • w – internal event, for internal synchronization
t11: w[¬in Low] t9: u[switch=down]
Volume
t12: v
1
2 t13: v
7
RSML Sys Alt-Layer t1: u[alt ≥ 9950]/w
t3: u[alt ≤ 2050]/w
High
t6: u[alt > 2050]/w
Low
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
t5: u[alt < 9950]/w
t4: u[alt > 10050]/w
t7: u[alt < 1950]/w
Mid t2: u[1950 ≤ alt ≤ 10050]/w
Alarm t8: u[switch=up]
Shutdown
t14: u[switch=test]
Transitions: Id: trigger[constraint]/action t1: u[alt ≥ 9950] / w
Operating Mode t10: w[c] On
Off t11: w[¬in Low]
t9: u[switch=down]
Volume
t12: v
1
2 t13: v
8
RSML Sys Alt-Layer t1: u[alt ≥ 9950]/w
t3: u[alt ≤ 2050]/w
High
t6: u[alt > 2050]/w
Low
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
t5: u[alt < 9950]/w
t4: u[alt > 10050]/w
t7: u[alt < 1950]/w
Mid t2: u[1950 ≤ alt ≤ 10050]/w
Alarm t8: u[switch=up]
Shutdown
t14: u[switch=test]
Operating Mode t10: w[c] On
Off t11: w[¬in Low]
t9: u[switch=down]
Volume
t12: v
1
2 t13: v
9
RSML – Step Semantics
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Microstep: Execute maximum amount of non-conflicting transitions After the execution of a transition all events that haven‘t been generated disappear Stability: execute microsteps until no more transitions can be triggered by the generated internal events After that the system is stable
Step: sequence of the microsteps from the arrival of the external events until the point where the system is stable
10
Problems (1/2) Contingent on TCAS II:
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Specification: 400sided Document in RSML ⇒ only partly specified (30%, mostly Own-Aircraft) Modeled one other plane only
Contingent on BDDs: Range of numerical inputs must be bounded No efficient method for multiplication on BDDs ⇒ Abstraction needed
11
Problems (2/2) Contingent on SMV Model Checker:
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
SMV works inefficiently on integers BDDs of 200 MB size One additional bit for variables: 10 h instead of 10 min runtime Uses inefficient BDD representation: X = Y with X = xn-1xn-2…x0 and Y = yn-1yn-2…y0 comparison: xn-1xn-2…x0 = yn-1yn-2…y0 better: xn-1 = yn-1 ∧ xn-2 = yn-2 ∧ … ∧ x0 = y0
Finding counterexamples takes much longer than the evaluation of the formula
12
Analysis Results: Function Consistence /* Case 1 */
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
0
/* Case 4*/
2500 ft/min
If New-Increase-Climb
-2500 ft/min
If New-Increase-Descend /* Case 5*/
Max(Own-TrackAlt-Rate, 1500 ft/min)
If Increase-ClimbCancelled and …
Function DisplayedModel-Goal
/* Case 6 */
Case differentiation with 8 cases, excluding each other
If Increase-Descend- /* Case 7 */ Min(Own-TrackAlt-Rate, -1500 ft/min) Cancelled and …
analysis result: false
/* Case 8*/
Reason: error in the abstraction
Prev(DisplayedModel-Goal)
Otherwise
AG (Composite-RA-Evaluated-Event -> !((Case-1 & Case-2) |(Case-1 & Case-3) | … (Case-6 & Case-7))) 13
Analysis Results: Descend“/“Increase-Descend“ Prohibition 1. Flight level < 1000 ft ⇒ all descent commands are prohibited
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
2. Flight level ≤ 1450 ft ⇒ all commands increasing the descent rate are prohibited AG ((stable & Radio-Altimeter-Status = Valid & Own-Alt-Radio !Increase-Descend)
Analysis results: 1. True 2. False Reason: The specification stated > instead of ≤
14
Analysis Result: Output Conformance
Two outputs with instructions for the pilot: Displayed-Model-Goal (DMG) and Composite-RA (RA)
⇒ Outputs must conform
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Analysis result: False
time
event
command
t0
Second plane appears. Instruction to descent.
DMG: ≤ -1500 ft/min RA: Descend
t1 > t0
Increase of descent rate neccessary
DMG: -2500 ft/min RA: Increase-Descend
t1+1
Climb increases safety more than descent
DMG: -1500 ft/min RA: Climb 15
Analysis Results
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Properties
Result
time (sec)
Amount of BDD-nodes
Memoryoccupancy (MB)
Generate Transition Relation
N/A
46.6
124618
7.1
Transition Consistence
False
387.0
717275
16.4
Function Consistence
False
289.5
387167
11.5
Step Termination
True
57.5
142937
7.4
„Descend“ Prohibition
True
166.8
429983
11.8
„Increase-Descend“ Prohibition
False
193.7
282694
9.9
Output
False
325.6
376716
11.6
16
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Zusammenfassung der Vorlesung
Modellbasierte Softwareentwicklung 26.01.2015
Überblick
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Motivation für Modellbasierte Softwareentwicklung Entwicklung komplexer, häufig sicherheitskritischer Systeme Teil I: Spezifikationstechniken für Analyse und Design 1. Struktur-orientierte Techniken Beschreibungssprachen wie z.B. UML-Klassendiagramme Design Patterns nach Gamma et al. 2. Operationale Techniken Zustandsmaschinen, Timed Automata: Syntax und Semantik Graphgrammatiken: Syntax und Semantik 3. Deskriptive Techniken: Z, Verfeinerungsschemata
Modellbasierte Softwareentwicklung
26.01.2015
18
Überblick
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Teil II Codegenerierung 4. Code-Generierung für Klassendiagramme (insb. Assoziationen), Zustandsmaschinen, Story-Diagramme Teil III Validation und Verifikation 5. Testen (White Box, Black Box, Überdeckungstests, Äquivalenzklassen) 6. Model Checking (explizites, symbolisches, CTL, TCTL, KripkeStrukturen, BDDs)
Modellbasierte Softwareentwicklung
26.01.2015
19
Weiterführende Veranstaltungen SS 2015 Bachelor Vorlesungen:
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Softwaremodellierung mit formalen Methoden (Wehrheim) Grundlagen Wissensbasierter Systeme (Kleine Büning)
Proseminare: Modellbasierte Softwareentwicklung für intelligente technische Systeme (Priesterjahn)
Modellbasierte Softwareentwicklung
26.01.2015
20
Weiterführende Veranstaltungen SS 2015 Master Vorlesungen:
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Software Quality Assurance (Engels) Propositional Proof Systems (Kleine Büning)
Modellbasierte Softwareentwicklung
26.01.2015
21
Erinnerung: Tutoren für das SWTPra / SoPra SS 2015 Wir suchen Tutoren für das SS 2015 zur Betreuung von Gruppen im
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Softwaretechnik-Praktikum (SWTPra) Softwarepraktikum (SoPra)
SHK-Vertrag 9,5 h/Woche (oder 19 h/Woche), 4 Monate Chance auf längerfristige Beschäftigung als SHK in Forschungsprojekten der Fachgruppe
Kontakt: Christian Brenner
[email protected] Büro ZM1.02-13 Modellbasierte Softwareentwicklung
26.01.2015
22
Klausur-Vorbereitung Folien durchgehen & lernen ggf. Literatur dazu holen (siehe Webseite)
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn
Übungsaufgaben wiederholen (& selbst lösen) In Gruppen lernen, gemeinsam Fragen beantworten …und jetzt Fragen stellen! (oder per Mail an
[email protected])
Modellbasierte Softwareentwicklung
26.01.2015
23