## 3 Petri Net Representation
### HCPN Concepts  
It is well known that places, transitions, and directed arcs are three main constituent elements in PNs, a particular kind of bipartite-directed graphs. From the viewpoint of system engineering modeling, a collection of places is used to express the state of systems, and transitions are used to represent events that cause the system state change. The capabilities of a high-level programming language and module hierarchy are associated with PNs, leading to the concepts of Hierarchical-Colored PNs [34; 35]. **Definition 1**. : _A Colored Petri net is a 9-tuple \(\Sigma=(P,T,A,C,V,W,G,E,I)\), where:_  
1. \(P\) _is a finite set of places;_
2. \(T\) _is a finite set of transitions and_ \(P\cap T=\varnothing\)_;_
3. \(A\) _is a finite set of directed arcs,_ \(A\subseteq P\times T\cup T\times P\)_;_
4. \(C\) _is a finite set of non-empty color sets;_
5. \(V\) _is a set of typed variables, such that_ \(\forall v\in V\)_,_ \(\gamma_{\text{PP}}[v]\in C\)_;_
6. \(W:P\to C\) _is a color set function that assigns a color set to each place;_
7. \(G:T\to EXPR_{V}\) _is a guard function that assigns a guard to each transition_ \(t\) _such that_ \(Type[G(t)]=Bool\)_;_
8. \(E:A\to EXPR_{V}\) _is an arc expression function that assigns an arc expression to each arc a such that_ \(Type[E(a)]=C(p)_{\text{MS}}\)_, here,_ \(MS\) _means multiset;_
9. \(I:P\to EXPR_{0}\) _is an initialization function that assigns an initialization expression to each place_ \(p\) _such that_ \(Type[I(p)]=C(p)_{\text{MS}}\)_._  
**Definition 2**. : _A Colored Petri net module can be expressed as a 4-tuple \(\Sigma_{M}=(\Sigma,T_{\text{sub}},P_{\text{port}},PT)\), where:_  
1. \(\Sigma=(P,T,A,C,V,W,G,E,I)\) _is a non-hierarchical colored Petri net;_
2. \(T_{\text{sub}}\subseteq T\) _is a set of substitution transitions;_
3. \(P_{\text{port}}\subseteq P\) _is a set of port places;_
4. \(PT:P_{\text{port}}\rightarrow\{IN,OUT,I/O\}\) _is a port type function that assigns a port type to each port place._  
**Definition 3**. : _A Hierarchical-Colored Petri net can be expressed as a 4-tuple \(\Sigma_{H}=(S,SM,PS,FS)\), where:_1. \(S\) _is a finite set of modules. Each module is a Colored Petri net module \(s=((P^{s},T^{s},A^{s},C^{s},V^{s},W^{s},G^{s},E^{s},I^{s}),T^{s}_{\text{sub}},P^{ s}_{\text{port}},PT^{s})\), it is required that \((P^{s_{1}}\cup T^{s_{1}})\cap(P^{s_{2}}\cup T^{s_{2}})=\varnothing\) for all \(s_{1},s_{2}\in S\) such that \(s_{1}\
eq s_{2}\);_
2. \(SM:T_{\text{sub}}\to S\) _is a submodule function that assigns a sub module to each substitution transition. It is required that the module hierarchy is acyclic;_
3. \(PS\) _is a port-socket relation that assigns a port-socket relation \(PS(t)\subseteq P_{\text{sock}}(t)\times P^{SM(t)}_{\text{port}}\) to each substitution transition \(t\), it is required that \(ST(p)=PT(p^{\prime}),C(p)=C(p^{\prime})\), and \(I(p)\langle\rangle=I(p^{\prime})\langle\rangle\) for all \((p,p^{\prime})\in PS(t)\) and all \(t\in T_{\text{sub}}\);_
4. \(FS\subseteq 2^{P}\) _is a set of non-empty fusion sets such that \(C(p)=C(p^{\prime})\) and \(I(p)\langle\rangle=I(p^{\prime})\langle\rangle\) for all \(p,p^{\prime}\in f\)s and all \(f\in FS\)._  
In practical applications of PNs for system engineering modeling, complex business logic requirements may lead to the state space of a net system being extremely large such that it is very difficult to perform simulation and performance optimization. Fortunately, HCPN formalisms using fusion place, port/socket place and substitution transition (also known as aggregated transition) provide a hierarchical formulation to solve this issue, reducing the dimension of the state space. In other words, a complete large-scale CPN model can be divided into a number of sub-nets, which is easily represented and investigated. When an HCPN executable model is built, according to the firing rules defined in [34], full state spaces representing all possible executions of the model can be generated.