On calculation of state space for linear system of simple sequential processes with resources

This work focuses on the calculation of state space for linear system of simple sequential processes with resources (LS3PR). The method, different from reachability graphs rendering high computational complexity, finds reachable markings by combinatorics. First, the set of invariant markings can be obtained by combinatorics if the influence of deadlocks is ignored. Unfortunately, some of reachable states in the set of invariant markings are proved to be spurious if deadlocks exist. Second, we find the spurious markings by computing a set of minimal spurious markings, which can be calculated by a proposed algorithm based on strict minimal siphons. The obtained spurious markings are proved to cover all the spurious markings of the LS3PR. Removing the spurious markings from the set of invariant markings, the left ones constitute the state space of the LS3PR. The detailed method is shaped to an algorithm. The effectiveness of the algorithm is proved by example calculation and analysis. Finally, we analyze the computational complexity of the proposed method compared with reachability graphs.


Introduction
Different kinds of products can be made in a flexible manufacturing system (FMS) by computer control based on the allocation of a limited number of shared resources. Due to the existence of competition for resources, deadlocks are always unavoidable. Petri nets, as a tool with powerful modeling and analysis abilities, are widely used in the deadlock prevention problems of resource allocation systems. 1,2 Petri nets-based deadlock prevention uses an offline computation mechanism to impose constraints on a system to prevent the system from reaching deadlock states.
Almost without exception, the existing literatures try to evaluate the performance of liveness-enforcing supervisors in terms of behavioral permissiveness, computational complexity, and structural complexity.
Reachability graph (RG) analysis is an important technique for deadlock control, based on which an optimal or nearly optimal supervisor with high behavioral permissiveness can always be obtained. Depending on the calculation of state space, the theory of regions can definitely find an optimal liveness-enforcing supervisor if it exists. 3 The theory of regions is used in previous studies [4][5][6] for an S 3 PR 7 to obtain a suboptimal livenessenforcing supervisor.
However, reachability analysis 8-10 needs a reachable marking enumeration, which requires a large number of consumptions of resources. In some cases, the analysis may stop due to the exhausted memory. It is shown in the work by Lipton 11 that the complexity of the reachability problem of a Petri net is exponential. Currently, using the popular integrated net analyzer (INA) 12 to obtain the state space of a large Petri net model is difficult, even impossible. Large sets of reachable markings with shared data structures can be represented by binary decision diagrams (BDDs). Besides, BDDs can implement efficient manipulation on the sets of reachable markings. In order to overcome the state explosion problem, BDD is used by Chen et al. 13 to represent the state space. However, the method still requires a complete enumeration of reachable markings whose number increases exponentially with the size of a Petri net. Hence, state explosion problem is still a technique barrier of using RG analysis to prevent deadlocks in an FMS. Consequently, we figure out another way with relatively low computational complexity, different from RG, to handle state-space problem.
We tackle the problem in the previous work 14 for arbitrary marked graphs by finding the number of reachable markings in an algebraic way. And the subsequent work 15,16 extends the research field from marked graphs to S 3 PR, where might exist deadlocks. It deals with an approximate calculation of the number of reachable markings of an S 3 PR to predict whether the number is beyond the upper limit of computing power.
Our previous works mainly focus on number estimation of reachable markings for deciding whether it is deserved to conduct an RG analysis. In this work, we place emphasis on the complete enumeration of reachable markings for a subclass of S 3 PR, called LS 3 PR. First, we find the set of invariant markings (IMs) of an LS 3 PR by combinatorics. Then, excluding all spurious markings from the set by finding a set of minimal spurious markings basing on strict minimal siphon (SMS), the left markings are the ones to be desired.
The article is organized as follows. Section ''Preliminaries'' presents the preliminaries used throughout this article. The detailed approach of computing the state space of an LS 3 PR is introduced and a well-known example of LS 3 PR is adopted to support the approach in section ''Main approach.'' We perform an analysis on computational complexity of the proposed method compared with RG in section ''Computational complexity analysis and comparison.'' Finally, the conclusion of the article is presented in section ''Conclusion.''

