Deductive Verification Of Hybrid Systems Lectures on Formal Methods - - PowerPoint PPT Presentation

deductive verification of hybrid systems
SMART_READER_LITE
LIVE PREVIEW

Deductive Verification Of Hybrid Systems Lectures on Formal Methods - - PowerPoint PPT Presentation

Deductive Verification Of Hybrid Systems Lectures on Formal Methods for Cyber-Physical Systems SOKENDAI, 07/29/19 Jrmy Dubut National Institute of Informatics Japanese-French Laboratory of Informatics Objectives of this lecture


slide-1
SLIDE 1

Deductive Verification Of Hybrid Systems

Jérémy Dubut National Institute of Informatics Japanese-French Laboratory of Informatics

Lectures on Formal Methods for Cyber-Physical Systems SOKENDAI, 07/29/19

slide-2
SLIDE 2
  • Deductive system to prove invariants of hybrid systems
  • Representability of HS (hybrid programs)
  • Platzer’s Differential Dynamic Logic
  • Sequent calculus for this logic

Objectives of this lecture

slide-3
SLIDE 3

References

  • T. A. Henzinger, The Theory of Hybrid Automata, Verification of 


Digital and Hybrid Systems, volume 170 of the NATO ASI Series,
 pp 265-292. Springer, 2000.

  • A. Platzer’s group. http://symbolaris.com
  • A. Platzer, Logical Foundations of Cyber-Physical Systems. 


Springer, 2018.

  • J. Kolčák, I. Hasuo, J. Dubut, S. Katsumata, D. Sprunger, 

  • A. Yamada, Relational Differential Dynamic Logic. Preprint 


arXiv:1903.00153.

slide-4
SLIDE 4

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} A hybrid automaton is:

Recap’ on hybrid automata

slide-5
SLIDE 5

M = {on, off}

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} A hybrid automaton is:

  • a set M of modes

Recap’ on hybrid automata

slide-6
SLIDE 6

V = {x, c, T}

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} A hybrid automaton is:

  • a set M of modes
  • a set V of variables

Recap’ on hybrid automata

slide-7
SLIDE 7

E = {turn on, turn off}

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events

Recap’ on hybrid automata

slide-8
SLIDE 8

s(turn off) = on s(turn on) = off t(turn off) = off t(turn on) = on

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions

s, t : E ⟶ M

Recap’ on hybrid automata

slide-9
SLIDE 9

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} Foff(x, c, T, t) = (−0.1x,0,0) Fon(x, c, T, t) = (4c − 0.1x,0,0) A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions
  • for every mode m, a flow function

Fm : ℝV × ℝ ⟶ ℝV s, t : E ⟶ M

Recap’ on hybrid automata

slide-10
SLIDE 10

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} Foff(x, c, T, t) = (−0.1x,0,0) Fon(x, c, T, t) = (4c − 0.1x,0,0) x(t) = cst exp(−0.1t) c = cst, T = cst x(t) = 40c + cst exp(−0.1t) c = cst, T = cst A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions
  • for every mode m, a flow function

Fm : ℝV × ℝ ⟶ ℝV s, t : E ⟶ M

Recap’ on hybrid automata

slide-11
SLIDE 11

Ioff = {(x, c, T) ∣ x ≥ T − 2} Ion = {(x, c, T) ∣ x ≤ T + 2} · x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions
  • for every mode m, a flow function
  • for every mode m, an invariant predicate

Fm : ℝV × ℝ ⟶ ℝV Im ⊆ ℝV s, t : E ⟶ M

Recap’ on hybrid automata

slide-12
SLIDE 12

A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions
  • for every mode m, a flow function
  • for every mode m, an invariant predicate
  • for every event e, a guard predicate

Fm : ℝV × ℝ ⟶ ℝV Im ⊆ ℝV s, t : E ⟶ M Ge ⊆ ℝV Gturn off = {(x, c, T) ∣ x > T + 1} Gturn on = {(x, c, T) ∣ x < T − 1} · x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3}

Recap’ on hybrid automata

slide-13
SLIDE 13

A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions
  • for every mode m, a flow function
  • for every mode m, an invariant predicate
  • for every event e, a guard predicate
  • for every event e, a jump relation

Fm : ℝV × ℝ ⟶ ℝV Im ⊆ ℝV s, t : E ⟶ M Ge ⊆ ℝV Je ⊆ ℝV × ℝV

Jturn off = {(x, c, T, x′, c′, T′) ∣ x = x′ ∧ c = c′ ∧ T = T′} Jturn on = {(x, c, T, x′, c′, T′) ∣ x = x′ ∧ c′ ∈ {1,2,3} ∧ T′ ∈ [15,30]}

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3}

Recap’ on hybrid automata

slide-14
SLIDE 14

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3}

I0,off = {(x, c, T) ∣ x ≥ T ∧ c ∈ {1,2,3} ∧ T ∈ [15,30]} I0,on = {(x, c, T) ∣ x ≤ T ∧ c ∈ {1,2,3} ∧ T ∈ [15,30]}

A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions
  • for every mode m, a flow function
  • for every mode m, an invariant predicate
  • for every event e, a guard predicate
  • for every event e, a jump relation
  • for every mode m, an initial predicate

Fm : ℝV × ℝ ⟶ ℝV Im ⊆ ℝV s, t : E ⟶ M Ge ⊆ ℝV Je ⊆ ℝV × ℝV I0,m ⊆ ℝV

