Unbounded product-form Petri nets

Computing steady-state distributions in infinite-state stochastic systems is in general a very dificult task. Product-form Petri nets are those Petri nets for which the steady-state distribution can be described as a natural product corresponding, up to a normalising constant, to an exponentiation of the markings. However, even though some classes of nets are known to have a product-form distribution, computing the normalising constant can be hard. The class of (closed) {\Pi}3-nets has been proposed in an earlier work, for which it is shown that one can compute the steady-state distribution efficiently. However these nets are bounded. In this paper, we generalise queuing Markovian networks and closed {\Pi}3-nets to obtain the class of open {\Pi}3-nets, that generate infinite-state systems. We show interesting properties of these nets: (1) we prove that liveness can be decided in polynomial time, and that reachability in live {\Pi}3-nets can be decided in polynomial time; (2) we show that we can decide ergodicity of such nets in polynomial time as well; (3) we provide a pseudo-polynomial time algorithm to compute the normalising constant.


Introduction
Quantitative analysis of stochastic infinite-state systems.Performance measures of stochastic systems can be roughly classified in two categories: those related to the transient behaviour as expressed by a temporal logic formula and those related to the long-run behaviour whose main measure is the steady-state distribution (when it exists).There are different relevant questions concerning the steady-state distribution of infinitestate systems: (1) given a state and a threshold, one can ask whether the steady-state probability of this state is above (or below) the threshold; (2) given a state, one can compute the steady-state probability of this state, either in an exact way, or in an accurate approximate way; and (3) one can give a symbolic representation of both the set of reachable states and its associated distribution (or an accurate approximation thereof).
Clearly the last question is the most difficult one, and the first breakthrough in that direction has been obtained in the framework of open queuing Markovian networks: in those systems, the measure of a state is obtained as the product of terms, where each term is related to the parameters of a queue (service and visit rate) and the number of clients in the queue [13].In order to get a probability distribution over the set of reachable states,

