• Non ci sono risultati.

Introduction to Formal Methods Chapter 11: Timed and Hybrid Systems

N/A
N/A
Protected

Academic year: 2021

Condividi "Introduction to Formal Methods Chapter 11: Timed and Hybrid Systems"

Copied!
284
0
0

Testo completo

(1)

Introduction to Formal Methods Chapter 11: Timed and Hybrid Systems

Roberto Sebastiani

DISI, Università di Trento, Italy – roberto.sebastiani@unitn.it URL: http://disi.unitn.it/rseba/DIDATTICA/fm2020/

Teaching assistant:Enrico Magnago– enrico.magnago@unitn.it

CDLM in Informatica, academic year 2019-2020

last update: Sunday 24thMay, 2020, 20:09

Copyright notice: some material (text, figures) displayed in these slides is courtesy of R. Alur, M. Benerecetti, A. Cimatti, M.

Di Natale, P. Pandya, M. Pistore, M. Roveri, and S.Tonetta, who detain its copyright. Some exampes displayed in these slides are taken from [Clarke, Grunberg & Peled, “Model Checking”, MIT Press], and their copyright is detained by the authors. All the other material is copyrighted by Roberto Sebastiani. Every commercial use of this material is strictly forbidden by the copyright laws without the authorization of the authors. No copy of these slides can be displayed in public

without containing this copyright notice.

(2)

Outline

1

Motivations

2

Timed systems: Modeling and Semantics Timed automata

3

Symbolic Reachability for Timed Systems Making the state space finite

Region automata Zone automata

4

Hybrid Systems: Modeling and Semantics Hybrid automata

5

Symbolic Reachability for Hybrid Systems

Multi-Rate and Rectangular Hybrid Automata

Linear Hybrid Automata

(3)

Motivations

Outline

1

Motivations

2

Timed systems: Modeling and Semantics Timed automata

3

Symbolic Reachability for Timed Systems Making the state space finite

Region automata Zone automata

4

Hybrid Systems: Modeling and Semantics Hybrid automata

5

Symbolic Reachability for Hybrid Systems Multi-Rate and Rectangular Hybrid Automata Linear Hybrid Automata

6

Exercises

(4)

Motivations

Acknowledgments

Thanks for providing material to:

Rajeev Alur & colleagues (Penn University) Paritosh Pandya (IIT Bombay)

Andrea Mattioli, Yusi Ramadian (Univ. Trento) Marco Di Natale (Scuola Superiore S.Anna, Italy)

Disclaimer

very introductory very-partial coverage

mostly computer-science centric

(5)

Motivations

Acknowledgments

Thanks for providing material to:

Rajeev Alur & colleagues (Penn University) Paritosh Pandya (IIT Bombay)

Andrea Mattioli, Yusi Ramadian (Univ. Trento) Marco Di Natale (Scuola Superiore S.Anna, Italy)

Disclaimer

very introductory very-partial coverage

mostly computer-science centric

(6)

Motivations

Hybrid Modeling

Hybrid machines = State machines + Dynamic Systems

(7)

Motivations

Hybrid Modeling: Examples

Automotive Applications

Vehicle Coordination Protocols Interacting Autonomous Robots

Bio-molecular Regulatory

Networks

(8)

Motivations

Hybrid Modeling: Examples

Automotive Applications Vehicle Coordination Protocols

Interacting Autonomous Robots

Bio-molecular Regulatory

Networks

(9)

Motivations

Hybrid Modeling: Examples

Automotive Applications Vehicle Coordination Protocols Interacting Autonomous Robots

Bio-molecular Regulatory

Networks

(10)

Motivations

Hybrid Modeling: Examples

Automotive Applications Vehicle Coordination Protocols Interacting Autonomous Robots

Bio-molecular Regulatory

Networks

(11)

Timed systems: Modeling and Semantics

Outline

1

Motivations

2

Timed systems: Modeling and Semantics Timed automata

3

Symbolic Reachability for Timed Systems Making the state space finite

Region automata Zone automata

4

Hybrid Systems: Modeling and Semantics Hybrid automata

5

