• Keine Ergebnisse gefunden

Formale Modellierung Vorlesung 13 vom 14.07.2014: Hybride Systeme

N/A
N/A
Protected

Academic year: 2022

Aktie "Formale Modellierung Vorlesung 13 vom 14.07.2014: Hybride Systeme"

Copied!
62
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Formale Modellierung

Vorlesung 13 vom 14.07.2014: Hybride Systeme

Serge Autexier & Christoph Lüth

Universität Bremen

Sommersemester 2014

(2)

Fahrplan

I Teil I: Formale Logik

I Teil II: Spezifikation und Verifikation

I Formale Modellierung mit der UML und OCL

I Lineare Temporale Logik

I Temporale Logik und Modellprüfung

I Hybride Systeme

I Zusammenfassung, Rückblick, Ausblick

(3)

What are Hybrid Systems?

How are they modeled? Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata

How are properties specified? Temporal Logic

CTL as a Branching Temporal Logic ICTL - Integrator CTL

How are safety properties verified? Forward Reachability

Backward Reachability Location Elimination

Approximations for Affine Automata

Thanks to Andreas Nonnengart for the slides

(4)

What are Hybrid Systems?

How are they modeled?

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata

How are properties specified? Temporal Logic

CTL as a Branching Temporal Logic ICTL - Integrator CTL

How are safety properties verified? Forward Reachability

Backward Reachability Location Elimination

Approximations for Affine Automata

Thanks to Andreas Nonnengart for the slides

(5)

What are Hybrid Systems?

How are they modeled?

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata

How are properties specified?

Temporal Logic

CTL as a Branching Temporal Logic ICTL - Integrator CTL

How are safety properties verified? Forward Reachability

Backward Reachability Location Elimination

Approximations for Affine Automata

Thanks to Andreas Nonnengart for the slides

(6)

What are Hybrid Systems?

How are they modeled?

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata

How are properties specified?

Temporal Logic

CTL as a Branching Temporal Logic ICTL - Integrator CTL

How are safety properties verified?

Forward Reachability Backward Reachability Location Elimination

Approximations for Affine Automata

Thanks to Andreas Nonnengart for the slides

(7)

What are Hybrid Systems?

How are they modeled?

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata

How are properties specified?

Temporal Logic

CTL as a Branching Temporal Logic ICTL - Integrator CTL

How are safety properties verified?

Forward Reachability Backward Reachability Location Elimination

(8)

What are Hybrid Systems?

How are they modeled?

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata

How are properties specified?

Temporal Logic

CTL as a Branching Temporal Logic ICTL - Integrator CTL

How are safety properties verified?

Forward Reachability Backward Reachability

(9)

What are Hybrid Systems?

Alur, Henzinger et al

A hybrid system is a digital real-time system that is embedded in an analog environment. It interacts with the physical world through sensors and actuators.

Wikipedia

A hybrid system is a system that exhibits both continuous and discrete dynamic behavior – a system that can both flow (described by differential equations) and jump (described by a difference equation).

(10)

What are Hybrid Systems?

How are they modeled?

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata

How are properties specified?

Temporal Logic

CTL as a Branching Temporal Logic ICTL - Integrator CTL

How are safety properties verified?

Forward Reachability Backward Reachability

(11)

Finite Automata

A B

C D

E F

I There are vertices (states, locations) and edges (transitions)

I and maybe some input alphabet

I and maybe some “accepting” state

(12)

Finite Automata

A B

C D

E a F

b

a

c b

a b

c

I There are vertices (states, locations) and edges (transitions)

I and maybe some input alphabet

I and maybe some “accepting” state

(13)

Finite Automata

A B

C D

E a F

b

a

c b

a b

c

I There are vertices (states, locations) and edges (transitions)

I and maybe some input alphabet

I and maybe some “accepting” state

(14)

Discrete Automata

A B

C D

x=0;y=1

x=+2;

y++

x=-y

