Towards Physical Hybrid Systems Katherine Cordwell and Andr Platzer - - PowerPoint PPT Presentation

towards physical hybrid systems
SMART_READER_LITE
LIVE PREVIEW

Towards Physical Hybrid Systems Katherine Cordwell and Andr Platzer - - PowerPoint PPT Presentation

Towards Physical Hybrid Systems Katherine Cordwell and Andr Platzer Carnegie Mellon University August 29, 2019 This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No.


slide-1
SLIDE 1

Towards Physical Hybrid Systems

Katherine Cordwell and André Platzer

Carnegie Mellon University

August 29, 2019

This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-1252522. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation or of any other sponsoring institution. This research was also sponsored by the AFOSR under grant number FA9550-16-1-0288 and by the Alexander von Humboldt Foundation. 1 / 1

slide-2
SLIDE 2

Safety-critical CPS

  • How do we know that cyber-physical systems

(CPS) are functioning correctly?

2 / 1

slide-3
SLIDE 3

Safety-critical CPS

  • How do we know that cyber-physical systems

(CPS) are functioning correctly?

  • First step: model your CPS
  • Hybrid systems model CPS

2 / 1

slide-4
SLIDE 4

Safety-critical CPS

  • How do we know that cyber-physical systems

(CPS) are functioning correctly?

  • First step: model your CPS
  • Hybrid systems model CPS

2 / 1

slide-5
SLIDE 5

Then write hybrid systems in logic...

...with differential dynamic logic, perhaps?

3 / 1

slide-6
SLIDE 6

Then write hybrid systems in logic...

...with differential dynamic logic, perhaps?

3 / 1

slide-7
SLIDE 7

Then write hybrid systems in logic...

...with differential dynamic logic, perhaps?

3 / 1

slide-8
SLIDE 8

Then write hybrid systems in logic...

...with differential dynamic logic, perhaps?

3 / 1

slide-9
SLIDE 9

Then write hybrid systems in logic...

...with differential dynamic logic, perhaps?

3 / 1

slide-10
SLIDE 10

Then write hybrid systems in logic...

...with differential dynamic logic, perhaps?

3 / 1

slide-11
SLIDE 11

Then write hybrid systems in logic...

...with differential dynamic logic, perhaps?

3 / 1

slide-12
SLIDE 12

Problems?

  • The model could be overly permissive

4 / 1

slide-13
SLIDE 13

Problems?

  • The model could be overly permissive
  • Or the model could be overly strict

4 / 1

slide-14
SLIDE 14

Problems?

  • The model could be overly permissive
  • Or the model could be overly strict
  • Logic is precise, physical systems are not
  • Note that we absolutely want to have precise

safety guarantees

4 / 1

slide-15
SLIDE 15

Math versus physics

  • How can models be too strict?

5 / 1

slide-16
SLIDE 16

Math versus physics

  • How can models be too strict?
  • Models can classify systems as being unsafe on

minutely small sets

5 / 1

slide-17
SLIDE 17

Math versus physics

  • How can models be too strict?
  • Models can classify systems as being unsafe on

minutely small sets

  • Is this realistic?

5 / 1

slide-18
SLIDE 18

Math versus physics

  • How can models be too strict?
  • Models can classify systems as being unsafe on

minutely small sets

  • Is this realistic?
  • No! Even math allows more imprecision than

models

5 / 1

slide-19
SLIDE 19

Math versus physics

  • How can models be too strict?
  • Models can classify systems as being unsafe on

minutely small sets

  • Is this realistic?
  • No! Even math allows more imprecision than

models

  • Does it matter?

5 / 1

slide-20
SLIDE 20

Math versus physics

  • How can models be too strict?
  • Models can classify systems as being unsafe on

minutely small sets

  • Is this realistic?
  • No! Even math allows more imprecision than

models

  • Does it matter?
  • Yes! Physically unrealistic counterexamples can

distract from real unsafeties of a system

5 / 1

slide-21
SLIDE 21

Our Approach

  • We propose physical hybrid systems (PHS),

which are systems that behave safely almost everywhere

6 / 1

slide-22
SLIDE 22

Our Approach

  • We propose physical hybrid systems (PHS),

which are systems that behave safely almost everywhere

  • There are multiple ways to develop PHS

