European Train Control System: A Case Study in Formal Verification e - - PowerPoint PPT Presentation

european train control system a case study in formal
SMART_READER_LITE
LIVE PREVIEW

European Train Control System: A Case Study in Formal Verification e - - PowerPoint PPT Presentation

European Train Control System: A Case Study in Formal Verification e Platzer 1 Jan-David Quesel 2 Andr 1 Carnegie Mellon University, Pittsburgh, PA 2 University of Oldenburg, Department of Computing Science, Germany International Conference on


slide-1
SLIDE 1

European Train Control System: A Case Study in Formal Verification

Andr´ e Platzer1 Jan-David Quesel2

1Carnegie Mellon University, Pittsburgh, PA 2University of Oldenburg, Department of Computing Science, Germany

International Conference on Formal Engineering Methods (ICFEM), Rio de Janeiro, 2009

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 1 / 19

slide-2
SLIDE 2

ETCS Control Verification

Problem

Hybrid System Continuous evolutions (differential equations) Discrete jumps (control decisions)

1 2 3 4 t 2 1 1 2 a 1 2 3 4 t 0.5 1.0 1.5 2.0 2.5 3.0 v 1 2 3 4 t 1 2 3 4 5 6 z

τ.a τ.v τ.p Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 2 / 19

slide-3
SLIDE 3

European Train Control System

m.e ST SB τ.p

Objectives

1 Collision free 2 Maximise throughput &

velocity (300 km/h)

3 2.1 ∗ 106 passengers/day

Overview

1 No static partitioning of track 2 Radio Block Controller (RBC)

manages movement authorities dynamically

3 Moving block principle Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 3 / 19

slide-4
SLIDE 4

European Train Control System

m.e ST SB τ.p

Parametric Hybrid Systems

continuous evolution along differential equations + discrete change MA z v t m.e τ.v τ.p

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 3 / 19

slide-5
SLIDE 5

European Train Control System

m.e ST SB τ.p

Parametric Hybrid Systems

continuous evolution along differential equations + discrete change MA z v t m.e τ.v τ.p

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 3 / 19

slide-6
SLIDE 6

European Train Control System

m.e ST SB τ.p

Parametric Hybrid Systems

continuous evolution along differential equations + discrete change MA z v MA z v t m.e τ.v τ.p

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 3 / 19

slide-7
SLIDE 7

European Train Control System

m.e ST SB τ.p

Parametric Hybrid Systems

continuous evolution along differential equations + discrete change Parameters have nonlinear influence Handle SB as free symbolic parameter? Challenge: verification (falsifying is “easy”) Which constraints for SB? ∀m.e ∃SB “train always safe” MA z v MA z v t m.e τ.v τ.p

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 3 / 19

slide-8
SLIDE 8

Differential Dynamic Logic (dL)

m.e τ.p τ.v

Example

→ [ ]( )

Precondition Operation model Property

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 4 / 19

slide-9
SLIDE 9

Differential Dynamic Logic (dL)

m.e τ.p τ.v

Example

τ.v 2 ≤ 2b(m.e − τ.p) → [ ](τ.p ≤ m.e)

Precondition Operation model Property

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 4 / 19

slide-10
SLIDE 10

Differential Dynamic Logic (dL)

m.e τ.p τ.v

Example

τ.v 2 ≤ 2b(m.e − τ.p) → [ τ.p′ = τ.v, τ.v ′ = τ.a](τ.p ≤ m.e)

Precondition Operation model Property Continuous evolution: differential equation

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 4 / 19

slide-11
SLIDE 11

Differential Dynamic Logic (dL)

m.e τ.p τ.v

Example

τ.v 2 ≤ 2b(m.e − τ.p) → [τ.a := ∗; τ.p′ = τ.v, τ.v ′ = τ.a](τ.p ≤ m.e)

Precondition Operation model Property Random assignment

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 4 / 19

slide-12
SLIDE 12

Differential Dynamic Logic (dL)

m.e τ.p τ.v

Example

τ.v 2 ≤ 2b(m.e − τ.p) → [τ.a := ∗; ?τ.a ≤ −b; τ.p′ = τ.v, τ.v ′ = τ.a](τ.p ≤ m.e)

