30.06.2013 Views

slides - Summer School Marktoberdorf

slides - Summer School Marktoberdorf

slides - Summer School Marktoberdorf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Model-based<br />

Verification and Validation<br />

Embedded Systems<br />

Kim G. Larsen<br />

Aalborg University, DENMARK


Timed Automata<br />

.. and Prices, Games, Probabilities<br />

Kim G. Larsen<br />

Aalborg University, DENMARK


Aalborg<br />

Aarhus<br />

Aalborg<br />

Copenhagen<br />

Aalborg University leading Danish ICT University in terms of<br />

public investments (33%) Jomfru Ane Gade<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [3]


CISS - Center For Embedded Software Systems<br />

Regional ICT Center (2003- )<br />

3 research groups<br />

Computer Science<br />

Control Theory<br />

HW/SW- codesign<br />

20 Employed<br />

25 Associated<br />

20 PhD Students<br />

50 Industrial projects<br />

10 Elite-students<br />

65 MDKK<br />

ARTIST Design<br />

ARTEMIS<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [4]


ES are Pervasive<br />

Characteristica:<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [5]<br />

Dedicated function<br />

Complex environment<br />

SW/HW/Mechanics<br />

Autonomous<br />

Ressource constrained<br />

: Energy<br />

: Bandwidth<br />

: Memory<br />

: …<br />

Timing constraints


ES are often Safety Critical<br />

How to achieve ES that are:<br />

• correct<br />

• predicable<br />

• dependable<br />

• fault tolerant<br />

• ressource minial<br />

• cheap<br />

..<br />

Model-Based Development<br />

300 horse power<br />

100 processors<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [6]


System Description<br />

Requirement<br />

A( req ) A} grant)<br />

Model Checking<br />

TOOL<br />

A( req ) A} t


Synthesis<br />

?<br />

System Description<br />

Requirement<br />

A( req ) A} grant)<br />

TOOL<br />

A( req ) A} t


Overview<br />

Introduction to<br />

Timed Automata<br />

Decidability and<br />

Symbolic verification<br />

Priced Timed Automata<br />

Timed Games & Interfaces<br />

Stochastic Timed Automata<br />

Statistical Model Checking<br />

Open Problems<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [9]<br />

CLASSIC<br />

CORA<br />

TIGA<br />

ECDAR<br />

SMC<br />

TRON


Timed Automata


UPPAAL (1995- )<br />

@AALborg<br />

Kim G Larsen<br />

Alexandre David<br />

Gerd Behrman<br />

Marius Mikucionis<br />

Jacob I. Rasmussen<br />

Arne Skou<br />

Brian Nielsen<br />

Shuhao Li<br />

@Elsewhere<br />

Emmanuel Fleury, Didier Lime, Johan Bengtsson,<br />

Fredrik Larsson, Kåre J Kristoffersen, Tobias Amnell,<br />

Thomas Hune, Oliver Möller, Elena Fersman, Carsten<br />

Weise, David Griffioen, Ansgar Fehnker, Jan Tretmans,<br />

Frits Vandraager, Theo Ruys, Pedro D’Argenio, J-P<br />

Katoen,, Judi Romijn, Ed Brinksma, Martijn Hendriks,<br />

Klaus Havelund, Franck Cassez, Magnus Lindahl,<br />

Francois Laroussinie, Patricia Bouyer, Augusto<br />

Burgueno, H. Bowmann, D. Latella, M. Massink, G.<br />

Faconti, Kristina Lundqvist, Lars Asplund, Justin<br />

Pearson.....<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

@UPPsala<br />

Wang Yi<br />

Paul Pettersson<br />

John Håkansson<br />

Anders Hessel<br />

Pavel Krcal<br />

Leonid Mokrushin<br />

Shi Xiaochun<br />

40000<br />

35000<br />

30000<br />

25000<br />

Total Downloads<br />

20000<br />

15000<br />

10000<br />

5000<br />

0<br />

y = 3.4322x 2 - 28.247x + 749.99<br />

Kim Larsen [11]<br />

UPPAAL Downloads<br />

YYMM


Real Time Systems<br />

Plant<br />

Continuous<br />

Eg.: Realtime Protocols<br />

Pump Control<br />

Air Bags<br />

Robots<br />

Cruise Control<br />

ABS<br />

CD Players<br />

Production Lines<br />

sensors<br />

actuators<br />

Controller Program<br />

Discrete<br />

Real Time System<br />

A system where correctness not only<br />

depends on the logical order of events<br />

but also on their timing!!<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [12]


A Dumb Light Controller<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [13]


Timed Automata<br />

x: real-valued<br />

clock<br />

Reset<br />

[Alur & Dill’89]<br />

Synchronizing<br />

action<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [14]<br />

Clock Guard<br />

Conjunctions of<br />

x~n<br />

ADD a clock x


A Timed Automata (Semantics)<br />

States:<br />

( location , x=v) where v2R<br />

Transitions:<br />

delay 4.32<br />

( Off , x=0 )<br />

( Off , x=4.32 )<br />

press? ( Light , x=0 )<br />

delay 2.51 ( Light , x=2.51 )<br />

press? ( Bright , x=2.51 )<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [15]


Intelligent Light Controller<br />

Invariant<br />

(Henzinger)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [16]


Intelligent Light Controller<br />

Transitions:<br />

delay 4.32<br />

( Off , x=0 )<br />

( Off , x=4.32 )<br />

press? ( Light , x=0 )<br />

delay 4.51 ( Light , x=4.51 )<br />

press? ( Light , x=0 )<br />

delay 100 ( Light , x=100)<br />

( Off , x=0)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [17]<br />

Note: X<br />

( Light , x=0 ) delay 103 <br />

Invariants<br />

ensures<br />

progress


Timed Automata (formally)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [18]


Timed Automata (formally)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [19]


Timed Automata (formally)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [20]


Timed Automata (formally)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [21]


Timed Automata: Example<br />

guard<br />

reset<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

synchronization<br />

22


Timed Automata: Example<br />

invariant<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

guard<br />

23


Example<br />

a b<br />

c<br />

Is L1 reachable ?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [24]


Example<br />

a b<br />

c<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [25]<br />

y<br />

x


Example<br />

a b<br />

c<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [26]<br />

y<br />

x


Example<br />

a b<br />

c<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [27]<br />

y<br />

a<br />

x


Example<br />

a b<br />

c<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [28]<br />

y<br />

a a<br />

x


Networks Light Controller & User<br />

press? x:=0<br />

press?<br />

Off Light Bright<br />

y¸10<br />

x:=0<br />

x:=0<br />

x=100<br />

x·100<br />

Rest Busy<br />

y:=0<br />

Synchronization<br />

press!<br />

press!<br />

y:=0<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

y·10<br />

x·3<br />

x:=0<br />

press?<br />

x>3<br />

x:=0<br />

x=100<br />

x·100<br />

press?<br />

x:=0<br />

Transition<br />

delay 20<br />

( Off, Rest, x=0, y=0 )<br />

( Off, Rest, x=20, y=20 )<br />

press?! ( Light, Busy, x=0, y=0 )<br />

delay 2 ( Light, Busy, x=2, y=2)<br />

press?! ( Bright, Rest, x=0, y=0)<br />

Kim Larsen [29]


Network Semantics<br />

s<br />

1 2<br />

T T ( S S , ,<br />

s s ) Xwhere<br />

A<br />

1 X<br />

<br />

s1<br />

1 s1´<br />

<br />

1<br />

Xs2 <br />

s1´<br />

X s2<br />

s<br />

s<br />

1<br />

1<br />

2<br />

s<br />

1<br />

2<br />

0 X<br />

0<br />

s<br />

s<br />

1<br />

X<br />

a !<br />

1 s1´<br />

a?<br />

s2<br />

<br />

<br />

1 s s ´<br />

X 2 <br />

1 s<br />

X 2<br />

<br />

e(<br />

d)<br />

<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

s<br />

1<br />

s<br />

X<br />

1<br />

2<br />

s<br />

1<br />

´<br />

e(<br />

d)<br />

s<br />

2<br />

<br />

s<br />

<br />

´<br />

1<br />

X<br />

´<br />

2<br />

s<br />

2<br />

e(<br />

d)<br />

s<br />

2<br />

2<br />

<br />

<br />

<br />

s<br />

´<br />

<br />

2<br />

<br />

2<br />

´<br />

<br />

2<br />

s<br />

2<br />

Kim Larsen [30]<br />

´<br />

s<br />

s<br />

2<br />

´<br />

1<br />

X<br />

s<br />

2<br />

´


Network Semantics<br />

(URGENT synchronization)<br />

s<br />

1 2<br />