6 / 1

slide-23
SLIDE 23

Our Approach

  • We propose physical hybrid systems (PHS),

which are systems that behave safely almost everywhere

  • There are multiple ways to develop PHS
  • Our first foray into PHS stays very close to the

usual notion of safety

6 / 1

slide-24
SLIDE 24

Our Approach

  • We propose physical hybrid systems (PHS),

which are systems that behave safely almost everywhere

  • There are multiple ways to develop PHS
  • Our first foray into PHS stays very close to the

usual notion of safety

6 / 1

slide-25
SLIDE 25

Our Approach

  • We propose physical hybrid systems (PHS),

which are systems that behave safely almost everywhere

  • There are multiple ways to develop PHS
  • Our first foray into PHS stays very close to the

usual notion of safety

6 / 1

slide-26
SLIDE 26

Our Approach

  • We propose physical hybrid systems (PHS),

which are systems that behave safely almost everywhere

  • There are multiple ways to develop PHS
  • Our first foray into PHS stays very close to the

usual notion of safety

  • Our new logic (PdTL) is designed to ignore “very

small”, meaningless sets of safety violations along the execution trace of a system.

6 / 1

slide-27
SLIDE 27

FAQ, anticipated

  • Why not ask the user to edit the models?

7 / 1

slide-28
SLIDE 28

FAQ, anticipated

  • Why not ask the user to edit the models?
  • PdTL is capturing something that is even closer to

the normal notion of safety

  • Also, we don’t want to limit the models that a user

can write

7 / 1

slide-29
SLIDE 29

FAQ, anticipated

  • Why not ask the user to edit the models?
  • PdTL is capturing something that is even closer to

the normal notion of safety

  • Also, we don’t want to limit the models that a user

can write

  • Why isn’t this just solved by robustness?

7 / 1

slide-30
SLIDE 30

Robustness

  • Safe up to small perturbations
  • Tool support, e.g. dReach

8 / 1

slide-31
SLIDE 31

Robustness

  • Safe up to small perturbations
  • Tool support, e.g. dReach
  • Models of CPS can and should be robust

8 / 1

slide-32
SLIDE 32

Robustness

  • But robustness is only one piece of the puzzle.

We’re trying to do something different.

9 / 1

slide-33
SLIDE 33

Robustness

  • But robustness is only one piece of the puzzle.

We’re trying to do something different.

9 / 1

slide-34
SLIDE 34

Robustness

  • But robustness is only one piece of the puzzle.

We’re trying to do something different.

  • Also, robustness often requires a reachability

analysis and can be more limited in scope (no induction!)

9 / 1

slide-35
SLIDE 35

Let’s talk PdTL

  • Physical differential temporal dynamic logic

(PdTL) extends dTL extends dL

  • dTL rigorizes execution traces

10 / 1

slide-36
SLIDE 36

Formulas in dTL (and PdTL!)

  • State formulas
  • Evaluated in a state

(at a snapshot in time)

11 / 1

slide-37
SLIDE 37

Formulas in dTL (and PdTL!)

  • State formulas
  • Evaluated in a state

(at a snapshot in time)

  • States map

variables to R

11 / 1

slide-38
SLIDE 38

Formulas in dTL (and PdTL!)

  • State formulas
  • Evaluated in a state

(at a snapshot in time)

  • States map

variables to R

  • Trace formulas
  • Evaluated along

execution traces (sequences of functions mapping intervals to states)

11 / 1

slide-39
SLIDE 39

Traces in PdTL

12 / 1

slide-40
SLIDE 40

PdTL

  • Trace semantics
  • The same as in dTL, except we allow Carathéodory

solutions to ODEs

13 / 1

slide-41
SLIDE 41

PdTL

  • Trace semantics
  • The same as in dTL, except we allow Carathéodory

solutions to ODEs

  • Formulas
  • The same state formulas as dTL
  • Instead of dTL’s trace formulas, use tae

13 / 1

slide-42
SLIDE 42

PdTL

  • Trace semantics
  • The same as in dTL, except we allow Carathéodory

solutions to ODEs

  • Formulas
  • The same state formulas as dTL
  • Instead of dTL’s trace formulas, use tae
  • Intuitively, σ |