Precondition Operation model Property Test

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 4 / 19

slide-13
SLIDE 13

3D Movement Authorities

τ.p τ.v Vectorial MA m = (d, e, r): Beyond point m.e train not faster than m.d. Train should try not to keep recommended speed m.r

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 6 / 19

slide-14
SLIDE 14

3D Movement Authorities

m.r τ.p τ.v Vectorial MA m = (d, e, r): Beyond point m.e train not faster than m.d. Train should try not to keep recommended speed m.r

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 6 / 19

slide-15
SLIDE 15

3D Movement Authorities

m.r m1.e m1.d τ.p τ.v Vectorial MA m = (d, e, r): Beyond point m.e train not faster than m.d. Train should try not to keep recommended speed m.r

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 6 / 19

slide-16
SLIDE 16

3D Movement Authorities

m.r m1.e m1.d τ.p τ.v Vectorial MA m = (d, e, r): Beyond point m.e train not faster than m.d. Train should try not to keep recommended speed m.r

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 6 / 19

slide-17
SLIDE 17

3D Movement Authorities

m.r m2.e m2.d τ.p τ.v Vectorial MA m = (d, e, r): Beyond point m.e train not faster than m.d. Train should try not to keep recommended speed m.r

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 6 / 19

slide-18
SLIDE 18

3D Movement Authorities

m.r m2.e m2.d τ.p τ.v Vectorial MA m = (d, e, r): Beyond point m.e train not faster than m.d. Train should try not to keep recommended speed m.r

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 6 / 19

slide-19
SLIDE 19

3D Movement Authorities

m.r m3.e m3.d τ.p τ.v Vectorial MA m = (d, e, r): Beyond point m.e train not faster than m.d. Train should try not to keep recommended speed m.r

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 6 / 19

slide-20
SLIDE 20

3D Movement Authorities

m.r m3.e m3.d τ.p τ.v Vectorial MA m = (d, e, r): Beyond point m.e train not faster than m.d. Train should try not to keep recommended speed m.r

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 6 / 19

slide-21
SLIDE 21

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide. m.e ST SB τ.p

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 7 / 19

slide-22
SLIDE 22

Parametric Skeleton of ETCS

Read from the informal specification. . .

ETCSskel : (train ∪ rbc)∗ train : spd; atp; drive spd : (?τ.v ≤ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ A) ∪(?τ.v ≥ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ 0) atp : if(m.e − τ.p ≤ SB ∨ rbc.message = emergency) τ.a := −b drive : t := 0; (τ.p′ = τ.v, τ.v′ = τ.a, t′ = 1 ∧ τ.v ≥ 0 ∧ t ≤ ε) rbc : (rbc.message := emergency) ∪ (m := ∗; ?m.r > 0)

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 8 / 19

slide-23
SLIDE 23

Parametric Skeleton of ETCS

As transition system. . .

?τ.v ≤ m.r ?τ.v ≥ m.r τ.a := ∗ τ.a := ∗ ? − b ≤ τ.a ≤ A ?0 > τ.a ≥ −b ?(m.e − τ.p ≤ SB∨ rbc.message = emergency) ?m.e − τ.p ≥ SB∧ rbc.message = emergency) τ.a := −b t := 0 τ.p′ = τ.v, τ.v′ = τ.a, t′ = 1 τ.v ≥ 0 ∧ t ≤ ε m0 := m m := ∗ rbc.message := emergency

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 8 / 19

slide-24
SLIDE 24

Parametric Skeleton of ETCS

ETCSskel : (train ∪ rbc)∗ train : spd; atp; drive spd : (?τ.v ≤ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ A) ∪(?τ.v ≥ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ 0) atp : if(m.e − τ.p ≤ SB ∨ rbc.message = emergency) τ.a := −b drive : t := 0; (τ.p′ = τ.v, τ.v′ = τ.a, t′ = 1 ∧ τ.v ≥ 0 ∧ t ≤ ε) rbc : (rbc.message := emergency) ∪ (m := ∗; ?m.r > 0)

Task

Verify safety

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 8 / 19

slide-25
SLIDE 25

Parametric Skeleton of ETCS