31:2
Unbounded Product-Form Petri Nets this product is normalised by a constant, whose computation is easy when the service rates of the queues do not depend on the number of clients.This work has been adapted to closed networks, and the main contribution in [9] consists in computing the normalising constant without enumerating the (finite) reachability set, leading to an algorithm which runs in polynomial-time w.r.t. the size of the network and the number of clients.Later, Markov chains generated by a stochastic Petri net with a single unbounded place (that is, quasibirth death processes) have been investigated [8], and an algorithm which approximates up to arbitrary precision the steady-state distribution has been proposed; however the complexity of the algorithm is very high, since it requires the computation of the finite reachability sets of some subnets, whose size may be non primitive recursive.More recently, the abstract framework of (infinite-state) Markov chains with a finite eager attractor (e.g.probabilistic lossy channel systems) has been used to develop an algorithm which approximates up to arbitrary precision the steady-state distribution as well [1], but there is no complexity bound for the algorithm.
Product-form Petri nets.While queuing networks are very interesting since they allow for an explicit representation of the steady-state distribution, they lack two important features available in Petri nets [19,20], which are very relevant for modelling concurrent systems: resource competition and process synchronisation.So very soon researchers have tried to get the best of the two formalisms and they have defined subclasses of Petri nets for which one can establish product-form steady-state distributions.Historically, solutions have been based on purely behavioural properties (i.e. by an analysis of the reachability graph) like in [15], and then progressively have moved to more and more structural characterisations [16,6].Building on the work of [6], [11] has established the first purely structural condition for which a product-form steady-state distribution exists, and designed a polynomial-time algorithm to check for the condition (see also [17] for an alternative characterisation).These nets are called Π 2 -nets.However the computation of the normalising constant remains a difficult open issue since a naive approach in the case of finite-state Π 2 -nets would require to enumerate the potentially huge reachability state-space.Furthermore, the lower bounds shown in [10] for behavioural properties of Π 2 -nets strongly suggest that the computation of the normalising constant can probably not be done in an efficient way.In [6,23], the authors introduce semantical classes of product-form Petri nets for which this constant is computed in pseudopolynomial time.However their approach suffers two important drawbacks: (1) checking whether a net fufills this condition as least as hard as the reachability problem, and (2) the only syntactical class for which this condition is fulfilled boils down to queuing networks.
To overcome this problem, the model of Π 3 -nets is defined in [10] as a subclass of Π 2nets obtained by structuring the synchronisation between concurrent activity flows in layers.This model strictly generalises closed product-form queuing networks (in which there is a single activity flow).Two interesting properties of those nets is that liveness for Π 3 -nets and reachability for live Π 3 -nets can both be checked in polynomial time.Furthermore, from a quantitative point-of-view, the normalising constant of the steady-state distribution can be efficiently computed using an elaborated dynamic programming algorithm.
Product-form Petri nets have been applied for the specification and analysis of complex systems.From a modelling point-of-view, compositional approaches have been proposed [18,2] as well as hierarchical ones [12].Application fields have also been identified, for instance, hardware design and more particularly RAID storage [12], or software architectures [3].In particular, several places may in general be unbounded.Open Π 3 -nets are particularly appropriate when modelling, in an open environment, protocols and softwares designed in layers.In adddition, they allow to specify dynamical management of resources where processes may produce and consume them with no a priori upper bound on their number.
Our results on open Π 3 -nets can be summarised as follows: We first establish that the liveness problem can be solved in polynomial time, and that the boundedness as well as the reachability problem in live nets can also be solved in polynomial time.On the other side, we show that the unboundedness, the reachability and even the covering problem become NP-hard without the liveness assumption.Contrary to the case of closed Π 3 -nets, open Π 3 -nets may not be ergodic (that is, there may not exist a steady-state distribution).We design a polynomial-time algorithm to decide ergodicity of an open Π 3 -net.
Our main contribution is the computation of the normalising constant for ergodic live Π 3 -nets.Our procedure combines symbolic computations and dynamic programming.
The time complexity of the algorithm is polynomial w.r.t. the size of the structure of the net and the maximal value of integers occuring in the description of the net (thus pseudo-polynomial).As a side result, we improve the complexity for computing the normalising constant of closed Π 3 -nets that was given in [10] (the complexity was the same, but was assuming that the number of activity flows is a constant).
In Section 2, we introduce and illustrate product-form nets, and recall previous results.In Section 3, we focus on qualitative behavioural properties, while quantitative analysis is developed in Section 4. All proofs are postponed to the full version of this article.

Product-form Petri nets
Notations.Let A be a matrix over I × J, one denotes A(i, j) the item whose row index is i and column index is j.When I and J are disjoint, W (k) denotes the row (resp.column) vector indexed by k when k ∈ I (resp.k ∈ J).Given a real vector v indexed by I its norm, denoted v , is defined by v = i∈I |v(i)|.Sometimes, one writes v i for v(i).Given two vectors v, w indexed by I their scalar product denoted v • w is defined by i∈I v i w i .Finally, if v is a vector over I, we define its support as We briefly recall Petri nets and stochastic Petri nets.The state of a Petri net, called a marking is defined by the number of tokens contained in every place.A Petri net models concurrent activities by transitions whose enabling requires tokens to be consumed in some places and then tokens to be produced in some places.