T T ( S S , ,<br />

s s ) Xwhere<br />

A<br />

1 X<br />

<br />

s1<br />

1 s1´<br />

1 Xs 2 <br />

s1´<br />

X s2<br />

s<br />

s<br />

1<br />

1<br />

2<br />

a !<br />

s<br />

1<br />

<br />

s<br />

1 X<br />

e(<br />

d)<br />

1<br />

2<br />

s<br />

2<br />

<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

s<br />

1<br />

s<br />

X<br />

1<br />

2<br />

1<br />

´<br />

<br />

0 X<br />

s<br />

2<br />

<br />

s<br />

s<br />

1<br />

´<br />

e(<br />

d)<br />

´<br />

0<br />

s<br />

1 X<br />

s<br />

<br />

s<br />

s<br />

1<br />

X<br />

a?<br />

<br />

2<br />

s<br />

´<br />

2<br />

1<br />

X<br />

´<br />

2<br />

s<br />

2<br />

e(<br />

d)<br />

s<br />

2<br />

2<br />

<br />

<br />

<br />

s<br />

´<br />

<br />

2<br />

<br />

2<br />

´<br />

<br />

2<br />

s<br />

2<br />

Kim Larsen [31]<br />

´<br />

s<br />

s<br />

2<br />

´<br />

1<br />

X<br />

s<br />

2<br />

´<br />

d’ < d, u UAct:<br />

e(d’) u? e(d’) u!<br />

( s1 s2 )


Light Control Interface


User<br />

press? 0.2 release? … press? 0.7 release? … press? 1.0 2.4 release? …<br />

Ø<br />

press?<br />

release?<br />

Interface<br />

touch!<br />

starthold!<br />

endhold!<br />

press? d release? touch! 0.5·d· 1<br />

press? 1 starthold! Light<br />

press? d release? endhold! d >1<br />

touch! starthold! endhold!<br />

Informationsteknologi Light Control Interface<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>,<br />

2012<br />

Control<br />

Program<br />

33


User<br />

press?<br />

release?<br />

touch!<br />

starthold!<br />

endhold!<br />

Informationsteknologi Light Control Interface<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Control<br />

Program<br />

34


Informationsteknologi<br />

Light Control Network<br />

press?<br />

release?<br />

touch!<br />

starthold!<br />

endhold!<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Control<br />

Program<br />

35


Informationsteknologi Full Light Controller<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong><br />

<strong>School</strong>, 2012<br />

Dim<br />

Dim<br />

36


UPPAAL<br />

Modeling & Specification


Train Crossing<br />

list<br />

Stopable<br />

Area<br />

[7,15]<br />

[10,20]<br />

Gate<br />

[3,5]<br />

Crossing<br />

River<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [38]


Train Crossing<br />

appr<br />

stop<br />

list<br />

Stopable<br />

Area<br />

[7,15]<br />

go<br />

enqueue()<br />

dequeue()<br />

front()<br />

[10,20]<br />

Gate<br />

[3,5]<br />

Crossing<br />

River<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [39]<br />

Communication via channels!<br />

leave<br />

id-”parameter”


Declarations<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [40]<br />

Constants<br />

Bounded integers<br />

Channels<br />

Clocks<br />

Arrays<br />

Types<br />

Functions<br />

Templates<br />

Processes<br />

Systems


UPPAAL Help<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [41]


Logical Specifications<br />

Validation Properties<br />

Possibly: E P<br />

Safety Properties<br />

Invariant: A[] P<br />

Pos. Inv.: E[] P<br />

Liveness Properties<br />

Eventually: A P<br />

Leadsto: P Q<br />

Bounded Liveness<br />

Leads to within: P · t Q<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

The expressions P and<br />

Q must be type safe,<br />

side effect free, and<br />

evaluate to a boolean.<br />

Only references to<br />

integer variables,<br />

constants, clocks,<br />

and locations are<br />

allowed (and arrays of<br />

these).<br />

42


Case Studies: Controllers<br />

Gearbox Controller [TACAS’98]<br />

Bang & Olufsen Power Controller [RTPS’99,FTRTFT’2k]<br />

SIDMAR Steel Production Plant [RTCSA’99, DSVV’2k]<br />

Real-Time RCX Control-Programs [ECRTS’2k]<br />

Terma, Verification of Memory Management for Radar (2001)<br />

Scheduling Lacquer Production (2005)<br />

Memory Arbiter Synthesis and Verification for a Radar Memory Interface Card [NJC’05]<br />

Adapting the UPPAAL Model of a Distributed Lift System, 2007<br />

Analyzing a χ model of a turntable system using Spin, CADP<br />

and Uppaal, 2006<br />

Designing, Modelling and Verifying a Container Terminal<br />

System Using UPPAAL, 2008<br />

Model-based system analysis using Chi and Uppaal: An<br />

industrial case study, 2008<br />

Climate Controller for Pig Stables, 2008<br />

Optimal and Robust Controller for Hydralic Pump, 2009<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [43]


Case Studies: Protocols<br />

Philips Audio Protocol [HS’95, CAV’95, RTSS’95, CAV’96]<br />

Bounded Retransmission Protocol [TACAS’97]<br />

Bang & Olufsen Audio/Video Protocol [RTSS’97]<br />

TDMA Protocol [PRFTS’97]<br />

Lip-Synchronization Protocol [FMICS’97]<br />

ATM ABR Protocol [CAV’99]<br />

ABB Fieldbus Protocol [ECRTS’2k]<br />

IEEE 1394 Firewire Root Contention (2000)<br />

Distributed Agreement Protocol [Formats05]<br />

Leader Election for Mobile Ad Hoc Networks [Charme05]<br />

Analysis of a protocol for dynamic configuration of IPv4 link<br />

local addresses using Uppaal, 2006<br />

Formalizing SHIM6, a Proposed Internet Standard in UPPAAL,<br />

2007<br />

Verifying the distributed real-time network protocol RTnet using<br />

Uppaal, 2007<br />

Analysis of the Zeroconf protocol using UPPAAL, 2009<br />

Analysis of a Clock Synchronization Protocol for Wireless Sensor<br />

Networks, 2009<br />

Model Checking the FlexRay Physical Layer Protocol, 2010<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [44]


Using UPPAAL as Back-end<br />

Vooduu: verification of object-oriented designs using Uppaal,<br />

2004<br />

Moby/RT: A Tool for Specification and Verification of Real-Time<br />

Systems, 2000<br />

Formalising the ARTS MPSOC Model in UPPAAL, 2007<br />

Timed automata translator for Uppaal to PVS<br />

Component-Based Design and Analysis of Embedded<br />

Systems with UPPAAL PORT, 2008<br />

Verification of COMDES-II Systems Using UPPAAL with<br />

Model Transformation, 2008<br />

METAMOC: Modular WCET Analysis Using UPPAAL,<br />

2010.<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [45]


www.uppaal.com<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [46]


Decidability<br />

and<br />

Symbolic Verification<br />

Kim G. Larsen<br />

Aalborg University, DENMARK


Decidability


Reachability ?<br />

a b<br />

c<br />

Reachable from initial state (L0,x=0,y=0) ?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [49]<br />

OBSTACLE:<br />

Uncountably infinite<br />

state space<br />

locations clock-valuations


The Region Abstraction<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [50]


Time Abstracted Bisimulation<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [51]


Regions – From Infinite to Finite<br />

Reset<br />

region<br />

THM [AD90]<br />

Reachability is decidable<br />

(and PSPACE-complete) for<br />

timed automata<br />

THM [CY90]<br />

Time-optimal reachability is decidable<br />

(and PSPACE-complete) for<br />

timed automata<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [52]<br />

+<br />

A region<br />

Successor Successor<br />

Regions regions


Region Graph<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [53]


Region Automaton =<br />

Finite Bisimulation Quotiont<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [54]


An Example<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [55]


Region Automaton<br />

LARGE: exponential in the number of clocks and in the<br />

constants (if encoded in binary). The number of regions is<br />

<br />

xX (2 2) | !| 2 X<br />

M X <br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [56]<br />

x<br />

| |


Fundamental Results<br />

Reachability <br />

Model-checking<br />

TCTL ; MTL ; MITL <br />

Bisimulation, Simulation<br />

Timed ; Untimed <br />

Trace-inclusion<br />

Timed ; Untimed <br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [57]


Symbolic Verification<br />

The UPPAAL<br />

Verification Engine


Regions – From Infinite to Finite<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [59]<br />

+


Zones – From Finite to Efficiency<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [60]<br />

A zone Z:<br />

1· x · 2<br />

0· y · 2<br />

x - y ¸ 0


Zones - Operations<br />

y<br />

y<br />

