# P System with Fractional Reduction
## 4 Fractional Simplification P System
### P System for Fraction Simplification in the Division Algorithm
#### 4.3.2 Membrane Rules for Combining the Two Methods
Taking membrane A\({}_{1}\) as an example, the multiset \(x^{b_{1}}y^{b_{1}}\) generated by executing rule \(r_{1}\) is the value used for temporary storage \(b_{1}\) and is used to compare with \(\xi\), to determine whether to convert; \(r_{2}\) converts \(c\) to \(k,e,j\); execute \(r_{3}\) to converts the remaining multiset \(a^{n_{1}-b_{1}}\) to multiset \(a_{1}{}^{u_{1}}a_{1}{}^{u_{1}}{}^{u_{1}}{}^{u_{1}}\) for backup (\(u_{1}=a_{1}-b_{1}\)): \(a_{1}\) passes the difference \(u_{1}\) to the submembrane and does not participate in other comparisons; object \(u\) compares size with \(y\) and decides how to pass \(A_{2}\) and \(b_{2}\) to submembrane \(a_{2}\); and object \(i\) compares value with \(d\) and determines whether to end the more phase derogation algorithm and start using the division algorithm. Execute \(r_{4}\) to compare the difference between \(u_{1}\) and \(\xi\), at this point. 2. When \(u_{1}>\xi\) (i.e., after executing \(r_{4}\), object \(i\) remains in the membrane after the execution), the execution of \(r_{5}\) converts \(i\) and \(g\) to \(f\) and continues using the more phase derogation algorithm, the order of execution in this case is \(r_{6}\rightarrow\{r_{7},r_{10}\}\rightarrow\{r_{8},r_{9}\}\rightarrow\{r_{11}, r_{12}\}\) or \(r_{6}\rightarrow\{r_{7},r_{10}\}\rightarrow\{r_{8},r_{13}\}\rightarrow\{r_{14}, r_{15}\}\). 1. Execute rule \(r_{6}\) to convert \(y\) and \(u\) into object \(\lambda\) to determine the magnitude of the subtraction and the difference. When there is \(\lambda\) in the membrane, \(r_{7}\) is executed to dynamically generate Class A submembrane. After the object \(CreateSubMem\) is consumed, it indicates that the submembrane has been generated. At the same time, \(r_{10}\) is executed to transfer \(c\) into the submembrane \(A_{2}\). 2. As the CreateSubMem in the membrane is consumed, \(r_{8}\) is then executed to pass the remaining multiset, \(Num^{u_{1}-1}\), into the submembrane for continued dynamic generation of the membrane. At this point, if the object \(y\) is still remaining within the membrane, it indicates that the minus number is larger and that both the larger and smaller values in the submembrane need to be replaced. Execution of \(r_{9}\) generates \(\delta\) within this membrane and also generates \(z\) to be passed into the inner membrane \(A_{2}\), i.e., \(z_{2}=1\). 3. Object \(\delta\) serves as the condition for executing \(r_{11}\), passing the subtractive backup \(x^{b_{1}}\) of the membrane to the subtractive \(a\) of the submembrane, and executing \(r_{12}\) to transfer the differential backup \(a_{1}{}^{u_{1}}\) to the subtractive b of the submembrane, i.e., \(a_{2}=b_{1}\), \(b_{2}=u_{1}\). 4. If there is still object \(u\) in membrane \(A_{1}\), it proves that only the subtracted number \(a\) needs to be replaced in the submembrane \(A_{2}\), and the value of \(b\) is equal to that of the membrane \(A_{1}\), i.e., \(a_{2}=u_{1}\). \(b_{2}=b_{1}\), and \(z_{2}=0\) (indicating that there is no object \(z\) inside the submembrane \(A_{2}\) and no need to execute the rule); at this time, there are still objects \(u\) and \(\varepsilon\) in the membrane, and executing \(r_{13}\) generates \(h\); under the catalysis of \(h\), execute \(r_{14}\) to transfer the backup subtracted number \(x^{b_{1}}\) to the subtracted number \(b^{b_{2}}\) in the submembrane, and execute \(r_{15}\) to transfer the difference backup \(a_{1}{}^{u_{1}}\) to the subtracted number \(a^{n_{2}}\) in the submembrane. \(\{r_{16},r_{17}\}\) is aimed at the special case where the subtraction \(b_{i}\) is directly equal to the difference \(u_{i}\), and there is no need for tossing and dividing. They directly generate \(p^{2}q\) to start the more phase decrement improvement part. For details, please refer to Section 4.1.2 of this paper. 3. When \(u_{1}\leq\xi\), the order of rule execution in this membrane, at this time, is \(r_{18}\rightarrow\{r_{19},r_{20}\}\). When the object \(g\) exists and both \(i\) and \(f\) do not exist, execute \(r_{18}\) to convert \(g\) to \(o\).