Definition 1 (Petri net).
A Petri net is a tuple N = (P, T, W − , W + ) where: P is a finite set of places; T is a finite set of transitions, disjoint from P ; W − and W + are P × T matrices with coefficients in N.
W − (resp.W + ) is called the backward (resp.forward) incidence matrix, W − (p, t) (resp.W + (p, t)) specifies the number of tokens consumed (resp.produced) in place p by the firing of transition t, and W − (t) (resp.W + (t)) is the t-th column of W − (resp.W + ).One assumes that for all t ∈ T , W − (t) = W + (t) (i.e.no useless transition) and for all t = t, either W − (t) = W − (t ) or W + (t) = W + (t ) (i.e.no duplicated transition); this will not affect our results.
A marking of N is a vector of N P ; in the sequel we will often see m as a multiset (m(p) is then the number of occurrences of p), or as a symbolic sum p∈P |m(p)>0 m(p) p.The symbolic sum p∈P p will be more concisely written P .Transition t is enabled by marking m ∈ N P if for all p ∈ P , m(p) W − (p, t).When enabled, its firing leads to the marking m defined by: for all p ∈ P , . Given an initial marking m 0 ∈ N P , the reachability set R N (m 0 ) is the smallest set containing m 0 and closed under the firing relation.When no confusion is possible one denotes it more concisely by R(m 0 ).Later, if m ∈ R(m 0 ), we may also write m 0 → * m.We will call (N , m 0 ) a marked Petri net From a qualitative point of view, one is interested by several standard relevant properties including reachability.Liveness means that the modelled system never loses its capacity: for all t ∈ T and m ∈ R(m 0 ), there exists m ∈ R(m) such that t is enabled in m .Boundedness means that the modelled system is a finite-state system: there exists B ∈ N such that for all m ∈ R(m 0 ), m B. While decidable, these properties are costly to check: (1) Reachability is EXPSPACE-hard in general and PSPACE-complete for 1-bounded nets [7], (2) using results of [21] liveness has the same complexity, and (3) boundedness is EXPSPACE-complete [22].Furthermore there is a family of bounded nets {N n } n∈N whose size is polynomial in n such that the size of their reachability set is lower bounded by some Ackermann function [14].Example 2. An example of marked Petri net is given on Figure 1.Petri nets are represented as bipartite graphs where places are circles containing their initial number of tokens and transitions are rectangles.When W − (p, t) > 0 (resp.W + (p, t) > 0) there is an edge from p (resp.t) to t (resp.p) labelled by W − (p, t) (resp.W + (p, t)).This label is called the weight of this edge, and is omitted when its value is equal to one.For sake of readability, one merges edges p leading to a pseudo-edge with two arrows, as in the case of (r 0 , t 5 ).
The net of Figure 1 is not live.Indeed t 0 , t 1 , t 2 , t 3 and t 4 will never be enabled due to the absence of tokens in p 0 , p 1 , p 2 , p ext .Suppose that one deletes the place p ext and its input and output edges.Consider the firing sequence Since the marking p 2 + 3q 3 + r 0 is (componentwise) larger than the initial marking q 3 + r 0 , we can iterate this sequence and generate markings with an arbitrarily large number of tokens in p 2 and q 3 ; this new net is unbounded.Applying technics that we will develop in this paper (Section 3), we will realize that this new net is actually live.

