Logical Foundations of Cyber-Physical Systems Andr Platzer Andr - - PowerPoint PPT Presentation

logical foundations of cyber physical systems
SMART_READER_LITE
LIVE PREVIEW

Logical Foundations of Cyber-Physical Systems Andr Platzer Andr - - PowerPoint PPT Presentation

08: Events & Responses Logical Foundations of Cyber-Physical Systems Andr Platzer Logical Foundations of Cyber-Physical Systems Andr Platzer Andr Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 1 / 20 Outline Learning


slide-1
SLIDE 1

08: Events & Responses

Logical Foundations of Cyber-Physical Systems

Logical Foundations of Cyber-Physical Systems

André Platzer

André Platzer

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 1 / 20

slide-2
SLIDE 2

Outline

1

Learning Objectives

2

The Need for Control Events in Control Cartesian Demon Event Detection

3

Event-Triggered Control Evolution Domains Detect Events Non-negotiability of Physics Dividing Up the World Event Firing Physics vs. Control Event-Triggered Verification

4

Summary

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 2 / 20

slide-3
SLIDE 3

Outline

1

Learning Objectives

2

The Need for Control Events in Control Cartesian Demon Event Detection

3

Event-Triggered Control Evolution Domains Detect Events Non-negotiability of Physics Dividing Up the World Event Firing Physics vs. Control Event-Triggered Verification

4

Summary

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 2 / 20

slide-4
SLIDE 4

Learning Objectives

Events & Responses

CT M&C CPS using loop invariants design event-triggered control modeling CPS event-triggered control continuous sensing feedback mechanisms control vs. physics semantics of event-triggered control

  • perational effects

model-predictive control

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 3 / 20

slide-5
SLIDE 5

Outline

1

Learning Objectives

2

The Need for Control Events in Control Cartesian Demon Event Detection

3

Event-Triggered Control Evolution Domains Detect Events Non-negotiability of Physics Dividing Up the World Event Firing Physics vs. Control Event-Triggered Verification

4

Summary

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 3 / 20

slide-6
SLIDE 6

Quantum the Safely Bored Bouncing Ball

Proposition (Quantum can bounce around safely)

0 ≤ x ∧ x = H ∧ v = 0∧ g > 0∧ 1 ≥ c ≥ 0 →

[

  • {x′ = v,v′ = −g &x ≥ 0};(?x=0;v :=−cv ∪?x=0)

∗](0 ≤ x ∧ x ≤ H)

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 4 / 20

slide-7
SLIDE 7

Quantum the Safely Bored Bouncing Ball

Proposition (Quantum can bounce around safely)

0 ≤ x ∧ x = H ∧ v = 0∧ g > 0∧ 1 = c →

[

  • {x′ = v,v′ = −g &x ≥ 0};(?x=0;v :=−cv ∪?x=0)

∗](0 ≤ x ∧ x ≤ H)

Proof @invariant(2gx = 2gH − v2 ∧ x ≥ 0) Can be improved. . .

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 4 / 20

slide-8
SLIDE 8

Quantum the Safely Bored Bouncing Ball

Proposition (Quantum can bounce around safely)

0 ≤ x ∧ x = H ∧ v = 0∧ g > 0∧ 1 ≥ c ≥ 0 →

[

  • {x′ = v,v′ = −g &x ≥ 0};(?x=0;v :=−cv ∪?x=0)

∗](0 ≤ x ∧ x ≤ H)

Can be improved. . .

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 4 / 20

slide-9
SLIDE 9

Quantum the Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • {x′ = v,v′ = −g &x ≥ 0};

(?x=0;v :=−cv ∪?x=0) ∗ (0≤x≤5)

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 5 / 20

slide-10
SLIDE 10

Quantum the Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • {x′ = v,v′ = −g &x ≥ 0};

(?x=0;v :=−cv ∪?4≤x≤5;v :=−fv ∪?x=0) ∗ (0≤x≤5)

Proof? Ask René Descartes

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 5 / 20

slide-11
SLIDE 11

Cartesian Doubt: Descartes’s Cartesian Demon 1641

Outwit the Cartesian Demon

Skeptical about the truth of all beliefs until justification has been found.

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 6 / 20

slide-12
SLIDE 12

Quantum the Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • {x′ = v,v′ = −g &x ≥ 0};

(?x=0;v :=−cv ∪?4≤x≤5;v :=−fv ∪?x=0) ∗ (0≤x≤5)

Proof? Ask René Descartes

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 7 / 20

slide-13
SLIDE 13

Quantum the Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • {x′ = v,v′ = −g &x ≥ 0};

(?x=0;v :=−cv ∪?4≤x≤5;v :=−fv ∪?x=0) ∗ (0≤x≤5)

Proof? Ask René Descartes who says no! Could run instead of control

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 7 / 20

slide-14
SLIDE 14