ETCSskel : (train ∪ rbc)∗ train : spd; atp; drive spd : (?τ.v ≤ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ A) ∪(?τ.v ≥ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ 0) atp : if(m.e − τ.p ≤ SB ∨ rbc.message = emergency) τ.a := −b drive : t := 0; (τ.p′ = τ.v, τ.v′ = τ.a, t′ = 1 ∧ τ.v ≥ 0 ∧ t ≤ ε) rbc : (rbc.message := emergency) ∪ (m := ∗; ?m.r > 0)

Task

Verify safety

Specification

[ETCSskel](τ.p ≥ m.e → τ.v ≤ m.d)

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 8 / 19

slide-26
SLIDE 26

Parametric Skeleton of ETCS

ETCSskel : (train ∪ rbc)∗ train : spd; atp; drive spd : (?τ.v ≤ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ A) ∪(?τ.v ≥ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ 0) atp : if(m.e − τ.p ≤ SB ∨ rbc.message = emergency) τ.a := −b drive : t := 0; (τ.p′ = τ.v, τ.v′ = τ.a, t′ = 1 ∧ τ.v ≥ 0 ∧ t ≤ ε) rbc : (rbc.message := emergency) ∪ (m := ∗; ?m.r > 0)

Task

Verify safety

Specification

[ETCSskel](τ.p ≥ m.e → τ.v ≤ m.d)

Issue

Lots of counterexamples!

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 8 / 19

slide-27
SLIDE 27

Iterative Control Refinement Process

m.d τ.p τ.v m.e

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 9 / 19

slide-28
SLIDE 28

Iterative Control Refinement Process

m.d τ.p τ.v m.e

1 Controllability discovery Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 9 / 19

slide-29
SLIDE 29

Iterative Control Refinement Process

m.d τ.p τ.v m.e

1 Controllability discovery Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 9 / 19

slide-30
SLIDE 30

Iterative Control Refinement Process

m.d τ.p τ.v m.e

1 Controllability discovery Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 9 / 19

slide-31
SLIDE 31

Iterative Control Refinement Process

m.d τ.p τ.v m.e SB

  • 1 Controllability discovery

2 Control refinement Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 9 / 19

slide-32
SLIDE 32

Iterative Control Refinement Process

m.d τ.p τ.v m.e SB

1 Controllability discovery 2 Control refinement Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 9 / 19

slide-33
SLIDE 33

Iterative Control Refinement Process

m.d τ.p τ.v m.e SB

1 Controllability discovery 2 Control refinement Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 9 / 19

slide-34
SLIDE 34

Iterative Control Refinement Process

m.d τ.p τ.v m.e SB Reaction time ε

1 Controllability discovery 2 Control refinement Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 9 / 19

slide-35
SLIDE 35

Iterative Control Refinement Process

m.d τ.p τ.v m.e SB

1 Controllability discovery 2 Control refinement 3 Repeat 2 until safety can be proven Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 9 / 19

slide-36
SLIDE 36

Iterative Control Refinement Process

m.d τ.p τ.v m.e SB

1 Controllability discovery 2 Control refinement 3 Repeat 2 until safety can be proven 4 Liveness check Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 9 / 19

slide-37
SLIDE 37

ETCS Controllability

m.d τ.p τ.v m.e τ.v2 − m.d2 ≤ 2b(m.e − τ.p)

Proposition (Controllability)

[τ.p′ = τ.v, τ.v′ = −b ∧ τ.v ≥ 0](τ.p ≥ m.e → τ.v ≤ m.d) ≡ τ.v2 − m.d2 ≤ 2b(m.e − τ.p) (C)

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 10 / 19

slide-38
SLIDE 38

ETCS RBC Controllability

EOA NEW EOA NEW EOA NEW EOA

  • Proposition (RBC Controllability)

m.d ≥ 0 ∧ b > 0 → [m0 := m; rbc]

  • m0.d2 − m.d2 ≤ 2b(m.e − m0.e) ∧ m0.d ≥ 0 ∧ m.d ≥ 0 ↔

∀τ

  • (m := m0C) → C
  • Andr´

e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 11 / 19

slide-39
SLIDE 39

ETCS Reactivity

m.d τ.p τ.v m.e SB Reaction time ε

Proposition (Reactivity)

  • ∀m.e ∀τ.p
  • m.e − τ.p ≥ SB ∧ C → [τ.a := A; drive] C
  • ≡ SB ≥ τ.v2 − m.d2

