• No results found

This section mainly introduces the deadlock prevention policy proposed by Ezpeleta et al. in [16]. It develops a systematic method to establish a liveness-enforcing su-pervisor for an S3PR by adding monitors for its strict minimal siphons such that they are prevented from being unmarked. The work in [16] is usually considered to be one of the most significant contributions in deadlock control area using a Petri net formalism [21].

Before the presentation of the policy, some notations are first introduced in order that the readers can understand it well. It should be stressed that many monitor-based deadlock prevention policies in the literature are motivated by the seminal work in [16] and [29].

Let N= (P, T, F) be an S2P with idle process place p0. The length of a path (circuit) in a Petri net is defined as the number of its nodes. The support of a path (circuit) is the set of its nodes.

• Let C be a circuit of N and x and y be two nodes of C . Node x is said to be previousto y iff there exists a path in C from x to y, the length of which is greater than one and does not pass over the idle process place p0. This fact is denoted by x<C y.

• Let x and y be two nodes in N. Node x is said to be previous to y in N iff there exists a circuit C such that x<C y. This fact is denoted by x<Ny.

• Let x and A ⊆ P ∪ T be a node and a set of nodes in N, respectively. Then x <NA iff there exists a node y∈ A such that x <Nyand A<Nxiff there exists a node y∈ A such that y <Nx.

Example 5.9.In the net N in Fig. 5.3, C = p1t1p7t2p3t3p5t4p6t5p1is a circuit and EP(p7, p6) = p7t2p3t3p5t4p6is a path in C . The support of EP(p7, p6) is {p7, t2, p3, t3, p5, t4, p6} and the support of C is {p1,t1, p7,t2, p3,t3, p5,t4, p6,t5}. Clearly, we have p7<C p6and p7<N p6.

The following notations are also useful in the establishment of a deadlock preven-tion policy. Mathematically, given a set A, the power set (or powerset) of A, written as 2A, is the set of all subsets of A. Note thatΠ is used to denote the set of strict minimal siphons in an S3PR(N, M0). First the definitions of the sets of downstream and upstream siphons of a transition are given.

Definition 5.19. Let∆+(t) (∆(t)) denote the set of downstream (upstream) siphons of a transition t and PS denote the adjoint set of a siphon S in an S3PR N =

ni=1Ni= (P0∪ PA∪ PR, T, F).

120 5 Deadlock Control Based on Elementary Siphons 1.∆+: T → 2Π is a mapping defined as follows: If t ∈ Ti, then ∆+(t) = {S ∈

Π|t <N

i[S]i}. If S ∈∆+(t) then the set [S]iis reachable from t, i.e., there exists a path in Nileading from t to an operation place p∈ PAithat is not included in S but uses a resource of S, where[S] = ∪ni=1[S]i, PA= ∪ni=1PAi, and[S]i= [S] ∩ PAi. 2.∆: T → 2Π is a mapping defined as follows: If t ∈ Ti, then ∆(t) = {S ∈

Π|[S]i<Nit}.

3.∀i ∈ Nn,∀S ∈Π, PSi= [S]i∪ {p ∈ PAi|p <Ni [S]i}, and PS= ∪ni=1Pi

S.

Example 5.10.Take the net shown in Fig. 5.3 as an example. There are three strict minimal siphons S1= {p5, p9, p12, p13}, S2= {p4, p6, p13, p14}, and S3= {p6, p9, p12, p13, p14}. Their complementary sets are [S1] = {p3, p4}, [S2] = {p5, p8}, and[S3] = {p3, p4, p5, p8}, respectively. We have downstream siphons∆+(t1) =

+(t2) =∆+(t8) = {S1, S2, S3}, ∆+(t3) = {S2, S3}, and ∆+(t4) =∆+(t10) = /0.

Similarly, upstream siphons include ∆(t1) =∆(t2) =∆(t6) =∆(t7) = /0,

