Bellerophon: Tactical Theorem Proving for Hybrid Systems Nathan - - PowerPoint PPT Presentation

bellerophon tactical theorem proving for hybrid systems
SMART_READER_LITE
LIVE PREVIEW

Bellerophon: Tactical Theorem Proving for Hybrid Systems Nathan - - PowerPoint PPT Presentation

Bellerophon: Tactical Theorem Proving for Hybrid Systems Nathan Fulton , Stefan Mitsch, Brandon Bohrer, Andr Platzer Carnegie Mellon University Cyber-Physical Systems Cyber-Physical Systems combine computation and control. Hybrid Systems


slide-1
SLIDE 1

Bellerophon: Tactical Theorem Proving for Hybrid Systems

Nathan Fulton, Stefan Mitsch, Brandon Bohrer, André Platzer Carnegie Mellon University

slide-2
SLIDE 2
slide-3
SLIDE 3

Cyber-Physical Systems

Cyber-Physical Systems combine computation and control. Hybrid Systems model combinations of discrete and continuous dynamics.

slide-4
SLIDE 4

Bellerophon

Verifying hybrid systems is hard.

slide-5
SLIDE 5

Bellerophon

Verifying hybrid systems is hard. Bellerophon demonstrates how to tackle hybrid systems with tactics:

slide-6
SLIDE 6

Bellerophon

Verifying hybrid systems is hard. Bellerophon demonstrates how to tackle hybrid systems with tactics:

  • Build on a sound core.
slide-7
SLIDE 7

Bellerophon

Verifying hybrid systems is hard. Bellerophon demonstrates how to tackle hybrid systems with tactics:

  • Build on a sound core.
  • Implement high-level primitives for hybrid

systems proofs.

slide-8
SLIDE 8

Bellerophon

Verifying hybrid systems is hard. Bellerophon demonstrates how to tackle hybrid systems with tactics:

  • Build on a sound core.
  • Implement high-level primitives for hybrid

systems proofs.

  • Automate common constructions (for

ODEs and control software)

slide-9
SLIDE 9

Theorem Bellerophon LOC Conceptual Proof Steps Hybrid Systems Axiom Applications

Static Safety 12 71 30,355 Passive-Friendly Safety 45 140 68,620 Orientation Safety 15 108 173,989 Pass Intersection Liveness 234 440 61,878 Bellerophon

slide-10
SLIDE 10

KeYmaera X: Trustworthy Foundations Interactive Reachability Analysis

➢ Bellerophon combinator language ➢ Bellerophon standard library for hybrid systems ➢ Demonstration

Bellerophon for Automation and Tooling Conclusions & Resources

slide-11
SLIDE 11

Trustworthy Foundations

KeYmaera X enables trustworthy automation for hybrid systems analysis:

  • A well-defined logical foundations,
  • implemented in a small trustworthy core
  • that ensures correctness of automation and tooling.
slide-12
SLIDE 12

Trustworthy Foundations

Hybrid Programs

a := t

a=a0 b=b0 c=c0

...

a=t b=b0 c=c0

...

slide-13
SLIDE 13

Trustworthy Foundations

Hybrid Programs

a := t

a=a0 b=b0 c=c0

...

a=t b=b0 c=c0

...

a;b

a;b a b

slide-14
SLIDE 14

Trustworthy Foundations

Hybrid Programs

a := t ?P

a=a0 b=b0 c=c0

...

a=t b=b0 c=c0

...

a;b

a;b a b If P is true: no change If P is false: terminate

slide-15
SLIDE 15

Trustworthy Foundations

Hybrid Programs

a := t a∪b ?P

a=a0 b=b0 c=c0

...

a=t b=b0 c=c0

...

a;b

a;b a b If P is true: no change If P is false: terminate

slide-16
SLIDE 16

Trustworthy Foundations

Hybrid Programs

a := t a∪b ?P

a=a0 b=b0 c=c0

...

a=t b=b0 c=c0

...

a;b

a;b a b If P is true: no change If P is false: terminate

slide-17
SLIDE 17

Trustworthy Foundations

Hybrid Programs

a := t a∪b ?P

a=a0 b=b0 c=c0

...

a=t b=b0 c=c0

...

a;b

a;b a b If P is true: no change If P is false: terminate

a*

a ...a...

slide-18
SLIDE 18

Trustworthy Foundations

Hybrid Programs

a := t a∪b ?P

