A Tutorial on EMPA: A Theory of ConcurrentProcesses with Nondeterminism, Priorities, Probabilities and Time Marco Bernardo Roberto Gorrieri Technical Report UBLCS-96-17 December 1996Revised January 1997 Department of Computer Science University of Bologna Mura Anteo Zamboni 740127 Bologna (Italy) The University of Bologna Department of Computer Science Research Technical Reports are available ingzipped PostScript format via anonymous FTP from the area ftp.cs.unibo.it:/pub/TR/UBLCS or viaWWW at URL http://www.cs.unibo.it/. Plain-text abstracts organized by year are available in thedirectory ABSTRACTS. All local authors can be reached via e-mail at the address last-name@cs.unibo.it. Questions and comments should be addressed to tr-admin@cs.unibo.it. Recent Titles from the UBLCS Technical Report Series 95-8 Building Hypermedia for Learning: a Framework Based on the Design of User Interface, S. Mangiaracina, C.Maioli, February 1995. 95-9 The Bologna Optimal Higher-Order Machine, A. Asperti, C. Giovannetti, A. Naletto, March 1995. 95-10 Synchronization Support and Group-Membership Services for Reliable Distributed Multimedia Applications,F. Panzieri, M. Roccetti, March 1995 (Revised July 1995). 95-11 The Inherent Cost of Strong-Partial View-Synchronous Communication, "O. Babao*glu, R. Davoli, L.-A. Giachini, P. Sabattini, April 1995. 95-12 On the Complexity of Beta-Reduction, A. Asperti, July 1995. 95-13 Optimal Multi-Block Read Schedules for Partitioned Signature Files, P. Ciaccia, August 1995. 95-14 Integrating Performance and Functional Analysis of Concurrent Systems with EMPA, M. Bernardo, L.Donatiello, R. Gorrieri, September 1995 (Revised March 1996). 95-15 On Programming with View Synchrony, "O. Babao*glu, A. Bartoli, G. Dini, September 1995. 95-16 Generative Communication in Process Algebra, P. Ciancarini, R. Gorrieri, G. Zavattaro, October 1995. 95-17 Dynamic Declustering Methods for Parallel Grid Files, P. Ciaccia, A. Veronesi, November 1995. 95-18 Group Membership and View Synchrony in Partitionable Asynchronous Distributed Systems: Specifications,"O. Babao*glu, R. Davoli, A. Montresor, November 1995 (Revised September 1996). 96-1 An Investigation on the Optimal Implementation of Processes, C. Laneve, January 1996. 96-2 Expansivity, Permutivity, and Chaos for Cellular Automata, F. Fagnani, L. Margara, January 1996. 96-3 Enriched View Synchrony: A Paradigm for Programming Dependable Applications in Partitionable Asyn-chronous Distributed Systems, "O. Babao*glu, A. Bartoli, G. Dini, February 1996 (Revised November 1996). 96-4 May and Must Testing in the Join-Calculus, C. Laneve, March 1996. 96-5 The Shape of Shade: a Coordination System, S. Castellani, P. Ciancarini, D. Rossi, March 1996. 96-6 Engineering Formal Requirements: an Analysis and Testing Method for Z Documents, P. Ciancarini, S.Cimato, C. Mascolo, March 1996. 96-7 Using Bayesian Belief Networks for the Automated Assessment of Students' Knowledge of Geometry ProblemSolving Procedures, M. Roccetti, P. Salomoni, March 1996. 96-8 Virtual Interactions: An Investigation of the Dynamics of Sharing Graphs, A. Asperti, C. Laneve, April1996. 96-9 Towards an Algebra of Actors, M. Gaspari, April 1996. 96-10 Mobile Petri Nets, A. Asperti, N. Busi, May 1996. 96-11 Communication Support for Critical Distributed Multimedia Applications: an Experimental Study, F.Panzieri, M. Roccetti, May 1996. 96-12 A Logic Coordination Language Based on the Chemical Metaphor, P. Ciancarini, D. Fogli, M. Gaspari, July1996. 96-13 Towards Parallelization of Concurrent Systems, F. Corradini, R. Gorrieri, D. Marchignoli, August 1996 (Revised December 1996). 96-14 The Compositional Security Checker: A Tool for the Verification of Information Flow Security Properties, R. Focardi, R. Gorrieri, August 1996. 96-15 Jada: a Coordination Toolkit for Java, P. Ciancarini, D. Rossi, October 1996. 96-16 Fault Tolerance through View Synchrony in Partitionable Asynchronous Distributed Systems, A. Montresor,December 1996. 96-17 A Tutorial on EMPA: A Theory of Concurrent Processes with Nondeterminism, Priorities, Probabilities andTime, M. Bernardo, R. Gorrieri, December 1996. 97-1 Partitionable Group Membership: Specification and Algorithms, "O. Babao*glu, R. Davoli, A. Montresor, January 1997. A Tutorial on EMPA: A Theory of Concurrent Processes with Nondeterminism, Priorities, Probabilities and Time Marco Bernardo 1 Roberto Gorrieri 1 Technical Report UBLCS-96-17 December 1996Revised January 1997 Abstract We give an overview of EMPA, a process algebra for modeling and analyzing concurrent systems wherenondeterminism, priorities, probabilities and time are present, aiming at a reasonable trade off between the expressive power of the calculus and the complexity of its underlying theory. 1. Universit`a di Bologna, Dipartimento di Scienze dell'Informazione, Mura Anteo Zamboni 7, 40127 Bologna, Italy.E-mail: fbernardo, gorrierig@cs.unibo.it. 1 1 Introduction 1 Introduction Several process algebras have been proposed in the literature in order to model and analyzeconcurrent systems. Classical process algebras such as CCS [26], CSP [20], ACP [4] and LOTOS [9] were concerned only with functional aspects of concurrent systems. This means that actionscomposing algebraic terms were only given a name, and nothing was said about e.g. their duration. As a consequence, only functional properties (e.g. absence of deadlock) of concurrentsystems could be investigated. Subsequently, the expressiveness of classical process algebras was enriched by allowing forthe modeling of real-world features such as priorities, probabilities and durations, thereby resulting in prioritized process algebras (see e.g. [2, 11, 12, 39]), probabilistic process algebras (seee.g. [21, 40, 14, 25, 3, 36]), deterministically timed process algebras (see [28, 15] and the references therein), and stochastically timed process algebras (see [31, 32, 33, 34] and the references therein). Theenhanced expressive power achieved by these classes of process algebras has allowed to model and analyze a greater number of characteristics with respect to classical process algebras suchas interrupt mechanisms, service centers where customers having different priorities may arrive, loss probability of a communication channel, probability to reach a deadlocked state, satisfactionof real-time constraints, throughput and utilization of service centers. Now, if we examine the process algebras mentioned above, we realize that nondeterminism,priorities, probabilities and time are considered in isolation. In other words, to the best of our knowledge there is no process algebra where all the four features are taken into account. Thepoint is that it would be nice to develop one single calculus of concurrent processes accounting for nondeterminism, priorities, probabilities and time in order to exploit all the advantages affordedby each class of process algebras, provided that the theory underlying such a calculus is not too complex. This means that a reasonable trade off between the modeling power and the availabilityof analysis tools should be attained. In order to achieve this objective, we have developed a process algebra called Extended Marko-vian Process Algebra (EMPA) [5, 7]. The development of EMPA has been strongly influenced by the stochastically timed process algebras MTIPP [16] and PEPA [18], and by the formalism ofgeneralized stochastic Petri nets (GSPNs) [1]. This is witnessed by the fact that in EMPA there are three different kinds of actions: exponentially timed actions (taken from MTIPP and PEPA),prioritized weighted immediate actions (analogous to prioritized weighted immediate transitions of GSPNs), and passive actions (similar to passive actions of PEPA). Exponentially timed actionsdescribe activities that are relevant from the performance point of view. Prioritized weighted immediate actions model logical events as well as activities that are either irrelevant from theperformance point of view or unboundedly faster than the others, and are useful to express both prioritized choices and probabilistic choices. Finally, passive actions model activities waiting forthe synchronization with exponentially timed or immediate activities, and are useful to express nondeterministic choices. The purpose of this tutorial is to present EMPA by showing how nonde-terminism, priorities, probabilities and time have been combined together so that a considerable expressive power has been achieved without burdening the underlying theory exceedingly.The tutorial is organized as follows. In Section 2 we present the syntax of EMPA terms and we informally explain the semantics of EMPA operators. In Section 3 we define the integratedinterleaving semantics of EMPA terms. In Section 4 we show that the coexistence of the different kinds of actions can be thought of as the coexistence of a nondeterministic kernel, a prioritizedkernel, a probabilistic kernel and an exponentially timed kernel. The division of EMPA into four kernels should provide a better insight in the structure of EMPA, and allows us to make somecomparisons with process algebras appeared in the literature. In Section 5 we define a notion of equivalence over EMPA terms which is build by considering the various kernels singled outin the previous section. Finally, in Section 6 we report some concluding remarks on further enhancements of the expressiveness of EMPA and the related consequences on the complexity ofthe underlying theory. This tutorial is based mainly on [7, 8]. With respect to [7], we emphasize the coexistence ofseveral kernels and the resulting expressive power like in [8]; unlike [8], passive actions are part UBLCS-96-17 2 2 Syntax and informal semantics for EMPA of each of the four kernels in order to stress their gluing role. Two new technical results, theaxiomatization of the notion of equivalence and an algorithm to check two terms for equivalence, are presented at the end of Section 5. 2 Syntax and informal semantics for EMPA 2.1 Actions: types and rates The building blocks of EMPA are actions. Each action is a pair !a; ~*? consisting of the type of theaction and the rate of the action. The type denotes the kind of the action (e.g. transmission of a message), while the rate indicates the speed at which the action occurs from the point of view ofan external observer: rates are used as a concise way to denote the random variables specifying the duration of the actions (see below). Depending on the type, like in classical process algebras,actions are divided into external and internal: as usual, we denote by o/ the only internal actiontype we use. Depending on the rate, actions are divided into: ffl Active actions, i.e. actions whose rate is fixed, in turn divided into:- Exponentially timed actions, i.e. actions whose rate * is a positive real number. Such anumber is interpreted as the parameter of the exponentially distributed random variable specifying the duration of the action. We recall that an exponentially distributedrandom variable X has probability distribution function FX(t) = Pr[X ^ t] = 1\Gamma e\Gamma *\Delta tand expected value 1 =*, thus it is uniquely identified by its parameter * 2 RI +.- Immediate actions, i.e. actions whose rate 1l;w is infinite. Such actions have durationzero, and each of them is given a priority level l 2 NI + and a weight w 2 RI +. ffl Passive actions, i.e. actions whose rate (denoted by \Lambda ) is undefined. The duration of a passiveaction is fixed only by synchronizing it with an active action of the same type. The classification of actions based on their rates implies that: (i) exponentially timed actionsmodel activities that are relevant from the performance point of view, (ii) immediate actionsmodel logical events as well as activities that are either irrelevant from the performance point of view or unboundedly faster than the others, (iii) passive actions model activities waiting for thesynchronization with timed activities. We denote the set of actions by Act = AType \Theta ARate where AType is the set of types and ARate = RI + [ Inf [ f\Lambda g, with Inf = f1l;w j l 2 NI + ^ w 2 RI +g, is the set of rates. We use a; b; c; : : : as metavariables for AType, ~*; ~_; ~fl; : : : for ARate, and *; _; fl; : : : for RI +. Finally, wedenote by PLevel = f\Gamma 1g [ NI the set of priority levels, and we assume that \Lambda ! * ! 1l;w for all * 2 RI + and 1l;w 2 Inf . 2.2 Syntax of terms and informal semantics of operators Let Const be a set of constants, ranged over by A; B; C; : : :, and let RFun = f' : AType \Gamma ! AType j '(o/ ) = o/ ^ '(AType \Gamma fo/ g) ` AType \Gamma fo/ gg be a set of relabeling functions. Definition 2.1 The set L of process terms of EMPA is generated by the following syntax E ::= 0 j !a; ~*?:E j E=L j E['] j E + E j E kS E j A where L; S ` AType \Gamma fo/ g. The set L will be ranged over by E; F; G; : : :. The null term "0" represents a termination or deadlocked state. The prefix operator "!a; ~*?: " represents the sequential composition of an action and a term; so, term !a; ~*?:E can execute action !a; ~*? and then behaves as term E.The functional abstraction operator " =L" abstracts from the type of the actions (executed by theterm to which it is applied) whenever it is in L, i.e. the action type is turned into o/ . The meaningof this operator is the same as that of the hiding operator of CSP [20]. The functional relabeling operator " [']" changes the type of the actions (executed by the termto which it is applied) according to '. The meaning of this operator is the same as that of therelabeling operator of CCS [26]. UBLCS-96-17 3 2 Syntax and informal semantics for EMPA The alternative composition operator " + " expresses a choice between two terms. As we shallsee in Section 2.3, the nature of the choice depends on the kind of the actions involved in the choice itself.The parallel composition operator " kS " is based on two synchronization disciplines. Thesynchronization discipline on action types is the same as that of CSP [20], hence two actions can synchronize only if they have the same type, and this coincides with the resulting type. The synchronization discipline on action rates states that action !a; ~*? can be synchronized with action !a; ~_? only if min(~*; ~_) = \Lambda , and the resulting rate is given by max(~*; ~_) up tonormalization. In other words, in a synchronization at most one active action can be involved and its rate determines the rate of the synchronization itself, up to normalization. Concerning constants, let Def ` Const \Theta L be a set of defining equations of the form A \Delta = E.In order to guarantee the correctness of recursive definitions given by means of constants, we restrict ourselves to terms that are closed and guarded. Definition 2.2 Let E 2 L and A \Delta = E0 2 Def, and let us denote by j the syntactical equivalencebetween terms. The term EhA := E0i obtained from E by replacing each occurrence of A with E0is defined by induction on the syntactical structure of E as follows: ffl 0hA := E0i j 0 ffl (!a; ~*?:E)hA := E0i j !a; ~*?:(EhA := E0i) ffl (E=L)hA := E0i j (EhA := E0i)=L ffl (E['])hA := E0i j (EhA := E0i)['] ffl (E1 + E2)hA := E0i j (E1hA := E0i) + (E2hA := E0i) ffl (E1 kS E2)hA := E0i j (E1hA := E0i) kS(E2hA := E0i) ffl BhA := E0i j ae E 0 if B j A B if B 6j A Definition 2.3 Let E 2 L, and let us denote by st the relation subterm-of. The set of terms ob-tained from E by repeatedly replacing constants by the right-hand side terms of their definingequations in Def is defined by SubstDef(E) = [ n2 NI Subst nDef (E) where SubstnDef (E) = ( fEg if n = 0fF 2 L j F j GhA := E0i ^ G 2 Substn\Gamma 1 Def (E) ^ A st G ^ A \Delta =E0 2 Defg if n ? 0 Definition 2.4 Let E 2 L. The set of constants occurring in E is defined by ConstDef (E) = fA 2 Const j 9F 2 SubstDef (E): A st F g Definition 2.5 A term E 2 L is guardedly closed w.r.t Def if and only if for each constant A 2Const Def (E) ffl A is equipped in Def with exactly one defining equation A \Delta = E0, and ffl there exists F 2 SubstDef(E0) such that, whenever an instance of a constant B satisfies B st F , then the same instance satisfies B st !a; ~*?:G st F . We denote by G the set of terms in L that are guardedly closed w.r.t Def. From now on, Def will not be explicitly mentioned as it will be clear from the context. UBLCS-96-17 4 2 Syntax and informal semantics for EMPA 2.3 Semantic model: race policy, preselection policy and interleaving In this section we address the problem of representing the semantic model of an EMPA term byexamining three cases. Sequence Consider term !a; *?:0. This term represents a system that can execute an actionhaving type a whose duration is exponentially distributed with rate *. Its semantic model canbe represented as a rooted labeled transition system (LTS), i.e. a graph whose nodes describe the states of the system and whose transitions describe state changes. In this case, the LTS has twostates that correspond to terms !a; *?:0 and 0, respectively. At first sight, in this case we shouldhave infinitely many transitions labeled with a from the first state to the second state, i.e. onetransition for every possible duration of the action. Fortunately, this infinitely branching structure can be replaced by means of one single transition labeled with a; *: the rate of the exponentialdistribution describing the duration of the action at hand contains all the information we need from the point of view of the underlying performance model, which is a Markov chain as weshall see. Choice Consider term !a; *?:0 + !b; _?:0. This term represents a system that can execute twoalternative exponentially timed actions. Like in [1, 16, 18], as a mechanism for choosing the action to execute we adopt the race policy: the action sampling the least duration succeeds. Theadoption of the race policy implies that (i) the random variable describing the sojourn time in thestate corresponding to the term above is the minimum of the exponentially distributed random variables describing the duration of the two actions, and (ii) the execution probability of thetwo actions is determined as well by the exponentially distributed random variables describing their durations. In order to compute the two quantities above, we exploit the property thatthe minimum of n independent exponentially distributed random variables is an exponentiallydistributed random variable whose rate is the sum of the n original rates [22]. As a consequence,for the term above we have that the sojourn time of the corresponding state is exponentially distributed with rate *+_ (hence the mean sojourn time is 1=(*+_)) and the execution probabilitiesof the two actions are *=(* + _) and _=(* + _), respectively. Since these two probabilities arenonzero, the semantic model of the term at hand is a LTS comprising two states that correspond to terms !a; *?:0 + !b; _?:0 and 0, respectively, as well as two transitions from the first state tothe second state labeled with a; * and b; _, respectively.Another important consequence of the adoption of the race policy is the fact that immediate actions take precedence over exponentially timed actions. If we consider term !a; *?:0 + !b; 1l;w?:0, then the underlying semantic model is a LTS with only one transition labeled with b; 1l;w because action !b; 1l;w? has duration zero whereas action !a; *? cannot sample durationzero from the associated exponential distribution. Consider now term !a; 1l;w?:0 + !b; 1l0;w0?:0. This term represents a system that canexecute two alternative immediate actions. Since both actions have the same duration hence the race policy does not apply, the action to execute is chosen according to the preselection policy: onlythe actions having the highest priority level are executable, and each of them is given a probability execution proportional to its own weight. The semantic model of the term above is a LTS with twostates that correspond to terms !a; 1l;w?:0 + !b; 1l0;w0?:0 and 0, respectively, and the sojourntime in the first state is zero. If l ? l0 (l0 ? l), then there is only one transition from the first state tothe second state which is labeled with a; 1l;w (b; 1l0;w0). If l = l0, then there are two transitionsfrom the first state to the second state which are labeled with a; 1l;w and b; 1l0;w0, respectively:the execution probability of the first transition is w=(w + w0) while the execution probability ofthe second transition is w0=(w + w0).Finally, consider term !a; \Lambda ?:0 + !b; \Lambda ?:0. This term represents a system that can executetwo alternative passive actions. Since the duration of passive actions is undefined, and they are assigned neither priority levels nor weights, they can be undergone to neither the race policynor the preselection policy. This means that passive actions can be viewed as actions of classical process algebras, hence the term above expresses a purely nondeterministic choice, wherenondeterminism refers to the absence of a mechanism that specifies how the choice is resolved. UBLCS-96-17 5 3 Integrated interleaving semantics of EMPA terms In conclusion, we observe that the alternative composition operator is parametric in the natureof the choice, because in its simpler form it describes a choice between two actions which is: ffl Prioritized if the two actions are active and have different priority levels. The choice is solvedimplicitly if it concerns an exponentially timed action and an immediate action (because the choice is implicitly determined by the race policy), explicitly if it concerns two immediateactions having different priority levels (because the priority levels explicitly determine the choice). ffl Probabilistic if the two actions are active and have the same priority level. The choice issolved implicitly if it concerns two exponentially timed actions (because their execution probabilities are implicitly determined by their durations due to the race policy), explicitlyif it concerns two immediate actions having the same priority level (because their execution probabilities are explicitly determined by their weights). ffl Nondeterministic if the two actions are passive, because in such a case neither the race policynor the preselection policy applies. Parallelism Consider terms E1 j !a; *?:!b; _?:0 + !b; _?:!a; *?:0 E2 j !a; *?:0 k; !b; _?:0Term E 1 represents a system that can execute either !a; *? followed by !b; _? or !b; _? followedby !a; *?, while term E2 represents a system that can execute !a; *? in parallel with !b; _?.Following the interleaving style of classical process algebras, we propose the following two LTSs as semantic models for E1 and E2 a,l b,u b,u a,l _0 _0. E1 a,l b,u _0 O/ _0|| < ,u>.b_0 O/ _0 E2 _0 O/ _0|| . ,l>. The isomorphism between the two LTSs is correct from the functional point of view by definitionof interleaving, and also from the performance point of view: due to the memoryless property of exponential distributions [22], if we assume that E2 completes a before b, then the residual time tothe completion of b is still exponentially distributed with rate _, so the rate labeling the transitionfrom state 0 k; !b; _?:0 to state 0 k; 0 is _ itself instead of _ conditional on *. In other words,this means that the semantics for EMPA can be defined in the interleaving style as in the case of classical process algebras.Furthermore, it is worth noting that in the right-hand LTS there is no transition from state E2 to state 0 k; 0 recording the possible simultaneous completion of a and b. The reason is thatthe probability of such a simultaneous completion is zero because the durations of a and b aredescribed by means of continuous probability distribution functions. 3 Integrated interleaving semantics of EMPA terms The main problem to tackle when defining the semantics for EMPA is that the actions executableby a given term may have different priority levels, and only those having the highest priority level are actually executable. Let us call potential move of a given term a pair composed of (i) anaction executable by the term, and (ii) a derivative term obtained by executing that action. Tosolve the problem above, we compute inductively the multiset 2 of the potential moves of a given term regardless of priority levels, and then we select those having the highest priority level. Thisis motivated in our framework by the fact that the actual executability as well as the execution probability of an action depend upon all the actions that are executable at the same time when it 2. We use "fj" and "jg" as brackets for multisets, " \Phi " to denote multiset union, Mufin(S) (Pfin (S)) to denote thecollection of finite multisets (sets) over set S, M(s) to denote the multiplicity of element s in multiset M, and ssi(M) todenote the multiset obtained by projecting the tuples in multiset M on their i-th component. UBLCS-96-17 6 3 Integrated interleaving semantics of EMPA terms is executable: only if we know all the potential moves of a given term, we can correctly determinethe transitions of the corresponding state and their rates. The formal definition of the integrated interleaving semantics for EMPA is based on thetransition relation \Gamma \Gamma \Gamma !, which is the least subset of G \Theta Act \Theta G satisfying the inference rulereported in the first part of Table 1. This rule selects the potential moves having the highest priority level, and then merges together those having the same action type, the same priority level and thesame derivative term. The first operation is carried out through functions Select : Mufin(Act \Theta G) \Gamma ! Mufin (Act \Theta G) and PL : Act \Gamma ! PLevel , which are defined in the third part of Table 1.The second operation is carried out through function Melt : Mufin (Act \Theta G) \Gamma ! Pfin (Act \Theta G)and partial function Min : (ARate \Theta ARate) \Gamma !o ARate, which are defined in the fourth partof Table 1. The name Min should recall the adoption of the race policy: the minimum of a setof random variables has to be computed. We regard Min as an associative and commutativeoperation, thus we take the liberty to apply it to multisets of rates. Example 3.1 If we consider term E j !a; *?:F + !a; *?:F then we have two identical potential moves (!a; *?; F ) which are merged into (!a; 2 \Delta *?; F ) bymeans of Melt and Min. The rationale behind the use of Melt and Min is thus the possibility of producing standard LTSs as integrated semantic models, without the need to decorate transitionswith auxiliary labels like in [16] nor the need to take into account the multiplicity of transitions like in [18]. The multiset PM (E) 2 Mufin (Act \Theta G) of potential moves of E 2 G is defined by structuralinduction in the second part of Table 1. The normalization of the rates of potential moves resulting from the synchronization of the same active action with several independent or alternative passiveactions is carried out through partial function Norm : (AType \Theta ARate \Theta ARate \Theta Mufin (Act \Theta G) \Theta Mufin(Act \Theta G)) \Gamma !o ARate and function Split : (ARate \Theta RI ]0;1]) \Gamma ! ARate, which are defined in the fifth part of Table 1. Note that Norm(a; ~*1; ~*2; PM 1; PM 2) is defined if and only if min(~*; ~_) = \Lambda , which is the condition on action rates we have required in Section 2.2 in order fora synchronization to be permitted. Example 3.2 Consider terms E1 j !a; *?:0 kfag(!a; \Lambda ?:0 k; !a; \Lambda ?:0) E2 j !a; *?:0 kfag(!a; \Lambda ?:0 + !a; \Lambda ?:0) In both cases, the left-hand side operand of "kfag" has one potential move (!a; *?; 0) and theright-hand side operand has two potential moves whose action is !a; \Lambda ?, hence the whole termhas two potential moves whose type is a. Since both terms consist of a single active action which isexponentially timed with rate *, the rate of each of the two potential moves cannot be * otherwisethe mean sojourn time of the states corresponding to E1 and E2 would be 1=2 \Delta * instead of 1=*:a normalization must take place so that the sum of the rates of the two potential moves turns out to be *. Assuming that independent or alternative passive actions have the same executionprobability when they are involved in a synchronization, Norm computes the rate of each of the potential moves above by dividing * by the number of independent or alternative passive actionswith which the synchronization can take place. As a consequence, the rate of each of the two potential moves is *=2. Definition 3.3 The integrated interleaving semantics of E 2 G is the LTS I[[E]] = ("E; Act; \Gamma \Gamma \Gamma !E; E)where "E is the set of states reachable from E, and \Gamma \Gamma \Gamma !E is \Gamma \Gamma \Gamma ! restricted to "E \Theta Act \Theta "E. Definition 3.4 E 2 G is performance closed if and only if I[[E]] does not contain passive transitions. UBLCS-96-17 7 3 Integrated interleaving semantics of EMPA terms (!a; ~*?; E0) 2 Melt(Select(PM (E))) E a;~*\Gamma \Gamma \Gamma ! E0 PM (0) = ; PM (!a; ~*?:E) = fj (!a; ~*?; E) jg PM (E=L) = fj (!a; ~*?; E0=L) j (!a; ~*?; E0) 2 PM (E) ^ a =2 L jg \Phi fj (!o/; ~*?; E0=L) j (!a; ~*?; E0) 2 PM (E) ^ a 2 L jg PM (E[']) = fj (!'(a); ~*?; E0[']) j (!a; ~*?; E0) 2 PM (E) jg PM (E1 + E2) = PM (E1) \Phi PM (E2) PM (E1 kS E2) = fj (!a; ~*?; E01 kS E2) j a =2 S ^ (!a; ~*?; E01) 2 PM (E1) jg \Phi fj (!a; ~*?; E1 kS E02) j a =2 S ^ (!a; ~*?; E02) 2 PM (E2) jg \Phi fj (!a; ~fl?; E01 kS E02) j a 2 S ^ (!a; ~*1?; E01) 2 PM (E1) ^ (!a; ~*2?; E02) 2 PM (E2) ^ ~fl = Norm(a; ~*1; ~*2; PM (E1); PM (E2)) jg PM (A) = PM (E) if A \Delta = E Select(PM ) = fj (!a; ~*?; E) 2 PM j PL(!a; ~*?) = \Gamma 1 . 8(!b; ~_?; E0) 2 PM : PL(!a; ~*?) * PL(!b; ~_?) jg PL(!a; \Lambda ?) = \Gamma 1 PL(!a; *?) = 0 PL(!a; 1l;w?) = l Melt(PM ) = f(!a; ~*?; E) j (!a; ~_?; E) 2 PM ^~ * = Minfj ~fl j (!a; ~fl?; E) 2 PM ^ PL(!a; ~fl?) = PL(!a; ~_?) jgg \Lambda Min \Lambda = \Lambda *1 Min *2 = *1 + *2 1l;w1 Min 1l;w2 = 1l;w1+w2 Norm(a; ~*1; ~*2; PM 1; PM 2) = ae Split(~*1; 1=(ss1(PM 2))(!a; \Lambda ?)) if ~*2 = \Lambda Split(~*2; 1=(ss1(PM 1))(!a; \Lambda ?)) if ~*1 = \Lambda Split(\Lambda ; ff) = \Lambda Split(*; ff) = * \Delta ff Split(1l;w; ff) = 1l;w\Delta ff Table 1. Inductive rules for EMPA integrated interleaving semantics UBLCS-96-17 8 4 EMPA kernels We denote by E the set of performance closed terms of G. Given a term E 2 G, its integrated interleaving semantics I[[E]] fully represents the behaviorof E because transitions are decorated by both the action type and the action rate. One can thinkof obtaining the functional semantics F[[E]] and the performance semantics P[[E]] of E from I[[E]] bysimply dropping action rates and action types, respectively. As a matter of fact, this is the case for the functional semantics. Definition 3.5 The functional semantics of E 2 G is the LTS F[[E]] = (" E; AType; \Gamma \Gamma \Gamma !E;F ; E)where \Gamma \Gamma \Gamma !E;F is \Gamma \Gamma \Gamma !E restricted to "E \Theta AType \Theta "E. The definition of the performance semantics requires instead a more careful treatment which isdeferred to the next section, and is given only for performance closed terms. 4 EMPA kernels Due to the coexistence of exponentially timed actions, prioritized weighted immediate actions,and passive actions, EMPA can be viewed as being made out of four kernels (see Figure 1): a nondeterministic kernel, a prioritized kernel, a probabilistic kernel, and an exponentially timedkernel. probabilistickernel kernelnondeterministic EMPA l* l, _ _, w kerneltimed exponentially kernelprioritized Figure 1. EMPA kernels In Sections 4.1 to 4.4 we examine each of these kernels separately by presenting how thefunctional semantics (in the case of the nondeterministic kernel and the prioritized kernel) or the integrated interleaving semantics (in the case of the probabilistic kernel and the exponentiallytimed kernel) specializes to the kernel at hand, by defining the performance semantics in the case of the probabilistic kernel and the exponentially timed kernel, and by making some comparisonwith related process algebras appeared in the literature. In Section 4.5 we consider the interplay UBLCS-96-17 9 4 EMPA kernels between the probabilistic kernel and the exponentially timed kernel both from the point of viewof the performance semantics and from the point of view of the probability distribution functions that can be modeled. In Section 4.6 we emphasize the role played by passive actions and wereport some remarks on the synchronization discipline adopted in EMPA. Finally, in Section 4.7 we show an example that should highlight the considerable expressive power of EMPA resultingfrom the coexistence of the four kernels. 4.1 Nondeterministic kernel The nondeterministic kernel EMPAnd is the sublanguage of EMPA obtained by considering onlypassive actions. Since the duration of passive actions is completely unspecified, EMPA nd is aclassical process algebra and allows for pure nondeterminism. We define below the syntax and the functional semantics of EMPAnd terms. Definition 4.1 The set Lnd of process terms of EMPAnd is generated by the following syntax E ::= 0 j !a; \Lambda ?:E j E=L j E['] j E + E j E kS E j A where L; S ` AType \Gamma fo/ g. We denote by Gnd the set of closed and guarded terms of Lnd. Definition 4.2 The functional semantics of E 2 Gnd is the LTS Fnd[[E]] = ("E; AType; \Gamma \Gamma \Gamma !E;Fnd; E)where \Gamma \Gamma \Gamma !E;Fnd is the restriction of \Gamma \Gamma \Gamma !Fnd (defined in Table 2) to "E \Theta AType \Theta "E. !a; \Lambda ?:E a\Gamma \Gamma \Gamma ! Fnd E E a\Gamma \Gamma \Gamma ! Fnd E0 E=L a\Gamma \Gamma \Gamma ! Fnd E0=L if a =2 L E a\Gamma \Gamma \Gamma ! Fnd E0 E=L o/\Gamma \Gamma \Gamma ! Fnd E0=L if a 2 L E a\Gamma \Gamma \Gamma ! Fnd E0 E['] '(a)\Gamma \Gamma \Gamma ! Fnd E0['] E1 a\Gamma \Gamma \Gamma ! Fnd E0 E1 + E2 a\Gamma \Gamma \Gamma ! Fnd E0 E2 a\Gamma \Gamma \Gamma ! Fnd E0 E1 + E2 a\Gamma \Gamma \Gamma ! Fnd E0 E1 a\Gamma \Gamma \Gamma ! Fnd E01 E1 kS E2 a\Gamma \Gamma \Gamma ! Fnd E01 kS E2 if a =2 S E2 a\Gamma \Gamma \Gamma ! Fnd E02 E1 kS E2 a\Gamma \Gamma \Gamma ! Fnd E1 kS E02 if a =2 S E1 a\Gamma \Gamma \Gamma ! Fnd E01 E2 a\Gamma \Gamma \Gamma ! Fnd E02 E1 kS E2 a\Gamma \Gamma \Gamma ! Fnd E01 kS E02 if a 2 S E a\Gamma \Gamma \Gamma ! Fnd E0 A a\Gamma \Gamma \Gamma ! Fnd E0 if A \Delta = E Table 2. Inductive rules for EMPAnd functional semantics UBLCS-96-17 10 4 EMPA kernels Proposition 4.3 For any E 2 Gnd we have that Fnd[[E]] is isomorphic to F[[E]]. Proof It follows immediately from the fact that function Norm always evaluates to "\Lambda ", functionSelect boils down to the identity function, and the application of function Melt is irrelevant because the effect of \Lambda Min \Lambda = \Lambda would stem from the fact that \Gamma \Gamma \Gamma ! is a transition relation instead of amultitransition relation. We conclude by observing that the operators of EMPAnd are a mix of the operators of CCS [26]and CSP [20]: the functional abstraction operator coincides with the hiding operator of CSP, the functional relabeling operator coincides with the relabeling operator of CCS, and the parallelcomposition operator reduces to the parallel composition operator of CSP since the constraint on action rates is always satisfied in EMPAnd . 4.2 Prioritized kernel The prioritized kernel EMPApt;w is the sublanguage of EMPA obtained by considering only imme-diate actions having the same weight w and passive actions. Since each immediate action is givena priority level, EMPA pt;w is a prioritized process algebra: in this framework, the priority level ofa passive action is considered to be unspecified, and the weight and the duration of an immediate action are ignored. We define below the syntax and the functional semantics of EMPApt;w terms. Definition 4.4 The set Lpt;w of process terms of EMPApt;w is generated by the following syntax E ::= 0 j !a; ~*?:E j E=L j E['] j E + E j E kS E j A where ~* 2 f1l;w j l 2 NI +g [ f\Lambda g and L; S ` AType \Gamma fo/ g. We denote by Gpt;w the set of closedand guarded terms of Lpt;w. Definition 4.5 The functional semantics of E 2 Gpt;w is the LTS Fpt;w[[E]] = ("E; AType; \Gamma \Gamma \Gamma !E;Fpt;w; E) where \Gamma \Gamma \Gamma !E;Fpt;w is the restriction of \Gamma \Gamma \Gamma !Fpt;w (defined in Table 3) to "E \Theta AType \Theta "E. Proposition 4.6 For any E 2 Gpt;w we have that Fpt;w[[E]] is isomorphic to F[[E]]. Proof It follows immediately from the fact that function Norm has the same effect of side condition (~*1 = \Lambda ^ ~fl = ~*2) . (~*2 = \Lambda ^ ~fl = ~*1), and the application of function Melt is irrelevant becausewe are interested in action types only. Since every nonpassive action is given an explicit priority level, from the syntactical point ofview EMPA pt;w is similar to the proposal of [11] where for each action type both a prioritizedversion and an unprioritized version are provided. The difference is that in [11] unprioritized actions are preempted only by internal prioritized actions in order to achieve compositionality,while the semantic treatment of priorities in EMPA pt;w is quite different because the actual prioritylevel of an action is independent of its visibility. As we shall see in Section 5, in order to achieve compositionality in the presence of actions having different priority levels, we extend EMPA witha priority operator in the style of [2] such that the priority structure is enforced only within its scope, and we show that every EMPA term can be thought of as having a single occurrence ofthe priority operator on top of it. We claim that our approach is convenient from the modeling point of view because the priority level of each action is exactly that specified by the designer: toenforce it, there is no need to introduce artificial prioritized o/ loops in the algebraic descriptionof the system like in [11], nor to burden the algebraic description with occurrences of the priority operator like in [2].Furthermore, we observe that EMPA pt;w is different from the proposals of [12], where apriority choice operator is explicitly defined, and [39, 40], where priority is expressed as extremal probability. Concerning the important features when modeling priority according to [39], wehave that: UBLCS-96-17 11 4 EMPA kernels (!a; ~*?; E0) 2 Select(PM (E)) E a;~*\Gamma \Gamma \Gamma ! Fpt;w E0 PM (0) = ; PM (!a; ~*?:E) = f(!a; ~*?; E)g PM (E=L) = f(!a; ~*?; E0=L) j (!a; ~*?; E0) 2 PM (E) ^ a =2 Lg [ f(!o/; ~*?; E0=L) j (!a; ~*?; E0) 2 PM (E) ^ a 2 Lg PM (E[']) = f(!'(a); ~*?; E0[']) j (!a; ~*?; E0) 2 PM (E)g PM (E1 + E2) = PM (E1) [ PM (E2) PM (E1 kS E2) = f(!a; ~*?; E01 kS E2) j a =2 S ^ (!a; ~*?; E01) 2 PM (E1)g [ f(!a; ~*?; E1 kS E02) j a =2 S ^ (!a; ~*?; E02) 2 PM (E2)g [ f(!a; ~fl?; E01 kS E02) j a 2 S ^ (!a; ~*1?; E01) 2 PM (E1) ^ (!a; ~*2?; E02) 2 PM (E2) ^ ((~*1 = \Lambda ^ ~fl = ~*2) . (~*2 = \Lambda ^ ~fl = ~*1))g PM (A) = PM (E) if A \Delta = E Table 3. Inductive rules for EMPApt;w functional semantics ffl Like [11, 12, 39, 40], the priority relation of EMPApt;w is globally dynamic, i.e. it may be thecase that an action with type a has priority over an action with type b in one state, and theconverse in some other state. ffl Unlike [2], the priority relation of EMPApt;w cannot define arbitrary partial orders becausethe leveled priority structure causes incomparable actions to have the same priority. As an example, it is not possible in EMPApt;w to express the fact that, in a given state, action type a takes precedence over action types b and c while action type d takes precedence only overaction type c. 4.3 Probabilistic kernel The probabilistic kernel EMPApb;l is the sublanguage of EMPA obtained by considering only im-mediate actions having the same priority level l and passive actions. Since each immediate actionis given a weight, EMPA pb;l is a probabilistic process algebra: in this framework, the weight of apassive action is considered to be unspecified, and the priority level and the duration of an immediate action are ignored. We define below the syntax, the integrated semantics, the functionalsemantics and the performance semantics of EMPA pb;l terms. Definition 4.7 The set Lpb;l of process terms of EMPApb;l is generated by the following syntax E ::= 0 j !a; ~*?:E j E=L j E['] j E + E j E kS E j A where ~* 2 f1l;w j w 2 RI +g [ f\Lambda g and L; S ` AType \Gamma fo/ g. We denote by Gpb;l the set of closedand guarded terms of Lpb;l, and by Epb;l the set of performance closed terms of Gpb;l. UBLCS-96-17 12 4 EMPA kernels Definition 4.8 The integrated semantics of E 2 Gpb;l is the LTS Ipb;l[[E]] = ("E; Act; \Gamma \Gamma \Gamma !E;Ipb;l; E) where \Gamma \Gamma \Gamma !E;Ipb;l is the restriction of \Gamma \Gamma \Gamma !Ipb;l (defined in Table 4) to "E \Theta Act \Theta "E. (!a; ~*?; E0) 2 Melt(PM (E)) E a;~*\Gamma \Gamma \Gamma ! Ipb;l E0 Table 4. Inductive rules for EMPApb;l integrated semantics Definition 4.9 The functional semantics of E 2 Gpb;l is the LTS Fpb;l[[E]] = ("E; AType; \Gamma \Gamma \Gamma !E;Fpb;l; E) where \Gamma \Gamma \Gamma !E;Fpb;l is the restriction of \Gamma \Gamma \Gamma !E;Ipb;l to "E \Theta AType \Theta "E. Proposition 4.10 For any E 2 Gpb;l we have that Ipb;l[[E]] is isomorphic to I[[E]]. Proof It is a straightforward consequence of the fact that function Select boils down to the identityfunction. Corollary 4.11 For any E 2 Gpb;l we have that Fpb;l[[E]] is isomorphic to F[[E]]. The performance semantics of terms in Epb;l is defined by considering the execution probabilityof each immediate transition exiting from a given state: since such a probability is proportional to the weight of the transition and depends only on the current state, the underlying performancemodel is a homogeneous discrete-time Markov chain (HDTMC) [22]. Every HDTMC can be formalized by means of a probabilistically rooted labeled transition system (PLTS), i.e. a LTS where the initialstate is replaced by a probability mass function specifying for each state the probability that it is the initial one. The labels of the transitions of such a PLTS are the execution probabilities of thetransitions themselves: they are computed according to the weights of the corresponding actions because of the adoption of the preselection policy. Definition 4.12 The Markovian semantics of E 2 Epb;l is the PLTS Mpb;l[[E]] = ("E; RI ]0;1]; \Gamma \Gamma \Gamma !E;Mpb;l; PE;Mpb;l) where: ffl \Gamma \Gamma \Gamma !E;Mpb;l is the least subset of "E \Theta RI ]0;1]\Theta "E such that F p\Gamma \Gamma \Gamma ! E;Mpb;l F 0 whenever p = Pfj w j F a;1l;w\Gamma \Gamma \Gamma ! E;Ipb;l F 0^a 2 AType jg= Pfj w j F a;1l;w\Gamma \Gamma \Gamma ! E;Ipb;l F 00^a 2 AType^F 00 2"E jg; ffl PE;Mpb;l :"E \Gamma ! RI [0;1] such that PE;Mpb;l(F ) = ae 1 if F j E0 if F 6j E . Unlike probabilistic process algebras appeared in the literature, EMPApb;l does not rely onan explicit probabilistic alternative composition operator since the probabilistic information, i.e. weights, is coded inside actions. Besides, in EMPApb;l probabilistic and nondeterministic aspectscoexist due to the presence of passive actions, thereby causing EMPA pb;l to be viewed as a possiblesyntactical counterpart of formal models for randomized distributed computations such as those defined in [38]. By performing more accurate comparisons, we see that EMPApb;l differs fromPCCS [21] and WSCCS [40] due to the two reasons above (i.e. introduction of a probabilistic alternative composition operator and absence of pure nondeterminism) as well as the fact that UBLCS-96-17 13 4 EMPA kernels these calculi are synchronous, i.e. the computation proceeds in locksteps: it is however worthnoting that the idea of using weights instead of probabilities proposed for WSCCS is retained in EMPApb;l for operational convenience. If we consider instead asynchronous probabilistic calculi,we realize that EMPA pb;l differs from prACP [3] and PCSP [36] because of the usual two reasons:furthermore, the parallel composition operator of prACP is probabilized while the corresponding operator of EMPApb;l is not. Finally, EMPApb;l differs from the asynchronous probabilistic calculusLOTOS-P [25] since the latter introduces a probabilistic alternative composition operator. Following the classification of models of probabilistic processes proposed in [14], it is easilyseen that performance closed terms of EMPA pb;l do not represent reactive models because thechoice among enabled actions having different types is probabilistic instead of nondeterministic. As a consequence, Epb;l produces generative models because the relative frequency of performingactions having different types is explicitly described. More accurately, Epb;l is even finer as it canproduce stratified models where the intended relative frequencies of actions are preserved in a levelwise fashion in the presence of a restriction. Example 4.13 Consider an operating system having three processes to be multiprogrammed: thegarbage collector gc, user process up 1, and user process up2. Suppose that each process is given 1=3of the CPU cycles, and that this frequency must be preserved for the garbage collector whenever one of the user processes is denied further access to the machine due to a restriction context. Thecorresponding EMPA pb;l term is Sched \Delta = !gc; 1l;1?:Sched + !o/; 1l;2?:(!up1; 1l;1?:Sched + !up2; 1l;1?:Sched) If we consider Sched kfup2g 0, then we have that the execution probability of the action having typegc is still 1 =3, as required. It is however possible to describe also reactive models in EMPApb;l by means of the interplay ofweighted immediate actions and passive actions. Example 4.14 Suppose that two people want to flip a coin in order to make a decision: only oneof them actually flips the coin, and the outcome of the coin toss is a head with probability 1 =2, atail with probability 1 =2. This scenario can be modeled as follows: GetCoin \Delta = !person1; \Lambda ?:FlipCoin + !person2; \Lambda ?:FlipCoin FlipCoin \Delta = !flip; 1l;1=2?:Head + !flip; 1l;1=2?:Tail The underlying model is reactive because the relative frequency with which the two people getthe coin is not specified, i.e. it is left to the environment, while the probability of the outcome of the coin toss is governed by the system. 4.4 Exponentially timed kernel The exponentially timed kernel EMPAet is the sublanguage of EMPA obtained by considering onlyexponentially timed actions and passive actions. Since each active action is given a duration through a probability distribution function, EMPAet is a stochastically timed process algebra. Wedefine below the syntax, the integrated semantics, the functional semantics and the performance semantics of EMPAet terms. Definition 4.15 The set Let of process terms of EMPAet is generated by the following syntax E ::= 0 j !a; ~*?:E j E=L j E['] j E + E j E kS E j A where ~* 2 RI + [ f\Lambda g and L; S ` AType \Gamma fo/ g. We denote by Get the set of closed and guardedterms of Let, and by Eet the set of performance closed terms of Get. Definition 4.16 The integrated semantics of E 2 Get is the LTS Iet[[E]] = ("E; Act; \Gamma \Gamma \Gamma !E;Iet; E)where \Gamma \Gamma \Gamma !E;Iet is the restriction of \Gamma \Gamma \Gamma !Iet (defined in Table 5) to "E \Theta Act \Theta "E. UBLCS-96-17 14 4 EMPA kernels (!a; ~*?; E0) 2 Melt(PM (E)) E a;~*\Gamma \Gamma \Gamma ! Iet E0 Table 5. Inductive rules for EMPAet integrated semantics Definition 4.17 The functional semantics of E 2 Get is the LTS Fet[[E]] = ("E; AType; \Gamma \Gamma \Gamma !E;Fet; E)where \Gamma \Gamma \Gamma !E;Fet is the restriction of \Gamma \Gamma \Gamma !E;Iet to "E \Theta AType \Theta "E. Proposition 4.18 For any E 2 Get we have that Iet[[E]] is isomorphic to I[[E]]. Proof It is a straightforward consequence of the fact that function Select boils down to the identityfunction. Corollary 4.19 For any E 2 Get we have that Fet[[E]] is isomorphic to F[[E]]. The performance semantics of terms in Eet is defined by considering the rate of each exponen-tially timed transition exiting from a given state: since the execution probability of each of these transitions depends only on the current state, and the sojourn time of every state is exponentiallydistributed, the underlying performance model is a homogeneous continuous-time Markov chain (HCTMC) [22] which can be formalized by means of a PLTS. The labels of the transitions of sucha PLTS are the rates of the corresponding exponentially timed actions. Definition 4.20 The Markovian semantics of E 2 Eet is the PLTS Met[[E]] = ("E; RI +; \Gamma \Gamma \Gamma !E;Met ; PE;Met) where: ffl \Gamma \Gamma \Gamma !E;Met is the least subset of "E \Theta RI +\Theta "E such that F *\Gamma \Gamma \Gamma ! E;Met F 0 whenever * =P fj _ j F a;_\Gamma \Gamma \Gamma ! E;Iet F 0 ^ a 2 AType jg; ffl PE;Met :"E \Gamma ! RI [0;1] such that PE;Met(F ) = ae 1 if F j E0 if F 6j E . The reason why we consider only exponential distributions in order to specify durations istwofold. On the one hand, the underlying performance models turn out to be HCTMCs, so we can exploit the related theory in order to derive performance measures. On the other hand, thememoryless property of exponential distributions allows us to define the integrated semantics for EMPA through the interleaving approach, as we have noted in Section 2.3.We would like to point out that EMPA et closely resembles the stochastically timed processalgebras MTIPP [16] and PEPA [18]. As we shall see in Section 4.6, the main difference among them is the synchronization discipline on action rates. 4.5 Joining the probabilistic and the exponentially timed kernels When we consider the whole process algebra, we have to cope with the coexistence of immediateand exponentially timed actions. From the performance standpoint, this means that the sojourn time of some states is exponentially distributed (tangible states), while the sojourn time of otherstates is zero (vanishing states). In order to define the performance semantics of terms in E,we have devised an algorithm that eliminates immediate transitions together with the related vanishing states, and produces HCTMCs. UBLCS-96-17 15 4 EMPA kernels Given E 2 E, the algorithm comprises several steps. The first step consists of dropping actiontypes, removing selfloops composed of an immediate transition (hereafter called immediate selfloops for short), changing the weight of each immediate transition into the correspondingexecution probability, and determining the initial state probability function. Formally, from the LTS I[[E]] = ("E; Act; \Gamma \Gamma \Gamma !E; E) we obtain the PLTS P1[[E]] = (SE;1; RI + [ Inf ; \Gamma \Gamma \Gamma !E;1; PE;1)where: ffl SE;1 = "E. ffl Let PM 1(s) = fj (~*; s0) j s a;~*\Gamma \Gamma \Gamma ! E s0 jg for any s 2 SE;1. Then \Gamma \Gamma \Gamma !E;1 is the least subset of SE;1 \Theta ( RI + [ Inf ) \Theta SE;1 such that: - If s is tangible and (*; s0) 2 Melt(PM 1(s)), then s *\Gamma \Gamma \Gamma ! E;1 s0.- If s is vanishing and in Melt(PM 1(s)) there are exactly m * 1 potential moves (1l;wj ; sj), 1 ^ j ^ m, such that sj 6j s, then there are m transitions s 1l;wj=w \Gamma \Gamma \Gamma ! E;1 sj,1 ^ j ^ m, where w = Pmj=1 wj. ffl PE;1 : SE;1 \Gamma ! RI [0;1], PE;1(s) = ae 1 if s j E0 if s 6j E . s0 l ~ 2l,p1l,p nl,p s2s1 sn q0 2q1q Split(~l, p1) Split(~l, p )2 Split(~l, p )n s1 s2 sn q0 1p1q + . q0 q0 ...... q + .p2 2 q + .pn n ...... nq Figure 2. Graph reduction rule The k-th step, k * 2, handles a vanishing state by eliminating the state itself as well as itsoutgoing immediate transitions, splitting the transitions entering the vanishing state, removing immediate selfloops created by splitting immediate transitions entering the vanishing state andexiting from states reached by the eliminated immediate transitions, and distributing the initial state probability associated with the vanishing state among the states reached by the eliminatedimmediate transitions. Formally, if we assume that the vanishing state considered at the k-th stepis the one shown in Figure 2, we build PLTS Pk[[E]] = (SE;k; RI + [ Inf ; \Gamma \Gamma \Gamma !E;k; PE;k) where: ffl SE;k = SE;k\Gamma 1 \Gamma fs0g. ffl Let PM k(s) = fj (~*; s0) j s ~*\Gamma \Gamma \Gamma ! E;k\Gamma 1 s0 ^ s0 6j s0 jg \Phi fj (Split(~*; pi); si) j s ~*\Gamma \Gamma \Gamma ! E;k\Gamma 1 s0 ^ 1 ^ i ^ n jg for any s 2 SE;k. Then \Gamma \Gamma \Gamma !E;k is the least subset of SE;k \Theta ( RI + [ Inf ) \Theta SE;k suchthat: - If s is tangible, or vanishing but s =2 fsi j 1 ^ i ^ ng, and (~*; s0) 2 Melt(PM k(s)), then s ~*\Gamma \Gamma \Gamma ! E;k s0.- If s is vanishing, s j si and in Melt(PM k(s)) there are exactly m * 1 potential moves (1l;pj ; sj), 1 ^ j ^ m, such that sj 6j s, then there are m transitions s 1l;pj=p \Gamma \Gamma \Gamma ! E;k sj,1 ^ j ^ m, where p = Pmj=1 pj. ffl PE;k : SE;k \Gamma ! RI [0;1], PE;k(s) = ae PE;k\Gamma 1(s) if s =2 fsi j 1 ^ i ^ ngP E;k\Gamma 1(s) + PE;k\Gamma 1(s0) \Delta pi if s j si . Definition 4.21 The Markovian semantics of E 2 E is the PLTS M[[E]] = (SE;M; RI +; \Gamma \Gamma \Gamma !E;M ; PE;M) obtained by applying the algorithm above. UBLCS-96-17 16 4 EMPA kernels Theorem 4.22 Let E 2 E. (i) For every k 2 NI + and s 2 SE;k vanishing, Pfj p j s 1l;p\Gamma \Gamma \Gamma ! E;k s0 jg = 1. (ii) For every k 2 NI +, Ps2SE;k PE;k(s) = 1. (iii) The elimination of immediate selfloops is correct from the performance viewpoint. (iv) The graph reduction rule is confluent. (v) If I[[E]] has finitely many states, then the algorithm terminates and M[[E]] has no immediatetransitions, has finitely many states, and is unique. Proof See [5]. We conclude by observing that the coexistence of the probabilistic and the exponentially timedkernels allows phase-type distributions [27] to be modeled. This makes the limitation to exponential distributions less restrictive, as it becomes possible to describe or approximate distributionsfrequently occurring in practice. For more details, the reader is referred to [5, 8]. 4.6 The gluing role of passive actions: synchronization The four kernels of EMPA share a common feature: the presence of passive actions. This is dueto the synchronization discipline on action rates adopted in EMPA, which causes passive actions to act as a glue for the various kernels forming EMPA.The main consequence of the synchronization discipline on action rates is that only client-server communications are directly expressible: the rate of the action resulting from a synchronization isdetermined by the rate of the only possible active action involved in the synchronization itself. This choice has been made due to its simplicity, since it avoids the need to define the rate of theaction deriving from the synchronization of two active actions. Also, this choice has been made due to its modularity. When modeling an n-way synchronization, only the designer of the activecomponent must know the rate of the synchronization, while the other n \Gamma 1 designers can get ridof it by leaving it unspecified through passive actions. Furthermore, possible subsequent changes of the rate affect only one component.To compute correctly the rate of a synchronization according to the bounded capacity assumption [19] which establishes that the rate at which a term carries out an action cannot be increasedin case of synchronization, a normalization is required that takes into account the number of alternative or independent passive actions that can be synchronized with the active action athand. Example 4.23 Consider a queueing system M=M=2=2 [22], i.e. a service center with two inde-pendent servers where the customer interarrival time is exponentially distributed with rate * andthe service time of each server is exponentially distributed with rate _. This queueing system canbe represented as follows: QSM=M=2=2 \Delta = Arrivals kfag Servers2 Arrivals \Delta = !a; *?:Arrivals Servers2 \Delta = S k; S S \Delta = !a; \Lambda ?:!s; _?:S The normalization operates in such a way that in I[[QSM=M=2=2]] the two transitions leaving theinitial state have rate *=2, so the rate * of the involved active component Arrivals is preserved.Such a normalization is completely transparent to the user in EMPA and stochastically timed process algebras like PEPA [18] since it is embodied in the semantic rules. On the contrary, in thecase of the stochastically timed process algebra MTIPP [16], where passive actions are simulated through exponentially timed actions with rate 1 and the rate of the synchronization of two actionsis given by the product of their rates, no normalization is carried out because the bounded capacity assumption is not made. As a consequence, it is responsibility of the designer to define the ratesof actions with type a in both terms S so that their sum is 1, otherwise the expected underlyingHCTMC would not be obtained. The problem of the context-dependent meaning of the rates of UBLCS-96-17 17 4 EMPA kernels MTIPP actions has been alleviated in IMTIPP [17] and PMTIPP [35] by means of the introductionof unprioritized unweighted immediate actions and a probabilistic choice operator. Despite of the fact that client-server communications frequently occur in computing systems,it would be useful to be able to describe other kinds of communication, as recognized in [19]. Some of them can be described in other stochastically timed process algebras: for example, flexible client-server communications in MTIPP [16] (where the service requirement is expressed by means of an action whose rate describes a scaling factor instead of a passive action), and patient communicationsin PEPA [18] (where the two terms involved in a synchronization work together at the rate of the slowest one). Unlike patient communications, flexible client-server communications can bemodeled indirectly in EMPA. Example 4.24 Consider a queueing system M=M=1=q [22] with scalable service rate, i.e. a servicecenter with one server and a FIFO queue with q \Gamma 1 seats where the customer interarrival time isexponentially distributed with rate * and the service time depends on the number of customersin the queue. This queueing system can be represented as follows: SSRQSM=M=1=q \Delta = Arrivals kfag(Queue0 kfdhj1^h^q\Gamma 1g Server) Arrivals \Delta = !a; *?:Arrivals Queue0 \Delta = !a; \Lambda ?:Queue1 Queueh \Delta = !a; \Lambda ?:Queueh+1 + !dh; \Lambda ?:Queueh\Gamma 1; 0 ! h ! q \Gamma 1 Queueq\Gamma 1 \Delta = !dq\Gamma 1; \Lambda ?:Queueq\Gamma 2 Server \Delta = !d1; 11;1?:Server1 + : : : + !dq\Gamma 1; 11;1?:Serverq\Gamma 1 Serverh \Delta = !s; sf(h) \Delta _?:Server; 1 ^ h ^ q \Gamma 1where _ is the basic service rate and sf : NI + \Gamma ! RI + describes the scaling factor. Other kinds of communications are listed in [19]: polite communications, impolite communicationsand timed synchronizations. In [8] we have shown that all of them can be described indirectly with EMPA obtaining the expected underlying HCTMC. This means that the limitation to client-serversynchronizations, introduced for the sake of simplicity, is not so restrictive from the modeling viewpoint as it might seem. 4.7 A summarizing example We report in this section an example that should demonstrate the usefulness of the four kernelsembodied in EMPA from the standpoint of the modeling and analysis of concurrent systems. The example examined below is the Dining Philosophers problem. Suppose we are given nphilosophers Pi (0 ^ i ^ n \Gamma 1) sat at a round table each with a plate in front of him, and nchopsticks Ci (0 ^ i ^ n \Gamma 1) each shared by two neighbor philosophers and used to get the riceat the center of the table. Let us denote by " +n " the sum modulo n, and let think i be the actiontype " Pi is thinking", pui (pui+n1) be "Pi picks up Ci (Ci+n1)", eati be "Pi is eating", and pd i( pdi+n1) be "Pi puts down Ci (Ci+n1)". The scenario can be described as follows: DP n j (P0 k; : : : k; Pn\Gamma 1) kfpui;pdij0^i^n\Gamma 1g(C0 k; : : : k; Cn\Gamma 1) Pi \Delta = !think i; \Lambda ?:(!pui; \Lambda ?:!pui+n1; \Lambda ?:P 0i + !pui+n1; \Lambda ?:!pui; \Lambda ?:P 0i) P 0i \Delta = !eati; \Lambda ?:!pd i; \Lambda ?:!pdi+n1; \Lambda ?:Pi Ci \Delta = !pui; \Lambda ?:!pdi; \Lambda ?:Ci Since all the actions are passive, the system is purely nondeterministic: this is exactly the samedescription we would obtain with classical process algebras. As a naive solution to break the symmetry that may cause deadlock, we could introduce aprecedence relation among philosophers by means of the priority levels of immediate actions, thus modifying the specification of Pi as follows: Pi \Delta = !think i; \Lambda ?:!pui; 1i+1;1?:!pui+n1; 1i+1;1?:!eati; \Lambda ?:!pdi; \Lambda ?:!pd i+n1; \Lambda ?:Pi UBLCS-96-17 18 5 A notion of equivalence for EMPA To solve the problem in a more elegant and fair manner, we could use the randomized dis-tributed algorithm of [24]: Pi flips a fair coin to choose between Ci and Ci+1, gets the chosenchopstick as soon as it becomes free, and gets the other chopstick if it is free, otherwise releases the chosen chopstick and flips the coin again. This algorithm can be easily described in EMPAthrough the weights of immediate actions by modifying the specification of Pi as follows: Pi \Delta = !think i; \Lambda ?:P 0i P 0i \Delta = !o/; 11;1=2?:!pui; \Lambda ?:(!pui+n1; \Lambda ?:P 00i + !pdi; \Lambda ?:P 0i)+ !o/; 11;1=2?:!pui+n1; \Lambda ?:(!pui; \Lambda ?:P 00i + !pdi+n1; \Lambda ?:P 0i ) P 00i \Delta = !eati; \Lambda ?:!pd i; \Lambda ?:!pdi+n1; \Lambda ?:Pi Finally, by performance closing the system, with EMPA we can even assess some performanceindices like, e.g., the average time during which there is at least one philosopher eating, i.e. the chopstick utilization (see [6] for the analysis of a description similar to the one given below). Thespecification of Pi has to be modified as follows: Pi \Delta = !think i; *i?:P 0i P 0i \Delta = !o/; 11;1=2?:!pui; 11;1?:(!pui+n1; 11;1?:P 00i + !pdi; 11;1?:P 0i )+ !o/; 11;1=2?:!pui+n1; 11;1?:(!pui; 11;1?:P 00i + !pdi+n1; 11;1?:P 0i) P 00i \Delta = !eati; _i?:!pdi; 11;1?:!pd i+n1; 11;1?:Pi Observe that actions pui and pd i have been modeled as immediate, because they are irrelevantfrom the performance evaluation point of view. Thus immediate actions provide a mechanism for performance abstraction in the same way as action type o/ provides a mechanism for functionalabstraction. Other examples that highlight the expressive power of EMPA can be found in [5]: they areconcerned with different kinds of queueing systems as well as the alternating bit protocol. 5 A notion of equivalence for EMPA A notion of equivalence for EMPA should relate terms describing concurrent systems that areindistinguishable from the point of view of an external observer, i.e. having the same functional and performance properties. The purpose of this section is to develop such an integrated notionof equivalence as well as to make sure that it is a congruence. The section is organized as follows. In Section 5.1 we introduce a notion of equivalence denoted ,FP which is defined on the projected semantic models, and we show that it is not appropriatebecause it is not a congruence. In Section 5.2 we present a notion of equivalence denoted ,EMB which is defined on the integrated semantic model by refining the idea of probabilisticbisimulation [23] according to the various kernels of EMPA. In Section 5.3 we prove that ,EMB isa congruence, and in Section 5.4 we demonstrate that ,EMB is the coarsest congruence containedin ,FP as far as terms that cannot execute internal immediate actions are concerned. In Section 5.5we give a sound and complete axiomatization of ,EMB for the set of nonrecursive terms of EMPA.Finally, in Section 5.6 we develop an algorithm in the style of [13] that can be used both to check two EMPA terms for ,EMB and to minimize the integrated semantic model of an EMPA term. 5.1 A deceptively integrated equivalence: ,FP A generally accepted notion of equivalence in the field of process algebras is bisimilarity [30, 26].Using this approach, it is straightforward to define two projected equivalences based on the two projected semantic models. For the functional semantic model we use classical bisimilarity,whereas for the performance semantic model we use probabilistic bisimilarity in the style of [23]. Definition 5.1 Let E1; E2 2 G. We say that E1 is functionally equivalent to E2, written E1 ,F E2, ifand only if F[[E1]] = ("E1; AType; \Gamma \Gamma \Gamma !E1;F ; E1) is bisimilar to F[[E2]] = ("E2; AType; \Gamma \Gamma \Gamma !E2;F ; E2),i.e. there exists a relation B ` "E1 \Theta "E2 such that: ffl (E1; E2) 2 B; UBLCS-96-17 19 5 A notion of equivalence for EMPA ffl for each (F1; F2) 2 B and for each a 2 AType: - whenever F1 a\Gamma \Gamma \Gamma ! E1;F F 01, then F2 a\Gamma \Gamma \Gamma ! E2;F F 02 and (F 01; F 02) 2 B; - whenever F2 a\Gamma \Gamma \Gamma ! E2;F F 02, then F1 a\Gamma \Gamma \Gamma ! E1;F F 01 and (F 01; F 02) 2 B. Definition 5.2 Let E1; E2 2 E. We say that E1 is performance equivalent to E2, written E1 ,P E2, ifand only if M[[E1]]=(SE1; RI +; \Gamma \Gamma \Gamma !E1;M ; PE1) is p-bisimilar to M[[E2]]=(SE2 ; RI +; \Gamma \Gamma \Gamma !E2;M ; PE2),i.e. there exists an equivalence relation B ` (SE1 [ SE2 ) \Theta (SE1 [ SE2 ) such that: ffl for each C 2 (SE1 [ SE2 )=B it holds Ps2C"SE1 PE1 (s) = Ps2C"SE2 PE2(s); ffl whenever (s1; s2) 2 B " (SE1 \Theta SE2 ), then for each C 2 (SE1 [ SE2 )=B it holds that Pfj * j s1 *\Gamma \Gamma \Gamma ! E1;M s01 ^ s01 2 C " SE1 jg = Pfj * j s2 *\Gamma \Gamma \Gamma ! E2;M s02 ^ s02 2 C " SE2 jg. A natural candidate notion of equivalence may be ,FP = ,F " ,P . However, the examplesbelow show that ,FP is not useful as it is not a congruence. Example 5.3 Consider terms E1 j !a; *?:0 + !b; _?:0 E2 j !a; _?:0 + !b; *?:0 where * 6= _. It turns out that E1 ,FP E2 but E1 kfbg 0 6,P E2 kfbg 0 because the left-hand sideterm can execute only one action with rate * while the right-hand side term can execute only oneaction with rate _. Note that the action with type a of E1 has execution probability *=(* + _),while the action with type a of E2 has execution probability _=(* + _), and this is not detected by ,FP. Example 5.4 Consider terms E1 j !a; 11;1?:0 E2 j !a; 12;1?:0 It turns out that E1 ,FP E2 but E1 + !b; 11;1?:0 6,F E2 + !b; 11;1?:0 because the left-hand sideterm can execute an action with type b while the right-hand side term cannot. Example 5.5 Consider terms E1 j !a; 11;1?:0 E2 j !a; 11;2?:0 It turns out that E1 ,FP E2 but E1 + !b; 11;1?:!b; *?:0 6,P E2 + !b; 11;1?:!b; *?:0 becausestate !b; *?:0 has initial state probability 1=2 in the Markovian semantics of the left-hand sideterm, 1 =3 in the Markovian semantics of the right-hand side term. The examples above show that ,FP is unable to keep track of the link between the functional partand the performance part of the actions. This means that to achieve semantic compositionality, it is necessary to define an equivalence based on the integrated semantic model, and this willbe stressed by Theorem 5.25. Incidentally, this is even convenient with respect to ,FP , since itavoids the need to build the two projected semantic models and checking them for bisimilarity and p-bisimilarity, respectively. 5.2 A really integrated equivalence: ,EMB In order to define a really integrated equivalence in the bisimulation style, we have to considerthe various kernels of EMPA: ffl The exponentially timed kernel and the probabilistic kernel should be treated by followingthe notion of probabilistic bisimulation proposed in [23], which consists of requiring a bisimulation to be an equivalence relation such that two bisimilar terms have the same aggregated UBLCS-96-17 20 5 A notion of equivalence for EMPA probability to reach the same equivalence class by executing actions of the same type andpriority level. - In the case of the exponentially timed kernel, the notion of probabilistic bisimulationmust be refined by requiring additionally that two bisimilar terms have identically distributed sojourn times. For example, if we consider terms E1 j !a; *?:F + !a; _?:Gand E2 j !a; 2 \Delta *?:F + !a; 2 \Delta _?:G then both transitions labeled with a; * and a; 2 \Delta *have execution probability *=(* + _), and both transitions labeled with a; _ and a; 2 \Delta _have execution probability _=(* + _), but the average sojourn time of E1 is twicethe average sojourn time of E2. Due to the race policy, requiring that two bisimilarterms have identically distributed sojourn times and the same aggregated probability to reach the same equivalence class by executing exponentially timed actions of thesame type, amounts to requiring that two bisimilar terms have the same aggregated rate to reach the same equivalence class by executing exponentially timed actions ofthe same type. For example, it must hold that !a; *?:F + !a; _?:F , !a; * + _?:F This coincides with the notion of Markovian bisimulation proposed in [16, 18, 10].- In the case of the probabilistic kernel, the notion of probabilistic bisimulation must be restated in terms of weights. As a consequence, two bisimilar terms are required tohave the same aggregated weight to reach the same equivalence class by executing immediate actions of the same type and priority level. For example, it must hold that !a; 1l;w1?:F + !a; 1l;w2?:F , !a; 1l;w1+w2 ?:F This coincides with the notion of direct bisimulation proposed in [40]. ffl The nondeterministic kernel should be treated by following the classical notion of bisimu-lation (see, e.g., [26]). Thus, bisimilar terms are required to have the same passive actions reaching the same equivalence class, regardless of the actual number of these passive ac-tions. For example, it must hold that !a; \Lambda ?:F + !a; \Lambda ?:F , !a; \Lambda ?:F ffl Concerning the prioritized kernel, it might seem useful to be able to write equations like !a; *?:E + !b; 1l;w?:F , !b; 1l;w?:F !c; 1l;w?:E + !d; 1l0;w0?:F , !d; 1l0;w0?:F if l0 ? l The problem is that the applicability of such equations depends on the context: e.g., terms E1 j (!a; *?:E + !b; 1l;w?:F ) kfbg 0 and E2 j (!b; 1l;w?:F ) kfbg 0 are not equivalentbecause E1 can execute one action while E2 cannot execute actions at all. To solve theproblem, we follow the proposal of [2] by introducing a priority operator " \Theta ( )": prioritylevels are taken to be potential, and they become actual only inside the scope of the priority operator. We thus consider the language L\Theta generated by the following syntax E ::= 0 j !a; ~*?:E j E=L j E['] j \Theta (E) j E + E j E kS E j A whose semantic rules are those in Table 1 except that the rule in the first part is replaced by (!a; ~*?; E0) 2 Melt(PM (E)) E a;~*\Gamma \Gamma \Gamma ! E0 and the following rule for the priority operator is introduced in the second part PM (\Theta (E)) = Select(PM (E)) It is easily seen that EMPA coincides with the set of terms f\Theta (E) j E 2 Lg. Definition 5.6 We define partial function Rate : (G\Theta \Theta AType \Theta PLevel \Theta P(G\Theta )) \Gamma !o ARate by 3 Rate(E; a; l; C) = Minfj ~* j E a;~*\Gamma \Gamma \Gamma ! E0 ^ PL(!a; ~*?) = l ^ E0 2 C jg 3. We let Min ; = ?, ~* Min ? = ~*, Split(?; p) = ?. UBLCS-96-17 21 5 A notion of equivalence for EMPA Definition 5.7 An equivalence relation B ` G\Theta \Theta G\Theta is a strong extended Markovian bisimulation(strong EMB) if and only if, whenever (E1; E2) 2 B, then for all a 2 AType, l 2 PLevel and C 2 G\Theta =B Rate(E1; a; l; C) = Rate(E2; a; l; C) In this case we say that E1 and E2 are strongly extended-Markovian bisimilar (strongly EMB). As an example, the identity relation Id G\Theta over G\Theta is a strong EMB, and it is contained in anystrong EMB due to reflexive property. We now prove that the largest strong EMB is the union of all the strong EMBs, and we define the integrated equivalence as the largest strong EMB. Lemma 5.8 Let fBi j i 2 Ig be a family of strong EMBs. Then B = ([i2IBi)+ is a strong EMB. Proof Once observed that B is an equivalence relation because it is the transitive closure ofthe union of equivalence relations, assume that (E1; E2) 2 B. Since B = [n2 NI + B(n) where B(n) = ([i2IBi)n, we have (E1; E2) 2 B(n) for some n 2 NI +. The result follows by proving byinduction on n 2 NI + that, whenever (E1; E2) 2 B(n), then Rate(E1; a; l; C) = Rate(E2; a; l; C) forall a 2 AType, l 2 PLevel, C 2 G\Theta =B. ffl If n = 1, then (E1; E2) 2 Bi for some i 2 I. Let G\Theta =Bi = fCi;j j j 2 Jig. Since (E1; E2) 2 Biimplies (E1; E2) 2 B, we have that for each Ci;j 2 G\Theta =Bi there exists C 2 G\Theta =B suchthat Ci;j ` C, so each equivalence class of B can be written as the union of a set ofequivalence classes of Bi. As a consequence, for all a 2 AType, l 2 PLevel and C 2 G\Theta =B, if C = [j2J0i Ci;j where J0i ` Ji, then Rate(E1; a; l; C) = Minfj Rate(E1; a; l; Ci;j) j j 2 J0i jg =Min fj Rate(E2; a; l; Ci;j) j j 2 J0i jg = Rate(E2; a; l; C) because Bi is a strong EMB. ffl Let n ? 1. From (E1; E2) 2 B(n) we derive that there exists F 2 G\Theta such that (E1; F ) 2 B(n\Gamma 1)and (F; E2) 2 Bi for some i 2 I. Thus for all a 2 AType, l 2 PLevel and C 2 G\Theta =B, it turnsout Rate (E1; a; l; C) = Rate(F; a; l; C) by the induction hypothesis, and Rate(F; a; l; C) =Rate (E2; a; l; C) by applying the same argument as the previous point. Proposition 5.9 Let ,EMB be the union of all the strong EMBs. Then ,EMB is the largest strongEMB. Proof By definition, ,EMB contains the largest strong EMB, so ,EMB is at least as large as thelargest strong EMB. It remains to prove that ,EMB is a strong EMB. This is achieved by applyingLemma 5.8 to the fact that ,EMB = ,+EMB. In fact, ,EMB ` ,+EMB trivially holds, and ,+EMB ` ,EMBis due to the fact that ,+EMB is a strong EMB (by virtue of Lemma 5.8) and that ,EMB contains allthe strong EMBs. Definition 5.10 We call ,EMB the strong extended Markovian bisimulation equivalence (strong EMBE),and we say that E1; E2 2 G\Theta are strongly extended-Markovian bisimulation equivalent (strongly EMBE)if and only if E1 ,EMB E2. In other words, two terms E1; E2 2 G\Theta are strongly EMBE if and only if they are strongly EMB,i.e. there exists a strong EMB containing the pair (E1; E2). It is worth noting that, despite of thepresence of several different kernels, we have been able to come up with a compact and elegant notion of equivalence in the style of [23].We conclude the section by exhibiting two necessary conditions and one sufficient condition in order for two terms are strongly EMBE. The necessary conditions are based on conditional exitrates independent of equivalence classes, so they are easily checkable. Proposition 5.11 Let E1; E2 2 G\Theta . If E1 ,EMB E2, then (i) for all l 2 PLevel Minfj Rate(E1; a; l; G\Theta ) j a 2 AType jg = Minfj Rate(E2; a; l; G\Theta ) j a 2 AType jg UBLCS-96-17 22 5 A notion of equivalence for EMPA (ii) for all a 2 AType and l 2 PLevel Rate(E1; a; l; G\Theta ) = Rate(E2; a; l; G\Theta ) The first necessary condition guarantees that the states associated with strongly EMBE termshave identically distributed sojourn times, if tangible, or identical total weights, if vanishing. The second necessary condition will be used in Section 5.4 and recalled in Section 5.6.The sufficient condition is based on the notion of strong EMB up to ,EMB . Definition 5.12 An equivalence relation B ` G\Theta \Theta G\Theta is a strong EMB up to ,EMB if and only if,whenever (E1; E2) 2 B, then for all a 2 AType, l 2 PLevel and C 2 G\Theta =(,EMB B ,EMB) Rate(E1; a; l; C) = Rate(E2; a; l; C) Proposition 5.13 Let B ` G\Theta \Theta G\Theta and (E1; E2) 2 B. If B is a strong EMB up to ,EMB, then E1 ,EMB E2. Proof Given B ` G\Theta \Theta G\Theta , we first prove that if B is a strong EMB up to ,EMB, then ,EMB B ,EMBis a strong EMB. Let (E1; E2) 2 ,EMB B ,EMB, i.e. E1 ,EMB E01 B E02 ,EMB E2, and a 2 AType, l 2 PLevel and C 2 G\Theta =(,EMB B ,EMB). Then Rate(E01; a; l; C) = Rate(E02; a; l; C). Since ,EMB ` ,EMB B ,EMB, C is the union of some equivalence classes with respect to ,EMB. As a consequence,for j 2 f1; 2g we have Rate(Ej; a; l; C) = Rate(E0j; a; l; C), hence the result follows. To completethe proof, we observe that B ` ,EMB B ,EMB because IdG\Theta ` ,EMB, and ,EMB B ,EMB ` ,EMBbecause ,EMB B ,EMB is a strong EMB, hence B ` ,EMB. The notion of strong EMB up to ,EMB is helpful to avoid redundancy in strong EMBs: forexample, if B is a strong EMB and (E1 kS E2; E3) 2 B, then also (E2 kS E1; E3) 2 B although itmay be retrieved from the fact that E2 kS E1 ,EMB E1 kS E2. The sufficient condition above statesthat in order for two terms E1; E2 2 G\Theta to be strongly EMBE, it suffices to find out a strong EMBup to ,EMB containing the pair (E1; E2). The notion of strong EMB up to ,EMB will be used inSection 5.3. 5.3 ,EMB is a congruence In this section we show that ,EMB is preserved by all the operators of EMPA. Theorem 5.14 Let E1; E2 2 G\Theta . If E1 ,EMB E2 then: (i) For every !a; ~*? 2 Act, !a; ~*?:E1 ,EMB !a; ~*?:E2. (ii) For every L ` AType \Gamma fo/ g, E1=L ,EMB E2=L. (iii) For every ' 2 RFun, E1['] ,EMB E2[']. (iv) \Theta (E1) ,EMB \Theta (E2). (v) For every F 2 G\Theta , E1 + F ,EMB E2 + F and F + E1 ,EMB F + E2. (vi) For every F 2 G\Theta and S ` AType \Gamma fo/ g, E1 kS F ,EMB E2 kS F and F kS E1 ,EMB F kS E2. Proof Let E1; E2 2 G\Theta be such that E1 ,EMB E2. (i) Let B ` G\Theta \Theta G\Theta be a strong EMB such that (E1; E2) 2 B. Given !a; ~*? 2 Act, we prove that B0 = (B [ f(!a; ~*?:E1; !a; ~*?:E2); (!a; ~*?:E2; !a; ~*?:E1)g)+ is a strong EMB. Observed that B0 is an equivalence relation, we have two cases. - If (!a; ~*?:E1; !a; ~*?:E2) 2 B, then B0 = B and the result trivially follows. - Assume that (!a; ~*?:E1; !a; ~*?:E2) =2 B. Observed that G\Theta =B0 = (G\Theta =B \Gamma f[!a; ~*?:E1]B; [!a; ~*?:E2]Bg) [ f[!a; ~*?:E1]B [ [!a; ~*?:E2]Bg let (F1; F2) 2 B0 and b 2 AType, l 2 PLevel, C 2 G\Theta =B0. \Lambda If (F1; F2) 2 B and C 2 G\Theta =B \Gamma f[!a; ~*?:E1]B; [!a; ~*?:E2]Bg, then triviallyRate (F1; b; l; C) = Rate(F2; b; l; C). UBLCS-96-17 23 5 A notion of equivalence for EMPA \Lambda If (F1; F2) 2 B and C = [!a; ~*?:E1]B [ [!a; ~*?:E2]B, then for j 2 f1; 2g we have Rate(Fj; b; l; C) = Rate(Fj; b; l; [!a; ~*?:E1]B) Min Rate(Fj; b; l; [!a; ~*?:E2]B)so Rate (F1; b; l; C) = Rate(F2; b; l; C). \Lambda If (F1; F2) 2 B0 \Gamma B, i.e. F1 2 [!a; ~*?:E1]B and F2 2 [!a; ~*?:E2]B, then for j 2 f1; 2g we have Rate(Fj; b; l; C) = ae ~* if b = a ^ l = PL(!a; ~*?) ^ C = [Ej]B 0 ? otherwise Since [E1]B0 = [E1]B = [E2]B = [E2]B0, it turns out that Rate(F1; b; l; C) =Rate (F2; b; l; C). (ii) Given L ` AType \Gamma fo/ g, we prove that B0 = B [ IdG\Theta ; where B = f(E1=L; E2=L) j E1 ,EMB E2g; is a strong EMB. Observed that B0 is an equivalence relation, and that either each of theterms of an equivalence class has " =L" as outermost operator or none of them has, let (F1; F2) 2 B0 and a 2 AType, l 2 PLevel, C 2 G\Theta =B0.- If (F1; F2) 2 IdG\Theta , then trivially Rate(F1; a; l; C) = Rate(F2; a; l; C).- If (F1; F2) 2 B, then F1 j E1=L and F2 j E2=L where E1 ,EMB E2. \Lambda If none of the terms in C has " =L" as outermost operator, then trivially Rate(F1; a; l; C) = ? = Rate(F2; a; l; C). \Lambda If each of the terms in C has " =L" as outermost operator, given E=L 2 C it turnsout that C = fE0=L j E0 2 [E],EMBg. Thus for j 2 f1; 2g we have Rate(Fj; a; l; C) = 8!: Rate (Ej; a; l; [E],EMB)Rate (Ej; o/; l; [E],EMB) MinMin fj Rate(Ej; b; l; [E],EMB) j b 2 L jg depending on whether a =2 L [ fo/ g or a = o/ . From E1 ,EMB E2 it followsRate (F1; a; l; C) = Rate(F2; a; l; C). (iii) Given ' 2 RFun, the proof that B0 = B [ IdG\Theta ; where B = f(E1[']; E2[']) j E1 ,EMB E2g; is a strong EMB is similar to the one developed in (ii). The main difference is that in thelast subcase the result follows from the fact that for j 2 f1; 2g we have Rate(Fj; a; l; C) = Minfj Rate(Ej; b; l; [E],EMB) j '(b) = a jg (iv) The proof that B0 = B [ IdG\Theta ; where B = f(\Theta (E1); \Theta (E2)) j E1 ,EMB E2g; is a strong EMB is similar to the one developed in (ii). The main difference is that in thelast subcase the result follows from the fact that for j 2 f1; 2g we have Rate(Fj; a; l; C) = ( Rate(Ej; a; l; [E],EMB) if :(Ej b;~*\Gamma \Gamma \Gamma !F ^PL(!b;~*?) ? l).(l = \Gamma 1) ? otherwise (v) Let B ` G\Theta \Theta G\Theta be a strong EMB such that (E1; E2) 2 B. Given F 2 G\Theta , the proof that B0 = (B [ f(E1 + F; E2 + F ); (E2 + F; E1 + F )g)+ is a strong EMB is similar to the one developed in (i). The main difference is that in the lastsubcase the result follows from the fact that for j 2 f1; 2g we have Rate(Fj; b; l; C) = Rate(Ej; b; l; C) Min Rate(F; b; l; C) and from the following considerations:- If C 2 G\Theta =B \Gamma f[E1 + F ]B; [E2 + F ]Bg, then from (E1; E2) 2 B we derive Rate(E1; b; l; C) = Rate(E2; b; l; C) so Rate(F1; b; l; C) = Rate(F2; b; l; C).- If C = [E1 + F ]B [ [E2 + F ]B, then for j 2 f1; 2g we have Rate(Ej; b; l; C) = Rate(Ej; b; l; [E1 + F ]B) Min Rate(Ej; b; l; [E2 + F ]B) Since (E1; E2) 2 B, it turns out that Rate(E1; b; l; C) = Rate(E2; b; l; C) so Rate(F1; b; l; C) = Rate(F2; b; l; C). UBLCS-96-17 24 5 A notion of equivalence for EMPA (vi) Given S ` AType \Gamma fo/ g, the proof that B0 = B [ IdG\Theta ; where B = f(E1 kS F; E2 kS F ) j E1 ,EMB E2 ^ F 2 G\Theta g; is a strong EMB is similar to the one developed in (ii). The main difference is that in thelast subcase, where given E kS G 2 C it turns out that C = fE0 kS G j E0 2 [E],EMBg, theresult follows from the considerations below: - If a =2 S, then for j 2 f1; 2g we have that Rate(Fj; a; l; C) = 8??!??: Rate(Ej; a; l; [E],EMB) Min Rate(F; a; l; fGg)Rate (Ej; a; l; [E],EMB)Rate (F; a; l; fGg) ? depending on whether Ej 2 [E],EMB ^ F j G, Ej =2 [E],EMB ^ F j G, Ej 2 [E],EMB ^ F 6j G or Ej =2 [E],EMB ^ F 6j G. Since E1 ,EMB E2, it follows thatRate (F1; a; l; C) = Rate(F2; a; l; C).- If a 2 S, then for j 2 f1; 2g we have that Rate(Fj; a; l; C) = 8??!??: Rate(Ej; a; l; [E],EMB) Min Rate(F; a; l; fGg)Rate (Ej; a; l; [E],EMB)Rate (F; a; l; fGg) ? depending on whether Rate(F; a; \Gamma 1; fGg) 6= ?^Rate(Ej; a; \Gamma 1; [E],EMB) 6= ?, Rate(F; a; \Gamma 1; fGg) 6= ? ^ Rate(Ej; a; \Gamma 1; [E],EMB) = ?, Rate(F; a; \Gamma 1; fGg) = ? ^ Rate(Ej; a; \Gamma 1; [E],EMB) 6= ? or Rate(F; a; \Gamma 1; fGg) = ? ^ Rate(Ej; a; \Gamma 1; [E],EMB) = ?. Since E1 ,EMB E2, it follows that Rate(F1; a; l; C) = Rate(F2; a; l; C). We conclude by proving that ,EMB is preserved by recursive definitions as well. To do so,we first extend the definition of ,EMB to terms that are guardedly closed up to constants devoidof defining equation. Note that such constants act as variables. Definition 5.15 A constant A 2 Const is free if and only if, for any E 2 L\Theta , A \Delta = E =2 Def\Theta . Definition 5.16 A term E 2 L\Theta is partially guardedly closed (pgc) w.r.t. Def\Theta if and only if for eachconstant A 2 ConstDef\Theta (E) either A is free or ffl A is equipped in Def\Theta with exactly one defining equation A \Delta = E0, and ffl there exists F 2 SubstDef\Theta (E0) such that, whenever an instance of a nonfree constant B satisfies B st F , then the same instance satisfies B st !a; ~*?:G st F . Definition 5.17 Let E 2 L\Theta , A 2 Const free, and B 2 G\Theta . The term EhhA := Bii obtained from E by replacing each occurrence of A with B is defined by induction on the syntactical structureof E as follows: ffl 0hhA := Bii j 0 ffl (!a; ~*?:E)hhA := Bii j !a; ~*?:(EhhA := Bii) ffl (E=L)hhA := Bii j (EhhA := Bii)=L ffl (E['])hhA := Bii j (EhhA := Bii)['] ffl \Theta (E)hhA := Bii j \Theta (EhhA := Bii) ffl (E1 + E2)hhA := Bii j (E1hhA := Bii) + (E2hhA := Bii) ffl (E1 kS E2)hhA := Bii j (E1hhA := Bii) kS (E2hhA := Bii) ffl A0hhA := Bii j 8!: B if A0 j A A0 if A0 6j A ^ A0 free A00 if A0 6j A ^ A0 \Delta = E 2 Def\Theta ^ A00 \Delta = EhhA := Bii 2 Def\Theta UBLCS-96-17 25 5 A notion of equivalence for EMPA Definition 5.18 Let E1; E2 2 L\Theta be pgc, and suppose that ConstDef\Theta (E1) [ ConstDef\Theta (E2) contains fAi 2 Const j i 2 Ig as free constants. We say that E1 and E2 are strongly EMBE if and only if, forall sets fBi 2 G\Theta j i 2 Ig such that E1hhAi := Biiii2I ; E2hhAi := Biiii2I 2 G\Theta , it turns out that E1hhAi := Biiii2I ,EMB E2hhAi := Biiii2I Theorem 5.19 Let E1; E2 2 L\Theta be pgc, and suppose that ConstDef\Theta (E1) [ ConstDef\Theta (E2) contains only A 2 Const as a free constant. Let A1 \Delta = E1hhA := A1ii and A2 \Delta = E2hhA := A2ii be in G\Theta . If E1 ,EMB E2, then A1 ,EMB A2. Proof It suffices to prove that B0 = B [ B\Gamma 1 where B = f(F1; F2) j F1 j F hhB := A1ii ^ F2 j F hhB := A2ii ^F 2 L \Theta pgc with at most B 2 ConstDef\Theta (F ) freeg is a strong EMB up to ,EMB: the result will follow by taking F j B. We first observe that B0 ` G\Theta \Theta G\Theta is reflexive (because if F does not contain free variables then F 2 G\Theta and F1 j F j F2),symmetric (by definition), and transitive (for any F 2 L\Theta pgc with at most B 2 ConstDef\Theta (F )free we have (F1; F2) 2 B0 and (F2; F1) 2 B0, and transitivity is guaranteed by F1; F2 2 G\Theta andreflexivity). Given (F1; F2) 2 B0, a 2 AType, l 2 PLevel, and C 2 G\Theta =(,EMB B0 ,EMB), we provethat Rate (F1; a; l; C) = Rate(F2; a; l; C) by proceeding by induction on the maximum depth d ofthe inference of a potential move for F1 having type a, priority level l, and derivative term in C. ffl If d = 1, then only the rule for the prefix operator has been used to deduce the potential move. Therefore F j !a; ~*?:F 0 with PL(!a; ~*?) = l, and for j 2 f1; 2g we have Fj j !a; ~*?:(F 0hhB := Ajii). Since (F 0hhB := A1ii; F 0hhB := A2ii) 2 B, it turns out that C = [F 0hhB := A1ii],EMBB0,EMB = [F 0hhB := A2ii],EMBB0,EMB hence Rate(F1; a; l; C) =~ * = Rate(F2; a; l; C). ffl If d ? 1, then several subcases arise depending on the syntactical structure of F .- If F j F 0=L, then for j 2 f1; 2g we have Fj j (F 0hhB := Ajii)=L. Since F1 has apotential move having type a (with a =2 L), priority level l, and derivative term in C,such that the depth of its inference is d, F 0hhB := A1ii has a potential move havingtype b (with b = a if a 6= o/ , b 2 L [ fo/ g if a = o/ ), priority level l, and derivativeterm G 2 C0 2 G\Theta =(,EMB B0 ,EMB), such that the depth of its inference is d \Gamma 1 and C = [G=L],EMBB0,EMB. For j 2 f1; 2g we have Rate(Fj; a; l; C) = 8!: Rate (F 0hhB := Ajii; a; l; C0)Rate (F 0hhB := Ajii; o/; l; C0) MinMin fj Rate(F 0hhB := Ajii; b; l; C0) j b 2 L jgdepending on whether a =2 L [ fo/ g or a = o/ . From the induction hypothesis, it followsthat Rate (F1; a; l; C) = Rate(F2; a; l; C).- If F j F 0['], then the proof is similar to the one developed in the first subcase. The re-sult follows by applying the induction hypothesis to the fact that for j 2 f1; 2g we have Rate(Fj; a; l; C) = Minfj Rate(F 0hhB := Ajii; b; l; C0) j '(b) = a jg - If F j \Theta (F 0), then the proof is similar to the one developed in the first subcase. The re-sult follows by applying the induction hypothesis to the fact that for j 2 f1; 2g we have Rate(Fj; a; l; C) = Rate(F 0hhB := Ajii; a; l; C0) - If F j F 0 + F 00, then for j 2 f1; 2g we have Fj j (F 0hhB := Ajii) + (F 00hhB := Ajii).Since F1 has a potential move having type a, priority level l, and derivative term in C,such that the depth of its inference is d, F 0hhB := A1ii (F 00hhB := A1ii) has the samemove but the depth of its inference is d \Gamma 1. For j 2 f1; 2g we have Rate(Fj; a; l; C) = Rate(F 0hhB := Ajii; a; l; C) Min Rate(F 00hhB := Ajii; a; l; C) From the induction hypothesis, it follows that Rate(F1; a; l; C) = Rate(F2; a; l; C).- If F j F 0 kS F 00, then for j 2 f1; 2g we have Fj j (F 0hhB := Ajii) kS(F 00hhB := Ajii).Suppose that F1 has a potential move having type a, priority level l, and derivativeterm in C, such that the depth of its inference is d. UBLCS-96-17 26 5 A notion of equivalence for EMPA \Lambda If a =2 S, then F 0hhB := A1ii (F 00hhB := A1ii) has a potential move having type a,priority level l, and derivative term in G 2 C0 2 G\Theta =(,EMB B0 ,EMB), such thatthe depth of its inference is d \Gamma 1 and C = [G kS(F 00hhB := A1ii)],EMBB0,EMB( C = [(F 0hhB := A1ii) kS G],EMBB0,EMB). For j 2 f1; 2g we have Rate(Fj; a; l; C)=8!: Rate (F 0hhB := Ajii; a; l; C0) MinRate (F 00hhB := Ajii; a; l; [F 00hhB := Ajii],EMBB0,EMB )Rate (F 0hhB := Ajii; a; l; C0) depending on whether F 0hhB := Ajii 2 C0 or F 0hhB := Ajii =2 C0. From theinduction hypothesis, it follows that Rate (F1; a; l; C) = Rate(F2; a; l; C). \Lambda If a 2 S, then F 0hhB := A1ii (F 00hhB := A1ii) has a potential move having type a,priority level l, and derivative term in G0 2 C0 2 G\Theta =(,EMB B0 ,EMB), such thatthe depth of its inference is at most d \Gamma 1, and F 00hhB := A1ii (F 0hhB := A1ii)has a potential move having type a, priority level \Gamma 1, and derivative term in G00 2 C00 2 G\Theta =(,EMB B0 ,EMB), such that the depth of its inference is at most d \Gamma 1; besides, C = [G0 kS G00],EMBB0,EMB. For j 2 f1; 2g we have Rate(Fj; a; l; C) = 8!: Rate (F 0hhB := Ajii; a; l; C0) MinRate (F 00hhB := Ajii; a; l; C00)Rate (F 0hhB := Ajii; a; l; C0) depending on whether Rate(F 0hhB := Ajii; a; \Gamma 1; C0) 6= ? or Rate(F 0hhB := Ajii; a; \Gamma 1; C0) = ?. From the induction hypothesis, it follows that Rate(F1; a; l; C) = Rate(F2; a; l; C).- If F j B0, then for j 2 f1; 2g we have Fj j B0hhB := Ajii. \Lambda If B0 j B, then for j 2 f1; 2g we have Fj j Aj. Since F1 has a potential movehaving type a, priority level l, and derivative term in C, such that the depth ofits inference is d, then E1hhA := A1ii has the same potential move but the depthof its inference is d \Gamma 1. For j 2 f1; 2g we have Rate(Fj; a; l; C) = Rate(Ej; a; l; C).From the induction hypothesis and the fact that E1 ,EMB E2, it follows thatRate (F1; a; l; C) = Rate(F2; a; l; C). \Lambda If B0 6j B, then B0 2 G\Theta and the result trivially follows from the fact that F1 j B0 j F2. 5.4 Relationship between ,EMB and ,FP In this section we investigate the relationship between ,EMB and ,FP . The first result we proveis that the inclusion ,EMB ` ,FP holds in E \Theta E. Theorem 5.20 Let E1; E2 2 G. If E1 ,EMB E2 then E1 ,F E2. Proof It follows immediately from the definitions of ,EMB and ,F . Theorem 5.21 Let E1; E2 2 E. If E1 ,EMB E2 then E1 ,P E2. Proof Let E1; E2 2 E and let B ` G\Theta \Theta G\Theta be a strong EMB such that (E1; E2) 2 B (it isunderstood that (\Theta (E1); \Theta (E2)) 2 B). Let us group the steps of the algorithm for determining theMarkovian semantics into macrosteps, where a given macrostep results in the elimination of the forks of immediate transitions whose upstream vanishing states belong to the same vanishing equivalence class of ("E1 [ "E2)=B. Let us denote by ^P0[[E1]] and ^P0[[E2]] the two PLTSs produced by the execution of the first step (up to immediate selfloop removal), and by ^Ph[[E1]] and ^Ph[[E2]]the two PLTSs produced by the execution of macrostep h * 1 related to vanishing equivalenceclass Ch (up to removal of immediate selfloops incident on states not belonging to Ch). The result follows by proving that ^Ph[[E1]] and ^Ph[[E2]] are p-bisimilar by proceeding by induction on thenumber h 2 NI of vanishing equivalence classes of ("E1 [ "E2)=B. ffl Let h = 0. We prove that B0 = B " ((SE1;1 [ SE2;1) \Theta (SE1;1 [ SE2;1)) UBLCS-96-17 27 5 A notion of equivalence for EMPA is a p-bisimulation between ^P0[[E1]] and ^P0[[E2]]. Observe that B0 is an equivalence relation,and that (SE1;1 [ SE2;1)=B0 = fC j C = C0 " ((SE1;1 [ SE2;1) \Theta (SE1;1 [ SE2;1)) 6= ; ^ C0 2 G\Theta =Bg - Let C 2 (SE1;1 [ SE2;1)=B0. For j 2 f1; 2g we haveX s2C"SEj;1 PEj;1(s) = ae 1 if Ej 2 C0 if E j =2 C Since (E1; E2) 2 B, it turns out that E1 2 C if and only if E2 2 C, soX s2C"SE1;1 PE1;1(s) = X s2C"SE2;1 PE2;1(s) - Let (s1; s2) 2 B0 " (SE1;1 \Theta SE2;1). Let C 2 (SE1;1 [ SE2;1)=B0, and C0 be the correspond-ing equivalence class in G\Theta =B. Since h = 0, s1 and s2 are tangible. For j 2 f1; 2g we have Minfj * j sj *\Gamma \Gamma \Gamma ! Ej;1 s0j ^ s0j 2 C " SEj;1 jg = Minfj * j sj a;*\Gamma \Gamma \Gamma ! Ej s0j ^ a 2 AType ^ s0j 2 C " SEj;1 jg = Minfj Rate(sj; a; 0; C0) j a 2 AType jg as SEj;1 = "Ej. Since (s1; s2) 2 B and C0 2 G\Theta =B, it turns out Minfj * j s1 *\Gamma \Gamma \Gamma ! E1;1 s01 ^ s01 2 C " SE1;1 jg = Minfj * j s2 *\Gamma \Gamma \Gamma ! E2;1 s02 ^ s02 2 C " SE2;1 jg ffl Let h * 1 and suppose that ^Ph\Gamma 1[[E1]] and ^Ph\Gamma 1[[E2]] are p-bisimilar via Bh\Gamma 1 ` (SE1;k1 [ SE2;k2) \Theta (SE1 ;k1 [ SE2;k2). Let Ch 2 (SE1;k1 [ SE2;k2)=Bh\Gamma 1 be the vanishing equivalence class considered during macrostep h, and let SE1;k01 and SE2;k02 be the set of states of ^Ph[[E1]] and ^Ph[[E2]], respectively. We prove that Bh = Bh\Gamma 1 " ((SE1;k01 [ SE2;k02 ) \Theta (SE1;k01 [ SE2;k02)) is a p-bisimulation between ^Ph[[E1]] and ^Ph[[E2]]. Observe that Bh is an equivalence relation,and that (SE1;k01 [ SE2;k02)=Bh = fC j C = C0 " ((SE1;k01 [ SE2;k02) \Theta (SE1;k01 [ SE2;k02)) 6= ; ^ C0 2 (SE1;k1 [ SE2;k2)=Bh\Gamma 1g - Let C 2 (SE1;k01 [ SE2;k02)=Bh, and C0 be the corresponding equivalence class in (SE1;k1 [ SE2;k2)=Bh\Gamma 1. \Lambda If Ch " (SE1;k01 [ SE2;k02) 6= ;, then there is no state in Ch having transitions to statesnot in Ch, so for j 2 f1; 2g we haveX s2C"SEj;k0 j PEj;k0j (s) = X s2C0"SEj;kj PEj;kj (s) From the induction hypothesis, it follows thatX s2C"SE1;k01 PE1;k01(s) = X s2C"SE2;k02 PE2;k02(s) \Lambda If Ch " (SE1;k01 [ SE2;k02) = ;, given sh 2 Ch " SE1;k1 let p; q 2 RI [0;1] be defined by 1l;p = Minfj 1l;p0 j sh 1l;p0\Gamma \Gamma \Gamma ! E1;k1 s0 ^ s0 2 C0 " SE1;k1 jgand 1l;q = Minfj 1l;p0 j sh 1l;p0\Gamma \Gamma \Gamma ! E1;k1 s0 ^ s0 =2 Ch " SE1;k1 jgNote that q is well defined because each state in Ch has transitions to states notin Ch, whereas p could be undefined and in this case p is taken to be 0 for conve-nience. Then for j 2 f1; 2g we haveX s2C"SEj;k0 j PEj;k0j (s) = X s2C0"SEj ;kj PEj;kj (s) + pq \Delta X sh2Ch"SEj;kj PEj;kj (sh) From the induction hypothesis, it follows thatX s2C"SE1;k01 PE1;k01(s) = X s2C"SE2;k02 PE2;k02(s) UBLCS-96-17 28 5 A notion of equivalence for EMPA - Let (s1; s2) 2 Bh " (SE1;k01 \Theta SE2;k02). Let C 2 (SE1;k01 [ SE2;k02)=Bh, and C0 be thecorresponding equivalence class in (SE1;k1 [ SE2;k2)=Bh\Gamma 1. Note that (s1; s2) 2 Bh\Gamma 1 " (SE1;k1 \Theta SE2;k2). \Lambda If Ch " (SE1;k01 [ SE2;k02) 6= ;, then there is no state in Ch having transitions to statesnot in Ch, so for j 2 f1; 2g we have Minfj ~* j sj ~*\Gamma \Gamma \Gamma ! Ej;k0j s0j ^ s0j 2 C " SEj;k0j jg = Minfj ~* j sj ~*\Gamma \Gamma \Gamma ! Ej;kj s0j ^ s0j 2 C0 " SEj ;kj jg From the induction hypothesis, it follows that Minfj ~* j s1 ~*\Gamma \Gamma \Gamma ! E1;k01 s01 ^ s01 2 C " SE1;k01 jg = Minfj ~* j s2 ~*\Gamma \Gamma \Gamma ! E2;k02 s02 ^ s02 2 C " SE2;k02 jg \Lambda If Ch " (SE1;k01 [ SE2;k02) = ;, given sh 2 Ch " SE1;k1 let p; q 2 RI [0;1] be defined by 1l;p = Minfj 1l;p0 j sh 1l;p0\Gamma \Gamma \Gamma ! E1;k1 s0 ^ s0 2 C0 " SE1;k1 jg and 1l;q = Minfj 1l;p0 j sh 1l;p0\Gamma \Gamma \Gamma ! E1;k1 s0 ^ s0 =2 Ch " SE1;k1 jg Note that q is well defined because each state in Ch has transitions to states notin Ch, whereas p could be undefined and in this case p is taken to be 0 for conve-nience. Then for j 2 f1; 2g we have Minfj ~* j sj ~*\Gamma \Gamma \Gamma ! Ej;k0j s0j ^ s0j 2 C " SEj ;k0j jg = Minfj ~* j sj ~*\Gamma \Gamma \Gamma ! Ej;kj s0j ^ s0j 2 C0 " SEj ;kj jg Min Split(Minfj ~* j sj ~*\Gamma \Gamma \Gamma ! Ej;kj sh ^ sh 2 Ch " SEj;kj jg; pq ) From the induction hypothesis, it follows that Minfj ~* j s1 ~*\Gamma \Gamma \Gamma ! E1;k01 s01 ^ s01 2 C " SE1;k01 jg = Minfj ~* j s2 ~*\Gamma \Gamma \Gamma ! E2;k02 s02 ^ s02 2 C " SE2;k02 jg The inclusion ,EMB ` ,FP in E \Theta E is strict, as one can see by considering the examplesbelow. Additionally, such examples show that ,EMB cannot abstract from either priority levelsor weights of immediate actions; otherwise, the congruence property would no longer hold. Example 5.22 Consider terms E1 and E2 of Example 5.3. Then E1 ,FP E2 but E1 6,EMB E2 becauseRate (E1; a; 0; G\Theta ) = * 6= _ = Rate(E2; a; 0; G\Theta ). Example 5.23 Consider terms E1 and E2 of Example 5.4. Then E1 ,FP E2 but E1 6,EMB E2 becauseRate (E1; a; 1; G\Theta ) = 11;1 6= ? = Rate(E2; a; 1; G\Theta ). If we relax Definition 5.7 to abstract from thepriority level of immediate actions, then E1 ,EMB E2 but this new strong EMBE would be closedunder neither the alternative composition operator nor the parallel composition operator. For example, E1 + !b; 11;1?:0 6,EMB E2 + !b; 11;1?:0 and E1 k; !b; 11;1?:0 6,EMB E2 k; !b; 11;1?:0because the left-hand side terms can execute an action with type b while the right-hand side termscannot. Example 5.24 Consider terms E1 and E2 of Example 5.5. Then E1 ,FP E2 but E1 6,EMB E2because Rate (E1; a; 1; G\Theta ) = 11;1 6= 11;2 = Rate(E2; a; 1; G\Theta ). If we relax Definition 5.7 toconsider execution probabilities instead of weights for immediate actions (see the notion of relative bisimulation proposed in [40]), then E1 ,EMB E2 but this new strong EMBE would be closed under UBLCS-96-17 29 5 A notion of equivalence for EMPA neither the alternative composition operator nor the parallel composition operator. For example, E1 + !b; 11;1?:0 6,EMB E2 + !b; 11;1?:0 and E1 k; !b; 11;1?:0 6,EMB E2 k; !b; 11;1?:0 becausethe left-hand side terms can execute actions having type a with probability 1=2 while the right-hand side terms can execute actions having type a with probability 2=3. As a matter of fact, the second result we prove is that ,EMB , restricted to the set E\Gamma o/1 of termsin E whose integrated semantic model does not contain internal immediate transitions, is thecoarsest congruence contained in ,FP . Theorem 5.25 Let E1; E2 2 E\Gamma o/1. Then E1 ,EMB E2 if and only if, for all F 2 G and S `AType \Gamma fo/ g such that E1 +F , E2 +F , E1 kS F , E2 kS F 2 E\Gamma o/1, it turns out that E1 +F ,FP E2 +Fand E1 kS F ,FP E2 kS F . Proof (=)) Since E1 ,EMB E2 and ,EMB is a congruence, for all F 2 G and S ` AType \Gamma fo/ gwe have E1 + F ,EMB E2 + F and E1 kS F ,EMB E2 kS F . Since ,EMB ae ,FP in E \Theta E, the resultfollows. ((=) We prove the contrapositive, so we assume that E1 6,EMB E2 and we demonstrate that E1 and E2 are distinguishable with respect to ,FP by means of an appropriate context basedon the alternative composition operator or the parallel composition operator. We proceed by induction on the number n of actions that E1 and E2 have to execute in order to become E01 and E02, respectively, such that E01 6,EMB E02 because they violate the necessary condition expressed byProposition 5.11 (ii). 4 ffl Let n = 0, i.e. assume that there exist a 2 AType and l 2 PLevel such that Minfj Rate(E1; a; l; fEg) j E 2 E\Gamma o/1 jg 6= Minfj Rate(E2; a; l; fEg) j E 2 E\Gamma o/1 jg. Since both sides of theinequality cannot be ?, we assume that Minfj Rate(E1; a; l; fEg) j E 2 E\Gamma o/1 jg 6= ?. Thereare several cases: - Assume that Minfj Rate(E2; a; l; fEg) j E 2 E\Gamma o/1 jg 6= ?. \Lambda Assume that l = 0. \Delta If a = o/ , or a 6= o/ and Minfj Rate(E1; o/; 0; fEg) j E 2 E\Gamma o/1 jg 6=Min fj Rate(E2; o/; 0; fEg) j E 2 E\Gamma o/1 jg, then E1 kAType\Gamma fo/g 0 6,P E2 kAType\Gamma fo/g 0 because the exit rates of these two terms are Minfj Rate(E1; o/; 0; fEg) j E 2 E\Gamma o/1 jg and Minfj Rate(E2; o/; 0; fEg) j E 2 E\Gamma o/1 jg, respectively, hence p-bisimilarity is violated. \Delta If a 6= o/ and Minfj Rate(E1; o/; 0; fEg) j E 2 E\Gamma o/1 jg = Minfj Rate(E2; o/; 0; fEg) j E 2 E\Gamma o/1 jg, then E1 kAType\Gamma fo/g !a; \Lambda ?:0 6,P E2 kAType\Gamma fo/g !a; \Lambda ?:0 because the exit rates of these two terms are Minfj Rate(E1; a; 0; fEg) j E 2 E\Gamma o/1 jg Min Minfj Rate(E1; o/; 0; fEg) j E 2 E\Gamma o/1 jg and Minfj Rate(E2; a;0 ; fEg) j E 2 E\Gamma o/1 jg Min Minfj Rate(E2; o/; 0; fEg) j E 2 E\Gamma o/1 jg, respec-tively, hence p-bisimilarity is violated. \Lambda Assume that l * 1. From E1; E2 2 E\Gamma o/1, it follows that a 6= o/ and Minfj Rate(E1; o/; l; fEg) j E 2 E\Gamma o/1 jg = ? = Minfj Rate(E2; o/; l; fEg) j E 2 E\Gamma o/1 jg. As a con-sequence, given b 2 AType \Gamma fo/ g occurring neither in E1 nor in E2, and * 2 RI +smaller than the smallest rate of the possible exponentially timed actions occurring in E1 and E2, we have that E1 kAType\Gamma fo/g\Gamma fbg(!a; \Lambda ?:0 + !b; 1l;w?:!b; *?:0) 6,P E2 kAType\Gamma fo/g\Gamma fbg(!a; \Lambda ?:0 + !b; 1l;w?:!b; *?:0) because the state having the transition labeled with b; * has initial state probability w=(Minfj Rate(E1; a; l; fEg) j E 2 E\Gamma o/1 jg + w) in the Markovian semantics of 4. If such E01 and E02 did not exist, then E1 6,EMB E2 would not hold. UBLCS-96-17 30 5 A notion of equivalence for EMPA the left-hand side term, w=(Minfj Rate(E2; a; l; fEg) j E 2 E\Gamma o/1 jg + w) in theMarkovian semantics of the right-hand side term. 5 - Assume that Minfj Rate(E2; a; l; fEg) j E 2 E\Gamma o/1 jg = ?. \Lambda Assume that there exists l0 2 PLevel \Gamma flg such that Minfj Rate(E2; a; l0; fEg) j E 2 E\Gamma o/1 jg 6= ?. From E1; E2 2 E\Gamma o/1, it follows that a 6= o/ . Then, given b 2 AType \Gamma fo/ g occurring neither in E1 nor in E2, we have that E1 kAType\Gamma fo/g\Gamma fbg(!a; \Lambda ?:0 + !b; 1max(l;l0);w?:0) 6,F E2 kAType\Gamma fo/g\Gamma fbg(!a; \Lambda ?:0 + !b; 1max(l;l0);w?:0) because one of these two terms can execute an action with type b while the otherterm cannot. \Lambda Assume that Minfj Rate(E2; a; l0; fEg) j l0 2 PLevel ^ E 2 E\Gamma o/1 jg = ?. \Delta If a = o/ , then E1 kAType\Gamma fo/g 0 6,F E2 kAType\Gamma fo/g 0 because the left-hand side term can execute an action with type o/ while theright-hand side term cannot. \Delta If a 6= o/ , then E1 kAType\Gamma fo/g !a; \Lambda ?:0 6,F E2 kAType\Gamma fo/g !a; \Lambda ?:0 because the left-hand side term can execute an action with type a while theright-hand side term cannot. ffl Let n * 1, i.e. assume that for all a 2 AType and l 2 PLevel it turns out that Minfj Rate(E1; a; l; fEg) j E 2 E\Gamma o/1 jg = Minfj Rate(E2; a; l; fEg) j E 2 E\Gamma o/1 jg. From E1 6,EMB E2 and thehypothesis above, it follows that there exist a 2 AType, l 2 PLevel and C; C0 2 E\Gamma o/1= ,EMBsuch that Rate (E1; a; l; C) 6= Rate(E2; a; l; C), Rate(E1; a; l; C0) 6= Rate(E2; a; l; C0), C "C0 = ;,and Rate (E1; a; l; C) Min Rate(E1; a; l; C0) 6= ? 6= Rate(E2; a; l; C) Min Rate(E2; a; l; C0). As aconsequence, there exist F1 2 C (C0) and F2 2 C0 (C) reachable from E1 and E2, respec-tively, by executing an action having type a and priority level l, such that we can apply theinduction hypothesis to F1 and F2. Let " kAType\Gamma fo/g\Gamma S F " be the context that distinguishes F1 and F2 with respect to ,FP. If a = o/ , then E1 kAType\Gamma fo/g\Gamma S F 6,FP E2 kAType\Gamma fo/g\Gamma S F else E1 kAType\Gamma fo/g\Gamma S !a; \Lambda ?:F 6,FP E2 kAType\Gamma fo/g\Gamma S !a; \Lambda ?:F provided that the constraint on the possible element of S, and the constraint on the rate ofthe possible exponentially timed action occurring in F , are satisfied. In the following example we show the problems that arise when internal immediate transitionscome into play. Example 5.26 Consider terms E1 j !a; 11;1?:A E2 j !a; 11;1?:Bwhere A \Delta = !o/; 11;1?:A B \Delta = !o/; 11;2?:BIt turns out that E 1 6,EMB E2 because A and B violate the necessary condition expressed byProposition 5.11 (ii), and that E1 and E2 cannot be distinguished with respect to ,FP by means ofa context based on the alternative composition operator or the parallel composition operator. Concerning the alternative composition operator, it does not allow us to introduce a choice atthe level of A and B. 5. The choice of b makes the determination of initial state probabilities easier, while the choice of * is important in thecase we are interested in the lumped Markovian semantics (see Section 5.6). If we ignore the constraint on *, then e.g. E1 j !a; 11;1?:!o/; _?:0 and E2 j !a; 11;2?:!o/; _?:0 may not be distinguished with respect to ,P by means ofthe context above, because the ordinary lumping may come into play and the state considered above may have the same initial state probability in the Markovian semantics of both resulting terms. UBLCS-96-17 31 5 A notion of equivalence for EMPA Concerning the parallel composition operator, in principle it allows us to introduce a choiceat the level of A and B. However, we also have to introduce an exponentially timed action, insuch a way that the state having a transition labeled with this action has different initial state probabilities in the Markovian semantics of the two resulting terms. The problem is that such anaction cannot be executed at all because A and B always have a higher priority level action readyto be executed, and this action cannot be blocked by means of an appropriate synchronization set as it is internal. 5.5 Axiomatization of ,EMB Since we have proved that ,EMB is a congruence, we can develop an equational theory for EMPAwhich is based on ,EMB . Definition 5.27 We denote by A the set of axioms in Table 6, and we denote by Ded(A) thecorresponding deductive system. As it can be noted, the main difference with respect to the axiomatization of classical processalgebras lies in axiom A4: the idempotency property of the alternative composition operatorholds only in the case of passive actions, and the fact that rates of exponentially timed actions are summed up is a consequence of the adoption of the race policy.Now we prove that Ded (A) is a sound and complete deductive system with respect to ,EMBfor the set G\Theta ;nrec of nonrecursive terms in G\Theta . Definition 5.28 F 2 G\Theta ;nrec is in sum normal form (snf) if and only if either F j 0 or F jP i2I !ai; ~*i?:Fi where every Fi is itself in snf. Definition 5.29 We define function size : G\Theta ;nrec \Gamma ! NI + by structural induction as follows: ffl size(0) = 1; ffl size(!a; ~*?:E) = 1 + size(E); ffl size(E=L) = size(E[']) = size(\Theta (E)) = size(E); ffl size(E1 + E2) = max(size(E1); size(E2)); ffl size(E1 kS E2) = size(E1) + size(E2). Lemma 5.30 For any E 2 G\Theta ;nrec we have size(E) * 1. Lemma 5.31 For any axiom E1 = E2 in Table 6 we have size(E1) * size(E2). Lemma 5.32 For any E 2 G\Theta ;nrec there exists F 2 G\Theta ;nrec in snf such that A ` E = F . Proof Given E 2 G\Theta ;nrec, we proceed by induction on size(E): ffl Let size(E) = 1. The result follows by proving by induction on the syntactical structure of E that A ` E = 0:- If E j 0, then we take F j 0 and the result follows by reflexivity. - The case E j !a; ~*?:E0 is not possible because it contradicts the hypothesis size(E) =1. - If E j E0=L, then E0 is a subterm of E such that size(E0) = 1, hence A ` E0 = 0 bystructural induction. The result follows by substitutivity, A5 and transitivity.- If E j E0['] or E j \Theta (E0), then the result can be proved by proceeding as in theprevious point and by exploiting A8 in the first case and A11 in the second case.- If E j E1+E2, then E1 and E2 are subterms of E such that size(E1) = 1 and size(E2) = 1,hence A ` E1 = 0 and A ` E2 = 0 by structural induction. The result follows by UBLCS-96-17 32 5 A notion of equivalence for EMPA (A1) (E1 + E2) + E3 = E1 + (E2 + E3) (A2) E1 + E2 = E2 + E1 (A3) E + 0 = E (A4) !a; ~*1?:E + !a; ~*2?:E = !a; ~*1 Min ~*2?:E if PL(!a; ~*1?) = PL(!a; ~*2?) (A5) 0=L = 0 (A6) (!a; ~*?:E)=L = ae !a; ~*?:(E=L) if a =2 L!o/; ~*?:(E=L) if a 2 L (A7) (E1 + E2)=L = E1=L + E2=L (A8) 0['] = 0 (A9) (!a; ~*?:E)['] = !'(a); ~*?:(E[']) (A10) (E1 + E2)['] = E1['] + E2['] (A11) \Theta (0) = 0 (A12) \Theta (P i2I !a i; ~*i?:Ei) = P j2J !a j; ~*j?:\Theta (Ej) where J = fi 2 I j ~*i = \Lambda . 8h 2 I: PL(!ai; ~*i?) * PL(!ah; ~*h?)g (A13) 0 kS 0 = 0 (A14) (P i2I !a i; ~*i?:Ei) kS 0 = P j2J !a j; ~*j?:(Ej kS 0) where J = fi 2 I j ai =2 Sg (A15) 0 kS(P i2I !a i; ~*i?:Ei) = P j2J !a j; ~*j?:(0 kS Ej) where J = fi 2 I j ai =2 Sg (A16) ( P i2I1 !a i; ~*i?:Ei) kS( P i2I2 !a i; ~*i?:Ei) = P j2J1 !a j; ~*j?:(Ej kS P i2I2 !a i; ~*i?:Ei) +P j2J2 !a j; ~*j?:( P i2I1 !a i; ~*i?:Ei kS Ej) +P k2K1^h2Hk !a k; Split(~*k; 1=nk)?:(Ek kS Eh) +P k2K2^h2Hk !a k; Split(~*k; 1=nk)?:(Eh kS Ek) where J1 = fi 2 I1 j ai =2 Sg J2 = fi 2 I2 j ai =2 Sg K1 = fi1 2 I1 j 9i2 2 I2: ai1 = ai2 2 S ^ ~*i2 = \Lambda g K2 = fi2 2 I2 j 9i1 2 I1: ai1 = ai2 2 S ^ ~*i1 = \Lambda g Hk = fh 2 I2 j ak = ah ^ ~*h = \Lambda g with k 2 K1 Hk = fh 2 I1 j ak = ah ^ ~*h = \Lambda g with k 2 K2 nk = jHkj Table 6. Axioms for ,EMB UBLCS-96-17 33 5 A notion of equivalence for EMPA substitutivity, A3 and transitivity.- The case E j E1 kS E2 is not possible because it contradicts the hypothesis size(E) = 1. ffl Let the result hold whenever size(E) ^ n 2 NI +, and assume size(E) = n + 1. The resultfollows by proceeding by induction on the syntactical structure of E:- The case E j 0 is not possible because it contradicts the hypothesis size(E) = n+1 * 2. - If E j !a; ~*?:E0, then size(E0) = n hence by the induction hypothesis there exists F 0 2 G\Theta ;nrec in snf such that A ` E0 = F 0. The result follows by substitutivity.- If E j E0=L, then E0 is a subterm of E hence by structural induction there ex-ists F 0 2 G\Theta ;nrec in snf such that A ` E0 = F 0. By substitutivity we obtain A ` E = F 0=L. Assuming F 0 j Pi2I !ai; ~*i?:F 0i where every F 0i is in snf, by exploiting A7, A6 and transitivity we obtain A ` F 0=L = Pi2I((!ai; ~*i?:F 0i )=L) =P i2I^ai2L !o/; ~*i?:(F 0i =L) + Pi2I^ai =2L !ai; ~*i?:(F 0i =L). Since for every i 2 I wehave size(F 0 i =L) = size(F 0i ) ! size(F 0) = size(F 0=L) ^ size(E) = n + 1, by the inductionhypothesis it follows that for every i 2 I there exists F 00 i 2 G\Theta ;nrec in snf such that A ` F 0i =L = F 00i . If we take F j Pi2I^ai2L !o/; ~*i?:F 00i + Pi2I^ai =2L !ai; ~*i?:F 00i , thenthe result follows by substitutivity. - If E j E0['] or E j \Theta (E0), then the result can be proved by proceeding as in theprevious point and by exploiting A10 and A9 in the first case and A12 in the secondcase. - If E j E1 + E2, then E1 and E2 are subterms of E hence by structural induction thereexist F1; F2 2 G\Theta ;nrec in snf such that A ` E1 = F1 and A ` E2 = F2. By substitutivitywe obtain A ` E = F1 + F2 and the result follows after a possible application of A3.- If E j E1 kS E2, then size(E1) ^ n and size(E2) ^ n hence by the induction hypothesisthere exist F 01; F 02 2 G\Theta ;nrec in snf such that A ` E1 = F 01 and A ` E2 = F 02. Bysubstitutivity we obtain A ` E = F 01 kS F 02. There are three cases: \Lambda If size(E1) = size(E2) = 1, then F 01 j F 02 j 0 hence A ` E = 0 by A13 andtransitivity. \Lambda If size(E1) = 1 and size(E2) ? 1, then F 01 j 0 and F 02 j Pi2I !ai; ~*i?:F 02;iwhere every F 02;i is in snf. By A15 and transitivity we obtain A ` F 01 kS F 02 =P j2J !aj; ~*j?:(0 kS F 02;j). Since for every j 2 J we have size(0 kS F 02;j) ! size(0 kSF 2) ^ size(E) = n + 1, by the induction hypothesis it follows that for every j 2 Jthere exists F 002;j in snf such that A ` 0 kS F 02;j = F 002;j, hence the result follows bysubstitutivity. In the symmetric case, A14 is used instead of A15. \Lambda If size(E1) ? 1 and size(E2) ? 1, then F 01 j Pi2I1 !ai; ~*i?:F 01;i and F 02 jP i2I2 !ai; ~*i?:F 02;i where every F 01;i and F 02;i is in snf. By A16 and transitivity weobtain A ` F 01 kS F 02 = Pj2J1 !aj; ~*j?:(F 01;j kS F 02)+Pj2J2 !aj; ~*j?:(F 01 kS F 02;j)+P k2K1^h2Hk !ak; Split(~*k; 1=nk)?:(F 01;k kS F 02;h) + Pk2K2^h2Hk !ak; Split(~*k; 1=n k)?:(F 01;h kS F 02;k). Since the size of every term surrounded by parentheses is atmost n, by the induction hypothesis each such term can be proved equal via A toa term in snf, hence the result follows by substitutivity. Theorem 5.33 The deductive system Ded(A) is sound and complete with respect to ,EMB for theset G\Theta ;nrec of nonrecursive terms. Proof We must prove that for any E1; E2 2 G\Theta ;nrec we have A ` E1 = E2 () E1 ,EMB E2.( =)) It is a straightforward consequence of the fact that reflexivity, symmetry, transitivity andsubstitutivity of Ded (A) are matched by the reflexive, symmetric, transitive and congruenceproperties of ,EMB, and the fact that every axiom in A can be restated as a property of ,EMB.( (=) Assume E1 ,EMB E2. There are two cases:- If E1 and E2 are both in snf, the result follows by proceeding by induction on size(E1): \Lambda If size(E1) = 1, then E1 j 0 j E2 since they are both in snf. The result follows byreflexivity. UBLCS-96-17 34 5 A notion of equivalence for EMPA \Lambda If size(E1) ? 1, then E1 j Pi2I1 !a1;i; ~*1;i?:E1;i and E2 j Pi2I2 !a2;i; ~*2;i?:E2;i. It is not restrictive to assume that for k 2 f1; 2g it holds ak;i = ak;j^PL(!ak;i; ~*k;i?) = PL(!ak;j; ~*k;j?) ^ Ek;i ,EMB Ek;j =) i = j because if this were not thecase, then it would suffice to resort to finitely many applications of A1, A2and A4. Since E1 ,EMB E2, we have that jI1j = jI2j and for every summand !a1;i; ~*1;i?:E1;i in E1 there exists exactly one summand !a2;j; ~*2;j?:E2;j in E2 such that a1;i = a2;j ^ ~*1;i = ~*2;j ^ E1;i j E2;j (hence E1;i ,EMB E2;j), and viceversa. By the induction hypothesis we obtain that A ` E1;i = E2;j, and the resultfollows by substitutivity. - If E1 or E2 is not in snf, then by Lemma 5.32 there exist F1; F2 2 G\Theta ;nrec in snf suchthat A ` E1 = F1 and A ` E2 = F2. We then obtain E1 ,EMB F1 and E2 ,EMB F2by soundness and F1 ,EMB F2 by the transitive property, hence A ` F1 = F2 by theprevious point. By transitivity we finally obtain A ` E1 = E2. 5.6 An algorithm to check for ,EMB We conclude our study of a notion of equivalence for EMPA by presenting an algorithm that canbe used to check whether two finite-state terms of G are strongly EMBE or not, and to minimizethe integrated semantic model of a finite-state term with respect to ,EMB . begin Partition := fSg; Splitters := fSg; repeat OldPartition := Partition; choose C0 in Splitters; Splitters := Splitters \Gamma fC0g; for each a 2 AType do for each l 2 PLevel do for each C 2 OldPartition do begin !let PartitionC be the coarsest partition ofC such that for every E1; E2 2 C00 2 PartitionC Rate(E1; a; l; C0) = Rate(E2; a; l; C0)?; if PartitionC 6= fCg then begin Partition := Partition \Gamma fCg [ PartitionC; Splitters := Splitters \Gamma fCg [ PartitionC end end untilSplitters = ; end Table 7. Algorithm to check for ,EMB The algorithm, which is shown in Table 7, is an adaptation to our framework of the algorithmdescribed in [13] (which could be applied to the functional semantic models of finite-state terms of G), which is in turn a variant of the algorithm proposed in [29] to solve the relational coarsestpartition problem. Given a labeled transition system with state space S representing the unionof the integrated semantic models of two finite-state terms of G to be checked for ,EMB , or theintegrated semantic model of a finite-state term of G to be minimized with respect to ,EMB ,the idea of the algorithm is to repeatedly refine the current partition until this is a strong EMB. As we can see, the initial partition contains only one class which is the entire state space, andthe partition resulting after the first execution of the repeat-until cycle is the coarsest partition UBLCS-96-17 35 5 A notion of equivalence for EMPA satisfying the necessary condition for ,EMB of Proposition 5.11(ii).By following the proposal of [29], this algorithm can be implemented in O(m log n) time and O(m + n) space where n is the number of states and m is the number of transitions.It is worth noting that a variant of the algorithm in Table 7 can be used to compute the coarsest ordinary lumping [37] of the Markovian semantics of a given term, hence allowing for thedetermination of performance measures by solving a smaller Markov chain which is equivalent to the original one. Definition 5.34 Let Mi = (Si; RI +; \Gamma \Gamma \Gamma !i ; Pi), i 2 f1; 2g, be two PLTSs representing two HCTMCs. We say that M2 is an ordinary lumping of M1 if and only if S2 is a partition of S1 such that C *\Gamma \Gamma \Gamma ! 2 C0 whenever for every s 2 C it holds * = Pfj _ j s _\Gamma \Gamma \Gamma ! 1 s0 ^ s0 2 C0 jg. Proposition 5.35 Let Mi = (Si; RI +; \Gamma \Gamma \Gamma !i ; Pi), i 2 f1; 2g, be two PLTSs representing twoHCTMCs, such that M2 is an ordinary lumping of M1. Then M2 is p-bisimilar to M1. Proof It suffices to take the reflexive, symmetric and transitive closure of the relation thatassociates every microstate of M1 with the macrostate of M2 that contains it. We conclude by giving the definition of lumped Markovian semantics and by showing therelation among ,EMB , p-bisimilarity and ordinary lumpability. Definition 5.36 Let M[[E]] = (SE;M; RI +; \Gamma \Gamma \Gamma !E;M ; PE;M) be the Markovian semantics of E 2 E.The lumped Markovian semantics of E is the PLTS Ml[[E]] = (SE;Ml ; RI +; \Gamma \Gamma \Gamma !E;Ml ; PE;Ml) where: ffl SE;Ml = Partition where Partition is the result of the algorithm in Table 8; ffl \Gamma \Gamma \Gamma !E;Ml is the least subset of SE;Ml \Theta RI + \Theta SE;Ml such that C *\Gamma \Gamma \Gamma ! E;Ml C0 whenever * = Pfj _ j s _\Gamma \Gamma \Gamma ! E;M s0 ^ s0 2 C0 jg with s fixed in C; ffl PE;Ml : SE;Ml \Gamma ! RI [0;1] such that PE;Ml(C) = Ps2C PE;M(s). Theorem 5.37 Let E1; E2 2 E. If E1 ,EMB E2 then Ml[[E1]] is p-bisimilar to Ml[[E2]]. Proof From Theorem 5.21 it follows that M[[E1]] is p-bisimilar to M[[E2]] via a given equivalencerelation BM. The result follows by proving that BMl = f(C1; C2) 2 (SE1;Ml [ SE2;Ml) \Theta (SE1;Ml [ SE2;Ml) j 9s1 2 C1: 9s2 2 C2: (s1; s2) 2 BMg is a p-bisimulation between Ml[[E1]] and Ml[[E2]]. Note that BMl is an equivalence relationbecause so is BM. ffl Let D 2 (SE1;Ml [ SE2;Ml)=BMl . For j 2 f1; 2g we haveX C2D"SEj;Ml PEj;Ml(C) = X C2D"SEj;Ml Xs2C PEj;M(s) = X s2([C2DC)"SEj;M PEj;M(s) Since [C2DC is the union of some equivalence classes with respect to BM, and BM is ap-bisimulation, it follows thatX C2D"SE1;Ml PE1;Ml(C) = X C2D"SE2;Ml PE2;Ml(C) ffl Let (C1; C2) 2 BMl " (SE1;Ml \Theta SE2;Ml) due to the existence of s1 2 C1 and s2 2 C2 suchthat (s1; s2) 2 BM. Let D 2 (SE1;Ml [ SE2;Ml)=BMl. For j 2 f1; 2g we haveX fj * j Cj *\Gamma \Gamma \Gamma ! Ej;Ml C0j ^ C0j 2 D " SEj;Ml jg =X fj * j sj *\Gamma \Gamma \Gamma ! Ej;M s0j ^ s0j 2 C0j 2 D " SEj ;Ml jg =X fj * j sj *\Gamma \Gamma \Gamma ! Ej;M s0j ^ s0j 2 ([C2DC) " SEj;M jg where the first equality holds whichever is sj 2 Cj because Ml[[Ej]] is obtained from M[[Ej]] UBLCS-96-17 36 6 Conclusion begin Partition := fSE;Mg; Splitters := fSE;Mg; repeat OldPartition := Partition; choose C0 in Splitters; Splitters := Splitters \Gamma fC0g; for each C 2 OldPartition do begin !let PartitionC be the coarsest partition ofC such that for every s1; s2 2 C00 2 PartitionCP fj * j s1 *\Gamma \Gamma \Gamma ! E;M s ^ s 2 C0 jg = Pfj * j s2 *\Gamma \Gamma \Gamma ! E;M s ^ s 2 C0 jg?; if PartitionC 6= fCg then begin Partition := Partition \Gamma fCg [ PartitionC; Splitters := Splitters \Gamma fCg [ PartitionC end end untilSplitters = ; end Table 8. Algorithm to compute the coarsest ordinary lumping via ordinary lumping. Since [C2DC is the union of some equivalence classes with respectto BM, and BM is a p-bisimulation, it follows thatX fj * j C1 *\Gamma \Gamma \Gamma ! E1;Ml C01 ^ C01 2 D " SE1;Ml jg =X fj * j C2 *\Gamma \Gamma \Gamma ! E2;Ml C02 ^ C02 2 D " SE2;Ml jg Corollary 5.38 Let E1; E2 2 E. If E1 ,EMB E2 then Ml[[E1]] is p-isomorphic to Ml[[E2]], i.e. thereexists a bijection fi : SE1;Ml \Gamma ! SE2;Ml such that: ffl PE1;Ml(s) = PE2;Ml(fi(s)) for any s 2 SE1;Ml; ffl s *\Gamma \Gamma \Gamma ! E1;Ml s0 () fi(s) *\Gamma \Gamma \Gamma ! E2;Ml fi(s0) for any s 2 SE1;Ml. Proof The searched bijection is relation BMl built in the proof of the previous theorem. The reasonis that BMl is a p-bisimulation and Ml[[E1]] and Ml[[E2]] are the coarsest lumpings of M[[E1]] and M[[E2]], respectively. The corollary above reveals the adequacy of ,EMB from the performance standpoint: if E1 ,EMB E2, then their underlying lumped Markovian models have the same transient and steady-state (ifany) probability distributions, i.e. E1 and E2 describe two concurrent systems having the sameperformance characteristics. 6 Conclusion In this paper we have shown that it is possible to develop a process algebra allowing for nondeter-minism, priorities, probabilities and time without burdening the underlying theory exceedingly. In particular, we have shown that the expressiveness of EMPA is considerable, because it canbe viewed as the sum of the expressiveness of a classical process algebra, a prioritized process algebra, a probabilistic process algebra and an exponentially timed process algebra, while theunderlying theory is relatively simple, since the idea of potential move is intuitive and the notion of equivalence is compact as well as elegant. UBLCS-96-17 37 REFERENCES The problem we are currently investigating is how to further enhance the expressive power ofEMPA. This means extending the timed kernel in order to cope with durations following arbitrary distributions. To achieve this, we have to understand which information must be added to statesand transitions of the integrated semantics, how to define the performance semantics, and how to extend the notion of equivalence. We are afraid that the enhanced expressiveness obtained bymeans of general distributions cannot be traded with the complexity of the underlying theory. However, this is extremely challenging because it should permit to bridge the gap betweendeterministically timed process algebras and stochastically timed process algebras. AcknowledgementsThis research has been partially funded by MURST and CNR. References [1] M. Ajmone Marsan, G. Balbo, G. Conte, "A Class of Generalized Stochastic Petri Nets for thePerformance Evaluation of Multiprocessor Systems", in ACM Trans. on Computer Systems 2:143-172, 1984[2] J.C.M. Baeten, J.A. Bergstra, J.W. Klop, "Syntax and Defining Equations for an Interrupt Mechanism in Process Algebra", in Fundamentae Informatica IX:127-168, 1986[3] J.C.M. Baeten, J.A. Bergstra, S.A. Smolka, "Axiomatizing Probabilistic Processes: ACP with Generative Probabilities", in Information and Computation 121:234-255, 1995[4] J.A. Bergstra, J.W. Klop, "Process Algebra for Synchronous Communication", in Information and Control 60:109-137, 1984[5] M. Bernardo, L. Donatiello, R. Gorrieri, "Integrating Performance and Functional Analysis of Concurrent Systems with EMPA", Technical Report UBLCS-95-14, University of Bologna(Italy), 1995 [6] M. Bernardo, "Extended Markovian Process Algebra: A Case Study", in Proc. of the 5th ItalianConf. on Theoretical Computer Science (ICTCS '95), World Scientific, pp. 466-481, Ravello (Italy), 1995[7] M. Bernardo, R. Gorrieri, "Extended Markovian Process Algebra", in Proc. of the 7th Int. Conf. on Concurrency Theory (CONCUR '96), LNCS 1119:315-330, Pisa (Italy), 1996[8] M. Bernardo, "On the Coexistence of Exponential, Immediate and Passive Actions in EMPA", in [34], pp. 58-76[9] T. Bolognesi, E. Brinksma, "Introduction to the ISO Specification Language LOTOS", in Computer Networks and ISDN Systems 14, 1987[10] P. Buchholz, "Markovian Process Algebra: Composition and Equivalence", in [34], pp. 11-30 [11] R. Cleaveland, M. Hennessy, "Priorities in Process Algebras", in Information and Computa-tion 87(1/2):58-77, 1990 [12] J. Camilleri, G. Winskel, "CCS with Priority Choice", in Information and Computa-tion 116:26-37, 1995 [13] J.-C. Fernandez, "An Implementation of an Efficient Algorithm for Bisimulation Equivalence",in Science of Computer Programming 13:219-236, 1989 [14] R. van Glabbeek, S.A. Smolka, B. Steffen, "Reactive, Generative and Stratified Models ofProbabilistic Processes", in Information and Computation 121:59-80, 1995 [15] R. Gorrieri, M. Roccetti, E. Stancampiano, "A Theory of Processes with Durational Actions",in Theoretical Computer Science 140(1):73-94, 1995 [16] H. Hermanns, M. Rettelbach, "Syntax, Semantics, Equivalences, and Axioms for MTIPP",in [34], pp. 71-87 [17] H. Hermanns, M. Rettelbach, T. Weiss, "Formal Characterisation of Immediate Actions in SPAwith Nondeterministic Branching", in [33], pp. 530-541 [18] J. Hillston, "A Compositional Approach to Performance Modelling", Ph.D. Thesis, Universityof Edinburgh (UK), 1994 [19] J. Hillston, "The Nature of Synchronisation", in [32], pp. 51-70[20] C.A.R. Hoare, "Communicating Sequential Processes", Prentice Hall, 1985 UBLCS-96-17 38 REFERENCES [21] C.-C. Jou, S.A. Smolka, "Equivalences, Congruences, and Complete Axiomatizations for Prob-abilistic Processes", in Proc. of the 1st Int. Conf. on Concurrency Theory (CONCUR '90), LNCS 458:367-383, Amsterdam (The Netherlands), 1990[22] L. Kleinrock, "Queueing Systems", John Wiley & Sons, 1975 [23] K.G. Larsen, A. Skou, "Bisimulation through Probabilistic Testing", in Information and Com-putation 94(1):1-28, 1991 [24] D. Lehmann, M. Rabin, "On the Advantage of Free Choice: A Symmetric and Fully DistributedSolution to the Dining Philosophers Problem", in Proc. of POPL '81, pages 133-138, 1981 [25] C. Miguel, A. Fernandez, L. Vidaller, "LOTOS Extended with Probabilistic Behaviours", inFormal Aspects of Computing 5:253-281, 1993 [26] R. Milner, "Communication and Concurrency", Prentice Hall, 1989[27] M.F. Neuts, "Matrix-Geometric Solutions in Stochastic Models - An Algorithmic Approach", John Hopkins University Press, 1981[28] X. Nicollin, J. Sifakis, "An Overview and Synthesis on Timed Process Algebras", in Proc. of the 3rd Workshop on Computer Aided Verification (CAV '91), LNCS 575:376-398, Alborg(Denmark), 1991 [29] R. Paige, R.E. Tarjan, "Three Partition Refinement Algorithms", in SIAM Journal of Comput-ing 16(6):973-989, 1987 [30] D. Park, "Concurrency and Automata on Infinite Sequences", in Proc. of the 5th GI-Conf. onTheoretical Computer Science, LNCS 104:167-183, 1981 [31] Proc. of the 1st Workshop on Process Algebras and Performance Modelling (PAPM '93), J. Hillstonand F. Moller editors, Edinburgh (UK), 1993 [32] Proc. of the 2nd Workshop on Process Algebras and Performance Modelling (PAPM '94), U. Herzogand M. Rettelbach editors, Erlangen (Germany), 1994 [33] Proc. of the 3rd Workshop on Process Algebras and Performance Modelling (PAPM '95), S. Gilmoreand J. Hillston editors, Computer Journal 38(7), Edinburgh (UK), 1995 [34] Proc. of the 4th Workshop on Process Algebras and Performance Modelling (PAPM '96), M. Rib-audo editor, CLUT, Torino (Italy), 1996 [35] M. Rettelbach, "Probabilistic Branching in Markovian Process Algebras", in [33], pp. 590-599[36] K. Seidel, "Probabilistic Communicating Processes", in Theoretical Computer Science 152:219- 249, 1995[37] P. Schweitzer, "Aggregation Methods for Large Markov Chains", in Mathematical Computer Performance and Reliability, pp. 275-286, North Holland, 1984[38] R. Segala, "Modeling and Verification of Randomized Distributed Real-Time Systems", Ph.D. Thesis, MIT, 1995[39] S.A. Smolka, B. Steffen, "Priority as Extremal Probability", in Proc. of the 1st Int. Conf. on Concurrency Theory (CONCUR '90), LNCS 458:456-466, Amsterdam (The Netherlands),1990 [40] C. Tofts, "Processes with Probabilities, Priority and Time", in Formal Aspects of Comput-ing 6:536-564, 1994 UBLCS-96-17 39