#### Abstract

Mixed integer programming (MIP) is an important technique to verify the liveness property of sequential flexible manufacturing systems (FMS) modeled by Petri nets. When there are some fully flexible routings in FMS, the existing MIP-based methods are not suitable for testing their liveness. This paper defines a subclass of S*PR nets firstly, namely, OSC-S*PR nets, and concludes that an OSC-S*PR net is live if there exist no non-max′-controlled siphons. Accordingly, determining whether or not an OSC-S*PR net is live can also be realized by using standardized mixed integer programming (MIP) tools. Furthermore, the liveness property of S*PR nets can be tested in two steps: first, for a given S*PR net, constructing an OSC-S*PR net to ensure that if the latter is live then the former must be live; second, testing liveness of the constructed OSC-S*PR net by the aforementioned MIP-based algorithm. In the end, the performance of the method is demonstrated by an application of FMS.

#### 1. Introduction

Flexible manufacturing systems (FMS) utilize computers and shared resources (such as robots, machines, and automated guided vehicles) to automatically produce products [1]. Owing to the competition of shared resources, there may be some processes in FMS, which once started cannot be finished, that is, deadlocks [2]. Hence, it should be ensured that no deadlocks will occur in FMS; in other words, all working processes should be live. Usually, liveness property of FMS might be tested by analyzing their models (such as Petri nets) before using. Since the model complexity will increase with job shop flexibility (alternative machines, alternative operation sequences, and full routing flexibility) [3], the work for detecting liveness of FMS will also increase correspondingly.

At present, there are two categories of techniques for liveness test: one category is relied on the classic state enumeration analysis of Petri nets, which grows exponentially with the size of the net [4]; the other one is based on standardized tools of mixed integer programming (MIP), which is originally proposed by Chu and Xie [5] and is more efficient than the former. The basic idea of the latter is that if there does not exist any siphon becoming empty in a Petri net, then the net is deadlock free. It has been verified that for some subclasses of ordinary Petri nets such as ES^{2}PR nets [6], S^{3}PR nets [7], LS^{3}PR [8] nets, and ES^{3}PR [9] nets the net is live if and only if it is deadlock free. So, the liveness of these subclasses of ordinary Petri nets can be tested by MIP-based algorithms [10, 11]. The natural thing is to extend MIP-based method of liveness test for general Petri nets. Park and Reveliotis [12] introduced an MIP-based algorithm for testing the weakly liveness of FMS with alternative machines flexibility modeled by S^{3}PGR^{2} nets, which is in view of the conclusion that a net is weakly live if there exist no dead marked siphons (DMS). Shih et al. [13] has obtained some similar results for S^{3}PGR^{2} nets, in which DMS is found on the grounds of the conception of max′-controlled siphons. Moreover, Liu and Li [14] provided a general MIP algorithm of liveness test for S^{3}PGR^{2} nets, which is based on the result that a net is live if there is no extended deadly marked siphons (EDMS). Owing to the shortage of liveness conditions of S*PR nets, which can model FMS with full routing flexibility [15, 16], there is no MIP-based method of liveness test for S*PR net. The liveness of Gadara nets [17] (a subclass of S*PR nets) may be detected by the original MIP approach [5], because of the conclusion that a Gadara net is live if and only if there does not exist any empty siphons [17, 18].

This paper defined a subclass of S*PR nets firstly, namely, OSC-S*PR nets, in which all output transitions of each choice working place are restricted to use the same type and quantity of resources. The main structure characteristic of OSC-S*PR nets is that an OSC-S*PR net is live if there exists no non-max′-controlled siphons. Accordingly, an MIP-based algorithm is proposed to determine whether or not an OSC-S*PR net is live. It is worth to say that OSC-S*PR nets are an extension of Gadara nets, which are usually used to model multithreaded programs [17]. Considering the structure complexity of S*PR nets, it is difficult to develop an MIP-based algorithm for testing their liveness directly. So, an indirect method is given here, which comprises two steps as follows: first, for a given S*PR net, constructing an OSC-S*PR net to ensure that if the latter is live then the former must be live; second, testing liveness of the constructed OSC-S*PR net by the aforementioned MIP-based algorithm. In order to verify the performance of our method, a typical case of FMS is taken as example.

This paper is organized as follows. Section 2 introduces the basic knowledge about Petri nets. Section 3 presents OSC-S*PR nets and their structure characteristics. Section 4 proposes an MIP-based algorithm for testing liveness of OSC-S*PR nets. Section 5 discusses an indirect method for testing liveness of S*PR nets. A typical example is presented in Section 6.