a=a0 b=b0 c=c0

...

a=t b=b0 c=c0

...

a;b

a;b a b If P is true: no change If P is false: terminate

a* x’=f

x=x0 ... x=F(0) ... x=F(T) ... ⋮ a ...a...

slide-19
SLIDE 19

Trustworthy Foundations

Reachability Specifications

[a]P

“after every execution of a, P”

<a>P

“after some execution of a, P”

slide-20
SLIDE 20

Trustworthy Foundations

Reachability Specifications

[a]P

“after every execution of a, P”

<a>P

“after some execution of a, P” init → [{x := u(x); x’ = f(x)}*]safe

slide-21
SLIDE 21

Trustworthy Foundations

Hello, World

{ {?Dive ∪ r := rp}; t:=0; {x’ = v, V’ = f(v,g,r), t’=1 & 0≤x & t≤T} }*

Control: Continue diving if safe, else open parachute. Plant: Downward velocity determined by gravity, air resistance.

x v’=f(v,g,r)

slide-22
SLIDE 22

Trustworthy Foundations

Hello, World

{ {?Dive ∪ r := rp}; t:=0; {x’ = v, V’ = f(v,g,r), t’=1 & 0≤x & t≤T} }*

Control: Continue diving if safe, else open parachute. Plant: Downward velocity determined by gravity, air resistance.

x v’=f(v,g,r)

slide-23
SLIDE 23

Trustworthy Foundations

Hello, World

{ {?Dive ∪ r := rp}; t:=0; {x’ = v, V’ = f(v,g,r), t’=1 & 0≤x & t≤T} }*

Control: Continue diving if safe, else open parachute. Plant: Downward velocity determined by gravity, air resistance.

x v’=f(v,g,r)

slide-24
SLIDE 24

Trustworthy Foundations

Hello, World

{ {?Dive ∪ r := rp}; t:=0; {x’ = v, V’ = f(v,g,r), t’=1 & 0≤x & t≤T} }*

Control: Continue diving if safe, else open parachute. Plant: Downward velocity determined by gravity, air resistance.

x v’=f(v,g,r)

slide-25
SLIDE 25

Trustworthy Foundations

Hello, World

{ {?Dive ∪ r := rp}; t:=0; {x’ = v, V’ = f(v,g,r), t’=1 & 0≤x & t≤T} }*

Control: Continue diving if safe, else open parachute. Plant: Downward velocity determined by gravity, air resistance.

x v’=f(v,g,r)

slide-26
SLIDE 26

Trustworthy Foundations

Hello, World

{ {?Dive ∪ r := rp}; t:=0; {x’ = v, V’ = f(v,g,r), t’=1 & 0≤x & t≤T} }*

Control: Continue diving if safe, else open parachute. Plant: Downward velocity determined by gravity, air resistance.

x v’=f(v,g,r)

slide-27
SLIDE 27

(Dive & g>0 & …)→ [{ {?Dive ∪ r := rp}; {x’ = v, V’ = f(v,g,r) & 0≤x} }*](x=0→m≤v)

x v’=f(v,g,r)

Trustworthy Foundations

Reachability Specifications

slide-28
SLIDE 28

(Dive & g>0 & …)→ [{ {?Dive ∪ r := rp}; {x’ = v, V’ = f(v,g,r) & 0≤x} }*](x=0→m≤v)

x v’=f(v,g,r) If the parachuter is on the ground, their speed is safe (m≤v≤0)

Trustworthy Foundations

Reachability Specifications

slide-29
SLIDE 29

Introduction to Differential Dynamic Logic

Dynamical Axioms

[x:=t]f(x) ↔ f(t) [a;b]P ↔ [a][b]P [a∪b]P ↔ ([a]P & [b]P) [x’=f&Q]P → (Q → P)

...

slide-30
SLIDE 30

Introduction to Differential Dynamic Logic

Trusted Core

[x:=t]f(x) ↔ f(t) [a;b]P ↔ [a][b]P [a∪b]P ↔ ([a]P & [b]P) [x’=f&Q]P → (Q → P) ...

AXIOM BASE

KeYmaera X Core

Q.E.D.

slide-31
SLIDE 31

Introduction to Differential Dynamic Logic

Trustworthy Implementations

[x:=t]f(x) ↔ f(t) [a;b]P ↔ [a][b]P [a∪b]P ↔ ([a]P & [b]P) [x’=f&Q]P → (Q → P) ...

