Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton,...

63
1 Towards Efficient Set Representations in SpaceEx Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler Université Grenoble 1 Joseph Fourier / CNRS – Verimag, France Colas Le Guernic New York University CIMS Antoine Girard Laboratoire Jean Kuntzmann, France NSV Workshop, Snowbird, UT, July 14, 2011

Transcript of Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton,...

Page 1: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

1

Towards Efficient Set Representations

in SpaceEx

Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarsh i Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

Université Grenoble 1 Joseph Fourier / CNRS – Verimag, France

Colas Le GuernicNew York University CIMS

Antoine Girard Laboratoire Jean Kuntzmann, France

NSV Workshop, Snowbird, UT, July 14, 2011

Page 2: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

2

Outline

Hybrid Systems Reachability– Modeling Hybrid Systems

SpaceEx Approximation Algorithm– Time Elapse Computation with Support Functions

– Transition Successors Mixing Support Functions and Polyhedra

– Fixpoint Algorithm: Clustering & Containment

SpaceEx Verification Platform– Examples

Page 3: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

3

Modeling Hybrid Systems

Example: Bouncing Ball– ball with mass m and position x in free fall

– bounces when it hits the ground at x = 0

– initially at position x and at rest

x

0

Fg

Page 4: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

4

Condition for Free Fall– ball above ground:

First Principles (physical laws)

Part I – Free Fall

• gravitational force :Fg = −mg

g = 9.81m/s2

• Newton's law of motion :mx = Fg

x ≥ 0 x

0

Fg

Page 5: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

5

Obtaining 1 st Order ODE System

Part I – Free Fall

Fg = −mgmx = Fg

• ordinary differential equation x = f(x)

• transform to 1st order by introducing variablesfor higher derivatives

• here: v = x:x = vv = −g

x

0

Fg

Page 6: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

6

Part II – Bouncing

Conditions for “Bouncing”

Action for “Bouncing”

• ball at ground position: x = 0

• downward motion: v < 0

• velocity changes direction

• loss of velocity (deformation, friction)

• v := −cv, 0 ≤ c ≤ 1

Page 7: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

7

Combining Part I and II

Free Fall

Bouncing

• while x ≥ 0,x = vv = −g

• if x = 0 and v < 0v := −cv

continuous dynamics

discrete dynamics

x = f(x)

x ∈ Gx := R(x)

Page 8: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

8

Hybrid Automaton Model

x ≥ 0 bounce

x = 0 ∧ v < 0v := −cv

freefall

x = vv = −g

x = x0v = 0

flow

location

invariant

discrete transition

guard

label

reset

initial conditions

Page 9: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

9

Hybrid Automata - Semantics

Run– sequence of time elapse and discrete transitions

Execution– run that starts in the initial states

x(t)

x(t)

x(t)

Page 10: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

10

Execution of Bouncing Ball

time t

position x

x(t)x(t)

x(t)x(t)

x(t)

δ δ δ δ δ

x

0

time t

velocity v

v(t)v(t)

v(t)v(t)

v(t)

δ δ δ δ δ

v

0

Page 11: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

11

Execution of Bouncing Ball

State-Space View (infinite time range)

position x

velocity v

discrete transition

x

0

x(t)

x(t)

x(t)

Page 12: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

12

Compute successor states

0

R0

Computing Reachable States

R1=Postc(R0)

R2=Postd(R1)

R3=Postc(R2)

Page 13: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

13

Computing Reachable States

Fixpoint computation

Problems– in general termination not guaranteed

– time-elapse very hard to compute with sets

• Initialization: R0 = Ini

• Recurrence: Rk+1 = Rk ∪ Postd(Rk) ∪ Post c(Rk)

• Termination: Rk+1 = Rk ⇒ Reach = Rk.

Page 14: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

14

Outline

Hybrid Systems Reachability– Modeling Hybrid Systems

SpaceEx Approximation Algorithm– Time Elapse Computation with Support Functions

– Transition Successors Mixing Support Functions and Polyhedra

– Fixpoint Algorithm: Clustering & Containment

SpaceEx Verification Platform– Examples

Page 15: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

15

Time Elapse with Affine Dynamics

Affine Flow– nondeterministic affine differential equation:

