**2.1. Petri nets2**

52 Petri Nets – Manufacturing and Computer Science

reachability graph isomorphic to the original TS.

special nets only.

redundant MTSIs cannot be entirely avoided for large FMS cases.

controllers are not ordinary (i.e. they contain weighted arcs).

5 gives the comparisons. Conclusions are made in Section 6.

of siphons3-6. Li & Zhou propose an elementary siphon control policy (ESCP) to reduce the redundant siphons to obtain structurally simpler controllers9-10. However, they cannot obtain optimal ones. Reachability graph methods are used to obtain the live system behavior11-14. Without confining to a certain class of FMS, they can provide an optimal deadlock controller by adopting the theory of regions15. The theory is originally developed for a transition system (TS). A state-based representation with arcs labeled with symbols from an alphabet of events in a TS can be mapped into a PN model. For an elementary TS (ETS) there exists a PN with minimum transition count (one transition for each label) with a

Uzam12 follows the theory of regions15 to define a deadlock-zone (DZ) and deadlock-free zone (DFZ) for preventing deadlocks. Hence, the concept of DZ and DFZ is used to solve ESSPs. An optimal controller can be obtained but suffers from many redundant control places. Ghaffari *et al.*13 propose a unique interpretation of the theory of regions and define *MF* (*forbidden marking*), *MD* (*dangerous marking*), *ML* (*legal marking*), and (the set of *marking*/*transition-separation instances* or MTSI). An optimal PN controller synthesis method for FMS is proposed based on both MTSI and the theory of regions. Unfortunately,

To reduce redundant control places, Li *et al.*16 adopt a combined algorithm based on siphon control and the theory of regions15. Its advantage is that the number of separation instances is significantly reduced after some sets of elementary siphons of a system are controlled. However, it fails to determine all sets of MTSIs and its application seems limited to some

Uzam and Zhou propose an iterative control policy of liveness enforcement for PNs based on the theory of regions17. Less computation is required to obtain a controller. However, as indicated by Li et al18, it requires the repeated calculation of reachability graphs. Piroddi *et al.* propose a combined selective siphons and critical markings in a reachability graph algorithm to obtain optimal controllers via iterations19. They successfully identify the critical uncontrolled siphons and control them to make a deadlock-prone PN live. However, their algorithm also requires the repeated calculation of reachability graphs. Eventually, the

This work in this chapter aims to develop a computationally more efficient optimal deadlock control policy by using the theory of regions. It focuses on dead markings in a reachability graph. The concept of a crucial MTSI (CMTSI) is proposed to synthesize optimal controllers. The proposed method can reduce the computational burden of the MTSI method13 and redundant control places12-13. The experimental results indicate that it is the

Section 2 presents the basic definitions and properties of PNs and the theory of regions. Section 3 describes the proposed policy. Section 4 presents the experimental results. Section

most efficient policy among all known ones12-13, 16 that can design optimal controllers.

A Petri net (*PN*) is a 5-tuple *N =* (*P, T, F, W, M*0) where *P* is a finite set of places; *T* is a finite set of transitions, with *P T* ≠ and *P T* = ; *F*  (*P*×*T*) (*T*×*P*) is the set of all directed arcs, *W*: (*P*×*T*) (*T*×*P*) → is the weight function where = { 0, 1, 2, …}, and *M*0: *P* → is the initial marking. A *PN* is said to be ordinary, denoted as (*P, T, F*), if *f F*, *W*(*f*) = 1. [*N*]*+*(*p, t*) *= W*(*p, t*) is the input function that means the multiplicity of a directed arc from *p* to *t* if (*p*, *t*)*F*. [*N*]*-* (*p, t*) *= W*(*t, p*) is the output function that means the multiplicity of a directed arc from *t* to *p* if (*t*, *p*)*F*. The set of input (resp., output) transitions of a place *p* is denoted by •*p* (resp., *p*•). Similarly, the set of input (resp., output) places of a transition *t* is denoted by •*t* (resp., *t*•). A PN structure *(P, T, F, W)* is denoted by *N*. A PN with a given initial marking is denoted by (*N, M*0).

A PN is said to be pure if no place is both input and output places of the same transition. The so-called incidence matrix [*N*] of a pure Petri nets is defined as [*N*] = [*N*]- [*N*]+. A transition *t* is said to be enabled at marking *M*, if *p* •*t, M*(*p*)  *W*(*p, t*)*, or p* is marked with at least *W*(*p*, *t*) tokens, as denoted by *M*[*t*>. A transition may fire if it is enabled. In an ordinary net, it is enabled iff *p* •*t*, *M*(*p*) 1. Firing *t* at *M* gives a new marking *M*such that *p P*, *M*(*p*) = *M*(*p*) – *W*(*p*, *t*) + *W*(*t*, *p*). It is denoted as *M*[*t*>*M*. *M* indicates the number of tokens in each place, which means the current state of the modeled system. When *Mn* can be reached from *M*<sup>0</sup> by firing a sequence of transitions σ, this process is denoted by *M* [σ > *Mn* and satisfies the *state equation Mn* = *M* + [*N*] . Here, is a vector of non-negative integers, called a *firing vector*, and ( )*<sup>t</sup>* indicates the algebraic sum of all occurrences of *t* in . The set of all reachable markings for a PN given *M*<sup>0</sup> is denoted by *R*(*N*, *M*0). Additionally, a definition of linearized reachability set (using the state equation) is defined as ( *R N*, *M*0)={*M*: *M* = *M*0 +[*N*](• )}. This definition is suitable for the incorporation of the state equation into a set of linear constraints. The markings in ( *R N*, *M*0) - *R*(*N*, *M*0) are called *spurious ones* (with respect to the state equation)20*.* They may also be the solutions of the state equation but not reachable markings. In this work, ones just focus on the reachable markings.

A transition *t* is said to be *live* if for any *M R*(*N*, *M*0), there exists a sequence of transitions whose firing leads to *M'* that enables *t*. A PN is said to be *live* if all the transitions are live. A PN contains a *deadlock* if there is a marking *M R*(*N*, *M*0) at which no transition is enabled. Such a marking is called a dead marking. Deadlock situations are as a result of inappropriate resource allocation policies or exhaustive use of some or all resources. Liveness of a PN means that for each marking *M R*(*N*, *M*0) reachable from *M*0, it is finally possible to fire *t*, *t T* through some firing sequence. (*N, M*0) is said to be *reversible*, if *M R*(*N*, *M*0), *M*<sup>0</sup> *R*(*N*, *M*). Thus, in a reversible net it is always possible to go back to initial marking (state) *M*0. A marking *M* is said to be a *home state*, if for each marking *M R*(*N*, *M*0), *M* is reachable from *M*. Reversibility is a special case of the home state property, i.e. if the home state *M*= *M*0, then the net is reversible.

#### **2.2. Theory of regions and synthesis problem13**

The theory of regions is proposed for the synthesis of pure nets given a finite TS15, which can be adopted to synthesize the liveness-enforcing net supervisor (LENS) for a plant model12-13. For convenience, our method follows the interpretation of the theory of regions in13.

First of all, let *T* be a set of transitions and *G* be a finite directed graph whose arcs are labeled by transitions in *T*. Assume that there exists a node *v* in *G* such that there exists a path from it to any node. The objective of the theory of regions is to find a pure PN (*N*, *M*0), having *T* as its set of transitions and characterized by its incidence matrix [*N*](*p*, *t*) and its initial marking *M*0, such that its reachability graph is *G* and the marking of node *v* is *M*0. In the following, *M* denotes both a reachable marking and its corresponding node in *G*.

Consider any marking *M* in net (*N*, *M*0). Because (*N*, *M*0) is pure, *M* can be fully characterized by its corresponding incidence vector [*N*](*p*, ) *<sup>M</sup>* where *<sup>M</sup>* is the firing vector of path *<sup>M</sup>* . For any transition *t* that is enabled at *M*, i.e., *t* is the label of an outgoing arc of the node *M* in *G*

$$M'(p) = M(p) + [N](p\_\prime \cdot) \vec{\Gamma}\_{M \to M'}, \forall \{M, M'\} \in G \land M \mid t \ge M' \tag{1}$$

Consider now any oriented cycle of a reachability graph. Applying the state equation to a node in and summing them up give the following cycle equation:

$$\sum\_{t \in T} [N](p, t)\vec{\gamma}(t) = 0, \forall \gamma \in \mathbb{C} \tag{2}$$

A Computationally Improved Optimal Solution

for Deadlocked Problems of Flexible Manufacturing Systems Using Theory of Regions 55

The above equation (4) is called the event separation condition of (*M*, *t*). The set of all possible pairs (*M*, *t*) where *M* is a reachable marking and *t* is not enabled at *M* is called the *set of event separation instances* or *marking/transitions-separation instances* (MTSI)13. Symbol is used to represent the set of MTSI in this paper. To solve the control problem, is identified. The corresponding control places can then be found to prevent the transitions of the

In this section, an efficient controller synthesis method is developed based on the theory of regions. Please note that all transitions of the PN models are regarded as controllable

It is assumed that a deadlock-prone PN model contains at least a dead marking in its reachability graph at which no transition is enabled. Its reachability graph contains dead and live zones. Consequently, this study attempts to propose a method to prevent the

A dead marking cannot enable any transition and thus cannot go to any other markings.

Once a marking enters a dead zone, the system is dead. If there is no dead zone in a

The goal of the work is to control a deadlock-prone system such that it is live. All markings of a reachability graph can be divided into three groups: legal markings (*ML*), quasi-dead

*Definition 3*: The set of *quasi-dead markings MQ* = {*MR*(*N*, *M*0)| *M* must eventually evolve to a

*Definition 4*: A zone consisting of all quasi-dead markings is called a *quasi-dead zone*, denoted

*Definition 5*: A zone consisting of all quasi-dead and dead markings, i.e., *ZI* = *ZD ZQ*, is

Markings except quasi-dead and dead markings are legal ones. Once a legal marking is

*Definition 6*: A zone consisting of all legal markings is called a *legal zone*, i.e., *ZL* = *R*(*N*, *M*0) - *ZI*. Ramadge and Wonham show that a system has the maximally permissive behavior if the system behavior equals *ZL*21. In other words, one must remove all the markings in illegal

enforced into the illegal zone, the net will eventually become deadlock.

*Definition 1*: The set of *dead markings MD* = {*M R*(*N*, *M*0)| at *M*, no transition is enabled}. *Definition 2*: A zone consisting of all dead markings is called a *dead zone*, denoted by *ZD*.

controlled system from firing in order to keep all legal markings only.

**3. Controller synthesis method** 

**3.1. Supervisory control problem** 

controlled systems from entering a dead zone/marking.

We can formally define the dead marking *MD* as follows.

reachability graph, the system is called a live one.

dead one regardless of transition firing sequences}.

markings (*MQ*), and dead markings (*MD*).

ones.

by *ZQ*.

called an *illegal zone*.

where is an oriented cycle of *G*, ( )*<sup>t</sup>* is a firing vector corresponding to *,* and *C* is the set of oriented cycles of *G.*

According to the definition of *G*, there exists an oriented path *<sup>M</sup>* from *M*0 to *M*. Applying (1) along the path leads to *M*(*p*) = *M*0(*p*) + [*N*](*p*,) *<sup>M</sup>* . There are several paths from *M*0 to *M*. Under the cycle equations, the product [*N*](*p*,) *<sup>M</sup>* is the same for all these paths. As a result, *<sup>M</sup>* can be arbitrarily chosen. The reachability of any marking *M* in *G* implies that

$$M(p) = M\_0(p) + [N](p\_\prime \cdot) \vec{\Gamma}\_M \ge 0, \forall M \in G \tag{3}$$

The above equation is called the reachability condition. Notably, (3) is necessary but not sufficient. Hence, spurious markings are beyond this paper.

It is clear that the cycle equations and reachability conditions hold for any place *p*. For each pair (*M*, *t*) such that *M* is a reachable marking of *G* and *t* is a transition not enabled at *M*, *t* should be prevented from happening by some place *p*. Since the net is pure, *t* is prevented from happening at *M* by a place *p* iff

$$[M\_0(p) + [N](p\_\prime \cdot)]\vec{\Gamma}\_M + [N](p\_\prime t) \le -1\tag{4}$$

The above equation (4) is called the event separation condition of (*M*, *t*). The set of all possible pairs (*M*, *t*) where *M* is a reachable marking and *t* is not enabled at *M* is called the *set of event separation instances* or *marking/transitions-separation instances* (MTSI)13. Symbol is used to represent the set of MTSI in this paper. To solve the control problem, is identified. The corresponding control places can then be found to prevent the transitions of the controlled system from firing in order to keep all legal markings only.