= taeφ means φ holds except at

  • nly a “small” set of positions along the trace

13 / 1

slide-43
SLIDE 43

PdTL

  • Trace semantics
  • The same as in dTL, except we allow Carathéodory

solutions to ODEs

  • Formulas
  • The same state formulas as dTL
  • Instead of dTL’s trace formulas, use tae
  • Intuitively, σ |

= taeφ means φ holds except at

  • nly a “small” set of positions along the trace
  • Measure zero: mathematically rigorous notion of a

very small set

13 / 1

slide-44
SLIDE 44

PdTL

  • How to get a measure on a trace? Map it to R

positions (0, 0), . . . , (0, r0) positions (1, 0), . . . , (1, r1)

σ = (σ0, σ1, . . . , σn) r0 1 + r0 1 + r0 + r1

. . .

n +

n−1

X

k=0

rk n +

n

X

k=0

rk positions (n, 0), . . . , (n, rn)

14 / 1

slide-45
SLIDE 45

PdTL

  • For σ |

= taeφ to hold:

  • Need φ to be satisfied at almost all positions along

the trace (continuous condition)

15 / 1

slide-46
SLIDE 46

PdTL

  • For σ |

= taeφ to hold:

  • Need φ to be satisfied at almost all positions along

the trace (continuous condition)

  • On discrete portions of the trace, need φ to almost

hold (discrete condition)

15 / 1

slide-47
SLIDE 47

PdTL

  • For σ |

= taeφ to hold:

  • Need φ to be satisfied at almost all positions along

the trace (continuous condition)

  • On discrete portions of the trace, need φ to almost

hold (discrete condition)

15 / 1

slide-48
SLIDE 48

Compelling logical properties

  • Conservative extension of dL

16 / 1

slide-49
SLIDE 49

Compelling logical properties

  • Conservative extension of dL
  • A proof calculus that is designed to:
  • Remove instances of tae when possible

[?P]taeφ ↔ φ

16 / 1

slide-50
SLIDE 50

Compelling logical properties

  • Conservative extension of dL
  • A proof calculus that is designed to:
  • Remove instances of tae when possible

[?P]taeφ ↔ φ

  • Reduce complicated formulas to structurally

simpler formulas [α ∪ β]taeφ ↔ [α]taeφ ∧ [β]taeφ

16 / 1

slide-51
SLIDE 51

Compelling logical properties

  • Conservative extension of dL
  • A proof calculus that is designed to:
  • Remove instances of tae when possible

[?P]taeφ ↔ φ

  • Reduce complicated formulas to structurally

simpler formulas [α ∪ β]taeφ ↔ [α]taeφ ∧ [β]taeφ

  • Do induction

φ ⊢ [α]taeφ φ ⊢ [α∗]taeφ

16 / 1

slide-52
SLIDE 52

Compelling logical properties

  • A major challenge: reasoning principles for

ODEs

17 / 1

slide-53
SLIDE 53

Compelling logical properties

  • A major challenge: reasoning principles for

ODEs

  • [x′ = f (x)]taeP ↔ P ∧ ∀t≥0Q

17 / 1

slide-54
SLIDE 54

Compelling logical properties

  • A major challenge: reasoning principles for

ODEs

  • [x′ = f (x)]taeP ↔ P ∧ ∀t≥0Q
  • P and Q are FOL formulas so that:

“for almost all t≥0[x := y(t)]P” ⇐ ⇒ ∀t≥ 0 Q, where y(t) solves the ODE

17 / 1

slide-55
SLIDE 55

Compelling logical properties

  • A major challenge: reasoning principles for

ODEs

  • [x′ = f (x)]taeP ↔ P ∧ ∀t≥0Q
  • P and Q are FOL formulas so that:

“for almost all t≥0[x := y(t)]P” ⇐ ⇒ ∀t≥ 0 Q, where y(t) solves the ODE

  • More complicated ODEs reasoning: a remaining

challenge

17 / 1

slide-56
SLIDE 56

Proof calculus