Solve with superposition principle– disregard inputs: “autonomous dynamics”

– add inputs afterwards

Page 16: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

16

Linear Dynamics

“Autonomous” part of the dynamics:

Known solutions:– analytic solution in continuous time

– explicit solution at discrete points in time (up to arbitrary accuracy)

Approach for Reachability:– Compute reachable states over finite time: Reach[0,T](XIni)

– Use time-discretization, but with care!

x = Ax, x ∈ Rn

Page 17: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

17

Time-Discretization for an Initial Point

Analytic solution:

Explicit solution in discretized time (recursive):x0 = xInixk+1 = eAδxk

x(t) = eAtxIni

2δ 3δδ0

x0x1

x2

x3

t

x(t)

multiplication with const. matrix eAδ

= linear transform

x(δ(k + 1)) = eAδx(δk)

• with t = δk :

Page 18: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

18

Time-Discretization for an Initial Set

Explicit solution in discretized time

Acceptable solution for purely continuous systems– x(t) is in ǫ(δ)-neighborhood of some Xk

Unacceptable for hybrid systems– discrete transitions might “fire” between sampling times

– if transitions are “missed,” x(t) not in ǫ(δ)-neighborhood

2δ 3δδ0

X0

X1

X2

X3

t

X0 = XIni

Xk+1 = eAδXk

Reach[0,3δ](XIni)

Page 19: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

19

One can miss jumps– intersection with guard set

Time Discretization for Hybrid Systems

guard

flowpipe sets in discretized time

X1X2

jump not visible in discretization

Page 20: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

20

Bouncing Ball

– In other examples this error might not be as obvious…

X90= ∅

Page 21: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

21

Goal:– Compute sequence Ωk over bounded time [0,Nδ] such that:

Approach:– Refine Ωk by recurrence:

– Condition for Ω:

Reachability by Time-Discretization

Reach[0,Nδ](XIni) ⊆ Ω0 ∪ Ω1 ∪ . . . ∪ ΩN

2δ 3δδ0 t

Reach[0,3δ](XIni)

Ω0

Ω1

Ω2

Ωk+1 = eAδΩk

Reach[0,δ](XIni) ⊆ Ω0

Page 22: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

22

Nondeterministic Affine Dynamics

Let’s include the effect of inputs:

– variables x,…,xn, inputs u,…,up

Input u models nondeterminism– disturbances etc.

– can be used for overapproximating nonlinear dynamics(U = bounds of approximation error)

Page 23: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

23

Nondeterministic Affine Dynamics

Superposition Principle

2δ 3δδ0 t

Reach[0,3δ](XIni)

influence of inputs

autonomousdynamics

influence ofinputs

Page 24: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

24

Set overapproximation of input influence– How far can the input “push” the system in δ time?

– from Taylor series expansion

Operators:– Minkowski Sum:

– Symmetric Bounding Box:

– Linear Transform

Nondeterministic Affine Dynamics

A⊕B = a+ b | a ∈ A, b ∈ B

(error bound)

(matrix)

(input influence set)

Page 25: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

25

Nondeterministic Affine Dynamics

Recurrence equation with influence of inputs

Still needed:– approximation of the

initial time step with Ω0

– called “approximation model”

2δ 3δδ0 t

Ω0

Ω1

Ω2

Page 26: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

26

Approximating Initial Time Step– Previous Work

convex hull constraints + bloat with ∼∼∼∼ e||A||δ

Asarin, Dang et al., HSCC 2000

error large and uniform

exponential cost

bloat last set with ∼∼∼∼ e||A||δ

+ convex hull Le Guernic, Girard, CAV 2009

error large and uniform

Page 27: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

27

intersect forward and backward approximations

if no inputs:exact at tttt=0=0=0=0 and tttt====δδδδ

Approximating Initial Time Step

approximate set separately for each tttt

error small and non-uniformbloat with ∼∼∼∼ eabs(A)δAX0

Ωt

Page 28: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

28

New Approximation Model

for each tttt: overapproximate Reach[[[[tttt,,,,tttt]]]] with ΩΩΩΩtttt

linear interpolation between X0 and Xδ = eAδ X0

error bound from Taylor approximation around t = 0 and around t = δ