AXIOM BASE

KeYmaera X Core

Q.E.D. Bellerophon Tooling Automated Analyses

slide-32
SLIDE 32

Introduction to Differential Dynamic Logic

Prover Core Comparison

slide-33
SLIDE 33

Bellerophon

Bellerophon enables interactive verification and tool development:

slide-34
SLIDE 34

Bellerophon

Bellerophon enables interactive verification and tool development:

  • A standard library of common proof

techniques.

slide-35
SLIDE 35

Bellerophon

Bellerophon enables interactive verification and tool development:

  • A standard library of common proof

techniques.

  • A combinator language/library for

decomposing theorems and composing proof strategies.

slide-36
SLIDE 36

Bellerophon

Standard Library

Tactic Meaning prop Applies propositional reasoning exhaustively. unfold Symbolically executes discrete, loop-free programs. loop(J, i) Applies loop invariance axiom to position i. dI,dG,dC,dW Reasoning principles for differential equations.

slide-37
SLIDE 37

Bellerophon

Standard Library

Tactic Meaning prop Applies propositional reasoning exhaustively. unfold Symbolically executes discrete, loop-free programs. loop(J, i) Applies loop invariance axiom to position i. dI,dG,dC,dW Reasoning principles for differential equations.

1000+

slide-38
SLIDE 38

Bellerophon

Combinators

Combinator Meaning A ; B Execute A on current goal, then execute B on the result. A | B Try executing A on current goal. If A fails, execute B on current goal. A* Run A until it no longer applies. A<( B1,B2, … ,BN ) Execute A on current goal to create N subgoals. Run Bi on subgoal i. Tactic Meaning prop Applies propositional reasoning exhaustively. unfold Symbolically executes discrete, loop-free programs. loop(J, i) Applies loop invariance axiom to position i, extends J with constants. dI,dG,dC,dW Reasoning principles for differential equations.

1000+

slide-39
SLIDE 39

Bellerophon

Isolating Interesting Questions

(Dive & g>0 & …)→ [{ }*](x=0→m≤v)

slide-40
SLIDE 40

Bellerophon

Isolating Interesting Questions

(Dive & g>0 & …)→ [{ }*](x=0→m≤v) prop ; loop(J,1) (Dive & g>0 & …)→ J J → x=0→m≤v J→[ ]J

Loop invariant holds initially Loop invariant is preserved Loop invariant implies safety

slide-41
SLIDE 41

Bellerophon

Isolating Interesting Questions

(Dive & g>0 & …)→ [{ }*](x=0→m≤v) prop ; loop(J,1) (Dive & g>0 & …)→ J J → x=0→m≤v J→[ ]J

Loop invariant holds initially Loop invariant is preserved Loop invariant implies safety

slide-42
SLIDE 42

Bellerophon

Isolating Interesting Questions

(Dive & g>0 & …)→ [{ }*](x=0→m≤v) prop ; loop(J,1) (Dive & g>0 & …)→ J J → x=0→m≤v J→[ ]J u n f

  • l

d J & Dive & r=ra→ [x’=v,v’=...]J J & r=rp→ [x’=v,v’=...]J

slide-43
SLIDE 43

Bellerophon

Isolating Interesting Questions

(Dive & g>0 & …)→ [{ }*](x=0→m≤v) prop ; loop(J,1) (Dive & g>0 & …)→ J J → x=0→m≤v J→[ ]J u n f

  • l

d J & Dive & r=ra→ [x’=v,v’=...]J J & r=rp→ [x’=v,v’=...]J

slide-44
SLIDE 44

Bellerophon

Isolating Interesting Questions prop ; loop(J, 1) <( QE, /* Real arith. solver */ QE, unfold ; <( … /* parachute open case */ … /* parachute closed case */ ) )

slide-45
SLIDE 45

Interactive Verification in Bellerophon

Trustworthy Standard Library at High Abstraction Level J → [{ctrl; plant}*]J J = v > -sqrt(g/pr) > m & … Parachute Open Case: v ≥ v0 - gt ≥ v0 - gT > -sqrt(g/pr) x v’=rv2-g Inductive invariants

slide-46
SLIDE 46

Interactive Verification in Bellerophon

From Axioms to Proof Steps

DI Axiom: [{x'=f&Q}]P↔([?Q]P←(Q→[{x'=f&Q}]P'))

