A Framework to Decompose GSPN Modes Leonardo Brenner, Pauo Fernandes, Afonso Saes, and Thais Webber Pontifícia Universidade Catóica do Rio Grande do Su, Av. Ipiranga, 6681 90619-900 Porto Aegre, Brazi {brenner, pauof, asaes, twebber}@inf.pucrs.br Abstract. This paper presents a framework to decompose a singe GSPN mode into a set of sma interacting modes. This decomposition technique can be appied to any GSPN mode with a finite set of tangibe markings and a generaized tensor agebra (Kronecker) representation can be produced automaticay. The numerica impact of a the possibe decompositions obtained by our technique is discussed. To do so we draw the comparison of the resuts for some practica exampes. Finay, we present a the computationa gains achieved by our technique, as we as the future extensions of this concept for other structured formaisms. 1 Introduction It is common knowedge in the research community the advantages in using the GSPN (Generaized Stochastic Petri Nets) formaism [2] to mode compex systems, i.e., systems with both parae and synchronous behavior. For a quite ong time, the main imitation to use the GSPN formaism was the absence of an efficient numerica support to hande usefu, and consequenty arge, modes. Ciardo and Trivedi s work [14] brought a first approach that coud be empoyed to decompose a singe mode into components. However, their approach does not mention any specific storage or numericay suitabe soution technique. The need of a theoretica too to represent such structured modes naturay eads to Tensor Agebra representations [4, 8, 3, 15]. The term Tensor Agebra is being empoyed in this paper, but many authors sti prefer the cassic denomination Kronecker Agebra chosen in honor of Leopod Kronecker. The first compete approaches in this direction were the works of Donatei in the SGSPN (Superposed GSPN ) formaism [16, 17]. By compete, we understand that it was proposed a compete framework to: construct a SGSPN mode by assembing synchronized components; generate a Markovian descriptor, i.e., a tensor agebra formua, as the infinitesima generator of the equivaent Markov chain; and consequenty an efficient way to sove it (functiona eements). However, the SGSPN formaism coud ony be used to mode a rather sma cass of GSPN modes which compy to the restrictive rues of generation defined by This work was partiay funded by CNPq/Brazi. Corresponding author. The order of authors is merey aphabetica. G. Ciardo and P. Darondeau (Eds.): ICATPN 2005, LNCS 3536, pp. 128 147, 2005. c Springer-Verag Berin Heideberg 2005
A Framework to Decompose GSPN Modes 129 Donatei, i.e., a SGSPN mode is composed of a set of standard GSPN modes which interact ony through a set of synchronized transitions. The SGSPN appication scope restriction, and the consequent disadvantages in terms of numerica performance, suggests the use of other formaisms that coud be coser to the tensor representation, such as SAN (Stochastic Automata Networks) [26]. At this time, the soution through the shuffe agorithm used in SAN [18, 7] presents an efficient soution with reasonabe memory needs. Evidenty, the use of other structured storage and soution techniques instead of the tensor agebra aso presents good aternatives to the imited scope of the SGSPN formaism. This is the case of the quite impressive techniques based on MDD (Muti-vaued Decision Diagrams) [22]andMxD (Matrix Diagrams) [21] proposed by Ciardo and Miner. Furthermore, the MDD and MxD techniques are very efficient to sove very sparse modes, i.e., modes with a huge product state space and a comparativey sma number of reachabe states. In fact, we beieve that the techniques based on tensor agebra are sti worthy, at east considering the new improvements to hande tensor structures [5, 10]. This paper presents a study about the decomposition of a very genera cass of GSPN modes, expoiting the description power of the GSPN formaism. It aso proposes a memory efficient tensor agebra format to describe the components and their interactions. As the first step, we formay define the cass of GSPN modes in which our technique can be appied. The proposed decomposition technique and the consequent tensor format representation are generaizations of the SGSPN formaism [17], but we extend the appication scope foowing the ideas firsty advanced in [14] and empoyed ater in [20]. The new contribution of our work is justified by the numerica impact of the decomposition choices on the storage demands. We are specificay interested to hande modes with a reay arge reachabe state space. Buchhoz, Ciardo, Donatei, Kemper, and Miner [9, 23, 11] aready present very efficient methods to dea with absoutey huge modes (e.g., 9.18 10 626 states in 1000 dining phiosophers exampe [22]), but with consideraby fewer reachabe states. Our decomposition technique intends to spit a GSPN mode into subnets providing a structured representation. Regardess the number of subnets, we wi aways have the same reachabe state space. With many (sma) subnets, we have a very structured (and therefore memory efficient) representation, but aso a product state space much arger than the reachabe state space. With few (arge) subnets, we have a ess structured representation, but a product state space equa or a itte bit arger than the reachabe state space. In fact, we intend to compare possibe decompositions in order to show the trade off between many sma and few arge subnets. In addition, we point out the underestimated benefits of the use of guards in the GSPN formaism, which can be ceary demonstrated by the tensor format proposed in our work. We do not pay much attention in this paper to the computationa cost to sove the tensor representations. The recent evoutions in pure tensor soutions [5, 10], the promising ideas of parae impementations, and the MDD and MxD techniques [12] suggest many changes in the computationa
130 L. Brenner et a. cost in a near future. We focus our interest in the memory savings due to our decomposition techniques and the corresponding tensor format. The next section briefy presents the theoretica too used to the tensor representation: Cassica (CTA) and Generaized Tensor Agebra (GTA). Section 3 describes the GSPN formaism, the appication scope of our technique and the scope of the technique proposed for SGSPN. Section 4 presents our decomposition technique and the corresponding tensor format. Section 5 draws some considerations about the possibe choices of decomposition. Section 6 presents some modeing exampes in order to discuss numerica issues about the decomposition technique. Finay, the concusion summarizes our contribution and suggests the sti vast future work to be done. 2 Tensor Agebra In this section, the concepts of Cassica Tensor Agebra [3, 15] and Generaized Tensor Agebra [25, 18] are briefy presented. 2.1 CTA - Cassica Tensor Agebra The tensor product of two matrices: A of dimensions (ρ 1 γ 1 )andb of dimensions (ρ 2 γ 2 ) is a tensor with dimensions (ρ 1 ρ 2 γ 1 γ 2 ) which may be considered as consisting of ρ 1 γ 1 bocks each having dimensions (ρ 2 γ 2 ), i.e., the dimensions of B. To specify a particuar eement, it suffices to specify the bock in which the eement occurs and the position within that bock of the eement under consideration. Thus, as mentioned previousy, eement c 36 (a 11 b 02 ) is in the (1, 1) bock and at position (0, 2) of that bock. The tensor C = A B is defined by assigning to the eement of C that is in the (k, ) position of bock (i, j), the vaue a ij b k, i.e., c [ik][j] = a ij b k.thetensor sum of two square matrices A and B is defined in terms of tensor products as: A B = A I nb + I na B where n A is the order of A; n B is the order of B; I ni is the identity matrix of order n i ; and + represents the usua operation of matrix addition. Since both sides of this operation (matrix addition) must have identica dimensions, it foows that tensor addition is defined for square matrices ony. The vaue assigned to the eement c [ik][j] of the tensor C = A B is c [ik][j] = a ij δ k + b k δ ij, where δ ij is the eement of i th row and j th coumn of an identity matrix defined as δ ij =1 for i = j and δ ij =0fori j. 2.2 GTA - Generaized Tensor Agebra Generaized Tensor Agebra is an extension of Cassica Tensor Agebra. The main distinction of GTA with respect to CTA is the addition of the concept of functiona eements. However, a matrix can be composed of constant eements
A Framework to Decompose GSPN Modes 131 (beonging to R) or functiona eements. A functiona eement is a function evauated in R according to a set of parameters composed of the rows of one or more matrices. Generaized tensor product is denoted by. The vaue assigned g to the eement c [ik][j] of the tensor C = A(B) B(A) isc [ik][j] = a ij (b k )b k (a i ). g Generaized tensor sum is aso anaogous to the ordinary tensor sum, and is denoted by. The eements of the tensor C = A(B) B(A) arec [ik][j] = g g a ij (b k )δ k + b k (a i )δ ij. 3 Generaized Stochastic Petri Nets The GSPN formaism [2] is a performance anaysis too on the graphica system representation typica of Petri Nets [27, 24]. The GSPN formaism is derived from the SPN formaism and contains two types of transitions: timed and immediate. An exponentiay distributed random firing time is associated with each timed transition, whereas immediate transitions, by definition, fire in zero time. Immediate transitions aways have precedence to fire over timed transitions. The GSPN modes with immediate transitions can aways be represented by a mode with timed transitions. In the graphica representation of a GSPN mode, paces are drawn as circes, timed transitions as rectanges and immediate transitions as bars. Paces may contains tokens, which are drawn as back dots. A pace is an input to a transition if an arc exists from the pace to the transition. A pace is an output from a transition if an arc exists from the transition to the pace. A transition is enabed when a of its input paces contain at east one token. Enabed transitions can fire, thus removing one token from each input pace and pacing one token in each output pace. Additionay, a condition can be associated to enabe the firing of the transitions. Such conditions are caed guards and, with the avaiabiity of tokens in the input paces, they are the ony restrictions to enabe the firing of a given transition. A forma description is presented as foows. Let C set of conditions associated to transitions of T. Definition 1. A GSPN is defined by tupe (P, T, π, I, O, W, G, M 0 ), where: 1.1. P non-empty set of paces; 1.2. T non-empty set of transitions; 1.3. π: T {0, 1} priority function of the transitions; 1.4. I and O: T P input and output functions of the transitions; 1.5. W : T R + function that assigns a rate to each transition; 1.6. G: T C function, caed guard, that associates a necessary, but not sufficient, condition c C to the firing of each transition t T; 1.7. M 0 : P N initia marking in each pace.
132 L. Brenner et a. Definition 2. c Cis a condition that may be associated to a transition t T, which depends on tokens of one or more p P. This condition is a function with domain on tokens of a paces p and counter-domain on R. A condition c defines the firing rate of a transition according to the number of tokens in a specific set of paces. Athough the counter-domain of c is R, ony a discrete set of vaues can be obtained, since the possibe combination of markings of paces (i.e., the domain of c) is a discrete set. Definition 3. Set of timed transitions T T of a GSPN is defined as T T = {t T π(t) =0}. Definition 4. Set of immediate transitions T I of a GSPN is defined as T I = {t T π(t) =1}. Definition 5. Set of transitions T of a GSPN is defined as T = T T T I and T T T I =. Numerica Soution Restriction. Athough the framework proposed in this paper coud be appied to a arger cass of GSPN modes, we assume a singe restriction in order to faciitate the stationary or transient numerica soution: the set of tangibe markings of the modes must be finite. 4 Framework We present in this section a framework to decompose GSPN modes. Our decomposition technique is shown in Fig. 1. The basic idea is to decompose a GSPN mode into N components GSPN (i) (i [1..N]), where each component GSPN (i) is viewed as a subsystem of the GSPN mode. A component GSPN (i) may not be a GSPN mode. It is then necessary to know the possibe tangibe markings. This is done by the construction of TRG (i) considering the possibe firing of a transitions imited by: avaiabiity of tokens; guards; and maximum number of tokens in each pace. A component GSPN (i) has an independent behavior (oca transitions) and occasiona interdependencies (synchronized transitions and/or transitions with guards). It is important to notice that there is a strong equivaence between the decomposition of a TRG (i) and the TRG of the whoe GSPN (which is the underying Markov Chain). Nevertheess the computationa cost to obtain the TRG from the composition of a TRG (i) is usuay too high. In fact, the memory needs can be prohibitive as wi be seem in the Section 6. In the next section, we define a component GSPN (i) and its properties. In Section 4.2, we formay present the tensor format (Markovian Descriptor) used to obtain the infinitesima generator Q of a decomposed GSPN mode.
A Framework to Decompose GSPN Modes 133 4.1 Decomposition There is no restriction to decompose a GSPN mode with a finite set of tangibe marking into N components GSPN (i) (i [1..N]). Our technique is ess restrictive than the definition of the SGSPN formaism. Definition 6. Each component GSPN (i) is defined as a GSPN, i.e., it is defined by tupe (P (i), T (i), π (i), I (i), O (i), W (i), G (i), M (i) 0 ), where: 6.1. P (i) non-empty set of paces, such that p (i) P (i) p (i) Pand N i=1 P (i) = P and P (i) = P; 6.2. T (i) non-empty set of transitions, such that t (i) T (i) t (i) T and p I (i) (t) or p O (i) (t) such that p P (i) ; 6.3. π (i) : T (i) {0, 1} priority function of the transitions; 6.4. I (i) and O (i) : T (i) P (i) input and output functions of the transitions in which P (i) denotes a possiby empty set of paces; 6.5. W (i) : T (i) R + function that assigns a rate to each transition; 6.6. G (i) : T (i) Cfunction guard that associates a necessary, but not sufficient, condition c (i) C to the firing of each transition t (i) T (i) ; 6.7. M (i) 0 : P(i) N initia marking in each pace p (i) P (i). It is important to notice that the set of paces P (i) is a subset of P, asweas the set of transitions T (i) is a subset of T. Obviousy, the subset of paces P (i) of a component GSPN (i) cannot be the whoe set of paces P, otherwise there is no decomposition. The same restriction does not appy to T (i), since it can be identica to T. There is no restriction to paces superposition. A pace p Pcanbeinas many subsets of paces P (i) as wanted. Obviousy, the same appies to transitions. The soe restriction regards the immediate transitions that cannot be used to synchronized two or more partitions. However such restriction is a minor discomfort since a GSPN mode can be described by an equivaent SPN (i.e., without immediate transitions) mode. Eements of tupe (P (i), T (i), π (i), I (i), O (i), W (i), G (i), M (i) 0 (i) ) are conservatives, i.e., an eement in component GSPN has the same vaue of the corresponding eement in that origina GSPN, e.g., if t (i) correspond to t, then W (i) (t (i) ) has the same vaue of W (t). 4.2 Tensor Format We now formay present the tensor format (Markovian Descriptor) used to obtain the infinitesima generator Q of a decomposed GSPN mode. As shown in Fig. 1, the decomposition technique uses the concepts of Tangibe Reachabiity Graph and Stochastic State Machine. So we firsty remind the cassica definitions of P-invariants, Reachabiity Set (RS), Tangibe Reachabiity Set (TRS), Tangibe Reachabiity Graph (TRG) and Stochastic State Machine (SSM).
134 L. Brenner et a. GSPN (1) TRG (1) SSM (1) GSPN GSPN (N) TRG (N) SSM (N) Markovian Descriptor Fig. 1. Decomposition technique Let C incidence matrix of a GSPN (dimensions: P T ); eement from row j and coumn k of an incidence matrix. c jk Definition 7. Eements of an incidence matrix C are defined by: 7.1. p j P, t k T +1 if p j O(t k ) c jk = 1 if p j I(t k ) 0 if p j O(t k ) and p j I(t k ) Definition 8. P-invariants of a GSPN are defined by vector soutions σ composed of non-negative integer: 0 and 1, given by equation σc = 0[27], where vaue 1 in i th position of σ means that i th pace of GSPN beongs to the P- invariant. Let PI minima set of P-invariants, where PI = {PI 1, PI 2, }. The scaar product between a P-invariant and any marking M produces a constant. If in a GSPN a paces are covered by P-invariant, the maximum number of tokens in any pace in any reachabe marking is finite, and the net is said to be bounded [1]. Therefore, a GSPN must have a paces covered by P-invariants (a paces are bounded) in order to have a finite set of tangibe markings. We assume a minima set of P-invariants as a set with the smaer number of P-invariants that covers a paces of the whoe net. Let M i (p) number of tokens in pace p in marking M i ; B(PI i ) number of tokens in any P-invariant PI i (bound ); max(p) maximum number of tokens in pace p defined as the minimum B(PI i ) for a PI i, where p PI i ; M k [t>m change from marking M k to M due to the firing of t.
A Framework to Decompose GSPN Modes 135 Definition 9. Reachabiity Set RS (i) (M (i) 0 ) of component GSPN (i) is defined as the smaest set of markings, such that: 9.1. M (i) 0 RS (i) (M (i) 9.2. M (i) RS (i) (M (i) M (i) k 0 ); 0 ),ifandonyif p(i),m (i) (p (i) ) max(p (i) );and RS (i) (M (i) 0 ) and t T(i) such that M (i) [t>m(i) Definition 10. Tangibe Reachabiity Set TRS (i) (M (i) (i) 0 ) of component GSPN is composed of a tangibe markings of RS (i) (M (i) 0 ). Definition 11. Tangibe Reachabiity Graph TRG (i) (M (i) 0 ) of component GSPN (i) given an initia marking M (i) 0 is a abeed directed mutigraph whose set of nodes TM (i) is composed of markings of Tangibe Reachabiity Set TRS (i) (M (i) 0 ) and whose set of arcs TARC(i) is defined as foows: 11.1. TARC (i) TRS (i) (M (i) 0 ) T RS(i) (M (i) (i) (i) 0 ) T T T I ; 11.2. a (i) =[M (i) k,m(i),t 0,σ] TARC (i),ifandonyif M (i) k [t 0 >M (i) 1,σ = t 1,,t n, (n 0); and 11.3. M (i) 2,,M(i) n such that M (i) 1 [t 1 >M (i) 2 [t 2 >M n (i) [t n >M (i) k Definition 12. A Stochastic State Machine (SSM) is defined by tupe (P, T,F,Λ), where: 12.1. P set of non-empty paces; 12.2. T set of non-empty transitions; 12.3. F ((P T) (T P)) with dom(f ) codom(f )=P T is the fow reation. It has to satisfy the foowing restriction 1 : t T: t = t =1; 12.4. Λ : T R +,whereλ(t) is the rate of the exponentia probabiity distribution associated to transition t. A decomposed GSPN mode has N components GSPN (i), where i [1..N]. Each component GSPN (i) has a tangibe reachabiity graph TRG (i) (Definition 12). Each tangibe reachabiity graph TRG (i) has an equivaent stochastic state machine SSM (i) such that: 1. Each node M (i) j TM (i) corresponds to p (i) P (i) of SSM (i) ; 2. Each arc a (i) TARC (i) corresponds to [p (i),t (i) ] F (i) and [t (i),q (i) ] F (i), if and ony if exist a (i) =[M (i) k to pace p (i) P (i), M (i) σ T (i) I.,M(i).,t,σ] such that M (i) k. corresponds,and corresponds to pace q (i) P (i), t T (i) T 1 t and t indicate the number of input and output paces of t.
136 L. Brenner et a. The transition rate of t (i) T (i) (obtained from [M (i) k,m(i),t,σ]) can be computed as Λ(t).Λ(σ) 2, where Λ(t) is the transition rate of t. Any transition t (i) T (i), whose guard has dependency on markings of other components GSPN (j) (i, j [1..N] andi j), has a function f mutipied by its rate. Function f is evauated as true for a markings whose its guard is satisfied, and fase otherwise. So we can now cassify a transition as oca or synchronized. Let T (i) set of oca transitions of component SSM (i) ; T s (i) set of synchronized transitions of component SSM (i). Definition 13. Set of synchronized transitions T s of a decomposed GSPN mode is defined as T s = T s (1) T s (2) T s (N). Markovian Descriptor is an agebraic formua that aows to store, in a compact form, the infinitesima generator of an equivaent Markov chain. This mathematica formua describes the infinitesima generator through the transition tensors of each component. Each component SSM (i) has associated: 1 tensor, which has a transition rates for oca transitions in T (i) ; 2 T s tensors t and + t, which have a transition rates for synchronized transitions in T (i) s. Let k (p(i),q (i) ) tensor eement k from row p (i) and coumn q (i), where i [1..N] andk {, t +,t }; I P (i) identity tensor of order P (i), where i [1..N]; τ t (p (i),q (i) ) occurrence rate of transition t T (i), where [p (i),t] F (i) and [t, q (i) ] F (i) ; succ t (p (i) ) successor pace q (i) such that [p (i),t] F (i) and [t, q (i) ] F (i). Definition 14. Tensor eements, which represent a oca transitions t of component SSM (i), are defined by: T (i) 14.1. p (i),q (i) P (i) such that q (i) succ t (p (i) ) and p (i) q (i) (p (i),q (i) )= τ t (p (i),q (i) ); t T (i) 14.2. p (i) P (i) such that q (i) succ t (p (i) ) (p (i),p (i) )= τ t (p (i),q (i) ); t T (i) 2 See [1] for the computation of Λ(σ) (sequence of immediate transitions).
A Framework to Decompose GSPN Modes 137 14.3. p (i),q (i) P (i) such that q (i) succ t (p (i) ) and p (i) q (i) (p (i),q (i) )=0. Let η (t) ι (t) set of indices i (i [1..N]) such that component SSM (i) has at east one transition t T (i) ; index of the component SSM which has the transition rate of synchronized transition t T s, where ι (t) [1..N]. Actuay a transition t can be viewed as oca transition if η (t) = 1 or as synchronized transition if η (t) > 1. Definition 15. Tensor eements t, which represent the occurrence of synchronized transition t T s (i), are defined by: + 15.1. i η (t) t = I + P ; (i) 15.2. p (ι(t)),q (ι(t)) P (ι(t)) such that q (ι(t)) succ t (p (ι(t)) ) Q (ι(t) ) t (p (ι(t)),q (ι(t)) )=τ + t (p (ι(t)),q (ι(t)) ); 15.3. i η (t) such that i ι (t), p (i),q (i) P (i) such that q (i) succ t (p (i) ) t (p (i),q (i) )=1; + 15.4. i η (t), p (i),q (i) P (i) such that q (i) succ t (p (i) ) t (p (i),q (i) )=0. + Definition 16. Tensor eements t, which represent the adjustment of synchronized transition t T s (i), are defined by: 16.1. i η (t) t = I P ; (i) 16.2. p (ι(t)) P (ι(t) ) Q (ι(t) ) t (p (ι(t)),p (ι(t)) )= { 0 if q (ι(t)) succ t (p (ι(t)) ) τ t (p (ι(t)),q (ι(t)) ) if q (ι(t)) succ t (p (ι(t)) ) 16.3. i η (t), i ι (t) { and p (i) P (i) t (p (i),p (i) 0 if q (i) succ t (p (i) ) )= 1 if q (i) succ t (p (i) ) 16.4. i η (t), p (i),q (i) P (i) and p (i) q (i) t (p (i),q (i) )=0. Definition 17. Infinitesima generator Q corresponding to the Markov chain associated to a decomposed GSPN mode is represented by tensor formua caed Markovian Descriptor: Q = N g i=1 + t T s N g i=1 t + + N g i=1 t (1)
138 L. Brenner et a. Once a tensor sum is equivaent to a sum of particuar product tensors, the Markovian Descriptor may be represented as: Q = (N+2 T s ) j=1 where j = N g i=1 j, (2) I P (i) t + (j N) t (j (N+ Ts )) if j N and j i if j N and j = i if N<j (N+ T s ) if j>(n+ T s ) 5 Choosing a Decomposition In this section, we present severa approaches to decompose a GSPN mode. We show the necessary steps to obtain a components SSM. Afterwards, we comment about the side effect of guards and its consequences. Fig. 2 presents an exampe of a GSPN mode. Based on this mode, we show our decomposition technique appied in three different approaches. For a the possibe decomposition approaches, the demonstration in Section 4.2 can be used to obtain the equivaent tensor agebra representation automaticay. 5.1 Decomposing by Paces Firsty, we anayse a quite naive approach, which is based on decomposing a GSPN mode by paces. Each pace has a maximum number of tokens K, and so we can view each pace as a SSM with K + 1 states. A decomposed GSPN mode by paces of Fig. 2 is presented in Fig. 3. Each component SSM (i) represents the possibe states of pace p i of a GSPN mode. Note that paces p 2 and p 5 in Fig. 2 are 2-bounded, i.e., there are no P 1 t 1 P 2 P 3 P 4 t 2 t 4 P 5 P 6 P 7 t 5 Fig. 2. An exampe of a GSPN mode
A Framework to Decompose GSPN Modes 139 SSM (1) SSM (2) 0 1 0 t 1 t 5 t 2 1 SSM (3) SSM (4) t 2 0 0 t 1 t 4 t 1 2 1 1 SSM (5) SSM (6) SSM (7) t 2 0 0 0 t 5 t 5 t 4 t 2 1 1 1 2 Fig. 3. Decomposed GSPN mode by paces more than 2 tokens in each pace in any marking M RS. Hence SSM (2) and SSM (5) have three paces which represent the states (0, 1 and 2) of paces p 2 and p 5 respectivey. Anaogousy, paces p 1, p 3, p 4, p 6,andp 7 are 1-bounded. So SSM (1), SSM (3), SSM (4), SSM (6), and SSM (7) have two states (0 and 1). 5.2 Decomposing by P-Invariants Other decomposition of GSPN modes is based on P-invariants. A P-invariant is composed of a set of paces with constant token count. Fig. 4 presents a decomposed mode of Fig. 2 using the P-invariants concept. There are three minima soutions of σ given by equation σc =0(seeDefinition 8). So we can define three P-invariants to GSPN mode of Fig. 2. PI 1 has two paces (p 2 and p 5 ), PI 2 has three paces (p 1, p 3 and p 6 ), and PI 3 aso has three paces (p 1, p 4 and p 7 ). SSM (1) SSM (2) SSM (3) t 2 t 1 t 1 t 2 t 4 t 5 t 5 Fig. 4. Decomposed GSPN mode by P-invariants
140 L. Brenner et a. Each PI i corresponds to a component SSM (i) of the GSPN mode. So, in this exampe, we can decompose the GSPN mode in three components SSM. It is important to note that, besides the transition superposition, there is a pace superposition between components SSM (2) and SSM (3). 5.3 Decomposing as Superposed GSPN Another possibe approach to decompose a GSPN mode is through transition superposition proposed by Donatei [17]. Donatei proposed the SGSPN formaism in which components (subsystems) interact each other through transition superposition. Exampe of Fig. 2 can be decomposed by SGSPN, since there is a transition which synchronizes two components GSPN. Component GSPN (1) is composed of two paces (p 2 and p 5 ), whereas component GSPN (2) is composed of five paces (p 1, p 3, p 4, p 6,andp 7 ). Once defined the components GSPN (i), it is possibe to obtain the equivaent components SSM (i). Fig. 5 presents the equivaent components SSM of the GSPN mode (Fig. 2). SSM (2) SSM (1) t 1 t 2 t 4 t 2 t 4 t 5 Fig. 5. Decomposed GSPN mode by SGSPN 5.4 Decomposing Arbitrariy It is aso possibe to decompose a GSPN mode according to an arbitrariy chosen semantic. We can decompose the GSPN mode of Fig. 2 as foows: markings of paces p 1, p 2, p 3,andp 4, as we as markings of paces p 5, p 6,andp 7. Hence component SSM (1) is obtained from distinct markings of paces p 1, p 2, p 3,and p 4 of TRG, and component SSM (2) is aso obtained from distinct markings of paces p 5, p 6,andp 7 of TRG. Note that the decomposition choice may priviege some features of the tensor format which is important to the soution method. In some cases, it may be important to decompose a GSPN mode considering: a arge or sma number of components SSM; a sma number of reachabe states; or even the difference between reachabe and unreachabe states.
A Framework to Decompose GSPN Modes 141 5.5 Side Effect of Guards The concept of guards in the GSPN formaism aows transition firing dependency according to the number of tokens in each pace. Guards in GSPN are quite simiar to functiona eements in the SAN formaism [26, 18]. A natura decomposition among components GSPN of a GSPN mode can be viewed through the use of guards. Therefore, guards in the GSPN modes can aow to produce disconnected GSPN modes, which have synchronization through the guards on theirs transitions. As shown in Section 4.2, tensor format (Markovian Descriptor) of a decomposed GSPN mode uses generaized tensor sum and products. GTA operators in the Markovian descriptor are used to represent the functiona rates of transitions, but as ong as there are no guards defined to transitions, they can be cassica tensor products. Hence, guards on transitions are evauated in Markovian Descriptor by GTA operators. Another consequence of the use of guards is the possibiity to define GSPN modes with disconnected parts, i.e., modes where there is not ony a singe net, but two or more nets with no arcs connecting them. In this case, there must be guards referring to paces of other components in order to estabish an interdependency (not a synchronization) among parts. The ast exampe (Section 6.3) shows a net with disconnected parts and the use of guards to estabish the interdependency. 6 Modeing Exampes We now present three modeing exampes in order to present the approaches discussed in the previous section. The first one presents a Structured mode, the second one describes a Simutaneous Synchronized Tasks mode, whereas the ast one shows a Resource Sharing mode. 6.1 Structured Mode Fig. 6 presents an exampe of a Structured mode composed of four submodes. The submode i is composed of four paces (p ai, p bi, p ci, p di ) and two oca transitions. There are aso four synchronized transitions responsibe for the synchronization of the submodes. It is important to observe that guards were chosen to define the possibe firing sequence of transitions. This mode was introduced by Miner [20]. In this mode, the decomposition by paces is rather catastrophic, since there is a correation among marking of paces. It resuts in a quite arge product state space (65, 536 states) for a rather sma reachabe state space (ony 486 states). According to the SGSPN and P-invariants approaches, we have exacty the same decomposition and a more reasonabe product state space (1, 296 states). As a genera concusion one may discard the decomposition by paces approach, but this is not reay a fair concusion, since this mode is quite particuar. Modes
142 L. Brenner et a. p a1 t a1 p b1 p a2 t a2 p b2 t d1 p d1 1 4 p c1 p d2 p c2 t synch41 t synch23 p a4 p b4 p a3 p b3 t d4 t synch12 t synch34 p t c4 d4 p p t c3 c4 d3 2 3 t b2 t b3 p c3 Guards g a1 =(tk(p b1 )==0) g d1 =(tk(p a1 )==0) g a2 =(tk(p b2 )==0) g b2 =(tk(p c2 )==0) g b3 =(tk(p c3 )==0) g c3 =(tk(p d3 )==0) g c4 =(tk(p d4 )==0) g d4 =(tk(p a4 )==0) g 12 =((tk(p c1 ) == 0)&(tk(p a2 )==0)) g 23 =((tk(p d2 ) == 0)&(tk(p b3 ) == 0)) g 34 =((tk(p a3 ) == 0)&(tk(p c4 )==0)) g 41 =((tk(p d1 ) == 0)&(tk(p b4 ) == 0)) Fig. 6. Exampe of a structured mode with paces with a arger bound (nets with more tokens) may be more interesting, as the next exampe wi demonstrate. 6.2 Simutaneous Synchronized Tasks Fig. 7 describes a Simutaneous Synchronized Tasks (SST) mode in which five tasks are modeed. Such tasks have synchronization behavior among them, and those synchronization behaviors occur in different eves of the task execution. t 0 P 0 N t 1 P 1 P 5 P 9 t 2 t 5 t 8 P 2 P 6 P 7 P 10 t 6 t 9 P 3 P8 P 11 P 13 t 4 t 7 t 10 P 4 P 12 P 14 P15 t 11 P 16 Fig. 7. Simutaneous Synchronized Tasks
1 3 9 A Framework to Decompose GSPN Modes 143 Tabe 1. Indices of decomposed SST modes N approach #SSM SSM sizes pss rss mem 10 20 21 27 Paces 17 (2 2 2 2) 1.31 10 5 98 1KB P-Inv 6 (5 5 5 5 5 2) 6.25 10 3 98 1KB SGSPN 2 (49 2) 9.80 10 1 98 1KB Paces 17 (4 4 2 2) 4.29 10 9 12, 100 2KB P-Inv 6 (35 35 35 35 35 2) 1.05 10 8 12, 100 7KB SGSPN 2 (6, 050 2) 1.21 10 4 12, 100 236 KB Paces 17 (10 10 2 2) 4.00 10 15 22, 391, 512 6KB P-Inv 6 (715 715 2) 3.74 10 14 22, 391, 512 201 KB SGSPN 2 (11, 195, 756 2) 2.24 10 7 22, 391, 512 672 MB Paces 17 (11 11 2 2) 1.67 10 16 51, 887, 550 6KB P-Inv 6 (1, 001 1, 001 2) 2.01 10 15 51, 887, 550 288 KB SGSPN 2 (25, 943, 775 2) 5.19 10 7 51, 887, 550 - Paces 17 (21 21 2 2) 2.72 10 20 18, 994, 747, 662 12 KB P-Inv 6 (10, 626 10, 626 2) 2.71 10 20 18, 994, 747, 662 3MB SGSPN 2 (9, 497, 373, 831 2) 1.90 10 10 18, 994, 747, 662 - Paces 17 (22 22 2 2) 5.48 10 20 29, 368, 986, 350 13 KB P-Inv 6 (12, 650 12, 650 2) 6.48 10 20 29, 368, 986, 350 4MB SGSPN 2 (14, 684, 493, 175 2) 2.94 10 10 29, 368, 986, 350 - Paces 17 (28 28 2 2) 2.04 10 22 286, 448, 238, 746 16 KB P-Inv 6 (31, 465 31, 465 2) 6.17 10 22 286, 448, 238, 746 10 MB SGSPN 2 (143, 224, 119, 373 2) 2.86 10 11 286, 448, 238, 746 - Tabe 1 presents some indices to compare the decomposition aternatives. In this exampe, we use the foowing approaches: decomposing by Paces (Section 5.1), decomposing by P-invariants (Section 5.2) and decomposing by Superposed GSPN (Section 5.3). N represents the number of tokens in pace P 0. The number of SSM components, decomposed by a approaches, is indicated by #SSM. SSM sizes represents the number of states in each component SSM. Product State Space, Reachabe State Space, and memory needs to store the Markovian Descriptor 3 of the mode are denoted by pss, rss, andmem respectivey. The first important phenomenon to observe in Tabe 1 is the increasing gains of the P-invariant and Paces approaches achieved to modes with arge N vaues. For sma N vaues, there is much waste in the product state space that is not significant compared to the memory savings, speciay for the Paces approach. Regarding the comparison between SGSPN and P-invariant approaches, the mode with N = 9 is a turning point, since the memory savings are aready quite significant. In fact, arger modes coud not even be generated using the SGSPN decomposition. The reationship between product and reachabe state space for 3 We do not take into account the memory needs to store neither the probabiity vector to compute soution, nor any specia structure to represent the reachabe state space.
144 L. Brenner et a. decomposition based on P-invariants is consideraby arge, but we beieve that an optimized soution for modes with sparse reachabe state space coud take great advantage from this decomposition approach. The second very impressive resuts taken from Tabe 1 is the very consistent gains of the Paces approach. Even though the product state space waste is consideraby arge for smaer modes (roughy one or two orders of magnitude), the difference between the product state space for the P-invariant and Paces approaches becomes insignificant for the N = 20 mode. Taking the mode to its imits (N = 21 to 27) we observe an inversion, since the Paces approach has a smaer product state space than the P-invariant approach. 6.3 Resource Sharing Fig. 8 (a) shows a traditiona exampe of a Resource Sharing (RS) mode, which has N process sharing R resources. Each process i is composed of two paces: S i (seeping) andu i (using). Tokens in pace RS represent the number of avaiabe resources, whereas they represent the number of using resources in pace RU. Fig. 8 (b) is an equivaent mode in which guards impose a restriction to the firing of each transition ta i. S1 SN RS R S 1 S N ta1 U1 tan UN RU ta 1 U 1 ta N U N Guards ga 1 =((tk(u 1)+ + tk(u N)) <R)... ga N =((tk(u 1)+ + tk(u N)) <R) tr1 trn (a) tr 1 (b) tr N Fig. 8. (a) Resource Sharing without guards - (b) Resource Sharing with guards Tabe 2 shows some indices to compare the use of guards in a GSPN mode producing, in this case, an equivaent disconnected mode. The indices for the mode of Fig. 8 (a) are shown in the without guards rows, whereas indices for the mode of Fig. 8 (b) are presented in the with guards rows. R indicates the number of tokens in pace RS of Fig. 8 (a), as we as the number of avaiabe resources in the mode of Fig. 8 (b). The computationa cost (number of mutipications) to evauate the product of a probabiity vector by the Markovian Descriptor 4, the memory needs and the CPU time to perform one singe power iteraction are denoted by c.c., mem and time respectivey. The numerica resuts for those 4 The vector-descriptor mutipication is the basic operation for most of the iterative soutions, e.g., Power method, Uniformization [28].
1 3 9 A Framework to Decompose GSPN Modes 145 Tabe 2. IndicesofdecomposedRSmodes(N =16) R mode #SSM SSM sizes pss rss c.c. mem time without guards 17 (2 2 2) 131, 072 17 1.34 10 8 6KB0.33 s with guards 16 (2 2) 65, 536 17 2.10 10 6 1KB0.45 s without guards 17 (2 2 4) 262, 144 697 2.73 10 8 8KB0.71 s with guards 16 (2 2) 65, 536 697 2.10 10 6 1KB0.49 s without guards 17 (2 2 10) 655, 360 50, 643 6.88 10 8 14 KB 1.81 s with guards 16 (2 2) 65, 536 50, 643 2.10 10 6 1KB0.53 s 15 without guards 17 (2 2 16) 1, 048, 576 65, 535 1.10 109 20 KB 3.07 s with guards 16 (2 2) 65, 536 65, 535 2.10 10 6 1KB0.53 s exampes were obtained on a 2.8 GHz Pentium IV Xeon under Linux operating system with 2 GBytes of memory. The resuts in Tabe 2 show the decomposition based on P-invariants, since decomposition based on SGSPN coud ony be appied to the without guards mode. Observe that SGSPN approach woud resut in exacty the same decomposition as P-invariants. The main concusion observing this tabe is the absoute gains represented by the use of guards. It resuts in a mode which has the same product state space independenty from the number of resources, as we as the pss sizes are aways smaer than those in the without guards modes. It aso has a smaer memory need and a more efficient soution (smaer computationa cost). It is a common mistake in some segments of the research community to assume that a mode which requires functiona evauations (GTA operators) has a bigger CPU time to perform vector-descriptor mutipication than equivaent modes described ony with CTA operators. In fact, such use of guards gives to this GSPN mode an efficiency as good as the one achieved by an equivaent SAN mode [7]. Obviousy, it happens due to the Markovian Descriptor representation using GTA. 7 Concusion The main contribution of this paper is to foow up the pioneer works of Ciardo and Trivedi [14], Donatei [17], and Miner [20]. Our starting point is the assumption that for reay arge (and therefore structured) modes the main difficuty is the storage of the infinitesima generator. The soution techniques are rapidy evoving and many improvements, probaby based on efficient parae soutions, wi soon enough be avaiabe. Using this assumption, we do beieve that the tensor format based on Generaized Tensor Agebra has an important roe to pay. For the moment, it benefits the Stochastic Automata Networks and it can aso be appied to Generaized Stochastic Petri Nets. A natura future theoretica work is to expand those gains to other formaisms, such as PEPANETs [19]. A more immediate future work woud be the integration of this decompo-
146 L. Brenner et a. sition anaysis to the sovers for SAN and GSPN (PEPS [6] and SMART [13] software toos respectivey). It is easy to precompute the possibe decomposition with their memory and computationa costs. Therefore, the integration of such precacuation may automaticay suggest the best decomposition approach according to the amount of memory avaiabe. Finay, we woud ike to concude stating that the use of tensor based storage can sti give very interesting resuts and aows the soution (which cannot be done without the storage) of arger and arger modes. References 1. M. Ajmone-Marsan, G. Babo, G. Chioa, G. Conte, S. Donatei, and G. Franceschinis. An Introduction to Generaized Stochastic Petri Nets. Microeectronics and Reiabiity, 31(4):699 725, 1991. 2. M. Ajmone-Marsan, G. Conte, and G. Babo. A Cass of Generaized Stochastic Petri Nets for the Performance Evauation of Mutiprocessor Systems. ACM Transactions on Computer Systems, 2(2):93 122, 1984. 3. V. Amoia, G. De Michei, and M. Santomauro. Computer-Oriented Formuation of Transition-Rate Matrices via Kronecker Agebra. IEEE Transactions on Reiabiity, R-30(2):123 132, 1981. 4. R. Beman. Introduction to Matrix Anaysis. McGraw-Hi, New York, 1960. 5. A. Benoit, L. Brenner, P. Fernandes, and B. Pateau. Aggregation of Stochastic Automata Networks with repicas. Linear Agebra and its Appications, 386:111 136, Juy 2004. 6. A. Benoit, L. Brenner, P. Fernandes, B. Pateau, and W. J. Stewart. The PEPS Software Too. In Computer Performance Evauation / TOOLS 2003, voume 2794 of LNCS, pages 98 115, Urbana, IL, USA, 2003. Springer-Verag Heideberg. 7. L. Brenner, P. Fernandes, and A. Saes. The Need for and the Advantages of Generaized Tensor Agebra for Kronecker Structured Representations. Internationa Journa of Simuation: Systems, Science & Technoogy, 6(3-4):52 60, February 2005. 8. J. W. Brewer. Kronecker Products and Matrix Cacuus in System Theory. IEEE Transactions on Circuits and Systems, CAS-25(9):772 780, 1978. 9. P. Buchhoz, G. Ciardo, S. Donatei, and P. Kemper. Compexity of memoryefficient Kronecker operations with appications to the soution of Markov modes. INFORMS Journa on Computing, 13(3):203 222, 2000. 10. P. Buchhoz and T. Dayar. Bock SOR for Kronecker structured representations. Linear Agebra and its Appications, 386:83 109, Juy 2004. 11. P. Buchhoz and P. Kemper. Hierarchica reachabiity graph generation for Petri nets. Forma Methods in Systems Design, 21(3):281 315, 2002. 12. G. Ciardo, M. Forno, P. L. E. Grieco, and A. S. Miner. Comparing impicit representations of arge CTMCs. In 4 th Internationa Conference on the Numerica Soution of Markov Chains, pages 323 327, Urbana, IL, USA, September 2003. 13. G. Ciardo, R. L. Jones, A. S. Miner, and R. Siminiceanu. SMART: Stochastic Mode Anayzer for Reiabiity and Timing. In Toos of Aachen 2001 Internationa Muticonference on Measurement, Modeing and Evauation of Computer- Communication Systems, pages 29 34, Aachen, Germany, September 2001.
A Framework to Decompose GSPN Modes 147 14. G. Ciardo and K. S. Trivedi. A Decomposition Approach for Stochastic Petri Nets Modes. In Proceedings of the 4 th Internationa Workshop Petri Nets and Performance Modes, pages 74 83, Mebourne, Austraia, December 1991. IEEE Computer Society. 15. M. Davio. Kronecker Products and Shuffe Agebra. IEEE Transactions on Computers, C-30(2):116 125, 1981. 16. S. Donatei. Superposed stochastic automata: a cass of stochastic Petri nets with parae soution and distributed state space. Performance Evauation, 18:21 36, 1993. 17. S. Donatei. Superposed generaized stochastic Petri nets: definition and efficient soution. In R. Vaette, editor, Proceedings of the 15 th Internationa Conference on Appications and Theory of Petri Nets, pages 258 277. Springer-Verag Heideberg, 1994. 18. P. Fernandes, B. Pateau, and W. J. Stewart. Efficient descriptor - Vector mutipication in Stochastic Automata Networks. Journa of the ACM, 45(3):381 414, 1998. 19. J. Histon and L. Kou. An Efficient Kronecker Representation for PEPA modes. In L. de Afaro and S. Gimore, editors, Proceedings of the first joint PAPM-PROBMIV Workshop), pages 120 135, Aachen, Germany, September 2001. Springer-Verag Heideberg. 20. A. S. Miner. Data Structures for the Anaysis of Large Structured Markov Modes. PhD thesis, The Coege of Wiiam and Mary, Wiiamsburg, VA, 2000. 21. A. S. Miner. Efficient soution of GSPNs using Canonica Matrix Diagrams. In 9 th Internationa Workshop on Petri Nets and Performance Modes (PNPM 01), pages 101 110, Aachen, Germany, September 2001. IEEE Computer Society Press. 22. A. S. Miner and G. Ciardo. Efficient Reachabiity Set Generation and Storage Using Decision Diagrams. In Proceedings of the 20 th Internationa Conference on Appications and Theory of Petri Nets, voume 1639 of LNCS, pages 6 25, Wiiamsburg, VA, USA, June 1999. Springer-Verag Heideberg. 23. A. S. Miner, G. Ciardo, and S. Donatei. Using the exact state space of a Markov mode to compute approximate stationary measures. In Proceedings of the 2000 ACM SIGMETRICS Conference on Measurements and Modeing of Computer Systems, pages 207 216, Santa Cara, Caifornia, USA, June 2000. ACM Press. 24. T. Murata. Petri nets: Properties, anaysis and appications. Proceedings of the IEEE, 77(4):541 580, Apri 1989. 25. B. Pateau. On the stochastic structure of paraeism and synchronization modes for distributed agorithms. In Proceedings of the 1985 ACM SIGMETRICS conference on Measurements and Modeing of Computer Systems, pages 147 154, Austin, Texas, USA, 1985. ACM Press. 26. B. Pateau and K. Atif. Stochastic Automata Networks for modeing parae systems. IEEE Transactions on Software Engineering, 17(10):1093 1108, 1991. 27. W. Reisig. Petri nets: an introduction. Springer-Verag Heideberg, 1985. 28. W. J. Stewart. Introduction to the numerica soution of Markov chains. Princeton University Press, 1994.