Definition 3 (Stochastic Petri net).
A stochastic Petri net (SPN) is a pair (N , λ) where: A marked stochastic Petri net (N , λ, m 0 ) is a stochastic Petri net equipped with an initial marking.In a marked stochastic Petri net, when becoming enabled a transition triggers a random delay according to an exponential distribution with (firing) rate λ(t).When several transitions are enabled, a race between them occurs.Accordingly, given some initial marking m 0 , the stochastic process underlying a SPN is a continuous time Markov chain (CTMC) whose (possibly infinite) set of states is R(m 0 ) and such that the rate Q(m, m ) of a transition from some m to some m = m is equal to Matrix Q is called the infinitesimal generator of the CTMC (see [5] for more details).
From a quantitative point of view, one may be interested in studying the long-run behaviour of the net and in particular in deciding whether there exists a steady-state distribution and in computing it in the positive case.When the underlying graph of the CTMC is strongly connected (i.e. an irreducible Markov chain) it amounts to deciding whether there exists a non-zero distribution It is in general non-trivial to decide whether there exists a steady-state distribution, and even when such a distribution exists, given some state it is hard to compute its steady-state probability (see the introduction).Furthermore, even when the net is bounded, the size of the reachability set may prevent any feasible computation of π.
Thus one looks for subclasses of nets where the steady-state distribution π can be computed more easily and in particular when π has a product-form, that is: there exist a constant vector µ ∈ R P ≥0 only depending on N such that for all m ∈ R(m 0 ), is the so-called normalising constant [9].The most general known class of nets admitting a structural product-form distribution is the class of Π 2 -nets [11].It is based on two key ingredients: bags and witnesses.A bag is a multiset of tokens that is consumed or produced by some transition.Considering a bag as a whole, one defines the bag graph whose vertices are bags and, given a transition t, an edge goes from the bag consumed by t to the bag produced by t.Observe that there are at most 2|T | vertices and exactly |T | edges.This alternative representation of a net via the bag graph does not lose any information: from the bag graph, one can recover the original net.Formally: Definition 4 (Bag graph of a Petri net).Let N = (P, T, W − , W + ) be a Petri net.Then its bag graph is a labelled graph G N = (V N , E N ) defined by: Example 5.The bag graph of the net of Figure 1 is described in Figure 2. The bag is written inside the vertex (the external label of the vertices will be explained later).Observe that this graph has three connected components, both of them being strongly connected.We now turn to the notion of witness.A queuing network models a single activity flow where activities are modelled by queues and clients leave their current queue when served and enter a new one depending on a routing probability.In Π 2 -nets there are several activity flows, one per component of the bag graph.So one wants to witness production and consumption of every bag b by the transition firings.In order to witness it, one looks for a linear combination of the places wit such that for every firing of a transition t that produces (resp.consumes) the bag b, for every marking m, m • wit is increased (resp.decreased) by one unit, and such that all other transition firings let m • wit invariant.Definition 6 (Witness of a bag).Let N = (P, T, W − , W + ) be a a Petri net, b ∈ V N and wit ∈ Q P .Then wit is a witness of b if: Example 7. All bags of the net of Figure 1 have (non unique) witnesses.We have depicted them close to their vertices in Figure 2.For instance, consider the bag b = q 1 +r 0 : transition t 6 produces b while transition t 7 consumes it.Let us check that w = q 1 − p ext is a witness of b. t 6 produces a token in q 1 and the marking of p ext is unchanged.t 7 consumes a token in q 1 and the marking of p ext is unchanged.The other transitions that change the marking of q 1 and p ext are t 1 and t 3 .However since they simultaneously produce or consume a token in both places, m • w is unchanged (m is the current marking).
The definition of Π 2 -nets relies on structural properties of the net and on the existence of witnesses.Every connected component of the graph bag will represent an activity flow of some set of processes where every activity (i.e. a bag) has a witness.
Observe that the first condition called weak reversibility ensures that the reachability graph is strongly connected since the firing of any transition t can be "withdrawn" by the firing of transitions occurring along a path from W + (t) to W − (t) in the bag graph.The complexity of reachability in weakly reversible nets is still high: EXPSPACE-complete [4].
The next theorem shows the interest of Π 2 -nets.Let us define λ(b) the firing rate of a bag b by λ(b) = t|W − (t)=b λ(t) and the choice probability pr t of transition t by pr t = λ(t) λ(W − (t)) .