Recap’ on hybrid automata

slide-15
SLIDE 15

Verification of hybrid systems

Goal: prove that the system is not going wrong This means proving some properties on the set of 
 reachable configurations

slide-16
SLIDE 16

A configuration is an element of the form An initial configuration is a configuration such that . A valid configuration is a configuration such that . (m, ω) ∈ M × ℝV ω ∈ I0,m (m, ω) (m, ω) ω ∈ Im

Configurations of a hybrid automaton

A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions
  • for every mode m, a flow function
  • for every mode m, an invariant predicate
  • for every event e, a guard predicate
  • for every event e, a jump relation
  • for every mode m, an initial predicate

Fm : ℝV × ℝ ⟶ ℝV Im ⊆ ℝV s, t : E ⟶ M Ge ⊆ ℝV Je ⊆ ℝV × ℝV I0,m ⊆ ℝV

slide-17
SLIDE 17

Example

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3}

configuration initial valid

(off,18,1,20) (off,17,2,20) (on,17,2,20) (on,21,1,20) (m, x, c, T)

slide-18
SLIDE 18

Example

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3}

configuration initial valid No Yes No No Yes Yes No Yes

(off,18,1,20) (off,17,2,20) (on,17,2,20) (on,21,1,20) (m, x, c, T)

slide-19
SLIDE 19

Discrete transitions of HA

A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions
  • for every mode m, a flow function
  • for every mode m, an invariant predicate
  • for every event e, a guard predicate
  • for every event e, a jump relation
  • for every mode m, an initial predicate

Fm : ℝV × ℝ ⟶ ℝV Im ⊆ ℝV s, t : E ⟶ M Ge ⊆ ℝV Je ⊆ ℝV × ℝV I0,m ⊆ ℝV Given two valid configurations and we have a discrete transition if there is an event such that:

  • and
  • (m1, ω1)

(m1, ω1) ⟶d (m2, ω2) e ∈ E (m2, ω2) s(e) = m1 t(e) = m2 ω1 ∈ Ge (ω1, ω2) ∈ Je

slide-20
SLIDE 20

Example

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} (off,19,1,20.5) ⟶d (on,19,2,21) (off,19,1,20) ⟶d (off,19,2,21) (off,19,1,20) ⟶d (on,20,2,21) (off,19,1,20) ⟶d (on,19,2,16) ?? ?? ?? ?? (off,20,1,20) ⟶d (on,20,2,21) ?? (m, x, c, T) ⟶d (m′, x′, c′, T′)

slide-21
SLIDE 21

Example

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} (off,19,1,20) ⟶d (off,19,2,21) (off,19,1,20) ⟶d (on,20,2,21) (off,19,1,20) ⟶d (on,19,2,16) Yes No No No (off,20,1,20) ⟶d (on,20,2,21) No (m, x, c, T) ⟶d (m′, x′, c′, T′) (off,19,1,20.5) ⟶d (on,19,2,21)

slide-22
SLIDE 22

Continuous transitions of HA

A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions
  • for every mode m, a flow function
  • for every mode m, an invariant predicate
  • for every event e, a guard predicate
  • for every event e, a jump relation
  • for every mode m, an initial predicate

Fm : ℝV × ℝ ⟶ ℝV Im ⊆ ℝV s, t : E ⟶ M Ge ⊆ ℝV Je ⊆ ℝV × ℝV I0,m ⊆ ℝV Given two valid configurations and we have a continuous transition if the following holds:

  • there is a continuous function



 derivable on ]0,T[ such that:

★ ★ and ★

(m1, ω1) (m1, ω1) ⟶c (m2, ω2) (m2, ω2) m1 = m2 Ψ : [0,T] ⟶ ℝV (T ≥ 0) ∀s ∈ ]0,T[. · Ψ(s) = Fm1(Ψ(s), s) Ψ(0) = ω1 Ψ(T) = ω2 ∀s ∈ [0,T] . Ψ(s) ∈ Im1

slide-23
SLIDE 23

Example

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} (off,19,1,20) ⟶c (off,18,1,20) (off,19,1,20) ⟶c (on,18,1,20) (off,19,1,20) ⟶c (off,19,1,20) (off,19,1,20) ⟶c (off,18,2,23) ?? ?? ?? ?? (off,19,1,20) ⟶c (off,20,1,20) ?? (m, x, c, T) ⟶c (m′, x′, c′, T′)

slide-24
SLIDE 24

Example

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3} (off,19,1,20) ⟶c (off,18,1,20) (off,19,1,20) ⟶c (on,18,1,20) (off,19,1,20) ⟶c (off,19,1,20) (off,19,1,20) ⟶c (off,18,2,23) Yes No Yes No (off,19,1,20) ⟶c (off,20,1,20) No (m, x, c, T) ⟶c (m′, x′, c′, T′)

slide-25
SLIDE 25

Reachability set of HA

A hybrid automaton is:

  • a set M of modes
  • a set V of variables
  • a set E of events
  • source and target functions
  • for every mode m, a flow function
  • for every mode m, an invariant predicate
  • for every event e, a guard predicate
  • for every event e, a jump relation
  • for every mode m, an initial predicate

Fm : ℝV × ℝ ⟶ ℝV Im ⊆ ℝV s, t : E ⟶ M Ge ⊆ ℝV Je ⊆ ℝV × ℝV I0,m ⊆ ℝV A configuration is reachable if there is
 a finite sequence of continuous and 
 discrete transitions from a valid initial 
 configuration, that is: Reach = {(m, ω) ∣ ∃m0 . ω0 ∈ I0,m0 ∩ Im0 . (m0, ω0) ( →d ∪ →c )⋆ (m, ω)}