2b + A b + 1 A 2 ε2 + ε τ.v

  • Andr´

e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 12 / 19

slide-40
SLIDE 40

Refined ETCS Control

ETCSr: (train ∪ rbc)∗ train : spd; atp; drive spd : (?τ.v ≤ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ A) ∪(?τ.v ≥ m.r; τ.a := ∗; ?0 > τ.a ≥ −b) atp : SB := τ.v2−m.d2

2b

+ A

b + 1

A

2 ε2 + ε τ.v

  • ;

: if(m.e − τ.p ≤ SB ∨ rbc.message = emergency) τ.a := −b drive : t := 0; (τ.p′ = τ.v, τ.v′ = τ.a, t′ = 1 ∧ τ.v ≥ 0 ∧ t ≤ ε) rbc : (rbc.message := emergency) ∪

  • m0 := m; m := ∗;

?m0.d2 − m.d2 ≤ 2b(m.e − m0.e) ∧ m.r ≥ 0 ∧ m.d ≥ 0

  • Andr´

e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 13 / 19

slide-41
SLIDE 41

Refined ETCS Control

ETCSr: (train ∪ rbc)∗ train : spd; atp; drive spd : (?τ.v ≤ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ A) ∪(?τ.v ≥ m.r; τ.a := ∗; ?0 > τ.a ≥ −b) atp : SB := τ.v2−m.d2

2b

+ A

b + 1

A

2 ε2 + ε τ.v

  • ;

: if(m.e − τ.p ≤ SB ∨ rbc.message = emergency) τ.a := −b drive : t := 0; (τ.p′ = τ.v, τ.v′ = τ.a, t′ = 1 ∧ τ.v ≥ 0 ∧ t ≤ ε) rbc : (rbc.message := emergency) ∪

  • m0 := m; m := ∗;

?m0.d2 − m.d2 ≤ 2b(m.e − m0.e) ∧ m.r ≥ 0 ∧ m.d ≥ 0

  • Specification

τ.v2 − m.d2 ≤ 2b(m.e − τ.p) → [ETCSr](τ.p ≥ m.e → τ.v ≤ m.d)

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 13 / 19

slide-42
SLIDE 42

Refined ETCS Control

Necessary for safety ETCSr: (train ∪ rbc)∗ train : spd; atp; drive spd : (?τ.v ≤ m.r; τ.a := ∗; ? − b ≤ τ.a ≤ A) ∪(?τ.v ≥ m.r; τ.a := ∗; ?0 > τ.a ≥ −b) atp : SB := τ.v2−m.d2

2b

+ A

b + 1

A

2 ε2 + ε τ.v

  • ;

: if(m.e − τ.p ≤ SB ∨ rbc.message = emergency) τ.a := −b drive : t := 0; (τ.p′ = τ.v, τ.v′ = τ.a, t′ = 1 ∧ τ.v ≥ 0 ∧ t ≤ ε) rbc : (rbc.message := emergency) ∪

  • m0 := m; m := ∗;

?m0.d2 − m.d2 ≤ 2b(m.e − m0.e) ∧ m.r ≥ 0 ∧ m.d ≥ 0

  • Specification

τ.v2 − m.d2 ≤ 2b(m.e − τ.p) → [ETCSr](τ.p ≥ m.e → τ.v ≤ m.d)

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 13 / 19

slide-43
SLIDE 43

ETCS Safety

EOA

Proposition (Safety)

C → [ETCS](τ.p ≥ m.e → τ.v ≤ m.d)

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 14 / 19

slide-44
SLIDE 44

ETCS Liveness

EOA NEW EOA NEW EOA

Proposition (Liveness)

τ.v ≥ 0 ∧ ε > 0 → ∀P ETCSr τ.p ≥ P

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 15 / 19

slide-45
SLIDE 45

Safety Despite Disturbances

So far: no wind, friction, etc.

Direct control of the acceleration

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 16 / 19

slide-46
SLIDE 46

Safety Despite Disturbances

So far: no wind, friction, etc.

Direct control of the acceleration

Issue

This is unrealistic!

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 16 / 19

slide-47
SLIDE 47

