## 4 Implementation of the Extended Algorithm
### Discovering Meta-States
Let \(M=\langle V,\ E,\ v_{stat},v_{end},\ sig\rangle\) and \(M^{\prime}=\langle V^{\prime},\ E^{\prime},v_{start},\ v_{end},sig^{\prime}\rangle\) be a process model before and after significant cycles folding, respectively, and let us introduce the following notations:  
* \(\widetilde{V}=\left\{\widetilde{v}=\langle\widetilde{v}_{1},\widetilde{v}_{2} \ldots\widetilde{v}_{k}\rangle|\langle\widetilde{v}_{j},\ \widetilde{v}_{j+1}\rangle\in E\ \forall j=\overline{1,k-1},\ \forall k\leq n,\ \langle \widetilde{v}_{k},\ \widetilde{v}_{1}\rangle\in E\right\}\)--meta-states, i.e., significant cycles found in the process model \(M\), and \(\widetilde{v}(i)=\widetilde{v}_{i}\),
* \(V^{+}=\left\{v\in V\middle|\exists i\ v=\widetilde{v}_{i},\ \widetilde{v}\in \widetilde{V}\right\}\) is a set of meta-state vertices,
* \(V^{-}=V\backslash V^{+}\) is a set of vertices not appearing in meta-states,
* \(\widetilde{E}\subseteq E\cup\left(V\times\widetilde{V}\right)\cup\left( \widetilde{V}\times V\right)\) is a set of edges obtained for the event log with collapsed cycles. Then, \(V^{\prime}\subseteq V\cup\widetilde{V}\), \(E^{\prime}\subseteq\widetilde{E}\) for outer aggregation, and \(V^{\prime}\subseteq V^{-}\cup\widetilde{V}\), \(E^{\prime}\subseteq\left(V^{-}\times\widetilde{V}\right)\cup\left( \widetilde{V}\times V^{-}\right)\subseteq\widetilde{E}\) after inner joining with updating significance for redirected edges as follows:  
\[sig^{\prime}(\langle u,v\rangle)=\frac{\sum_{j=1}^{k}\vee_{q:q=v(i)}\left(r_{* }(q,v)\wedge 1_{\widetilde{v}_{j}}(\langle u,q\rangle)\right)}{k}\ \forall u\in V^{-},\ v\in \widetilde{V} \tag{12}\]  
\[sig^{\prime}(\langle u,v\rangle)=\frac{\sum_{j=1}^{k}\vee_{q:q=u(i)}\left(r_{* }(q,u)\wedge 1_{\sigma_{j}}(\langle q,v\rangle)\right)}{k}\ \forall u\in\widetilde{V},\ v\in V^{-} \tag{13}\]  
where \(r_{*}\) is defined for the filtering aggregation function that is defined in two forms:  
\[r_{all}(v,\widetilde{v})=\left\{ \begin{array}{ll}1,\ \exists i:\ v=\widetilde{v}(i) \text{\rm'{.}}\forall v\in V^{+},\ \widetilde{v}\in\widetilde{V}\\ 0,\ \text{otherwise,}\end{array} \right. \tag{14}\]  
\[r_{freq}(v,\widetilde{v})=\left\{ \begin{array}{ll}1,&\text{argmax }\ \ \ sig(v^{\prime})= \widetilde{v},\\ &v^{\prime}\in\widetilde{V}\\ \exists i:v=v^{\prime}(i)&\forall v\in V^{+},\ \widetilde{v}\in\widetilde{V}\\ &0,\ \text{otherwise,}\end{array} \right. \tag{15}\]Formulas (12) and (13) depict how we \"hide\" transitions between events, one of which meta-states absorb, i.e., recalculate their frequencies according to \(r_{*}\) (14) and (15). After meta-states discovery, the event log is rebuilt, as in the example illustrated in Figure 5. The activities included in meta-states are not considered when we mine a process from the event log in the case of inner joining. Their precedence relations are redirected to corresponding meta-states determined by \(r_{*}\). We show an example of how the proposed technique can transform a model in Figure 6: (a) the initial process model has two simple cycles (BC and BCD); (b) if we assume they appeared in the event log in more than half of the cases, they are significant and may appear in the model as nodes along with the activities which compose these cycles in the case of outer aggregation; (c) performing inner joining with \(r_{all}\) hides activity C, which is an element of the significant cycles, and incorporates frequencies of transitions associated with C (A \(\rightarrow\) C) with frequencies of transitions to or from all meta-states containing C (A \(\rightarrow\) BC, A \(\rightarrow\) BCD); and (d) inner joining with \(r_{frag}\) is similar to the previous case but recounts frequencies of only the most significant meta-states (e.g., BCD). It is worth noting that after the introduction of meta-states, the frequencies are re-calculated for states and meta-states. This may cause the appearance of events unseen in process models without meta-states.