Quantum the Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • {x′ = v,v′ = −g &x ≥ 0};

(?x=0;v :=−cv ∪?4≤x≤5;v :=−fv ∪?x=0∧x<4∨x>5) ∗ (0≤x≤5)

Proof? Ask René Descartes who says no! No bounce nor event

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 7 / 20

slide-15
SLIDE 15

Quantum the Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • {x′ = v,v′ = −g &x ≥ 0};

(?x=0;v :=−cv ∪?4≤x≤5;v :=−fv ∪?x=0∧x<4∨x>5) ∗ (0≤x≤5)

Proof? Ask René Descartes who says no! Could miss this event

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 7 / 20

slide-16
SLIDE 16

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes Rewrite as if-then-else

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 8 / 20

slide-17
SLIDE 17

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who says no!

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 8 / 20

slide-18
SLIDE 18

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who says no! Could also miss if-then event

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 8 / 20

slide-19
SLIDE 19

Outline

1

Learning Objectives

2

The Need for Control Events in Control Cartesian Demon Event Detection

3

Event-Triggered Control Evolution Domains Detect Events Non-negotiability of Physics Dividing Up the World Event Firing Physics vs. Control Event-Triggered Verification

4

Summary

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 8 / 20

slide-20
SLIDE 20

Evolution Domains Detect Events

Evolution domains detect events x′ = f(x)&Q Evolution domain Q of a differential equation is responsible for detecting

  • events. Q can stop physics whenever an event happens on which the

control wants to take action. t x Q w u r x′ = f(x) & Q

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 9 / 20

slide-21
SLIDE 21

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who says no! Could also miss if-then event

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 10 / 20

slide-22
SLIDE 22

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ 4≤x≤5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who says no! Domain as event trap?

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 10 / 20

slide-23
SLIDE 23

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ 4≤x≤5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who says no! Broken physics: Always event

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 10 / 20

slide-24
SLIDE 24

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ 4≤x≤5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who says no! Broken physics: Always event = Zero-crossing

≥ Zero-event

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 10 / 20

slide-25
SLIDE 25

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes Limiting constraint

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 10 / 20

slide-26
SLIDE 26

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes May miss 4 but not 5

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 10 / 20

slide-27
SLIDE 27

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who says yes! May miss 4 but not 5

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 10 / 20

slide-28
SLIDE 28

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who says yes! But meant to say no! Domain by construction

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 10 / 20

slide-29
SLIDE 29

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who says yes! But meant to say no! Non-negotiable physics

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 10 / 20

slide-30
SLIDE 30

On the Nuisance of Nuances of Physics

Non-negotiability of Physics

1

Making systems safe by construction is a great idea. For control!

2

But not by changing the laws of physics.

3

Physics is unpleasantly non-negotiable.

4

If models are safe because we forgot to include all behavior of physical reality, then correctness statements only hold in that other universe. Despite control We don’t get to boss physics around

We don’t make this world any safer by writing CPS programs for another universe.

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 11 / 20

slide-31
SLIDE 31

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who says yes! But meant to say no! Can’t stop the world for an event

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 12 / 20

slide-32
SLIDE 32

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x>5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes Can split the world for an event

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 12 / 20

slide-33
SLIDE 33

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x>5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes Disjoint domains Shattered the world

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 12 / 20

slide-34
SLIDE 34

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes Glue domains Reunite the world

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 13 / 20

slide-35
SLIDE 35

Connected Evolution Domains

Connected evolution domains

1

Evolution domain constraints need care.

2

Determine regions within which the system can evolve.

3

Disconnected/disjoint disallows continuous transitions.

1

Splitting the state space into different regions to detect events is fine.

2

Destroying the world is not.

3

Not even by poking infinitesimal holes into the time-space continuum.

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 14 / 20

slide-36
SLIDE 36

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 15 / 20

slide-37
SLIDE 37

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes Multi-fire

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 15 / 20

slide-38
SLIDE 38

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes Multi-fire

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 15 / 20

slide-39
SLIDE 39

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes who definitely says no! Multi-fire

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 15 / 20

slide-40
SLIDE 40

Quantum the Deterministically Daring Ping-Pong Ball

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

Proof? Ask René Descartes Only upsense event

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 15 / 20

slide-41
SLIDE 41

Multi-firing Events

Multi-firing of events

1

If the same event is detected multiple times:

2

Are multiple responses acceptable?

3

Or is a single response crucial?

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 16 / 20

slide-42
SLIDE 42

Physics vs. Control: Classification

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

control: robust, all cases physics: precise

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 17 / 20

slide-43
SLIDE 43

Physics vs. Control: Classification

