## 5 Numerical Example  
In this section, an example is used to present the application of the proposed approach. Consider an AMS example illustrated in Figure 15a. Its Petri net model is given in [6, 7, 15, 22, 45, 46]. The system consists of four machines M1-M4 for processing parts; two robots R1 and R2 for loading and unloading parts. Each machine (robot) can process (hold) one part at a time. There are two input buffers II and I2 and two output buffers O1 and O2. Two raw part types, A and B, are considered to be processed in the system. Figure 15b shows the operation sequences of the two raw part types. The S\({}^{3}\)PR net of this AMS example is illustrated in Figure 16. It comprises 19 places and 14 transitions. The places can be defined as the following set partitions: \(P_{A}=\{p_{2},p_{3},\ldots,p_{12}\}\), \(P_{R}=\{p_{13},p_{14},\ldots,p_{18}\}\), and \(P^{0}=\{p_{1},p_{19}\}\). The S\({}^{3}\)PR net contains 282 reachable markings. Figure 14: Comparison of the proposed method with the existing methods. Figure 15: **(a)** An AMS example and **(b)** production sequence. Suppose that the first configuration of the system involves removing old machine. In this case, an old machine M1 is removed from the system (\(N_{o}\), \(M_{o}\)). To model the removed machine by using the synthesis procedure of Algorithm 1, we construct a configuration as a rewriting rule \(\mathcal{R}\)= \(\{rr_{1}\}\) with \(rr_{1}\) = \(\{L_{1}\), \(R_{1}\), \(\varphi_{1}\), \(\boldsymbol{\varphi_{1}}\), \(\boldsymbol{\varphi_{1}}\), \(\boldsymbol{\varphi_{1}}\)\(\boldsymbol{\varphi_{1}}\)\(\boldsymbol{\varphi_{1}}\)\(\boldsymbol{\varphi_{1}}\), where \(L_{1}\) and \(R_{1}\) are illustrated in Figures 17a and 17b, respectively. In addition, we have \(\xi_{1}\): \(N_{1}\)\(N_{o}\), \(\varphi_{1}\)= (\(\{p_{2}\), \(p_{3}\), \(p_{4}\), \(p_{5}\), \(p_{13}\), \(p_{16}\), \(p_{17}\}\),\(\{t_{1}\), \(t_{2}\), \(t_{3}\), \(t_{4}\), \(t_{5}\), \(t_{6}\)}), \(\boldsymbol{\varphi_{1}}\)= (\(\{L_{1}\).\(t_{1}\)),\(\{R_{1}\).\(t_{1}\}\)), and \(\varphi_{1}\)\(\boldsymbol{\ast}\) = (\(\{L_{1}\).\(t_{6}\}\),\(\{R_{1}\).\(t_{6}\}\)). The second configuration includes adding new product. If a new product (part C) is assigned to a system, which indicates that a new operation sequence is assigned and the system requires an adjustment to its Petri net model structure. To model the addition of new product by using the synthesis procedure of Algorithm 1, we construct a configuration as a rewriting rule \(\mathcal{R}\) = \(\{rr_{2}\}\) with \(rr_{2}\) = \(\{L_{2}\), \(R_{1}\), \(\varphi_{2}\), \(\boldsymbol{\ast}\)\(\varphi_{2}\), \(\boldsymbol{\varphi^{\ast}}\)\(\}\), where \(L_{2}\) and \(R_{2}\) are illustrated in Figures 18a and 18b, respectively. Moreover, we have \(\xi_{2}\): \(N_{2}\)\(\rightarrow\)\(N_{1}\), \(\varphi_{2}\)= (\(\{p_{15}\), \(p_{17}\), \(p_{20}\), \(p_{21}\), \(p_{22}\), \(p_{23}\}\),\(\{t_{15}\), \(t_{16}\), \(t_{17}\), \(t_{18}\}\)), \(\boldsymbol{\ast}\)\(\varphi_{2}\)= (\(\{L_{2}\).\(p_{15}\), \(L_{2}\).\(p_{17}\}\),\(\{R_{2}\).\(t_{15}\}\)), and \(\varphi_{2}\)\(\boldsymbol{\ast}\) = (\(\{L_{2}\).\(p_{15}\), \(L_{2}\).\(p_{17}\}\),\(\{R_{2}\).\(t_{15}\}\)), and \(\varphi_{2}\)\(\boldsymbol{\ast}\) = (\(\{L_{2}\).\(p_{15}\), \(L_{2}\).\(p_{17}\}\),\(\{R_{2}\).\(t_{18}\}\)). The third system configuration involves rework. In this scenario, a part can be inspected after all operations have been completed. By using the proposed Algorithm 1, the production operations of the reworked part can be exactly and easily modeled by considering rework operations as alternative sequences. Suppose that an inspection machine M5 is added to a system and that part A is processed in M1 and M3. Then, part A is moved to an M5 by Robot 2 to check if there are defects in part A. If part A performs properly, then it will leave the system by Robot 2. Otherwise, if part A has defects, rework is needed, and part A is moved to M3 by Robot 2.