#### 2. Preliminaries

This section, we briefly introduce the basic definitions and notations of a Petri net, which will be discussed in the rest of this paper. More details can be found in [4, 19].

A generalized Petri net is a four-tuple , where and are finite, nonempty and disjoint sets. denotes the set of places and denotes the set of transitions with and . is called a flow relation of the net, represented by arcs with arrows from places to transitions or from transitions to places. is a mapping that assigns a weight to an arc: if and only if , and otherwise, where and denotes the set of natural numbers.

A marking of a Petri net is a mapping from to . denotes the number of tokens in the place . We usually describe markings and vectors using a multiset (bag) or formal sum notation for economy of space. As a result, is used to denote vector . For instance, a marking that puts four tokens in place and two tokens in place only in a net with is denoted by instead of . A place is marked by marking if and only if . A subset is marked by if and only if at least one place in is marked by . The sum of tokens of all places in is denoted by ; that is, . is said to be empty at if and only if . is called a net system or marked net and is called an initial marking of . In general, is directly called a net where there is no confusion.

Let be a node of net . denotes the preset of , while denotes its postset of . Furthermore, this notation can be extended to a set of nodes. For example, given , and . Given a place , we denote by and by .

A transition is enabled at marking if and only if for all , . This fact is denoted by . Firing it yields a new marking such that for all , , as denoted by . is called a immediately reachable marking from . Marking is said to be reachable from if there exists a sequence of transitions and markings , and such that holds. The set of markings reachable from in is called the reachability set of Petri net and denoted by .

Let be a Petri net. is pure (self-loop free) if and only if for all , . is called an ordinary net, denoted by if for all , . is called a state machine if for all , . It is strongly connected if for all , there is a sequence of nodes such that , where . An extended free-choice net is an ordinary Petri net such that for all , . A pure net can be represented by its incidence matrix , where is a integer matrix with . For a place (transition ), its incidence vector, a row (column) in , is denoted by . The structural bound of a place is defined as .

A* P*-invariant is a -dimensional vector which satisfies , . For any reachable marking and a* P*-invariant of , . is called the support of . denotes the positive support of -invariant and denotes the negative support of* P*-invariant . is said to be minimal if is not a superset of the support of any other one and its components are mutually prime. If for all , , then is a* P*-semiflow.

Let be a nonempty subset of places in . is a siphon (trap) if and only if (). A siphon is said to be minimal if and only if it contains no other siphons as its proper subset. A minimal siphon is strict if it does not contain a trap (SMS for short).

Given a net , a transition is live under if and only if for all , such that . A transition is said to be dead under marking if and only if such that . is quasi-live under if and only if for all , such that . is live if and only if for all , is live. In this paper, we will denote the set of live transition under by and the set of dead transition for marking by . From the definition above, it can be known that a live transition can be fired infinitely in . A dead transition for marking can never be fired in .

A number of nodes is called a path of if for all , . An simple path (not a circuit) from to is a path whose nodes are all different, which can be denoted as . A circuit is an simple path with .

#### 3. Definitions and Properties of OSC-S*PR Nets

In order to model FMS with full routing flexibility and multiple copies of different resources, S*PR nets are proposed by Ezpeleta et al. [15], which are defined as follows.

*Definition 1 (see [15]). *Let be a finite set of indexes. An S*PR net is a connected generalized self-loop-free Petri net where(i) is a partition such that (a) is called the set of operation places, where and for all ; (b) is called the set of idle places; (c) is called the set of resource places;(ii), ; for all , ;(iii), where and for all , ; , where is the set of natural number;(iv)for all , the subnet generated by is a strongly connected state machine;(v)for all , there exists a unique minimal -semiflow , such that , , and ;(vi);(vii) is pure and strongly connected.

*Definition 2 (see [15]). *A well-marked S*PR net is a marked Petri net with initial marking such that for all , ; for all , ; and , .

Due to the structure complexity of S*PR nets, the liveness problem usually relies on the classic state enumeration analysis. Obviously, it is time-consuming due to the state explosion problem. Fortunately, Gadara nets, a subclass of S*PR nets, may utilize some efficient methods such as MIP-based approach for testing their liveness. In fact, Gadara nets are a simplified subclass of S*PR nets with the restriction that no resources are required in all branches and quantity of the same type of resources equals one. The definition is shown as follows.

