real-time systems, dtu, feb 15, 2000 paul pettersson, brics, aalborg, denmark. timed automata and...

40
Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Upload: erika-washburn

Post on 01-Apr-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed Automata and

Timed Computation Tree Logic

Paul PetterssonBRICS@Aalborg

Page 2: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

CTL Models = Kripke Structures

Page 3: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Computation Tree Logic, CTLClarke & Emerson 1980

Syntax

Page 4: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

CTL, Derived Operators

. . .

. . .

. . .

. . .

p

p p

AF p

. . .

. . .

. . .

. . .

p

EF p

possible

inevitable

”exists eventually”

or ”reachable””exists globally”

Page 5: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

CTL, Derived Operators

p p

p

. . .

. . .

. . .

. . .

AG p

p p p p

p

p

. . .

. . .

. . .

. . .

EG p

p

always

potentially always

for all paths next

”forall globally”

or ”invariantly”

”forall eventually”

Page 6: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Exercise 18

Page 7: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Exercise 22

Page 8: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Exercise 22

{}

)(. yEXpypEF

Page 9: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Exercise 22

},,,{,{}

)(.

4321 ssss

yEXpypEF

Page 10: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Exercise 22

},,,,{},,,,{,{}

)(.

432104321 sssssssss

yEXpypEF

Page 11: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Exercise 22

},,,,{

)(.

][

43210 sssss

yAXpypAG

pAGEF

Page 12: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Exercise 22

},,,{},,,,,{

)(.

][

432143210 sssssssss

yAXpypAG

pAGEF

Page 13: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Exercise 22

},,,{},,,,,{

)(.

][

432143210 sssssssss

yAXpypAG

pAGEF

},,,{

)(.

4321 ssss

yEXpypEF

Page 14: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Exercise 22

},,,{},,,,,{

)(.

][

432143210 sssssssss

yAXpypAG

pAGEF

},,,,{},,,,{{},

)(.

432104321 sssssssss

yEXpypEF

Page 15: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Off Light Brightpress? Press?

press?

Press?

WANT: if press is issued twice quickly then the light will get brighter; otherwise the light is turned off.

Timed Automata

Intelligent Light Control

Page 16: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed Automata

Intelligent Light Control

Off Light Bright

Solution: Add real-valued clock x

X:=0X<=3

X>3

press? Press?

press?

Press?

Page 17: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed Automata

n

m

a

(Alur & Dill 1990)

Clocks: x, y

x<=5 & y>3

x := 0

Guard Boolean combination of comp withinteger bounds

ResetAction perfumed on clocks

Transitions

( n , x=2.4 , y=3.1415 ) ( n , x=3.5 , y=4.2415 )

e(1.1)

( n , x=2.4 , y=3.1415 ) ( m , x=0 , y=3.1415 )

a

State ( location , x=v , y=u ) where v,u are in R

Actionused

for synchronization

Page 18: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

n

m

a

Clocks: x, y

x<=5 & y>3

x := 0

Transitions

( n , x=2.4 , y=3.1415 ) ( n , x=3.5 , y=4.2415 )

e(1.1)

( n , x=2.4 , y=3.1415 )

e(3.2)

x<=5

y<=10

LocationInvariants

g1g2 g3

g4

Invariants ensure progress!!

Timed Safety Automata = Timed Automata + Invariants

(Henzinger et al, 1992)

Page 19: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Clock Constraints

Page 20: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed (Safety) Automata

Page 21: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed Automata: Exampleguard

reset

location

Page 22: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed Automata: Exampleguard

reset

location

Page 23: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed Automata: Example

3x

Page 24: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed Automata: Example

3x

Page 25: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed Automata: Example

Page 26: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed Automata: Example

Page 27: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Light Switch

push

pushclick

9y

Page 28: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Light Switch

• Switch may be turned on whenever at least 2 time units has elapsed since last “turn off”

push

pushclick

9y

Page 29: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Light Switch

• Switch may be turned on whenever at least 2 time units has elapsed since last “turn off”

• Light automatically switches off after 9 time units.

push

pushclick

Page 30: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Semantics• clock valuations:

• state:

• Semantics of timed automata is a labeled transition systemwhere

• action transition

• delay Transition

)(),( CVvandLlwherevl

})(|),({ LlandCVvvlS

0:)( RCvCV

),( S

0')')((

),(),(

RddwheneverdvlInv

iffdvlvl d

g a rl l’

)')('(][')(

)','(),(

vlInvandrvvandvg

iffvlvl a

Page 31: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Semantics: Example

...)9,0,()9),3(9,(

)3,3,(),0,(

),()0,(

)5.3,()0,(

)3(93

5.3

yxoffyxon

yxonyxon

yxonyxon

yxoffyxoff

click

push

push

push

pushclick

9y

Page 32: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Networks of Timed Automata + Integer Variables + arrays ….

l1

l2

a!

x>=2i==3

x := 0i:=i+4

m1

m2

a?

y<=4

…………. Two-way synchronizationon complementary actions.

Closed Systems!

(l1, m1,………, x=2, y=3.5, i=3,…..) (l2,m2,……..,x=0, y=3.5, i=7,…..)

(l1,m1,………,x=2.2, y=3.7, I=3,…..)

0.2

tau

Example transitions

If a URGENT CHANNEL

Page 33: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timed Automata in UPPAAL• Timed Safety Automata

+ urgent actions+ urgent locations (i.e. zero-delay locations)+ committed locations (i.e. zero-delay and atomic locations)+ data-variables (integers with bounded domains)+ arrays of data-variables+ guards and assignments over data-variables and arrays...

Page 34: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Urgent and Committed Locations

m

n

o

2x

!a

0:x

p

q

r

?a

)0,|(

)0,|(

)5.2,|(

)5.2,|(

)0,|(

xro

xqo

xqn

xpm

xpm

2.5

a )5.2,|( xrn

)5.2,|( dxqn

)5.2,|( dxqo

committed

urgent

d

d

Page 35: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

TCTL = CTL + Time

inz

clocksformulaDz

nspropositioautomicAPp

,,

,,

constraints over formula clocks and automata clocks

“freeze operator” introduces new formula clock z

E[ U ], A[ U ] - like in CTL

No EX

Page 36: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Derived Operators

Along any path holds continuously until within 7 time units

becomes valid.

=

=

The property becomes valid within 5 time units.

Page 37: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Paths

Example:

push

pushclick

9y

...)9,0,()9),3(9,(

)3,3,(),0,(

),()0,(

)5.3,()0,(

)3(93

5.3

yxoffyxon

yxonyxon

yxonyxon

yxoffyxoff

click

push

push

Page 38: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Elapsed time in path

...)9,0,()9),3(9,(

)3,3,(),0,(

),()0,(

)5.3,()0,(

)3(93

5.3

yxoffyxon

yxonyxon

yxonyxon

yxoffyxoff

click

push

push

Example:

Page 39: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

TCTL Semantics

s - location

w - formula clock valuation

PM(s) - set of paths from s

Pos() - positions in ,i) - elapsed time

(i,d) <<(i’,d’) iff (i<j) or ((i=j) and (d<d’))

Page 40: Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and Timed Computation Tree Logic Paul Pettersson BRICS@Aalborg

Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.

Timeliness Properties

receive(m) occurs within 5 time units after send(m)

receive(m) occurs exactly 11 time units after send(m)

putbox occurs periodically (exactly) every 25 time units

(note: other putbox’s may occur in between)