# P System Design for Integer Factorization
## 2 Foundation  
### Cell-like P System  
In this section, we briefly introduce a basic model of a cell-like P system. The cell-like P system consists of membranes, intra-membrane objects, and intra-membrane evolutionary rules. Membranes labeled by different labels form the basic structure of the cell-like P system through nested structures. The outermost membrane, called the skin membrane, serves to delineate the entire membrane system from the external environment. When the membrane contains no other membrane, it is called an elementary membrane, otherwise, it is called a non-elementary membrane. In this paper, we do not strictly distinguish between elementary and non-elementary membranes, and we refer to them collectively as membranes. The data are represented by the number of objects inside the membrane and the objects are evolved by evolutionary rules. The evolutionary rules can not only change the number and type of objects, but also transport the objects between different membranes and make the membrane divide and dissolve. For example, in Figure 1, a structure consisting of four membranes is shown. Among them, _Skin_ represents the skin membrane. In addition to the _Skin_ membrane, we refer to the membranes numbered 2 and 3 as elementary membranes, while the membrane numbered 1 is a non-elementary membrane. The non-elementary membrane 1 contains two objects \(a\) and membrane 3, while membrane 3 contains object \(b\), while membrane 2 does not contain any object. The computation of cell-like P systems is performed by evolutionary rules, which are defined as rewrite rules for membranes and objects. All objects and membranes can evolve according to the evolution rules. If there are no evolutionary rules applicable to any object, the system stops computation. A cell-like P system of the degree m can be defined formally as follows:  
\[\Pi=(O,\mu,\omega_{1},\ldots,\omega_{m},R_{1},\ldots,R_{m},\rho_{1},...,\rho_{ m},i_{o}) \tag{1}\]  
where \(O\) is the alphabet of the system, representing the set of so objects used in the system. \(O^{*}\) is the set of strings that can be constructed using the symbols in \(O\). Each multiset can be represented by a string, where \(\lambda\) denotes the empty string and \(O^{+}=O^{*}-\{\lambda\}\);  
\(\mu\) is the membrane structure composed of \(m\) membranes, where each membrane is assigned a label to refer to itself;  
\(\omega_{i}(1\leq i\leq m)\) denotes the multiset of objects in membrane \(i\) in the initial state. The statement that \(\omega_{i}=\lambda\) means that there is no object in membrane \(i\). For instance, in Figure 1, \(\omega_{Env}=\lambda,\omega_{1}=a^{2},\omega_{2}=\lambda,\omega_{3}=b\);  
\(R_{i}(1\leq i\leq m)\) is the set of evolution rules in membrane \(i\). The representation of the intramembrane rule is \(u\to v\) or \(u\to v\delta\), where \(u\in O^{+}\), \(v\in(O\times Tar)\), \(Tar=\{\)_here_, \(in_{j}|1\leq j\leq m,out\}\). _Tar_ indicates the membrane to which the target object \(v\) will be sent; _here_ means to stay in the current membrane, \(in_{j}\) means that \(v\) will be sent to membrane \(j\), and _out_ means that \(v\) will be sent to the outside of membrane \(i\) (the father membrane of membrane \(i\)). The symbol \(\delta\) represents the membrane dissolution operation. After the membrane is dissolved, the objects in the membrane automatically flow into their parent membrane. It should be noted that the \(\delta\) operation cannot be performed on the skin membrane;  
\(\rho_{i}(1\leq i\leq m)\) defines the partial order relationship of the rules in \(R_{i}\). In this paper, the partial order relationship is shown in the form of priority; that is, the number after the rule is the priority of rule execution, and the smaller the number, the higher the priority, and 0 is the highest priority. For example, the priorities of rules \(a\to b,1\) and \(c\to d,2\) are one and two, respectively. \(i_{o}\) is the label of the membrane that holds the system output results.