(t3) = {S1}, and∆(t4) =∆(t5) = {S1, S2, S3}.

We have adjoint sets PS1 = PS1

1∪ PS21 = ({p3} ∪ {p7}) ∪ ({p4} ∪ {p8}) = {p3, p4, p7, p8}, PS2 = PS12∪ PS22 = ({p5} ∪ {p7, p3}) ∪ {p8} = {p7, p3, p5, p8}, and PS3= PS13∪ PS23 = ({p3, p5} ∪ p7) ∪ {p4, p8} = {p7, p3, p5, p4, p8}.

Definition 5.20. Let(N, M0) be an S3PR with N= ni=1Ni= (PA∪ P0∪ PR, T, F).

The net(NV, M0V) = (PA∪ P0∪ PR∪ PV, T, F ∪ FV, M0V) is the controlled system of (N, M0) iff:

1. PV = {VS|S ∈Π} is a set of monitors such that there exists a bijective mapping betweenΠ and PV.

2. FV= FV1∪ FV2∪ FV3, where FV1= {(VS,t)|S ∈∆+(t),t ∈ P0•}, FV2= {(t,VS)|t ∈ [S], S /∈∆+(t)},

FV3= ∪ni=1{(t,VS)|t ∈ Ti\ P0•, S /∈∆(t),t∩ PAi⊆ PSi,t≮ [S]i}.

3. M0Vis defined as follows: (1)∀p ∈ PA∪ P0∪ PR, M0V(p) = M0(p) and (2) ∀VS∈ PV, M0V(VS) = M0(S) − 1.

Theorem 5.6.(NV, M0V) is live [16].

Example 5.11.For the net shown in Fig. 5.3, three monitors are needed to prevent three strict minimal siphons from being emptied. We first take S1= {p5, p9, p12, p13} as an example. Since P0= {p1, p10}, we have P0•= {t1,t8}. As a result, {(VS1,t1), (VS1,t8)} ⊆ FV1.

Due to[S1] = {p3, p4}, [S1]= {t3,t10}. Note that S1∈/∆+(t3) and S1∈/∆+(t10).

We have{(t3,VS1), (t10,VS1)} ⊆ FV2.

Next let us find the arcs related to VS1in FV3. Let Tα= (T1\ P0•) ∪ (T2\ P0•),

Tβ= {t|S1∈/∆(t),t ∈ T },

Tγ= {t|t∩ PA1⊆ PS1} ∪ {t|t∩ PA2⊆ PS2},

Tδ = {t|t ≮ [S1]1} ∪ {t|t ≮ [S1]2}.

According to Theorem 5.6, the net in Fig. 5.6 is live. ⊓⊔ Remark 5.1.For a strict minimal siphon S, this policy ensures that the maximal number of tokens held by PSis not more than M0(S). Since [S] ⊆ PS, S cannot be emptied if a monitor VSis added for it. For example, S1= {p5, p9, p12, p13} is a strict minimal siphon with M0(S1) = 2. Its monitor guarantees that the maximal number of tokens held in PS1 is M0(S1) − 1 = 1.

Next we present an FMS example to illustrate the deadlock prevention policy.

This FMS is extensively investigated in the literature [6, 7, 16, 24, 30–33, 52, 54].

Particularly, in a recent survey paper [36], this FMS is exploited as a benchmark example to compare a variety of deadlock prevention policies in the literature.

122 5 Deadlock Control Based on Elementary Siphons Example 5.12.A flexible manufacturing cell as shown in Fig. 5.7 has four machine tools M1− M4. Each machine tool can hold two parts at the same time. Also the cell contains three robots R1− R3 and each of them can hold one part. Parts enter the cell through three loading buffers I1− I3, and leave the cell through three unloading buffers O1− O3. Three part types J1 − J3 are produced. The machine tools perform operations on raw parts and the robots deal with the movements of parts.

M 1

M 2

M 3

