1. Introduction
In flexible manufacturing systems (FMSs) [
1,
2], a resource is usually shared by different processes. If the resource allocation is not appropriate, the system may move to deadlocks [
3], where any deadlock makes the whole system or part of the system unable to be operated, and indirectly causes incalculable economic losses or other catastrophic consequences. Therefore, a deadlock is a situation that FMSs should avoid. The description, analysis, solution, and control of deadlocks in FMSs are undoubtedly of vital importance to ensure the normal operation of the system.
The Petri net theory [
4,
5] has a strict mathematical expression and intuitive graphical expression, and is often used for the modeling, deadlock analysis, and control of FMSs. In the Petri net theory, there mainly exist three approaches for solving the deadlock problem: deadlock detection and recovery [
6], deadlock avoidance [
7,
8], and deadlock prevention [
9,
10,
11]. The reachability graph analysis method [
12,
13,
14] is a fundamental technique for deadlock prevention, which provides complete and detailed information about the dynamic behavior of Petri nets since all-state place enumeration is considered. Moreover, the structural analysis method [
15,
16,
17,
18] is marking-independent and only depends on the place–transition relationship of the underlying net by the flow relation. Uzam and Zhou [
19] proposed an active controller design method using the iterative method. The proposed method simplifies the calculation of the control places, but it cannot guarantee optimal controllability and solves the reachability graph repeatedly. In addition, Chen et al. [
20] propose another iterative controller design method, which has higher computational efficiency and achieves optimal control. In the proposed method, first, the minimum cover sets of legal and first-time damaged identifiers are obtained by vector coverage. Second, by solving an integer linear programming problem, a P-invariant is designed to prevent the system from reaching the first-time damaged identifier, and then the illegal identifier is forbidden. Finally, the optimal controller of the system is obtained.
Siphons are closely related to deadlock on structural analysis [
21]. Once a siphon is emptied, all transitions related to the siphon in the net become dead, and then the system is blocked. Therefore, siphon control is a typical deadlock prevention strategy based on structure analysis. Ezpeleta et al. [
22] define the system of simple sequential processes with resources (
PR), and propose a controller design method for adding control places to all strict minimal siphons to avoid the result that siphons become emptied. The proposed method realizes the active control of the net but, for the large-scale net, a large number of control places need to be added, which makes the net structure extremely complex. Huang et al. [
23] propose an iterative deadlock control strategy based on
PR, where the strategy is divided into two stages. One is siphon control, and the other is control-induced siphon control. To reduce the complexity of the model structure, Li et al. [
24] propose the concepts of the basic siphon and subordinate siphon, proving that the controllability of the subordinate siphon can be guaranteed by the controllability of the basic siphon if the basic siphon is controlled under certain conditions. Additionally, they propose the method of adding controllers to basic siphons as controlled places, which reduces the scope of controlled places, the computational complexity, and structural complexity, and is more suitable for large-scale Petri nets, compared with the method proposed in [
22]. In addition to adding control places from the siphon point of view, Xing et al. [
25] utilize the resource transition (RT) circuits of
PR to describe the deadlock of the system, where a deadlock state occurs if a maximal perfect RT-circuit (MPRTC) is saturated, and a controller is designed to retain the maximally permissive behavior of
PR without
resources. However, the method has to face the problems of computational complexity and structural complexity. Liu et al. [
26] put forward the concept of transition coverage, and prove that an active Petri net controller can be obtained only by controlling the maximal perfect RT-circuit under change coverage. As a result, the proposed method reduces the computational complexity of controlling and structural complexity of the net.
This paper studies dual-process PR and dual-process PR and analyzes the relationship between their structural characteristics and deadlock, where the control places are added to form the P-invariant with the activity places in the original net to realize deadlock prevention. The relationship between the control places and the net size is that the two special subclasses have fixed control laws. For a given dual-process PR and a dual-process PR, there is no need for the complex calculation of siphons or RTC, since control places can be directly added to the net to ensure that the system is alive.
The contributions of the paper are twofold as follows.
This study introduces the concept of encounter place pair and encounter state in the dual-process PR, and the relationship between the encounter state and deadlock is analyzed. When the initial marking of the resource place is 1, the addition of control places prevents the occurrence of encounter states, progressive encounter states, and blocked states, ensuring that the net is live and maximally permissive. Moreover, the control law of dual-process PR is summarized.
This paper utilizes the concept of PR and analyzes the relationship between a saturated pair of encounter paths and deadlock in dual-process PR. As a result, the optimal active-controlled system is obtained by adding control places. The mathematical relationship between the number of independent resource holder loops and the number of control places in the dual-process PR is analyzed, and the control law of the dual-process PR is obtained indirectly.
2. Preliminaries
2.1. Petri Nets
A Petri net (PN) is a four-tuple , where P and T are non-empty and finite sets of elements named places and transitions, and . F is a flow relation set of a PN, where is represented by directed arcs pointing from transitions to places (or places to transitions). Let denote the set of non-negative integers. W: represents a map that assigns a non-negative integer number (weight) to each arc in F, i.e., if , else . A PN is ordinary, if, for all , .
M is a marking of a PN, which is a map: . For a place , represents the quantity of tokens in it. A place p is marked, if . A subset is marked if there exists at least one place marked by M. . is said to be a marked net with being called an initial marking.
Let be an element of a PN . is the preset of i; is the the postset of i. The previous notation is extended to sets of nodes; if , , then = . If, for all , a path of N is defined as a string , where , . A path is an elementary path, if all nodes of it are different (except, perhaps, and ). A path is a circuit if it is an elementary path and .
A transition is enabled at a marking M if, for all , , which is denoted by . Firing t to a new marking such that for all , , denoted by . If there is a sequence of transitions = as well as markings , such that holds, we can say is reachable from marking M. is called the reachability set which denotes all the markings reachable from M in . A reachability graph of a net is denoted as . A PN is called a state machine if, for all , .
A net is pure if, for all , implies . It can be noticed that a pure PN is able to be represented by an incidence matrix , where . This incidence matrix can be divided into two parts: Post−Pre, where Post and Pre are called the output matrix and input matrix, respectively.
Given a PN (), is live under if . is live if , t is live under . is dead under if , .
A P-vector is a column vector indexed by P, where is the set of integers. The P-vector I is called a P-invariant (place invariant) if and . The P-invariant I is a P-semiflow if every element of I is non-negative. is called the support of I.
Let S be a non-empty subset of places. S is called a siphon (trap) if holds. A siphon is said to be minimal if there is no siphon contained in it as a proper set. A minimal siphon is said to be strict if it does not contain a trap. A strict minimal siphon is denoted as SMS for short. denotes the set of SMSs in a PN.
2.2. PR
The system considered can be modeled as a system of simple sequential processes with resources (PR) if there is no unreliable resource. The definition of PR is briefly introduced as follows.
Definition 1 ([
22]).
Let and be PNs with and , where and . The net with is said to be the resultant of composing and via the set of shared places if (1) , , , and if , ; and (2) , , , , and , . The composition of and is denoted by . Definition 2 ([
22]).
A system of simple sequential processes with resources (PR) is the PN defined as the union of a set of nets sharing common places, where the following statements are true: is called the process idle place of . Elements in and are called activity or operation and resource places, respectively. A resource place is called a resource for short in case of no confusion.
; and .
is a strongly connected state machine, where is the resulting net after the places in and related arcs are removed from and .
Every circuit of contains place .
Any two s are composable when they share a set of common places. Every shared place must be a resource.
Transitions in and are called the source and sink transitions of an PR, respectively.
Definition 3 ([
22]).
A PN is an PR and let S be an SMS in N. and represent the set of resource places and the set of activity places in S, respectively. For , is called the set of holders of r, which means that these activity places in need resource r. Let and it is called the complementary set of siphon S. Figure 1 is an
PR that has eleven places and eight transitions, where
,
, and
. The sets
,
, and
are three SMSs for the PN. According to Definition 3, we have
,
, and
, which means that places
and
can use resources in
,
and
can use resources in
, and resources in
can be used by places
and
. Their complementary sets are
,
, and
, respectively.
Definition 4 ([
22]).
Let be an PR, and x and y are two different nodes in . (1) A path in N that merely contains activity places in and transitions in T is called an operation path. (2) If there exists an operation path in N from x to y, it is said that x is previous to y in N, which is denoted as . (3) Let . If there is a node with , we can obtain . If there exists a node such that , then . Let us consider the net shown in
Figure 1, where
is a circuit and
is a path in this circuit. Clearly, we have
.
4. Control Law for Dual-Process PR
Dual-process PR net is a special subclass of PR net, where every resource place is held by two processes and the two processes use the resource in reverse order. However, for a manufacturing system with resources that are only employed by one process, the dual-process PR net cannot model and analyze it. This section studies the activity analysis and control laws of another special PR subclass: the dual-process unitary PR (PR) net.
Definition 12 ([
18]).
Let θ be a circuit in an ; it is called a resource–transition circuit (RT-circuit) if it contains resource places and transitions only. Definition 13 ([
18]).
In an , assuming that there exist two RT-circuits and , then is called a ξ-resource if . Definition 14 ([
17]).
In the context of an , a resource is termed independent if there is no strict minimal siphon S such that ; otherwise, if such a siphon exists, r is considered dependent. The set of independent resources in is denoted by . Definition 15 ([
18]).
Given a resource in an PR, an associated holder–resource circuit (HR-circuit), denoted by , is a simple circuit consisting of r as the unique resource place, an activity place , and the connecting transitions. An HR-circuit, , is termed monoploid if . Definition 16 ([
18]).
An PR is said to be unitary if there is only one ξ-resource and, for all , there exists an RT-circuit θ, such that where is a set of resource places in N. Definition 17. Let be a marked PR and unitary; is a marked dual-process PR if
;
, ;
, ;
, .
Figure 7 illustrates an
PR net, featuring three distinct strict minimal siphons:
,
, and
. Two non-inclusive resource transition circuits,
and
, are discerned.
It is noteworthy that , , designating as the exclusive resource in N. Furthermore, and , affirming the net’s classification as a PR net.
Defining sets as , , , and , we observe a consistent pattern with for .
Definition 18. Consider a dual-process PR net denoted by . For any , if with and , we designate r as a shared repository, denoted as . The set of all shared repositories in N is represented by .
If N is a dual-process PR, it must exclusively feature three shared repositories, denoted by , with representing a resource place.
An RT-circuit necessitates a minimum of two shared resource repositories. Without this, the path formed by the resource places and transitions cannot constitute a circuit, as per Definition 17. Furthermore, as articulated in Definition 17, each process within a dual-process US3PR net lacks a branch structure. Consequently, any two adjacent shared resource repositories exclusively correspond to an RT-circuit.
Suppose there are only two shared resource repositories in N; in that scenario, only one RT-circuit exists, but no resource is present in N, leading to a contradiction with Definition 17. Conversely, assuming N contains four or more shared resource repositories would result in the formation of two or more resources, contradicting Definition 17. In summary, a dual-process PR net must invariably consist of precisely three shared resource places.
Definition 19. If there exists a basic path , , where, for all , , and , then is considered the basic process path from to , denoted as .
Definition 20. Let be a basic process path for the marked dual-process PR , and be the set of operation places in . If, for all , and all , there exists , then is referred to as a set of resource places held by . If , is said to be saturated; if , is said to be progressively saturated.
Definition 21. Let be the set of shared resources for the marked dual-process PR ; if , and , then the basic process path and are a pair of encounter paths.
Theorem 5. Let and be a pair of encounter paths in a marked dual-process PR ; if and are saturated, then a deadlock occurs in N.
Proof. Consider a pair of encounter paths in a marked dual-process PR , denoted as and . According to Definition 21, and , implying that firing or requires tokens in and r respectively.
As both and are saturated, the operation places in have occupied all tokens in the associated resource places. Firing the output transition to release tokens in allows subsequent transitions to be fired, releasing other occupied resources. Similarly, the operation places in have occupied all tokens in the associated resource places. Firing the output transition to release tokens in r enables subsequent transitions to release other occupied resources.
Therefore, both and depend on the other path to release resources first, leading to a circular wait condition. Consequently, all transitions in and become inactive. □
Definition 22. In a marked dual-process PR , let be a set of shared resources, with identified as a ξ resource. Consider two pairs of encounter paths: and , as well as and . For any marking M in , M is termed a progressive encounter state if the following conditions hold: (1) and are saturated. (2) and are progressively saturated.
Theorem 6. Given a marked dual-process PR net , if a progressive encounter state occurs, a deadlock occurs inevitably in N.
Proof. Let and be a pair of encounter paths of . Referring to Definition 22, and are saturated, while and are progressively saturated. Under these circumstances, the paths have no opportunity to reach saturation, and deadlock is unlikely.
Since both and are occupied, transitions and cannot be fired, preventing a decrease in tokens in and . The output transition of serves as the input transition of , implying that firing would increase tokens in and result in saturation. Similarly, firing would saturate . Given that is a resource with , simultaneous saturation of and is impossible. Therefore, a progressive encounter state inevitably leads to an encounter state, causing deadlocks. □
Definition 23. Consider a dual-process PR net , where represents a set of shared resource places and is designated as the ξ resource. Let . Two pairs of encounter paths corresponding to the resource pairs and , are denoted as , and , , respectively. A set of controlled places of N is defined as follows:
;
;
;
, ;
, .
Definition 24. Let denote the set of controlled places in a dual-process PR net N. A set is defined as the collection of resource places held by if .
Definition 25. Let be a marked dual-process PR net, where is a set of controlled places of N. Add the control place to , such that forms a P-invariant of the controlled net , where , and, for all , , and .
Theorem 7. Let be marked a dual-process PR net; the controlled net defined in Definition 25 is live and maximally permissive.
Proof. Given a marked dual-process PR net , where the number of monoploid holder resource circuits is represented by a variable in the parameterized dual-process PR model, is the set of shared resource places, with being the resource, and encounter path pairs include and between and , and and between and . Let x, y, z, and w represent the number of operation places in , , , and , respectively, where .
According to Definition 25, control places are added to to obtain the controlled net . Since the control places and the controlled place set form a P-invariant of , where , and the encounter path pair and satisfies the condition that, for all , , the encounter path pair and will not saturate. Consequently, no deadlock is generated, and the workpiece in x can enter z by firing , and the workpiece in y can be exported by firing . Similarly, for the encounter path pair and , after adding the control place, ensuring that the workpiece in w can enter y by firing , the workpiece in z can be exported by firing . The controlled net is live.
The initial marking of control place . Compared to the original net , the controlled net only eliminates the encounter state and the progressive encounter state in the reachable graph, retaining all states except these two special states. As the encounter state and the progressive encounter state can cause deadlock or inevitably lead to deadlock, they correspond to the dead states and bad states in the reachable graph of . The controlled net removes only the dead states and bad states compared to the original net while retaining all legal states. Therefore, is maximally permissive. □
Figure 8 shows a dual-process
PR net
, where
,
,
,
,
,
,
, the number of operation places in
,
,
, and
are
x,
y,
z, and
w, respectively.
Theorem 8. Let be a marked dual-process PR, and x, y, z, and w respectively represents the number of operation places in , , , and , where is the number of control places added according to Definition 25. As a result, k is only related to y and z, and satisfies .
Proof. The control places defined by Definition 25 have a one-to-one correspondence with . Therefore, the number k of is equal to the number of . According to Definition 23, the following conditions are satisfied:
(1) The controlled place set is the set of operation places in the encounter path pair and , denoted as .
(2) The controlled place set is the set of operation places in the encounter path pair and , denoted as .
(3) The controlled place set is the set of operation places in the encounter path pair and , and , which excludes the set of places in , i.e., .
(4) If , where contains y operation places, the number of is . Correspondingly, the number of is . Similarly, if , the number of is . In summary, the number of is , and the number of , i.e., . □
Example 2. In the dual-process PR net shown in Figure 7, since the number of reachable states is 405, and the number of good states is 380, the net is dead. The sets and are presented in Table 4. According to Definition 25, a control place needs to be added to each controlled place set. The control places and the controlled place set together form a P-invariant, and the control places are listed in Table 5. As a result, the controlled net with 380 reachable states is live and maximally permissive.