1
Sarah M. Loos and André Platzer Computer Science Department Carnegie Mellon University
Verified Cyber-Physical Systems [FM11] 2 Verified Cyber-Physical - - PowerPoint PPT Presentation
Differential Refinement Logic Sarah M. Loos and Andr Platzer Computer Science Department Carnegie Mellon University 1 Verified Cyber-Physical Systems [FM11] 2 Verified Cyber-Physical Systems x l x j p x k x i
1
Sarah M. Loos and André Platzer Computer Science Department Carnegie Mellon University
2
[FM11]
3
[FM11, HSCC13]
xi xj p xk xl xm
4
[FM11, ITSC11, ICCPS12, HSCC13, ITSC13]
xi xj p xk xl xm
5
Time-triggered vs. Event-triggered Verified Car Control
Proof Calculus
6
Time-triggered vs. Event-triggered Verified Car Control
Proof Calculus
7
8
9
10
11
12
13
Syntax of a dRL formula:
φ, ψ ::= θ1 θ2 | ¬φ | φ ^ ψ | 8xφ FOLR
14
Syntax of a dRL formula:
φ, ψ ::= θ1 θ2 | ¬φ | φ ^ ψ | 8xφ φ | [α]φ | hαiφ
15
Syntax of a dRL formula:
φ, ψ ::= θ1 θ2 | ¬φ | φ ^ ψ | 8xφ φ | [α]φ | hαiφ φ | α β + refinement
16
Syntax of a dRL formula: Syntax of a hybrid program:
φ, ψ ::= θ1 θ2 | ¬φ | φ ^ ψ | 8xφ φ | [α]φ | hαiφ φ | α β
17
Syntax of a dRL formula: Syntax of a hybrid program:
φ, ψ ::= θ1 θ2 | ¬φ | φ ^ ψ | 8xφ φ | [α]φ | hαiφ φ | α β ψ | α ∪ β | α; β | α⇤ α, β ::= x := θ | x0 = θ & ψ | ?ψ
18
Syntax of a dRL formula: Syntax of a hybrid program:
φ, ψ ::= θ1 θ2 | ¬φ | φ ^ ψ | 8xφ φ | [α]φ | hαiφ φ | α β ψ | α ∪ β | α; β | α⇤ α, β ::= x := θ | x0 = θ & ψ | ?ψ
dRL extends by adding refinement directly into the grammar of formulas
19
Hybrid P Programs model cyber-physical systems
α
then following transitions of , state can be reached.
[Platzer08]
20
[Platzer08]
ρ(x := θ) =
iff except for the value of
v = w ρ(x
21
[Platzer08]
ρ(x := θ) =
iff except for the value of
v = w ρ(x
?ψ
Iff holds in state
| = ψ
22
[Platzer08]
ρ(x := θ) =
iff except for the value of
v = w ρ(x
?ψ
Iff holds in state
| = ψ
x0 = θ
x := y(t)
If solves
y(t) x0 = θ
23
[Platzer08]
ρ(x := θ) =
iff except for the value of
v = w ρ(x
?ψ
Iff holds in state
| = ψ
x0 = θ
x := y(t)
If solves
y(t) x0 = θ
u α β α; β
24
[Platzer08]
ρ(x := θ) =
iff except for the value of
v = w ρ(x
?ψ
Iff holds in state
| = ψ
x0 = θ
x := y(t)
If solves
y(t) x0 = θ
u α β α; β
25
v | = [α]φ
Box Modality:
26
w1 w2 w3 v | = [α]φ
Box Modality:
φ φ
α α
27
Refinement Relation:
v | = α ≤ β
28
w1 w2 w3
Refinement Relation:
v | = α ≤ β
α α
29
w1 w2 w3
Refinement Relation:
v | = α ≤ β ≤ β ≤ β ≤ β
α α
30
w1 w2 w3
Refinement Relation:
v | = α ≤ β ≤ β ≤ β ≤ β
α α
31
Time-triggered vs. Event-triggered Verified Car Control
Proof Calculus
32
Time-triggered vs. Event-triggered Verified Car Control
Proof Calculus
33
34
v | = G, v 6| = D for all G ∈ Γ, D ∈ ∆
35
w1 w2 w3
v | = G, v 6| = D for all G ∈ Γ, D ∈ ∆
α α
36
w1 w2 w3 ≤ β ≤ β ≤ β
v | = G, v 6| = D for all G ∈ Γ, D ∈ ∆
α α
37
w1 w2 w3 ≤ β ≤ β ≤ β
v | = G, v 6| = D for all G ∈ Γ, D ∈ ∆
α α
38
w1 w2 w3 ≤ β ≤ β ≤ β
φ φ φ v | = G, v 6| = D for all G ∈ Γ, D ∈ ∆
α α
39
w1 w2 w3 ≤ β ≤ β ≤ β φ φ
v | = G, v 6| = D for all G ∈ Γ, D ∈ ∆ φ
α α
40
α1; β1
41
α1; β1
hi α2; β2?
42
α1; β1
43
u
α1; β1 α1 β1
44
u
α1; β1 α1 β1 α2
45
u
α1; β1 α1 β1 α2 β2?
46
u
α1; β1 α1 β1 α2 β2
47
u
α1; β1 α1 β1 α2 β2
48
u
α1; β1 α1 β1 α2 β2
49
u
α1; β1 α1 β1 α2 β2
hi α2; β2
50
51
52
53
54
55
0.0 0.5 1.0
0.0 0.5 1.0
0.0 0.5 1.0
0.0 0.5 1.0
56
0.0 0.5 1.0
0.0 0.5 1.0
0.0 0.5 1.0
0.0 0.5 1.0
0.0 0.5 1.0
0.0 0.5 1.0
0.0 0.5 1.0
0.0 0.5 1.0
57
0.0 0.5 1.0
0.0 0.5 1.0
0.0 0.5 1.0
0.0 0.5 1.0
58
Time-triggered vs. Event-triggered Verified Car Control
Proof Calculus
59
Time-triggered vs. Event-triggered Verified Car Control
Proof Calculus
60
Discrete sensing
Continuous sensing
61
Discrete sensing
Continuous sensing
62
Discrete sensing Realistic, easy to implement Difficult to design controllers Challenging to verify
Continuous sensing Unrealistic, hard to implement Easier to design controllers Easier to verify
63
Discrete sensing Realistic, easy to implement Difficult to design controllers Challenging to verify
Continuous sensing Unrealistic, hard to implement Easier to design controllers Easier to verify
64
Time-triggered vs. Event-triggered Verified Car Control
Proof Calculus
65
Time-triggered vs. Event-triggered Verified Car Control
Proof Calculus
66
Time-triggered [FM11] Event-triggered
Controllers satisfy refinement “Brake” for epsilon time “Accelerate” for epsilon time
Time-triggered (dRL)
67
Maintains a modular and hierarchical proof structure Abstracts implementation-specific designs Leverages iterative system design Prove time-triggered model refines event-triggered Encouraging evidence of reduced user interaction and
computation time
68
69
We have proved that the refinement relation can be embedded in dL. As a result, dL and dRL are equivalent in terms of expressibility and provability.
However, we can analyze dRL on familiar (challenging) case
70
[Platzer08]
ρ(x := θ) = ) = {(v, w) : w = v except [[x]]w = [[θ]]v}
ρ(x := θ) =
iff except for the value of
v = w ρ(x
?ψ
Iff holds in state
| = ψ
x0 = θ
x := y(t)
ρ(x0 = θ) = {(ϕ(0), ϕ(t)) : ϕ(s) | = x0 = θ for all 0 ≤ s ≤ t}
ρ(?ψ) = ) = {(v, v) : v | = ψ}
If solves
y(t) x0 = θ
71
[Platzer08]
u α β α; β ρ(α; β) = {(v, w) : (v, u) ∈ ρ(α), ( ), (u, w) ∈ ρ(β)}
72
73
74
ρ(x := θ) = vJθKv
x
x
75
x := ∗
ρ(x := θ) = vJθKv
x
x
x
x
x := ∗ hi x : = ∗ h i
x
x
76
x := ∗
ρ(x := θ) = vJθKv
x
x
x
x
x := ∗ hi x : = ∗ h i
x
x
77
α
α
α
78
α
α
α β
79
α
α
α β β?
80
α
α
α β β?
81
α
α
α β β
82
α
α
α β β β?
83
α
α
α β β β?
84
α
α
α β β β
85
α
α
α β β β β∗
86
87
w1 w2 w3 w4 β α α
88
w1 w2 w3 w4 β α α
89
w1 w2 w3 w4 β α α
90
w1 w2 w3 w4 β α α γ?
91
w1 w2 w3 w4 β α α γ?
92
w1 w2 w3 w4 β α α γ
93
w1 w2 w3 w4 β α α γ γ?
94
w1 w2 w3 w4 β α α γ γ?
95
w1 w2 w3 w4 β α α γ γ?
96
w1 w2 w3 w4 β α α γ γ
97
w1 w2 w3 w4 β α α γ γ γ …
98
w1 w2 w3 w4 β α α γ γ γ γ …
99
β
w1
w2 w3 w4 α α
100
β γ γ
γ w1 w2 w3 w4 γ
α α
101
102
∗
103
H(x) ^ I ` [event∗]φ H(x) ^ I ` time∗ event∗ H(x) ^ I ` [time∗]φ ([])
104
H(x) ^ I ` [event∗]φ H(x) ^ I ` time∗ event∗ H(x) ^ I ` [time∗]φ ([])
✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
105
H(x) ^ I ` [event∗]φ H(x) ^ I ` time∗ event∗ H(x) ^ I ` [time∗]φ ([])
✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
106
Time-triggered is safe Event-triggered is safe
^ ` H(x) ^ I ` [time∗]φ
Controllers satisfy refinement
` Safeε ! Safe
“Braking” is safe for time “Accelerating” is safe for time
Safeε(Sa(0)) ^ 0 t ε ` H(Sa(t)) ε ε
H(Sc(0)) ^ 0 t ε ` H(Sc(t))
H(x) ^ I ` [event∗]φ H(x) ^ I ` time∗ event∗ H(x) ^ I ` [time∗]φ ([])
✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
107
Time-triggered is safe Event-triggered is safe
^ ` H(x) ^ I ` [time∗]φ
Controllers satisfy refinement
` Safeε ! Safe
“Braking” is safe for time “Accelerating” is safe for time
Safeε(Sa(0)) ^ 0 t ε ` H(Sa(t)) ε ε
dL
H(Sc(0)) ^ 0 t ε ` H(Sc(t))
108
Time-triggered is safe
^ ` H(x) ^ I ` [time∗]φ
Controllers satisfy refinement
` Safeε ! Safe
“Braking” is safe for time “Accelerating” is safe for time
Safeε(Sa(0)) ^ 0 t ε ` H(Sa(t)) ε ε
FOLR FOLR
Event-triggered is safe
dL
H(Sc(0)) ^ 0 t ε ` H(Sc(t))
FOLR
109
Reflexive: Transitive: Antisymmetric:
110
111
112
113
?ψ
Iff holds in state
| = ψ
ρ(?ψ) = ) = {(v, v) : v | = ψ}
114
x0 = θ
x := y(t)
ρ(x0 = θ) = {(ϕ(0), ϕ(t)) : ϕ(s) | = x0 = θ for all 0 ≤ s ≤ t}
If solves
y(t) x0 = θ
115
x0 = θ
x := y(t)
116
[Kozen97]
Kleene algebra with tests is a system for
manipulating programs that are equivalent.
KAT doesn’t have continuous dynamics, but we can
see that it is still relevant to hybrid programs
117
118
119
Designing proof search heuristics that exploit
refinement to automatically create more hierarchical proof structures.
Shifting the proof responsibility completely to
determining refinement.
Code synthesis – verifying that refinement relation is
satisfied with each transformation step.
120
Continuous sensing Unrealistic, hard to implement Easier to design controllers Easier to verify Discrete sensing Realistic, easy to implement Difficult to design controllers Challenging to verify
discrete controller continuous dynamics
121
Continuous sensing Unrealistic, hard to implement Easier to design controllers Easier to verify Discrete sensing Realistic, easy to implement Difficult to design controllers Challenging to verify
discrete controller continuous dynamics
122
Continuous sensing Unrealistic, hard to implement Easier to design controllers Easier to verify Discrete sensing Realistic, easy to implement Difficult to design controllers Challenging to verify
discrete controller continuous dynamics
123
Continuous sensing Unrealistic, hard to implement Easier to design controllers Easier to verify Discrete sensing Realistic, easy to implement Difficult to design controllers Challenging to verify
discrete controller ?
124
Continuous sensing Unrealistic, hard to implement Easier to design controllers Easier to verify Discrete sensing Realistic, easy to implement Difficult to design controllers Challenging to verify
discrete controller ?
125
Continuous sensing Unrealistic, hard to implement Easier to design controllers Easier to verify Discrete sensing Realistic, easy to implement Difficult to design controllers Challenging to verify
126
Continuous sensing Unrealistic, hard to implement Easier to design controllers Easier to verify Discrete sensing Realistic, easy to implement Difficult to design controllers Challenging to verify
127
Continuous sensing Discrete sensing
128
Continuous sensing Discrete sensing
& x + v2 2B ≤ S)
129
Continuous sensing Discrete sensing
& x + v2 2B ≤ S)
& t ≤ ε)
130
Continuous sensing Discrete sensing
& x + v2 2B ≤ S)
& t ≤ ε)
131
Continuous sensing Discrete sensing
& x + v2 2B ≤ S)
& t ≤ ε)
132
event-triggered time-triggered
; x0 = θ & E(x))⇤ ((?Safe; a := ∗) ∪ a := c; ; x0 = θ & t ≤ ε)⇤ ((?Safeε; a := ∗) ∪ a := c;
133
134
135
Low packet loss, small margin for error.
136
Low packet loss, small margin for error. High packet loss, large margin for error.
137
1 2 3 4 5 6 7 8 9 10 0.4 0.5 0.6 0.7 0.8 0.9 1
Timeout T (seconds) Efficiency Controller efficiency Effa f Reception probability Effre c Overall effiency Eff
Eff(T ) =
Effassist(T ) = Effaf (T ) =
138
8i 6= j : A
A kx(i) x(j)k p
To Prove:
Safe separation of aircraft.
xHiL xHjL p H L
xHiL xHiL xHiL xHjL p H L
dHiL dHjL p
xHiL xHiL
8i 6= j : A
8 6 kd(i) d(j)k 2r + p
8i : A
8 kx(i) d(i)k r
139
140
[:=] [x := θ]φ(x) ↔ φ(θ)
[Platzer08]
141
Time-triggered vs. Event-triggered
event∗ time∗
Verified Car Control
Iterative System Design
?Event ?Time
x := ∗; x := ∗; x := θ
142
Time-triggered vs. Event-triggered
event∗ time∗
Verified Car Control
Iterative System Design
?Event ?Time
x := ∗; x := ∗; x := θ
143
144
! + Ki(z) + Kd(vl − vf) ≡ af := Kp (xl − xf) − ⇣v2 2b − v2 2b + (A b + 1)(A 2 ε2 + εv) ⌘!
145
af := θ
146
147
148
Time-triggered vs. Event-triggered
event∗ time∗
Verified Car Control
Iterative System Design
?Event ?Time
x := ∗; x := ∗; x := θ
149
150
Sensor limits on aircraft are local.
151
Sensor limits on aircraft are local.
152
Sensor limits on aircraft are local.
153
Sensor limits on aircraft are local. Sometimes a maneuver may look safe locally…
154
Sometimes a maneuver may look safe locally…
Sensor limits on aircraft are local.
155 But is a terrible idea when implemented globally.
Sometimes a maneuver may look safe locally…
Sensor limits on aircraft are local.
156 But is a terrible idea when implemented globally.
Sometimes a maneuver may look safe locally…
Sensor limits on aircraft are local.
157 But is a terrible idea when implemented globally.
Sometimes a maneuver may look safe locally…
Sensor limits on aircraft are local.
158 But is a terrible idea when implemented globally.
Sometimes a maneuver may look safe locally…
Sensor limits on aircraft are local.
159
distance greater than p.
at any time.
Requireme ment nts
Assumptions ns
160
2 4 6 8 10 t 0.2 0.4 0.6 0.8 1.0
d
2 4 6 8 10 t 1 2 3
p
2 4 6 8 10 t 0.2 0.1 0.1 0.2 0.3 0.4 0.5
Ω
d2
d1 P1 P2
1 2 3 4 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5
P2 P1
Aircraft are controlled by steering, through discrete changes in angular velocity .
0.5
Ω
161
disc before completing avoidance maneuver.
2
m i n r
i n r
xi disci
[LoosRP13]
162
2
m i n r
i n r
xi disci
163
2
m i n r
i n r
xi disci
164
2
m i n r
i n r
xi disci
165
2
m i n r
i n r
xi disci
Dubins Model for 2D motion [Dubins57]
h h
166
2
m i n r
i n r
xi disci
The disc does not move when in a collision avoidance maneuver
h h
167
2
m i n r
i n r
xi disci
All aircraft evolve simultaneously
h h
168
2
m i n r
i n r
xi disci
h h
169
2
m i n r
i n r
xi disci
h
170
2
m i n r
i n r
xi disci
control can engage CA maneuver.
remain within disc
171
2
m i n r
i n r
xi disci
172
2
m i n r
i n r
xi disci
h
173
do so.
xi xj p xk xl xm
[PallottinoSBF07, LoosRP13]
174
xi xj p xk xl xm
175
xi xj p xk xl xm h
176
Cha halle lleng nges Cont ntributions ns
CPS needs verification Infinite, continuous, and
evolving state space,
Continuous dynamics Discrete control
decisions
Distributed dynamics Arbitrary number of
aircraft
Emergent behaviors
Theorem proving is
powerful for verifying distributed dynamics
Non-linear flight paths and
flyable maneuvers
Compositionality – using
small problems to solve the big ones
Hierarchical proofs Undergraduates can
understand and verify hybrid systems!
m i n r
i n r
xi disci xi xj p xk xl xm
R∞
177
178
Sarah M. Loos, David Renshaw, and André Platzer. Formal Verification of Distributed Aircraft
(HSCC), 2013. André Platzer and Jan-David Quesel. KeYmaera: A hybrid theorem prover for hybrid systems. In Alessandro Armando, Peter Baumgartner, and Gilles Dowek, editors, IJCAR, volume 5195 of LNCS, pages 171-178. Springer, 2008 Platzer, André. "Differential dynamic logic for hybrid systems." Journal of Automated Reasoning 41.2 (2008): 143-189. Nikos Aréchiga, Sarah M. Loos, André Platzer, and Bruce H. Krogh. Using theorem provers to guarantee closed-loop system properties. In the American Control Conference, ACC, Montréal, Canada, 2012. Stefan Mitsch, Sarah M. Loos, and André Platzer. Towards Formal Verification of Freeway Traffic
Lucia Pallottino, Vincenzo Giovanni Scordio, Antonio Bicchi, and Emilio Frazzoli. "Decentralized cooperative policy for conflict resolution in multivehicle systems." Robotics, IEEE Transactions on 23, no. 6, pages 1170-1183, 2007.
179
Akshay Rajhans, Ajinkya Bhave, Sarah M. Loos, Bruce H. Krogh, André Platzer, and David Garlan. Using parameters in architectural views to support heterogeneous design and verification. In the IEEE Conference on Decision and Control and European Control Conference. 2011. Sarah M. Loos and André Platzer. Safe Intersections: At the Crossing of Hybrid Systems and
Washington, D.C., USA, Proceedings, 2011. David Renshaw, Sarah M. Loos, and André Platzer. Distributed theorem proving for distributed hybrid
Kingdom, Proceedings, LNCS. Springer, 2011. Sarah M. Loos, André Platzer, and Ligia Nistor. Adaptive cruise control: Hybrid, distributed, and now formally verified. In the 17th International Symposium on Formal Methods, FM, Limerick, Ireland, Proceedings, LNCS. Springer, 2011. André Platzer. Quantified differential dynamic logic for distributed hybrid systems. In Computer Science
Dubins, L.E. On curves of minimal length with a constraint on average curvature, and with prescribed initial and terminal positions and tangents. Am J Math 79(3), pages 497–516, 1957.