x:=xx

x5x:=x5

I there are variables involved, and they can be manipulated

I transitions may be guarded

I in general not finite state

(15)

Discrete Automata

A B

C D

x=0;y=1

x=+2;

y++

x=-y

x:=xx

x5x:=x5

I there are variables involved, and they can be manipulated

I transitions may be guarded

I in general not finite state

(16)

Timed Automata

I additionalclock variables

I they continuously increase their value in locations

I all of them behave identically

I only operation: reset to 0

x1

A

x2 x=0;y=0 B

x=1x:=0

x1x:=0,y:=0

(17)

Timed Automata

I additionalclock variables

I they continuously increase their value in locations

I all of them behave identically

I only operation: reset to 0

˙ x=1

˙ y=1 x1

A x˙=1

˙ y=1 x2 x=0;y=0 B

x=1x:=0

x1x:=0,y:=0

(18)

Multi-Phase Automata

I additional variables with a fixed rate, not only clocks

I they increase their value according to the rate

I thus not all of them behave identically

I arbitrary operations

˙ x=1

˙ y=0 x1

A x˙=1

˙ y=3 x2 x=0;y=0 B

x=1x:=0

x1x:=0,y:=0

(19)

Rectangular Automata

I additional variables with abounded rate

I they increase their value according to these bounds

I they represent arbitrary functions wrt/ bounds

I arbitrary operations

˙ x=1

˙ y[0,1]

x1

A x˙[1,2]

˙ y=3 x2 x=0;y=0 B

x=1x:=0

x1x:=0,y:=0

(20)

Railroad Gate Controller

(21)

Smart Factory

(22)

Affine Automata

I additional variables with arbitrary rate

I the rate may be in terms of the (other) variables

I they represent in general non-linear functions

I arbitrary operations

˙ x=y

˙ y=−x

x1

A x˙=y

˙ y=3y

x2 x=0;y=0 B

x=1x:=0

x1x:=0,y:=0

(23)

What are Hybrid Systems?

How are they modeled?

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata

How are properties specified?

Temporal Logic

CTL as a Branching Temporal Logic ICTL - Integrator CTL

How are safety properties verified?

Forward Reachability Backward Reachability

(24)

Temporal Logic - operators and ♦

Linear Temporal Logic

Interpretas Always, Henceforth, from now on Interpret♦ asEventually, Unavoidable

Branching Temporal Logic

Interpretas Always, Henceforth, from now on Interpret♦ asEventually in a possible future

(25)

Computation Tree Logic Illustrated

for each path - always

(26)

Computation Tree Logic Illustrated

∃♦ for some path - eventually

(27)

Computation Tree Logic Illustrated

∀♦ for each path - eventually

(28)

Computation Tree Logic Illustrated

for some path - always

(29)

Timed (Integrator) CTL

I add clock variables

I these may be used in formulas

I restrict these clocks to certain locations (stopwatches)

z.∃♦{A∧z ≤5}

c{N,M}.∀{P →c ≥12}

(30)

What are Hybrid Systems?

How are they modeled?

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata

How are properties specified?

Temporal Logic

CTL as a Branching Temporal Logic ICTL - Integrator CTL

How are safety properties verified?

Forward Reachability Backward Reachability

(31)

Safety Properties

A safety propertyis of the form

∀Φ

whereΦ is a classical logic formula (with arithmetics) We call a states safe if Φ(s) is true

It has to be shown that all reachable states are safe (forward reachability) or, equivalently,

It has to be shown that no unsafe state is reachable (backward reachability)

(32)

Forward Reachability

The Operator post(S) Given a set S of states

post(S) ={s | ∃s0S :s0 7→δ7→tr s}

Fixpoint Iteration

Start with S a the initial states

repeat until post(S)S:S :=Spost(S) Finally

Check whether Φ(S) holds

(33)

Backward Reachability

The Operator pre(S) Given a set S of states