slide-47
SLIDE 47

Interactive Verification in Bellerophon

From Axioms to Proof Steps

DI Axiom: [{x'=f&Q}]P↔([?Q]P←(Q→[{x'=f&Q}]P')) Example: [v’=rpv2-g,t’=1]v ≥ v0 - gt

slide-48
SLIDE 48

Interactive Verification in Bellerophon

From Axioms to Proof Steps

DI Axiom: [{x'=f&Q}]P↔([?Q]P←(Q→[{x'=f&Q}]P')) Example: [v’=rpv2-g,t’=1]v ≥ v0 - gt ↔ … ↔ [v’:=rpv2-g][t’:=1]v’ ≥ -g*t’ ↔ rpv2-g ≥ -g ↔ rp≥0

slide-49
SLIDE 49

Interactive Verification in Bellerophon

From Axioms to Proof Steps

DI Axiom: [{x'=f&Q}]P↔([?Q]P←(Q→[{x'=f&Q}]P')) Example: [v’=rpv2-g,t’=1]v ≥ v0 - gt ↔ … ↔ [v’:=rpv2-g][t’:=1]v’ ≥ -g*t’ ↔ rpv2-g ≥ -g ↔ H→rp≥0

Side derivation: (v ≥ v0 - gt)’ ↔ (v)’≥ (v0 - gt)’ ↔ (v)’≥ (v0 - gt)’ ↔ (v)’≥ (v0)’-(gt) ’ ↔

(v)’≥(v

0)’- (t(g)’+g(t’)) ↔

V’ ≥v0’- (tg’+gt’)

dI Tactic:

H=rp≥0 & ra≥0 & g>0 & ...

slide-50
SLIDE 50

Automation and Tooling

Hybrid Systems Analyses can be built

  • n top of KeYmaera X.

Examples:

  • ODE Solver
  • Runtime Monitoring
slide-51
SLIDE 51

Automation and Tooling

Solving Differential Equations

[x:=t]f(x) ↔ f(t) [a;b]P ↔ [a][b]P [a∪b]P ↔ ([a]P & [b]P) [a*]P ↔ (J→P & J→[b]J) [x’=f&Q]P → (Q → P) ...

AXIOM BASE

KeYmaera X Core Q.E.D.

Untrusted ODE Solver Axiomatic Solver (Bellerophon Program)

1. Use untrusted code to find a conjecture. 2. Prove the conjecture systematically, leveraging standard library.

slide-52
SLIDE 52

Automation and Tooling

Solving Differential Equations

[x:=t]f(x) ↔ f(t) [a;b]P ↔ [a][b]P [a∪b]P ↔ ([a]P & [b]P) [a*]P ↔ (J→P & J→[b]J) [x’=f&Q]P → (Q → P) ...

AXIOM BASE

KeYmaera X Core Q.E.D.

Untrusted ODE Solver Axiomatic Solver (Bellerophon Program)

1. Use untrusted code to find a conjecture. 2. Prove the conjecture systematically, leveraging standard library.

slide-53
SLIDE 53

Automation and Tooling

ModelPlex Tactic

slide-54
SLIDE 54

Toward Automated Deduction

Other Proof Automation & Tooling

  • Taylor Series
  • Bifurcations
  • Limit Cycles
  • Numerical tools
  • ...

[x:=t]f(x) ↔ f(t) [a;b]P ↔ [a][b]P [a∪b]P ↔ ([a]P & [b]P) [a*]P ↔ (J→P & J→[b]J) [x’=f&Q]P → (Q → P) ...

AXIOM BASE

KeYmaera X Core Q.E.D.

ODE & Controls Tooling Clever Bellerophon Programs

slide-55
SLIDE 55

Toward Automated Deduction

Other Proof Automation & Tooling

  • Taylor Series
  • Bifurcations
  • Limit Cycles
  • Numerical tools
  • ...

[x:=t]f(x) ↔ f(t) [a;b]P ↔ [a][b]P [a∪b]P ↔ ([a]P & [b]P) [a*]P ↔ (J→P & J→[b]J) [x’=f&Q]P → (Q → P) ...

AXIOM BASE

KeYmaera X Core Q.E.D.

ODE & Controls Tooling Clever Bellerophon Programs Other Tooling:

  • Component-based

Verification

  • Web UI
slide-56
SLIDE 56

Conclusion There is a wide gap between sound foundations for hybrid systems and practical interactive theorem proving technology for cyber-physical systems verification.

