Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and...
-
Upload
erika-washburn -
Category
Documents
-
view
220 -
download
1
Transcript of Real-Time Systems, DTU, Feb 15, 2000 Paul Pettersson, BRICS, Aalborg, Denmark. Timed Automata and...
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Timed Automata and
Timed Computation Tree Logic
Paul PetterssonBRICS@Aalborg
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
CTL Models = Kripke Structures
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Computation Tree Logic, CTLClarke & Emerson 1980
Syntax
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”
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”
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Exercise 18
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Exercise 22
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Exercise 22
{}
)(. yEXpypEF
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Exercise 22
},,,{,{}
)(.
4321 ssss
yEXpypEF
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Exercise 22
},,,,{},,,,{,{}
)(.
432104321 sssssssss
yEXpypEF
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Exercise 22
},,,,{
)(.
][
43210 sssss
yAXpypAG
pAGEF
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Exercise 22
},,,{},,,,,{
)(.
][
432143210 sssssssss
yAXpypAG
pAGEF
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Exercise 22
},,,{},,,,,{
)(.
][
432143210 sssssssss
yAXpypAG
pAGEF
},,,{
)(.
4321 ssss
yEXpypEF
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Exercise 22
},,,{},,,,,{
)(.
][
432143210 sssssssss
yAXpypAG
pAGEF
},,,,{},,,,{{},
)(.
432104321 sssssssss
yEXpypEF
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
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?
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
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)
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Clock Constraints
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Timed (Safety) Automata
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Timed Automata: Exampleguard
reset
location
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Timed Automata: Exampleguard
reset
location
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Timed Automata: Example
3x
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Timed Automata: Example
3x
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Timed Automata: Example
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Timed Automata: Example
Real-Time Systems, DTU, Feb 15, 2000Paul Pettersson, BRICS, Aalborg, Denmark.
Light Switch
push
pushclick
9y
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
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
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
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
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
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...
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
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
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.
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
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:
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’))
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)