31:7
The routing matrix P of bags is the stochastic matrix indexed by bags such that for all t, P(W − (t), W + (t)) = pr t and P(b, b ) = 0 otherwise.Consider vis some positive solution of vis • P = vis.Since P is a stochastic matrix such a vector always exists but is not unique in general; however given b, b two bags of the same connected component, vis(b ) vis(b) measures the ratio between visits of b and b in the discrete time Markov chain induced by P. Theorem 9 ([11]).Let (N , λ, m 0 ) be a marked stochastic Π 2 -net.Then defining for all when ergodic, the associated Markov chain admits v −1 v as steady-state distribution.
Let us discuss the computational complexity of the product-form of the previous theorem.First deciding whether a net is a Π 2 -net is straightforwardly performed in polynomial time.The computation of the visit ratios, the witnesses and the rate of bags can also be done in polynomial time.So computing an item of vector v is easy.However without additional restriction on the nets the normalising constant v −1 requires to enumerate all items of R N (m 0 ), which can be prohibitive.
So in [10], the authors introduce Π 3 -net, a subclass of Π 2 -net which still strictly generalises closed queuing networks, obtained by structuring the activity flows of the net represented by the components of the bag graph.First there is a bijection between places and bags such that the input (resp.output) transitions of the bag produce (consume) one token of this place.The other places occurring in the bag may be viewed as resources associated with the bag and thus the potential of the bag is its total number of resources.Second the components of the graph may be ordered as N layers such that the resources of a bag occurring in layer i correspond to places associated with bags of layer i − 1 (for i > 1) and more precisely to those with maximal potential.Informally a token in such a place means that it is a resource available for the upper layer.V N is partitioned into N strongly connected components V 1 , . . ., V N .One denotes: is obtained by deleting some place p ext ∈ P N (and its input/output edges) from an N -closed Π 3 -net.
Given an open Π 3 -net N , N denotes the closed net based on which N has been defined.For every 1 ≤ i ≤ N , we will later write P ¬ max i for the set P i \ P max i , and T i for the set of transitions t such that W − (t) ∈ V i .The next proposition establishes that Π 3 -nets are product-form Petri nets.

31:8 Unbounded Product-Form Petri Nets
The next theorem shows the interest of closed Π 3 -nets.
Theorem 13 ([10]).Let (N , λ, m 0 ) be a N -closed Π 3 -net.Then: (N , m 0 ) is bounded.One can decide whether (N , m 0 ) is live in polynomial time.When (N , m 0 ) is live, one can decide in polynomial time, given m, whether m ∈ R N (m 0 ).For any fixed N , when (N , m 0 ) is live, one can compute the normalising constant of the steady-state distribution (i.e.v −1 in Theorem 9) in polynomial time with respect to |P |, |T |, the maximal weight of the net's edges, and m 0 (thus in pseudo-polynomial time w.r.t. the size of m 0 ).
The above results do not apply to infinite-state systems and in particular to the systems generated by open Π 3 -nets.In addition, the polynomial-time complexity for computing the normalising constant requires to fix N .We address these issues in the next sections.

Qualitative analysis
In this section we first give a simple characterisation of the liveness property in a marked Π 3 -net.We then fully characterise the set of reachable markings in a live marked Π 3 -net.These characterisations give polynomial-time algorithms for deciding liveness of a marked Π 3 -net, and the boundedness property of a live marked Π 3 -net.We end the section with a coNP-hardness result for the boundedness property of a marked Π 3 -net, when it is not live.
For the rest of this section, we assume N = (P, T, W − , W + ) is an open or closed Π 3 -net with N layers.We further use the notations of Definition 10.In particular, if N is open, then we write p ext for the place which has been removed (and we call it virtual).We therefore set P N = P N ∪ {p ext } if the net is open and P N = P N otherwise; For every 1 ≤ i ≤ N − 1 we define P i = P i ; And we set P = N i=1 P i .

Liveness analysis
We give a simple characterisation of the liveness property through a dependence between the number of tokens at some layer and potentials of places activated on the next layer.More precisely, for every 1 ≤ i ≤ N − 1, Live i is defined as the set of markings m such that: Note that p = p ext can only happen when N is open and i = N − 1.We additionally define Live N as the set of markings m such that m • P N > 0 if N is closed, and as the set of all When N is open, we write POT N = pot(p ext ).Given a marking m, when no place p fulfills p ∈ P i+1 and (m(p) > 0 or p = p ext ), the minimum is equal to POT i+1 .Thus given a marking m, the condition m ∈ Live i for i < n only depends on the values of m(p) for p ∈ P i ∪ P ¬ max i+1 .The intuition behind condition Live i is the following: transitions in j≤i T j cannot create new tokens on layer i (layer i behaves like a state machine, and smaller layers do not change the number of tokens in that layer); therefore, to activate a transition of T i+1 out of some marked place p ∈ P i+1 , it must be the case that enough tokens are already present on layer i; hence there should be at least as many tokens in layer i as the minimal potential of a marked place in layer i + 1.When N is open, the virtual place p ext behaves like a source of tokens, hence it is somehow always "marked"; this is why it is taken into account in the right part of Live i .The following characterisation was already stated in [10] in the restricted case of closed nets.Theorem 14.A marking m is live if and only if for every Example 15.Building on the marked Petri net of Figure 1, the marking q 3 + r 0 is live when the net is open but not live if the net is closed.Indeed, transitions of the two first layers can trivially be activated from q 3 +r 0 (hence by weak-reversibility from every reachable marking).We see that in the case of the closed net, transitions of layer 3 cannot be activated (no fresh token can be produced on that layer).On the contrary, in the case of the open net, the token in q 3 can be moved to q 1 , which will activate transition t 3 ; from there, all transitions of layer 3 will be eventually activated.
As a consequence of the characterisation of Theorem 14, we get: Corollary 16.We can decide the liveness of a marked Π 3 -net in polynomial time.

