Electronic Notes in Theoretical Computer Science 7 (1997)
URL: http://www.elsevier.nl/locate/entcs/volume7.html
19 pages
Eager, Busy-Waiting and Lazy Actions in Timed Computation ? Flavio Corradini Dipartimento di Matematica Pura ed Applicata, Universit di L'Aquila,
[email protected]
GianLuigi Ferrari Dipartimento di Informatica, Universit di Pisa,
[email protected]
Marco Pistore Dipartimento di Informatica, Universit di Pisa,
[email protected]
Abstract
This paper develops a formal framework to describe and reason about semantic theories which provide measures of the eciency in time of process behaviours. The framework relies on the notions of reduction and observability and permits to naturally explain the possible choices to incorporate timing information in terms of process interaction mechanisms. The framework provides a parameterized context where well-known and new theories can be formally compared and classied by a suitable instantiation of the parameters. Alternative SOS-based characterizations are also provided.
1 Introduction
A number of attempts have been made to dene SOS-based theories of process calculi which provide measures of the eciency in time of process behaviours 1,2,8,9,11,12]. Common to these semantic theories is the principle that each sequential component of a process has its local independent clock, namely states of the underlying transition system are not simply process terms but process terms equipped with local clocks. It is the use of local clocks which permits to represent and compute quantitative timing information of process behaviours. Moreover, much standard process theory extends to this setting. ?
Modelli Astratti di Computazione and Esprit CONFER2 and COORDINA.
Research supported in part by CNR Pro ject
Working Groups
c 1997 Published by Elsevier Science B. V.
Corradini, Ferrari and Pistore
For instance, in 5] an eciency preorder over processes was given, while 6] oered an algorithm for checking bisimilarity. The central issue of these semantic theories is the way in which the passing of time on local clocks is modeled. In these approaches the passage of time on local clocks is not forced by a special tick action, but it is the execution of actions which makes local time progress (a duration function indicates how much time an action requires to be executed). This treatment of actions distinguishes these approaches from other timed theories where actions are durationless events (see 13,1719,22] to cite a few). Moreover, the passage of time on independent local clocks is progressing independently: local clocks synchronize only at explicit interaction points. The theories of processes with durational actions are broadly similar but they are presented with dierent parameters which correspond to choices in the modelling of the passage of time and in the synchronization policies of local clocks. However, the details of the SOS semantics may hinder the specic choice of the parameters. This can lead to diculty in understanding the limitation of each theory and in recognizing the common points and the subtle dierences among them. Let us consider the process p = 0 . a:b j 0 . c where the local clocks of the two parallel processes are set up to 0. For simplicity, we assume that actions a, b and c have duration 2, 1 and 1, respectively. By adopting the approaches of 1,2] and 11,12] we have: p
@2 b@3 @1 ! 2.bj0.c ! 3 . nil j 0 . c c! 3 . nil j 1 . nil a
where a@t indicates that t is the timing of the occurrence of the action a. Focusing on the modelling of time passing on local clocks, we note: There is no time passing between the execution of the actions in each parallel component: actions are eager, i.e., they happen as soon as possible. Computations are ill-timed, i.e., the timing of action occurrences in computations does not necessarily follow the temporal order. Instead, by taking the approach of 3,6] we have: p
@3 @5 @6 ! 3 . b j 0 . c b! 5 . nil j 0 . c c! 5 . nil j 6 . nil a
Here, dierent parameters for modelling the passage of time are taken: Actions can be delayed before being executed, i.e., they are lazy. Computations are well-timed, i.e., the timing of action occurrences follows a temporal order. Another important point concerns the treatment of synchronization. For instance, in 1,2] two processes may synchronize if they are ready at the same time. For instance,
j
t . a:e t . a:f
t+ (a) @ ! t + (a) . e j t + (a) . f
2
Corradini, Ferrari and Pistore
where (a) is the duration of action a. The resulting bisimulation semantics is compositional but it is not related to its untimed counterpart, namely Milner's strong bisimulation 14]. For 11,12], instead, eagerness of actions is broken by synchronization: when two processes interact the fastest process waits for the slowest (busywaiting interaction mechanism): @t+ (a) t1 . a:e j t2 . a:f ! t + (a) . e j t + (a) . f where t = max(t1 t2). However, the mixture of eager actions with busywaiting synchronizations has the main drawback that so called performance bisimulation is not compositional: bisimilarity is not preserved by parallel composition. By combining these parameters, several classes of process semantics can be obtained. Some of them have already been studied in the literature, others are new and interesting in their own right. In this paper, a mathematical framework based on the notion of reduction and observability is introduced. This framework allows the classication of the dierent proposals following the parameters which underlie the choices of the axioms for the passage of time on local clocks. Reduction semantics are written in a dierent style than ordinary SOS semantics. A reduction semantics is centered around the notion of reduction which describes the basic computational paradigm of interactions among processes. Focusing on reduction has the main benet that the three parameters eager, lazy and busy-waiting naturally emerge as separate concepts of process interactions. The three parameters are represented by a reduction axiom of the form: !t t . (e j f ) t1 . (a:e + ) j t2 . (a:f + ) What makes the dierence among the three mechanisms is the constraint on the time t in which the interaction occurs. In the eager case t = t1 + (a) = t2 + (a). Instead, t = max(t1 t2 ) + (a) for the busy-waiting paradigm, while t max(t1 t2 ) + (a) for the lazy case. Similarly, the dichotomy of well-timed vs. ill-timed is easily handled by the denition of the reduction relation. Besides reduction rules, observation predicates are the other fundamental ingredient of our framework. They allow to observe the interaction capabilities of processes. Again, we propose dierent classes of observation predicates, corresponding to dierent assumptions on which properties of a process can be observed. In this paper, the formal relationships among the dierent semantic theories are studied using the notion of barbed bisimulation and barbed congruence 16,20]. Two processes are barbed equivalent if they satisfy the same observation predicates and, by performing a reduction, can evolve to processes that are still equivalent. Two processes are barbed congruent if they are equivalent in all contexts. 3
Corradini, Ferrari and Pistore
Alternative characterizations of barbed congruences in terms of SOS semantics are also provided. Reduction semantics shows up especially useful in suggesting the structure of the corresponding SOS semantics. For instance, in the busy-waiting paradigm, dierent the SOS semantics suggested by the reduction semantics turns out to be compositional with respect to all language contexts (this does not happen in the approach of 11,12]).
2 Timed Reduction Semantics 2.1 Basic Process Calculus In this paper, as a worked case study, we consider a variant of Milner's CCS. Below we report its syntax. As usual, the set of atomic actions is denoted by A, its complementation by A and 62 A A is the invisible action. Act = A A (ranged over by a b : : :) is the set of visible actions and Act = Act f g (ranged over by ) is the set of all actions. Complementation is extended to Act by a = a. A durational function : Act ! N + , associates to every action a the time needed for its execution. We assume that (a) = (a). Process variables, used for recursive denitions, are ranged over by x. Pure processes (ranged over by e f : : :) are the closed (i.e., without free variables) and guarded (i.e., variable x in a rec x: e term, can appear only within summations) terms generated by the grammar below:
e :=
X i2I
i:ei
eje
enfag
x
rec
x: e
with t 2 N + The indexing set I of guarded summation may be innite we sometimes use inx + instead of summation in particular if I is a singleton we simply write : e, whereas in the case I = we write the sum as nil often we also write :e + if we are interested in a particular element of the summation. We only admit guarded summation as this simplies the analysis without losing expressiveness. However, everything in this paper can be modied to handle the more general use of summation. Notice that wait prexes are just syntactic sugar. For instance, wait t: e could be replaced by (a:nil j a:e)nfag, for some action a which does not appear in e and such that (a) = t. One should interpret wait t:e as being the timed version of CCS's :e. Timed processes, or simply processes (ranged over by 1 p q r : : :) are the terms:
:= a
wait
t
p := t . e
pjp
pnfag
With some abuse of notation, we sometimes use to denote terms that can be both pure and timed processes. This happens when the same denition can be applied to both the classes of terms.
1
p q r : : :
4
Corradini, Ferrari and Pistore
where t 2 N + . A sort S Act for a process p, denoted by p : S , is a set of actions such that all a 2 S appears in p outside the scope of a restriction nfag. In the rest of this paper we concentrate on the set of processes p with associated a sort S such that for every t 2 N + there are innitely many actions a for which (a) = t and a a 62 S . 2.2 Structural Equivalence Structural equivalence is the smallest congruence over both timed and pure processes which satises the following laws (where p q r can be both timed and pure processes): rec x: e e rec x: e=x]
nilnfag nil
pnfagnfbg pnfbgnfag pnfag j q (p j q)nfag if q : S and a a 62 S pnfag p b=a]nfbg if p : S , b b 62 S and (a) = (b) p j q q j p p j (q j r) (p j q) j r p j nil p t . (e j f ) t . e j t . f t . (enfag) (t . e)nfag.
It is easy to show that, using the structural equivalence , it is possible to rewrite each process into a canonical form: X s := t . i:ei s j s snfag: i2I
We shall often present our constructions for processes in canonical form. Denition 2.1 Let p be a timed process. The maximal clock of p, maxclock(p), is dened as follows: X maxclock(t . i :ei) = t i2 I
(p j q) = max(maxclock(p) maxclock(q)) maxclock(pnfag) = maxclock(p) maxclock(p) = maxclock(q ) if p q maxclock
2.3 Reductions Reduction relation describes the basic mechanism of interaction among processes. Here, we distinguish two types of reduction mechanisms: the untimed reduction, denoted by p ! p0 , meaning that agent p can reduce to agent p0 the timed reduction, denoted by p !t p0 , meaning that agent p can reduce to agent p0 and that this reduction terminates at time t. We now discuss in detail the denition of the timed reduction relation the untimed reduction can be easily obtained by stating that p ! p0 if and only t if p ! p0 for some t. 5
Corradini, Ferrari and Pistore
We distinguish three possible mechanisms of interactions they are all represented by an axiom of the form: t1 . (a:e + ) j t2 . (a:f + ) ! t . (e j f ) What makes the dierence among the three mechanisms is the constraint on the time t at which the interaction occurs. The strongest requirement is that t = t1 + (a) and that t = t2 + (a). This corresponds to requiring that actions re as soon as possible, i.e., there is no time passing between the execution of the actions in each parallel component. This kind of interaction (and hence this kind of action) is called eager and the corresponding reduction relation is denoted by !E. A weaker constraint consists of requiring that t = max(t1 t2 )+ (a). In this case, the fastest process waits for the slowest, but, when both processes are ready to interact, no more time can pass. This approach is called busy-waiting and the corresponding reduction relation is denoted by !B. The weakest requirement we consider is t max(t1 t2) + (a). In this case a pair of processes can delay the synchronization even when both are ready to re the complementary actions in other words, actions are lazy. The corresponding reduction relation is denoted by !L. The following axiom describes the reduction of wait prexes: t . (wait n: e + ) !t .e where t = t + n in the eager and busy waiting case, t t + n in the lazy case 2 . To conclude the description of the reduction relation, we have to say how reduction behaves underneath the remaining process combinators. To this purpose we distinguish two ways of behaving for parallel composition. If we allow ill-timed computations, i.e., computations that do not necessarily follow the temporal order, then the rule is as follows: t
t
t
t
t0
0
0
0
! p pjq !p jq p
t
0
t
0
If only well-timed computations are considered, the clause t maxclock(q) should be added: in all computations the timing of action occurrences follows a temporal order. The remaining reduction rules are standard.
! p pnfag ! p nfag p
t
0
t
0
p
q
! q p !p
q
t
t
q0
0
p
0
0
By combining the degrees of freedom in the denition of the reduction relation (including the possibility of having timed and untimed reductions), we The behaviour of wait prexes can be derived from the equivalent formulation given in terms of parallel composition described previously.
2
6
Corradini, Ferrari and Pistore
t1 . (a:e + ) j t2 . ( a:f
+ )
8 > > < t = t1 + (a) = t2 + (a) eager t max(t1 t2 ) + (a) lazy t . (e f ) > > : t = max(t1 t2) + (a) busy-waiting 8 > > < t = t + (a) eager t t + (a) lazy ) t .e > > : t = t + (a) busy-waiting
t !
j
0
t . (wait n: e +
t0 !
0
0
0
t
0 p ! p t maxclock(q ) t 0 pjq ! p j q
if well-timed
t
0 p ! p t 0 pnfag ! p nfag
pq
t
0 q ! q q0 t 0 p ! p
Table 1 Rules for the reduction semantics.
obtain 12 dierent reduction relations. Here, we identify a specic reduction relation by indexing the reduction with its mode, where the mode states if the reduction is well-timed (W) or ill-timed (I), and if it is eager (E), busywaiting (B) or lazy (L). For instance, ! indicates the well-timed, lazy timed-reduction. In what follows, to avoid cumbersome notations we will use p ! p to indicate a generic timed reduction. Moreover, when only the interaction mode is specied we mean that the reduction is valid for both the well-timed and ill-timed cases for instance p ! q will be used to indicate both p ! q and p ! q. Similar notational conventions will be adopted for the untimed reductions. Reduction rules are summarized in Table 1. t
WL
t
0
t
t
L
t
IL
WL
Proposition 2.2
p !E p0
implies p !B p0 implies p !L p0 p !E p0 implies p !B p0 implies p !L p0 . t
t
t
Proposition 2.3 If p !W p0 then t
( ) t and maxclock(p0) = t.
maxclock p
3 Observability and Barbed Equivalences
3.1 Observation Predicates As it is the case in the context of reduction semantics, natural and interesting notions of behavioural equivalences are obtained by introducing observability 7
p0
Corradini, Ferrari and Pistore
criteria, i.e., families of observation predicates which permit to observe certain properties of processes. Here, we consider three families of observation predicates. The observation predicate # permits to observe whether a process can interact with the environment by performing an action a The observation predicate # permits to observe whether a process can interact with the environment by performing an action a the interaction terminates at time t The observation predicate @ t permits to assign a timestamp to a process. This observation predicate is interesting only in the well-timed case. The denition of @ t is very simple: p @ t i maxclock(p) = t The denition of # is more complex. According to its intended meaning, p # holds if and only if a synchronization between the agent p and the agent (t (a)) .a:nil can occur and terminate at time t, i.e., if p j (t (a)) .a:nil ! p0 j t . nil. Hence, the basic axiom has the form a
at
at
at
t
( + ) # where t0 = t + (a) in the eager case, t0 t + (a) in the lazy and busy-waiting t . a:e
at0
cases. Observation predicates are extended to process combinators. For parallel composition we have to spell out the dierence between well-timed and illtimed. More precisely, we have:
# j #
p at p q at
and we require t maxclock(q) in the well-timed case. The remaining rules are standard:
p q p# # if a 6= b b q# pnfbg # Finally, p # if and only if p # for some t. We will index observation predicates # , # with their mode to identify the specic context of their use. For instance, #WB denotes the observation predicate # for the well-timed busy-waiting reduction. Moreover, p #E will be used to indicate both the predicates p #WE and p #IE . When it will be clear p
at
at
at
at
a
at
at
a
at
at
at
at
at
from the context all the indexes of both reductions and observation predicates will be omitted.
8
Corradini, Ferrari and Pistore
Four classes of observation predicates will be considered:
O1 = f# j a 2 Actg O3 = O1 f@ t j t 2 N g
O2 = f# j a 2 Act and t 2 N g O4 = O2 f@ t j t 2 N g
a
at
The other combinations of observables have been omitted, since either they do not allow to observe actions (neither # nor # present), or they are redundant (both # and # present). Classes O3 and O4 are interesting only in the welltimed cases. The following proposition points out the tight relation between the observation predicate # and timed reduction. This proposition holds both in the well-timed and in the ill-timed case, for the eager, busy-waiting and lazy reduction mechanisms. Proposition 3.1 Let p be a process. Then p # i p j (t (a)) . a:e ! p j t.e for all pure processes e. In the eager case (both well-timed and ill-timed) a similar proposition holds, where the untimed reductions are considered. Proposition 3.2 Let p be a process. Then p #E i p j (t (a)) . a:e !E p j t.e for all pure processes e. a
a
at
at
at
t
0
at
0
at
3.2 Barbed Bisimulation Congruences We now introduce the notion of barbed bisimilarity 16,20]. Denition 3.3 Let
! be a labelled reduction relation ( belongs to a set
of labels), and O a class of observation predicates. A barbed bisimulation is a relation R on processes such that p R q implies: for each p ! p0 (resp. q ! q0) there is some q ! q0 (resp. p ! p0) such 0 0 that p R q for each o 2 O , o(p) holds if and only if o(q ) holds. Two processes p and q are barbed bisimilar, written p _ q , if p R q for some barbed bisimulation R. Several barbed bisimulations can be dened, depending on the choice of the reduction relation 3 and of the family of observables. As usual, we represent a specic relation by indexing it: for instance _ WEt2 represents the bisimilarity corresponding to the well-timed eager timed paradigm with family of observation predicates O2. We are interested in the relation induced on pure processes and in the congruence relation on pure processes, induced by closing w.r.t. a class of
Timed reductions are labelled by the timing of their occurrence, whereas untimed reductions are intended as labelled by a constant label. 3
9
Corradini, Ferrari and Pistore
contexts. The contexts we consider are given below. C ]
Denition 3.4
e
and
e
and
f
Let
e
and
:= f
t.
p j C ]
C ]nfag
be two pure processes.
barbed bisimilar, written e _ f , if 0 . e _ 0 . f . are barbed congruent, written e f , if C e] _ C f ]
are
f context C ].
for each
4 Comparative Semantics In this section we study the relationships among the dierent semantics we introduced. Let us ignore for the moment the case of untimed semantics with the class O1 of observables. In all the three paradigms the relations between the semantics are the same: all the well-timed semantics coincide whereas the ill-timed semantics are divided in those corresponding to timed reductions and those corresponding to untimed reductions. The ill-timed semantics with timed reductions are stronger than both the well-timed semantics and the ill-timed semantics with untimed reductions, whereas these two classes are unrelated. Any barbed congruence which is based on either timed reductions, or any of the class of observables O2, O3, or O4, allow to distinguish processes that are equated by the ordinary CCS strong equivalence 4 CCS . To this purpose, let e = a j a and f = a:a be pure processes. Now, consider p = 0 . e and (a) 0 (a) 00 q = 0 . f . If timed reductions are used, then p ! p ! p whereas q cannot perform this computation. If #at is allowed, then p ! p0 #a(a) is possible, but q ! q0 #a(a) is not possible. There are cases in which the semantics are incomparable with CCS and cases in which they are ner than CCS . The semantics are incomparable with CCS in all those cases in which some reductions of a process, that could occur in CCS, cannot occur in the timed context due to the presence of certain conditions on local clocks. This is the case for the eager paradigm: consider process
(wait
t: b j b:c)nfbg
the synchronization between b and b cannot occur, since the two components have dierent clocks therefore this agent is equivalent to wait t: nil, whereas the two agents are obviously not CCS equivalent. This also happens in the well-timed busy-waiting approach: consider wait t1 : a j wait t2 : b with t1 > t2 after the reduction corresponding to t1 the reduction corresponding to t2 cannot occur. This cut of reductions due to the presence of conditions on the values of local clocks, by the use of suitable contexts allows one to For ordinary CCS strong equivalence we mean Milner's strong bisimulation equivalence 14] for CCS where, clearly, wait prexes have now to be intended as standard prexes. 4
10
Corradini, Ferrari and Pistore
observe timing also in the cases of untimed semantics with observables O1 (u1). The main consequence is that these semantics turn out to coincide with the corresponding untimed semantics with observables O2 (u2). The semantics are ner than CCS in all those cases where it is not possible to forbid the occurrence of a reduction by the use of conditions on the local clocks even if it is possible to delay it. This happens in the lazy approach (both well-timed and ill-timed) and in the ill-timed busy-waiting approach. In these cases the untimed semantics with observable O1 coincide with CCS . In this paper we will present the technical development only for few cases and we refer to the full paper for the complete analysis. In particular we focus on the relations between the well-timed semantics. Following results are basic and easy to prove: they state that if two pure processes are barbed congruent w.r.t. timed reduction, then they are barbed congruent also w.r.t. untimed reduction. Furthermore if two pure processes are barbed congruent w.r.t. a more informative class of observation predicates, then they are barbed congruent also w.r.t. a less informative class. Similar relations hold in the ill-timed case. Proposition 4.1
Wt Wu
W4 W3
W4 W2
W3 W1
W2 W1
In most cases, the proof strategy consists of constructing barbed bisimulations by considering powerful contexts as highlighted by proposition below. Proposition 4.2
Wt1
=
Wt2
Wt3
=
Wt4
Proof. (Outline) Half of the proof relies on Proposition 4.1.
Next, we show that e Wt1 f implies e Wt2 f . Given a sort S , we associate to each a 2 S an action aS such that aS aS 62 S and, for each a b 2 S , aS = bS implies a = b. Moreover, we assume to have distinguished actions kS1 and kS2 whose duration is 1. Dene R to be the relation: R
= (p q) p q : S f
where
j
n
US
^
maxclock
=0.
US j
(p) = maxclock(q) = n p ^
1.
n. X = a:a
US j j
US
a2S
Ai = kSi:A(i+1) mod 2 kSi: j
US j
n
_
j US Wt1
q
n
j US g
n . A(n mod 2)
S
US
for i = 1 2
Relation R is Wt2-barbed bisimulation. Then, we have that e Wt1 f implies, for each context C ], C e] j USn _ Wt1 C f ] j USn, where n = maxclock(C e]) = maxclock(C f ]) and S is such that C e] C f ] : S . Hence C e] _ Wt2 C f ] for each C ] and so e Wt2 f . 11
Corradini, Ferrari and Pistore
The proof that e Wt3 f implies e Wt4 f has the same technical development: obviously, by denition of R, if p R q then p @ t i q @ t. 2 Proposition 4.3
Wt1 = Wt3
Wt2 = Wt4
By Proposition 4.2 and Proposition 4.3, all the barbed congruences with timed reductions coincide in the well-timed case for the eager, busy-waiting and lazy approaches. Following propositions relate the timed congruences with the corresponding untimed congruences. Proposition 4.4
Wu2 = Wt2
Wu3 = Wt3
Wu4 = Wt4
In the eager and busy-waiting approaches also Wu1 coincides with the corresponding semantics with timed reductions, namely Wt1 . Proposition 4.5
WEu1 = WEt1
WBu1 = WBt1
In the lazy approach, instead, WLu1 collapses to CCS , and, therefore, it is dierent from the other well-timed lazy semantics. In fact, let forget be the obvious mapping which compiles timed processes into CCS processes e.g., forget(wait t: e) = :forget(e) and forget(t . p) = forget(p). It is straightforward to see that p !L p i forget(p) !CCS forget(p ) and that . p #La i forget(p) #CCS a 0
Proposition 4.6
0
WLu1 = CCS
Notice that in the ill-timed case all the timed semantics are dierent from all the untimed semantics here is the counterexample. Consider processes e = wait t1: nil and f = wait t2 : nil with t1 6= t2 . Then, e Iu f but e 6 It f .
5 SOS Semantics In this section we provide alternative characterizations of the dierent barbed congruences in terms of strong bisimulation over the labelled transition systems induced by SOS rules. We start by considering the eager and lazy semantics whose models are simpler. Then we consider the busy-waiting paradigm which presents some additional problem. To represent timing of action occurrences, labels of transitions are pairs @t, where 2 Act and t 2 N + . According to the SOS method, the transition relation is dened by induction on the structure of the processes. Here, SOS rules are inductively dened over processes in canonical form. The behaviour of guarded summation is explained by the two axioms:
t . (a:e + ) a@!t t . e 0
0
12
Corradini, Ferrari and Pistore
+ ) @!t t . e where t = t + (a) (resp. t = t + n) in the eager case, t t + (a) (resp. t t + n) in the lazy case. (
0
t . wait n: e 0
0
0
0
0
The structural rule of parallel composition discriminates between ill-timed and well-timed:
@ ! p @t pjq !p jq where the side condition t maxclock(q) is added in the well-timed case. p
t
0
0
The synchronization rule is the same in all the cases: two processes may synchronize provided that they perform complementary actions at the same time. p
a@ t @t !q a! p q @t pjq !p jq 0
0
0
0
Notice that, like in the reduction semantics, the operational behaviour of wait prexes can be derived from the other rules, by considering wait t:e equivalent to (a:nil j a:e)nfag, for some action a which does not appear in e and whose duration is t. The remaining structural rule is standard: @ ! p if 6= a a @t pnfag ! p nfag p
t
0
0
Finally, the following rule handles structural congruence. p
q
@t ! q @t p !p
q
q0
0
p
0
0
The rule for structural congruence is not a structural rule we have used it here for sake of simplicity and to obtain rules as similar as possible to those for the reduction semantics. However, this rule could be removed by adding symmetric rules for parallel composition and synchronization, and a new rule for recursion. Table 2 summarizes SOS rules. As usual, to identify a specic SOS semantics we index labelled transitions with their mode. The transition system induced by the ill-timed eager SOS rules is similar to the transition system of 1,2]. The dierences are that the latter includes information about the duration of actions and the beginning time of transitions is observed instead of the completing time. Moreover, the behavioural equivalence of 1,2] is based on branching bisimulation 10] rather than strong bisimulation. Instead, the well-timed lazy SOS rules induce the labelled transition system presented in 6]. The following proposition holds in the eager and lazy paradigms, both ill-timed and well-timed. 13
Corradini, Ferrari and Pistore
8 < t = t + (a) eager a@t t . e where : t . (a:e + ) t t + (a) lazy 8 < t = t + (a) eager where @t t . e : t t + (a) lazy t . (wait n: e + ) 0
0
0
!
0
0
0
@t @ t
p ! p0 pjq
!
p0 j q
!
0
0
t maxclock(q )
a@t
if well-timed
a@t
p ! p0 q ! q 0 @t p j q ! p0 j q 0
@t @t
p ! p0 pnfag
!
p0 nfag
if = a a 6
pq
q
@t q @t
!
0
q0
p0
p ! p0
Table 2 SOS semantics: eager and lazy rules. @t Lemma 5.1 If p a! p then p ((t . a:e + ) j p1 j p2 j j pn)nfb1 g nfbm g 0
0
and
p (t . e j p1 j p2 j j pn)nfb1g nfbmg with a 6= bi for i = 1 : : : m and t = t (a) in the eager case and t t (a) 0
0
0
in the lazy case).
Proposition 5.2 Let p be a timed process. Then: @t 0 p ! p i p !t p0 and a@ t 0 p ! p i p j t0 . a:e !t p0 j t . e for all pure processes e and for all t0 2 N + such that t0 = t (a) in the eager case and t0 t (a) in the lazy case. @t 0 Corollary 5.3 p #at implies p a! p for some p0.
We now introduce the standard notion of bisimulation. Denition 5.4 A relation R on timed processes is a bisimulation if, whenever p R q then: @t 0 @t 0 for each p ! p there is some q ! q with p0 R q0 @t 0 @t 0 for each q ! q there is some p ! p with p0 R q0. 14
Corradini, Ferrari and Pistore
Two timed processes p and q are bisimilar, written p ' q , if p R q for some bisimulation R. Two pure processes e and f are bisimilar, written e ' f , if 0 . e ' 0 . f. Lemma 5.5 Relation ' on pure processes is a congruence.
The proof of this lemma is omitted, since it is standard. Examples of such a proof can be found for instance in 13,6,4].
Proposition 5.6 'E = Et2 'L = Lt2 Proof. (Outline) The proof that e ' f implies e f is simple: by Lemma 5.5 ' is a congruence, so it remains to show that e ' f implies e f or, more in general, that p ' q implies p q. This is a consequence of Proposition 5.2
and Corollary 5.3. The proof that e f implies e ' f is more complex. We build a relation R which contains all the pair of processes (0 . e 0 . f ) such that e f then we show that R is a bisimulation: hence e f implies e ' f . Let S be such that p : S and q : S . Let US be the set of processes u such that u = u1 j u2 j j un with n 0 and ui = ti . (ai:nil + i :nil), where i are such that i i 62 S and i 6= j if i 6= j . The role of these actions i is to reveal whether in a t reduction p j u ! p a synchronization with some component ui is performed: in this case, in fact, p 6# . Notice that u can also be empty for n = 0, in which case we assume p j u = p. Relation R is dened as follows: R = f(p q) j maxclock(p) = maxclock(q) ^ p j u _ q j u8u 2 US g: Since e f implies 0 . e j u _ 0 . f j u for all u 2 US , then e f implies (0 . e 0 . f ) 2 R. 2 The busy-waiting case needs more explanation. Its main reduction axiom is !t t . (e j f ) t1 . (a:e + ) j t2 . (a:f + ) where t = max(t1 t2) + (a). The intuitive idea is that two processes can synchronize when they perform complementary actions at the same time if one of the two is able to execute such an action before the other, then a form of busy waiting is allowed. This permits to model situations in which a faster process can wait for a slower partner. However, when both partners are ready to synchronize, the handshaking immediately happens 5 Thus, while the slower 0
0
i
This notion of urgency of synchronizations is a weaker notion than the so called maximal progress 13,22] where, besides requiring synchronizations to happen as soon as they can, early actions can always disable later conicting actions. E.g., take the pro5
15
Corradini, Ferrari and Pistore
partner is always eager to perform its communicating action, the faster process may delay the execution of its matching action in order to synchronize. For these reasons, we have to consider three dierent kinds of experiments in the SOS characterization of the busy waiting barbed congruence. Lazy @t experiments for visible actions (p a! L p ): visible actions can be performed with an arbitrary delay before their execution is started. These delayed executions model the situation in which the process responsible of their execution, is faster with respect to an hypothetic external slower partner. Eager experia@ t ments for visible actions (p !E p ): visible actions can be performed with null execution delay. These executions model the inverse situation, in which the process responsible of their execution is slower with respect to a faster external @t partner. Finally, invisible experiments (p ! B p ) model (urgent) synchroniza @t tions. The SOS characterization of p !B p can be given by exploiting both the lazy and the eager operational semantics. The central rule is: 0
0
0
0
@
@
p !E p q !L q @t pjq !B p j q a t
0
a t 0
0
0
meaning that one of the two partners is always eager to synchronize while the other processes may delay its execution. The denition of bisimulation follows. Denition 5.7 A relation R on timed processes is a busy-waiting bisimulation (also B-bisimulation) if, whenever p R q then: a@t @t 0 0 0 for each p !E p0 there is some q a! E q with p R q , @t 0 a@ t for each p a! !L q0 with p0 R q0, L p there is some q @t 0 @t for each p ! !B q0 with p0 R q0 B p there is some q a@t @t 0 0 0 for each q !E q0 there is some p a! E p with p R q , a@t a @ t for each q !L q 0 there is some p !L p0 with p0 R q0 , @t 0 @t for each q ! !B p0 with p0 R q0. B q there is some p Two timed processes p and q are B-bisimilar, written p 'B q, if p R q for some B-bisimulation R. Two pure processes e and f are B-bisimilar, written e 'B f , if 0 . e 'B 0 . f . Proposition 5.8
'B = Bt2
The labelled transition system induced by the ill-timed busy-waiting SOS rules does not coincide with that dened in 11,12]. However, the characterization of the coarsest congruence contained in the so called performance equivalence 11,12], which was left as an open problem, is based on the labelled transition system dened above 4]. cess (( j ) j )nf g, both synchronizations on are allowed in our setting while the synchronization with the caused by is forbidden if maximal progress is assumed. a:b:c
b:c
b
b
b
b
a
16
Corradini, Ferrari and Pistore
To handle untimed semantics, it suces to abstract from the timing of @t occurrence of transitions. Namely, ! if ! for some . The resulting notion of bisimulation is the obvious one. If R then: a@ t 0 @t 0 for each ! there is some a! with 0 R 0, for each ! 0 there is some ! 0 with 0 R 0, and symmetrically for the transitions of (similarly for the busy-waiting case). We denote the corresponding bisimilarity with 'u (e.g., 'ILu is the relation obtained by using ill-timed, lazy transitions).
p
p
0
p
p
0
p
p
p
q
q
p
q
p
p
q
q
p
q
t
q
q
Proposition 5.9
Iu2 = 'Iu
Notice that this does not hold in the well-timed case: wait 2 nil with 1 6= 2 are 'Wu but are not Wu2 . t :
t
wait t1 : nil
and
t
6 Concluding Remarks We developed a semantic framework to describe and reason about performance sensitive semantics for process calculi. The framework relies on the notions of reduction and observability and has allowed to nicely motivate dierent design decisions for modelling the passage of time on local clocks in terms of process interaction mechanisms. It is worth also noting that our framework smoothly extends to deal with theories of timed mobile processes as 7]: they consider eager actions and local clocks are associated to the parallel components of -calculus processes 15]. The results of this paper provide the basis for a series of investigations. An interesting research theme is the generalization of our reduction framework to deal with duration functions which associate a random value to each action. The work by Walter Vogler on Petri Nets is also of great interest. A testing theory for Timed Petri Nets is proposed in 21] where the duration of transitions may vary from execution to execution and is actually xed by the tester. This presents some similarities with the notion of observation predicate presented in this paper. We plan to report on this extension in future works. The technical treatment of actions (actions have a duration) distinguishes the semantic theories we considered from other timed theories where actions are durationless events. It would also be of interest to see whether reduction semantics could be used to compare the relative expressive power of such timed calculi.
References 1] L. Aceto and D. Murphy. On the ill-timed but well-caused. In Proc. CONCUR'93, LNCS 715. Springer Verlag, 1993.
17
Corradini, Ferrari and Pistore
2] L. Aceto and D. Murphy. Timing and causality in process algebra. Acta Informatica 33:4, 1996. 3] F. Corradini. Compositionality for processes with durational actions. In Proc. 5th ICTCS. World Scientic, 1995. 4] F. Corradini. On performance congruences for process algebras. Unpublished manuscript. COGS, University of Sussex, 1996. 5] F. Corradini, R. Gorrieri and M. Roccetti. Performance preorder: ordering processes with respect to speed. In Proc. MFCS'95, LNCS 969. Springer Verlag, 1995. 6] F. Corradini and M. Pistore. Specication and verication of timed lazy systems. In Proc. MFCS'96, LNCS 1113. Springer Verlag, 1996. 7] P. Degano, J.V.Loddo and C. Priami. Mobile processes with local clocks. In Proc. of Workshop on Analysis and Veri cation of Multiple-Agents Languages, LNCS 1192. Springer Verlag, 1996. 8] G. Ferrari and U. Montanari. Dynamic matrices and the cost analysis of concurrent programs. In Proc. AMAST'95, LNCS 936. Springer Verlag, 1995. 9] C. Fidge and J. Zic. A simple, expressive, real time CCS. Technical Report, The University of Queensland, 1995. 10] R. van Glabbeek and P. Weijland. Branching time and abstraction in bisimulation semantics. In Proc. IFIP'89, 1989. 11] R. Gorrieri and M. Roccetti. Towards performance evaluation in process algebras. In Proc. AMAST'93, 1993. 12] R. Gorrieri, M. Roccetti and E. Stancampiano. A theory of processes with durational actions. Theoretical Computer Science 140, 1995. 13] M. Hennessy. Timed process algebras: a tutorial. Technical Report 3/93, Computer Science Department, University of Sussex, 1993. 14] R. Milner. Communication and Concurrency. Prentice Hall, 1989. 15] R. Milner, J. Parrow and D. Walker. A calculus of mobile processes (parts I and II). Information and Computation, 100:177, 1992. 16] R. Milner and D. Sangiorgi. Barbed Bisimulation. In Proc. ICALP'92, LNCS 623. Springer Verlag, 1992. 17] F. Moller and C. Tofts. A temporal calculus of communicating systems. In Proc. CONCUR'90, LNCS 458. Springer Verlag, 1990. 18] X. Nicollin and J. Sifakis. The algebra of timed processes ATP. Theory and application. Information and Computation 114:1, 1994. 19] X. Nicollin and J. Sifakis. An overview and synthesis on timed process algebras. In Proc. CAV'91, LNCS 575. Springer Verlag, 1991. 18
Corradini, Ferrari and Pistore
20] D. Sangiorgi. Expressing Mobility in Process Algebras: First Order and HigherOrder Paradigms. PhD Thesis, Department of Computer Science, University of Edinburgh, 1992. 21] W. Vogler. Timed testing of concurrent systems. Information and Computation 121, pp. 149-171, 1995. 22] W.Yi. Real time behaviour of asynchronous agents. In Proc. CONCUR'90, LNCS 458. Springer-Verlag, 1990.
19