pre(S) ={s | ∃s0S :s 7→tr7→δs0} Fixpoint Iteration

Start with S={s | ¬Φ(s)}

repeat until pre(S)S:S :=Spre(S) Finally

Check whether the initial state is contained in S

(34)

Example: Leaking Gas Burner

˙ x=1

˙ y=1

˙ z=1 x1

Leak

˙ x=1

˙ y=0

˙ z=1

NonLeak

x=0;y=0;z:=0

x1x:=0

x30x:=0

Safety Property

z ≥60→20∗yz I ={Leak(0,0,0)}

post(I) ={Leak(x,y,z)|0≤x ≤1,y =x,z =x}

∪ {NonLeak(0,y,z)|0≤y≤1,z =y}

(35)

Example: Leaking Gas Burner

˙ x=1

˙ y=1

˙ z=1 x1

Leak

˙ x=1

˙ y=0

˙ z=1

NonLeak

x=0;y=0;z:=0

x1x:=0

x30x:=0

Safety Property

z ≥60→20∗yz

I ={Leak(0,0,0)}

post(I) ={Leak(x,y,z)|0≤x ≤1,y =x,z =x}

∪ {NonLeak(0,y,z)|0≤y≤1,z =y}

(36)

Example: Leaking Gas Burner

˙ x=1

˙ y=1

˙ z=1 x1

Leak

˙ x=1

˙ y=0

˙ z=1

NonLeak

x=0;y=0;z:=0

x1x:=0

x30x:=0

Safety Property

z ≥60→20∗yz I ={Leak(0,0,0)}

post(I) ={Leak(x,y,z)|0≤x ≤1,y =x,z =x}

(37)

Problem: Long Loops

˙ x=1

˙ u=1

˙ v=1

˙ w=1 x1

˙ x=1

˙ u=1

˙ v=0

˙ w=0 x2

˙ x=1

˙ u=1

˙ v=1

˙ w=0 x2

x,u,v,w=0 x:=0

x1x:=0 x2x:=0

Property (many iterations)

∀(u ≥154→5.9∗wu+v)

(38)

Another Problem: Termination

˙ x=1

˙ y=1 x1

˙ x=1

˙ y=1 x1

˙ x=1

˙ y=1 x1

˙ x=1

˙ y=1 x1

x,y:=0 x,y:=0

x:=0

y= 2

x:=0 x:=0

x:=0;y:=y1

(39)

Location Elimination

General Idea

I Compute the responsibility for a location once and for all

I thereby compute adefinition for this location

I insertthis definition into the automaton

I delete the location (and all the transitions to and fro)

(40)

Elimination Example

A

˙ x=2

˙ y=1 xy

B C

xy x=yx,y:=0

x+y ≤10

Reachability Theory for B A(x,y)xyB(x,y) B(x,y)xy

B(x,y)x+y ≤10

B(x,y)→ ∀δ 0≤δx0 =x+2δ∧y0 =y+δx0y0B(x0,y0) B(x,y)x =yC(0,0)

(41)

Elimination Example

A

˙ x=2

˙ y=1 xy

B C

xy x=yx,y:=0

x+y ≤10 Reachability Theory for B

A(x,y)xyB(x,y) B(x,y)xy

B(x,y)x+y ≤10

B(x,y)→ ∀δ 0≤δx0 =x+2δ∧y0 =y+δx0y0B(x0,y0) B(x,y)x =yC(0,0)

(42)

Elimination Approach

Reachability Theory simplified A(x,y)xyB(x,y) B(x,y)xy

B(x,y)x+y ≤10

B(x,y)xx0x+2∗y0 =x0+2∗yx0y0B(x0,y0) B(x,y)x =yC(0,0)

Fixpoint Computation (Definition forB) B(x,y)xyC(0,0)

B(x,y)xy →2∗yx+5 Insertion (in A)

A(x,y)xyC(0,0) A(x,y)xy →2∗yx+5

(43)

Elimination Approach