slide-26
SLIDE 26

Example

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3}

configuration initial valid reachable No Yes No No Yes Yes No Yes

(off,18,1,20) (off,17,2,20) (on,17,2,20) (on,21,1,20) (m, x, c, T)

slide-27
SLIDE 27

Example

· x = − 0.1x x ≥ T − 2

  • ff

· x = 4c − 0.1x x ≤ T + 2

  • n

x ≤ T Thermostat system x > T + 1 turn

  • ff

T ∈ [15,30] c ∈ {1,2,3} x < T − 1 c ∈ {1,2,3} turn

  • n

T ∈ [15,30] x ≥ T T ∈ [15,30] c ∈ {1,2,3}

configuration initial valid reachable No Yes Yes No No No Yes Yes Yes No Yes Yes

(off,18,1,20) (off,17,2,20) (on,17,2,20) (on,21,1,20) Actually, initial valid = reachable ⇒ (m, x, c, T)

slide-28
SLIDE 28

Representability of functions

In practice, we cannot use any function 
 
 as we need a finite representation of it. Here, we assume that is given by polynomials on . Remark: This is not much of a restriction, as many dynamics can be modelled by 
 polynomial ones, by adding variables. Examples: Fm : ℝV × ℝ ⟶ ℝV Fm V ⊔ {t} · x = f(x, t) g(x, t) ⇒ introduce y = 1 g(x, t) ⇒ · x = f(x, t) . y, · y = − y2 . ( ∂g ∂x (x, t) . f(x, t) . y + ∂g ∂t (x, t)) · x = cos(x) . f(x, t) ⇒ introduce y = cos(x) z = sin(x) ⇒ · x = f(x, t) . y · y = − f(x, t) . y . z · z = f(x, t) . y2

slide-29
SLIDE 29

Representability of predicates and relations

In practice, we cannot use any predicate 
 


  • r any relation


Here, we assume that there are given by first order formulae of real arithmetic. Concretely, we assume given a countable set of variables containing . Im, Ge, I0,m ⊆ ℝV Je ⊆ ℝV × ℝV X V ⊔ ̂ V t, t′ ::= X ∣ ℚ ∣ t . t′ ∣ t + t′ ∣ − t ∣ t/t′ ϕ, ϕ′ ::= t ≤ t′ ∣ ⊤ ∣ ϕ ∧ ϕ′ ∣ ¬ϕ ∣ ∃x . ϕ Semantics: Given whose free variables are 
 Ex: iff Interest: Validity and satisfibility of first order
 real arithmetic are decidable. ϕ fv(ϕ) [ |ϕ| ] ∈ ℝfv(ϕ) For hybrid systems, we assume the 
 existence of such formulae: whose free variables are
 and 
 
 
 whose free variables are and ϕI,m, ϕG,e, ϕI,0,m V [ |ϕI,m| ] = Im, [ |ϕG,e| ] = Ge, [ |ϕI,0,m| ] = I0,m ϕJ,e V ⊔ ̂ V [ |ϕJ,e| ] = Je (rx, ry, rz) ∈ [ |x + y ≤ z| ] rx + ry ≤ rz

slide-30
SLIDE 30

Loop invariants for HA

Remember: 
 
 So to prove that every elements of Reach satisfies some property, we have to prove some sorts of loop invariants.
 
 
 To prove , you find such that:

  • if

and then

  • if

and then Reach ⊆ Prop Inv ⊆ Prop

∀m ∈ M, I0,m ∩ Im ⊆ Inv (m, ω) ∈ Inv (m, ω) →d (m′, ω′) (m′, ω′) ∈ Inv (m, ω) ∈ Inv (m, ω) →c (m′, ω′) (m′, ω′) ∈ Inv

Reach = ( →d ∪ →c )⋆( ⋃

m∈M

I0,m ∩ Im)

slide-31
SLIDE 31

Example: the bouncing ball

We model a bouncing ball that we drop at height without initial velocity.

H

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

We want to prove that at every instant, the height of the ball is between 0 and H

slide-32
SLIDE 32

Example: the bouncing ball

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

We want to prove that at every instant, the height of the ball is between 0 and H

We want . Can we use ? Prop = {(z, v, H, c, g) ∣ 0 ≤ z ≤ H} Inv = Prop

slide-33
SLIDE 33

Example: the bouncing ball

We want to prove that at every instant, the height of the ball is between 0 and H

We want . Can we use ? Initially, and , so OK Prop = {(z, v, H, c, g) ∣ 0 ≤ z ≤ H} Inv = Prop

z = H H ≥ 0

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

slide-34
SLIDE 34

Example: the bouncing ball

We want to prove that at every instant, the height of the ball is between 0 and H

We want . Can we use ? Initially, and , so OK If then and , so OK Prop = {(z, v, H, c, g) ∣ 0 ≤ z ≤ H} Inv = Prop

z = H H ≥ 0 (gravity, z, v, H, c, g) →d (gravity, z′, v′, H′, c′, g′) z = z′ H = H′

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

slide-35
SLIDE 35

Example: the bouncing ball

We want to prove that at every instant, the height of the ball is between 0 and H