Petri nets
A Petri net is a four-tuple N = (P, T , F, W ), where P and T are finite, nonempty, and disjoint sets. P is a set of places and T is a set of transitions. F (P 3 T ) [ (T 3 P) is called a flow relation, represented by arcs with arrows from places to transitions or from transitions to places. W : (P 3 T ) [ (T 3 P) ! N is a mapping that assigns a weight to an arc: M is used to denote a marking or state of a Petri net N, which is a mapping from P to N. The number of tokens in place p is denoted as M(p). For economy of space, multisets are used to describe markings and vectors. Hence, here, vector M is denoted as P p2P M(p) Á p. (N , M 0 ) is called a net system, where M 0 is called an initial marking of N. M S = P p2S M S (p) Á p is used to denote a marking of a subset, and S P is a mapping from S to N and M(S) is used to denote the sum of tokens in S. M S 0 is called an initial marking of S such that 8p 2 S, M S 0 (p) = M 0 (p). A P-invariant I is called minimal P-semiflow if it is non-negative and its support k I k = fpjI(p) 6 ¼ 0g is not a superset of the support of any other P-invariants. Here, P p2kIk I(p) Á p is used to denote vector I.
and M kIk 0 is a mapping from P I to N with P p2kIk M 0 (p) p as its multiset form. A P-vector of N kIk is a column vector I D : P I ! Z indexed by P I , where P I denotes the set of places in k I k.
the set of IMs of (N kIk , M kIk 0 ). Let I i be a minimal P-semiflow of N and I = P n i = 1 I i be a P-semiflow of N. I Di is a minimal Psemiflow of N kIk and I D = P n i = 1 I Di is a P-semiflow of N kIk . I D and I Di , i 2 f1, 2, . . . , ng, are column vectors: P I ! Z indexed by P I . Let X I be a matrix where each column is a minimal P-semiflow of N kIk .
. Let X be a matrix where each column is a minimal P-semiflow of N and denote the set of IMs of (N ,

LS 3 PR
A class of Petri nets defined by Ezpeleta et al., 7 called LS 3 PR, is introduced in this subsection. Definition 1. A simple sequential process, called S 2 P for short, is a Petri net N = (fp 0 g [ P A , T , F) such that (1) P A 6 ¼ [ denotes the set of operation places; (2) p 0 6 2 P A denotes the idle process place; (3) N is a strongly connected state machine; and (4) every process of N contains idle place p 0 . 7 Definition 2. A system of simple sequential process with resources, called S 3 PR for short, is a Petri net T , F) composed by N 1 and N 2 via P C can be defined as follows: (1) 3. P R is called the set of resource places; for r 2 P R , H(r) = r \ P A is called the set of holders of r.

Definition 3. A linear S 3 PR, called LS 3 PR for short, is an ordinary Petri net
is a strongly connected state machine, such that every cycle contains place p 0 3 PR consisting of n simple sequential processes and S be a siphon in N: 7 1. Any p 2 P A i with I p as its associated minimal P- Any resource r 2 P R with I r as its associated minimal P-semiflow, k I r k = frg [ H(r). 3. 8p 2 ½S, 9r 2 S R , p 2 H(r) and 8r 0 2 P R nfrg, In this article, quasi-safe LS 3 PRs are the subclass of Petri nets we focus on enumerating the reachable markings.

Main approach
This section aims to elaborate on how to completely enumerate the reachable markings of an LS 3 PR. First, for clarity, we use a simple example to exhibit the rough calculation of reachable markings by the proposed method. Second, the set of IMs of an LS 3 PR, obtained in the case of ignoring deadlocks, can be calculated by combinatorics. In the following subsection, we exclude all spurious markings from the set and obtain the reachable markings of the LS 3 PR. Finally, we give an algorithm as well as a supporting example to shape the detailed approach.

A simple example
For the simple LS 3 PR in Figure 1, there are two Pinvariants, I 1 = p 2 + p 6 + p 7 and I 1 = p 3 + p 5 + p 8 , containing resources. Supposing that there exists no deadlock, according to the definition of P-invariant, the tokens stayed in resource place initially can flow freely in the support of the P-invariant. For instance, we can consider that the token in p 7 can flow among p 2 , p 6 , and p 7 freely. Without considering deadlocks, by combinatorics, we can list the IM of the LS 3 PR, as shown in Table 1.
We know that the markings in Table 1 are the reachable markings of the LS 3 PR if there exists no deadlock. Unfortunately, by reachability analysis, M 6 is proved spurious and should be removed. Hence, the reachable markings of the LS 3 PR in Figure 1 are obtained and shown in Table 2.
Thus, in this article, we place an emphasis on how to steer clear of RG to find the state space of an LS 3 PR.

IMs
In this study, first, we construct a state space of an LS 3 PR based on P-invariants. According to the definition of P-invariants, the space can be obtained by combinatorics. In this work, P r -semiflow is used to denote a P-semiflow with resources.  Figure 2, supported by I p 7 , is a marked subnet of the LS 3 PR in Figure 1. I p 7 = p 2 + p 6 + p 7 and M I p 7 0 = p 7 . p 7 has two holders p 2 and p 6 . The token in p 7 can flow freely among p 2 , p 6 , and p 7 . By Corollary 1, we find jI I D (N kIk , M kIk 0 )j = 3, and the specific markings are generated and shown in Table 3. is the initial state of G. Table 1. Invariant markings of the LS 3 PR in Figure 1. Table 2. Reachable markings of the LS 3 PR in Figure 1.
In this article, suppose that the tokens in any minimal P r -semiflow of an LS 3 PR stay in the resources originally. If ignoring deadlocks, the reachable states of (N G , M G 0 ) can be generated by combinatorics. The set of the states is called the set of reachable states of theory permissive of (N G , M G 0 ), denoted as R B (N G , M G 0 ).   Figure 1. I p 7 = p 2 + p 6 + p 7 and I p 8 = p 3 + p 5 + p 8 . The reachable states of k I p 7 k and k I p 8 k are shown in Table 4.
View k I p 7 k and k I p 8 k as a whole, denoted as G. That is to say, G = k I p 7 k [ k I p 8 k. Combining the states in R(N kI p 7 k , M kI p 7 k 0 ) and R(N kI p 8 k , M kI p 8 k 0 ), we have the reachable states of theory permissive of (G, M G 0 ) and are show in Table 5.
Finally, considering idle places, by Property 3, we find the reachable states of theory permissive of (N , M 0 ) in Figure 1, as shown in Table 6.

Unreachable states exclusion
Without deadlocks, the tokens in the P r -semiflows of an LS 3 PR can flow freely among the places in the support of the P r -semiflow. The existence of deadlocks makes part of states unreachable. It is proved in the work by Ezpeleta et al. 7 that an SMS means at least a deadlock. Hence, we concentrate on an SMS-based method to determine the unreachable states from the upper bound. Let Proof. We prove it by contradiction. If M G u is reachable, let M P = fMjM = M G u À p i + p j 1 + Á Á Á + p j k + r i , p i 2 fp 1 , p 2 , . . . , p m g, k ! 1g be the set of closely previous states of M G u in R(N G , M G 0 ), where p j 1 , . . . , p j k 2 p i \ P A and r i 2 p i \ P R . Supposing that p j i 2k I r j i k, it is found that, 8M 2 M P , there exists p such that p 6 ¼ p j i , p 2k I r j i k, and M(p) = 1. At this moment, there are two tokens in k I r j i k since M(p) = 1 and M(p j i ) = 1. It contradicts with the fact that I r j i is a P r -semiflow. Hence, M G u is an unreachable state of (N G , M G 0 ).

Definition 7.
Let G be an m-*configuration of an LS 3 PR (N , M 0 ) and M G u = p 1 + p 2 + Á Á Á + p m be an ). Table 5. Reachable states of theory permissive of (N G , M G 0 ). Table 6. Reachable states of theory permissive of (N, M 0 ) in Figure 1.
, where G 0 = fpjp 2 G, p 6 2 jjI r i jjg and I r i denotes the minimal P r -semiflow where p i stays. (N , M 0 ). G is at an unreachable state if G 0 = fpjp 2 G, p 6 2k I r i kg is at an unreachable state.
The net N s shown in Figure 3(a) is a subnet of the LS 3 PR in Figure 1. jjI p 7 jj and jjI p 8 jj make up a two-*configuration, denoted as G = jjI p 7 jj [ jjI p 8 jj = fp 2 , p 3 , p 5 , p 6 , p 7 , p 8 g.
There exists an SMS S = fp 3 , p 6 , p 7 , p 8 g in G. M G 0 = p 7 + p 8 is the initial state of N s . By Theorem 2, it is concluded that M G u = p 3 + p 6 is an unreachable state of (N G , M G 0 ). As known to all, the unreachable states of an LS 3 PR are generated due to the existence of deadlocks. Precisely, deadlocks render part of states unreachable. By Property 4, we can find that the unreachable states of an LS 3 PR (N, M 0 ) can be derived from the MUS of the *configurations in (N , M 0 ). If we can find all the MUSs, we can obtain all the unreachable states of (N , M 0 ) correspondingly.
be an m-*configuration of an LS 3 PR (N, M 0 ). Suppose that p 1 2k I r 1 k \P A , p 2 2k I r 2 k \P A , ., p i 2k I r i k \P A , ., p m 2k I r m k \P A . M G = p 1 + p 2 + Á Á Á + p i + Á Á Á + p m is a reachable state of (N G , M G 0 ) if M G À p i is a reachable state of (N G 0 , M G 0 0 ) and 9p2 p i \ P A , p 6 2 G, where G 0 = fp 0 jp 0 2 G, p 0 6 2 jjI r i jjg and I r i denotes the minimal P r -semiflow where p i stays.
Proof. An m-*configuration, as an independent part of N, and its reachable states are independent of that of other parts. If M G À p i is a reachable state of (N G 0 , M G 0 0 ), we just need to check whether p i can be marked. If p i can be marked, then we can affirm that M G is reachable. We find there exists p2 p i \ P A , p 6 2 G implying that whether p can be marked does not depend on G. Hence, p i can be marked and M G is a reachable state of (N G , M G 0 ). Proof. Without considering deadlocks, we can find a set of all the reachable states of theory permissive, denoted as R G . Actually, R G contains two parts: set of reachable states R R and set of unreachable states R U . By the theory of resource circuit, operation places in G can be divided into two parts: . . , p m g. Supposing that 8p 2 K, p 2 P I , by Theorem 2, M is confirmed to be unreachable. Suppose that there is one place belonging to P O and the other places (P D is the set of the other places) belonging to P I in K. If M 0 = P p2P D p is an unreachable state, by Property 4, M is confirmed to be unreachable; else by Lemma 1, M is confirmed to be reachable. Suppose that there are two place belonging to P O and the other places (P D is the set of the other places) belonging to P I in K. If M 0 = P p2P D p is an unreachable state, by Property 4, M is confirmed to be unreachable; else by Lemma 1, M is confirmed to be reachable. By parity of reasoning, we can classify all the states in R G into R R and R U . Thus, it is noticed that the state in R G either satisfies the condition in Theorem 2 and Property 4 or Lemma 1. Furthermore, Property 4 is based on Theorem 2. Hence, in this sense, we can find all the unreachable state of (N G , M G 0 ) by Theorem 2. However, by Property 4, it is found that not all the unreachable states of a *configuration G obtained by Theorem 2 are a minimal one of (N G , M G 0 ). Algorithm 1 reserves the unreachable states that are minimal. Hence, Algorithm 1 completely enumerates the MUS of the *configurations in (N , M 0 ).

State estimate algorithm and example
We shape the detailed approach of calculating the state space of an LS 3 PR (N, M 0 ) to an algorithm and support it with an example in this section. First, a set of all the reachable states of theory permissive is generated by combinatorics. Then, we exclude the unreachable states by finding all the MUSs of the *configurations in (N , M 0 ) if there exist deadlocks. Finally, the left states are the reachable states of (N, M 0 ).
Here, the LS 3 PR (N, M 0 ) in Figure 4, quoted from the literature, 18 is taken as an example. According to the combinatorics and Property 2, we can find the set of reachable states of theory permissive R B (N , M 0 ). The states are listed in Table 7 (for economy of space, only a part of states is listed).
There are four SMSs, P = fS 1 , S 2 , S 3 , S 4 g, shown as follows By Theorem 2, we can find unreachable states of each *configuration. However, some of these states may be contained in the other *configurations that have less resources. Hence, it is necessary to find MUSs. By Definition 7, it is found that M G 1 u 1 = p 4 + p 10 , M G 1 u 2 = p 9 + p 10 , and M G 1 u 3 = p 10 + p 11 are the MUSs of M G 1 u since M = p i , i 2 f4, 10, 11g are not the MUSs of M G 1 u . There is no MUS in N G 4 since the unreachable states of N G 4 by Theorem 2 are not minimal. That is to say, the unreachable states derived from M G 4 u are included in the other unreachable states derived from M G 1 u , M G 2 u , or M G 3 u . For example, it is found that M G 1 u 1 = p 3 + p 4 + p 5 + p 12 is an unreachable state but not MUS of N G 1 since M G 2 u 1 = p 3 + p 4 + p 12 is an MUS. By applying Algorithm 1 to P, U min = fM G 1 u 1 , M G 1 u 2 , M G 1 u 3 , M G 2 u 1 , M G 2 u 2 , M G 2 u 3 , M G 3 u 1 , M G 3 u 2 , M G 3 u 3 g is obtained and shown in Table 8.
In the following, we need to compute the unreachable states of (N , M 0 ) derived from the MUS in U min . Taking M G 1 u 1 as an example, we denote the unreachable states of (N , M 0 ) derived from M G 1 u 1 as R G 1 u 1 (N, M 0 ). The elements of R G 1 u 1 (N, M 0 ) are generated by Definition 8 and listed in Table 9.
The rest unreachable states can be deduced by analogy. Finally, we find R U (N , (N, M 0 ). In the sequel, to obtain the reachable states