Conjecture (Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

control: robust, all cases physics: precise

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 17 / 20

slide-44
SLIDE 44

Quantum’s Ping-Pong Proof Invariants

Proposition ( Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 18 / 20

slide-45
SLIDE 45

Quantum’s Ping-Pong Proof Invariants

Proposition ( Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

Loop invariant j(x,v):

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 18 / 20

slide-46
SLIDE 46

Quantum’s Ping-Pong Proof Invariants

Proposition ( Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

Loop invariant j(x,v):

1

0≤x≤5

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 18 / 20

slide-47
SLIDE 47

Quantum’s Ping-Pong Proof Invariants

Proposition ( Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

Loop invariant j(x,v):

1

0≤x≤5 not inductive

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 18 / 20

slide-48
SLIDE 48

Quantum’s Ping-Pong Proof Invariants

Proposition ( Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

Loop invariant j(x,v):

1

0≤x≤5 not inductive

2

0≤x≤5∧v≤0

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 18 / 20

slide-49
SLIDE 49

Quantum’s Ping-Pong Proof Invariants

Proposition ( Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

Loop invariant j(x,v):

1

0≤x≤5 not inductive

2

0≤x≤5∧v≤0 not inductive

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 18 / 20

slide-50
SLIDE 50

Quantum’s Ping-Pong Proof Invariants

Proposition ( Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

Loop invariant j(x,v):

1

0≤x≤5 not inductive

2

0≤x≤5∧v≤0 not inductive

3

0≤x≤5∧(x=5→v≤0)

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 18 / 20

slide-51
SLIDE 51

Quantum’s Ping-Pong Proof Invariants

Proposition ( Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

Proof @invariant(0≤x≤5∧(x = 5 → v≤0)) Loop invariant j(x,v):

1

0≤x≤5 not inductive

2

0≤x≤5∧v≤0 not inductive

3

0≤x≤5∧(x=5→v≤0) yes!

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 18 / 20

slide-52
SLIDE 52

Quantum’s Ping-Pong Proof Invariants

Proposition ( Quantum can play ping-pong safely)

0 ≤ x ∧ x ≤ 5∧ v ≤ 0∧ g > 0∧ 1 ≥ c ≥ 0∧ f ≥ 0 →

  • ({x′ = v,v′ = −g &x ≥ 0∧ x≤5}∪{x′ = v,v′ = −g &x≥5});

if(x=0)v :=−cv elseif(4≤x≤5∧v≥0)v :=−fv

∗ (0≤x≤5)

Proof @invariant(0≤x≤5∧(x = 5 → v≤0)) Loop invariant j(x,v):

1

0≤x≤5 not inductive

2

0≤x≤5∧v≤0 not inductive

3

0≤x≤5∧(x=5→v≤0) yes! Just can’t implement . . .

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 18 / 20

slide-53
SLIDE 53

Outline

1

Learning Objectives

2

The Need for Control Events in Control Cartesian Demon Event Detection

3

Event-Triggered Control Evolution Domains Detect Events Non-negotiability of Physics Dividing Up the World Event Firing Physics vs. Control Event-Triggered Verification

4

Summary

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 18 / 20

slide-54
SLIDE 54

Summary: Event-triggered Control

1

One important principle for designing feedback mechanisms

2

Conceptually simple: detect all relevant events and respond correctly

3

Assumes all events are surely detected

4

Implementation: Requires continuous sensing Tell me if you ever find a faithful implementation platform . . .

5

Robust events, not just: if(x = 9.8696) ...

6

Events have subtle models, but make design and verification easier! Non-negotiability of Physics Connected domains Multi-firing

7

Useful abstraction when system evolves slowly but senses quickly

8

Verify event-triggered model as first step

9

Then refine toward realistic implementation based on safe event-triggered design

10 Physics = Control André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 19 / 20

slide-55
SLIDE 55

On the Nuisance of Nuances of Physics

Non-negotiability of Physics

1

Making systems safe by construction is a great idea. For control!

2

But not by changing the laws of physics.

3

Physics is unpleasantly non-negotiable.

4

If models are safe because we forgot to include all behavior of physical reality, then correctness statements only hold in that other universe. Despite control We don’t get to boss physics around

We don’t make this world any safer by writing CPS programs for another universe.

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 20 / 20

slide-56
SLIDE 56

André Platzer. Logical Foundations of Cyber-Physical Systems. Springer, Switzerland, 2018. URL: http://www.springer.com/978-3-319-63587-3,

doi:10.1007/978-3-319-63588-0.

André Platzer. Logical Analysis of Hybrid Systems: Proving Theorems for Complex Dynamics. Springer, Heidelberg, 2010.

doi:10.1007/978-3-642-14509-4.

Sarah M. Loos and André Platzer. Differential refinement logic. In Martin Grohe, Eric Koskinen, and Natarajan Shankar, editors, LICS, pages 505–514, New York, 2016. ACM.

doi:10.1145/2933575.2934555.

André Platzer (CMU) LFCPS/08: Events & Responses LFCPS/08 20 / 20