Reachability Theory simplified A(x,y)xyB(x,y) B(x,y)xy

B(x,y)x+y ≤10

B(x,y)xx0x+2∗y0 =x0+2∗yx0y0B(x0,y0) B(x,y)x =yC(0,0)

Fixpoint Computation (Definition forB) B(x,y)xyC(0,0)

B(x,y)xy →2∗yx+5

Insertion (in A)

A(x,y)xyC(0,0) A(x,y)xy →2∗yx+5

(44)

Elimination Approach

Reachability Theory simplified A(x,y)xyB(x,y) B(x,y)xy

B(x,y)x+y ≤10

B(x,y)xx0x+2∗y0 =x0+2∗yx0y0B(x0,y0) B(x,y)x =yC(0,0)

Fixpoint Computation (Definition forB) B(x,y)xyC(0,0)

B(x,y)xy →2∗yx+5 Insertion (inA)

A(x,y)xyC(0,0)

(45)

Elimination Result

A

˙ x=2

˙ y=1 xy

B C

xy x=yx,y:=0

x+y ≤10

A C

xyx,y:=0

xy →2y ≤x+5 ∀x+y ≤10

(46)

Elimination Result

A

˙ x=2

˙ y=1 xy

B C

xy x=yx,y:=0

x+y ≤10

A C

xyx,y:=0

xy →2y ≤x+5 ∀x+y ≤10

(47)

Elimination Approach

Advantages

I with each elimination the verification problem decreases

I no need for multiple turns through the automaton

I in a sensemixes(and generalizes) standard reachability approaches

(48)

What are Hybrid Systems?

How are they modeled?

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata

How are properties specified?

Temporal Logic

CTL as a Branching Temporal Logic ICTL - Integrator CTL

How are safety properties verified?

Forward Reachability Backward Reachability

(49)

Approximation of Affine Behavior

˙ x=y

˙ y=−x x[0,1]

y[0,1]

x=0y=1

˙ x[0,1]

˙ y[−1,0]

x[0,1] y[0,1] x=0y=1

1 x 1

y

(50)

Approximation of Affine Behavior

˙ x=y

˙ y=−x x[0,1]

y[0,1]

x=0y=1

˙ x[0,1]

˙ y[−1,0]

x[0,1]

y[0,1]

x=0y=1

1 x 1

y

(51)

Approximation of Affine Behavior

˙ x=y

˙ y=−x x[0,1]

y[0,1]

x=0y=1

˙ x[0,1]

˙ y[−1,0]

x[0,1]

y[0,1]

x=0y=1

1 x 1

y

(52)

Location Splitting

˙ x=y

˙ y=−x x[0,1]

y[0,1]

x=0y=1

˙ x=y

˙ y=−x x[0,0.5]

y[0,1]

˙ x=y

˙ y=−x x[0.5,1]

y[0,1]

x=0y=1 x=0.5

(53)

Location Splitting

˙ x=y

˙ y=−x x[0,1]

y[0,1]

x=0y=1

˙ x=y

˙ y=−x x[0,0.5]

y[0,1]

˙ x=y

˙ y=−x x[0.5,1]

y[0,1]

x=0y=1 x=0.5

(54)

One More Splitting

˙ x=y

˙ y=−x x[0,0.5]

y[0.5,1]

˙ x=y

˙ y=−x x[0.5,1]

y[0,1]

˙ x=y

˙ y=−x x[0,0.5]

y[0,0.5]

x=0y=1 x=0.5

y=

0.5 x=0.5

(55)

One More Splitting

˙ x[0.5,1]

˙

y[−0.5,0]

x[0,0.5]

y[0.5,1]

˙ x[0.5,1]

˙

y[−0.5,0]

x[0.5,1]

y[0,1]

˙ x[0.5,1]

˙

y[−0.5,0]

x[0,0.5]

y[0,0.5]

x=0y=1 x=0.5

y=

0.5 x=0.5