[?]tae [?P]taeφ ↔ φ Gtae φ [α]taeφ [∪]tae [α ∪ β]taeφ ↔ [α]taeφ ∧ [β]taeφ [:=]tae [x := e]taeφ ↔ φ ∧ [x := e]φ Ktae φ → ψ [α]tae(φ → ψ) [α]taeφ → [α]taeψ [; ]tae [α; β]taeφ ↔ ([α]taeφ ∧ [α][β]taeφ) Itae [α∗]taeφ ↔

  • φ ∧ [α∗](φ → [α]taeφ)
  • TopCL

φ → ψ φ → ψ [′]tae [x′ = f (x)]taeP ↔ P ∧ ∀t≥0Q [′&]tae [x′ = f (x)&R]taeP ↔ P∧ CGG [α]taeφ → [α]φ ∀t>0 ((∀0≤s≤t [x := y(s)]R) → Q)

Here, α and β are hybrid programs, φ and ψ are state formulas, P is a FOL formula, y(t) solves x′ = f (x), and the formula Q in [′]tae and [′&]tae is a FOL formula constructed for P(y(t)) so that “for almost all t≥0[x := y(t)]P” is logically equivalent to “∀t≥0 Q”.

18 / 1

slide-57
SLIDE 57

PdTL works on the train example

  • Model:

a = 0 ∧ v = 0 →[

  • ((?(v<100); a := 1) ∪ (?(v = 100); a := −1));

{x′ = v, v ′ = a & 0≤v≤100} ∗]taev<100

19 / 1

slide-58
SLIDE 58

PdTL works on the train example

  • Model:

a = 0 ∧ v = 0 →[

  • ((?(v<100); a := 1) ∪ (?(v = 100); a := −1));

{x′ = v, v ′ = a & 0≤v≤100} ∗]taev<100

  • Key idea: Remove the loop with looptae, split and

simplify with [; ]tae and dL axioms, handle the ODE with [′&]tae, close with dL reasoning

19 / 1

slide-59
SLIDE 59

PdTL works on the train example

... and other event-triggered controllers

20 / 1

slide-60
SLIDE 60

When else does it work?

  • Start at x = 0 and y = 1, evolve along

x′ = −x, y ′ = −y, require x2 + y 2 < 1

21 / 1

slide-61
SLIDE 61

When else does it work?

  • Start at x = 0 and y = 1, evolve along

x′ = −x, y ′ = −y, require x2 + y 2 < 1

  • Handover point glitch

21 / 1

slide-62
SLIDE 62

When else does it work?

  • Handle glitches in continuous portions of

program

22 / 1

slide-63
SLIDE 63

When else does it work?

  • Handle glitches in continuous portions of

program

  • Two robots moving

22 / 1

slide-64
SLIDE 64

When else does it work?

  • Model this with ¬(a1 ≤ 0 ∧ a2 ≥ 0)

22 / 1

slide-65
SLIDE 65

When else does it work?

  • Model this with ¬(a1 ≤ 0 ∧ a2 ≥ 0)
  • This is a small mistake. We should allow

a1 = 0 ∧ a2 = 0

22 / 1

slide-66
SLIDE 66

When else does it work?

  • Postcondition ¬(a1 ≤ 0 ∧ a2 ≥ 0)
  • Controller a1 := −1; a2 := −1; {a′

1 = 1, a′ 2 = 1}

23 / 1

slide-67
SLIDE 67

When else does it work?

  • Postcondition ¬(a1 ≤ 0 ∧ a2 ≥ 0)
  • Controller a1 := −1; a2 := −1; {a′

1 = 1, a′ 2 = 1}

  • This is tae safe (but not safe everywhere)

23 / 1

slide-68
SLIDE 68

When else does it work?

  • Postcondition ¬(a1 ≤ 0 ∧ a2 ≥ 0)
  • Controller a1 := −1; a2 := −1; {a′

1 = 1, a′ 2 = 1}

  • This is tae safe (but not safe everywhere)
  • a1 := −1; a2 := −1; {a′

1 = 1, a′ 2 = 2} is not tae

safe

23 / 1

slide-69
SLIDE 69

Conclusion

  • PdTL formalizes the notion of safety “almost

everywhere in time”

24 / 1

slide-70
SLIDE 70

Conclusion

  • PdTL formalizes the notion of safety “almost

everywhere in time”

  • Next up. . . more relaxed notions of PHS?

24 / 1

slide-71
SLIDE 71

Questions?

Thank you!

25 / 1