M 4 R 1

R 2

R 3 I 1

I 2

I 3

O 3

O 2

O 1

J 1 M 2

J 2 M 4 M 3

J 3

M 3 M 4 M 1 M 2 Fig. 5.7 The layout of a flexible manufacturing cell

• R1 handles part movements from I3 to M1, I3 to M3, and M3 to O2.

• R2 handles part movements from M1 to M2, M4 to M3, M3 to M4, I1 to M2, and M2 to O1.

• R3 handles part movements from I2 to M4, M2 to O3, and M4 to O3.

• M1 performs operations on J3.

• M2 performs operations on J1 and J3.

• M3 performs operations on J2 and J3.

• M4 performs operations on J2 and J3.

The production routes of the parts are as follows:

• J1: I1 → R2 → M2 → R2 → O1;

• J2: I2 → R3 → M4 → R2 → M3 → R1 → O2;

• J3: I3 → R1 → M1 → R2 → M2 → R3 → O3 or I3→ R1 → M3 → R2 → M4 → R3 → O3.

The flexible manufacturing cell contains global and local deadlocks if it is not properly supervised. Suppose that the system is in the scenario that M4 is fully occupied by machining two J3-type raw parts and R3 picks up a J2-type raw part and tries to upload M4. The processes to produce J2 and J3 remain indefinitely blocked since no further operations on them can be performed. That is to say, the system is in a local deadlock state.

While, if the system is in such a state that M4 is fully occupied by machining two J3-type raw parts, R3 has picked up a J2-type raw part from I2 and is trying to upload M4, M2 is fully occupied by machining two J1-type raw parts, and R2 has downloaded a J3-type part from M1 and is trying to upload M2, it will enter a global deadlock state. In this case, the whole system will be completely blocked.

The system can be modeled with Petri nets. Its model(N, M0) is shown in Fig.

5.8. The physical meaning of each place is explained in Table 5.1. Let T1= {t11− t14}, T2= {t15− t20}, and T3= {t1− t10}. This model belongs to S3PR where p1, p5, and p14are idle process places, p20− p26are resource places, and the others are operation places. The occurrence of system deadlocks corresponds to the existence of unmarked siphons in the model. They can be successfully prevented by properly supervising the siphons in their net model.

There are 18 strict minimal siphons in the Petri net model of the flexible man-ufacturing cell. These siphons, their complementary sets, and their corresponding monitors are shown in Tables 5.2− 5.4, respectively.

Next S1 = {p10, p18, p22, p26}, S3 = {p2, p4, p8, p13, p17, p21, p26}, and S5 = {p2, p4, p8, p10, p17, p21, p22, p26} are taken as examples to show the way of adding monitors to prevent them from being unmarked.

According to the definition of the complementary set of a siphon, we have [S1] = (H(p22) ∪ H(p26)) \ S1= ({p10, p19} ∪ {p13, p18}) \ S1= {p13, p19}, [S3] = ({p2, p4, p8, p12, p17} ∪ {p13, p18}) \ S3= {p12, p18}, and [S5] =({p2, p4, p8, p12, p17} ∪ {p10,p19} ∪ {p13, p18})\S5= {p12, p13, p18, p19}.

Since P0= {p1, p5, p14}, we have P0•= {t1,t11,t15}. {S1, S3, S5} ⊆∆+(t1), {S1, S3, S5} ⊆∆+(t15), and ∀S ∈ {S1, S3, S5}, S /∈∆+(t11). This leads to {(VS1,t1), (VS1,t15), (VS3,t1), (VS3,t15), (VS5,t1), (VS5,t15)} ⊆ FV1.

From [S1] = {p13, p19}, [S1] = {t10,t16}. It is clear that S1 ∈/ ∆+(t10) and S1∈/∆+(t16). Therefore, {(t10,VS1), (t16,VS1)} ⊆ FV2. From[S3] = {p12, p18}, [S3]= {t9,t17}. It is clear that S3∈/∆+(t9) and S3∈/∆+(t17). Therefore, {(t9,VS3), (t17,VS3)}