We want . Can we use ? Initially, and , so OK If then and , so OK If then, by , . Prop = {(z, v, H, c, g) ∣ 0 ≤ z ≤ H} Inv = Prop

z = H H ≥ 0 (gravity, z, v, H, c, g) →d (gravity, z′, v′, H′, c′, g′) z = z′ H = H′ (gravity, z, v, H, c, g) →c (gravity, z′, v′, H′, c′, g′) Igravity z′ ≥ 0

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

slide-36
SLIDE 36

Example: the bouncing ball

We want to prove that at every instant, the height of the ball is between 0 and H

We want . Can we use ? Initially, and , so OK If then and , so OK If then, by , . Assuming , can we prove ? Prop = {(z, v, H, c, g) ∣ 0 ≤ z ≤ H} Inv = Prop

z = H H ≥ 0 (gravity, z, v, H, c, g) →d (gravity, z′, v′, H′, c′, g′) z = z′ H = H′ (gravity, z, v, H, c, g) →c (gravity, z′, v′, H′, c′, g′) Igravity z′ ≥ 0 0 ≤ z ≤ H z′ ≤ H′

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

slide-37
SLIDE 37

Example: the bouncing ball

We want to prove that at every instant, the height of the ball is between 0 and H

We want . Can we use ? Initially, and , so OK If then and , so OK If then, by , . Assuming , can we prove ? No! Take very large for example. Prop = {(z, v, H, c, g) ∣ 0 ≤ z ≤ H} Inv = Prop

z = H H ≥ 0 (gravity, z, v, H, c, g) →d (gravity, z′, v′, H′, c′, g′) z = z′ H = H′ (gravity, z, v, H, c, g) →c (gravity, z′, v′, H′, c′, g′) Igravity z′ ≥ 0 0 ≤ z ≤ H z′ ≤ H′ v

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

slide-38
SLIDE 38

Example: the bouncing ball

We want to prove that at every instant, the height of the ball is between 0 and H

We want . Spoiler: use Initially, and , so OK Prop = {(z, v, H, c, g) ∣ 0 ≤ z ≤ H} Inv = {(z, v, H, c, g) ∣ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2}

z = H v = 0

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

slide-39
SLIDE 39

Example: the bouncing ball

We want to prove that at every instant, the height of the ball is between 0 and H

We want . Spoiler: use Initially, and , so OK If and then

  • , so OK

Prop = {(z, v, H, c, g) ∣ 0 ≤ z ≤ H} Inv = {(z, v, H, c, g) ∣ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2}

z = H v = 0 (gravity, z, v, H, c, g) →d (gravity, z′, v′, H′, c′, g′) (z, v, H, c, g) ∈ Inv 2g′z′ = 2gz ≤ 2gH − v2 = 2g′H′− v2 ≤ 2g′H′− c2v2 = 2g′H′− v′2

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

slide-40
SLIDE 40

Example: the bouncing ball

We want to prove that at every instant, the height of the ball is between 0 and H

We want . Spoiler: use Initially, and , so OK If and then

  • , so OK

If , then and 


  • for some .

After computation: , so OK Prop = {(z, v, H, c, g) ∣ 0 ≤ z ≤ H} Inv = {(z, v, H, c, g) ∣ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2}

z = H v = 0 (gravity, z, v, H, c, g) →d (gravity, z′, v′, H′, c′, g′) (z, v, H, c, g) ∈ Inv 2g′z′ = 2gz ≤ 2gH − v2 = 2g′H′− v2 ≤ 2g′H′− c2v2 = 2g′H′− v′2 (gravity, z, v, H, c, g) →c (gravity, z′, v′, H′, c′, g′) v′ = − gt + v z′ = − gt2 + vt + z t 2g′H′− 2g′z′− v′2 = 2gH − 2gz − v2 + g2t2

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

slide-41
SLIDE 41

Objective

  • Formalize those kinds of arguments in a Hoare triple/sequent calculus style
  • Issues:
  • We need a presentation of HA adapted to this style


Idea: use 


and are semantical objects, so we cannot use them


  • We cannot use closed forms of solutions of differential equations in 


proofs in general! Reach = ( →d ∪ →c )⋆( ⋃

m∈M

I0,m ∩ Im) →d →c

slide-42
SLIDE 42

Syntax of Hybrid Programs

We assume given a countable set X of variables. Hybrid Programs are given by the following grammar:

  • where is a first order formula of real arithmetic (conditional)

  • where (resp. ) is a vector of variables (resp. polynomials) 


(assignment)

  • where (resp. ) is a vector of variables (resp. polynomials) 


and is a first order formula of real arithmetic (dynamics)

  • (sequential composition)
  • (non-deterministic choice)
  • (loop)

α, β ::= ?ϕ ϕ ∣ x := e x e ∣ · x = e & ϕ x e ϕ ∣ α; β ∣ α ∪ β ∣ α⋆

slide-43
SLIDE 43

Semantics of HP

  • is defined by induction:

iff there is a continuous function such that:

and

  • is derivable on

and for all , 


  • for all

[ |α| ] ⊆ ℝX × ℝX [ |?ϕ| ] = {(ω, ω) ∣ ω ∈ [ |ϕ| ]} [ |x := e| ] = {(ω, ω′) ∣ ∀x ∈ x, ω′

x = ex(ω) ∧ ∀x ∉ x, ω′ x = ωx}

