
P1: IML/FFX P2: IML/FFX QC: IML/FFX T1: IML
MOBK015-04 MOBK015-Lynch.cls April 1, 2006 17:45
40 THEORY OF TIMED I/O AUTOMATA
If TimedChannel(b1, M) performs a send(m) action and the state changes from x to
x
, then we need to find an execution fragment β of TimedChannel(b2,M) from y ending
in y
, such that x
R y
and trace(β) is the same as the trace of ℘(x) send(m) ℘(x
). The
execution fragment β = ℘(y)
send(m) ℘(y
) satisfies the required conditions. This follows
from the hypothesis that x R y and the definition of R, using the fact that the effect of a
send(m) action of TimedChannel(b1, M), TimedChannel(b2, M) are, respectively, adding
the entry
[m,now + b1] to x(queue), and [m,now + b2] to y(queue) where b1 ≤ b2.
If
TimedChannel(b1, M) performs a receive(m) action and the state changes from x
to x
, then we need to show that receive(m) is also enabled in y and that there is an execution
fragment with the required properties that ends in a state y
such that x
R y
. In order to
show that
receive(m) is enabled in y, we use the hypothesis that x R y, which implies that
the first element of y(
queue) is of the form [m,u] for some u. The execution fragment ℘(y)
receive(m) ℘(y
)ofTimedChannel(b1, M) can be shown to satisfy the required conditions.
For the third property, we consider a closed trajectory τ of
TimedChannel(b1, M)
with τ.fstate = x and show that there exists a closed execution fragment β of the automaton
TimedChannel(b2, M) with β.fstate = y, trace(β) = trace(τ ), and τ.lstate = β.lstate.Itis
easyto check that thetrajectory τ
ofTimedChannel(b2, M) with τ
.fstate = y and τ
.ltime =
τ.
ltime satisfies the required conditions.
Example 4.25 (Time-bounded channel that keeps all messages). In this example we define
a variant of
TimedChannel from Example 4.1 called TimedChannel2. The main difference
between
TimedChannel and TimedChannel2 is that the message queue in TimedChannel2 is
implemented using a finite sequence of (message, delivery deadline) pairs
queue and a pointer
ptr that points to the next element that is to be delivered. Hence, the internal variables of
TimedChannel2 consist of queue, now, and ptr. The variable ptr initially has value 1, which
indicates that it is pointing to the first element in the sequence. A
send(m) action causes
messages and deadlines to be added to the sequence as in
TimedChannel.Areceive(m)
causes ptr to be incremented to make it point to the next element in the sequence instead of
removing the first element. This stops when predicate tests if there is a packet in the queue with
index greater than or equal to
ptr and deadline equal to now. The automaton TimedChannel
can be viewed as an optimized implementation of TimedChannel2.
We define below a forward simulation R from
TimedChannel to TimedChannel2.Ifx
is a state of
TimedChannel and y is a state of TimedChannel2, then x R y provided that the
following conditions are satisfied:
1. x(
now) = y(now).
2. x(
queue) = y(queue)(y(ptr) ···|y(queue)|).