Reachable markings
We will now give a characterisation of the set of reachable markings R N (m 0 ) when m 0 is live.We will first give linear invariants of the net: those are vectors in the left kernel of W (or P -flows).The name "invariants" comes from the fact that they will allow to infer real invariants satisfied by the reachable markings.Furthermore, for every 1 ≤ i ≤ N , for every p ∈ P i , we define cin(p) = POT i − pot(p).Except when N is open and i = N , the cin value of a place is nonnegative.Proposition 17.The following vectors are linear invariants of N : for every First observe that for i < N − 1, Supp(v (i) ) = P i ∪ P ¬ max i+1 .p 2 : 3 Thus given a marking m, only firing of transitions t . This is not the case of a transition t ∈ T i since it moves a token from a place of P i to another one.
To give an intuition why transitions in T i+1 do not change m • v (i) , we consider part of the closed net (that is, p ext is a real place) of Figure 1 depicted on the right, where numbers close to place names are potential values.We focus on transition t 1 and explain why m • v (2) is unchanged by its firing.The impact of transition t 1 is to decrease the sum p∈P2 p by 2; due to the weights of places of P 3 in v (2) , place p 2 counts as 0 and place p ext counts as +2.This intuition extends into a formal proof.
For every 1

31:10
Unbounded Product-Form Petri Nets More complex invariants were given in [10] for closed Π 3 -nets.The advantage of the above invariants is that each of them only involves two neighbouring layers.This will have a huge impact on various complexities, and will allow the development of our methods for quantitative analysis.
Example 19.Going back to the Petri net of Figure 1, with initial marking m 0 = q 3 + r 0 .We first consider the closed net.Then: POT 3 = 2 and POT 2 = 1.Therefore: We now turn to the open net, obtained by deleting p ext .Definition of POT 3 differs from the previous case: POT 3 = pot(p ext ) = 1 and POT 2 = 1.Therefore: The invariants of Corollary 18 do not fully characterise the set of reachable markings, since they do not take into account the enabling conditions of the transitions.However, they will be very helpful for characterising the reachable markings when m 0 is live.Theorem 20.Suppose that (N , m 0 ) is a live Π 3 -net.Then: Thus reachability in live Π 3 -nets can be checked in polynomial time.