Safety Despite Disturbances

So far: no wind, friction, etc.

Direct control of the acceleration

Issue

This is unrealistic!

Solution

Take disturbances into account.

Theorem

ETCS is controllable, reactive, and safe in the presence of disturbances.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 16 / 19

slide-48
SLIDE 48

Safety Despite Disturbances

So far: no wind, friction, etc.

Direct control of the acceleration

Issue

This is unrealistic!

Solution

Take disturbances into account.

Theorem

ETCS is controllable, reactive, and safe in the presence of disturbances.

m.d τ.p τ.v m.e

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 16 / 19

slide-49
SLIDE 49

Safety Despite Disturbances

So far: no wind, friction, etc.

Direct control of the acceleration

Issue

This is unrealistic!

Solution

Take disturbances into account.

Theorem

ETCS is controllable, reactive, and safe in the presence of disturbances.

Proof sketch

The system now contains τ.a − l ≤ τ.v ′ ≤ τ.a + u instead of τ.v ′ = τ.a. We cannot solve the differential equations anymore. Use differential invariants for approximation. For details see paper.

Platzer, A.: Differential-algebraic dynamic logic for differential-algebraic programs.

  • J. Log. Comput. (2008) DOI 10.1093/logcom/exn070.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 16 / 19

slide-50
SLIDE 50

Realistic Speed Control

So far

Almost completely non-deterministic control.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 17 / 19

slide-51
SLIDE 51

Realistic Speed Control

So far

Almost completely non-deterministic control.

Issue

This is unrealistic!

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 17 / 19

slide-52
SLIDE 52

Realistic Speed Control

So far

Almost completely non-deterministic control.

Issue

This is unrealistic!

Solution

Verify proportional-integral (PI) controllers used in trains.

Truncate

In min max Out1

Step Speed Plant 1 s PI Output Controller

v0−v a

Acceleration A 9 −b −7

v0−v

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 17 / 19

slide-53
SLIDE 53

Realistic Speed Control

So far

Almost completely non-deterministic control.

Issue

This is unrealistic!

Solution

Verify proportional-integral (PI) controllers used in trains.

Truncate

In min max Out1

Step Speed Plant 1 s PI Output Controller

v0−v a

Acceleration A 9 −b −7

v0−v a 1 [1.679 0.0008; 1 0]*u K*u [0.1995 0.000024; 1 0]*u K*u min 1 s v0−v 1 s

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 17 / 19

slide-54
SLIDE 54

Realistic Speed Control

So far

Almost completely non-deterministic control.

Issue

This is unrealistic!

Solution

Verify proportional-integral (PI) controllers used in trains.

Truncate

In min max Out1

Step Speed Plant 1 s PI Output Controller

v0−v a

Acceleration A 9 −b −7

v0−v a 1 K*u 1 s v0−v 1 s

Differential equation system

τ.v ′ = min

  • A, max
  • −b, l(τ.v − m.r) − i s − c m.r
  • ∧ s′ = τ.v − m.r

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 17 / 19

slide-55
SLIDE 55

Realistic Speed Control

So far

Almost completely non-deterministic control.

Issue

This is unrealistic!

Solution

Verify proportional-integral (PI) controllers used in trains.

Theorem

The ETCS system remains safe when speed is controlled by a PI controller.

Proof sketch

Cannot solve differential equations really. Differential invariants are to be used. For details see paper.

Platzer, A.: Differential-algebraic dynamic logic for differential-algebraic programs.

  • J. Log. Comput. (2008) DOI 10.1093/logcom/exn070.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 17 / 19

slide-56
SLIDE 56

Experimental Results (KeYmaera)

Case study Int Time(s) Steps Dim Controllability 1.3 14 5 RBC Controllability 1.7 42 12 RBC Control (characterization) 2.2 42 12 Reactivity (existence) 8 133.4 229 13 Reactivity 86.8 52 14 Safety 249.9 153 14 Liveness 4 27.3 166 7 Inclusion (PI) 19 766.2 301 25 Safety (PI) 16 509.0 183 15 Controllability (disturbed) 5.6 37 7 Reactivity (disturbed) 2 34.6 78 15 Safety (disturbed) 5 389.9 88 16

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 18 / 19