*Definition 3 (see [10]). *Let be a finite set of indexes. A Gadara net is an ordinary, self-loop-free Petri net where(i) is a partition such that (a) is called the set of operation places, where and for all ; (b) is called the set of idle places; (c) is called the set of resource places;(ii), ; for all , ;(iii)for all , the subnet generated by is a strongly connected state machine;(iv)for all , if , then for all ,;(v)for all , there exists a unique minimal -semiflow , such that (for all , ), , , and ;(vi);(vii)For all , . For all , . For all , .

In most cases, the modeling ability of Gadara nets is not enough. Here, a new subclass of S*PR nets, namely, OSC-S*PR nets, is introduced as follows.

*Definition 4. *Let be a well-marked S*PR net. A place is said to be a choice operation place if and only if and . The set of choice operation places in is denoted by ; that is, .

*Definition 5. *Let be a well-marked S*PR net. A choice operation place is said to be satisfied operation symmetry choice condition (OSC-Condition) if and only if
is said to be a well-marked OSC-S*PR net if and only if for all , satisfies OSC-Condition.

The OSC-Condition confirms that each output transition of each choice operation place must use the same kind and quantity of resources. From Definition 5, it is apparent that OSC-S*PR nets are a subclass of S*PR nets. Since any branch in a Gadara net cannot be associated with any resource [17], it satisfies OSC-Condition as well; that is, Gadara nets are a special case of OSC-S*PR nets.

*Example 6. *Consider the net shown in Figure 1. For the choice operation places and , all output transitions , , , and use none of resources. So it is an OSC-S*PR net but is not a Gadara net because initial tokens in , , , , and are greater than one.

Similar to the technique in [20, 21], the definition of max′-controlled siphon of S*PR nets is introduced as follows.

*Definition 7. *Let be a siphon of a S*PR net , where , , and . The holder of resource is defined as the difference of two sets and : , and is the complementary set of siphon .

*Definition 8. *Let be a siphon of a well-marked S*PR net . is said to be max′-marked at marking if and only if such that or such that . is said to be max′-controlled if and only if it is max′-marked under any reachable marking. is said to be max′-controlled if and only if each siphon of it is max′-controlled.

Before proving the liveness condition of OSC-S*PR nets, some lemmas are established first.

Lemma 9. *Let be a choice operation place in a well-marked OSC-S*PR net . For all , the following conclusions hold.*(i)*If such that , then for all we have .*(ii)*If such that is disabled under , then for all we have that is disabled under .*

*Proof. *This is trivial. Because from Definition 5, for all , and for all , . Therefore, all of them are enabled for making if one of them is enabled and all of them are disabled for making if one of them is disabled.

Lemma 10. *Let be a well-marked S*PR net. For all , there must exist a simple path from to .*

*Proof. *This is trivial, since by condition (iv) in Definition 1, generated by is strongly connected.

Lemma 11. *Let be a well-marked S*PR net. Then, is quasi-live under .*

*Proof. *From , by Definition 2, for all , is enabled. For the transition , since is well-marked, we can construct a trivial firing sequence from by only allowing the execution of only one sequential process and only one token flowing into process , reaching a marking such that . This is valid for each .

Lemma 12. *Let be a well-marked S*PR net, and let be a reachable marking so that is a dead transition under . Then, .*

*Proof. *Assume that . By Lemma 11, such that . This contradicts the hypothesis that is a dead transition under . Thus, Lemma 12 holds.

Similar to the method in [7], Lemma 13 is proposed which means that if there is a reachable marking such that a transition is dead, then there exists a set of processes where some tokens cannot evolve any more.

Lemma 13. *Let be a well-marked OSC-S*PR net. and is a dead transition under ; then there exist and two subsets such that , , , , and (i) for all , ; (ii) for all , , and is a set of dead transitions.*

*Proof. *By condition (ii) of Definition 1, for all and for all , . Therefore, there must exist and two subsets such that , , and (i) for all , ; (ii) for all , .

First, prove . Assume that . Then, it can be concluded that . Therefore, for all , we have , . Since is a well-marked OSC-S*PR net, by Lemma 11, it is quasi-live. Therefore, for all , , such that . This contradicts the condition that is a dead transition. Thus, .

Then, prove such that for all , is a set of dead transitions. From the marking mentioned before and move all processes one by one corresponding to indexes in as follows approach. By Lemma 10, for all there must exist a simple path from to . Then, for all , moving the process along , the process will be either dead (since by Lemma 9, all the transitions in the postset of a choice place are disabled as long as one of them is disabled) or back to initial state, in which the tokens in will flow back to . Repeat this for each process corresponding to indexes in . The net reaches a marking verifying condition (ii) in the hypothesis, because, on the contrary, all process corresponding to indexes in will get back to the initial state; that is, which is in contradiction with Lemma 12. Let ; Lemma 13 holds.