(n, 2·x·4<br />

1·y·3 y-x·0 )<br />

(n, x=0 1·y·3 )<br />

Reset<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

x<br />

x<br />

y<br />

y<br />

(n, 2·x<br />

1·y -3· y-x·0 )<br />

x<br />

x<br />

y<br />

y<br />

(n, 2·x<br />

1·y·3 y-x·0 )<br />

Delay Delay (stopwatch)<br />

(n, 2·x·4 1·y )<br />

Extrapolation<br />

2<br />

Kim Larsen [61]<br />

Convex Hull<br />

x<br />

x


Symbolic Transitions<br />

x>3<br />

a<br />

y:=0<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

y<br />

y<br />

x<br />

x<br />

1


Datastructures for Zones<br />

Difference Bounded<br />

Matrices (DBMs)<br />

Minimal Constraint<br />

Form<br />

[RTSS97]<br />

Clock Difference<br />

Diagrams<br />

[CAV99]<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [63]<br />

x1 x2<br />

4<br />

x0<br />

-4<br />

3 3 -2 -2<br />

2<br />

1<br />

5<br />

x3<br />

2


Inclusion Checking (DBMs)<br />

Inclusion<br />

D1<br />

D2<br />

x


Future (DBMs)<br />

D<br />

1


Reset (DBMs)<br />

D<br />

y<br />

0<br />

-1<br />

x<br />

1


Forward Reachability<br />

PW<br />

Waiting Final<br />

Init<br />

Init -> Final ?<br />

Passed<br />

67 <strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

INITIAL Passed := Ø;<br />

Waiting := {(n 0,Z 0)}<br />

REPEAT<br />

pick (n,Z) in Waiting<br />

if (n,Z) = Final return true<br />

for all (n,Z)(n’,Z’):<br />

if for some (n’,Z’’) Z’ Z’’ continue<br />

else add (n’,Z’) to Waiting<br />

move (n,Z) to Passed<br />

UNTIL Waiting = Ø<br />

return false


Forward Reachability<br />

PW<br />

Waiting Final<br />

Init<br />

Init -> Final ?<br />

Passed<br />

68 <strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

INITIAL Passed := Ø;<br />

Waiting := {(n 0,Z 0)}<br />

REPEAT<br />

pick (n,Z) in Waiting<br />

if (n,Z) = Final return true<br />

for all (n,Z)(n’,Z’):<br />

if for some (n’,Z’’) Z’ Z’’ continue<br />

else add (n’,Z’) to Waiting<br />

move (n,Z) to Passed<br />

UNTIL Waiting = Ø<br />

return false


Forward Reachability<br />

PW<br />

Waiting<br />

Init<br />

Init -> Final ?<br />

Passed<br />

69 <strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Final?<br />

INITIAL Passed := Ø;<br />

Waiting := {(n 0,Z 0)}<br />

REPEAT<br />

pick (n,Z) in Waiting<br />

if (n,Z) = Final return true<br />

for all (n,Z)(n’,Z’):<br />

if for some (n’,Z’’) Z’ Z’’ continue<br />

else add (n’,Z’) to Waiting<br />

move (n,Z) to Passed<br />

UNTIL Waiting = Ø<br />

return false


Forward Reachability<br />

PW<br />

Waiting Final<br />

Init<br />

Init -> Final ?<br />

Passed<br />

70 <strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

INITIAL Passed := Ø;<br />

Waiting := {(n 0,Z 0)}<br />

REPEAT<br />

pick (n,Z) in Waiting<br />

if (n,Z) = Final return true<br />

for all (n,Z)(n’,Z’):<br />

if for some (n’,Z’’) Z’ Z’’ continue<br />

else add (n’,Z’) to Waiting<br />

move (n,Z) to Passed<br />

UNTIL Waiting = Ø<br />

return false


Forward Reachability<br />

PW<br />

Waiting Final<br />

Init<br />

Init -> Final ?<br />

Passed<br />

71 <strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

INITIAL Passed := Ø;<br />

Waiting := {(n 0,Z 0)}<br />

REPEAT<br />

pick (n,Z) in Waiting<br />

if (n,Z) = Final return true<br />

for all (n,Z)(n’,Z’):<br />

if for some (n’,Z’’) Z’ Z’’ continue<br />

else add (n’,Z’) to Waiting<br />

move (n,Z) to Passed<br />

UNTIL Waiting = Ø<br />

return false


Forward Reachability<br />

PW<br />

Waiting Final<br />

Init<br />

Init -> Final ?<br />

Passed<br />

72 <strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

INITIAL Passed := Ø;<br />

Waiting := {(n 0,Z 0)}<br />

REPEAT<br />

pick (n,Z) in Waiting<br />

if (n,Z) = Final return true<br />

for all (n,Z)(n’,Z’):<br />

if for some (n’,Z’’) Z’ Z’’ continue<br />

else add (n’,Z’) to Waiting<br />

move (n,Z) to Passed<br />

UNTIL Waiting = Ø<br />

return false


Forward Reachability<br />

PW<br />

Waiting Final<br />

Init<br />

Init -> Final ?<br />

Passed<br />

73 <strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

INITIAL Passed := Ø;<br />

Waiting := {(n 0,Z 0)}<br />

REPEAT<br />

pick (n,Z) in Waiting<br />

if (n,Z) = Final return true<br />

for all (n,Z)(n’,Z’):<br />

if for some (n’,Z’’) Z’ Z’’ continue<br />

else add (n’,Z’) to Waiting<br />

move (n,Z) to Passed<br />

UNTIL Waiting = Ø<br />

return false


Symbolic Exploration<br />

Reachable?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [74]<br />

y<br />

x


Symbolic Exploration<br />

Reachable?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [75]<br />

y<br />

Delay<br />

x


Symbolic Exploration<br />

Reachable?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [76]<br />

y<br />

Left<br />

x


Symbolic Exploration<br />

Reachable?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [77]<br />

y<br />

Left<br />

x


Symbolic Exploration<br />

Reachable?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [78]<br />

y<br />

Delay<br />

x


Symbolic Exploration<br />

Reachable?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [79]<br />

y<br />

Left<br />

x


Symbolic Exploration<br />

Reachable?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [80]<br />

y<br />

Left<br />

x


Symbolic Exploration<br />

Reachable?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [81]<br />

y<br />

Delay<br />

x


Symbolic Exploration<br />

Reachable?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [82]<br />

y<br />

Down<br />

x


Verification Options


Verification Options<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Search Order<br />

Depth First<br />

Breadth First<br />

State Space Reduction<br />

None<br />

Conservative<br />

Aggressive<br />

State Space Representation<br />

DBM<br />

Compact Form<br />

Under Approximation<br />

Over Approximation<br />

Diagnostic Trace<br />

Some<br />

Shortest<br />

Fastest<br />

Extrapolation<br />

Hash Table size<br />

Reuse<br />

Kim Larsen [84]


State Space Reduction<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Cycles:<br />

Only symbolic states<br />

involving loop-entry points<br />

need to be saved on Passed list<br />

Kim Larsen [85]


To Store or Not To Store<br />

117 states total<br />

!<br />

81 states entrypoint<br />

!<br />

9 states<br />

Time OH<br />

less than 10%<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [86]<br />

Behrmann, Larsen,<br />

Pelanek 2003<br />

Audio Protocol


Over/Under Approximation<br />

Declared State Space<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

I<br />

O<br />

U<br />

R<br />

G<br />

Question:<br />

G 2 R ?<br />

How to use:<br />

G 2 O ?<br />

G 2 U ?<br />

G2 U ) G2 R<br />

:(G2 O) ) :(G2 R)<br />

Kim Larsen [87]


Over-approximation<br />

Convex Hull<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 88<br />

5<br />

3<br />

1<br />

y<br />

1 3 5<br />

x<br />

Convex Hull<br />

TACAS04: An EXACT method performing<br />

as well as Convex Hull has been<br />

developed based on abstractions<br />

taking max constants into account<br />

distinguishing between clocks, locations and · & ¸


Under-approximation<br />

Bitstate Hashing<br />

Waiting<br />

Init<br />

n,Z’<br />

n,Z<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

m,U<br />

Passed<br />

Final<br />

Kim Larsen [89]


Under-approximation<br />

Bitstate Hashing<br />

Waiting<br />

Init<br />

n,Z’<br />

n,Z<br />

m,U<br />

Passed<br />

Final<br />

Hashfunction<br />

F<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [90]<br />

1<br />

0<br />

1<br />

0<br />

0<br />

1<br />

Passed=<br />

Bitarray<br />

UPPAAL<br />

4 - 512 Mbits


Extrapolation<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [91]


Forward Symbolic Exploration<br />