slide-57
SLIDE 57

Summary

m.e ST SB τ.p

Formally verified a major case study with KeYmaera: discovered necessary safety constraints controllability, reactivity, safety and liveness properties Extensions for ETCS with disturbances and for ETCS with PI control

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-58
SLIDE 58

Literature

Platzer, A.: Differential-algebraic dynamic logic for differential-algebraic programs.

  • J. Log. Comput. (2008) DOI 10.1093/logcom/exn070.

Platzer, A., Quesel, J.D.: KeYmaera: A hybrid theorem prover for hybrid systems. In Armando, A., Baumgartner, P., Dowek, G., eds.: IJCAR. Volume 5195 of LNCS., Springer (2008) 171–178 http://symbolaris.com/info/KeYmaera.html. Platzer, A., Quesel, J.D.: European train control system: A case study in formal verification. Report 54, SFB/TR 14 AVACS (2009) ISSN: 1860-9821, avacs.org. Damm, W., Mikschl, A., Oehlerking, J., Olderog, E.R., Pang, J., Platzer, A., Segelken, M., Wirtz, B.: Automating verification of cooperation, control, and design in traffic applications. In Jones, C.B., Liu, Z., Woodcock, J., eds.: Formal Methods and Hybrid

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-59
SLIDE 59

Syntax of Differential Dynamic Logic

dL Formulas

φ ::= θ1 ∼ θ2 | ¬φ | φ ∧ ψ | ∀xφ | ∃xφ | [α]φ | αφ

Hybrid Program | Effect

α; β sequential composition α ∪ β nondeterministic choice α∗ nondeterministic repetition x := θ discrete assignment (jump) x := ∗ nondeterministic assignment

  • x′

1 = θ1, . . . , x′ n = θn, F

  • continuous evolution of xi

?F check if formula F holds

  • A. Platzer.

Differential Dynamic Logic for Hybrid Systems. Journal of Automated Reasoning, 41(2), 2008.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-60
SLIDE 60

Proof Sketch

Init ⊢ [ETCS∗]z ≤ m Init ⊢ Inv Inv ⊢ [ETCS]Inv RBC . . . Train Drive v ≥ vdes m − z ≤ SB m − z > SB v ≤ vdes m − z ≤ SB m − z > SB Brake Inv ⊢ z ≤ m

Example

m − z ≥ A

b + 1

εv + A

2 ε2

+ v2−d2

2b

∧ 0 ≤ a ≤ A ∧ 0 ≤ v ≤ vdes ∧v2 − d2 ≤ 2b(m − z) ∧ d ≥ 0 ∧ ε > 0 ∧ b > 0 ∧ A > 0 ⊢ ∀t ≥ 0 ((∀0 ≤ ˜ t ≤ t (a˜ t + v ≥ 0 ∧ ˜ t ≤ ε)) → (at + v)2 − d2 ≤ 2b(m − ( 1

2at + tv + z)) ∧ at + v ≥ 0 ∧ d ≥ 0)

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-61
SLIDE 61

Proof Sketch

Init ⊢ [ETCS∗]z ≤ m Init ⊢ Inv Inv ⊢ [ETCS]Inv RBC . . . Train Drive v ≥ vdes m − z ≤ SB m − z > SB v ≤ vdes m − z ≤ SB m − z > SB Brake Inv ⊢ z ≤ m

Example

m − z ≥ A

b + 1

εv + A

2 ε2

+ v2−d2

2b

∧ 0 ≤ a ≤ A ∧ 0 ≤ v ≤ vdes ∧v2 − d2 ≤ 2b(m − z) ∧ d ≥ 0 ∧ ε > 0 ∧ b > 0 ∧ A > 0 ⊢ ∀t ≥ 0 ((∀0 ≤ ˜ t ≤ t (a˜ t + v ≥ 0 ∧ ˜ t ≤ ε)) → (at + v)2 − d2 ≤ 2b(m − ( 1

2at + tv + z)) ∧ at + v ≥ 0 ∧ d ≥ 0)

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-62
SLIDE 62

Handling Differential Equations

Example

∀t ≥ 0 [x := y(t)] φ [x′ = f (x)] φ v w φ x′ = f (x) x := y(t) . . . ⊢ [z′ = v, v′ = −b]z ≤ m

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-63
SLIDE 63