From these lemmas, the main theorems can be obtained as follows.

Theorem 14. *Let be a well-marked OSC-S*PR net, , and is a dead transition for . Then , is a siphon such that is nonempty and non-max′-marked.*

*Proof. *Consider the making given in Lemma 13.

Let

is the set of resource places which have at least one disabled output transition and this transition is disabled only because of the lack of this resource. is the set of nonmarked places in . It is apparent that (otherwise , then for all , it is true that for all , which contradicts the condition that is a set of dead transitions).

Now we prove that is a non-max′-marked siphon under .

First, we prove that is a siphon; that is, for all , . Then, two cases should be considered.*Case 1*. , where . By Definition 1, the subnet of an S*PR net is a state machine. Thus, . Let . Since , it can be obtained that . Then, two subcases should be considered as follows.*Subcase 1.1*. If , by the definition of , it can be obtained that . Therefore, .*Subcase 1.2.* If , by the definition of in Lemma 13, . By Lemma 13, is a dead transition for . Therefore, satisfies . By the definition of , it can be obtained that . Thus, .*Case 2*. , where . By the definition of , such that . If , then . If , since , there must exist , such that . Similarly, the two following subcases should be considered.*Subcase 2.1*. If , by definition of , it can be obtained that . Therefore, .*Subcase 2.2*. If , similar to the proof in Subcase 1.2, holds.

In conclusion, . Thus, is a siphon.

Then, we prove siphon is non-max′-marked under . , by definition of , . , by definition of , such that . Thus, by Definition 8, siphon is non-max′-marked under .

In summary, and is a siphon such that is nonempty and non-max′-marked.

Theorem 15. *Let be a well-marked OSC-S*PR net. is live if all siphons of are max′-controlled.*

*Proof. *Assume that each siphon in is max′-controlled while not live. Then, and is a dead transition under . By Theorem 14, , is a siphon which is non-max′-marked under . This contradicts the assumption that is max′-controlled. Thus is live.

It should be noticed that Theorem 15 is a sufficient liveness condition for OSC-S*PR nets. Thus, there may be some live OSC-S*PR nets which are not max′-controlled.

#### 4. Liveness Test Algorithm for OSC-S*PR Nets

In this section, an MIP-based liveness test algorithm is proposed, which is based on Theorem 15 in Section 3. The operators set of an operation place is introduced here, which is similar to [14].

*Definition 16. *Let be an S*PR net. For , the resource places that are required by are called the set of operators of .

According to Theorems 14 and 15, the following theorem can be obtained, which is also a liveness test algorithm for testing liveness of OSC-S*PR nets.

Theorem 17 (Algorithm 1). *Let be a well-marked S*PR net. Then, the minimal non-max′-marked siphon under is determined by , where and are obtained by the following MIP formulation:
**
such that
**, **, , , **
where , is the structural bound of place .**Then, the minimal non-max′-marked siphon is the set of places with .*

*Proof. *Let be a non-max′-marked siphon. By Definition 8, the following conclusions hold:(i)for all , ;(ii)for all , .

Then, let us explain the meaning of the constraints one by one.

Objective (3) ensures that the siphon is a minimal siphon.

Constraint (4) ensures that is the characteristic vector of the siphon [22].

Constraint (5) ensures that . This is trivial.

Constrains (6)–(8) ensure that the siphon contains no idle place and has one operation place and one resource place at least.

In constrains (9)–(11), , . means whether transition is disabled by the operation place which is in the preset of it. If is disabled by the operation place , . Otherwise, . This comes from the following facts. If , then transition is enabled by the operation place . From constraint (9) and definition of structural bound in Section 2, it can be obtained that . Since , we have , which follows the meaning of ; if , then transition is disabled by the operation place . From constraints (9) and (10), it can be obtained that and . Thus, which follows the meaning of .

Then, constraint (11) ensures that in the siphon condition (i) holds. This comes from the following fact: for all , by the meaning of , we have . By constraint (11), it can be obtained that . Since , we have . By the conclusions above, it can be obtained that transition is disabled by the operation place and . This follows condition (i).

Constraint (12) ensures that in siphon condition (ii) will hold. Since , the following two cases should be considered.*Case 1*. If , that is, is not an element of siphon , then . Constrain (10) is equivalent to which is trivial and will not add extra constraints to the formulations.*Case 2*. If , that is, is an element of siphon , then constrain (10) is equivalent to