Need for<br />

Finite<br />

Abstractions<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [92]<br />

TERMINATION<br />

not<br />

garanteed


Abstractions<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

We want ) a to be:<br />

- sound & complete wrt reachability<br />

- finite<br />

- easy to compute<br />

- as coarse as possible<br />

Kim Larsen [93]


Abstraction by Extrapolation<br />

Let k be the largest constant appearing in the TA<br />

x1 x2<br />

x0<br />

*<br />

>k<br />

* * * *<br />

*<br />

*<br />

*<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

x3<br />


Location Dependency<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

k x = 5 k y = 10 6<br />

Will generate all symbolic states of the form<br />

(l 2, x2 [0,14] , y2 [5,14n] , y-x2 [5,14n-14])<br />

for n ·10 6 /14 !!<br />

[Behrmann, Bouyer,<br />

Fleury, Larsen 03]<br />

But y¸10 6 is not RELEVANT in l 2<br />

Kim Larsen [95]


Location Dependent Constants<br />

k x i = 14 for i2{1,2,3,4}<br />

k y i = 5 for i2{1,2,3}<br />

k y 4 = 10 6<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

k x = 5 k y = 10 6<br />

k j i may be found as solution to<br />

simple linear constraints!<br />

Active Clock Reduction:<br />

k j i = -1<br />

Kim Larsen [96]


Experiments<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [97]


Lower and Upper Bounds<br />

k x l = 10 6<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

[Behrmann, Bouyer,<br />

Larsen, Pelanek 04]<br />

Given that x·10 6 is an upper bound implies that<br />

(l,v x,v y) simulates (l,v’ x,v y)<br />

whenever v’ x¸ v x¸ 10.<br />

For reachability downward<br />

closure wrt simulation<br />

suffices!<br />

Kim Larsen [98]


Fischer<br />

CSMA/CD<br />

Advanced Extrapolations<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Classical Loc. dep. Max Loc. dep. LU Convex Hull<br />

Kim Larsen [99]


Additional “secrets”<br />

Sharing among symbolic states<br />

location vector / discrete values / zones<br />

Distributed implementation of UPPAAL<br />

Symmetry Reduction<br />

Sweep Line Method<br />

Guiding wrt Heuristic Value<br />

User-supplied / Auto-generated<br />

Slicing wrt “C” Code<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [100]


Open Problems<br />

Fully symbolic exploration of TA (both<br />

discrete and continuous part) ?<br />

Canonical form for CDD’s ?<br />

Partial Order Reduction ?<br />

Compositional Backwards Reachability ?<br />

Bounded Model Checking for TA ?<br />

Exploitation of multi-core processors ?<br />

…<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [101]


Priced Timed Automata<br />

Optimal Scheduling<br />

Kim G. Larsen<br />

– Aalborg University<br />

DENMARK


Overview<br />

Timed Automata<br />

Scheduling<br />

Priced Timed Automata<br />

Optimal Reachability<br />

Optimal Infinite Scheduling<br />

Multi Objectives<br />

Energy Automata<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [103]<br />

CLASSIC<br />

CORA<br />

TIGA<br />

ECDAR<br />

TRON<br />

PRO


Resources & Tasks<br />

Resource<br />

Shared variable<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Synchronization<br />

Kim Larsen [104]<br />

Task


A<br />

C<br />

D<br />

Task Graph Scheduling – Example<br />

3<br />

5<br />

1<br />

+ *<br />

*<br />

*<br />

P1<br />

P2<br />

B C D<br />

2<br />

6<br />

4<br />

1<br />

+<br />

+<br />

3ps<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [105]<br />

+<br />

*<br />

2ps<br />

time<br />

+<br />

*<br />

5ps<br />

7ps<br />

5 10 15 20 25<br />

2 3 5 6<br />

4<br />

Compute :<br />