slide-57
SLIDE 57

Conclusion There is a wide gap between sound foundations for hybrid systems and practical interactive theorem proving technology for cyber-physical systems verification. Bellerophon demonstrates how to verify hybrid systems using tactics.

slide-58
SLIDE 58

Conclusion There is a wide gap between sound foundations for hybrid systems and practical interactive theorem proving technology for cyber-physical systems verification. Bellerophon demonstrates how to verify hybrid systems using tactics.

slide-59
SLIDE 59

Conclusion There is a wide gap between sound foundations for hybrid systems and practical interactive theorem proving technology for cyber-physical systems verification. Bellerophon demonstrates how to verify hybrid systems using tactics.

DI Axiom: [{x'=f&Q}]P↔([?Q]P←(Q→[{x'=f&Q}]P')) Example: [v’=rpv2-g,t’=1]v ≥ v 0 - gt ↔ … ↔ [v’:=r pv2-g][t’:=1]v’ ≥ -g*t’ ↔ rpv2-g ≥ -g ↔ H→rp≥0 Side derivation: (v ≥ v 0 - gt)’ ↔ ...↔ ...↔ ... dI Tactic: H=rp≥0 & ra≥0 & g>0 & ...

slide-60
SLIDE 60

Conclusion There is a wide gap between sound foundations for hybrid systems and practical interactive theorem proving technology for cyber-physical systems verification. Bellerophon demonstrates how to verify hybrid systems using tactics.

DI Axiom: [{x'=f&Q}]P↔([?Q]P←(Q→[{x'=f&Q}]P')) Example: [v’=rpv2-g,t’=1]v ≥ v 0 - gt ↔ … ↔ [v’:=r pv2-g][t’:=1]v’ ≥ -g*t’ ↔ rpv2-g ≥ -g ↔ H→rp≥0 Side derivation: (v ≥ v 0 - gt)’ ↔ ...↔ ...↔ ... dI Tactic: H=rp≥0 & ra≥0 & g>0 & ...

Axioms

KyX

qed

ODE & Controls Tooling Clever Bellerophon Programs

slide-61
SLIDE 61

Conclusion There is a wide gap between sound foundations for hybrid systems and practical interactive theorem proving technology for cyber-physical systems verification. Bellerophon demonstrates how to verify hybrid systems using tactics.

Project Website (start here) keymaeraX.org Online Demo web.keymaeraX.org Open Source (GPL) github.com/ls-lab/KeYmaeraX-release

Thanks: 15-424 students, Jean-Baptiste Jeannin, Khalil Ghorbal, Yanni Kouskoulas et al., and many others!

slide-62
SLIDE 62

Developers:

  • Stefan Mitsch
  • Nathan Fulton
  • André Platzer
  • Brandon Bohrer
  • Jan-David Quesel
  • Yong Kiam Tan
  • Markus Völp
slide-63
SLIDE 63
slide-64
SLIDE 64

Interactive Reachability Analysis in KeYmaera X

Differential Ghosts Parachute Closed: J & t=0 & r=rp → [x’=v,v’=rv2-g & 0≤x & t≤T]v>-sqrt(g/pr) > m x v’=rv2-g Proof requires a differential ghost because the property is not inductive.

slide-65
SLIDE 65

Interactive Reachability Analysis in KeYmaera X

Differential Ghosts An example differential ghost. x>0 → [x’=-x]x>0

slide-66
SLIDE 66

Interactive Reachability Analysis in KeYmaera X

Differential Ghosts An example differential ghost. x>0 → [x’=-x]x>0 Ghost: y’=y/2 Conserved: 1=xy2

slide-67
SLIDE 67

Interactive Reachability Analysis in KeYmaera X

Differential Ghosts An example differential ghost. x>0 → [x’=-x]x>0 Ghost: y’=y/2 Conserved: 1=xy2 Notice: x>0 ↔ ∃y.1=xy2 Therefore, suffices to show: 1=xy2→∃y.[x’=-x,y’=y/2]1=xy2

slide-68
SLIDE 68

Introduction to Differential Dynamic Logic

Prover Core Comparison Tool Trusted LOC (approx.)

KeYmaera X 1,682 (out of 100,000+) KeYmaera 65,989 Isabelle/Pure 8,113 Coq 20,000 HSolver 20,000 dReal 50,000 SpaceEx 100,000