Symbolic Reachability for Hybrid Systems Multi-Rate and Rectangular Hybrid Automata Linear Hybrid Automata

6

Exercises

(12)

Timed systems: Modeling and Semantics Timed automata

Outline

1

Motivations

2

Timed systems: Modeling and Semantics Timed automata

3

Symbolic Reachability for Timed Systems Making the state space finite

Region automata Zone automata

4

Hybrid Systems: Modeling and Semantics Hybrid automata

5

Symbolic Reachability for Hybrid Systems

Multi-Rate and Rectangular Hybrid Automata

Linear Hybrid Automata

(13)

Timed systems: Modeling and Semantics Timed automata

Timed Automata

(14)

Timed systems: Modeling and Semantics Timed automata

Example: Simple light control

Requirement:

if Off and press is issued once, then the light switches on;

if Off and press is issued twice quickly, then the light gets brighter;

if Light/Bright and press is issued once, then the light switches off;

(15)

Timed systems: Modeling and Semantics Timed automata

Example: Simple light control

Solution: add real-valued clock x

x reset at first press

if next press before x reaches 3 time units, then the light will get brighter;

otherwise the light is turned off

(16)

Timed systems: Modeling and Semantics Timed automata

Modeling: timing constraints

Finite graph + finite set of (real-valued) clocks

Vertexes are locations

Time can elapse there Constraints (invariants)

Edges are switches

Subject to constraints Reset clocks

(17)

Timed systems: Modeling and Semantics Timed automata

Timed Automata

Locations l

1

, l

2

, ... (like in standard automata)

discrete part of the state

may be implemented by discrete variables

Switches (discrete transitions like in standard aut.) Labels, aka events, actions,... (like in standard aut.)

used for synchronization

Clocks: x, y,... ∈ Q

+

value: time elapsed since the last time it was reset

Guards: (x ./ C) s.t. ./ ∈ {≤, <, ≥, >}, C ∈ N

set of clock comparisons against integers bounds constrain the execution of the switch

Resets (x := 0)

set of clock assignments to 0

Invariants: (x ./ C) s.t. ./ ∈ {≤, <, ≥, >}, C ∈ N

set of clock comparisons against integers bounds ensure progress

a l1

l2

(18)

Timed systems: Modeling and Semantics Timed automata

Timed Automata

Locations l

1

, l

2

, ... (like in standard automata)

discrete part of the state

may be implemented by discrete variables

Switches (discrete transitions like in standard aut.) Labels, aka events, actions,... (like in standard aut.)

used for synchronization

Clocks : x, y,... ∈ Q

+

value: time elapsed since the last time it was reset

Guards : (x ./ C) s.t. ./ ∈ {≤, <, ≥, >}, C ∈ N

set of clock comparisons against integers bounds constrain the execution of the switch

Resets (x := 0)

set of clock assignments to 0

Invariants: (x ./ C) s.t. ./ ∈ {≤, <, ≥, >}, C ∈ N

set of clock comparisons against integers bounds ensure progress

(x ≥ 4) (y ≤ 2) a

y := 0 l1

l2

(19)

Timed systems: Modeling and Semantics Timed automata

Timed Automata

Locations l

1

, l

2

, ... (like in standard automata)

discrete part of the state

may be implemented by discrete variables

Switches (discrete transitions like in standard aut.) Labels, aka events, actions,... (like in standard aut.)

used for synchronization

Clocks: x, y,... ∈ Q

+

value: time elapsed since the last time it was reset

Guards: (x ./ C) s.t. ./ ∈ {≤, <, ≥, >}, C ∈ N

set of clock comparisons against integers bounds constrain the execution of the switch

Resets (x := 0)

set of clock assignments to 0

Invariants : (x ./ C) s.t. ./ ∈ {≤, <, ≥, >}, C ∈ N

set of clock comparisons against integers bounds ensure progress

(x ≥ 4) (y ≤ 2) a

y := 0 l1

(x ≤ 5)

l2

(x > 4) (y ≤ 3)

(20)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i:

OK!

hl2,2, 4i:

not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i:

OK!

hl1,6, 2i−→ hla 2,6, 0i:

not OK!(violates invar. in l1)

hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(21)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i:

OK! hl2,2, 4i:

not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i:

OK!

hl1,6, 2i−→ hla 2,6, 0i:

not OK!(violates invar. in l1)

hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(22)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:

not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i:

OK!

hl1,6, 2i−→ hla 2,6, 0i:

not OK!(violates invar. in l1)

hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(23)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:

not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i:

OK!

hl1,6, 2i−→ hla 2,6, 0i:

not OK!(violates invar. in l1)

hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(24)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i:

OK!

hl1,6, 2i−→ hla 2,6, 0i:

not OK!(violates invar. in l1)

hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(25)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i:

OK!

hl1,6, 2i−→ hla 2,6, 0i:

not OK!(violates invar. in l1)

hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(26)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i:

OK! hl1,6, 2i−→ hla 2,6, 0i:

not OK!(violates invar. in l1)

hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(27)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:

not OK!(violates invar. in l1)

hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(28)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:

not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(29)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1)

hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(30)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:

not OK!(violates guard) hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(31)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:not OK!(violates guard)

hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(32)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:not OK!(violates guard) hl1,4.5, 2i−→ hla 2,4.5, 2i:

not OK!(violates reset) hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(33)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:not OK!(violates guard) hl1,4.5, 2i−→ hla 2,4.5, 2i:not OK!(violates reset)

hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(34)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:not OK!(violates guard) hl1,4.5, 2i−→ hla 2,4.5, 2i:not OK!(violates reset) hl1,4, 2i−→ hla 2,4, 0i:

not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(35)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:not OK!(violates guard) hl1,4.5, 2i−→ hla 2,4.5, 2i:not OK!(violates reset) hl1,4, 2i−→ hla 2,4, 0i:not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(36)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:not OK!(violates guard) hl1,4.5, 2i−→ hla 2,4.5, 2i:not OK!(violates reset) hl1,4, 2i−→ hla 2,4, 0i:not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(37)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:not OK!(violates guard) hl1,4.5, 2i−→ hla 2,4.5, 2i:not OK!(violates reset) hl1,4, 2i−→ hla 2,4, 0i:not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i:

OK! hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(38)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:not OK!(violates guard) hl1,4.5, 2i−→ hla 2,4.5, 2i:not OK!(violates reset) hl1,4, 2i−→ hla 2,4, 0i:not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i: OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(39)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:not OK!(violates guard) hl1,4.5, 2i−→ hla 2,4.5, 2i:not OK!(violates reset) hl1,4, 2i−→ hla 2,4, 0i:not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i: OK!

hl1,3, 0i−→ hl3 1,6, 3i:

not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(40)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: States and Transitions

State: hl

i

, x

1

, x

2

i

hl1,4, 7i: OK!

hl2,2, 4i:not OK!(violates invariant in l2)

Switch: hl

i

, x , y i −→ hl

a j

, x

0

, y

0

i

hl1,4.5, 2i−→ hla 2,4.5, 0i: OK!

hl1,6, 2i−→ hla 2,6, 0i:not OK!(violates invar. in l1) hl1,3, 2i−→ hla 2,3, 0i:not OK!(violates guard) hl1,4.5, 2i−→ hla 2,4.5, 2i:not OK!(violates reset) hl1,4, 2i−→ hla 2,4, 0i:not OK!(violates invar. in l2)

Wait (time elapse): hl

i

, x , y i −→ hl

δ i

, x + δ, y + δi

hl1,3, 0i−→ hl2 1,5, 2i: OK!

hl1,3, 0i−→ hl3 1,6, 3i:not OK!(violates invar. in l1)

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(41)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations Σ: Set of labels

X : Set of clocks Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location a: label

ϕ: clock constraints λ⊆ X : clocks to be reset l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(42)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations

Σ: Set of labels X : Set of clocks Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location a: label

ϕ: clock constraints λ⊆ X : clocks to be reset l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(43)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations Σ: Set of labels

X : Set of clocks Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location a: label

ϕ: clock constraints λ⊆ X : clocks to be reset l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(44)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations Σ: Set of labels

X : Set of clocks

Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location a: label