(D * ( C * ( A + B )) + (( A + B ) + ( C * D ))<br />

using 2 processors<br />

P1 (fast) P2 (slow)<br />

4


A<br />

C<br />

D<br />

Task Graph Scheduling – Example<br />

3<br />

5<br />

1<br />

+ *<br />

*<br />

*<br />

P1<br />

P2<br />

B C D<br />

1<br />

2<br />

6<br />

4<br />

+<br />

+<br />

2<br />

Compute :<br />

(D * ( C * ( A + B )) + (( A + B ) + ( C * D ))<br />

using 2 processors<br />

P1 (fast) P2 (slow)<br />

3ps<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [106]<br />

+<br />

*<br />

2ps<br />

time<br />

+<br />

*<br />

5ps<br />

7ps<br />

5 10 15 20 25<br />

3 5 4<br />

6


A<br />

C<br />

D<br />

Task Graph Scheduling – Example<br />

3<br />

5<br />

1<br />

+ *<br />

*<br />

*<br />

P1<br />

P2<br />

B C D<br />

1<br />

2<br />

6<br />

4<br />

+<br />

+<br />

2<br />

Compute :<br />

(D * ( C * ( A + B )) + (( A + B ) + ( C * D ))<br />

using 2 processors<br />

P1 (fast) P2 (slow)<br />

3ps<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [107]<br />

+<br />

*<br />

2ps<br />

time<br />

+<br />

*<br />

5ps<br />

7ps<br />

5 10 15 20 25<br />

3 5 4<br />

6


A<br />

C<br />

D<br />

Task Graph Scheduling – Example<br />

3<br />

5<br />

1<br />

+ *<br />

*<br />

*<br />

P1<br />

P2<br />

B C D<br />

1<br />

2<br />

6<br />

4<br />

+<br />

+<br />

Compute :<br />

(D * ( C * ( A + B )) + (( A + B ) + ( C * D ))<br />

using 2 processors<br />

P1 (fast) P2 (slow)<br />

3ps<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [108]<br />

+<br />

*<br />

2ps<br />

time<br />

+<br />

*<br />

5ps<br />

7ps<br />

5 10 15 20 25<br />

3 5 4 6<br />

2<br />

E (Task1.End and … and Task6.End)


Experimental Results<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [109]<br />

Symbolic A*<br />

Branch-&-Bound<br />

60 sec<br />

Abdeddaïm, Kerbaa, Maler


Priced Timed<br />

Automata


A<br />

C<br />

D<br />

Task Graph Scheduling – Revisited<br />

3<br />

5<br />

1<br />

+ *<br />

*<br />

*<br />

P1<br />

P2<br />

B C D<br />

1<br />

2<br />

6<br />

4<br />

+<br />

+<br />

2<br />

Compute :<br />

(D * ( C * ( A + B )) + (( A + B ) + ( C * D ))<br />

using 2 processors<br />

P1 (fast) P2 (slow)<br />

ENERGY:<br />

3ps<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [111]<br />

+<br />

*<br />

2ps<br />

time<br />

+<br />

*<br />

5ps<br />

7ps<br />

5 10 15<br />

90W<br />

20<br />

30W<br />

25<br />

3 5 4 6<br />

Idle<br />

In use<br />

1oW<br />

Idle<br />

In use<br />

20W


A<br />

C<br />

D<br />

Task Graph Scheduling – Revisited<br />

3<br />

5<br />

1<br />

+ *<br />

*<br />

*<br />

P1<br />

P2<br />

B C D<br />

1<br />

2<br />

6<br />

4<br />

+<br />

+<br />

3<br />

2<br />

Compute :<br />

(D * ( C * ( A + B )) + (( A + B ) + ( C * D ))<br />

using 2 processors<br />

P1 (fast) P2 (slow)<br />

ENERGY:<br />

3ps<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [112]<br />

+<br />

*<br />

Idle<br />

In use<br />

2ps<br />

10W<br />

Idle<br />

time<br />

+<br />

*<br />

In use<br />

5ps<br />

7ps<br />

20W<br />

5 10 15<br />

90W<br />

20<br />

30W<br />

25<br />

4<br />

5<br />

6


A<br />

C<br />

D<br />

Task Graph Scheduling – Revisited<br />

3<br />

5<br />

1<br />

+ *<br />

*<br />

*<br />

P1<br />

P2<br />

B C D<br />

1<br />

2<br />

6<br />

4<br />

+<br />

+<br />

3<br />

2<br />

Compute :<br />

(D * ( C * ( A + B )) + (( A + B ) + ( C * D ))<br />

using 2 processors<br />

P1 (fast) P2 (slow)<br />

ENERGY:<br />

3ps<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [113]<br />

+<br />

*<br />

Idle<br />

In use<br />

2ps<br />

10W<br />

Idle<br />

time<br />

+<br />

*<br />

In use<br />

5ps<br />

7ps<br />

20W<br />

5 10 15<br />

90W<br />

20<br />

30W<br />

25<br />

4<br />

5<br />

6


A simple example<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [114]


A simple example<br />

Q: What is cheapest cost for reaching ?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [115]


Corner Point Regions<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [116]<br />

0<br />

THM [Behrmann, Fehnker ..01] [Alur,Torre,Pappas 01]<br />

Optimal reachability is decidable for PTA<br />

THM [Bouyer, Brojaue, Briuere, Raskin 07]<br />

Optimal reachability is PSPACE-complete<br />

for PTA<br />

0<br />

3<br />

0<br />

0 0<br />

0<br />

3


Priced Zones<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [117]<br />

[CAV01]<br />

A zone Z:<br />

1· x · 2<br />

0· y · 2<br />

x - y ¸ 0<br />

A cost function C<br />

C(x,y)=<br />

2x - 1y + 3


Priced Zones – Reset<br />

Z[x=0]:<br />

x=0<br />

0· y · 2<br />

C = 1y + 3<br />

C= -1y + 5<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [118]<br />

[CAV01]<br />

A zone Z:<br />

1· x · 2<br />

0· y · 2<br />

x - y ¸ 0<br />

A cost function C<br />

C(x,y) =<br />

2x - 1y + 3


Symbolic Branch & Bound Algorithm<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [119]<br />

Z' <br />

Z<br />

Z’ is bigger &<br />

cheaper than Z<br />

· is a well-quasi<br />

ordering which<br />

guarantees<br />

termination!


Example: Aircraft Landing<br />

cost<br />

e*(T-t)<br />

d+l*(t-T)<br />

E T L<br />

Planes have to keep separation<br />

distance to avoid turbulences<br />

caused by preceding planes<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

t<br />

E earliest landing time<br />

T target time<br />

L latest time<br />

e cost rate for being early<br />

l cost rate for being late<br />

d fixed cost for being late<br />

Kim Larsen [120]<br />

Runway


Example: Aircraft Landing<br />

x >= 4<br />

x=5<br />

x


Aircraft Landing Source of examples:<br />

Baesley et al’2000<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [122]


Symbolic Branch & Bound Algorithm<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Zone based<br />

Linear Programming<br />

Problems<br />

(dualize)<br />

Min Cost Flow<br />

Kim Larsen [123]


Optimal Infinite Schedule<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [124]


Optimal Infinite Scheduling<br />

Maximize throughput:<br />

i.e. maximize Reward / Time in the long run!<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [125]


Optimal Infinite Scheduling<br />

Minimize Energy Consumption:<br />

i.e. minimize Cost / Time in the long run<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [126]


Optimal Infinite Scheduling<br />

Maximize throughput:<br />

i.e. maximize Reward / Cost in the long run<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [127]


Mean Pay-Off Optimality<br />

Bouyer, Brinksma, Larsen:<br />

HSCC04,FMSD07<br />

s<br />

c 1<br />

c 2<br />

r 1 r 2<br />

c 3<br />

r 3<br />

: BAD<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [128]<br />

c n<br />

r n<br />

Accumulated cost<br />

Accumulated reward<br />

Value of path s: val(s) = lim n!1 c n/r n<br />

Optimal Schedule s * : val(s * ) = inf s val(s)


Discount Optimality<br />

Larsen, Fahrenberg:<br />

INFINITY’08<br />

s<br />

c(t1) c(t2) c(t3) c(tn) t3 tn t1 t2 : BAD<br />

Value of path s: val(s) =<br />

Cost of time t n<br />

Optimal Schedule s * : val(s * ) = inf s val(s)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [129]<br />

< 1 : discounting factor<br />

Time of step n


Soundness of<br />

Corner Point Abstraction<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [130]


Multiple Objective Scheduling<br />

16,10<br />

2,3<br />

cost 1’==4 cost 2’==3<br />

P 2<br />

cost 2<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [131]<br />

2,3<br />

P 1<br />

6,6 10,16<br />

P6 P3 P4 Pareto Frontier<br />

2,2 P7 8,2<br />

P 5<br />

4W 3W<br />

cost 1


Energy Automata


Managing Resources<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [133]


Consuming & Harvesting Energy<br />

Maximize throughput<br />

while respecting: 0 · E · MAX<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [134]


Energy Constrains<br />

Energy is not only consumed but may also be regained<br />

The aim is to continously satisfy some energy constriants<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [135]


Results (so far)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [136]<br />

Bouyer, Fahrenberg,<br />

Larsen, Markey, Srba:<br />

FORMATS 2008


L-Problem for 1-Clock Case<br />

Theorem:<br />

The L-problem is decidable in PTIME for 1-clock PTAs<br />

P Bouyer, U Fahrenberg, K Larsen, N Markey,.. . Infinite runs in weighted timed automata with energy constraints. 2008.<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [137]


LU-Problem for<br />

1-Clock Energy Games<br />

Theorem<br />

For 1-clock priced timed games, the existence of a strategy<br />

satisfying LU-bounds is undecidable<br />

P Bouyer, U Fahrenberg, K Larsen, N Markey,.. . Infinite runs in weighted timed automata with energy constraints. 2008.<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [138]


Generic Module for Inc/Dec<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [139]


1½ Clocks = Discrete Updates<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [140]


New Approach: Energy Functions<br />

Maximize energy<br />

along paths<br />

Use this information<br />

to solve<br />

general problem<br />

P. Bouyer, U. Fahrenberg, K. G. Larsen, N. Markey: Timed automata with observers under energy constraints. HSCC 2010<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [141]


Energy Function<br />

General Strategy<br />

Spend just enough time<br />

to survive the next negative<br />

update<br />

P. Bouyer, U. Fahrenberg, K. G. Larsen, N. Markey: Timed automata with observers under energy constraints. HSCC 2010<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [142]


Exponential PTA<br />

General Strategy<br />

Spend just enough time<br />

to survive the next negative<br />

update<br />

so that after next negative<br />

update there is a certain positive<br />

amount !<br />

Minimal Fixpoint:<br />

P. Bouyer, U. Fahrenberg, K. G. Larsen, N. Markey: Timed automata with observers under energy constraints. HSCC 2010<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [143]


Exponential PTA<br />

Thm [BFLM09]:<br />

The L-problem is decidable<br />

for linear and exponential 1-clock PTAs with<br />

negative discrete updates.<br />

Energy Function<br />

P. Bouyer, U. Fahrenberg, K. G. Larsen, N. Markey: Timed automata with observers under energy constraints. HSCC 2010<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [144]


Multiple Costs & Clocks<br />

LU Problem Undecidable<br />

2 clocks + 2 costs [1]<br />

1 clock + 2 costs [2]<br />

2 clocks + 1 cost [3]<br />

Update Test-Decrement<br />

c1 Increment n=3<br />

Decrement n=12<br />

(1) Karin Quaas. On the interval-bound problem for weighted timed automata. 2011.<br />

(2) Uli Fahrenberg, Line Juhl, Kim G. Larsen, and Jirı Srba. Energy games in multiweighted automata. 2011<br />

(3) Nicolas Markey. Verification of Embedded Systems – Algorithms and Complexity. 2011.<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [145]


Multiple Clocks & 1 Cost<br />

L problem is undecidable<br />

4 clocks or more<br />

x=x 0<br />

C=C 0<br />

x=x 0<br />

C=C 0<br />

P. Bouyer, K. G. Larsen, and N. Markey. Lower-bound constrained runs in weighted timed automata. QEST 2012<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [146]<br />

x=x 0<br />

C=x 0+C 0<br />

x=x 0<br />

C=(1-x 0)<br />

+C 0


Multiple Clocks & 1 Cost<br />

L Problem<br />

P. Bouyer, K. G. Larsen, and N. Markey. Lower-bound constrained runs in weighted timed automata. QEST 2012<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [147]


Multiple Clocks & 1 Cost<br />

L Problem<br />

Encoding of N-TM<br />

P. Bouyer, K. G. Larsen, and N. Markey. Lower-bound constrained runs in weighted timed automata. QEST 2012<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [148]


Multiple Clocks & 1 Cost<br />

L Problem<br />

Encoding of N-TM<br />

t·dK<br />

t=dK<br />

P. Bouyer, K. G. Larsen, and N. Markey. Lower-bound constrained runs in weighted timed automata. QEST 2012<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [149]<br />

-4<br />

t=dK t=dK<br />

t·dK t·dK<br />

-4 -4


Multiple Clocks & 1 Cost<br />

L Problem<br />

Region Construction<br />

Lemma 3<br />

P. Bouyer, K. G. Larsen, and N. Markey. Lower-bound constrained runs in weighted timed automata. QEST 2012<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [150]


Multiple Costs & 0 Clocks<br />

Uli Fahrenberg, Line Juhl, Kim G. Larsen, and Jirı Srba. Energy games in multiweighted automata. 2011<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [151]


Conclusion<br />

Priced Timed Automata a uniform framework<br />

for modeling and solving dynamic ressource<br />

allocation problems!<br />

Not mentioned here:<br />

Model Checking Issues (ext. of CTL and LTL).<br />

Future work:<br />

Zone-based algorithm for optimal infinite runs.<br />

Approximate solutions for priced timed games to<br />

circumvent undecidablity issues.<br />

Open problems for Energy Automata.<br />

Approximate algorithms for optimal reachability<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [152]


Timed Games<br />

&<br />

Timed Interfaces<br />

Kim G. Larsen<br />

– Aalborg University<br />

DENMARK<br />

TIGA<br />

ECDAR


Timed Automata & Model Checking<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [154]<br />

State (L1, x=0.81)<br />

Transitions<br />

(L1 , x=0.81)<br />

- 2.1 -><br />

(L1 , x=2.91)<br />

-><br />

(goal , x=2.91)<br />

Ehi goal ?<br />

Ahi goal ?<br />

A[ ] : L4 ?


Timed Game Automata & Synthesis<br />

controllable<br />

uncontrollable<br />

Problems to be considered:<br />

- Does there exist a winning strategy?<br />

- If yes, compute one (as simple as possible)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [155]


Decidability of Timed Games<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [156]


Computing Winning States<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [157]


Reachability Games Backwards Fixed-Point Computation<br />

Definitions<br />

cPred(X) = { q2Q | 9 q’2 X. q c q’}<br />

uPred(X) = { q2Q | 9 q’2 X. q u q’}<br />

Pred t(X,Y) = { q2Q | 9 t. q t 2X and 8 s·t. q s 2Y C }<br />

p(X) = Pred t[ X [ cPred(X) , uPred(X C ) ]<br />

Theorem:<br />

The set of winning states is obtained as the least fixpoint<br />

of the function: X a p(X) [ Goal<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [158]<br />

Pred t(X,Y)<br />

X<br />

Y


Symbolic On-the-fly Algorithms for<br />

Timed Games [CDF+05, BCD+07]<br />

symbolic version of on-the-fly MC algorithm<br />

for modal mu-calculus<br />

Liu & Smolka 98<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [159]


Model Checking (ex Train Gate)<br />

Environment<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [160]<br />

Controller<br />

: Never two trains at<br />

the crossing at the<br />

same time


Synthesis (ex Train Gate)<br />

Environment<br />

?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [161]<br />

Controller<br />

: Never two trains at<br />

the crossing at the<br />

same time


Timed Games<br />

Environment<br />

Find strategy for controllable<br />

actions st behaviour satisfies <br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [162]<br />

Controllable Uncontrollable<br />

Controller<br />

: Never two trains at<br />

the crossing at the<br />

same time


Plastic Injection Molding Machine<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Robust and optimal<br />

control<br />

Tool Chain<br />

Quasiomodo<br />

Synthesis: UPPAAL<br />

TIGA<br />

Verification: PHAVer<br />

Performance: SIMULINK<br />

40% improvement of<br />

existing solutions..<br />

Kim Larsen [163]<br />

[CJL+09]


Oil Pump Control Problem<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

R1: stay within safe<br />

interval [4.9,25.1]<br />

R2: minimize<br />

average/overall oil<br />

volume<br />

Kim Larsen [164]<br />

Quasiomodo


The Machine (consumption)<br />

Infinite cyclic demand<br />

to be satisfied by our<br />

control strategy.<br />

P: latency 2 s between<br />

state change of pump<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

F: noise 0.1 l/s<br />

Kim Larsen [165]<br />

Quasiomodo


Abstract Game Model<br />

UPPAAL Tiga<br />

offers games of perfect information<br />

Abstract game model such that states only<br />

contain information about:<br />

Volume of oil at the beginning of cycle<br />

The ideal volume as predicted by the<br />

consumption cycle<br />

Current time within the cycle<br />

State of the Pump (on/off)<br />

Discrete model<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [166]<br />

Quasiomodo<br />

D<br />

V, V_rate<br />

V_acc<br />

time


Machine (uncontrollable)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [167]<br />

Quasiomodo<br />

Checks whether V<br />

under noise gets<br />

outside<br />

[Vmin+0.1,Vmax-0.1]


Pump (controllable)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Every 1 (one)<br />

seconds<br />

Kim Larsen [168]<br />

Quasiomodo


Tool Chain<br />

Strategy Synthesis TIGA<br />

Verification PHAVER<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Performance Evaluation<br />

SIMULINK<br />

Guaranteed<br />

Correctness<br />

Robustness<br />

with<br />

Kim Larsen [169]<br />

Quasiomodo<br />

40% Improvement


Timed Interfaces<br />

& Compositionality


Real-Time version of Milner’s Scheduler<br />

w i+1<br />

rec i+1<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

N i+1<br />

w i<br />

N i<br />

S<br />

rec 0<br />

rec i<br />

N 0<br />

w 0<br />

rec 1<br />

N 1<br />

N 2<br />

w 1<br />

rec 2<br />

w 2<br />

171


<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Demo<br />

172


<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Compositional Verification<br />

SubSpec 3<br />

SubSpec 1<br />

SubSpec 2<br />

173


Spec: set of specifications<br />

Imp: set of implementations<br />

Specification Theory<br />

Specification<br />

SPF <br />

where<br />

Formalism<br />

(Imp, Spec,<br />

sat Imp<br />

Spec<br />

| S|<br />

<br />

{<br />

Refinement:<br />

I<br />

:<br />

I<br />

sat<br />

sat)<br />

S<br />

S Tiff |S| |T|<br />

Consistenc y :<br />

| S|<br />

| S|<br />

<br />

Ø<br />

|<br />

T | <br />

Ø<br />

}


Operations on Specifications<br />

Logical Conjunction:<br />

Given S 1 and S 2 construct S 1S 2 such that<br />

|S 1 S 2| = |S 1||S 2|<br />

Structural Composition:<br />

Given S 1 and S 2 construct S 1 par S 2 such that<br />

| S 1 par S 2 | = |S 1| par |S 2|<br />

· should be precongruence wrt par to allow for<br />

compositional analysis !<br />

Quotienting:<br />

Given overall specification T and component specification S<br />

construct the quotient specification T\S such that<br />

S par X · T iff X · T\S<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

175


SPECs<br />

IMPs<br />

Specifications and Implementations<br />

Timed I/O Transition Systems<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Timed I/O Transition Systems<br />

Timed I/O Automata<br />

176


Refinements, Implementations, Consistency<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

177


TIOTS :<br />

where<br />

and<br />

( St,<br />

Act,<br />

)<br />

St<br />

Act<br />

Timed I/O Transition Systems<br />

:<br />

St<br />

( Act )<br />

St<br />

<br />

<br />

i<br />

touch?<br />

1.4<br />

off!<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

<br />

o<br />

dim!<br />

Time determinism (d )<br />

d<br />

d<br />

if s s ' and s s '' then s ' s ''<br />

Input enabledness<br />

i<br />

for all s and i . s <br />

Determinis m<br />

if<br />

a<br />

s <br />

s'<br />

and<br />

Output Urgency<br />

whenever<br />

(a Act )<br />

o<br />

s<br />

d<br />

Either d 0.<br />

s <br />

i<br />

d<br />

then s implies d <br />

Independent Progress<br />

a<br />

s <br />

s'<br />

' then s'<br />

s'<br />

'<br />

d o<br />

or d , o. s <br />

0<br />

178


Let<br />

S T<br />

i.<br />

ii.<br />

iii.<br />

Definition<br />

I<br />

S<br />

S <br />

S'<br />

sat<br />

and<br />

iff<br />

i?<br />

o!<br />

S<br />

T<br />

<br />

Refinement =<br />

Timed Alternating Simulation<br />

be TIOGA.<br />

T <br />

T'<br />

then S <br />

S'<br />

with S'<br />

T'<br />

S <br />

S'<br />

then T <br />

T'<br />

with S'<br />

T'<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

d<br />

I S<br />

i?<br />

o!<br />

d<br />

then T <br />

T'<br />

with S'<br />

T'<br />

Theorem<br />

Intuition:<br />

S leaves less choices than T<br />

for an implementation.<br />

: WheneverS<br />

T then|<br />

S|<br />

|<br />

T|<br />

Theorem:<br />

Whenever |S| |T| then S T<br />

Theorem<br />

S <br />

T<br />

<br />

Φ<br />

ATCTL.<br />

T cntr Φ Scntr<br />

Φ<br />

179


grant<br />

coin<br />

Timed Systems Specifications =<br />

Timed I/O Automata<br />

Machine Researcher<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Administration<br />

tea<br />

cof<br />

pub<br />

patent<br />

Input:<br />

control.<br />

(required)<br />

Output:<br />

uncontrol.<br />

(allowed)<br />

180


Overall Specification<br />

grant patent<br />

¸ ?<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

grant<br />

Administration<br />

coin pub<br />

Machine Researcher<br />

tea<br />

cof<br />

patent<br />

181


grant<br />

Administration<br />

u·20<br />

coin pub<br />

Machine Researcher<br />

Specification<br />

tea<br />

cof<br />

Quotienting, ”Application”<br />

·<br />

patent<br />

grant<br />

u·20<br />

patent<br />

Spec\Adm<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

u·20<br />

IFF<br />

coin pub<br />

Machine Researcher<br />

tea<br />

cof<br />

·<br />

Spec \ Adm<br />

182


Assume-Guarantee<br />

Guarantee Assumption<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Good<br />

Bad<br />

ButA<br />

ButB<br />

A>>G = (A | G) \ A<br />

Properties<br />

A>>G ¸ G<br />

A · A’ )<br />

A>>G ¸ A’>> G<br />

G · G’ )<br />

A>>G · A>>G’<br />

183


A, G<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Assume-Guarantee Reasoning<br />

A 1, G 1<br />

A 2, G 2<br />

Proof Rule:<br />

A>>G ¸ ( A1>>G1 | A2>>G2 )<br />

184


w i+1<br />

rec i+1<br />

w i<br />

N i+1<br />

N i<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Milner’s Scheduler Compositionaly<br />

S<br />

rec 0<br />

SPEC<br />

rec i<br />

N 0<br />

w 0<br />

rec 1<br />

N 1<br />

N 2<br />

w 1<br />

rec 2<br />

w 2<br />

Find SS i and verify:<br />

1. N 1· SS 1<br />

2. SS 1 | N 2 · SS 2<br />

3. SS 2 | N 3 · SS 3<br />

… …<br />

n. SS n-1 | N n · SS n<br />

n+1. SS n | N 0 · SPEC<br />

185


w i+1<br />

rec i+1<br />

w i<br />

N i+1<br />

G<br />

N i<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Milner’s Scheduler Compositionaly<br />

S<br />

rec 0<br />

rec i<br />

N 0<br />

w 0<br />

rec 1<br />

N 1<br />

N 2<br />

w 1<br />

rec 2<br />

w 2<br />

A 1<br />

A 2<br />

Find SS i ……<br />

186


w i+1<br />

rec i+1<br />

w i<br />

N i+1<br />

G<br />

N i<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Milner’s Scheduler Compositionaly<br />

S<br />

rec 0<br />

rec i<br />

N 0<br />

w 0<br />

rec 1<br />

N 1<br />

N 2<br />

w 1<br />

rec 2<br />

w 2<br />

A 1<br />

A 2<br />

Take SS i = (A 1 & A 2)>>G<br />

187


w i+1<br />

rec i+1<br />

w i<br />

N i+1<br />

N i<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Milner’s Scheduler Compositionaly<br />

S<br />

rec 0<br />

rec i<br />

N 0<br />

w 0<br />

rec 1<br />

N 1<br />

N 2<br />

w 1<br />

rec 2<br />

w 2<br />

Take SS i = (A 1 & A 2)>>G<br />

188


<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Experiments<br />

189


Open Problems<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [190]


Open Problems<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [191]


Statistical Model Checking<br />

for Timed Automata<br />

Collaborators: Peter Bulychev,<br />

Alexandre David, Dehui Du,<br />

Axel Legay, Marius Mikucionis<br />

Wang Zheng, Guanyan Li,<br />

Jonas van Vliet, Danny Poulsen


UPPAAL Tool Suit<br />

Editor<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [193]<br />

Simulator<br />

Processes<br />

Verifier<br />

MSC


UPPAAL<br />

Safety<br />

A[] forall (i : id_t) forall (j : id_t)<br />

Train(i).Cross && Train(j).Cross imply i == j<br />

E Train(0).Cross and Train(1).Stop<br />

Reachability<br />

Train(0).Appr --> Train(0).Cross<br />

Liveness<br />

A .. E[] ..<br />

Performance properties<br />

State-space explosion<br />

Limited quantitative analysis<br />

sup: .. inf: ..<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [194]


UPPAAL SMC<br />

Performance properties<br />

Pr[


Overview<br />

Stochastic Semantics of Networks of Timed<br />

Automata<br />

Statistical Model Checking in UPPAAL<br />

Estimation<br />

Sequential Hypothesis Testing<br />

Sequential Probability Comparison<br />

Demo<br />

Case Studies<br />

LMAC<br />

Energy Aware Buildings<br />

Genetic Oscillation<br />

SMC for WMTL<br />

Conclusion<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [196]


Stochastic Semantics of TA<br />

Exponential Distribution<br />

Input enabled<br />

Uniform Distribution<br />

Composition =<br />

Repeated races between components<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [197]


Stochastic Semantics of<br />

Timed Automata<br />

Delay Density Function<br />

¹ s: R! R<br />

Output Probability Function<br />

° s: § o! [0,1]<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

g1<br />

s<br />

g2<br />

• ¹ s uniform on [ d min, d max ]<br />

• ° s uniform over enabled outputs<br />

Kim Larsen [198]


Stochastic Semantics of<br />

Timed Automata<br />

Composition = Race between components<br />

for outputting<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Pr[time


Stochastic Semantics of<br />

Timed Automata<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Assumptions:<br />

Component TAs are:<br />

• Input enabled<br />

• Deterministic<br />

• Disjoint set of output actions<br />

¼ ( s , a 1 a 2 …. a n ) :<br />

the set of maximal runs from s with a prefix<br />

t 1 a 1 t 2 a 2 … t n a k<br />

for some t 1,…,t n 2 R.<br />

Kim Larsen [200]


Logical Properties<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [201]


Random Run Generator<br />

THEOREM<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [202]


SMC Algorithms -1<br />

Quantitative (Estimation)<br />

Algorithm I: Probability Estimation<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [203]<br />

= ?<br />

Chernoff-Hoeffding Bound<br />

Alternatives, e.g. Clopper-Pearson<br />

10


SMC Algorithms -2<br />

Qualitative (Hypothesis Testing)<br />

®: prob of acc H 0 when H 1<br />

¯: prob of acc H 1 when H 0<br />

Algorithm II: Sequential Probability Ratio Testing (Wald)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [204]<br />

r<br />

0<br />

0<br />

0<br />

1<br />

Accept H 1<br />

1<br />

0<br />

0<br />

Accept H 0<br />

11<br />

0<br />

0<br />

runs #


SMC Algorithms -3<br />

t<br />

Probability Comparison<br />

(Beyond “Classical” SMC)<br />

Decide p1 ¸ p2 without<br />

computing p1, p2 0 0<br />

1<br />

Relative “superiority” of Á1 over Á2 u0 < 1 < u1 1<br />

0<br />

1<br />

1<br />

Accept H0 Algorithm III: Sequential Test for Probability Comparison<br />

®: prob of acc H 0 when H 1<br />

Accept H 1<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [205]<br />

¯: prob of acc H 1 when H 0<br />

r<br />

a<br />

runs #


Queries in UPPAAL SMC<br />

Pr[


Queries in UPPAAL SMC<br />

Pr[ = 0.8<br />

Pr[ = 0.5<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

207


Queries in UPPAAL SMC<br />

Pr[ =<br />

Pr[


Queries in UPPAAL SMC<br />

simulate 1 [


DEMO


Extensions of UPPAALs TA<br />

Constant Slope Timed Automata<br />

Clocks may have different (integer) slope in different<br />

locations.<br />

Branching edges with discrete probabilities (weights).<br />

Beyond Priced TA, Energy TA. Equal LHA in (nonstochastic)<br />

expressive power.<br />

Beyond TPS, Probabilistic TA, DTMC, beyond CTMC<br />

(with multiple rewards)<br />

All features of UPPAAL supported<br />

User defined functions and types<br />

Expressions in guards, invariants, clock-rates, delayrates<br />

(rationals), and weights.<br />

New GUI for plot-composing and exporting.<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [211]<br />

Invariants<br />

x’==5<br />

y’==int_fun()<br />

T’==5 T


Extensions of UPPAALs TA<br />

Constant Slope Timed Automata<br />

Clocks may have different (integer) slope in different<br />

locations.<br />

Branching edges with discrete probabilities (weights).<br />

Beyond Priced TA, Energy TA. Equal LHA in (nonstochastic)<br />

expressive power.<br />

Beyond TPS, Probabilistic TA, DTMC, beyond CTMC<br />

(with multiple rewards)<br />

All features of UPPAAL supported<br />

User defined functions and types<br />

Expressions in guards, invariants, clock-rates, delayrates<br />

(rationals), and weights.<br />

New GUI for plot-composing and exporting.<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [212]


Extensions of UPPAALs TA<br />

Constant Slope Timed Automata<br />

Clocks may have different (integer) slope in different<br />

locations.<br />

Branching edges with discrete probabilities (weights).<br />

Beyond Priced TA, Energy TA. Equal LHA in (nonstochastic)<br />

expressive power.<br />

Beyond TPS, Probabilistic TA, DTMC, beyond CTMC<br />

(with multiple rewards)<br />

Hybrid Systems – by discretizing and integration<br />

All features of UPPAAL supported<br />

User defined functions and types<br />

Expressions in guards, invariants, clock-rates, delayrates<br />

(rationals), and weights.<br />

New GUI for plot-composing and exporting.<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [213]


Extensions of UPPAALs TA<br />

Constant Slope Timed Automata<br />

Clocks may have different (integer) slope in different<br />

locations.<br />

Branching edges with discrete probabilities (weights).<br />

Beyond Priced TA, Energy TA. Equal LHA in (nonstochastic)<br />

expressive power.<br />

Beyond TPS, Probabilistic TA, DTMC, beyond CTMC<br />

(with multiple rewards)<br />

Hybrid Systems – by discretizing and integration<br />

All features of UPPAAL supported<br />

User defined functions and types<br />

Expressions in guards, invariants, clock-rates, delayrates<br />

(rationals), and weights.<br />

New GUI for plot-composing and exporting.<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [214]


Extensions of UPPAALs TA<br />

Constant Slope Timed Automata<br />

Clocks may have different (integer) slope in different<br />

locations.<br />

Branching edges with discrete probabilities (weights).<br />

Beyond Priced TA, Energy TA. Equal LHA in (nonstochastic)<br />

expressive power.<br />

Beyond TPS, Probabilistic TA, DTMC, beyond CTMC<br />

(with multiple rewards)<br />

Hybrid Systems – by discretizing and integration<br />

All features of UPPAAL supported<br />

User defined functions and types<br />

Expressions in guards, invariants, clock-rates, delayrates<br />

(rationals), and weights.<br />

New GUI for plot-composing and exporting.<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [215]


Stochastic Hybrid Systems<br />

simulate 1 [


Stochastic Hybrid Systems<br />

A Bouncing Ball<br />

Simulate 5 [= 4))<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [217/52]


Case Studies<br />

FIREWIRE BLUETOOTH<br />

10 node LMAC<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Energy Aware<br />

Buildings<br />

Kim Larsen [218]<br />

100 x 100 ROBOT<br />

Genetic Oscilator


LMAC


Lightweight Media Access Control<br />

Problem domain:<br />

communication<br />

scheduling<br />

Targeted for:<br />

self-configuring<br />

networks,<br />

collision avoidance,<br />

low power<br />

consumption<br />

Application domain:<br />

wireless sensor<br />

networks<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [220]<br />

Initialization (listen until a<br />

neighbor is heard)<br />

Waiting (delay a random<br />

amount of time frames)<br />

Discovery (wait for entire<br />

frame and note used slots)<br />

Active<br />

choose free slot,<br />

use it to transmit, including<br />

info about detected collisions<br />

listen on other slots<br />

fallback to Discovery if<br />

collision is detected<br />

Only neighbors can detect<br />

collision and tell the usernode<br />

that its slot is used by<br />

others


added<br />

power<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

adopted from A.Fehnker, L.v.Hoesel, A.Mader<br />

initialization<br />

..used UPPAAL to explore 4- and 5-node<br />

random wait<br />

topologies and found cases with<br />

perpetual collisions<br />

(8.000 MC problems)<br />

discovery<br />

Statistical MC offers an insight by<br />

calculating the probability over the<br />

number of collisions.<br />

+ estimated cost in terms of energy.<br />

Kim Larsen [221]<br />

active usage


SMC of LMAC with 4 Nodes<br />

Wait distribution:<br />

geometric<br />

uniform<br />

Network topology:<br />

chain<br />

ring<br />

Collision probability<br />

Collision count<br />

Power consumption<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

no collisions<br />


10-Node Star<br />

The first collision:<br />

happens before 500tu<br />

• The first collisions happen before 500tu.<br />

• It is unlikely (8.2%) that<br />

there will be 0 collisions.<br />

• And if they happen, they are perpetual.<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [223]<br />

Collision counts after 1000tu<br />

0 0 0<br />

0<br />

0<br />

Collision counts after 2000tu:<br />

the numbers are doubled –<br />

perpetual collisions<br />

0


Energy Aware<br />

Fehnker, Ivancic.<br />

Benchmarks for Hybrid Systems Verification.<br />

HSCC04<br />

Buildings<br />

With Alexandre David,<br />

Dehui Du<br />

Marius Mikucionis<br />

Arne Skou


Framework<br />

Design<br />

Space<br />

Exploration<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [225]


Rooms & Heaters – MODELS<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [226]


Control Strategies – MODELS<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Temperature Threshold<br />

Kim Larsen [227]<br />

Strategies


Weather & User Profile – MODELS<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [228]


Results – Simulations<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

simulate 1 [


Results – Discomfort<br />

Pr[0<br />

&& Monitor.Discomfort)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [230]


Results – Comfort<br />

Pr[comfort=2*day)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [231]


Results – Energy<br />

Pr[Monitor.energy=2*day)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [232]


Result – User Profile<br />

Pr[Monitor.energy=2*day)<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Kim Larsen [233]


Genetic Oscillator<br />

With<br />

Alexandre David,, Axel Legay,<br />

Marius Mikucionis,<br />

Danny Bøgsted Poulsen, Sean Sedwards


CMTC Model<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Vilar, Kueh, Barkai, Leibler:<br />

Mechanisms of noise-resistance in genetic oscillators,<br />

PNAS, 2002<br />

Kim Larsen [235]


ODE Model<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [236]


Amplitudes & Periods<br />

Amplitude E[


Frequency Analysis<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [238]


SMC for MITL


Example – WMITL<br />

SYSTEM<br />

95% confidence interval: [0.215,0.225]<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [240]<br />

MONITOR<br />

(det)


Metric Interval Temporal Logic<br />

MITL ≤ syntax:<br />

ϕ ::=σ | ¬ϕ | ϕ 1 ∧ ϕ 2 | Oϕ | ϕ 1 U ≤d ϕ 2<br />

where d ∈ ℕ is a natural number and c a clock.<br />

MITL ≤ semantics [ r=(a 1,t 1)(a 2,t 2)(a 3,t 3) … ]:<br />

r ⊨σ if a 1= σ<br />

r ⊨¬ϕ if r ⊭ ϕ<br />

r ⊨ ϕ 1 ∧ ϕ 2 if r ⊨ ϕ 1 and r ⊨ ϕ 2<br />

r ⊨Oϕ if (a 2,t 2)(a 3,t 3)… ⊨ ϕ<br />

r ⊨ϕ 1 U ≤d ϕ 2 if 9 i. (a i,t i)(a i+1,t i+1)… ⊨ ϕ 2<br />

with t 1 +t 2 +…+t i ≤d<br />

and (a j,t j)(a j+1,t j+1)… ⊨ ϕ 1 for j


Tableaux Construction<br />

} ·1 p<br />

accept<br />

p<br />

p , x·1<br />

} ·1 p<br />

p x in O[}( p x·1 )]<br />

}( }( p p x·1 x·1 ) )<br />

(x·1 p) O[}( p x·1 )]<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [242]<br />

!p<br />

!p<br />

x=0


Tableaux Construction<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [243]


Tool Chain [LPAR2012]<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [244]


Experiments<br />

How exact is the over / underapproximation<br />

1000 random formulas<br />

2, 3, 4 actions<br />

15 connectives<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [245]


Case Study 2: Robot control<br />

Consider the case of a robot<br />

moving on a two-dimensional<br />

grid in a random fashion<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012<br />

Ice<br />

Wall<br />

Starting point<br />

Fire<br />

We want to estimate the<br />

probability that the<br />

robot will arrive in time<br />

at the Goal location<br />

without burning or<br />

freezing to death<br />

Kim Larsen [246]<br />

Goal


www.uppaal.{org,com}<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [247]


Thank You !<br />

<strong>Marktoberdorf</strong> <strong>Summer</strong> <strong>School</strong>, 2012 Kim Larsen [248]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!