Taylor approximation of inputs with error bound

Page 29: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

29

New Approximation Model

overapproximate Reach[[[[0000,,,, δδδδ]]]] with convex hullof time instant approximations

error terms: symmetric bounding boxes

Page 30: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

30

New Approximation Model

overapproximate Reach[[[[0000,,,, δδδδ]]]] with convex hullof time instant approximations

smaller overall error with math tricks– Taylor approx. of interpolation error

– bound remainder with absolute value sum instead of matrix norm

Page 31: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

31

New Approximation Model

What Set Representation to Use?

++--+--Convex hull

Polyhedra

Operators Constraints Vertices Zonotopes Support F.

Linear transform +/- ++ ++ ++

Minkowski sum -- -- ++ ++

Page 32: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

32

Support Functions

0

d

max. signed distance of P to origin projected in direction d

P

Page 33: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

33

Support Functions

0

If we know the value of ρP (d), we know P is in the halfspace

d

P

Page 34: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

34

d1

Support Functions

0

If we know ρP (d1), ρP (d2),… we know P is inside the intersection of the halfspaces= outer polyhedral approx.

d2

d3

d2

P

Page 35: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

35

Computing with Support Functions

Needed operations are simple

– Linear Transform:

– Minkowski sum:

– Convex hull:

Implement as function objects– can add more directions at any time

C. Le Guernic, A.Girard. Reachability analysis of hybrid systems using support functions. CAV’09

Page 36: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

36

New Approximation Model

Efficiently computable with support functions

chull of union ⇒ max

intersection of axis aligned boxes⇒ solution of pw linear function

Page 37: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

37

Efficiently computable with support functions

– maximize piecewise quadratic scalar functionfor each template direction

New Approximation Model

quadratic term

solution for intersection of axis aligned boxes

Page 38: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

38

New Approximation Model

Error bounds for each template direction dddd

– used to choose time steps

Page 39: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

39

Extension to Variable Time Steps

adapt to error

different time scale for each direction– new approximation model can interpolate

cost: recompute matrix eAδ

– cache matrix

X0

x

t2 t3t10 t

Ω0

Ω1

Ω2

Page 40: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

40

Intersection with Invariant

++--+--Convex hull

Polyhedra

Operators Constraints Vertices Zonotopes Support F.

Affine transform +/- ++ ++ ++

Minkowski sum -- -- ++ ++

Intersection ++ -- -- -

Page 41: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

41

Computing Time Elapse

Linear Map

Minkowski Sum Invariant Intersection

Convex Hull

Support Functions Polyhedra

overapprox.

Initial Set Initial Set

Page 42: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

42

Outline

Hybrid Systems Reachability– Modeling Hybrid Systems

SpaceEx Approximation Algorithm– Time Elapse Computation with Support Functions

– Transition Successors Mixing Support Functions and Polyhedra

– Fixpoint Algorithm: Clustering & Containment

SpaceEx Verification Platform– Examples

Page 43: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

43

Computing Transition Successors

Intersection with guard– use outer poly approximation

Linear map &Minkowski sum– with polyhedra if invertible

(map regular, input set a point)

– otherwise use support functions

Intersection with target invariant– use outer poly approximation

x ≥ 0

bounce

x = 0 ∧ v < 0v := −cv

freefall

x = vv = −g

x = x0v = 0

guard

reset

Page 44: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

44

Computing Transition Successors

Linear Map

Minkowski Sum

Invariant Intersection

Guard Intersection

Support Functions Polyhedra

overapprox.

Linear Map

Minkowski Sum

map reversible

irreversibleexact (LP)

Page 45: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

45

Fixpoint Computation

Standard fixpoint algorithm– Alternate time elapse and transition successor computation

– Stop if new states are contained in old states

Problem: flowpipe = union of many sets– number of flowpipes may explode with exploration depth

– containment very difficult on unions

Solution: – reduce number after jump through clustering

– use sufficient conditions for containment

– nested depth of support function calls is limited due to outer poly.

Page 46: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

46

Clustering

After discrete jump, every convex set spawns a new flowpipe

Reduce number to avoid explosion

How many sets?

Bound approximation error

guard

Page 47: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

47

Clustering – Template Hull