Example 21.
In the open Petri net of Figure 1, with initial marking m 0 = q 3 + r 0 , the sets Live i are Live 1 = {m | m(r 0 ) + m(r 1 ) + m(q 0 ) 1}, Live 2 = {m | 3 i=0 m(q i ) + m(p 0 ) 1} and Live 3 = N P .Observing that Inv i (m 0 ) ⊆ Live i for 1 i 3, the net has reachability set R N (m 0 ) = {m | m(r 0 ) + m(r 1 ) + m(q 0 ) = 1 and The idea of the proof when the net is closed is to show that, from every marking m satisfying the right handside condition in the theorem, one can reach a specific marking m * 0 (where, for every 1 ≤ i ≤ N , C m0 i tokens are in one arbitrary place of P max i ).Hence, given two markings m and m satisfying the conditions, m → * m * 0 and m → * m * 0 , which implies by weak reversibility of the net: m → * m * 0 → * m .This is in particular the case from m 0 : every marking satisfying the conditions is reachable from m 0 .In the case of an open net, this is a bit more tricky, and a joint marking to every pair (m, m ) of markings satisfying the conditions has to be chosen.

Boundedness analysis
As a consequence of the characterisation given in Theorem 20, we get: Corollary 22.We can decide the boundedness of a live marked Π 3 -net in polynomial time.

31:11
Indeed, it can be shown that, if N is closed, then N is bounded, and that if N is open, then it is bounded if and only if cin(q) > 0 for all q ∈ P N (that is, p ext has maximal potential, and no other place of P N has maximal potential).Furthermore, if N is bounded, then the overall number of tokens in the net is bounded by The polynomial-time complexity of Corollary 22 is in contrast with the following hardness result, which can be obtained by a reduction from the independent-set problem.Proposition 23.Deciding the boundedness of a marked Π 3 -net which is not live is coNPhard.The reachability (and even the coverability) problem is NP-hard.

4
Quantitative analysis Contrary to closed Π 3 -nets, open Π 3 -nets may not be ergodic.In this section, we first give a simple characterisation of the ergodicity property for open Π 3 -nets, which gives us a polynomial-time algorithm for deciding ergodicity.We then provide a polynomial-time algorithm for computing the steady-state distribution of ergodic (open and closed) Π 3 -nets.
For the rest of this section, we assume that (N , λ, m 0 ) is a stochastic Π 3 -net with N layers, and that m 0 is live.Let W be the maximal weight of the edges of N .Then we assume that the constants µ p = b∈V N (vis(b)/λ b ) wit b •p have already been precomputed (in polynomial time with respect to |P |, |T | and log(1 + W)). 1  In what follows, and for every vector δ ∈ N P , we denote by v(δ) the product p∈P µ δ(p) p .Consequently, the vector v mentioned in Theorem 9 is then defined by v(m) = v(m) for all markings m ∈ R(m 0 ), and its norm is v = m∈R(m0) v(m).Note that v and v only differ by their domain.In addition, in what follows, and for every set Z ⊆ P , we simply denote by cin(Z) the formal sum p∈Z cin(p)p.

Ergodicity analysis
We assume here that N is open.We give a simple characterisation of the ergodicity property through a comparison of the constants µ p for a limited number of places p.Those constraints express congestion situations that may arise; we show that they are sufficient.These places are the elements of the subset Y of places that is defined by Y = P N ∪ P max N −1 .In particular, as soon as the initial marking m 0 is live, then the ergodicity of the stochastic net (N , λ, m 0 ) does not depend on m 0 .
According to Theorem 9, the net is ergodic if and only if the norm v = m∈R(m0) v(m) is finite.Hence, deciding ergodicity amounts to deciding the convergence of a sum.The following characterisation holds.
Theorem 24.Let (N , λ, m 0 ) be a live open stochastic Π 3 -net with N layers.This net is ergodic if and only if all of the following inequalities hold: for all places p ∈ P N , if cin(p) = 0, then µ p < 1; for all places p, q ∈ P N , if cin(p) > 0 > cin(q), then µ |cin(q)| p µ cin(p) q < 1; for all places p ∈ P max N −1 and q ∈ P N , if 0 > cin(q), then µ |cin(q)| p µ q < 1.

Proof (sketch).
Let F be the family formed of the vectors p (for p ∈ P N such that cin(p) = 0), cin(p)q − cin(q)p (for p, q ∈ P N such that cin(p) > 0 > cin(q)) and q − cin(q)p (for C O N C U R 2 0 1 7

31:12
Unbounded Product-Form Petri Nets p ∈ P max N −1 and q ∈ P N such that 0 > cin(q)).Let also L be the sublattice of N P generated by the vectors in F, and let G be the finite subset of N P formed of those vectors whose entries are not greater than some adequately chosen constant G.
Since m 0 is live, Theorem 20 applies, which allows us to prove the inclusions {m 0 } + L ⊆ R(m 0 ) ⊆ G + L. Hence, the sum m∈R(m0) v(m) is finite iff the sum m∈L v(m) is finite, i.e. iff each constant v(δ) is (strictly) smaller than 1, for δ ∈ F.
Example 25.Going back to the open Π 3 -net of Figure 1, with any live initial marking m 0 , we obtain the following necessary and sufficient conditions for being ergodic: As a consequence of the characterisation of Theorem 24, we get: Corollary 26.We can decide the ergodicity of a marked, live and open stochastic Π 3 -net in polynomial time.

Computing the steady-state distribution
In case the Π 3 -net is ergodic, it remains to compute its steady-state distribution, given by π(m) = v −1 v(m) for all m ∈ R(m 0 ).Since we already computed R(m 0 ) and v(m) for all markings m ∈ R(m 0 ), it remains to compute the normalising constant v .
This section is devoted to proving the following result.This theorem applies to both closed and open Π 3 -nets.For closed nets, it provides a similar yet stronger result than Theorem 13, where the polynomial-time complexity was obtained only for a fixed value of N (the number of layers of the net).
We prove below Theorem 27 in the case of open nets.The case of closed nets is arguably easier: one can transform a closed net into an equivalent open net by adding a layer N + 1 with one place (and one virtual place p ext ), and set a firing rate λ t = 0 for all transitions t of the layer N + 1.We therefore assume for the rest of this section that N is open.
We first describe a naive approach.The normalisation constant v can be computed as follows.Recall the family F introduced in the proof of Theorem 24.We may prove that the set R(m 0 ) is a union of (exponentially many) translated copies of the lattice L generated by F. These copies may intersect each other, yet their intersections themselves are translated copies of L. Hence, using an inclusion-exclusion formula and a doubly exponential computation step, computing the sum v = m∈R(m0) v(m) reduces to computing the sum ∈L v( ).The family F is not free a priori, hence computing this latter sum is not itself immediate.Using again inclusion-exclusion formulae, we may write L as a finite, disjoint union of exponentially many lattices generated by free subfamilies of F. This last step allows us to compute ∈L v( ), and therefore v .Such an approach suffers from a prohibitive computational cost.Yet it is conceptually simple, and it allows proving rather easily that v is a rational fraction in the constants µ p , whose denominator is the product ∈F (1 − v( )).
Our contributions.Unfortunately Π 3 -nets generate finite-state systems.Here we address this problem by introducing and studying open Π 3 -nets.Informally, an open Π 3 -net has a main activity flow, which roughly corresponds to an open queuing network, and has other activity flows which are structured as in (standard, or closed) Π 3 -nets.More precisely, in the case of a single activity flow this model is exactly equivalent to an open queuing network, but the general model is enriched with other activity flows, raising difficult computation issues.
This firing is denoted by m t − → m .The incidence matrix W = W + − W − allows one to rewrite the marking evolution as

Figure 2
Figure 2 Bags and witnesses.

Definition 10 (
Π 3 -net).Let N be a net.Then N is an N -closed Π 3 -net if: There is a bijection between P and V N .Denoting b p the bag associated with place p (and p b the place associated with bag b), we have b p (p) = 1.The potential of a place pot(p) is equal to b p − 1.
and if N is closed, we define Inv N (m 0 ) as the set of markings m such that m • v (N ) = C m0 N .For uniformity, if N is open, we define Inv N (m 0 ) as the set of all markings.As a consequence of Proposition 17, we get: Corollary 18. R N (m 0 ) ⊆ N i=1 Inv i (m 0 ).C O N C U R 2 0 1 7

Theorem 27 .
Let (N , λ, m 0 ) be a live ergodic stochastic Π 3 -net.There exists an algorithm for computing the normalising constant v in polynomial time with respect to |P |, |T |, W, and m 0 (thus in pseudo-polynomial time).