Handling Differential Equations

Example

∀t ≥ 0 [x := y(t)] φ [x′ = f (x)] φ v w φ x′ = f (x) x := y(t) . . . ⊢ ∀t ≥ 0 [z := − 1

2bt2 + tv + z]z ≤ m

. . . ⊢ [z′ = v, v′ = −b]z ≤ m

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-64
SLIDE 64

Handling Differential Equations

Example

∀t ≥ 0 [x := y(t)] φ [x′ = f (x)] φ v w φ x′ = f (x) x := y(t) . . . ⊢ ∀t ≥ 0 (− 1

2bt2 + tv + z ≤ m)

. . . ⊢ ∀t ≥ 0 [z := − 1

2bt2 + tv + z]z ≤ m

. . . ⊢ [z′ = v, v′ = −b]z ≤ m

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-65
SLIDE 65

Model/State Variables

Train τ ( )

τ.p Position τ.v Speed τ.a Acceleration (t model time)

RBC + MA

m.e End of Authority m.d Speed limit m.r Recommended speed rbc.message Channel

Parameters

SB Start Braking b Braking power/deceleration A Maximum acceleration ε Maximum cycle time

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-66
SLIDE 66

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide. m.e ST SB τ.p

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-67
SLIDE 67

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide.

Proof.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-68
SLIDE 68

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide.

Proof.

To simplify notation, assume trains are points.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-69
SLIDE 69

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide.

Proof.

To simplify notation, assume trains are points. Consider any point in time ζ.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-70
SLIDE 70

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide.

Proof.

To simplify notation, assume trains are points. Consider any point in time ζ. For n ∈ N, let z1, . . . , zn be positions of all the trains 1 to n at ζ.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-71
SLIDE 71

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide.

Proof.

To simplify notation, assume trains are points. Consider any point in time ζ. For n ∈ N, let z1, . . . , zn be positions of all the trains 1 to n at ζ. Let Mi be the MA-range, i.e., the set of positions on the track for which train i has currently been issued MA.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-72
SLIDE 72

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide.

Proof.

To simplify notation, assume trains are points. Consider any point in time ζ. For n ∈ N, let z1, . . . , zn be positions of all the trains 1 to n at ζ. Let Mi be the MA-range, i.e., the set of positions on the track for which train i has currently been issued MA. Suppose there was a collision at time ζ.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-73
SLIDE 73

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide.

Proof.

To simplify notation, assume trains are points. Consider any point in time ζ. For n ∈ N, let z1, . . . , zn be positions of all the trains 1 to n at ζ. Let Mi be the MA-range, i.e., the set of positions on the track for which train i has currently been issued MA. Suppose there was a collision at time ζ. Then zi = zj at ζ for some i, j ∈ N.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-74
SLIDE 74

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide.

Proof.

To simplify notation, assume trains are points. Consider any point in time ζ. For n ∈ N, let z1, . . . , zn be positions of all the trains 1 to n at ζ. Let Mi be the MA-range, i.e., the set of positions on the track for which train i has currently been issued MA. Suppose there was a collision at time ζ. Then zi = zj at ζ for some i, j ∈ N. However, by assumption, zi ∈ Mi and zj ∈ Mj at ζ, thus Mi ∩ Mj = ∅,

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19

slide-75
SLIDE 75

Separation Principle

Lemma (Principle of separation by movement authorities)

Each train respects its movement authority and the RBC partitions into disjoint movement authorities ⇒ trains can never collide.

Proof.

To simplify notation, assume trains are points. Consider any point in time ζ. For n ∈ N, let z1, . . . , zn be positions of all the trains 1 to n at ζ. Let Mi be the MA-range, i.e., the set of positions on the track for which train i has currently been issued MA. Suppose there was a collision at time ζ. Then zi = zj at ζ for some i, j ∈ N. However, by assumption, zi ∈ Mi and zj ∈ Mj at ζ, thus Mi ∩ Mj = ∅, This contradicts the assumption of disjoint MA.

Andr´ e Platzer, Jan-David Quesel ETCS: A Case Study in Formal Verification ICFEM 2009 19 / 19