Then we explain that constraint (15) indicates condition (ii). Two cases should be considered. If , that is, , then we can obtain that and . Since , . By Definition 16 and , it can be obtained that . Thus, (15) can be transferred into , which means . If , that is, , then we can obtain that or . Similarly, it can be obtained that or . Then, , this kind of transitions will not be taken into comparison [14].

Therefore, constraint (12) ensures that in the siphon condition (ii) holds.

In conclusion, constraints (11) and (12) ensure that the obtained siphon satisfies conditions (i) and (ii), that is, is a non-max′-marked siphon.

In summary, if the MIP formulation has a feasible solution, the obtained siphon is the minimal non-max′-marked siphon.

Thus, Theorem 17 can find a non-max′-controlled siphon at a bad marking. It utilizes some MIP tools to find non-max′-controlled siphons rather than traverse the state space of the net. Following Theorem 17, Corollary 18 can be obtained.

Corollary 18. *Let be a well-marked OSC-S*PR net. It is live if Algorithm 1 has no feasible solution.*

*Proof. *For a well-marked OSC-S*PR net, Algorithm 1 having no feasible solution means that all siphons of this net are max′-controlled. By Theorem 15, it is live.

*Example 19. *Applying Algorithm 1 to the OSC-S*PR net in Figure 1 and solving by Lingo [23] no feasible solution can be found. By Corollary 18, it is live, which follows the fact that it is a live net.

#### 5. Liveness Test for S*PR Nets

In order to test liveness of the S*PR nets, an indirect method is given in this section, which comprises two steps as follows: first, for a given S*PR net, constructing an OSC-S*PR net to ensure that if the latter is live then the former must be live; second, testing liveness of the constructed OSC-S*PR net by the aforementioned MIP-based algorithm.

*Remark 20. *In the following sections, we assume that for all , .

Remark 20 restricts that each process in the net can only have one start action.

In the following, the constructing algorithm is proposed.

*Insertion 1. *Let be a well-marked S*PR net. For all , , a pair of virtual place and virtual transition is inserted into as follows:(i);(ii), ;(iii), , ;(iv).

Then, for a given S*PR net, an OSC-S*PR net can be constructed by the following algorithm.

*Algorithm 2*

*Input*. S*PR net .

*Output*. A constructed net .

*Step 1*. , , , ;

*Step 2*.** while **, for the net do the following:

*Step 2.1*. :

*Step 2.2*.** while **, do the following:

*Step 2.1.1*. for all , insert to by Insertion 1 and obtain ;

*Step 2.1.2*. , , , , ;

**endwhile**

*Step 2.3*. ;

**endwhile **

*Step 3*. ;

*Step 4*. Output the constructed net .

Since and are finite sets, it can be obtained that Algorithm 2 will end in finite steps. What is more, is called the constructed net of , and is called original S*PR net of .

*Remark 21. *By Algorithm 2 and Insertion 1, it is trivial that for all , and for all , ; that is, .

Lemma 22. *Let be a well-marked S*PR net and is the constructed net obtained by Algorithm 2. Then, is a well-marked OSC-S*PR net.*

*Proof. *First, we prove that is a well-marked S*PR net. By Insertion 1, the virtual places are considered as operation places. Thus, it is apparent that satisfies conditions (i), (ii), (iii), (iv), and (v) in Definition 1. Then, we prove that it satisfies conditions (vi) and (vii). Without loss of generality, assume that and in . Then by Insertion 1, and will be inserted to . Since , and , it can be obtained that no self-loop is inserted to by Insertion 1. This is valid for each insertion in Algorithm 2. Therefore, it can be concluded that no self-loop will be inserted to ; that is, will still be a pure net. What is more, and are still connected by the path . This is also valid for all the insertions in Algorithms. Hence, will still be strongly connected; that is, satisfy condition (vii) in Definition 1. Since do not attach to any resources, will use the resources that has used. Therefore, satisfies condition (vi) of Definition 1. Henceforth, is an S*PR net. What is more, by Remark 21, the initial marking of virtual place is zero and the initial marking of other places stays the same. Thus, regarding virtual places as members of operation places, satisfies Definition 2 as well; that is, is a well-marked S*PR net.

Second, we prove that is an OSC-S*PR net. Considering Step 2.1 in Algorithm 2 with Remark 20, it is guaranteed that for all if , then for all , and . Thus satisfies Definition 5; that is, is an OSC-S*PR net.

In summary,