scieee AI-readable full text Open interactive document viewer

New region-based algorithms for deriving bounded Petri nets

Carmona Vargas, Josep,Cortadella, Jordi,Kishinevsky, Michael

Abstract

The theory of regions was introduced in the early nineties as a method to bridge state and event-based models. This paper tackles the problem of deriving a Petri net from a state-based model, using the theory of regions. Some of the restrictions required in the traditional approach are dropped in this paper, together with significant extensions that make the approach applicable in new scenarios. One of these scenarios is Process Mining, where accepting (discovering) additional behavior in the synthesized Petri net is sometimes valued. The algorithmic emphasis used in this paper contributes to the demystification of the theory of regions as been only a good theoretical exercise, opening the door for its application in the industrial domain.

Full text

New Region-Based Algorithms for Deriving Bounded Petri Nets Josep Carmona, Jordi Cortadella, Member,IEEE, and Mike Kishinevsky, Senior Member,IEEE Abstract—The theory of regions was introduced in the early nineties as a method to bridge state and event-based models. This paper tackles the problem of deriving a Petri net from a state-based model, using the theory of regions. Some of the restrictions required in the traditional approach are dropped in this paper, together with significant extensions that make the approach applicable in new scenarios. One of these scenarios is Process Mining, where accepting (discovering) additional behavior in the synthesized Petri net is sometimes valued. The algorithmic emphasis used in this paper contributes to the demystification of the theory of regions as been only a good theoretical exercise, opening the door for its application in the industrial domain. Index Terms—Petri nets, transition systems, theory of regions, synthesis, process mining, bisimulation. Ç 1INTRODUCTION STATE-BASED representations, like FSMs [17], I/O Automata [21], Team Automata [27], or burst-mode automata [24], among others are typical models of complex systems. Such formalizations represent the behavior by means of sequences of events carrying state information. Event-based specifications like Petri nets [25] or CCS [22], model event causality, conflict, and concurrency, thus, providing alternative information to state-based models often captured in a more concise form. The theory of regions [18] provides a bridge between state- and event-based representations. This theory, which is now almost two decades old, was introduced to solve the synthesis problem. This problem consists of transforming a state-based into an event-based specification while preserving the behavior. More specifically, the theory of regions was used for transforming a transition system (TS) into a Petri net. The theory was initially defined for elementary transition systems deriving 1-bounded Petri nets, whereas in [11] this restriction was dropped. Mukund [23] extended the theory of [18] for k-bounded Petri nets with weighted arcs, while in this paper we extend [11] for the same purpose. Transforming a transition system into a Petri net is particularly useful when modeling concurrent systems: the state-based model (which represents the concurrency implicitly) can be too complex to understand whereas the equivalent Petri net (which represents the concurrency explicitly) is usually a more concise and clear representation. Moreover, the formal analysis of the model can be highly alleviated if done at the Petri net level. Examples of concurrent systems in the real life range from digital circuits to databases systems. Another useful application of the synthesis problem comes from the Business Intelligence domain: business information systems that record transactions (called event logs) might mine a model from the set of transactions observed in order to realize the processes underlying the system. This is known as Process Mining. The available tool support for synthesis based on the theory of regions is relegated to the academic domain. For synthesis, we can mention the tools Petrify [11] and Synet [7]. For process mining, the Parikh language miner [31] (within the ProM tool) and the ViPTool [5], [4]. In this paper, we provide a uniform approach for deriving Petri nets from transitions systems, based on the theory of regions. We extend the synthesis theory of [11] (only valid for 1-bounded Petri nets) to k-bounded Petri nets. Second, we show how to derive (mine) k-bounded Petri nets whose corresponding language includes the one from the initial transition systems. The practicality of our approach is demonstrated by providing efficient algorithms, heuristics, and data structures to implement the methods developed in this paper. This paper extends the work presented in [9], [8]. 1.1 Two Introductory Examples Let us introduce the two main results of this paper by means of two simple examples. Synthesis of k-bounded Petri nets. Fig. 1a shows a TS with two events aand b(we ask the reader to ignore for the moment the numbers in states). The language defined by the transition system is faaa; ab; ba; bbg. From this transition system, a 6-bounded Petri net can be derived by the theory developed in this paper, as shown in Fig. 1b. In contrast, if a 1-bounded Petri net is required, more than one transition with the same label is needed to represent the same behavior, leading to a Petri net with five transitions and five places. The theory in this paper extends the one presented in [11], which was restricted to 1-bounded Petri nets, representing a significant step toward the use of Petri nets in more complex scenarios. Informally, the theory works as follows: the states of the transition system are collected into regions, which are multisets satisfying conditions with respect to the set of IEEE TRANSACTIONS ON COMPUTERS, VOL. 59, NO. 3, MARCH 2010 371 .J. Carmona and J. Cortadella are with the Universitat Polite `cnica de Catalunya, C/Jordi Girona, 1-3, 08034 Barcelona, Spain. E-mail: [email protected], [email protected]du. .M. Kishinevsky is with Intel Corporation, 2111 NE 25th Ave., Hillsboro, OR 97124. E-mail: [email protected]. Manuscript received 26 Nov. 2008; revised 27 July 2009; accepted 22 Aug. 2009; published online 3 Sept. 2009. Recommended for acceptance by S. Shukla. For information on obtaining reprints of this article, please send e-mail to: [email protected], and reference IEEECS Log Number TC-2008-11-0590. Digital Object Identifier no. 10.1109/TC.2009.131. 0018-9340/10/$26.00 ß2010 IEEE Published by the IEEE Computer Society events. Each one of the regions corresponds to a place in the derived Petri net. For instance, Fig. 1a shows the (only one) region rcorresponding to the place shown in Fig. 1b. The region is rðs0Þ¼6;rðs1Þ¼4;...;rðs6Þ¼0. The crucial idea is that ris a region because each event has a homogeneous enter and exit relation with it: for instance, each time event aoccurs, the cardinality of the state reached is decremented by two in r. Once the region is computed, the corresponding place can be created in the Petri net, and the initial marking and input and output arcs for the place can be derived: since rðs0Þ¼6, i.e., the initial state of the transition system has cardinality 6, the initial marking of the place is 6. Moreover, due to the aforementioned relation between event aand r, there is an arc with weight two between the corresponding place and the transition ain Fig. 1b. The behavior of this net corresponds exactly to the one described in Fig. 1a. Mining of k-bounded Petri nets. For some applications, reproducing exactly the behavior is not a requirement, but to have instead a clear visualization of what are the main processesispreferred.Process Mining [29] is a clear application of this, but many other applications will appear in the future, given the increasing complexity of software and hardware-based systems. The theory presented in this paper for Petri net mining is a first step toward bridging the gap between the classical theory of region-based synthesis and real industrial applications. Alternative approaches have been presented in the last years [5], [31] with the same goal. Let us use the simple example of Fig. 2a, representing a 3-input OR gate. Although simple, this example illustrates a typical behavior that cannot be easily represented in a Petri net: the or-causality between events. The behavior of this gate can be represented with a transition system of 14 states. However, to reproduce exactly this behavior in a Petri net requires complex interactions between transitions. For instance, a 1-bounded Petri net representing the behavior has 11 places, 17 transitions, and 74 arcs. If a 3-bounded Petri net is synthesized instead, it does not get significantly better: eight places, eight transitions, and 65 arcs. In contrast to synthesis, Petri net mining can summarize nicely the most important part of the 3-or gate by means of a 1-bounded Petri net, shown in Fig. 2b. The Petri net contains every possible behavior of the gate, including the correct alternation of every rising and falling transitions of the signals in the gate (denoted by aþand a, respectively), and the input-output relation. It also shows additional behavior not observed in the gate: initially the gate might be in an unstable state by changing infinitely its state (i.e., trace ðqþqÞis possible in the initial marking of the Petri net). In other words, in mining of Petri nets the goal is in finding a Petri net that can reproduce all observed behaviors, but extra behavior is allowed. The intention is to restrict extra behaviors as much as possible and to obtain a tight overapproximation of the observed behaviors. 1.2 Overall Approach for Synthesis and Mining Fig. 3 describes the complete flow for k-bounded PN derivation. The transition system representing the input of our methods can be obtained from some of the traditional formalisms to specify a concurrent system (FSM, CSP, CCS), from graphs describing hardware (State graphs) or also from event logs [28]. Our approach offers two possibilities for obtaining the corresponding Petri nets: mining and synthesis. In mining, the language formed by the set of feasible traces in the derived PN (PN1) includes the language of the transition system. In synthesis, the obtained PN (PN2) has a reachability graph bisimilar to the transition system. Mining can be considered as an intermediate step for synthesis [12], and this is why an arc exists between PN1and PN2in Fig. 3. In this paper, we emphasize the mining due to the applications that it has for discovering unseen behaviors, as was demonstrated in the Process Mining area [30], [29]. The organization of the paper is as follows: Section 2 includes the theory needed for the paper. Section 3 shows how to derive a k-bounded Petri net from a set of k-bounded regions. Sections 4 and 5 provide two alternatives for deriving a Petri net, depending on the properties to achieve (language inclusion or bisimilarity). Section 6 defines an algorithm for the generation of k-bounded minimal regions. Section 7 introduces the notion of irredundant cover, to restrict the set of necessary regions. In Section 8, the technique of label splitting is presented for the general case, to force the bisimulation approach of Section 5 to obtain a 372 IEEE TRANSACTIONS ON COMPUTERS, VOL. 59, NO. 3, MARCH 2010 Fig. 1. (a) TS and (b) equivalent 6-bounded Petri net. Fig. 2. (a) The 3-or gate and (b) mined Petri net. Fig. 3. Flow for Petri net derivation. k-bounded Petri net bisimulating the initial TS. Finally, Section 9 provides experiments of synthesis and mining, some of them taken from real life applications. 2BASIC THEORY 2.1 Finite Transition Systems and Petri Nets Definition 2.1 (Transition system). Atransition system (TS) is a tuple ðS; E; A; sinÞ, where Sis a set of states,Eis an alphabet of actions, such that S\E¼;;ASESis a set of (labeled) transitions, and sin is the initial state. Let TS ¼ðS; E; A; sinÞbe a transition system. We consider connected TSs that satisfy the following axioms: .Sand Eare finite sets. .Every event has an occurrence: 8e2E:9ðs; e; s0Þ2A. .Every state is reachable from the initial state: 8s2S:sin ! s. ATS is called deterministic if for each state sand each label athere can be at most one state s0such that s! as0. The relation between TSs will be studied in this paper. The language of a TS,LðTSÞ, is the set of traces feasible from the initial state. When LðTS1ÞLðTS2Þ, we will denote TS2as an overapproximation of TS1. The notion of simulation between two TSs is related to this concept: Definition 2.2 (Simulation, Bisimulation [2]). Let TS1¼ ðS1;E;A 1;s in1Þand TS2¼ðS2;E;A 2;s in2Þbe two TSs with the same set of events. A simulation of TS1by TS2is a relation between S1and S2such that .for every s12S1, there exists s22S2such that s1s2; .for every ðs1;e;s 0 1Þ2A1and for every s22S2such that s1s2, there exists ðs2;e;s 0 2Þ2A2such that s0 1s0 2. When TS1is simulated by TS2with relations , and vice versa with relation 1;TS1and TS2are bisimilar [2]. Definition 2.3 (Petri net [25]). A Petri net (PN) is a tuple ðP;T;W;M0Þwhere Pand Trepresent finite sets of places and transitions, respectively, and W:ðPTÞ[ðTPÞ!NN is the weighted flow relation. The initial marking M02NNjPj defines the initial state of the system. A transition t2Tis enabled in a marking Mif 8p2P:M½pWðp; tÞ. Firing an enabled transition tin a marking Mleads to the marking M0defined by M0½p¼ M½pWðp; tÞþWðt; pÞ, for p2P, and is denoted by M! tM0. The set of all markings reachable from M0is called its reachability set. The reachability graph of PN (RG(PN)) is a transition system in which the set of states is the reachability set, the events are the transitions of the net and a transition ðM1;t;M 2Þexists if and only if M1! tM2. We use LðPNÞas a shortcut for LðRGðPNÞÞ. 2.2 Multisets In general, a region in a TS is a multiset where additional conditions hold [23]. We recap in this section the main definitions and operations on multisets. From now on, we will assume a TS ¼ðS; E; A; sinÞproviding the necessary context for the corresponding definitions. Given the set S,amultiset rof Sis a mapping r:S! NN. We will also use a set notation for multisets. For example, let S¼fs1;s 2;s 3;s 4g, then a multiset r¼fs3 1;s 2 2;s 3gcorre- sponds to the following mapping rðs1Þ¼3,rðs2Þ¼2, rðs3Þ¼1,rðs4Þ¼0. The support of r(suppðrÞ) is defined as fs2SjrðsÞ>0g. The power of r(r)ismaxs2SrðsÞ. For instance, for r¼fs3 1;s 2 2;s 3g,suppðrÞ¼fs1;s 2;s 3gand r¼3. The union, intersection, and difference of two multisets r1 and r2are defined as follows: ðr1[r2ÞðsÞ¼maxðr1ðsÞ;r 2ðsÞÞ; ðr1\r2ÞðsÞ¼minðr1ðsÞ;r 2ðsÞÞ; ðr1r2ÞðsÞ¼maxð0;r 1ðsÞr2ðsÞÞ: AmultisetrissaidtobetrivialifrðsÞ¼rðs0Þforalls,s02S. The trivial multisets will be denoted by 0;1;...;Kwhen rðsÞ¼0,rðsÞ¼1;...;rðsÞ¼k, for every s2S, respectively. Multiset ris k-bounded if for all s2S:rðsÞk. The multiset r1is a subset of r2(r1r2)if8s2S:r1ðsÞr2ðsÞ. As usual, we will denote by r1r2the fact that r1r2 and r16¼ r2. The k-topset of r, denoted by >kðrÞ, is defined as follows: >kðrÞðsÞ¼ rðsÞ;if rðsÞk; 0;otherwise:  and kis the degree of such k-topset. Multiset r1is a topset of r2if there exists some kfor which r1¼> kðr2Þ. For example, the multiset fs3 1;s 3gis a subset of fs3 1;s 2 2;s 3g, but it is not a topset. The multisets fs3 1;s 2 2gand fs3 1gare the 2 and 3-topsets of fs3 1;s 2 2;s 3g, respectively. 2.3 General Regions Given a multiset r, the gradient of a transition ðs; e; s0Þis defined as rðs; e; s0Þ¼rðs0ÞrðsÞ. An event eis said to have a nonconstant gradient in rif there are two transitions ðs1;e;s 0 1Þand ðs2;e;s 0 2Þsuch that rðs1;e;s 0 1Þ 6¼ rðs2;e;s 0 2Þ. As example, consider the following multiset r. Event ahas nonconstant gradient in r,becauserðs0;a;s 1Þ¼26¼ 4¼rðs1;a;s 2Þ. However, bhas constant gradient 1. Definition 2.4 (Region). A multiset ris a region if all events have a constant gradient in r. For instance, the multiset shown in Fig. 1a is a region, whereas the one shown in the figure above is not a region due to event a. The original notion of region from [18] was restricted to subsets of S, i.e., events could only have gradients in f1;0;þ1g. We say that a region is trivial if it is a trivial multiset (0;1;...;K). The set of nontrivial general regions of TS will be denoted by RTS. Definition 2.5 (Gradient of an event). Given a region rand an event ewith ðs; e; s0Þ2E, the gradient of ein ris defined as CARMONA ET AL.: NEW REGION-BASED ALGORITHMS FOR DERIVING BOUNDED PETRI NETS 373 rðeÞ¼rðs; e; s0Þ: For instance, in the example of Fig. 1a, rðaÞ¼2. Definition 2.6 (Minimal region). A region ris minimal if there is no other region r06¼ 0such that r0r. 3DERIVING K-BOUNDED PETRI NETS This section presents an algorithm that derives a k-bounded PN from a set of k-bounded regions. The relation between the initial transition system and the PN will be established in the next two sections: language inclusion (Section 4), and bisimilarity (Section 5). First, the following definition describes these sets of states that must be covered by a region in order to have an arc in the derived Petri net. Definition 3.1 (Excitation and switching regions). The excitation region 1 of an event e; ERðeÞ, is the set of states in which eis enabled, i.e., ERðeÞ¼fsj9s0:ðs; e; s0Þ2Eg: The switching region of an event e,SRðeÞ, is the set of states reachable from ERðeÞafter having fired e, i.e., SRðeÞ¼fsj9s0:ðs0;e;sÞ2Eg: For convenience, ERðeÞand SRðeÞwill be also considered as multisets of states when necessary. As example, in the TS shown in Fig. 4a, ERðaÞ¼fs1;s 3;s 6gand SRðaÞ¼fs2;s 5;s 7g. Definition 3.2 (Pre- and postregions). A region ris a preregion of eif ERðeÞr. A region ris a postregion of eif SRðeÞr. The sets of pre- and postregions of an event eare denoted by eand e, respectively. Intuitively, pre- and postregions will be represented by predecessor and successor places of the event in the derived PN. Following the example of Fig. 4, the region r3is a preregion of a, whereas r6is a postregion of a. Next, we define the basic objects that will be used to establish the weight on the arcs in the derived PN: Definition 3.3 (Topset and its degree). Given an event eand a preregion r, the multiset TOPðr; eÞis the multiset qsuch that q¼> gðrÞ,ERðeÞ> gðrÞ, and ERðeÞ 6> gþ1ðrÞ. The degree gof TOPðr; eÞis denoted as MAX-K-TOPðr; eÞ. Informally, TOPðe; rÞis the smallest topset of rstill covering ERðeÞ. Note that this is always a single multiset. The value MAX-K-TOPðr; eÞestablishes the maximal number of tokens that can be safely removed from the place corresponding to rwhen efires guaranteeing that no negative markings are reached. For instance, in the example of Fig. 1a, if we consider the region rshown, TOPða; rÞ¼> 2ðrÞ¼ fs6 0;s 4 1;s 2 2;s 3 4g, and therefore MAX-K-TOPðr; aÞ¼2. Now we define important objects called enabling topsets, which are crucial for deriving the weighted flow relation in the algorithm. Definition 3.4 (Enabling topsets). The set of smallest enabling topsets of an event eis denoted by eand defined as follows: e¼fqj9r2e^q¼TOPðe; rÞg: In the PN derived by Algorithm 1, every region becomes a place and each event a transition. The flow relation from places to transitions is defined with respect to the enabling topsets: for a preregion rof an event e,g¼MAX-K-TOPðr; eÞ tokens can be removed from place r(lines 7 and 8). However, the gradient of ein rcan be greater than g, i.e., eremoves less tokens than g. In this situation, part of the removed tokens (gþrðeÞ) are put back in r(lines 9 and 10). The flow relation from transition eto places is defined for regions covering SRðeÞand the corresponding gradient (line 13). For instance, in the example of Fig. 1, the region rshown is preregion of both aand b,withMAX-K-TOPðr; aÞ¼2and MAX-K- TOPðr; bÞ¼3, and so the corresponding weighted arcs derived by Algorithm 1 are connecting the region to transitions aand b, respectively. The initial marking of the region is 6 due to line 3 of the algorithm. Another example of application of Algorithm 1 is shown in Figs. 4a, 4b, and 4c. 374 IEEE TRANSACTIONS ON COMPUTERS, VOL. 59, NO. 3, MARCH 2010 Fig. 4. (a) Initial TS, (b) 1-bounded minimal regions, and (c) Petri net derived by Algorithm 1. 1. Excitation and switching regions are not regions in the terms of Definition 2.4. They correspond to the set of states in which an event is enabled or just fired, correspondingly. The terms are used due to historical reasons. 4MINING 4.1 Motivation In this section, we answer the following question: what is the relationship between the PN derived by applying Algorithm 1 (to the set of minimal regions of a TS) and the original TS? We will show that LðPNÞLðTSÞ. This result is consistent with the classical theory of region-based synthesis according to which the net synthesized using minimal regions is an approximation from above (i.e., includes the original language, see for instance [12]). In this section, we assume that the set of minimal regions has been computed: in Section 6, we will present an efficient algorithm to compute minimal regions. Let us consider the example of Fig. 4 to illustrate the main message of this section. Fig. 4a shows a TS. Assume that 1-bounded minimal regions from this TS are used in Algorithm 1. These regions are reported in Fig. 4b, and the PN derived from Algorithm 1 on these regions is shown in Fig. 4c. It is easy to see that LðPNÞLðTSÞ: the sequence cbade belongs to LðPNÞbut it does not belong to LðTSÞ. The remainder of this section formalizes the construction of Petri nets based on language overapproximation and presents an important result stating a minimality property on the derived PN. Formal proofs and necessary lemmas are provided in Appendix. 4.2 Mining Properties Formally, given a TS ¼ðS; E; A; sinÞ, Algorithm 1 derives a k-bounded Petri net PN ¼ðP;T;W;M0Þwith the following characteristics: 1. LðTSÞLðPNÞ, 2. T¼E, i.e., there is only one transition per event (no label splitting, see Section 8), and 3. Minimal language containment (MLC) property: For any k-bounded PN0¼ðP0;T0;W0;M0 0Þ s:t: T0¼E:LðTSÞLðPN0Þ)LðPNÞLðPN0Þ: Therefore, the algorithm generates the tightest overapproximation (measured by language containment) among all possible Petri nets that can be obtained without splitting labels. Since Algorithm 1 clearly guarantees item 2, it only remains to demonstrate the two other properties. First, language inclusion holds due to the following result: Theorem 4.1. Let TS ¼ðS; E; A; sinÞbe a transition system, and PN ¼ðP;T;W;M0Þbe the synthesized net (using Algorithm 1) with the set of minimal regions of TS. Then, LðTSÞLðPNÞ. This theorem guarantees that no trace is lost when using only the set of minimal regions in TS. Moreover, as the following theorem states, the MLC property holds in the PN: Theorem 4.2. Let TS ¼ðS; E; A; sinÞbe a transition system, and PN ¼ðP;T;W;M0Þbe the synthesized net (using Algorithm 1) with the set of minimal regions of TS. Then, PN satisfies the MLC property. Hence, this property guarantees a tight overapproximation of the input language. Compared to the languagebased regions from [31], this is a distinguishing factor that might be important if the degree of overapproximation must be controlled. 5SYNTHESIS 5.1 Motivation For some applications, deriving a Petri net equivalent to the initial transition system is required. However, as the example of Section 4.1 demonstrates, this cannot be always accomplished. In this section, we tackle this problem by defining a property (excitation closure) that a TS must satisfy in order to derive a PN with bisimilar behavior. Moreover, a label splitting technique is presented in Section 8, to repair excitation closure violations in a TS. This allows to present a complete method for deriving bisimilar k-bounded PNs, described in Section 8.1. Finally, in Section 7, excitation closure is used to reduce the number of necessary regions while preserving the properties in the derived net. 5.2 Excitation Closure The concept of excitation closure was presented in [11] for 1-bounded regions. Here, we generalize it for arbitrary k-bounded regions: Definition 5.1 (kk-ECTS). ATS is k-excitation closed (k-ECTS) if using minimal k-bounded regions, it satisfies the following two properties: 1. Excitation closure. For each event e \ q2e suppðqÞ¼ERðeÞ: 2. Event effectiveness. For each event e,e6¼;. For instance, the TS shown in Fig. 4a is not 1-ECTS, since event cis not excitation closed for the set of regions shown in Fig. 4b: \ q2c suppðqÞ¼r1ERðcÞ; while the rest of events (a,b,d, and e) are excitation closed. However, the TS is 2-ECTS, as Fig. 5 demonstrates. We will say that a TS is ECTS if it is k-ECTS for some k. The intuition behind the notion of excitation closure is that, provided that Algorithm 1 uses the enabling topsets to decide when a transition is enabled, the set of states corresponding to the enabling of the transition must be CARMONA ET AL.: NEW REGION-BASED ALGORITHMS FOR DERIVING BOUNDED PETRI NETS 375 Fig. 5. (a) The 2-bounded minimal regions in the TS of Fig. 4a, where only region r0is not 1-bounded, and (b) bisimilar Petri net derived by Algorithm 1. exactly the set of states where the transition is actually enabled in the TS (ER). In other words, if one state in the intersection of enabling topsets does not belong to the ER of the event, then the RG(PN) is an overapproximation of the TS and hence it cannot be simulated by TS. The following theorem links excitation closure and bisimilarity (see proof in Appendix): Theorem 5.1. Let TS ¼ðS; E; A; sinÞbe a k-excitation closed transition system. Algorithm 1 on the set of minimal regions derives a PN ¼ðP;T;W;M0Þwith reachability graph bisimilar to TS. For example, the reachability graph of the PN from Fig. 5b is bisimilar to the TS of Fig. 4a. 6COMPUTATION OF GENERAL REGIONS The first step in the approaches presented in the two previous sections is to compute the set of regions from the TS. The fact that the number of k-bounded regions in a given TS might be large with respect to the number of states makes this step a challenging one. In this section, we will try to convince the reader that practical algorithms can be used to fight the complexity underlying the generation of regions. Independently on the desired properties in the derived Petri net, not all the regions are necessary. Regions that are .Nonminimal [16], or .Not a preregion or postregion (see Property 6.1), or .Trivial, i.e., 0;1;...;K are not required. Moreover, as Section 7 reports, depending on the properties in the derived Petri net some minimal regions can also be excluded: .In mining, only a subset irredundant minimal cover of regions is needed. .In synthesis, only an irredundant minimal cover of regions is needed. 6.1 Basic Algorithm In this section, we will present an algorithm to generate a set of regions sufficient for deriving a correct Petri net, independently of the approach followed (language inclusion or bisimilarity). Excitation/switching regions will be the sets of states that serve as seeds in the algorithm. The following property will be useful to ensure the generation of minimal pre/postregions [9]: Property 6.1. Let TS ¼ðS;;E;s inÞbe a transition system. Then, any region r6¼ 0is the preregion or the postregion of some event e. Due to Property 6.1, only supersets of the ER and SR of every event must be considered. When a given (multi)set contains some region violation, it is expanded to avoid it. Formally, given a multiset rand an event ewith nonconstant gradient, the following definitions characterize the set of regions that include r: Definition 6.1. Let r6¼ 0be a multiset. We define Rgðr; eÞ¼fr0rjr0is a region and r0ðeÞgg; Rgðr; eÞ¼fr0rjr0is a region and r0ðeÞgg: Rgðr; eÞis the set of all regions larger than rin which the gradient of eis smaller than or equal to g. Similar for Rgðr; eÞ and the gradient of egreater than or equal to g. Notice that in this definition a gradient gmay be used to partition the set of regions including rinto two classes. This binary partition is the basis for the calculation of minimal k-bounded regions that will be presented at the end of this section. The expansion of a set consists of increasing the arity of some states to satisfy the region condition. As it is proved below, there is a bound in the increase for each state: Definition 6.2. Given a multiset r, a state s, and an event e, the following functions are defined 2 : gðr; e; sÞ¼maxð0;max ðs;e;s0Þ2Eðrðs0ÞrðsÞgÞÞ; gðr; e; sÞ¼maxð0;max ðs0;e;sÞ2Eðrðs0ÞrðsÞþgÞÞ: Informally, gdenotes a lower bound for the increase of rðsÞ, taking into account the arcs leaving from s, to force r0ðeÞgin some region r0larger than r. Similarly, g denotes a lower bound taking into account the arcs arriving at s, to force r0ðeÞg. Let us use Fig. 6a to illustrate this concept. In the figure, each state is labeled with rðsÞ. Now imagine that we want to force the gradient on event eto be greater or equal to 2. For state s1, we have 2ðr; e; s1Þ¼3, which is determined from the arc s0! es1, indicating that r0ðs1Þ4in case we seek a region r0rwith r0ðeÞ2. The states that, as s1, violate this constraint are shown with gray background. Definition 6.3. Given a multiset rand an event e, the multisets ugðr; eÞand ugðr; eÞare defined as follows: ugðr; eÞðsÞ¼rðsÞþgðr; e; sÞ; ugðr; eÞðsÞ¼rðsÞþgðr; e; sÞ: Intuitively, ugðr; eÞis a move toward growing rand obtaining all regions r0with rðeÞg. Similarly, ugðr; eÞfor those regions with rðeÞg. It is easy to see that ugðr; eÞand ugðr; eÞalways derive multisets larger than r. The successive steps of calculating u2ðr; eÞare illustrated in Figs. 6a, 6b, 6c, and 6d. The following theorem formalizes the notion: 376 IEEE TRANSACTIONS ON COMPUTERS, VOL. 59, NO. 3, MARCH 2010 2. For convenience, we consider maxx2DPðxÞ¼0when the domain Dis empty. Fig. 6. Successive calculations of u2ðr; eÞ. States violating the constraint rðeÞ2are depicted with yellow background. Theorem 6.1 (Expansion on events). a. Let r6¼ 0be a multiset and ean event such that there exists some ðs; e; s0Þwith rðs0ÞrðsÞ>g.The following hold: 1. ru gðr; eÞ; 2. Rgðr; eÞ¼R gðugðr; eÞ;eÞ. b. Let r6¼ 0be a multiset and ean event such that there exists some ðs; e; s0Þwith rðs0ÞrðsÞ<g.The following hold: 1. ru gðr; eÞ; 2. Rgðr; eÞ¼R gðugðr; eÞ;eÞ. The calculation of all minimal k-bounded regions is presented in Algorithm 2. It is based on a dynamic programming approach that, starting from a multiset, generates an exploration tree in which an event with nonconstant gradient is chosen at each node (line 7). All possible gradients for that event are explored by means of a binary search (lines 8-13). Dynamic programming with memoization [10] avoids the exploration of multiple instances of the same node (line 6). The final step of the algorithm (lines 16-17) removes all those multisets that are neither regions nor minimal regions that have been generated during the exploration. Fig. 7 shows how Algorithm 2 will explore the ERðaÞ (center). After successive calculations of r1¼u 1ðERðaÞ;aÞ, it reaches the region shown on the left. Analogously, the region on the right is obtained after successive calculations of r2¼u 0ðERðaÞ;aÞ, and notice that provided that r2covers both ERðaÞand SRðaÞ, it corresponds to a self-loop place for transition a. Theorem 6.2. Algorithm 2 calculates all k-bounded minimal regions. 6.2 Computing an Upper Bound for k The algorithm presented in Section 6.1 assumes an input parameter kdetermining the maximal bound required for the derivation of a PN.Ifkis unknown, an upper bound can be computed from the transition system. In [14, Section IV], a method to compute the bounded Petri net closure of a regular language is presented. This method consists of: 1. Unbounded Petri net synthesis of the language [13], by solving a finite system of linear constraints over the integers. 2. Construction of the covering tree [20] related to the unbounded Petri net derived in step 1: the vertices of this tree are tuples v¼ðM;qÞ, where Mis a marking of the Petri net constructed in the previous step, and qis a state of the transition system. 3. Iterate 1 and 2 until each leaf vertex v¼ðM;qÞof the corresponding covering tree is identical to some ancestor vertex v0¼ðM0;q0Þ, i.e., M0¼Mand q0¼q. When iteration takes place (M0<M), new constraints are added to the linear problem solved in step 1. These new constraints account for the boundedness of the new net derived, for the case of the repetitive sequence between M0and M. If step 1 is done with language T, the final net obtained provides an upper bound for k[15]. Although this strategy to provide an upper bound has high complexity, it might be used when there is no knowledge on the maximal cardinality needed for the regions. For many practical purposes, it is also possible to progressively increase the size of kduring synthesis iterations. Note that this problem was not considered in previous work [11], [9]. 7IRREDUNDANT COVERS In the methods presented in previous sections, all the minimal regions were used to satisfy the properties (bisimilarity and language inclusion, respectively). In this section we show that, as in the case of 1-bounded minimal regions [11], the number of minimal general regions needed might be smaller than the total number of minimal regions. Regions that are not needed for deriving a correct PN (under language inclusion or bisimilarity) are called redundant. CARMONA ET AL.: NEW REGION-BASED ALGORITHMS FOR DERIVING BOUNDED PETRI NETS 377 Fig. 7. Exploration of regions in Algorithm 2 for ERðaÞ: minrðaÞ¼1;maxrðaÞ¼0. We start by defining an important set of states related to an event: Definition 7.1 (Enabling Closure). Given an event eand a set of regions R, the enabling closure of ewith respect to Ris defined as ECðeÞ¼ \ q2ð e\RÞ suppðqÞ: The enabling closure of an event erepresents the set of states that enable eif the set of preregions is only considered for a given set of regions R. The intuition behind the theory of the remainder of this section is the following: given a set of regions R, if a region rdoes not reduces the enabling closure of any event, then the language of the Petri net derived by Algorithm 1 from Rand from Rfrgis the same. To prove that a given region is not needed by Algorithm 1, a stepwise simplification of the arcs arising in the place is applied. Fig. 8 illustrates the idea: region r2eis shown together with the corresponding partition based on the cardinality of its states (only the partition for states corresponding to the arities g1;...;gþ2is shown). Accordingly, the enabling topset derived from region r(see Definition 3.4) will be >gðrÞ. However, if >g1ðrÞis considered instead as enabling topset, ECðeÞis still preserved due to the presence of region q. As a consequence, the arc derived by Algorithm 1 will have weight g1instead of g.Ingeneral,this methodology can lead to arcs with zero weight, which can be removed. When all arcs arising in a place have been removed, then the place can be safely removed from the Petri net without modifying its language. The rest of the section formalizes this idea. Theorem 7.1. Given a TS ¼ðS; E; A; sinÞand Ra set of regions, let ebe an event and a region r2e\Rsuch that ERðeÞ> gðrÞ. If the following equality holds ECðeÞ¼ \ q2ðefrgÞ suppðqÞ 0 @1 A\> g1ðrÞ; then the arcs p! geand e! gþrðeÞpin the PN derived by Algorithm 1 can be substituted by the arcs p! g1eand e! gþrðeÞ1p, respectively, as long as gþrðeÞ10, leading to PN0. Moreover, LðPNÞ¼LðPN0Þ. Corollary 7.1. Given a place p, if successive applications of Theorem 7.1 are applied making every arc p! 0e, then pis redundant. In the results presented above, a set of regions Ris used for which the set eis defined for every event e, i.e., eR. Therefore, the notion of redundancy presented in Corollary 7.1 is done with respect to a given set of regions. In general, the notion of redundancy is not monotonic, i.e., if places p1and p2are redundant with respect to the set of regions R, it does not necessarily imply that p2is redundant with respect to Rfr1g, or vice versa. Hence, redundancies can arise in the approaches described in the previous sections. We can define irredundant minimal covers for each one of these approaches: .In the language-inclusion approach (Section 4): the cover will contain only those regions whose removal modify the enabling closure of some event. .In the bisimilarity approach (Section 5): regions that are not necessary for the excitation closure of any event will not appear in the cover. 8LABEL SPLITTING In some applications, the maximal bound accepted in the derived PN cannot be exceeded. If a TS is not k-ECTS and the bound cannot be incremented further, then only PNs overapproximating the initial TS can be derived with the method presented so far (see Section 4). This section presents a simple yet practical technique to escape from this problem. Let us illustrate the technique with the running example shown in Fig. 4a. Assume that the maximal bound accepted is 1, and a PN with bisimilar behavior must be generated. As reported in Figs. 4b and 4c, the derived PN on the set of minimal 1-bounded regions accepts more traces than the initial TS. Now let us split events aand bin the TS as shown in Fig. 9a. The new events appearing, a1,a2,b1, and b2are treated as different events and will generate a transition each in Algorithm 1. The new TS is 1-ECTS with corresponding PN shown in Fig. 9b. The fact that transitions keep the label of the original events 378 IEEE TRANSACTIONS ON COMPUTERS, VOL. 59, NO. 3, MARCH 2010 Fig. 8. Situation where the arc r! gecan be converted into p! g1e. Fig. 9. (a) Transition system after application of label splitting on events aand b, (b) Petri net derived by Algorithm 1 on the set of minimal regions from TS (a). guarantees that the reachability graph of the PN in Fig. 9b is bisimilar to TS of Fig. 4a. The formal definition of the technique is presented: Definition 8.1 (Label splitting). Let TS ¼ðS; E; A; sinÞbe a transition system. The splitting of event e2Ederives a transition system TS0¼ðS;E0;A 0;s inÞ,withE0¼E feg[fe1;...;e ng, and such that every transition ðs1;e;s 2Þ2 Acorresponds to exactly one transition ðs1;e i;s 2Þ, and the rest of transitions for events different from eare preserved in A0. This section presents heuristics to guide the label splitting technique for the achievement of the excitation closure. The following theorem guarantees completeness of the method: Theorem 8.1. Let TS be a non-k-ECTS. There exists a finite sequence of label splitting transformations that derive a k-ECTS TS’ bisimilar to TS. Theorem 8.1 provides only an upper bound on the number of splittings to be done to achieve excitation closure. In the remainder of this section, we provide heuristics to choose, among all the possible splittings, those that may be more likely to repair the excitation closure violations. In [9], some effective heuristics based on the excitation closure condition (see Definition 5.1) are presented for label splitting. Here, we briefly sketch the main idea of each heuristic: .Splitting disconnected ERs: when the ER of an event can be partitioned into disconnected components, and some of these components satisfy the excitation closure. .EC-guided splitting: for a nonexcitation closed event e, the multisets reached when expanding ERðeÞ(see Section 6) are ordered according to the number of events with constant gradient, and the more promising multiset (the one with more events with constant gradient) induce the event to split. 8.1 Bisimulation-Based Algorithm A complete algorithm for deriving a PN with bisimilar reachability graph to the initial TS is presented in Algorithm 3. The algorithm combines the generation of minimal regions (Algorithm 2, presented in the previous section) together with the label splitting technique presented in the previous section, which is applied only when excitation closure does not hold for the actual TS and the maximal allowed bound (kmax) is reached. The label splitting technique can be used also in the language-inclusion approach: if some events are considered to be critical in the sense that no overapproximation must be done for these events, then one can use label splitting to force only excitation closure on these events. 9EXPERIMENTS In the next two sections, we show particular uses of the algorithms presented in this paper (implemented in the tool Genet) for different applications. In the first section, we illustrate how to apply the algorithms in the area of Process Mining. 3 In the second section, we abstract away the particular application and show the benefits of representing complex behaviors with k-bounded Petri nets. 9.1 Synthesis and Mining from Event Logs First, we provide a simple example to illustrate the applicability of the flow presented in Section 1.2 in the emerging area of Process Mining [30]. The example is taken from [29] and considers the process of handling customer orders. The starting point in Process mining is typically a set of traces representing the log of a system. In our example, the event log contains seven traces with the following activities: r¼register,s¼ship,sb ¼send bill, p¼payment,ac ¼accounting,ap ¼approved,c¼close, em ¼express mail,rj ¼rejected, and rs ¼resolve. The set of traces recorded is shown in Fig. 10a, while Fig. 10b shows CARMONA ET AL.: NEW REGION-BASED ALGORITHMS FOR DERIVING BOUNDED PETRI NETS 379 Fig. 10. Process mining: (a) event log, (b) corresponding transition system, and (c) Mined Petri net. 3. We decided to apply both the synthesis and mining algorithms in Section 9.1 on purpose: traditionally synthesis has also been applied in Process Mining [6], [28].