## 3 Deadlock Prevention Policy for Reconfigurable S\({}^{3}\)PR Net Based on Siphons
(\(N_{RC}\), \(M_{\text{RC}o}\)) is said to be a controlled reconfigurable \(S^{3}PR\) net resulting from the integration of (\(N_{k}\), \(M_{\text{ko}}\)) and (\(V\), \(M_{\text{Vo}}\)), expressed as (\(N_{k}\), \(M_{\text{ko}}\)) \(\parallel\) (\(V\), \(M_{\text{Vo}}\)), where \(N_{RC}\) = (\(P_{RC}\), \(T_{RC}\), \(F_{RC}\), \(W_{RC}\), \(M_{\text{RC}}\), \(K_{RC}\)), \(P_{RC}\) = \(P_{\mathcal{C}k}\cup P_{V}\), \(T_{RC}\) = \(T_{k}\cup T_{V}\), \(F_{RC}\): (\(P_{RC}\times T_{RC}\)) \(\cup\) (\(T_{RC}\times P_{RC}\)) \(\rightarrow\)**IN** is a smaller flow relations, \(W_{RC}\): (\(P_{RC}\times T_{RC}\)) \(\cup\) (\(T_{RC}\times P_{RC}\)) \(\rightarrow\)**IN** is a mapping that assigns a weight to an arc, \(M_{\text{RC}o}\): \(P_{RC}\rightarrow\)**IN** is the initial marking, and \(K_{RC}\): \(P_{RC}\rightarrow\)**IN** is the function of capacity that assigns to each place \(p\) the maximal number of tokens \(K_{RC}\)(\(p\))._  
Based on the concept of place invariant and siphon control, the deadlock prevention algorithm for reconfigurable S\({}^{3}\)PR net is developed as follows:To illustrate the proposed Algorithm 2, reconsider the initial S\({}^{3}\)PR net (\(N_{o}\), \(M_{o}\)) illustrated in Figure 2. The initial net has four minimal siphons \(S_{1}=\{p_{1},p_{2},p_{3},p_{4}\}\), \(S_{2}=\{p_{3},p_{5}\}\), \(S_{3}=\{p_{2},p_{4},p_{6}\}\), and \(S_{4}=\{p_{4},p_{5},p_{6}\}\). The \(N_{o}\) incidence matrix is  
\[[N_{o}]=\left[ \begin{array}{cccc}-1&0&0&1\\ 1&-1&0&0\\ 0&1&-1&0\\ 0&0&1&-1\\ 0&-1&1&0\\ -1&1&-1&1\end{array} \right] \tag{9}\]  
while its initial marking is:  
\[M_{o}=\left[ \begin{array}{cccccc}5&0&0&0&1&1\end{array} \right]^{\rm T} \tag{10}\]  
\(S_{4}\) creates monitor \(V_{S1}\), therefore one monitor \(V_{S1}\) is added, which enforces:  
\[M(p_{4})+M(p_{5})+M(p_{6})\geq 1 \tag{11}\]  
The following place invariant is generated:  
\[M(V_{S1})=M(p_{4})+M(p_{5})+M(p_{6})-1 \tag{12}\]  
The current matrices \(\mathcal{L}\) and \(\mathcal{B}\) represent the Equation (12). \[\mathcal{L}=\left[ \begin{array}{cccccc}0&0&0&1&1&1\end{array} \right]\text{, } \mathcal{B}=[1] \tag{13}\]while the others minimal siphons create constraints in \((\mathcal{L}_{o};\mathcal{B}_{o})\). \[\mathcal{L}_{o}=\left[ \begin{array}{cccccc}1&1&1&1&0&0\\ 0&0&1&0&1&0\\ 0&1&0&0&0&1\end{array} \right],\ \mathcal{B}_{o}=\left[ \begin{array}{c}1\\ 1\\ 1\end{array} \right] \tag{14}\]  
The controller net incidence matrix is calculated by Equation (8):  
\[\left[N_{V_{S}}\right]=-\mathcal{L}_{*}[N_{o}]=\left[ \begin{array}{cccccc}- 1&0&1&0\end{array} \right] \tag{15}\]  
The controller's initial place marking is calculated as:  
\[M_{o}(V_{S1})=M_{o}(p_{4})+M_{o}(p_{5})+M_{o}(p_{6})-1=1\]  
The controlled net of \((N_{o},M_{o})\) is illustrated in Figure 7. The place and arcs of the controller are shown with blue lines. Now, reconsider the reconfigured S\({}^{3}\)PR net by addition of new machine \((N_{1},M_{1o})\) illustrated in Figure 3c. The reconfigured net has seven minimal siphons \(S_{1}=\{p_{3},p_{5}\}\), \(S_{2}=\{p_{7},p_{9}\}\), \(S_{3}=\{p_{2},p_{4},p_{6}\), \(p_{8}\}\), \(S_{4}=\{p_{4},p_{5},p_{6},p_{8}\}\), \(S_{5}=\{p_{2},p_{6},p_{8},p_{9}\}\), \(S_{6}=\{p_{5},p_{6},p_{8},p_{9}\}\), and \(S_{7}=\{p_{1},p_{2},p_{3},p_{4},p_{7},p_{8}\}\). The \(N_{1}\) incidence matrix is:  
\[[N_{1}]=\left[ \begin{array}{cccccc}-1&0&0&0&0&1\\ 1&-1&0&0&0&0\\ 0&1&-1&0&0&0\\ 0&0&1&-1&0&0\\ 0&-1&1&0&0&0\\ -1&1&-1&1&-1&1\\ 0&0&0&1&-1&0\\ 0&0&0&0&1&-1\\ 0&0&0&-1&1&0\end{array} \right] \tag{16}\]  
while its initial marking is:  
\[M_{1O}=\left[ \begin{array}{cccccc}5&0&0&0&1&1&0&0&1\end{array} \right]^{T} \tag{17}\]  
Figure 7: Controlled S\({}^{3}\)PR net by Algorithm 2. \(S_{4}\), \(S_{5}\), and \(S_{6}\) create monitor \(V_{S1}\), \(V_{S2}\), and \(V_{S3}\), respectively.