⊆ FV2.

The case of S5is slightly different from S1and S3. From[S5] = {p12, p13, p18, p19}, we have [S5]= {t9,t10,t16,t17}. However, S5∈∆+(t9), S5∈∆+(t16), S5∈/

+(t10), and S5∈/∆+(t17). As a result, {(t10,VS5), (t17,VS5)} ⊆ FV2.

In order to determine the set of additional arcs in FV3for VS1, VS3, and VS5, we first find PS1, PS3, and PS5.

PS

1 = PS11∪ PS21∪ PS31, where PSi1= [S1]i∪ {p ∈ PAi|p <Ni[S1]i}, i = 1,2,3.

It is easy to see that[S1]1= /0, [S1]2= {p19}, [S1]3= {p13}, {p ∈ PA1|p <N1[S1]1} = /0,{p ∈ PA2|p <N2 [S1]2} = /0, and {p ∈ PA3|p <N3 [S1]3} = {p6, p11, p12}. Hence PS

1 = {p13, p19, p6, p11, p12}.

124 5 Deadlock Control Based on Elementary Siphons

Fig. 5.8 The Petri net model(N, M0) of a flexible manufacturing cell

∀t ∈ T1\ P0•, t∩ PA1 ⊆ PS11 is not true since t∩ PA1 = /0 but PS11 = /0. M0V(VS5) = 3. The monitors for other siphons can be accordingly determined as shown in Table 5.4. The resultant net with 18 monitors, i.e., the controlled system, is denoted by(NV, M0V), and is live with 6,287 reachable states.

Table 5.1 Meanings of the places in the net model shown in Fig. 5.8 p1: Raw materials in I1 available

p2: R2 uploads M2 p3: M2 machining

p4: R2 downloads M2 and puts finished parts in O1 p5: Raw materials in I3 available

p6: R1 uploads M1 or M3 p7: M1 machining

p8: R2 downloads M1 and uploads M2 p9: M2 machining

p10: R3 downloads M2 or M4 and put finished parts in O3 p11: M3 machining

p12: R2 downloads M3 and uploads M4 p13: M4 machining

p14: Raw materials in I2 available

p15: R1 downloads M3 and puts finished parts in O2 p16: M3 machining

p17: R2 downloads M4 and uploads M3 p18: M4 machining

p19: R3 uploads M4 p20: R1 available p21: R2 available p22: R3 available p23: M1 available p24: M2 available p25: M3 available p26: M4 available

Table 5.2 Strict minimal siphons in the model(N, M0), where * means the corresponding siphons are dependent ones

S Places S Places

S1 p10, p18, p22, p26 S2 p4, p9, p12, p17, p21, p24

S3 p2, p4, p8, p13, p17, p21, p26 S4 p2, p4, p8, p12, p16, p21, p25

S5 p2, p4, p8, p10, p17, p21, p22, p26 S6 p4, p9, p12, p16, p21, p24, p25

S7 p4, p9, p13, p17, p21, p24, p26 S8 p2, p4, p8, p13, p16, p21, p25, p26

S9 p4, p10, p17, p21, p22, p24, p26 S10 p4, p9, p13, p16, p21, p24, p25, p26

S11 p2, p4, p8, p10, p16, p21, p22, p25, p26 S12 p2, p4, p8, p12, p15, p20, p21, p23, p25

S13 p4, p10, p16, p21, p22, p24, p25, p26 S14 p4, p9, p12, p15, p20, p21, p23, p24, p25

S15 p2, p4, p8, p13, p15, p20, p21, p23, p25, p26S16 p4, p9, p13, p15, p20, p21, p23−p26

S17 p2, p4, p8, p10, p15, p20−p23, p25, p26 S18 p4, p10, p15, p20−p26