Template Hull = Outer polyhedron for template directoins

guard

template hull up to given error bound

⇒⇒⇒⇒ low number of sets

small error

Page 48: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

48

Clustering

Even a low number of sets might be still too much

guard

2 sets ⇒⇒⇒⇒ possibly2k sets at iteration k

cluster again usingconvex hull

⇒⇒⇒⇒ 1 set, good accuracy

Page 49: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

49

Transition Successors with Clustering

Support Functions Polyhedra

Invariant Intersectionoverapprox.

Linear Map

Minkowski Sum

Guard Intersection

Linear Map

Minkowski Sum

map reversible

irreversibleexact (LP)

Convex Hull

Template Hull

after intersection becausecontained in convex invariant

Page 50: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

50

Sufficient Conditions for Containment

“Cheap” containment

– pairwise comparison

– comparison only with initial set of flowpipe

Clustering helps

– delays containment one iteration if clustering to a single set

Page 51: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

51

Summary: Fixpoint Computation

Support Functions Polyhedra

Time Elapse

Initial Set

Clustering

Transition Successors

Containment Check

Page 52: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

52

Outline

Hybrid Systems Reachability– Modeling Hybrid Systems

SpaceEx Approximation Algorithm– Time Elapse Computation with Support Functions

– Transition Successors Mixing Support Functions and Polyhedra

– Fixpoint Algorithm: Clustering & Containment

SpaceEx Verification Platform– Examples

Page 53: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

53

SpaceEx Web Interface

Page 54: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

54

SpaceEx Model Editor

Page 55: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

55

Example 1: Switched Oscillator

Switched oscillator– 2 state variables

– similar to many circuits(Buck converters,…)

plus mth order filter– dampens output signal

Piecewise affine dynamics– 4 discrete states

– total 2 + m continuous state variables

Page 56: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

56

Example 1: Switched Oscillator

Connecting Filter Components

Page 57: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

57

Example 1: Switched Oscillator

Low number of direction sufficent– here: 6 state variables

12 box constraints(axis directions)

72 octagonal constraints(± xi ± xj)

Page 58: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

58

first jump has 57 sets ⇒⇒⇒⇒ impossible w/o clustering

Template Hull and Convex Hull Clustering

11.5 sec 3.6 sec

3.4 sec 8.2 sec

Page 59: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

59

Example 1: Switched Oscillator

Scalable:– fixpoint reached in O(nm2) time

– box constraints: O(n3)

– octagonal constraints: O(n5)

Clustering necessary– 57 sets take first jump

– combination of template and convex hull:compromise in speed and accuracy

number of variables n

runt

ime

[s]

Page 60: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

60

Example 2: Controlled Helicopter

28th order linear model– 8th order model of an (actual) helicopter

– 20th order disturbance rejection controller

Performance:– old approx.: 200s

– new approx.: 24s

– variable time step: 14s(without interpolation)

Guaranteed error– < 0.025

Page 61: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

61

Example 2: Controlled Helicopter

Comparison of two controllers for nondeterministic inputs

Page 62: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

62

Conclusions

Classic problems mitigated to “softer” problems– no more explosion with number of variables

– complexity increases with

• accuracy needed (less explosive)

• nb. of constraints (for Hausdorff error: exponential)

Important algorithmic improvements– switching set representations for best efficiency

– variable time step with error bounds

– interpolation ⇒⇒⇒⇒ different time scale for each direction

– clustering

Page 63: Towards Efficient Set Representations in SpaceEx · Goran Frehse, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Manish Goyal, Rodolfo Ripado, Thao Dang, Oded Maler

63

Bibliography

Affine Dynamics

– E. Asarin, O. Bournez, T. Dang, and O. Maler. Approximate Reachability

Analysis of Piecewise-Linear Dynamical Systems. HSCC’00

– A. Girard, C. Le Guernic, and O. Maler. Efficient computation of reachable sets

of linear time-invariant systems with inputs. HSCC’06

Support Functions

– C. Le Guernic, A.Girard. Reachability analysis of hybrid systems using support

functions. CAV’09

– G. Frehse, R. Ray. Design Principles for an Extendable Verification Tool for

Hybrid Systems. ADHS’09