ϕ: clock constraints λ⊆ X : clocks to be reset l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(45)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations Σ: Set of labels

X : Set of clocks Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location a: label

ϕ: clock constraints λ⊆ X : clocks to be reset l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(46)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations Σ: Set of labels

X : Set of clocks Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location a: label

ϕ: clock constraints λ⊆ X : clocks to be reset l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(47)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations Σ: Set of labels

X : Set of clocks Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location

a: label

ϕ: clock constraints λ⊆ X : clocks to be reset l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(48)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations Σ: Set of labels

X : Set of clocks Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location a: label

ϕ: clock constraints λ⊆ X : clocks to be reset l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(49)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations Σ: Set of labels

X : Set of clocks Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location a: label

ϕ: clock constraints

λ⊆ X : clocks to be reset l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(50)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations Σ: Set of labels

X : Set of clocks Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location a: label

ϕ: clock constraints λ⊆ X : clocks to be reset

l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(51)

Timed systems: Modeling and Semantics Timed automata

Timed Automata: Formal Syntax

Timed Automaton hL, L

0

, Σ, X , Φ(X ), E i L: Set of locations

L

0

⊆ L: Set of initial locations Σ: Set of labels

X : Set of clocks Φ(X ): Set of invariants

E ⊆ L × Σ × Φ(X ) × 2

X

× L: Set of switches A switch hl, a, ϕ, λ, l

0

i s.t.

l: source location a: label

ϕ: clock constraints λ⊆ X : clocks to be reset l0: target location

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(52)

Timed systems: Modeling and Semantics Timed automata

Clock constraints and clock interpretations

Grammar of clock constraints:

ϕ ::= x ≤ C | x < C | x ≥ C | x > C | ϕ ∧ ϕ s.t. C positive integer values.

=⇒ allow only comparison of a clock with a constant

clock interpretation: ν

X = hx , y , zi, ν = h1.0, 1.5, 0i clock interpretation ν after δ time: ν + δ

δ = 0.2, ν + δ = h1.2, 1.7, 0.2i clock interpretation ν after reset λ: ν[λ]

λ = {y }, ν[y := 0] = h1.0, 0, 0i

A state for a timed automaton is a pair hl, νi, where l is a location and ν is a clock interpretation

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

(53)

Timed systems: Modeling and Semantics Timed automata

Clock constraints and clock interpretations

Grammar of clock constraints:

ϕ ::= x ≤ C | x < C | x ≥ C | x > C | ϕ ∧ ϕ s.t. C positive integer values.

=⇒ allow only comparison of a clock with a constant clock interpretation: ν

X = hx , y , zi, ν = h1.0, 1.5, 0i

clock interpretation ν after δ time: ν + δ δ = 0.2, ν + δ = h1.2, 1.7, 0.2i clock interpretation ν after reset λ: ν[λ]

λ = {y }, ν[y := 0] = h1.0, 0, 0i

A state for a timed automaton is a pair hl, νi, where l is a location and ν is a clock interpretation

(x1≥ 4) (x2≤ 2) a

y := 0

L1

(x1≤ 5)

L2

(x1>4) (x2≤ 3)

Riferimenti

Documenti correlati

Attraverso la definizione di un Piano Sanitario Nazionale dalla cadenza trimestrale, il governo centrale tramite il Ministero della Sanità si occupava della pianificazione

Given the following generalized Büchi automaton A def = hQ, Σ, δ, I, FT i, with two sets of accepting states FT def = {F 1, F 2} s.t.. Ex:

From LTL Formulas to Büchi Automata: generalities On-the-fly construction of Bu¨chi Automata from LTL Complexity..

Finally, Density Functional Theory calculations have shown that an oxidative addition/reductive elimination pathway, involving Cu III species, is an energetically

The derivative design approach to be effective in the industry development process has to be sup- ported by methodologies and tools that allow evaluation of “off the shelf”

exploiting tools for symbolic computation, that if we apply sphere semantics, each point in the space reaches a bounded region which includes the limit cycle. In this example

Different approaches, such as the introduction of noise in hybrid automata [9] and the use of approx- imated semantics (ε-semantics [5]), have been proposed with the aim of