(56)

Eliminating A

Positive A-clauses

x=0y=1A(x,y) initial state

B(x,y)x=0.5y[0.5,1]A(x,y) fromBtoA

C(x,y)y=0.5x[0,0.5]A(x,y) fromCtoA

A(x,y)y0yx0[0,0.5]y0[0.5,1]x+yx0+y0A(x0,y0) continuous change

Fixpoint Computation and Definition of A

x[0,0.5]y[0.5,1]1x+yA(x,y)

C(x,y)y=0.5y0=0.5x[0,0.5]xx0x0[0,0.5]A(x0,y0)

Insertion of A’s Definition

x=0.5y[0.5,1]B(x,y) x=0.5y=0.5C(x,y)

C(x,y)x[0,0.5]y=0.5x0[x,0.5]y0=yC(x0,y0)

(57)

After Eliminating A

˙ x=y

˙ y=−x x[0.5,1]

y[0,1]

B

˙ x=y

˙ y=−x x[0,0.5]

y[0,0.5]

C

x=0.5

x=0.5y=0.5 x=0.5y[0.5,1]

x[0,0.5]y=0.5x:∈[x,0.5]

(58)

Eliminating C

Positive C-clauses

x=0.5y=0.5C(x,y)

B(x,y)x=0.5y[0,0.5]C(x,y)

C(x,y)xx0y0yx0[0,0.5]y0[0,0.5]C(x0,y0)

Fixpoint Computation and Definition of C

x=0.5y[0,0.5]C(x,y)

B(x,y)x=0.5y[0,0.5]x0=0.5y0[0,y]C(x0,y0)

Insertion of C’s Definition

x=0.5y[0,0.5]B(x,y)

B(x,y)x=0.5y[0,0.5]x0=0.5y0[0,y]B(x0,y0)

(59)

After Eliminating C

˙ x=y

˙ y=−x x[0.5,1]

y[0,1]

B

x=0.5y[0.5,1]

x=0.5y[0,0.5]

x=0.5y[0,0.5]y:∈[0,y]

(60)

Eliminating B

Positive B-clauses

x=0.5y[0.5,1]B(x,y) x=0.5y[0,0.5]B(x,y)

B(x,y)xx0y0yx0+2y0x+2yx0[0.5,1]y0[0,1]B(x0,y0)

Fixpoint Computation and Definition of B

x+2y2.5x[0.5,1]y[0,1]B(x,y)

Final Insertion and Result

x[0,0.5]y[0.5,1]1x+yA(x,y) x+2y2.5x[0.5,1]y[0,1]B(x,y) x=0.5y[0,0.5]C(x,y)

(61)

After Eliminating All

1 x

1 y

A

B C

(62)

Summary

I Modelling of systems withcontinuousstate changes requires different techniques

I Inspired by state machines, but with continuous behaviour in states expressed by first derivatives

I Different aspects

I Timed Automata

I Multi-Phase Automata

I Rectangular Automata

I Affine Automata

I Properties formulated using CTL;

Referenzen

ÄHNLICHE DOKUMENTE

We prove that there exist context-free languages which cannot be accepted by any blackhole PDA with a sublinear depth function and any blackhole R-sPDA with a sublinear depth

Similarly, we prove that n-turn all-move self-regulating finite automata give rise to an infinite hierarchy of language families coinciding with the hierarchy resulting from (n

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata How are properties specified.

Finite Automata Discrete Automata Timed Automata Multi-Phase Automata Rectangular Automata Affine Automata How are properties specified.

Gabriele R¨ oger (University of Basel) Theory of Computer Science March 8, 2021 5 /

describing a run of an automaton over a single branch of the input tree A branch of a computational tree is accepting iff all infinite histories associated with it are accepting A

(a) Consider the following automata, describing a client server system where the client can request resources and the server may grant or deny

Roland Meyer (TU KL) Applied Automata Theory (WiSe 2013) 2 / 161... Table of