(ω, ω′) ∈ [ | · x = e & ϕ| ] ψ : [0,T] → ℝx ω = ω(0) ω′ = ω(T) ψ ]0,T[ t ∈ ]0,T[ · ψ(t) = e(ω(t)) t ∈ [0,T], ω(t) ∈ [ |ϕ| ] [ |α; β| ] = {(ω, ω′′) ∣ ∃ω′, (ω, ω′) ∈ [ |α| ] ∧ (ω′, ω′′) ∈ [ |β| ]} [ |α ∪ β| ] = [ |α| ] ∪ [ |β| ] [ |α⋆| ] = {(ω, ω′) ∣ ∃n ∈ ℕ, ω0, …, ωn, ω = ω0 ∧ ω′ = ωn ∧ (ωi, ωi+1) ∈ [ |α| ]}

  • denotes:

ω(t) ∈ ℝX ∀x ∈ x, ω(t)x = ψ(t)x ∀x ∉ x, ω(t)x = ωx

slide-44
SLIDE 44

From HA to HP , the example of the bouncing ball

We can describe the bouncing ball as a HP

· z = v, · v = − g

z ≥ 0 gravity z = H H ≥ 0 v = 0 0 < c ≤ 1 g > 0 z = 0 v := − cv bouncing

α = ((?z = 0; v := − cv) ∪ (· z = v, · v = − g & z ≥ 0))⋆

[

|α| ] = ( →d ∪ →c )⋆

→d →c

slide-45
SLIDE 45

From HA to HP , in general

A hybrid automaton is:

  • a finite set M of modes
  • a finite set V of variables
  • a finite set E of events
  • source and target functions
  • for every mode m, a flow function
  • polynomial on
  • for every mode m, an invariant predicate
  • formula on
  • for every event e, a guard predicate
  • formula on V
  • for every event e, a jump relation
  • formula on
  • for every mode m, an initial predicate
  • formula on

s, t : E ⟶ M Fm V ⊔ {t} ϕI,m V ϕG,e ϕJ,e V ⊔ ̂ V ϕI,0,m V

slide-46
SLIDE 46

From HA to HP , in general (simplified version)

A hybrid automaton is:

  • a finite set M of modes
  • a finite set V of variables
  • a finite set E of events
  • source and target functions
  • for every mode m, a flow function
  • polynomial on
  • for every mode m, an invariant predicate
  • formula on
  • for every event e, a guard predicate
  • formula on V
  • for every event e, a jump relation
  • formula on
  • for every mode m, an initial predicate
  • formula on

s, t : E ⟶ M Fm V ⊔ {t} ϕI,m V ϕG,e ϕJ,e V ⊔ ̂ V ϕI,0,m V

slide-47
SLIDE 47

A hybrid automaton is:

  • a finite set M of modes
  • a finite set V of variables
  • a finite set E of events
  • source and target functions
  • for every mode m, a flow function
  • polynomial on
  • for every mode m, an invariant predicate
  • formula on
  • for every event e, a guard predicate
  • formula on V
  • for every event e, a jump relation
  • formula on
  • f the form

where is a polynomial on

  • for every mode m, an initial predicate
  • formula on

s, t : E ⟶ M Fm V ⊔ {t} ϕI,m V ϕG,e ϕJ,e V ⊔ ̂ V ⋀

x∈V

̂ x = Px Px V ϕI,0,m V

From HA to HP , in general (simplified version)

slide-48
SLIDE 48

A hybrid automaton is:

  • a finite set M of modes
  • a finite set V of variables
  • a finite set E of events
  • source and target functions
  • for every mode m, a flow function
  • polynomial on
  • for every mode m, an invariant predicate
  • formula on
  • for every event e, a guard predicate
  • formula on V
  • for every event e, a jump relation
  • formula on
  • f the form

where is a polynomial on

  • for every mode m, an initial predicate
  • formula on

s, t : E ⟶ M Fm V ⊔ {t} ϕI,m V ϕG,e ϕJ,e V ⊔ ̂ V ⋀

x∈V

̂ x = Px Px V ϕI,0,m V

Assume , and Assume .

V ⊆ X

mode ∈ X∖V

M ⊆ ℕ

From HA to HP , in general (simplified version)

slide-49
SLIDE 49

A hybrid automaton is:

  • a finite set M of modes
  • a finite set V of variables
  • a finite set E of events
  • source and target functions
  • for every mode m, a flow function
  • polynomial on
  • for every mode m, an invariant predicate
  • formula on
  • for every event e, a guard predicate
  • formula on V
  • for every event e, a jump relation
  • formula on
  • f the form

where is a polynomial on

  • for every mode m, an initial predicate
  • formula on

s, t : E ⟶ M Fm V ⊔ {t} ϕI,m V ϕG,e ϕJ,e V ⊔ ̂ V ⋀

x∈V

̂ x = Px Px V ϕI,0,m V

Assume , and . Assume .

  • V ⊆ X

mode ∈ X∖V

M ⊆ ℕ ( ⋃

m∈M

(?mode = m; ( ⋃

e∈E∣s(e)=m

?ϕG,e ∧ ϕI,m; V := PV;

mode := t(e);

?ϕI,t(e)) ⋃ ( · V = Fm & ϕIm)) )

From HA to HP , in general (simplified version)

slide-50
SLIDE 50

Assume , and . Assume .

  • V ⊆ X

mode ∈ X∖V

M ⊆ ℕ ( ⋃

m∈M

(?mode = m; ( ⋃

e∈E∣s(e)=m

?ϕG,e ∧ ϕI,m; V := PV;

mode := t(e);

?ϕI,t(e)) ⋃ ( · V = Fm & ϕIm)) )

A hybrid automaton is:

  • a finite set M of modes
  • a finite set V of variables
  • a finite set E of events
  • source and target functions
  • for every mode m, a flow function
  • polynomial on
  • for every mode m, an invariant predicate
  • formula on
  • for every event e, a guard predicate
  • formula on V
  • for every event e, a jump relation
  • formula on
  • f the form

where is a polynomial on

  • for every mode m, an initial predicate
  • formula on

s, t : E ⟶ M Fm V ⊔ {t} ϕI,m V ϕG,e ϕJ,e V ⊔ ̂ V ⋀

x∈V

̂ x = Px Px V ϕI,0,m V

check the mode

From HA to HP , in general (simplified version)

slide-51
SLIDE 51

Assume , and . Assume .

  • V ⊆ X

mode ∈ X∖V

M ⊆ ℕ ( ⋃

m∈M

(?mode = m; ( ⋃

e∈E∣s(e)=m

?ϕG,e ∧ ϕI,m; V := PV;

mode := t(e);

?ϕI,t(e)) ⋃ ( · V = Fm & ϕIm)) )

A hybrid automaton is:

  • a finite set M of modes
  • a finite set V of variables
  • a finite set E of events
  • source and target functions
  • for every mode m, a flow function
  • polynomial on
  • for every mode m, an invariant predicate
  • formula on
  • for every event e, a guard predicate
  • formula on V
  • for every event e, a jump relation
  • formula on
  • f the form

where is a polynomial on

  • for every mode m, an initial predicate
  • formula on

s, t : E ⟶ M Fm V ⊔ {t} ϕI,m V ϕG,e ϕJ,e V ⊔ ̂ V ⋀

x∈V

̂ x = Px Px V ϕI,0,m V

either do a 
 discrete transition

From HA to HP , in general (simplified version)

slide-52
SLIDE 52

Assume , and . Assume .

  • V ⊆ X

mode ∈ X∖V

M ⊆ ℕ ( ⋃

m∈M

(?mode = m; ( ⋃

e∈E∣s(e)=m

?ϕG,e ∧ ϕI,m; V := PV;

mode := t(e);

?ϕI,t(e)) ⋃ ( · V = Fm & ϕIm)) )

A hybrid automaton is:

  • a finite set M of modes
  • a finite set V of variables
  • a finite set E of events
  • source and target functions
  • for every mode m, a flow function
  • polynomial on
  • for every mode m, an invariant predicate
  • formula on
  • for every event e, a guard predicate
  • formula on V
  • for every event e, a jump relation
  • formula on
  • f the form

where is a polynomial on

  • for every mode m, an initial predicate
  • formula on

s, t : E ⟶ M Fm V ⊔ {t} ϕI,m V ϕG,e ϕJ,e V ⊔ ̂ V ⋀

x∈V

̂ x = Px Px V ϕI,0,m V

  • r do a 


continuous transition

From HA to HP , in general (simplified version)

slide-53
SLIDE 53

Sequent/Hoare triple style for HP

{ {

Preconditions Execute the 
 system {

{

Postconditions

slide-54
SLIDE 54

Sequent/Hoare triple style for HP

{ {

Preconditions Execute the 
 system {

{

Postconditions

Γ

A set of first order 
 formulae of 
 real arithmetic

slide-55
SLIDE 55

Sequent/Hoare triple style for HP

{ {

Preconditions Execute the 
 system {

{

Postconditions

Γ

A set of first order 
 formulae of 
 real arithmetic

α

A hybrid program

slide-56
SLIDE 56

Sequent/Hoare triple style for HP

{ {

Preconditions Execute the 
 system {

{

Postconditions

Γ

A set of first order 
 formulae of 
 real arithmetic

α

A hybrid program

P

A first order 
 formula of 
 real arithmetic

slide-57
SLIDE 57

Sequent/Hoare triple style for HP

{ {

Preconditions Execute the 
 system {

{

Postconditions

Γ

A set of first order 
 formulae of 
 real arithmetic

[α]

A hybrid program

P

A first order 
 formula of 
 real arithmetic

Sequent

slide-58
SLIDE 58

A sequent calculus for HP

Γ ⊢ [α]P

  • a set of first order formulae of real arithmetic
  • a hybrid program
  • a first order formula of real arithmetic

Γ α P

slide-59
SLIDE 59

A sequent calculus for HP

Γ ⊢ [α1]…[αn]P

  • a set of first order formulae of real arithmetic

hybrid programs

  • a first order formula of real arithmetic

In particular, when we have a first order sequent of real arithmetic A sequent is said to be valid if

  • Objective of this lecture: prove that

is valid

Γ α1, …, αn P n = 0 Γ ⊢ [α1]…[αn]P {ωn ∣ ∃ω0, …ωn−1, ω0 ∈ ⋂

ϕ∈Γ

[ |ϕ| ] ∧ ∀i, (ωi−1, ωi) ∈ [ |αi| ]} ⊆ [ |P| ] I0,gravity ⊢ [αball] 0 ≤ z ≤ H

slide-60
SLIDE 60

Deductive system for HP

We will see some proof rules to prove validity of sequents:

  • whose meaning are

To prove that is valid, it is enough
 to prove that all are valid. Rules that satisfy this property are called sound.

Γ1 ⊢ [α1

1]…[α1 n1] P1

… Γk ⊢ [αk

1]…[αk nk] Pk

Γ ⊢ [α1]…[αn] P Γ ⊢ [α1]…[αn] P Γi ⊢ [αi

1]…[αi ni] Pi

slide-61
SLIDE 61

Bouncing ball

Notations:

  • I0 ≡ z = H, H ≥ 0, v = 0, 0 < c ≤ 1, g > 0

ball ≡ ((?z = 0; v := − cv) ∪ (·

z = v, · v = − g & z ≥ 0))

Sequents to prove: I0 ⊢ [ball] 0 ≤ z ∧ z ≤ H

slide-62
SLIDE 62

Rule for loop invariants

  • Γ ⊢ Inv

Inv ⊢ [α] Inv Inv ⊢ P

Γ ⊢ [α⋆] P

(LI)

slide-63
SLIDE 63

Rule for loop invariants

  • Proof of soundness. Assume that:

1. is valid, that is 2. is valid, that is 3. is valid, that is, We want to prove that is valid. Let: A. B. such that We want to prove that . By 3., it is enough to prove that by induction on :

  • case

: by 1. and A.

  • inductive case: assume

, then by 2. and B., .QED.

Γ ⊢ Inv

Inv ⊢ [α] Inv Inv ⊢ P

Γ ⊢ [α⋆] P

(LI)

Γ ⊢ Inv ∩ϕ∈Γ [ |ϕ| ] ⊆ [ |Inv| ]

Inv ⊢ [α] Inv

{ω′ ∣ ∃ω ∈ [ |Inv| ], (ω, ω′) ∈ [ |α| ]} ⊆ [ |Inv| ]

Inv ⊢ P

[ |Inv| ] ⊆ [ |P| ] Γ ⊢ [α⋆] P ω0 ∈ ∩ϕ∈Γ [ |ϕ| ] ω1, …, ωn (ωi, ωi+1) ∈ [ |α| ] ωn ∈ [ |P| ] ωi ∈ [ |Inv| ] i i = 0 ωi ∈ [ |Inv| ] ωi+1 ∈ [ |Inv| ]

slide-64
SLIDE 64

Rule for loop invariants

  • To prove the validity of:

it is enough to prove of:

where

Γ ⊢ Inv

Inv ⊢ [α] Inv Inv ⊢ P

Γ ⊢ [α⋆] P

(LI)

I0 ⊢ [ball] 0 ≤ z ≤ H I0 ⊢ Inv

Inv ⊢ [(?z = 0; v := − cv) ∪ (·

z = v, · v = − g & z ≥ 0)] Inv

Inv ⊢ 0 ≤ z ≤ H Inv ≡ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2

slide-65
SLIDE 65

Bouncing ball

Notations:

  • I0 ≡ z = H, H ≥ 0, v = 0, 0 < c ≤ 1, g > 0

Inv ≡ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2 Sequents to prove:

  • I0 ⊢ Inv

Inv ⊢ [(?z = 0; v := − cv) ∪ (·

z = v, · v = − g & z ≥ 0)] Inv

Inv ⊢ 0 ≤ z ≤ H

slide-66
SLIDE 66

Rule for real arithmetic

  • This is implementable since the first order theory of reals is decidable!

To prove the validity of:

it is enough the following inclusions:

  • ∩ϕ∈Γ [

|ϕ| ] ⊆ [ |P| ] Γ ⊢ P

(RA)

I0 ⊢ Inv

Inv ⊢ 0 ≤ z ≤ H

{(z, v, H, g, c) ∣ z = H ∧ H ≥ 0 ∧ v = 0 ∧ 0 < c ≤ 1 ∧ g > 0} ⊆ {(z, v, H, g, c) ∣ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2}

{(z, v, H, g, c) ∣ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2} ⊆ {(z, v, H, g, c) ∣ 0 ≤ z ≤ H}

slide-67
SLIDE 67

Bouncing ball

Notations: Inv ≡ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2 Sequents to prove:

  • Inv ⊢ [(?z = 0; v := − cv) ∪ (·

z = v, · v = − g & z ≥ 0)] Inv

slide-68
SLIDE 68

Rule for non-determistic choices

  • To prove the validity of:


 it is enough to prove the validity of :

  • Γ ⊢ [α]P

Γ ⊢ [β]P Γ ⊢ [α ∪ β]P

( ∪ ) Inv ⊢ [(?z = 0; v := − cv) ∪ (·

z = v, · v = − g & z ≥ 0)] Inv

Inv ⊢ [?z = 0; v := − cv] Inv Inv ⊢ [·

z = v, · v = − g & z ≥ 0] Inv

slide-69
SLIDE 69

Bouncing ball

Notations: Inv ≡ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2 Sequents to prove:

  • Inv ⊢ [?z = 0; v := − cv] Inv

Inv ⊢ [·

z = v, · v = − g & z ≥ 0] Inv

slide-70
SLIDE 70

Rule for sequential compositions

  • To prove the validity of:


 it is enough to prove the validity of :

Γ ⊢ [α][β]P Γ ⊢ [α; β]P

(; ) Inv ⊢ [?z = 0; v := − cv] Inv Inv ⊢ [?z = 0][v := − cv] Inv

slide-71
SLIDE 71

Bouncing ball

Notations: Inv ≡ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2 Sequents to prove:

  • Inv ⊢ [?z = 0][v := − cv] Inv

Inv ⊢ [·

z = v, · v = − g & z ≥ 0] Inv

slide-72
SLIDE 72

Rule for conditionals

  • To prove the validity of:


 it is enough to prove the validity of :

Γ, Q ⊢ P Γ ⊢ [?Q]P

(?) Inv ⊢ [?z = 0][v := − cv] Inv Inv, z = 0 ⊢ [v := − cv] Inv

slide-73
SLIDE 73

Bouncing ball

Notations: Inv ≡ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2 Sequents to prove:

  • Inv, z = 0 ⊢ [v := − cv] Inv

Inv ⊢ [·

z = v, · v = − g & z ≥ 0] Inv

slide-74
SLIDE 74

Rule for conditionals

To prove the validity of:


 it is enough to prove the validity of :

  • which can be proved using the (RA) rule.


Γ ⊢ P(x ← e) Γ ⊢ [x := e]P

( := ) Inv, z = 0 ⊢ [v := − cv] Inv Inv, z = 0 ⊢ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − (−cv)2

slide-75
SLIDE 75

Bouncing ball

Notations: Inv ≡ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2 Sequents to prove:

  • Inv ⊢ [·

z = v, · v = − g & z ≥ 0] Inv

slide-76
SLIDE 76

Rule for simplifying the postconditions

To prove the validity of:


 it is enough to prove the validity of :

Γ ⊢ [α]P Γ ⊢ [α]Q Γ ⊢ [α]P ∧ Q

([]∧) Inv ⊢ [·

z = v, · v = − g & z ≥ 0] Inv

Inv ⊢ [·

z = v, · v = − g & z ≥ 0] z ≥ 0

Inv ⊢ [·

z = v, · v = − g & z ≥ 0] 0 < c ≤ 1 ∧ g > 0

Inv ⊢ [·

z = v, · v = − g & z ≥ 0] 2gz ≤ 2gH − v2

slide-77
SLIDE 77

Bouncing ball

Notations: Inv ≡ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2 Sequents to prove:

  • Inv ⊢ [·

z = v, · v = − g & z ≥ 0] z ≥ 0

Inv ⊢ [·

z = v, · v = − g & z ≥ 0] 0 < c ≤ 1 ∧ g > 0

Inv ⊢ [·

z = v, · v = − g & z ≥ 0] 2gz ≤ 2gH − v2

slide-78
SLIDE 78

Rule for differential weakening

To prove the validity of:


 it is enough to prove the validity of :

which is obvious.

Q ⊢ P Γ ⊢ [·

x = e & Q]P (dW) Inv ⊢ [·

z = v, · v = − g & z ≥ 0] z ≥ 0 z ≥ 0 ⊢ z ≥ 0

slide-79
SLIDE 79

Bouncing ball

Notations: Inv ≡ z ≥ 0 ∧ 0 < c ≤ 1 ∧ g > 0 ∧ 2gz ≤ 2gH − v2 Sequents to prove:

  • Inv ⊢ [·

z = v, · v = − g & z ≥ 0] 0 < c ≤ 1 ∧ g > 0

Inv ⊢ [·

z = v, · v = − g & z ≥ 0] 2gz ≤ 2gH − v2

slide-80
SLIDE 80

Rule for constant properties

To prove the validity of:


 it is enough to prove the validity of :

which is obvious. What about ?

Γ ⊢ P

fv(P) ∩ x = Ø

Γ ⊢ [·

x = e & Q]P (cst) Inv ⊢ [·

z = v, · v = − g & z ≥ 0] 0 < c ≤ 1 ∧ g > 0

Inv ⊢ 0 < c ≤ 1 ∧ g > 0 Inv ⊢ [·

z = v, · v = − g & z ≥ 0] 2gz ≤ 2gH − v2

slide-81
SLIDE 81

Invariant of a dynamics, and Lie derivative

  • Assume that

. We want something to ensure:

It is enough to require that is constant along the dynamics, that is, if is a solution

  • f

, then is constant, that is, its derivative is zero.

  • So it is enough that the function

to be zero along the dynamics.

·

x = e & Q

≃ (?Q; x := x + dt . e)

⋆; ?Q

Γ, Q ⊢ Inv

Inv, Q ⊢ Inv(x ← x + dt . e) Inv ⊢ P

Γ ⊢ [·

x = e & Q]P (dtI)

P = Inv ≡ f ≥ 0 f(ω) ≥ 0 ⇒ f(ω + dt . e(ω)) ≥ 0 f ψ ·

x = e

K : t ↦ f(ψ(t)) · K(t) = ∑

x∈x

∂f ∂x (ψ(t)) . · ψ(t) = ∑

x∈x

∂f ∂x(ψ(t)) . ex(ψ(t)) ℒe f = ∑

x∈x

∂f ∂x . ex

slide-82
SLIDE 82

Rule for differential invariants

To prove the validity of:


 it is enough to prove the validity of :

which is obvious and of:

which is true after computation of the Lie derivative.

Γ, Q ⊢ f ≥ 0 Γ ⊢ [·

x = e & Q]ℒe f = 0

Γ ⊢ [·

x = e & Q]f ≥ 0 (dI) Inv ⊢ [·

z = v, · v = − g & z ≥ 0] 2gz ≤ 2gH − v2

Inv, z ≥ 0 ⊢ 2gz ≤ 2gH − v2 Inv ⊢ [·

z = v, · v = − g & z ≥ 0] ℒe f = 0

slide-83
SLIDE 83

Bouncing ball

Notations: Sequents to prove: No more!

slide-84
SLIDE 84

Keymaera X https://web.keymaerax.org