On state space decomposition for the numerical analysis of stochastic Petri nets
Carlos J. P´erez-Jim´enez and Javier Campos
Dpto. de Inform´atica e Ingenier´ıa de Sistemas, Universidad de Zaragoza Mar´ıa de Luna 3, 50015, Zaragoza, Spain
E-mail: cjperez,[email protected]
Abstract
Net-driven decomposition techniques are considered in this paper in order to reduce the state explosion problem for the computation of performance indices of stochastic Petri nets. Basically, the idea is to represent (or partially rep- resent) in a decomposed manner the reachability graph of the model so it can be used for exact and/or approximated performance analysis. In that way, the complete storing of the graph is avoided and, for the case of approximate analy- sis, the solution of the isomorphous continuous time Markov chain is substituted by the solution of smaller components.
The techniques are applied to a couple of non-trivial mod- els.
1. Introduction
One of the major drawbacks for the use of stochastic Petri nets (SPN’s) [9] in performance evaluation of real sys- tems is probably the state explosion problem. This paper tries to contribute to the solution of that problem propos- ing some ideas and techniques for a net-driven decomposi- tion of the reachability graph (RG) of the original system, leading to the generation of the continuous time Markov chains (CTMC’s) associated to several smaller submodels whose solution can be combined for an approximated per- formance analysis. An iterative response time approxima- tion algorithm is the technique selected here for the combi- nation of the solutions of the (CTMC’s of the) submodels in order to approximate the steady-state throughput of transi- tions (number of firings per time unit) in the original model (provided that such steady-state behaviour exists). How- ever, one of the techniques that will be presented gives an exact decomposed representation of the RG of the original system, therefore it could be useful also for exact perfor- mance analysis.
Previous works in the same direction by the authors and other (co-)authors are [1, 11, 12, 10] in the framework of
This work has been developed within the project TAP98-0679 of the Spanish CICYT.
approximate throughput computation for particular net sub- classes and [2] in the framework of tensor algebra-based exact solution of general SPN’s. Other related work is [4].
We assume that the reader is familiar with concepts and notation of
P=T
nets [6] and SPN’s [9]. The paper is or- ganised as follows. In section 2, we review a decompo- sition technique for general stochastic Petri nets that was proposed and applied to the exact solution of the under- lying CTMC in [2]. For our purpose, that decomposi- tion technique has a main problem: the derived subsys- tems may be non-ergodic (thus, the solution of their un- derlying CTMC’s could make no sense). In section 3, we solve the mentioned problem by presenting a very sim- ple technique to build ergodic CTMC’s from the subsys- tems. Even though that technique allows to compute a (meaningful) solution in all cases, in some situations the result may be not very accurate due to the inclusion of spurious states in the submodels that do not correspond to actual ones in the original system and to the ‘inade- quate aggregation’ of different states of the original sys- tem into the same state in the subsystems. For solving more accurately those cases, we present in section 4 a structured view of the RG of the original model that al- lows to compute and store it in a decomposed manner.In section 4.1, the decomposed representation of the RG is used to eliminate all the spurious states, while in sec- tion 4.2 the aggregation of states not connected by in- ternal transitions is avoided. The structured view of the RG of the original model presented in section 4 is ap- plied here to derive approximated values of throughput but it could be also an alternative technique to the ten- sor algebra-based solution presented in [2] for exact analy- sis, since it is based on the construction of an exact de- composed representation of the RG of the model. In section 5, an iterative response time approximation algo- rithm (similar to that presented in [1]) is explained as well as an example of application to a couple of non-trivial models. Some concluding remarks are stressed in sec- tion 6.
2. Structural decomposition of PN systems and two-level abstract views
In this section, we review a decomposition technique for general PN systems that was proposed in [2] in the framework of tensor algebra-based exact solution of SPN’s.
See [2] for the details.
2.1. Structured view of PN's (net level)
An arbitrary PN system can always be observed as a set of modules (disjoint simpler PN systems) that asynchro- nously communicate by means of a set of buffers (places).
Definition 1 (SAM) [2] A strongly connected PN system,
S=h
P
1[:::
[P
K[B;T
1[:::
[T
K; Pre ; Post ; m
0i, isa System of Asynchronously Communicating Modules, or simply a SAM, if:
1.
P
i\P
j=;for alli;j
2f1;:::;K
gandi
6=j
;2.
T
i\T
j =;for alli;j
2f1;:::;K
gandi
6=j
;3.
P
i\B
=;for alli
2f1;:::;K
g;4.
T
i=P
i[P
ifor alli
2f1;:::;K
g.The net systems hNi
; m
0ii =hP
i;T
i; Pre
i; Post
i; m
0iiwith
i
2 f1;:::;K
g are called modules of S (wherePre
i,Post
i, andm
0i are the restrictions ofPre
,Post
,and
m
0toP
iandT
i). Places inB
are called buffers. Tran- sitions belonging to the setTI=B
[B
are called inter- face transitions. Remaining ones((T
1[:::
[T
K)nTI)arecalled internal transitions.
(a)
P11
B1
B2
B3
B4 P22
P21
P23 P14
P12 P13
I11
I12
I13
I14
I21
I22 T21
T22
I23
I24 T11
T12
H21 H11
(b)
P11
B1
B2
B3
B4 P14
P12 P13
I11
I12
I13
I14
I21
I22
I23
I24 T11
T12
H21 H11
Figure 1. (a) A SAM and (b) its LS1.
A SAM with two modules (the subnets generated by nodes whose tag starts with
P
i orT
ifori
=1;
2) and fourbuffers (
B
1,B
2,B
3,B
4) is depicted in Fig. 1.a.All the strongly connected PN systems belong to the SAM class with the only addition of a structured view of the model (either given by construction or decided after obser- vation of the model). Many structured views are possible, ranging from the extreme consideration of each transition as a different module (all the places being buffers) to consider that the system is a single module (and there are no buffers).
With respect to timing interpretation, we assume that in- dependent, exponentially distributed random variables are associated to the firing of transitions with single-server se- mantics as in classical SPN’s [9]. The techniques presented in this paper can be easily extended to infinite-server se- mantics. We suppose that a unique steady-state behaviour exists to compute steady-state performance indices of the model. Even more, we restrict to structurally live, struc- turally bounded (therefore consistent and conservative) and reversible (therefore ergodic) PN systems.
2.2. Reduction rule and abstract views
In [2], the reduction rule that follows has been intro- duced for the internal behaviour of modules of a SAM.
Each module is decomposed into several pieces and each piece is substituted by a set of new special places called marking structurally implicit places (MSIP’s). Later, using that reduction, the original model can be decomposed into a collection of low level systems (LSi with
i
=1;:::;K
)and a basic skeleton (BS). In eachLSi, only one module is kept while the internal behaviour of the others is reduced.
In [2], the LSi and theBS are used for a tensor algebra- based exact computation of the underlying CTMC. In this paper, we adapt the decomposition for a non-exact but more efficient approximate analysis.
Definition 2 [2] LetS=h
P;T; Pre ; Post ; m
0ibe a SAMwith
P
=P
1[:::
[P
K[B
andT
=T
1[:::
[T
K. Theequivalence relation
R
is defined onP
nB
by:hp;p
0i2R
for
p;p
0 2P
i iff there exists a non-directed pathinNifrom
p
top
0 such that \TI = ;(i.e., containing only internal transitions). Ther
(i
)different equivalence classes defined inP
i withi
= 1;:::;K
by the relationR
are de-noted as
P
ijwithj
=1;:::;r
(i
).The next step is to define and compute the sets of MSIP’s needed for the reduction process.
Definition 3 [5] LetN be a net and
p
be a place with in- cidence vectorl
p =C
[p;
]. The placep
is a MSIP inN if there existsy
0
such thaty
[p
]=0andl
p=y
C
. The setof places ink
y
kare called implying places ofp
(whereky
k,called support of
y
, is the set of non-zero components ofy
).An algorithm for the computation of a set
H
ijof MSIP’sfor each equivalence class
P
ijdefined in a module by means of relationR
was proposed in [2]. The basic idea is to consider all the MSIP’sp
y derived from the minimalP
-semiflowsy
of the subnet induced byP
ij (i.e.,p
y is theplace with incidence vector
l
py =y
C
, wherey
is suchthat
y
C
[P
ij;T
ij]=0; y
0,y
has minimal support).A place is implicit, under interleaving semantics, if it can be deleted without changing the firing sequences. Each MSIP of
H
ij added toN needs an initial marking for mak- ing it implicit. In [5], an efficient method for computing such marking is presented.The next step for the definition of theLSiand theBSis to define an extended system (ES).
Definition 4 [2] LetS=h
P;T; Pre ; Post ; m
0ibe a SAMwith
P
=P
1[:::
[P
K[B
andT
=T
1[:::
[T
K. Theextended systemES is obtained from S by adding all the places in
H
ij,j
=1;:::;r
(i
);i
=1;:::;K
with their inci- dence vectors and the initial marking necessary for making them implicit.Consider, for instance, the SAM given in Fig. 1.a.
The original net system S is the net without the places
H
11 andH
21. These places are the MSIP’s computed to summarise the internal behaviour of the two modules.Place
H
11summarises the module 1 (the subnet generated by nodes whose tags begin withP
1 orT
1), and placeH
21summarises the module 2. The ES is the net system of Fig. 1.a (adding toSthe places
H
11andH
21).From theES, we can build theLSiandBS.
Definition 5 [2] LetS=h
P
1[:::
[P
K[B;T
1[:::
[T
K;
Pre ; Post ; m
0ibe a SAM andESits extended system.i) The low level systemLSi for
i
= 1;:::;K
ofS is thenet system obtained from ES by deleting all the nodes in
S
j6=i
(
P
j[(T
jnTI))and their adjacent arcs.ii) The basic skeleton BS ofS is the net system obtained fromESby deleting all the nodes in
S
K
j=1
(
P
j[(T
jnTI))and their adjacent arcs.
In eachLSiall the modulesNj with
j
6=i
, are reduced to their interface transitions and to the implicit places that were added in the ES, while Ni is fully preserved. Sys- temsLSirepresent different low level views of the original model. In theBSall the modules are reduced, and it con- stitutes a high level view of the system.In Fig. 1.b. theLS1 of Fig. 1.a is depicted. The BS is obtained by deleting from Fig. 1.b the nodes whose tags begin with
P
1andT
1.By construction, since the original net is conservative then theLSiand theBSare also conservative, so the reach- ability sets of all these subsystems are finite. The main re- sult about the behaviour of the constructed subsystems is the following.
Property 6 [2] LetSbe a SAM,LSiits low level systems for i=1,. . . , K,BSits basic skeleton, andL(S)the language of firing sequences ofS. Then:
i)L(S)jT i
[TI
L(LS
i
)for
i
=1;:::;K
.ii)L(S)jTI
L(BS).
The above property states that the reduction technique recalled here does not remove but possibly adds new paths between interface transitions.
3. Guaranteeing subsystems ergodicity
From the result stated in Property 6, it follows that the RG’s ofLSiandBSinclude at least the projections (on the corresponding preserved nodes) of the reachable markings of the original system. They also reproduce the projections on the preserved transitions of the firing sequences of the original system. But since the inclusion in the statement of Property 6 is not strict, the RG’s of the subsystems may possibly include new (let us say) spurious markings and fir- ing sequences that do not correspond to actual markings and firing sequences of the original system. In some cases, this non desired behaviour can lead to non ergodic systems. In this section we present a technique to avoid such undesired behaviour, guaranteeing ergodicity of the subsystems. Er- godicity of subsystems is needed to apply this decomposi- tion technique to approximate analysis since the underlying CTMC’s of subsystems must be solved.
Consider, for example, the system given in Fig. 1.a. Cut- ting the system through the places
B
1 toB
4and applying the reduction technique of the previous section to the right hand side subnet, theLS1 of Fig. 1.b is obtained. In the original system after the firing of interface transitionI
22only transition
I
23 can be fired, but inLS1 it is also pos- sible to fire transitionI
24after the firing of transitionI
22.This new possible firing makesLS1non live (the sequence
=I
12I
22I
24is firable inLS1and the marking produced by the firing ofisB
4P
13that is a total deadlock).In other words, the underlying CTMC’s of the subsys- tems may be non ergodic.
There is a direct way to adjust these CTMC’s to assure ergodicity. In general, the RG’s of the subsystems may have several strongly connected components. To obtain an er- godic CTMC, only the strongly connected component of the initial marking in each subsystem must be selected. It will be proved that these strongly connected components in- clude, at least, all the projected states and firing sequences of the original net system.
Theorem 7 LetSbe a SAM,ES,LSi with
i
=1;:::;K
andBS its extended, low level and the basic skeleton sys- tems, respectively. Let RG(LSi
) andRG(BS)be the strongly connected components ofRG(LSi
)andRG(BS), resp., that contain the initial marking. LetRS(LSi
)and
RS
(BS)be the states of RG(LSi
)andRG(BS), resp. Let
L
(LS
i
)andL(BS)be the language of firing sequences ofRG(LSi
)andRG(BS), respectively. Then:
i)L(S)jTi[TI
L
(LS
i
)for
i
=1;:::;K
andL(S)j
TI
L
(BS). ii)RS (ES)jP
i [H[B
RS
(LS
i
)for
i
=1;:::;K
andRS (ES)j
B[H
RS
(BS).
Proof: Consider the extended systemESofS. By definition, all the places inH =
S
K
i=1 H
iare implicit inES. ThereforeL(S)=L(ES). Since S is assumed reversible,
m
0 is a home state (if this is not the case, but S has home state, any home state can be considered as the new initial marking and the result is still true). Given a markingm
2 RS(ES), by reversibility ofES, there exists; 2 L(ES)such thatm
0,!m
,!m
0. Letm
0i=m
0jPi[H[Bbe the initial marking ofLSiandm
0 =m
jPi[H[Bbe the projection ofm
over the places ofLSi. Let0 =jTi
[TIand0 =jT i
[TI. It must be proved that
m
0 2 RS(LSi)and0 2 L(LSi). By definition ofES, it is clear that the marking of the places inH[Bis only changed by the firing of transitions inTI, and the marking of the places inPiis only changed by the firing of transitions inTi. Then, inLSi,m
0i,!0m
0,!0m
0i, som
02RS(LSi)and02L(LSi). }The strongly connected components of a directed graph can be efficiently computed with a time complexity of
O
(max
(n;
jE
j)), wheren
is the number of nodes of the graph andjE
jthe number of edges [7].The above theorem gives a general technique applicable to any structurally live, structurally bounded and reversible SAM to obtain, from the subsystems, ergodic CTMC’s available for subsequent computations.
(a)
B1
P21
P22 B2
P12
P11 I21
T21 I22
I12 I11
T11 H21
H11
2
2 2 2
(b)
B1
B2 P12
P11 I21
I22 I12
I11
T11 H21
H11 2 2
(c)
B1
B2 I21
I22 I12
I11
H21 H11
Figure 2. (a) A SAM, (b) its LS1 and (c) its BS.
In the case of Fig. 1,RG(LS1
)has two strongly con- nected components. One of them with all the states but
B
4P
13 and the other one with only the stateB
4P
13 (thedeadlock marking). The strongly connected component of the initial marking is the first one and then, the deadlock marking
B
4P
13is removed in the process.It must be pointed out that RG(LSi
) andRG(BS) may still include spurious markings (and/or spurious firing sequences) that do not correspond to the projection of any marking (firing sequence) of the original system over the preserved nodes.
For example, in Fig. 2.a a weighted marked graph is de- picted. Cutting the system through the places
B
1 andB
2and applying the reduction technique of the previous sec- tion, the LS1 of Fig. 2.b is obtained. Now, the underly- ing CTMC of LS1 is ergodic, so by computing in it the strongly connected component of the initial marking, the entire CTMC is obtained. But in this CTMC, there are spu- rious markings and firing sequences that were not possible in the original system. For example, in the original system,
m
[B
1]m
[B
2]=0, for any reachable marking, but inLS1, the markingB
1B
2is reachable. This marking is not a pro- jection of any reachable marking of the original system over the places ofLS1.4. Structured view of PN’s (RG level)
In many cases the technique developed in previous sec- tion is enough for getting good approximations with itera- tive algorithms like that presented in section 5, but in some cases these approximations may be very poor. In our opin- ion, the explanation comes from the following two prob- lems: (P1) The introduction of spurious markings (reach- able markings in the subsystems that do not correspond to projections of reachable markings of the original system).
In the example of Fig. 2 the state
B
1B
2is not reachable in the original system, but it becomes reachable in the subsys- tems. And the second problem (P2) is the ‘inadequate’ ag- gregation of different states of the original system (aggrega- tion of states not connected by internal transitions) into the same state in the subsystems. In the example of Fig. 2 the statesP
11P
21andP
12P
22are aggregated in the same stateH
11H
21in theBS. This aggregation in theBSintroduces spurious firing sequences in the submodel. Now, from stateH
11H
21, it is possible to fire transitionsI
11 andI
22 (thissituation was not possible in the original system). Making computations with this aggregated CTMC leads to very bad results. The same problems can appear in more complex nets.
In this section we develop the basis for the solution of these problems. First, a structured view of the RG of a SPN will be explained. With this view it is possible to compute and store in a decomposed manner the RG of the original model. Thus, this view can be applied not only for approx- imate analysis but also for other analysis techniques. After that, this representation of the RG of the original system is used for the generation of the subsystems. Several possible subsystems can be generated. In subsection 4.1 the prob- lem (P1) is completely solved (any reachable state of any subsystem is the projection of a state of the original system).
In subsection 4.2 also the second problem (P2) is solved.
Definition 8 Let S be a SAM and RG(S) its RG. Let
R
iwith
i
= 1;:::;K
be the following equivalence relations defined on the set of vertices of RG(S): 8s
1;s
2vertices of RG(S),hs
1;s
2i2R
iiff there exists a non-directed path in RG(S) froms
1tos
2containing only transitions inT
jnTIwith
j
6=i
. LetR
0be the following equivalence relation defined on the set of vertices of RG(S): 8s
1;s
2vertices of RG(S),hs
1;s
2i2R
0iff there exists a non-directed path in RG(S) froms
1tos
2containing only transitions inT
nTI.The following property trivially follows from the defini- tion.
Property 9 Let S be a SAM and
R
i withi
= 0;:::;K
the equivalence relations defined above. Then for each
i
=1;:::;K
we haveR
iR
0. LetD
iwithi
=1;:::;K
be the set of states of RG(S) belonging to an arbitrary equivalence class induced by
R
i. Then, there exists an equivalence classD
0induced byR
0such thatD
iD
0.Definition 10 Let
G
1 = (V
1;E
1;L
1),G
2 = (V
2;E
2;L
2)be two directed labelled graphs. The product
G
ofG
1andG
2(denoted byG
1G
2) is another directed labelled graphG
=(V;E;L
)such that:V
=V
1V
2 (Cartesian prod- uct),L
=L
1 [L
2 andE
((s
11;s
21);
(s
12;s
22)) =t
iff(
s
11 =s
12 andE
2(s
21;s
22) =t
) or (s
21 =s
22 andE
1(s
11;s
12)=t
).x y a3b1 a5b1
a1b1
a1b2 a3b2 a5b2
a4b1
a4b2 a2b1
a2b2
z t
r r
r r
r
x y z t
X =
b1
b2
x y a5 r
a1
a4 a2
z t
a3
Figure 3. Product of directed labelled graphs Fig. 3 shows the product of two directed labelled graphs.
Definition 11 Let S be a SAM and RG(S) its RG. Let
D
be the directed labelled subgraph of RG(S) generated by the states with a common given fixed marking in the buffers (the subgraph composed by the states and the labelled edges joining them). A breadth-first search in RG(S) induces a breadth-first search in
D
. Consider the breadth-first span- ning forest computed inD
. The rootH
of a tree of the span- ning forest is a head ofD
iff there is not any cross edge1 arriving atH
.1See [7] for the definition of cross edge in a breadth-first search.
Property 12 LetSbe a SAM and RG(S) its RG. Let
D
bethe directed labelled subgraph of RG(S) generated by the states with a common given fixed marking in the buffers.
Let
H
be a head ofD
,D
H be the directed labelled sub- graph generated by the set of successors ofH
inD
andD
Hiwith
i
= 1;:::;K
the aggregation ofD
H induced byR
i(the quotient set
D
HR
i). ThenD
H =D
1HD
KH.Proof: LetHiwith i = 1;:::;K be the equivalence class ofH in
D
H
Ri. LetJ 2 DH. Then there exists such thatH,!Jand composed only by internal transitions ofS. Letiwithi=1;:::;Kbe the projection ofon the internal transitions ofNiandJibe such that
H i
i
,! J
i(iis firable fromHiinDi
H
by concurrency among the inter- nal transitions ofNiandNjwithi6=j). ThenJ =(J1;:::;JK))
J2D 1
H
D K
H
. Let(J1;:::;JK) 2 D1
H
D K
H
. Then there existsi with
i = 1;:::;Ksuch thatHi,!i J
i. Let = 1
K. By concur- rency among internal transitions inNiandNjwithi 6=j,is firable fromHinDH. LetJbe such thatH,!
J. ThenJ=(J1;:::;JK))
(J 1
;:::;J K
)2D
H. }
The above property exploits the concurrency among in- ternal transitions in a SAM to compute the successors of a head locally in each module and storing only the aggregated classes in each subnet so reducing the time and memory re- quirements for the computation of these states.
Property 13 Let S be a SAM and RG(S) its RG. Let
D
be the directed labelled subgraph of RG(S) generated by the set of states with a common given fixed marking in the buffers. Let
H
1;:::;H
n be the set of heads ofD
,and
D
Hi withi
= 1;:::;n
the directed labelled sub- graph generated by the successors ofH
i inD
. ThenD
=Sni=1D
Hi1D
KHi, whereD
Hjiwith
i
=1;:::;n
and
j
= 1;:::;K
is the aggregated subgraph ofD
Hi bymeans of
R
j.This property immediately follows from the previous one. Then the minimum information needed to generate the states of an equivalence class of
R
0 is the set of heads of the class with their corresponding heads in each aggregated class. In different classes of the original RG the same head can appear in an aggregated class, so locally each aggre- gated class can be computed and stored only once, exploit- ing the concurrency of internal transitions at the maximum degree.Now we need to know what happens with the interface transitions.
Property 14 LetSbe a SAM and RG(S) its RG. Let
D
bethe directed labelled subgraph of RG(S) generated by the states with a common given fixed marking in the buffers.
Let
H
be a head ofD
,D
H the directed labelled subgraph generated by the set of successors ofH
inD
andD
iHwithi
= 1;:::;K
the aggregation ofD
H by means of rela- tionR
i. LetS
2D
Hi . An interface transitiont
2T
j\TIwith
i
6=j
is enabled inS
iff there existsS
02D
jHsuch thatt
is enabled inS
0.Proof: ))LetS0 be the state ofDj
H
in whichtis enabled andHi the class of H in Di
H
(the head ofDi
H
). By property 12 the state
M = (:::;H i
;:::;S 0
;:::) 2 D. tis enabled inM so, by concur- rency among internal transitions ofNiand interface transitions ofNjwith
i6=j,tis enabled in all the states ofDi
H
, thustis enabled inS.
()Iftis enabled inS, sinceSis an equivalence class inD, there exists a stateM = (:::;S;:::;S0;:::) 2 D such thattis enabled inM (SandS0are theiandj-component ofM). Aggregating by means ofRj,
S 0
2D j
H
andtis enabled inS0. }
Last property allows to compute locally in each mod- ule
i
the interface transitions ofNi that can be fired in a given local markingD
iHand exporting them to all the local markings of the other modulesD
jH withj
6=i
. Again, in different classes of RG(S) by means ofR
0 the same head can appear in an aggregated class, so taking into account the marking of buffers and the internal state inNi(in other words the classD
iH) is enough to compute the interface transitions enabled inD
H. Moreover, a spurious interface transition is never computed because the interface transi- tions are computed in the corresponding module with all the information about its input places.Now we can present the algorithm to compute the de- composed description of RG(S).
Algorithm 4.1 input: A SAMS
B
0
:=
m
0jB; initial marking on buffers fori:=1toKdoHi:=
m
0jPi; breadth-first search fromHiinNiH:=(H1;:::;HK)
insert head(B0;H)in the queue while queue of heads non empty do
(B;H):=first head of the queue;L:=; forj:=1to K
L:=L[fIj2Tj\TIjIjenabled inHjg for eachIj2Ldo
for each successorhjofHjinNjs. t.Ijis enabled do
(B;hj) I
j
,! (B
0
;H 0
j
);H0:=(H1;:::;Hj0
;:::;HK)
ifHj0is new then breadth-first search fromHj0inNj ifB0is new then insert head(B0;H0)
else isnew := TRUE
for eachH00s. t.(B0;H00)is head do ifH00,!
H
0,TnTIthen isnew := FALSE else ifH0,!
H
00withTnTIthen replaceH00byH0; isnew = FALSE else ifH0andH00have a common successor then
makeH0andH00related inB0 if isnew = TRUE then insert head(B0;H0) output:Set of heads
RG(S)jN
ifori=1;:::;K
In the above algorithm given the initial marking of a SAM, all the firing sequences composed only by internal transitions are computed locally in each module by means of a breadth-first search in each module. The local states computed in each module are stored locally (not all the pos- sible combinations among them). Then a queue of unex- plored heads is maintained in the while-loop. A head in the output of the algorithm is a state ofSthat is reachable only
after the firing of an interface transition. During the algo- rithm the heads are replaced by other ones at the moment in which a predecessor by means of internal transitions is computed. In each iteration of the while-loop, the first head
(
B;H
) of the queue is studied.B
is the marking of the buffers andH
=(H
1;:::;H
K)the local markings in each module. Given a headH
, locally in each modulej
, theset of interface transitions of
T
j that can be fired after any firing sequence of internal transitions are computed. The union of these sets is the setL
of interface transitions en- abled in the equivalence class of(B;H
)by means ofR
0.After that, each transtition
I
j of the setL
is fired (j
isthe number of the module). The firing of
I
j only changes buffers (B
toB
0) and the local marking of modulej
. Ingeneral several successors
h
j ofH
j inNj can enableI
j.Then for each
h
j we must fireI
j to produce a new local markingH
j0. The next step is to check if the local mark- ingH
j0 is new. If this is the case a new local breadth-first search is done in modulej
computing and storing new local states. Then we must test if the reached marking(B
0;H
0)is a new head to insert in the queue. To do that we test if
B
0 is new (then it is clearly a new head). IfB
0 is notnew, we must compare
H
0with all the computed heads of the form(B
0;H
00). Four cases are possible. If(B
0;H
0)isreachable from (
B
0;H
00)by means of internal transitions(
B
0;H
0)is erased. If(B
0;H
00)is reachable from(B
0;H
0)then(
B
0;H
0)replaces(B
0;H
00). If(B
0;H
00)and(B
0;H
0)have a common successor then we mark the two heads as related. It is important to store this information for the sub- sequent phase. In other case(
B
0;H
0)is a new head. The previous tests about reachability between states can also be done locally in each module.The output of this algorithm is a decomposed descrip- tion of RG(S) (computed with less memory and time re- quirements than in the classical way). Applying proper- ties 12 and 14 we could precisely compute RG(S). Now, we apply this reduced description of RG(S) to generate the RG’s of the reduced submodelsLSi andBS. Two differ- ent reduced submodels will be computed. In subsection 4.1 the projections of the markings of RG(S) on the preserved nodes in the submodels will be computed and in subsec- tion 4.2 the aggregations of RG(S) by means of relations
R
iwith
i
=0;:::;K
will be computed.4.1. Reducing spurious markings
In this subsection we use the decomposed description of the RG(S) computed with algorithm 4.1 for the generation of the projections of RG(S) on the preserved places ofLSi
andBS. So, the difference of this second decomposition technique with respect to the first one presented in section 3 is that the subsystems have no spurious states (thus, solv- ing the first problem P1 mentioned in the beginning of this section). In this way we obtain the smallest possible RS for each subsystem.