## 3 The Proposed Decomposition Method  
This section introduces a decomposition technique of a Petri net-based CPS oriented toward realization as an integrated system, e.g., An FPGA device. The proposed decomposition technique is shown in Algorithm 1. The method involves the linear algebra technique. The sequential components are obtained by computation of the place invariants with further manual selection of required SMCs. ```
Data: Incidence matrix \(A_{\left|T\right|\times\left|P\right|}\) of Petri net \(N=(P,T,F,M_{0})\) Result: S-decomposition \(\mathcal{S}\) of \(N=(P,T,F,M_{0})\) 1. Initialisation: 1.  form a unit matrix \(Q=[D|A]\) and initialise \(D\) as an identity matrix; 2. For each column \(t\) of matrix \(A\): 1.  find row pairs that annul the \(t\)-th column of \(A\) and append it to matrix \(Q\); 2.  delete rows of \(Q\) whose intersection with the \(t\)-th column is not equal to 0; 3.  reduce the redundant rows of \(Q\) (rows that binary cover to the other ones). ; 3. For each row \(r\) of \(A\) whose all elements are equal to 0: 1.  obtain support \(I_{r}\) of place invariant from matrix \(D\); 2.  construct a subnet \(S_{r}\) of \(N\) according to Definition 5. If \(S_{t}\) forms a proper SMC, add \(S_{r}\) to the Sdecomposition:- \(\mathcal{S}=\mathcal{S}\cup S_{r}\); 3.  remove \(r\) from Q. 4. Examine whether \(\mathcal{S}\) fulfils the designer needs: 1.  if \(\mathcal{S}\) fulfils the needs: 1.  manually select the most suitable SMCs, according to the requirements (the redundant components are removed from \(\mathcal{S}\)); 2.  search for places that occur in more than one SMC and manually replace them by NOPs according to Def. 7. (subsequent replaced places can be joined). 2.  otherwise: 1.  if \(t<\left|T\right|\) go to the step 2; 2.  else return \(\mathcal{S}=\varnothing\) with information that the system cannot be decomposed. 5. Synchronisation: for each transition \(t\in T\) shared by two or more components \(\mathcal{S}^{\prime}\in\mathcal{S}\): 1.  add a synchronisation signal \(z_{ti}\) to input place of \(t\) in each component \(S_{i}\in\mathcal{S}^{\prime}\); 2.  assign a logical conjunction of all synchronisation signals \(z_{ti}\) to \(t\). 6. Return the set of decomposed and synchronised components \(\mathcal{S}\). ```  
**Algorithm 1** Decomposition of a Petri net-based integrated system  
It should be noted that the general idea was initially shown in our previous papers [29; 33]. However, the technique proposed in this paper is significantly modified in order to adjust the obtained components to the designer's requirements. In particular, the components are obtained subsequently and examined at each step of the algorithm, whether they fulfil the designer requirements. Therefore, there is no need to apply an additional selection process. The main advantage of such a proposition is the obtained set of components, which is strictly adjusted to the designer's needs. The proposed algorithm consists of six main stages. As the input data, an incidence matrix of a Petri net is read. The main operations are executed on the unit matrix \(Q\) that unifies the resulting matrix \(D\) (initially set as an identity matrix), and incidence matrix \(A\) of a Petri net. The first three steps of the method are aimed at searching for subsequent sequential components in the system. The presented algebraic operations transform the unity matrix by annulling the subsequent transitions (columns). After each such operation, matrix \(A\) is examined in accordance with the rows that contain entirely zeros. The existence of such values means that place invariants are found (whose supports can be read from \(D\)). Moreover, step 3b verifies whether the obtained invariants form proper SMCs and includes them in the temporal set of decomposed components \(\mathcal{S}\). At the fourth stage the designer manually examines whether obtained SMCs fulfil the assumed requirements. If the result satisfies the needs, the redundant components are removed from the set \(\mathcal{S}\).