Next Article in Journal
Mobile Charging Scheduling Approach for Wireless Rechargeable Sensor Networks Based on Multiple Discrete-Action Space Deep Q-Network
Next Article in Special Issue
P System Design for Integer Factorization
Previous Article in Journal
An Improved Multi-Scale Feature Fusion for Skin Lesion Segmentation
Previous Article in Special Issue
Performing Arithmetic Operations with Locally Homogeneous Spiking Neural P Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

P System with Fractional Reduction

1
College of Computer Science and Engineering, Chongqing University of Technology, Chongqing 400054, China
2
College of Computer Science, Chongqing University, Chongqing 400044, China
*
Authors to whom correspondence should be addressed.
Appl. Sci. 2023, 13(14), 8514; https://doi.org/10.3390/app13148514
Submission received: 10 June 2023 / Revised: 11 July 2023 / Accepted: 21 July 2023 / Published: 23 July 2023
(This article belongs to the Special Issue Membrane Computing and Its Applications)

Abstract

:
Membrane computing is a branch of natural computing, which is a new computational model abstracted from the study of the function and structure of living biological cells. The study of numerical computation based on membrane computation has received increasing attention in recent years, where maximum parallelism in the execution of evolutionary rules plays an important role in improving the efficiency of numerical computation. Numbers in numerical computation are usually represented as decimals or fractions, and this paper investigates the fundamental problem in fraction representation and operations—fraction simplification. By improving the parallelization of two traditional fractional reduction algorithms, we design the corresponding fractional reduction class cells P System Π 1 and P System Π 2 . Combining these two P Systems, this paper designs P System Π 3 . The feasibility and effectiveness of the P System designed in this paper are verified experimentally with the simulation software UPSimulator, and the characteristics and application scenarios of the three P Systems are analyzed.

1. Introduction

Membrane computing (also known as P System) is a new branch of natural computing [1] introduced by Prof. Gh. Păun in a 1998 research paper and is an abstraction of a new model of computing based on the study of the function and structure of living cells in living organisms. The skin of a whole organism is equivalent to an entire computational System, which contains individual computational units. The membrane model of computing divides each biological cell into a hierarchy of regions, each of which is called a membrane; i.e., regions correspond to membranes. Each region contains a multiset of objects that evolve according to the evolutionary rules within the region, and the evolutionary rules vary from region to region. Membrane computation is based on the abstraction of living cells, and each computational unit is able to perform its own computation. Due to the extremely large number of cell membranes and the small amount of energy required to drive them, one of the greatest advantages of membrane computation is that it allows for maximum parallelism in the computation. Although computers nowadays have a profound impact on all aspects of human society, they still have limitations in their ability to process information. Due to their shortcomings, such as small storage capacity, slow computing speed and low intelligence, electronic computers are powerless to deal with many real-life challenges, such as NP problems. In contrast, membrane computing brings a finite, discrete, distributed, parallel, and hierarchical or mesh-based model of information processing to computer science [2]. Gh. Păun has demonstrated in the literature [3] that membrane computing has the equivalent computing power to Turing machines, and its powerful parallel computing capability can effectively solve the bottlenecks currently faced by electronic computers.
There is a proliferation of international research in the field of membrane computing, which has greatly facilitated the intersection and penetration of mathematics, computer science and biology. The research on membrane computing and membrane computers is developing rapidly, and great progress has been made in such areas as membrane computing applied to the solution of some NP-complete problems, membrane computing in biological laboratories, language Systems for membrane computers, associative memory problems, and the application of membrane computing to cryptography. For example, in solving NP problems, [4] proposed a new solution based on membrane computing and the dynamic window approximation algorithm, which enables the model to calculate the optimal motion command of the robot in logarithmic time and avoid obstacles in real time. Membrane computing is abstracted from living cells in organisms and is also applied to biology. In [5], it improved the implementation of biological processes, including Mitogen-activated protein kinase (MAPK), by virtue of its biological characteristics. In [6], it introduced the application of membrane computing in systems and Synthetic biology. Ref. [7] provided a detailed explanation of the extensive applications of membrane computing in biology, computer science, and linguistics for scholars to conduct in-depth learning and explore new ideas.
However, to achieve a general-purpose computer, it must also be able to implement basic arithmetic operations, such as the four operations of addition, subtraction, multiplication and division. Arithmetic operations are considered the basic operations for many complex operations, and therefore, to solve more complex problems, arithmetic operations need to be fully investigated first. Ref. [8] implemented arithmetic operations based on a designed arithmetic P System, but its membrane System structure was complex and did not make full use of the maximum parallelism of membrane computation; literature [9] designed a natural coding-based arithmetic P System to implement arithmetic operations, which greatly simplified the membrane System structure; Ref. [10] designed a multi-layer membrane P System to implement unsigned quadratic operations, which reduced the computational complexity; Ref. [11] designed a single-layer membrane P System to implement arithmetic operations, further simplifying the membrane structure and improving computational efficiency; Ref. [12] designed a multi-layer membrane P System to implement arithmetic operations with signed numbers, improving the application range and execution efficiency of basic operations; Refs. [13,14,15] designed a single-layer membrane P System to implement expression evaluation in the domain of integers; Ref. [16] used the P System implemented basic arithmetic operations in the domain of rational numbers, expanding the scope of application of arithmetic operations in P System to further enhance the computing power of biological computers.
Since all numbers in the Rational number field can be expressed as fractions, the results of arithmetic operations in the Rational number field may not be in the simplest form. If these results continue to be used in the new operation process, the fraction needs to be initialized first and reduced to its simplest form. In addition, from the perspective of mathematical rigor, the numerical meanings of 1/2 and 1349/2698 are the same. In the P System, the latter uses much more objects than the former. If used in other arithmetic P Systems, the large number calculation process will also be more complex, reducing system efficiency. In precise calculations, using 1/3 will be more accurate than 0.33333 and easier to represent in the P System. For this reason, scholars have conducted research on the problem of fractional simplification in order to simplify the process and obtain more accurate results when applying the simplification results to other arithmetic operations [17]. In [18], the authors studied a hybrid code-based arithmetic P System based on a cell-like P System and used fractional simplification as an example to simplify the arithmetic operations on large operands in the P System and to achieve fractional simplification after arithmetic operations on real numbers expressed as fractions in the P System. Its method used multi-layer membrane nesting, and the objects [19] inside each layer of membrane are related to the objects generated by its parent membrane, so this is a highly serialized P System that does not fully utilize the maximum parallelism of membrane computing. However, the solution to the problem of fractional simplification using membrane computing is not sufficient, and currently, there is no other literature that can fully utilize the characteristics of membrane computing to design a more suitable P System. In response to this phenomenon, we also study the issue of fractional reduction in this article, considering partial improvements on the basis of the more phase derogation method and attempting to find suitable solutions in the two traditional reduction methods of more phase derogation and division to further improve the parallelism of the P System, thereby improving the overall efficiency of arithmetic operations.
To this end, this paper designs a fraction simplification P System based on rule priorities, and the specific article is structured as follows:
Section 1 first introduces research on membrane computation in arithmetic operations, then presents the purpose and significance of this paper, and finally gives the organization of this paper.
Section 2 begins with an introduction to the biological basis of membrane computation, followed by a definition of the cell-like P System.
Section 3 introduces the principles and algorithms of two methods, namely, the more phase derogation algorithm and the division algorithm, respectively, and improves some parts of the more phase derogation algorithm by combining them with applications in the P System.
Section 4 designs the corresponding cell-like P System based on the more phase derogation algorithm and division algorithm methods, respectively, and proposes a new method to combine the two to achieve fractional simplification. Detailed rules are introduced for these three P Systems, and the execution flow of the rules is detailed with specific examples.
Section 5 verifies the execution efficiency of the three from an experimental point of view, using the UPSimulator simulation tool for a large amount of data. Firstly, experiments are conducted for the ξ values in the combined method, and the optimal solution is obtained and then compared with the two original methods of the more phase derogation algorithm and the division algorithm, and finally, the experimental conclusions are drawn.
Section 6 summarizes the work accomplished in this paper and presents the problems that need to be improved in the future.

2. Fundamentals of Membrane Computing

2.1. Biological Basis of Membrane Computation

The work in this paper is based on the cell-like P System [19], so the basics of the cell-like P System are introduced first. The structure of the cell-like P System is shown in Figure 1. A schematic diagram of a cell is shown in Figure 1a, from which the membrane structure is abstracted. The membrane structure, as shown in Figure 1b, consists of the skin and the membranes within the skin arranged in a hierarchical structure. These membranes divide the interior of the cell into regions with a hierarchical structure, with the boundaries of each region being called membranes. The skin is the outermost membrane, which separates the P System from the external environment. The area outside the skin is called the environment. A basic membrane is a membrane that contains no other membrane inside.
Membrane calculations do not simply simulate the structure and function of the cell but abstract the most basic essentials. Membranes play a very important role in the structure and function of the cell by:
(1)
The skin separates the cell from its external environment, creating an enclosed area inside the cell that contains the internal space of the cell.
(2)
The inner membrane divides the cell into regions with a hierarchical structure, within each of which local biochemical reactions take place.
(3)
The cell membrane acts as a communication channel between regions.
There are two general representations of membrane structure: the generalized table and the tree structure.
Generalized table: A membrane is represented by [ ] and the ordinal number of the membrane (represented by a number) is indicated by a subscript of [ ], i.e., [   ] i can represent basic membrane i ; [     i   ] j indicates that membrane j contains membrane i within it.
Tree structure: the nested properties of membranes can be conveniently described by means of a tree structure, i.e., the skin membrane is represented by the root of the tree, and the leaves of the tree represent the basic membrane.

2.2. Definition of the Cell-Like P System

The cell-like P System is one of the most fundamental and earliest proposed models for membrane computation [19]. A cell-like P System Π of degree m ( m 1 ) is defined as:
Π = V , O , H , μ , ω 1 , . . . , ω m , R 1 , . . . , R m , i o
Among them,
(1) V is a finite, non-empty alphabet whose elements are objects;
(2) O V is the set of output objects;
(3) H is the set of membrane markers, H = { 1,2 , , m } ;
(4) μ is the membrane structure containing m membranes, where m is called the degree of Π ;
(5) ω i V ( 1 i m ) , denotes the multiset of objects contained inside membrane i . For example, if membrane i contains 5 a -objects and 3 b -objects, then we have ω i = a 5 b 3 . V is the set of arbitrary strings consisting of the characters in V . If ω i = λ , then it means that no objects exist inside membrane i .
(6) R i 1 i m is a finite set of evolutionary rules inside region i in membrane structure μ . The evolutionary rules are a binary set u , v , usually written u v , where u is a string in V , v = v or v = v δ , where v is a string on the set { a h e r e , a o u t , a i n j   |   a V , 1 i m } , and h e r e indicates that object v is still in the the region where the rule is used; o u t indicates that object v is moved out of the current region into the outer membrane containing the current membrane; and i n j indicates that object v will be moved into membrane j , which is directly contained by membrane i . δ is a special character not belonging to V . When a rule contains δ , the membrane is dissolved after execution of the rule.
(7) i o is the output region of the membrane structure that is used to hold the results of the computation, i H .
In addition to the rules introduced above, it is necessary to consider rules for creating membranes of the form: e [   W   ] i , where e V , W V + , i is a number on a given list of ordinal numbers. This rule indicates that the object e creates a membrane labelled i and the objects inside the membrane are denoted by W [20].
In every membrane structure, the implementation of evolutionary rules will be guided by two principles:
(1)
Non-determinism
The P System will follow the non-determinism principle when executing evolutionary rules, which means that when multiple rules can be satisfied simultaneously, the rules chosen by the P System to execute are non-deterministic [3].
(2)
Maximum parallelism
In the P System, each step of the computation follows the principle of maximum parallelism, meaning that all rules that can be executed must be executed at the same time.

3. Principles and Algorithms of Fraction Simplification

Fractional reduction is an indispensable part of arithmetic operations. This paper designs the membrane system based on two traditional methods of fractional reduction: the more phase derogation algorithm and the division algorithm method, and Section 3 focuses on the principles of both and their algorithms.

3.1. The More Phase Derogation Algorithm

3.1.1. Principle

The more phase derogation algorithm is from the ancient Chinese mathematical treatise “the Nine Chapters on the Mathematical Art”, and can be used to find the greatest common divisor of two numbers.
The exact steps of this algorithm are as follows:
Step 1: Given any two positive integers, first determine if they are both even; if so, use 2 to approximate; if not, perform step 2.
Step 2: The larger number in the numerator denominator is subtracted from the smaller number; the resulting difference is compared to the smaller number; and the number is reduced by the larger number. Continue this operation until the resulting subtraction and difference are equal.
The rule a|b means that a divides b (a is a divisor of b). gcd(a,b) means the greatest common divisor of a, b.
a mod b means that a divides b by the remainder.
It may be useful to set A > B. Let the greatest common divisor of A and B be X so that A = aX and B = bX, where a and b are both positive integers and a > b. C = AB, then we have C = aXbX = (ab)X.
Since both a and b are positive integers, C is also divisible by X, i.e., the greatest common divisor of A, B and C is X. So gcd(A,B) = gcd(B,AB), which means that the final result is its greatest common divisor.
Then the numerator and denominator are divided by the maximum common divisor X, which is obtained by the more phase derogation method, to obtain the final result.

3.1.2. Improvement of the More Phase Derogation Algorithm

Although it is relatively simple to find the maximum convention by the approximate method of the more phase derogation algorithm, the steps of multiplication and simplification after finding the maximum convention are improved in this paper because the membrane rules and the complexity required for multiplication and division in the P System are much greater than those for addition and subtraction.
The specific steps are as follows:
Step 1: Given any two positive integers, subtract the smaller number from the larger number in the numerator denominator, then compare the resulting difference with the smaller number and record the relationship using z. If the difference is greater than the minus number, then z is recorded as 0, and if the difference is less than the minus number, then it is recorded as 1, and the larger number is used to reduce the number. Continue this procedure until the subtractor and the difference are equal.
Step 2: Design two other sequences { p i } and { q i }, starting with the last ordinal number n of the array z, so that the initial value of p n is 2 and the initial value of q n is 1. Then gradually assign values to the sequences: p n 1 = p n + q n , if z is 0, then q n 1 = q n ; if z is 1, then q n 1 = p n . Keep repeating this step, and the final approximate result is p 1 / q 1 .

3.1.3. Algorithms

Suppose we want to reduce the fraction x y ( 0 < y < x ) . Based on the principle of Section 3.1.1 and the refinement of Section 3.1.2, the process of fraction simplification by a more phase derogation algorithm is described as follows:
(i)
Input x , y ( 0 < y < x ) ;
(ii)
Calculate x i , y i , u i , z i , where i = 2,3 , . . . , t , a n d   x 1 = x , y 1 = y , u 1 = x y , z 1 = 0 ;
(iii)
Calculate p i , q i , where i = t , t 1 , . . . , 1 ;
(iv)
Output p 1 , q 1 .
The Algorithm 1 using the more phase derogation technique is as follows:
Algorithm 1: Algorithm for fraction simplification using more phase derogation.
Input:  x , y ( 0 < y < x )
Output: p1, q1, p1/q1 is the simplest form of x/y fractions.
procedure
Input:  x , y ( 0 < y < x )
Output: p1, q1, p1/q1 is the simplest form of x/y fractions.
procedure
x 1 x , y 1 y ;
z 1 0 ;
u 1 x y ;
while   y i ! = u i
if   u i < y i then   x i + 1 y i ;
y i + 1 u i ;
z i + 1 1 ;
end if
if   u i > y i then   x i + 1 u i ;
10 
y i + 1 y i ;
11 
z i + 1 0 ;
12 
end if
13 
i + + ;
14 
u i x i y i ;
15 
end while
16 
p i 2 ; q i 1 ;
17 
repeat
18 
i ;
19 
p i p i + 1 + q i + 1 ;
20 
if   z i + 1 = = 1 then   q i = p i + 1 ;
21 
end if
22 
else   then   q i = q i + 1 ;
23 
end else
24 
until   i = 1;
25 
end procedure
In this algorithm, the more phase derogation algorithm is split into two parts: the complexity of the algorithm is O ( 1 ) when x is twice as long as y. For a general x i , y i , the time complexity of the first part of the algorithm is O ( t ) if the algorithm performs t subtraction operations, at which point u t = y t , and the first part of the more phase derogation algorithm ends. It is easy to know that the length of the sequence { z i } is the same as the number of times the first part of the algorithm is executed, so the length of the sequence z is t. After t times of execution, the value of the more phase derogation algorithm i goes to 0, and the second part of the more phase derogation algorithm ends. That is, the time complexity of this algorithm in the second part is O ( t ) and its total time complexity is O ( t ) . That is, in the average case, the time complexity of this algorithm is O ( t ) . If the difference between x and y is large, then the worst time complexity is O ( m a x ( x ,   y ) ) .

3.2. Division Algorithm

3.2.1. Principle

The division algorithm, also known as Euclid’s algorithm [21,22] for finding the greatest common divisor of two numbers, is considered to be the earliest algorithm in the world (300 BCE). It first appeared in Euclid’s Principia Geometrica (Book VII, Propositions I and II), and in China, it can be traced back to the Nine Chapters of Arithmetic, which appeared in the Eastern Han Dynasty.
The greatest common divisor of two natural numbers is the largest positive integer that can divide them simultaneously. The division algorithm is based on the principle that the greatest common divisor of two integers is equal to the greatest common divisor of the smaller number and the remainder of the division of the two numbers.
For example, the greatest common divisor of 1254 and 390 is 6 (1254 = 6 × 209; 390 = 6 × 65); the process of deriving the greatest common divisor using these two numbers is as follows:
1254% 390 = 84
390% 84 = 54
84% 54 = 30
54% 30 = 24
30% 24 = 6
24% 6 = 0
So the greatest common divisor of these two numbers is 6.
The proof of this algorithm is as follows:
Let the two numbers be a and b (b < a) and denote by gcd(a,b) the greatest common divisor of a and b. r = a mod b is the remainder of a divided by b, and k is the quotient of a divided by b. The division algorithm method is to prove that gcd(a,b) = gcd(b,r).
Step 1: Let c = gcd(a,b), then let a = mc and b = nc;
Step 2: It follows from the premise that r = akb = mcknc = (mkn)c;
Step 3: It follows from the result of step 2 that c is also a factor of r;
Step 4: It can be concluded that mkn and n are mutually exclusive; otherwise, one can set mkn = xd and n = yd (d > 1), then m = kn + xd = kyd + xd = (ky + x)d, and then a = mc = (ky + x)dc and b = nc = ycd, so the maximum convention of a and b becomes cd, not c, contradicting the previous conclusion.
From this, it follows that gcd(b,r) = c, and subsequently gcd(a,b) = gcd(b,r).

3.2.2. Algorithm

Suppose we want to approximate the fraction x y . According to the principle of Section 3.2.1, the process to achieve fractional simplification by the division algorithm is described as follows:
(i)
Input x , y ( 0 < y < x ) ;
(ii)
Calculate { a i } , { b i } , { r i } , where i = 2 ,   3 , . . . , t ,   a n d   a 1 = x , b 1 = y , r 1 = m % n ;
(iii)
Output k , l .
The division Algorithm 2 is as follows:
Algorithm 2: Algorithm for fractional reduction using the division algorithm.
Input:  x , y ( 0 < y < x )
Output: k, l, k/l is the simplest form of x/y fractions.
procedure
X x , Y y ;
a 1 X , b 1 Y ;
if   a 1 < b 1 then   t a 1 ;
a 1 b 1 ;
b 1 t ;
end if
r 1 a 1 % b 1 ;
i 1 ;
while   r i ! = 0
10 
a i + 1 b i ;
11 
b i + 1 r i ;
12 
i i + 1 ;
13 
r i a i % b i ;
14 
end while
15 
end procedure
In this algorithm, the complexity of the algorithm is O ( 1 ) when m is a multiple of n. Generally, for the sequence { r i } , we know that r t + 1 = 0 if the algorithm performs t coset operations. Comparing the sequence { r t + 1 } with the Fibonacci sequence { F i } , we have F 0 = 1 r t and F 1 = 1 r t 1 . r k r k + 1 + r k + 2 can be obtained by r k   m o d   r k + 1 = r k + 2 ( 0 k t 1 ) . Therefore, r k F t k can be concluded by mathematical induction. In addition, we can obtain m = n 0 F t and n = n 1 F t 1 . That is, if our algorithm performs the remainder operation t times, then n must not be less than F t 1 and vice versa. According to the characteristics of the Fibonacci sequence, we have F t 1 1.618 t / 5 , which gives us n 1.618 t / 5 and t l o g 1.618 ( 5 n ) . Therefore, in the worst case, the complexity of the algorithm is O ( l o g n ) .

4. Fractional Simplification P System

In membrane computing, the execution of rules is parallel. If the system meets the execution conditions of multiple rules simultaneously and there are no conflicts between the rules, these rules will be executed synchronously. After execution, continue to judge whether all rules are met in the new state. If the system still has rules that are met, continue to execute, and if not, stop running. If there is a conflict between rules (referring to the situation where an object has multiple rules that can be executed), the system will choose to execute the rules indefinitely. At this point, we can specify the priority so that the rules are executed in the order of priority.. For this purpose, we designed three priority-based cellular P systems. This section will define, explain rules, and analyze examples of the three P Systems Π 1 , Π 2 and Π 3 .
In order to aid scholars when verifying the efficiency of the system, during manual simulation and simulation using simulation software UPS [23], the execution time of each rule is recorded as a time slice, and the efficiency of each P system is judged based on the number of time slices. In each time slice, the system will execute all the rules that can be executed once, until there are no rules to execute and the system stops running. At this point, the number of time slices can reflect the time consumed by the P system, thus comparing the efficiency of each P system.
In addition, when explaining the rule execution process and instance analysis in detail in the P System, if multiple objects execute a rule at the same time or if a rule generates multiple objects at the same time, in order to make the object representation clearer, we use “,” or “and” to partition between objects without corner markers. Among them, the objects with practical effects will be explained in detail in this article, while the process objects with auxiliary effects will be omitted or briefly explained.

4.1. P System for Fractional Simplification of More Phase Derogation Algorithm

This section first introduces the definition and initial pattern of the P System for the more phase derogation algorithm, and then provides a detailed explanation of the complete rules of the P System and provides specific examples to demonstrate the execution process of the rules.

4.1.1. Definition of the P System for More Phase Derogation Algorithm

The more phase derogation P System is formalized as:
Π 1 = ( V , O , H , μ , ω M 1 , ω A 1 , , ω A t , R M 1 , R A 1 , , R A t , i o ) ,
Among them,
(1) V = { m , n , c , C r e a t e S u b M e m , N u m , a , b , g , x , y , l , u , k , f , v } ;
(2) H = { M 1 , A 1 , , A t } , in this article, for clarity, membrane labels are expressed in the form of a combination of membrane type and subscripts.
(3) μ = {   [   [   [   [   ] A t   ]   ] A 1   ] M 1 } , in the initial state, the P System only contains membrane M 1 and membrane A 1 , and membrane A 1 is included in membrane M 1 . A i ( 2 i t ) is dynamically generated during the execution of membrane rules, and any A i always includes A i 1 in;
(4) ω M 1 = m x n y , ω A 1 = c C r e a t e S u b M e m , and x and y represent the numerator and denominator of fractions, respectively;
(5) The R M 1 , R A 1 , , R A t evolution rule finite set will be explained in Section 4.1.2;
(6) i o = M 1 indicates that when the entire System stops, the final result can be obtained in the membrane M 1 ;
For the convenience of description, there is the following agreement in the remaining content of this section: the newly created class A membrane is named A 2 , A 3 , , A t , and the rules within these membranes are consistent with those within membrane A 1 . Therefore, there will be no further explanation in the remaining content of this section. The initial pattern of the fraction simplification P System based on the more phase derogation algorithm is shown in Figure 2.
Figure 2 depicts the initial pattern of the P System using the more phase subtraction method for fractional reduction: membrane M 1 is mainly used to compare the sizes of molecule x and denominator y, transfer the larger and smaller values into object a and object b of membrane A 1 , respectively, and save the final calculation results and dissolve other objects transferred from membrane A 1 . Membrane A 1 and its dynamically generated sub membranes A 2 , A 3 , , A t are used for more phase reduction operations, and the values of variables such as sequence x i , y i , u i , z i , { p i } , { q i } are calculated (where i = 1,2 , , t ). Except for membrane M 1 and membrane A 1 , other required membrane structures are dynamically created during the reduction process based on the actual conditions of the fraction, and the newly created membrane rules are completely consistent with the rules in membrane A 1 .
In Figure 2, objects m and n are used to represent the numerator and denominator, respectively; x and y are the numbers of objects m and n, and object c is used to trigger the execution of rules in membrane A 1 and determine whether a new membrane needs to be generated based on different conditions. Membrane A 1 and other newly created submembranes are used together to calculate variables in the rules. These newly created membranes are nested layer by layer: membrane A 2 is created within membrane A 1 , membrane A 3 is created within membrane A 2 , and finally, membrane A t is created within membrane A t 1 .
The process of calculating sequences x i , y i , u i is described below, and the specific execution process of membrane rules will be explained in detail in Section 4.1.2.
(i)
In the initial state, a partial rule is executed in membrane M 1 to determine the magnitude of the numerator x and denominator y, passing the larger and smaller values to object a and object b in membrane A 1 , respectively. For e.g., if x = 12   a n d   y = 9 , then the rule is executed to generate a multiset a 12 b 9 in membrane A 1 , i.e., x 1 = 12   a n d   y 1 = 9 in the corresponding sequence.
(ii)
In membrane A 1 , the multiset a x 1 b y 1 is consumed by partial execution of the rule, a judgment is made as to whether z 1 is produced while a new membrane A 2 is produced, and the multiset a x 2 b y 2 is produced by passing some material into the submembrane. This step is repeated until no new membranes are generated when the stopping condition for more phase loss is met in membrane A t , and the computation of the sequence x i , y i , u i is completed.
(iii)
In general, within the membrane A i (2 ≤ i < t − 1), the multisets a x i and b y i generated by substances transported by the membrane A i 1 are then transformed into new multisets into the submembrane according to the corresponding rules, respectively, until the end when y t is equal to u t .

4.1.2. Membrane Rules for the More Phase Derogation Algorithm

According to Section 4.1.1, the fraction simplification using the more phase derogation algorithm consists of calculating the sequences x i , y i , u i , z i , { p i } , { q i } . The value of each sequence indicates the number of corresponding objects in each layer of the membrane. For example, x 1 = 12 means the number of x in membrane A 1 is 12. Combined with the idea of Algorithm 1 in Section 3.1.3, it can be seen that membrane A 1 and the dynamically created submembrane only need to use the addition and subtraction method to complete the calculation, and the specific process is shown in Figure 3.
The following is a specific description of the membrane rules.
(1) Compare the values of the numerator and denominator
According to the principle and algorithm of the more phase derogation algorithm, it is necessary to ensure that the subtracted number is larger than the subtracted number in the class A membrane, so the size of the numerator x and the denominator y are compared in the membrane M 1 first. The multiplicity set in the initial state is m x n y , and the comparison rules are as follows:
r 1 : m   n g , 1 r 2 : m a ( a   N u m , i n   a l l ) | g , 2 r 3 : n b ( a   N u m , i n   a l l ) | g , 2 r 4 : g a   b   N u m , i n   a l l , 3
(i)
When x > y, the membrane rules are executed in the following order: r 1 r 2 r 4 . Execution of rule r 1 , which corresponds to converting object n to g, also leaves xy m in the membrane System. Executing r 2 under the condition that both g and m are present backs up the difference of xy in the membrane as a multiset a x y , while generating a multiset a x y N u m x y to pass into the submembrane A 1 .
(ii)
When x < y, the membrane rules are executed in the following order: r 1 r 3 r 4 . Executing rule r 1 , there is no remaining m in the membrane, so executing r 3 backs up the excess n in the membrane as multiset b y x , while generating multiset a y x N u m y x to pass into submembrane A 1 .
The execution of r 4 continues in both cases, passing the smaller of the two, g, to a and b in the submembrane, so that the number of objects a in membrane A 1 , x 1 , is equivalent to performing a calculation of xy + y or yx + x. The number of objects b in membrane A 1 , y 1 is the smaller of the numerator and denominator, a and b in membrane M 1 still represent the numerator and denominator.
(2) Compute the sequence x i , y i , u i , z i
After first comparing the size of the numerator denominator in M 1 , the multiset a x 1 b y 1 is placed in membrane A 1 , at which point the complete multiset within the membrane is a x 1 b y 1 c N u m x 1 C r e a t e S u b M e m . Within membrane A 1 and other dynamically generated submembranes, object c evolves into k and f, which is used to control the loop; each layer of the generated membrane is initialized with a and b. To avoid confusion, the sequences { x i } and { y i } are designed to hold the number of a and b in the i th layer of the membrane, respectively, with x 1 and y 1 representing the initial larger and smaller values.
The rules for computing the sequence x i , y i , u i , z i are as follows:
r 1 : a   b x   y , 1 r 2 : ( a l   u | c , 2 )     r 3 : ( c k   f | u , 2 ) r 4 : y   u v , 3   r 5 : ( k ( c , i n   a l l ) | v , 4 )   r 6 : ( y   f i   ( z , i n   a l l ) | v , 4 ) r 7 : u   f h   v , 4 r 8 : ( x a , i n   a l l   | i , 4 )     r 9 : ( x ( b , i n   a l l )   | h , 4 ) r 10 : ( l ( b , i n   a l l )   | i , 4 )   r 11 : ( l a , i n   a l l   | h , 4 r 12 : ( C r e a t e S u b M e m   N u m A : a { }   | v , 3 r 13 : ( N u m ( N u m , i n   a l l ) | ! C r e a t e S u b M e m , 3 )
The membrane rule is executed in the following order when x i > y i : r 1 r 2 r 3 r 4 r 12 { r 5 , r 6 , r 13 } { r 8 , r 10 } or r 1 r 2 r 3 r 4 r 12 { r 5 , r 7 , r 13 } { r 9 , r 11 } (for convenience, if the rule r j 1 , r j 2 , , r j k can be executed simultaneously, it is denoted as { r j 1 , r j 2 , , r j k } ).
(i)
Execution of rule r 1 : In A i ( 1 i t 1 ) , objects a and b are consumed to generate the multiset x y i y y i , indicating that the numerator and denominator values are consumed in both y i copies, leaving u i ( u i = x i y i ) copies of object a. Matter x and y are used to back up the subtractor b and to compare with the difference u i , respectively. Rule r 2 is executed under the condition of the existence of object c. The multiset l u i u u i is generated by executing r 2 , where l is used to backup the difference u i , and u is used to compare the size with the subtraction y.
(ii)
Execute rule r 3 under the condition that there is an object u: c generates object k and f, k is used to control the loop, and f is used to check the size of y i and u i . If y i > u i , the rules are executed in the first order. If y i < u i , the rules are executed in the second order. When y i = u i , the dynamic generation of submembranes has ended, and will be discussed in the subsequent calculation of sequence { p i } , { q i } , which will not be explained in detail here.
(iii)
Execute rule r 4 and y and u evolve into v. Compare the size of y i and u i by observing which object remains within the environment. If there is still y in the membrane after evolving into v, then x i + 1 = y i , y i + 1 = u i , and z i + 1 = 1 in the child membrane A i + 1 ; otherwise, x i + 1 = u i , y i + 1 = y i , and z i + 1 = 0 (i.e., there is no substance z in the child membrane). So when y is still present within the environment, rules r 5 and r 6 are executed with object v as catalyst.
(iv)
Before executing r 5 , we must first execute r 12 to consume C r e a t e S u b M e m and a Num in the membrane to generate a child membrane, and then we can subsequently pass the object into the child membrane. Each class A membrane is initialized with a C r e a t e S u b M e m , and Num is passed from the parent membrane to the submembrane; to ensure sufficient Num, the number of initialized Num is x 1 . Execute r 5 and r 6 : object k generates a new c and sends it to the submembrane; if y i + 1 ! = y i , then y and f evolves to i and generates a new object z and sends it to the submembrane; then, execute r 13 after consuming a Num; the remaining Num is passed into the submembrane for the submembrane to dynamically generate membranes.
(v)
If object i exists, it is shown that both a and b values of the submembrane need to be changed, for which rules r 8 and r 10 are executed: r 8 passes the subtractive backup x to the a of the submembrane (i.e., x i + 1 = y i ) and r 10 passes the differential backup l to the b of the submembrane (i.e., y i + 1 = u i ). If u is left in the environment, rules r 5 and r 7 are executed with object v as the catalyst. When h is generated in the environment, it is proved that y i + 1 = y i in the submembrane A i + 1 . Therefore, r 9 and r 11 are executed to pass the subtractive backup to x to the submembrane y i + 1 and the differential backup l to x i + 1 in the submembrane, respectively. The above steps are executed several times until the dynamic generation ends when x t 1 = 2 y t 1 .
When the submembrane A t 1 is executed to x t 1 = 2 y t 1 , the order of rule execution is: r 1 r 2 r 3 r 4 r 12 { r 5 , r 13 }. The rule execution is the same as the parent membrane, at this time u t 1 = y t 1 , so the rest of the rules in this part are not eligible for execution, and the innermost membrane A t no longer executes any rules and starts the second part of the calculation.
(3) Compute the sequence { p i } , { q i }
When both y and u in membrane A t 1 are consumed, i.e., when the condition of termination of the more phase derogation algorithm is reached (the decrement is equal to the difference), the calculation of object z is ended and no new submembrane is generated in membrane A t . At this point, the sequence { p i } , { q i } is started, i.e., the execution of the improved part of the more phase derogation algorithm is started. According to the description of the improved step of the more phase derogation algorithm in Section 3.1.2, it is known that, by several calculations, object z is generated in part of the membrane, and object z is a marker of whether the value of q in the parent membrane is changed or not. By the idea of the more phase derogation algorithm, it is known that the subtraction operation ends when the subtraction and difference are equal, and based on this conclusion, the following rule is designed:
r 14 : ( f p ^ 2   q   |   !   y   &   !   u   &   !   a   &   !   b , 6 ) r 15 : ( p p 1 r ,   o u t ,   5 ) r 16 : ( q q 1 w , o u t , 5 ) r 17 : ( z o ,   o u t ,   5 ) r 18 : ( r p   q   | o , 5 ) r 19 : ( w p   | o ,   5 ) r 20 : ( w p   q , 6 ) r 21 : ( r p , 6 )
(i)
The order of the execution of the rules in membrane A t 1 is r 14 { r 15 , r 16 , r 17 }. To avoid confusion, the following explanation is given: in the membrane rule, p ^ 2 means that the membrane contains 2 objects p, and p1 means that the System contains an object named “p1”.
(a)
Since the final step of the method of finding the maximum convention by the more phase derogation algorithm is that the subtraction is equal to the difference, and this equal value is the sought maximum convention, in the absence of objects y,u,a, and b, which is the case when proving that the subtractors are equal to the difference after executing rule r 4 , the object f evolves to object p 2 q (i.e., p t 1 = 2 , q t 1 = 1 ) by executing rule r 14 , which means that the subtracted number in membrane A t 1 is two times the subtracted number.
(b)
Then execute rules r 15 and r 16 : p and q evolve into p 1 and q 1 , respectively, for saving p t 1 and q t 1 in this membrane, while generating objects r and w into the parent membrane for backup. Execute rule r 17 : when there is z in the membrane, evolve z to object o and release it to the parent membrane.
(ii)
Execution order of the rule in membrane A i ( 1 i < t 1 ) : { r 18 , r 19 } or ( { r 20 , r 21 } ) { r 15 , r 16 , r 17 }
(a)
Under the condition that an object o exists, prove the existence of z in the submembrane, which requires changing q i . Execute rules r 18 , r 19 : the multiset r p i + 1 evolves into the multiset p p i + 1 q p i + 1 and the multiset w q i + 1 evolves into the multiset p p i (at this time p i = p i + 1 + q i + 1 , q i = p i + 1 ). Under the condition that there is no object o, execute rules r 20 and r 21 : the multiset w q i + 1 evolves into the multiset p q i + 1 q q i + 1 , and the multiset r p i + 1 evolves into the object p p i (at this time p i = p i + 1 + q i + 1 , q i = q i + 1 ).
(b)
Then execute r 15 and r 16 to pass p i and q i in this membrane to the parent membrane, and if there is z in this membrane, execute r 17 to generate o to pass to the parent membrane.
(c)
The above steps are repeatedly executed until membrane A 1 finally generates the results p 1 and q 1 . Execute rules r 15 and r 16 to output the multiset r p 1 w q 1 , where p i and q i are the values after simplification of the larger and smaller values in the numerator denominator, respectively.
(d)
Finally, the comparison is performed in membrane M 1 : if the numerator ≥ denominator, the result p i / q i is directly derived (i.e., the quantity ratio of objects r and w), and if the numerator < denominator, r p 1 and w q 1 are replaced in membrane M 1 as w 1 p 1 and r 1 q 1 , respectively, and the final result is q i / p i (i.e., the quantity ratio of objects r 1 and w 1 ).

4.1.3. Example of Fraction Simplification by the More Phase Derogation Method

In this subsection, we will give an example to describe in detail the process of implementing fractional reduction using the more phase derogation algorithm of Section 4.1.1. For example, the fraction simplification process for 6/15 is shown in Figure 4:
The following details the execution process of rules in this P System.
(1) Initial pattern
First, put the multiset m 6 n 15 in the membrane M 1 , execute the rule r 16 times to generate the multiset g 6 ; execute r 3 under the condition that both g and n exist, generate b 9 in the membrane, and at the same time generate the multiset a 9 N u m 9 to pass to the submembrane A 1 ; execute r 4 to generate the multiset a 6 b 6 N u m 6 into the submembrane A 1 ; at this time, the multiset in the membrane M 1 is b 6 , and the initialized multiset of the membrane A 1 is a 15 b 6 c N u m 15 C r e a t e S u b M e m .
(2) Calculate the sequence x i , y i , u i , z i
(i)
The rules available in membrane A 1 are executed in the following order: r 1 r 2 r 3 r 4 r 12 { r 5 , r 7 , r 13 } { r 9 , r 11 }.
(a)
Execute the rule r 1 6 times in the membrane A 1 until b 6 is completely consumed, generating the multiset x 6 y 6 and a 9   remains; execute the rule r 2 under the condition that the object c exists, generating l 9 u 9 .
(b)
At this point, only the rule r 3 can be executed: evolve c to the multisets k and f under the condition that the object u exists; execute the rule r 4 six times to generate the multiset v 6 , at which point, the multiset in the membrane A 1 is x 6 u 3 l 9 v 6 k f . Execute the rule r 12 , as described in Section 4.1.2, consuming the CreateSubMem and a Num in this membrane to generate the membrane A 2 .
(c)
Execute the rules { r 5 , r 7 , r 13 } within the same time slice. Execute the rule r 5 to generate a new object c from k into the control loop in membrane A 2 ; execute the rule r 7 so that the multiset u and f is consumed to generate object h, and execute r 13 to pass the remaining Num into the submembrane for subsequent continuation of submembrane generation.
(d)
The next time slice executes { r 9 , r 11 } at the same time. Execute the rule r 9 6 times to evolve x 6 into the multiset b 6 and send b 6 into the membrane A 2 , execute r 11 at the same time to evolve l 9 into the multiset a 9 and send it into the membrane A 2 .
(ii)
At this time, there are multiple a 9 b 6 c N u m 14 sets in membrane A 2 . Execute the rules in the following order: r 1 r 2 r 3 r 4 r 12 { r 5 , r 6 , r 13 } { r 8 , r 10 }
(a)
After executing the membrane rule in the order of r 1 r 2 r 3 r 4 r 12 , the multiset within the membrane is l 3 y 3 x 6 v 3 k f , and a new submembrane A 3 is generated.
(b)
As described in Section 4.1.2, the next time slice simultaneously executes the rule { r 5 , r 6 , r 13 }: execute the rule r 5 , object k evolves into object c to be sent to membrane A 3 ; while executing the rule r 6 , object y and object f evolves into object i and sends z to membrane A 3 , and executes the rule r 13 to pass the remaining Num to membrane A 3 .
(c)
Execute the rules { r 8 , r 10 } under the condition that object i exists. The rule r 8 is executed 6 times, and the multiset x 6 evolves into the multiset a 6 into the membrane A 3 , while the rule r 10 is executed 3 times, and the l 3 evolves into the multiset b 3 into the membrane A 3 .
At this point, the membrane A 3 contains the multiset a 3 b 3 c z N u m 13 . Similarly in A 2 , the available rules are executed in order r 1 r 2 r 3 r 4 r 12 , and after execution, the multiset in membrane A 3 is l 3 x 3 v 3 k f z N u m 12 . This result indicates that the subtraction and difference are equal, and the first part of the more phase derogation algorithm is over.
(3) Compute the sequence { p i } , { q i }
(i)
At this time, the multiset in the membrane A 3 is l 3 , x 3 , v 3 , k , f , z . The P System executes the rules in the following order: r 14 { r 15 , r 16 , r 17 }.
(a)
Execute the rule r 14 , f generate the multiset p 2 q ; at this point, the multiset in the membrane A 3 is l 3 , x 3 , v 3 , k , z , p 2 , q ;
(b)
The next time slice simultaneously executes the rules { r 15 , r 16 , r 17 }: execute r 15 to evolve p 2 into the multiset p 1 2 , and generate the multiset r 2 into the membrane A 2 ; execute the rule r 16 to evolve q into the multiset q 1 , generate the object w into the membrane A 2 , and execute the rule r 17 to generate the multiset o of object z to output into A 2 .
(ii)
At this time, the multiset in membrane A 2 is o , i , y 2 , v 3 , r 2 , w and the order of execution of the rules is { r 18 , r 19 } { r 15 , r 16 }.
(a)
Under the condition that the object o exists, execute the rules { r 18 , r 19 }: w generates the multiset p, r 2 generates the multiset p 2 q 2 , at which point, the multiset in A 2 is o , i , y 2 , v 3 , p 3 , q 2 ;
(b)
Next, execute the rule { r 15 , r 16 } to generate the multiset p 1 3 q 1 2 within the membrane A 2 , and also generate the multiset r 3 w 2 to pass into the membrane A 1 .
(iii)
At this time, the multiset in membrane A 1 is r 3 , w 2 , h , u 2 , v 6 , and the order of execution of the rules is { r 20 , r 21 } { r 15 , r 16 }.
(a)
Execute the rule { r 20 , r 21 }, the multiset r 3 generates the multiset p 3 , and the multiset w 2 generates the multiset p 2 q 2 . At this time, the multiset in the membrane is p 5 , q 2 , h , u 2 , v 6 .
(b)
Then execute { r 15 , r 16 } to pass out r and w, respectively. In the membrane, M 1 obtains r 5 w 2 , corresponding with the numerator and denominator, and then converts it to r 1 2 w 1 5 . After that there is no rule to execute, so the whole System stops. So the final simplification of 6/15 results in 2/5.
The specific execution process is divided according to the time slice, as shown in Table 1. To facilitate experimental verification, all the membranes generated do not dissolve within the system. The number of membranes is large and the substances are complex, so only multiset that have changed is listed in the table. If a membrane is not listed in one of the rows of the table, it means that the material in this membrane has not changed during that time slice and the multiset in that membrane is the same as the last time it was listed.
From the above analysis process, it can be seen that using the P System Π 1 for fractional reduction on 6/15 requires a total of 19 time slices.

4.2. P System for Fraction Simplification in the Division Algorithm

4.2.1. Definition of the P System for Rolling Division

The definition of the P System based on the division algorithm is as follows (3):
Π 2 = ( V , O , H , μ , ω M 1 , ω A 1 , , ω A t , R M 1 , R A 1 , , R A t , i o ) ,
Among them,
(1) V = { m , n , c , t , C r e a t e S u b M e m , N u m , a , b , g , x , y , d , e , h , z , o , i , l , u , k , f , w , v } ;
(2) The definitions of H and μ are similar to those in Section 4.1.1, so this section does not provide detailed explanations;
(3) ω M 1 = m x n y c t , ω A 1 = c C r e a t e S u b M e m , and x and y represent the numerator and denominator of fractions, respectively;
(4) The R M 1 , R A 1 , , R A t evolution rule finite set will be explained in Section 4.2.2;
(5) i o = M 1 indicates that when the entire System stops, the final result can be obtained in the membrane M 1 .
Figure 5 depicts the initial layout of the division algorithm P System: membrane M 1 is mainly used to compare the magnitudes of the numerator x and the denominator y. The larger and smaller values are passed to object a and object b in membrane A 1 , respectively, and after obtaining the maximum convention x from membrane A 1 and the dynamically generated class A membrane, the numerator and denominator are divided by x, respectively, saving the final result of the operation k/l. Membrane A 1 is used to perform the division algorithm operation and calculate the value of the maximum convention, x. With the exception of membrane M 1 and membrane A 1 , all other required membrane structures are created dynamically during the reduction process based on the actual situation of the partition, and the rules within the newly created membrane are identical to those within membrane A 1 . In Figure 5, objects m and n are used to represent the numerator and denominator, respectively; x and y are the numbers of objects m and n. Object c is used to trigger the execution of the rules in the membrane, and CreateSubMem determines whether new membranes need to be generated according to different conditions. Membrane A 1 and other newly created submembranes are used to calculate the parameters in the rules. These newly created membranes are nested in a layer: membrane A 2 is created within membrane A 1 , membrane A 3 is created within membrane A 2 , and finally, membrane A t is created within membrane A t 1 .

4.2.2. Membrane Rule of Division Algorithm

Combining the design idea of the P System and the principle of Section 3.2, the P System of fraction simplification by division algorithm mainly consists of calculating the sequence of larger values a i , the sequence of smaller values b i , the maximum convention x 1 , the numerator k after reduction, and the denominator l after reduction. The initial state of the multiset m x , n y , c , t is first put into the membrane M 1 , where x denotes the number of numerators and n denotes the number of denominators. Then, after comparing the size of the numerator and denominator in membrane M 1 , the larger and smaller values are passed into membrane A 1 , respectively, and the maximum convention number x 1 is calculated according to the rule, and then x 1 is passed into membrane M 1 to calculate the final approximate result k/l. Following this idea, a specific flow chart can be obtained, as shown in Figure 6.
The following is a specific description of the membrane rules.
(1) Calculate the sequence a i , b i and the maximum convention x 1
m x n y c t is the initial state of membrane M 1 . The numerator x and denominator y are compared in membrane M 1 and then the larger and smaller values are passed to object a and object b in membrane A 1 , respectively. The specific conversion rules are similar to membrane M 1 in the more phase derogation algorithm, which can be found in Section 4.1.1. The membrane rule within this System improves the division into multiple additions and subtractions; the initialized multiset in membrane A 1 is a a 1 b b 1 c N u m a 1   C r e a t e S u b M e m , where a 1 is the value of the larger number in the numerator denominator, and b 1 is the value of the smaller number.
The rule for calculating the maximum convention x 1 is as follows:
r 1 : a   b x , 1 r 2 :   ( c y | x , 1 ) r 3 :   ( a   y a   d , 2 ) r 4 :   ( x b | d , 3 ) r 5 :   ( d c , 4 ) r 6 :   ( b   y b   e   g , 2 ) r 7 :   ( C r e a t e S u b M e m   N u m A : a { } | b , 3 ) r 8 :   ( g h , 3 ) r 9 :   ( x ( b , i n ) | h , 4 ) r 10 :   ( b ( a , i n ) | h , 4 ) r 11 :   ( h ( c , i n ) | h , 5 ) r 12 :   ( y z   e , 3 ) r 13 :   ( x ( z   x , o u t ) | z , 4 ) r 14 :   ( N u m N u m , i n | ! C r e a t e S u b M e m )
(i)
When a i n b i > b i ( i = 1,2 , , t 1 , n = 0,1 , , t 1 ) the rules are executed in the following order: { r 1 , r 7 } { r 2 , r 14 } r 3 r 4 r 5 .
(a)
Execution of rule r 1 within membrane A i : consume the multiset a b i b b i , generating x b i , which means that the values of the denominator and numerator are consumed in b i copies at the same time, leaving a i b i copies of the object a , while executing r 7 to generate a new submembrane A i + 1 ; execution of rule r 2 : object c evolves into y under the condition that object x exists; this step is used to control the loop, while execution r 14 passes the remaining Num into the submembrane A i + 1 ;
(b)
Then execute r 3 , the object y evolves into object d, where a plays a catalytic role; under the condition that d exists, execute rule r 4 ; the object x evolves into object b and returns x b i to b b i . At this time, the existing multiset in the membrane is a a i b i b b i d N u m a i , and the System satisfies the execution conditions of r 1 and continues to generate x.
(c)
Execute r 5 , object d evolves into object c; at this time, there are x generated in the membrane A i , so the execution conditions of r 2 are satisfied again. Because there is only one CreateSubMem object in the membrane, r 7 and r 14 in a membrane can only be executed once, but the rule r 1 r 2 r 3 r 4 r 5 may be cyclically executed n times, until a i n b i < b i stops the cycle of execution, or a i n b i = b i proves that the remainder is 0; then, the System has found the maximum convention x and stops the cycle of execution.
(ii)
When a i n b i < b i in the membrane A i , the rules are executed in the following order: r 1 r 2 r 6 { r 7 , r 8 } { r 9 , r 10 , r 11 , r 14 } .
(a)
Execution rule r 1 : the multiset a a i n b i b a i n b i is consumed to generate the multiset x a i n b i . This means that the values of the denominator and numerator are consumed in both a i n b i copies, leaving b i ( a i n b i ) copies of object b. At this time, the number of x  a i n b i is the remainder of a i divided by b i .
(b)
Under the condition that object x exists, rule r 2 is executed to evolve object c into y. This step is used to control the loop; rule r 6 is executed, and object y evolves into objects e and g under the action of catalyst b.
(c)
Execute rules { r 7 , r 8 } : consume CreateSubMem with a Num to generate a new submembrane A i + 1 under the condition that object b exists, while g evolves into object h for synchronization control.
(d)
Then execute the rules { r 9 , r 10 , r 11 , r 14 } : under the condition that the object h exists, convert the multiset x a i n b i to multiset b b i + 1 directly into the submembrane A i + 1 and the multiset b b i ( a i n b i ) to multiset a a i + 1 into the submembrane; at this time, b i + 1 = a i n b i and a i + 1 = b i ( a i n b i ) , while the object h evolves into c into the membrane A i + 1 to continue the execution. In membrane A i + 1 , we continue to judge the size relationship between a i + 1 and b i + 1 and execute the corresponding rules.
(iii)
When a t 1 n b t 1 = b t 1 , the rules are executed in the following order: r 1 r 2 r 12 r 13 .
(a)
Rule r 1 , r 2 is executed as above. At this time, there is no excess a or b in the membrane, proving that the two numbers have no remainder, which also means that they have been integregated; therefore, the execution of rule r 12 : the object y evolves into z and e. Under the condition that there is z, the execution of rule r 13 converts the multiset x b t 1 into the multiset z x 1 x x 1 directly into the parent membrane, i.e., b t 1 is the maximum common divisor.
(b)
In membranes A t 2 , A t 3 , , A 1 , after receiving the z x 1 x x 1 of the submembrane, rule r 13 is executed to output the maximum common divisor, and finally output it from membrane A 1 to membrane M 1 . Calculate k and l according to the rules in membrane M 1 .
(2) Calculate k, l
The calculation of k and l begins when membrane M 1 receives the maximum convention x 1 from membrane A 1 . The specific calculation rules are as follows:
r 5 :   ( x w   v ) r 6 :   ( a   w i , 1 ) r 7 :   ( c y | i , 1 ) r 8 :   ( a   y a   d , 2 ) r 9 :   ( i w | d , 3 ) r 10 :   ( d k   c , 4 ) r 11 :   ( y k , 3 ) r 12 :   ( b   v f , 1 ) r 13 :   ( t e | f , 1 ) r 14 :   ( b   e b   h , 2 ) r 15 :   ( f v | h , 3 ) r 16 :   ( h l   t , 4 ) r 17 :   ( e l , 3 )
The main job of membrane M 1 (at this point) is to divide the numerator and denominator by the maximum common divisor, respectively, and finally arrive at the result. Firstly, rule r 5 is executed: the multiset x x 1 is converted into a multiset w x 1 v x 1 for backup, so that the numerator and denominator can be synchronously simplified and parallelism can be improved.
(i)
The rules involved in simplifying the molecule x and the order of execution are as follows: r 6 r 7 r 8 r 9 r 10 r 11 .
(a)
Execute rule r 6 : The multiset a x 1 w x 1 evolves into i x 1 . At this point, object i retains the number of conventions x 1 , and there are x x 1 objects a remaining in the System. Because x 1 is the largest convention of the numerator denominator, object a must be an integer multiple of x 1 .
(b)
In the condition that object i exists, execute rule r 7 : object c evolves into object y. This step is used to control the loop; execute r 8 : object y evolves into object d under the action of catalyst a. This step proves that there is no end to integer division in the System, at this time;
(c)
Execute rule r 9 under the condition that object d exists: object i evolves into object w, and then the value of the convention number is passed to w; at this point, r 6 execution conditions are met, and rule r 10 is executed while continuing to execute r 6 : object d evolves into objects k and c, i.e., the convention number is subtracted once for one more k, which is equivalent to a counter.
(d)
The above steps can be executed several times. Until there is no object a in the System after executing r 6 again, it indicates that the molecules have been completely divided. Execution rule r 7 and r 11 : object y evolves into object k. The last number of k is the value of the numerator after the approximate simplification, and also, the number of times the subtraction is used.
(ii)
The rules involved in simplifying the denominator and the order of execution are as follows: r 12 r 13 r 14 r 15 r 16 r 17 . The execution rules are similar to the steps for dividing the numerator by the greatest common divisor, and the final number of l is the value of the denominator after simplification. Due to the maximum parallelism of the membrane calculation, the number of steps required to implement the division function is the number of steps in the larger value simplification.
The final result of the approximate fractional simplification in the division algorithm P System is k/l.

4.2.3. Example of Fraction Simplification by the Division Algorithm

In this subsection, we will give an example to describe in detail how to implement fractional simplification using the division algorithm P System. For example, the reduction process for 6/15 is shown in Figure 7:
The following details the execution process of rules in this P System.
(1) Initial pattern
As shown in Figure 7a, the initial multiset m 6 n 15 c t of this System is first put into the membrane M 1 , and the membrane A 1 has the initial object c and the object CreateSubMem. The object n is used to represent the denominator of the fractional equation with the number of 15, and the object m is used to represent the numerator of the fractional equation with the number of 6.
First execute the rule r 1 six times, and the multi-set m 6 n 6 is completely consumed to generate the object g 6 ; then execute the rule r 3 nine times under the condition of having the object g . The remaining object n 9 evolves into b 9 and generates the objects a 9 and N u m 9 into the membrane A 1 , while g 6 generates the multi-set a 6 b 6 and passes a 6 b 6 N u m 6 to the membrane A 1 . At this time, there is no other executable rule in the membrane M 1 , so wait for the end of the execution of the membrane of class A to continue the execution. The initialized multiset in membrane A 1 is a 15 b 6 c N u m 15 C r e a t e S u b M e m .
(2) Calculate the maximum common divisor x 1
(i)
Execute rules in the following order: { r 1 , r 7 } { r 2 , r 14 } r 3 r 4 . In membrane A 1 , execute rule r 1 6 times to generate object x 6 , while executing rule r 7 , under the condition of having b directly consume CreateSubMem and a Num to generate submembrane A 2 for backup. The existing object in Membrane A 1 is a 9 x 6 c . Execute rule r 2 to evolve object c to y under the condition that object x exists, while executing r 14 to pass the remaining Num value into submembrane A 2 .
At this point, only the rule r 3 can be executed, in the role of catalyst a object y evolved to d; according to the conditions of the implementation of the rule r 4 , the object x 6 evolved to b 6 ; implementation of the rule r 5 , the object d evolved to c; at this time, the r 1 condition is met again, and the multiset in the membrane A 1 is a 3 b 6 c , after the rules are executed in the order of r 1 r 2 r 3 r 4 .
(ii)
At this time a < b, the rules are executed in the order of r 1 r 2 r 6 { r 7 , r 8 } { r 9 , r 10 , r 11 } ; execute the rule r 1 three times to generate the multiset x 3 ; execute the rule r 2 , and the object c evolves into the object y; thus, at this time the multiset in the membrane A 1 is x 3 b 3 y ; this case can only execute the rule r 6 , converting the multiset b and y to the multiset b,e,g; then execute the rule r 8 , converting the object g to h ; under the condition that h exists at the same time, execute the rules r 9 , r 10 , r 11 , generating a 3 b 3 c passed to membrane A 2 .
(iii)
At this time, the multiset in membrane A 2 is a 3 b 3 c N u m 14 C r e a t e S u b M e m , i.e.,   a 2 = b 2 = 3 , according to { r 1 , r 7 } { r 2 , r 14 } r 12 r 13 ; execute the rule r 1 three times, consume all the a and b to generate x 3 , while executing r 7 to generate submembrane A 3 ; execute the rule r 2 , the multiset c evolves into the multiset y, and at this time, the multiset in the membrane A 2 is x 3 y , while executing the rule r 14 to pass the remaining Num values to the submembrane A 3 . In this environment, one can only execute the rule r 12 to evolve y into the multiset z and e; execute under the condition that the multiset z exists, and rule r 13 transforms x 3 into z 3 x 3 and passes it to membrane A 1 ; rule r 13 continues in membrane A 1 and passes the multiset z 3 x 3 to membrane M 1 , where the number of objects x is the maximum convention x 1 . This concludes the computation of the maximum convention x 1 .
(3) Calculate k, l
At this point, the multiset in the membrane M 1 is a 6 b 15 z 3 x 3 c t .
(i)
Execute rule r 5 in membrane M 1 , backing up the maximum convention as w 3 v 3 for simultaneous simplification of the numerator and denominator; execute rule r 6 three times, consuming the multiset a 3 w 3 to generate i 3 , and execute rule r 12 three times simultaneously, consuming the multiset b 3 v 3 to generate f 3 ;
(ii)
Execute rule r 7 to evolve object c into y under the condition that object i exists, and the execution of the rule r 13 involving the evolution of multiset f 3 to multiset v 3 under the condition that object h exists;
(iii)
Simultaneous execution of the rules r 8 , r 14 , evolving y to d in the presence of catalyst a and e to h in the presence of catalyst b.
(iv)
Simultaneously execute the rules r 9 , r 15 , under the condition that d exists, the object i 3 evolves into w 3 , and f 3 evolves into v 3 . Then simultaneously execute the rules r 10 , r 16 , evolve d into k , c and h into l , t , respectively; at this time, k and l start to accumulate, and the multiset in the membrane M 1 is z 3 , a 3 , b 12 , w 3 , v 3 , c , t , k ,   l .
(v)
After the numerator is repeated once in the order { r 6 , r 11 } and the denominator is repeated once in the order { r 12 , r 17 } , the multiset inside the membrane is z 3 i 3 b 9 v 3 k 2 l 2 t . Since a has been completely consumed, the rule { r 6 , r 11 } is stopped and the denominator continues to be executed. After repeating the execution three times in sequence, the multiset within the membrane is now z 3 i 3 f 3 k 2 l 4 e , at which point, only rule r 17 can be executed and object e evolves to l. At this time, the multiset in the membrane is z 3 i 3 f 3 k 2 l 5 .
The execution up to this point has no rules to execute, so the whole system stops. The number of objects k and l denote the values of the numerator and denominator after simplification, respectively, so 6/15 ends up with a simplification result of 2/5.
The specific execution process is divided according to the time slice, as shown in Table 2. This table is also partially omitted.
From the above process analysis, it is clear that the total time slice for this example is 40.

4.3. P System Combined with the More Phase Derogation and the Tossing and Division Algorithm

4.3.1. Definition of a Combinatorial P System

The P System of a combinatorial more phase derogation algorithm and the tossing and division algorithm is defined as Equation (4):
Π 3 = ( V , O , H , μ , ω M 1 , ω A 1 , , ω A t 1 , ω B 1 , , ω B t 2 , R M 1 , R A 1 , , R A t 1 , R B 1 , , R B t 2 , i o ) ,
Among them,
(1) V = { m , n , c , t , C r e a t e S u b M e m , N u m , a , b , g , x , y , d , e , h , z , o , i , l , u , k , f , w , v } ;
(2) H = { M 1 , A 1 , , A t 1 , B 1 , , B t 2 } , when the P System is in its initial state; it only contains membrane M 1 , membrane A 1 , and membrane B 1 . During the execution process, membranes A 2 , , A t 1 , B 2 , , B t 2 are generated according to different conditions.
(3) μ = { [ [ [ [ ] A t 1 ] ] A 1 [ [ [ ] B t 2 ] ] B 1 ] M 1 } , in the initial state, membrane A 1 and membrane B 1 are siblings, both included in membrane M 1 ; A i ( 2 i t 1 ) and B k ( 2 k t 2 ) are dynamically generated during the execution of the membrane rules; any A i is always included in A i 1 , and any B k is always included in B k 1 .
(4) ω M 1 = a m b n c t , ω A 1 = c C r e a t e S u b M e m ,   a n d   ω B 1 = c C r e a t e S u b M e m ;   m and n represent the numerator and denominator of fractions, respectively;
(5) The R M 1 , R A 1 , , R A t 1 , R B 1 , , R B t 2 evolution rule finite set will be explained in Section 4.3.2;
(6) i o = M 1 indicates that when the entire System stops, the final result can be obtained in the membrane M 1 .
As shown in Figure 8, this diagram shows the initial pattern of a fraction simplification P System with a combination of the more phase derogation and division algorithms. The order of execution of the various types of membranes in this P System is: m e m b r a n e   M 1 m e m b r a n e   A 1   a n d   s u b m e m b r a n e s m e m b r a n e   M 1 m e m b r a n e   B 1   a n d   s u b m e m b r a n e s m e m b r a n e   M 1 m e m b r a n e   A 1 and submembranes. The function of each type of membrane and the complete process of the P System are briefly described as follows: membrane A 1 is first used to perform a more phase derogation algorithm to determine the relationship with ξ, and when the difference is greater than ξ, it continues to generate submembrane for a more phase derogation algorithm until the difference is less than or equal to ξ; the intermediate truncation results m,n are obtained and passed to membrane M 1 and then from membrane M 1 to membrane B 1 . Membrane B 1 receives m,n and the division algorithm to calculate the maximum convention x and passes it to membrane M 1 . Membrane M 1 finds the approximate result of the intermediate m,n and passes it to membrane A 1 . Membrane A 1 passes the result of the more phase derogation algorithm r/w to membrane M 1 . Finally, within membrane M 1 , r and w correspond to the numerator and denominator: if the numerator > denominator, the final result is directly r/w, otherwise r and w are “interchanged”, and the final result is w1/r1 with exception to membrane M 1 and membranes A 1 and B 1 , all other required membrane structures are created dynamically during the reduction process, and the rules in the newly created class A membranes, A 2 , A 3 ,…, A t 1 , are identical to those in membrane A 1 ; class B membranes B 2 , B 3 ,…, B t 2 have exactly the same rules as those in membrane B 1 .

4.3.2. Membrane Rules for Combining the Two Methods

As can be seen from Section 4.1 of the more phase derogation algorithm P System, if the difference between the numerator and denominator is too large, the number of dynamically generated membranes is too large, and if Section 4.2 of the division algorithm is used, each division is equivalent to multiple subtractions, making the number of subtraction steps too heavy for a membrane System. For this reason, this sub-section discusses in detail the fraction simplification of the P System using a combination of the idea of a more phase derogation algorithm and a division algorithm.
The process of fraction simplification using the combination of the two methods consists of finding the sequence a i , b i , u i , z i , the intermediate values m, n of the method transformation, the greatest common divisor x 1 , the result of the reduction of the intermediate values k 1 , l 1 , and the sequence { p i } , { q i } . Combining the design ideas of the two P Systems in Section 4.1 and Section 4.2, it can be seen that all membrane structures require only addition and subtraction to complete the calculation of fractional simplification, as shown in Figure 9.
The following is a specific description of the membrane rules.
(1) Calculate the larger value of the partition a and the smaller value of b.
The multiset a x b y c t (here x is the numerator value and y is the denominator value) is put into the membrane M 1 , and the magnitudes of the numerator and denominator are compared in the membrane M 1 . When the numerator is greater than the denominator, the number of objects a and b are directly passed into the membrane A 1 ; otherwise, the rules are executed to convert the object b to a and directly passed to the membrane A 1 and swapping the order of numerators and denominators in membrane A 1 . At this point, there are no other rules to execute in membrane M 1 , so we wait for membrane A 1 to finish calculating the intermediate values m,n and then continue the execution.
Now the number of objects a and b in each layer of class A membrane is designed as a sequence a i , b i . For example, the number of object a in membrane A 1 is a 1 , and the number of b in membrane A t 1 is b t 1 .
Initialize the membrane A 1 in a 1 , b 1 . The rules are as follows:
r 1 : ( a   b g , 1 ) r 2 : ( a a 2 ( a   N u m , i n   a l l )   | g , 2 ) r 3 : ( b b 2 ( a   N u m , i n   a l l )   | g , 2 ) r 4 : ( g ( a   b   N u m , i n   a l l ) , 3 )
(i)
When x > y, the rules within membrane M 1 are executed in the following order: r 1 r 2 r 4 .
(a)
Execution rule r 1 : objects a and b are consumed and the multiset a y b y generates the multiset g y , with a x y remaining. This means that the numerator and denominator values are consumed in y copies at the same time, leaving x y of object a;
(b)
Execute the rule r 2 under the condition that object g exists, passing the remaining a to object a in the submembrane;
(c)
Execute r 4 to convert the multiset g y into a y b y and transfer it to the submembrane; at this time, the number of a in membrane A 1 and membrane B 1 is equivalent to performing a cumulative addition to obtain a 1 = x , b 1 = y . The multiplicity set, N u m x , is used to generate membranes dynamically.
(ii)
When x < y, the rules in membrane M 1 are executed in the following order: r 1 r 3 r 4 .
(a)
Execution rule r 1 : objects a and b are consumed and the multiset a x b x generates the multiset g x , with b y x remaining. This means that x copies of the numerator and denominator are consumed simultaneously, leaving y − x objects, b;
(b)
Execute rule r 3 in the presence of object g, passing the remaining b to object a in the submembrane;
(c)
Execute r 4 to convert the multiset g x into   a x b x and transfer it to the submembrane; at this time, the object a in membrane A 1 and membrane B 1 is also equivalent to performing an addition, obtaining   a 1 = y ,   b 1 = x . The multiset   N u m y is used for the dynamic generation of membranes.
(2) Calculate the sequence a i , b i , u i , z i and the intermediate values m,n
The process is performed by the membrane A 1 and the dynamically generated class A submembrane. Initially, a a 1 b b 1 c d ξ N u m a 1 C r e a t e S u b M e m is placed in membrane A 1 . Within membrane A 1 and other newly created submembranes, object c evolves into k , e , j , and k is used to control the execution of any dynamical membrane; e is involved in generating sequences z i ; object j is used to determine the special case where b i and difference are directly equal; a 1 and b 1 denote the larger and smaller values in the fractional equation, respectively; the number of d is the value of the parameter ξ in the conversion of the more phase derogation algorithm to division algorithm, and CreateSubMem is used for the dynamic generation of submembranes.
Calculate the sequence a i , b i , z i and the intermediate values m, n by the following rules:
r 1 : ( a   b x   y , 1 ) ; r 2 : ( c k   e   j , 1 ) ;       r 3 : ( a a 1 u   i , 2 ) r 4 : ( d   i g , 1 ) ;         r 5 : ( i   g f , 1 ) ;   r 6 : y   u λ | f ; r 7 : ( C r e a t e S u b M e m   N u m A : a { } | λ ) ; r 8 : ( N u m ( N u m , i n   a l l ) | ! C r e a t e S u b N u m ) ;   r 9 : ( y   e δ ( z , i n   a l l ) | λ , 4 r 10 : ( k ( c , i n   a l l ) | λ ) ;   r 11 : ( x ( a , i n   a l l ) | δ , 4 ) ;   r 12 : ( a 1 ( b , i n   a l l ) | δ , 4 ) r 13 : ( u   e h | λ ) ; r 14 : ( x ( b , i n   a l l ) | h , 4 ) ;           r 15 : ( a 1 ( a , i n   a l l ) | h , 4 ) r 16 : ( j j 1 | ! y   &   ! u   &   λ ) ;   r 17 : ( j 1 p ^ 2   q | ! y   &   ! u   &   λ ) ; r 18 : ( g o | ! i   &   ! f , 2 ) r 19 : ( x ( m   n , o u t ) | o ) ; r 20 : ( a 1 m , o u t | o ) r 21 : ( m ( m , o u t ) | ! o ) ;   r 22 : ( n n , o u t | ! o )
(i)
In class A membranes, the rules are executed in the following order: { r 1 , r 2 } r 3 r 4 r 5 . 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 ξ to determine whether to convert; r 2 converts c to k , e , j ; execute r 3 to converts the remaining multiset a a 1 b 1 to multiset a 1 u 1 u u 1 i 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 ξ, at this point.
(ii)
When   u 1 > ξ (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 { r 7 , r 10 } { r 8 , r 9 } { r 11 , r 12 } or   r 6 { r 7 , r 10 } { r 8 , r 13 } { r 14 , r 15 } .
(a)
Execute rule r 6 to convert y and u into object λ to determine the magnitude of the subtraction and the difference. When there is λ in the membrane, r 7 is executed to dynamically generate Class A submembrane. After the object C r e a t e S u b M e m 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 .
(b)
As the C r e a t e S u b M e m in the membrane is consumed, r 8 is then executed to pass the remaining multiset,   N u m a 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 δ within this membrane and also generates z to be passed into the inner membrane A 2 , i.e., z 2 = 1 .
(c)
Object δ 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 .
(d)
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 e 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 a 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.
(iii)
When u 1 ξ , the order of rule execution in this membrane, at this time, is r 18 { 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. The presence of o indicates that the P System is to be converted from the more phase derogation algorithm to the division algorithm; stop generating new membranes and execute   r 19 and transfer the backup subtractor   x b 1 to m and n in the parent membrane; execute r 20 and transfer the backup difference a 1 u 1 to m in the parent membrane. Execute r 20 , pass the backup difference a 1 u 1 to m in the parent membrane; at which point, the number of m in the parent membrane is a 1 .
The above rules take membrane A 1 as an example. In addition to membrane A 1 requiring initialization of a 1 b 1 , other rules also apply to membranes A 2 , A 3 , , A t 1 . All membranes except membrane A 1 in type A membrane execute { r 21 , r 22 } after receiving m,n values, and transmit the received multiset, m m n n , directly to the parent membrane, and finally from membrane A 1 to membrane M 1 .
(3) Calculation of the maximum convention x 1
The relevant rules for implementing this function in class B membranes are as follows:
r 1 : ( m 1   n 1 x , 1 ) r 2 : ( c > y   | x , 1 ) r 3 : ( m 1   y m 1   d , 2 ) r 4 : ( x n 1   | d , 3 )   r 5 : ( d c , 4 ) r 6 : ( n 1   y n 1   e   g , 2 ) r 7 : ( C r e a t e S u b M e m   N u m B : b { }   | n 1 , 3 ) r 8 : ( N u m N u m , i n   a l l   | ! C r e a t e S u b M e m ) r 9 : ( g h , 3 ) r 10 : ( x ( n 1 , i n   a l l ) | h , 4 )         r 11 : ( n 1 ( m 1 , i n   a l l ) | h , 4 ) r 12 : ( h ( c , i n   a l l )   | h , 5 ) r 13 : ( y z   | ! m 1   &   ! n 1 ,   3 )       r 14 : ( x ( z   x , o u t ) | z , 4 ) r 15 : ( a λ , 1 ) r 16 : ( b λ , 1 )
The procedure for finding the greatest common divisor x 1 of intermediate values m and n in a class B membrane is the same as that for finding the greatest common divisor x in the division algorithm P System, as described in Section 4.2.2.
(4) Calculating the intermediate value simplification results k 1 , l 1
The procedure for finding the m and n simplification results k 1 / l 1 in membrane M1 is the same as that for simplifying k / l in the division algorithm P System, as described in Section 4.2.2
(5) Compute the sequence { p i } , { q i }
r 23 : ( k 1 ( k 1 , i n   a l l ) | ! o , 1 ) ;     r 24 : ( l 1 ( l 1 , i n   a l l ) | ! o , 1 ) ; r 25 : k 1 p , 2 ; r 23 : ( k 1 ( k 1 , i n   a l l ) | ! o , 1 ) ;     r 24 : ( l 1 ( l 1 , i n   a l l ) | ! o , 1 ) ; r 25 : k 1 p , 2 ; r 26 : ( l 1 q , 2 ) ;         r 27 : ( p ( r , o u t ) ) ;     r 28 : q w , o u t ; r 29 : ( z ( o 1 , o u t ) ) ;   r 30 : ( r p   q | o 1 ) ;   r 31 : w p | o 1 ; r 32 : ( w p   q | ! o 1 ) ;         r 33 : r p | ! o 1 ;
(i)
Firstly, the membrane M 1 sends k 1 , l 1 to membrane A 1 and then executes { r 23 , r 24 } to gradually transfer k 1 and l 1 to the submembrane into the submembrane. When k 1 and l 1 reaches the innermost membrane, the order of execution in the innermost class A substratum is { r 25 , r 26 } { r 27 , r 28 , r 29 } .
(a)
Simultaneous execution of rules r 25 and r 26 translate the quantities of k 1   a n d   l 1 into the initial values p t 1 and q t 1 ;
(b)
Under the condition that multiset of p p i q q i exists within membrane A i ( i = t 1 , , 2,1 ) , simultaneous execution of r 27 , r 28 conversion to r p i w q i is passed directly to the parent membrane A i 1 , with r 29 deciding whether or not to execute based on the presence or absence of z in each layer, and. if the layer has z, convert z into o 1 and output it to the parent membrane.
(ii)
The order of execution of all class A membranes is { r 30 , r 31 } { r 27 , r 28 , r 29 } or { r 32 , r 33 } { r 27 , r 28 , r 29 } .
(a)
If o 1 is received from the parent membrane, it means that the minus number changes to the minus number during the more phase derogation algorithm, so it is necessary to convert the multiset r p i to p p i q p i and then the multiset w q i to the object p . At this point,   p i 1 = p i + q i , q i 1 = p i , i.e., the execution { r 30 , r 31 } . If no o 1 is passed in the substratum, it means that the decrement is not replaced. Execute r 32 , r 33 directly, converting objects w to p,q and r to p, i.e., p i 1 = p i + q i , q i 1 = q i .
(b)
Any class A membrane with { r 27 , r 28 , r 29 } performs the same process as the innermost submembrane, and finally membrane A 1 performs { r 27 , r 28 } to output the multiset r p 1 w q 1 to M 1 in the membrane, which is then assigned according to the size of the numerator and denominator: when the numerator > denominator, the fraction simplification result is r p 1 / w q 1 ; when the numerator < denominator, the objects r and w are swapped in membrane M 1 and transformed into w 1 and r 1 , respectively, and the final fraction simplification result is r 1 q 1 / w 1 p 1 .

4.3.3. Examples of Fractional Simplification by Combining the Two Methods

In this subsection, we will give an example to describe in detail how to implement fractional simplification in a P System using a combination of the more phase derogation algorithm and the division algorithm. For example, the reduction process for a P System taking a manifold of 15/40 with ξ = 20 is shown in Figure 10:
The following details the execution process of rules in this P System.
(1) Initial pattern
First, put the multiset a 15 b 40 c t in the membrane M 1 ; where: the number of object a is 15, which is used to represent the numerator of the partition; the number of object b is 40, which is used to represent the denominator. Preprocessing in membrane M 1 , executing rules in the order r 1 r 3 r 4 : execute rule r 1 fifteen times until object a is fully consumed, generating g 15 ; execute rule r 3 twenty-five times in the presence of object g, converting multiset b 25 to multiset b 2 25 and generating multiset a 25 N u m 25 to be fed into submembranes A 1 , B 1 ; after executing rule r 4 , the multiset g 15 generates the multiset a 15 b 15 N u m 15 and feeds it into submembrane A 1 , B 1 ; at this point, the multiset in membrane M 1 is b 2 25 c t .
(2) More phase derogation algorithm
(i)
At this time, the multiset in membrane A 1 is a 40 b 15 d 20 c N u m 40 C r e a t e S u b M e m , and the order of execution of the rules is: r 1 , r 2 r 3 r 4 r 5 r 6 { r 7 , r 13 } { r 8 , r 10 , r 14 , r 15 } .
(a)
Execute the rule r 1 , and the multiset a 15 b 15 evolves to x 15 y 15 ; while executing the rule r 2 , the object c evolves to k , e , j ;
(b)
Execute the rule r 3 , and the multiset a 25 evolved to a 1 25 u 25 i 25 ; then the rule r 4 is executed to compare the numerical values of 25 and ξ, and generate the multiset g 20 ;
(c)
Because of the remaining i 5 , the conditional execution rule r 5 is met and the multiset i 5 g 5 evolves to f 5 ;
(d)
Under the condition that the object f exists, execute the rule r 6 , and the multiset y 15 u 15 evolves to generate the multiset λ 15 ;
(e)
If object λ exists, the System executes the rule r 7 to generates a new submembrane A 2 , while executing r 13 to evolve u and e into object h;
(f)
Simultaneous execution of rules r 8 , r 10 , r 14 , r 15 and a 25 b 15 N u m 39 c is passed directly into the newly created submembrane A 2 . At which point, the remaining multiset in membrane A 1 is λ 15 u 9 f 5 g 15 j   h .
(ii)
At this point, the initialized multiset in membrane A 2 is a 25 b 15 N u m 39 c C r e a t e S u b M e m , and the rules are executed in the order r 1 , r 2 r 3 r 4 r 18 { r 19 , r 20 } .
(a)
Execute the rule r 1 , and the multiset a 15 b 15 evolves to multiset x 15 y 15 ; while executing the rule r 2 , c evolves to multiset k,e,j;
(b)
Execute the rule r 3 , and the multiset a 10 is evolved to a 1 10 u 10 i 10 ; then execute the rule r 4 to evolve d 10 i 10 to multiset g 10 ; then the multiset in the membrane A 2 is   x 15 , y 15 , a 1 10 , u 10 , g 10 , d 10 , k , e , j , N u m 39 , C r e a t e S u b M e m .
(c)
Execute the rule r 18 in the absence of object i and object f. The multiset g 10 evolves into o 10 ; by executing rule r 19 , r 20 in the presence of o, the multisets x 15 and a 1 10 evolve into the multisets m 15 n 15 and m 10 , respectively, which are transferred to the parent membrane A 1 .
At this point, the multiset in membrane A 2 is y 15 , u 10 , o 10 , d 10 , k , e , j , N u m 39 ,   C r e a t e S u b M e m , and the multiset in membrane A 1 is m 25 , n 15 , λ 15 , u 9 , f 5 , g 15 j , h ; execute the rules r 21 , r 22 simultaneously without object o; the multiset m 25 n 15 is fed into the membrane M 1 .
(3) Division algorithm
(i)
The multiset in membrane B 1 is m 1 25 n 1 15 c N u m 40 C r e a t e S u b M e m , and the rules are executed in the order r 1 r 2 r 3 r 4 r 5 .
(a)
Implementation rules r 1 , multiset m 1 15 n 1 15 evolves to x 15 ; then execute the rule r 2 that evolves object c to y, subject to the existence of object x;
(b)
Implementation rules r 3 , multiset m 1 y evolves to m 1 d ; execute the rule r 4 under the condition that object d exists, so that x 15 evolves into the multiplicity set n 1 15 ; then execute the rule r 5 , and the object d evolves to object c;
(ii)
At this time, the multiset in membrane B 1 is m 1 10 n 1 15 c N u m 40 C r e a t e S u b M e m , and the rules are executed in the order r 1 r 2 r 6 { r 7 , r 9 } { r 8 , r 10 , r 11 } r 12 .
(a)
Execute the rule r 1 that evolves   m 1 10 n 1 10 to the multiset x 10 ; execute the rule r 2 to evolve c into y under the condition that object x exists; then execute the rule r6 to evolve the multiset n 1 , y to n 1 , e , g ;
(b)
Execution rules r 7 , r 9 , consume CreateSubMem and a Num to generate a submembrane B 2 , while the object g evolves to h;
(c)
Under the condition that the multiset h exists, execute the rule r 8 , r 10 , r 11 that transfers the multiset   N u m 39 n 1 10 m 1 5 to the membrane B 2 ;
(d)
Execute the rule   r 12 , and the multiset h evolves into c and feeds into the membrane B 2 .
(iii)
The initialized multiset in membrane B2 is m 1 5 n 1 10 c N u m 39 C r e a t e S u b M e m . The rules are executed in the same order r 1 r 2 r 6 { r 7 , r 9 } { r 8 , r 10 , r 11 } r 12 . After the rules are executed, the remaining multiset in membrane B 2 is e. The multiset obtained from membrane B 3 is m 1 5 n 1 5 c N u m 38 .
(iv)
At this point, the initialized multiset in B 3 is m 1 5 n 1 5 c N u m 38 C r e a t e S u b M e m . And the rules are executed in the order   r 1 r 2 r 13 r 14 .
(a)
Implementation rules r 1 , multiset   m 1 5 n 1 5 evolves to x 5 , and then, execute the rule r 2 to evolve c into the object y;
(b)
Under the condition that there are no objects m 1 and n 1 , execute rules r 13 that evolves y to z; at this point, the condition is met to execute r 14 , the multiset x 5 evolves to z 5 x 5 and is fed into membrane B 2 ;
In membrane B 2 , continue to execute the rule r 14 to generate the multiset z 5 x 5 in membrane B 1 ; membrane B 1 also executes the rule r 14 , and finally sends the multiset z 5 x 5 into the membrane M 1 ; at this point, the number of x is the maximum number of conventions x 1 .
(4) Calculate the median simplification result k 1 , l 1
At this point, the multiset in membrane M 1 is a 1 25 b 1 15 b 2 25 z 5 x 5 c t . The execution process of the rule is the same as the approximate partitioning process of the example in Section 4.2.3, and will not be described too much here. After the rule is executed, the multiset in membrane M 1 is l 1 3 k 1 5 f 5 i 5 b 2 25 , and the multiset passed into membrane A 1 is l 1 3 k 1 5 .
(5) Calculate the final result
(i)
At this point, the multiset in membrane A 1 is λ 15 u 9 g 15 f 5 h j l 1 3 k 1 5 , and the condition is met to execute rule r 23 , r 24 to pass the multiset l 1 3 k 1 5 into membrane A 2 , respectively.
(ii)
When membrane A 2 receives a multiset l 1 3 k 1 5 from the parent membrane, the rules are executed in the order { r 25 , r 26 } { r 27 , r 28 } .
(a)
First executing rule r 25 , r 26 in membrane A 2 , converts the multisets k 1 5 and l 1 3 into p 5 and q 3 , respectively;
(b)
Then executing rule r 27 , r 28 converts the multiset p 5 q 3 into a multiset r 5 w 3 to pass directly into membrane A 1 ;
(iii)
The order of execution in membrane A 1 , at this time, is: { r 32 , r 33 } { r 27 , r 28 } .
(a)
In the absence of object o 1 , rule r 32 , r 33 is executed at the same time, and the multiset r 5 w 3 evolves into p 8 q 3 ;
(b)
Execute rule r 27 , r 28 to convert the multiset p 8 q 3 to r 8 w 3 and feed it into the membrane M 1 .
(iv)
When the membrane M 1 receives the multiset r 8 w 3 , the object b 2 is generated when the rule is executed because the numerator is smaller than the denominator, so the corresponding rule is executed to evolve the multiset r 8 w 3 into the multiset w 1 8 r 1 3 . At this time, the multiset in the membrane M 1 is l 1 3 k 1 5 f 5 i 5 b 2 25 w 1 8 r 1 3 , and there is no rule to execute in the System, so the whole System is stopped. The number of objects w 1 and r 1 represent the values of denominator and numerator, respectively, so the final reduction result of 15/40 is 3/8.
Table 3 shows the partial process of simplifying 15/40 in a combinatorial P System Π 3 , including system initialization, obtaining the maximum convention x, calculating the intermediate value reduction results k 1 , l 1 , and other key time slices. The complete execution process is shown in Appendix A.
From the above process analysis, it is clear that the total time slice for this example is 61.

5. Experimental Results

To determine the appropriate parameters ξ for the combination of the two methods, in this experiment, we randomly selected 100 sets of data and used the P System simulation software UPSimulator for validation analysis. We compared the steps obtained when introducing different parameters into the data. The fewer steps, the shorter the time used, and the better the rules.

5.1. Simulation Experiments

Various P System simulation tools are listed in the literature [24]. In this paper, we make use of the P System simulation software UPSimulator (UPS for short), which is used to read the P System model described by UPL and to perform simulation experiments on the model. Therefore, this section first introduces the relevant knowledge of UPLanguage, then introduces the UPSimulator simulation software, and finally provides an example to demonstrate the simulation process.

5.1.1. UPSimulator: P System Simulation Software

In order to more conveniently describe the simulation model, literature [23] introduced the language UPLanguage (UPL for short) for describing the P System, which is used to describe the membrane structure, membrane properties, initial object multiset and rule sets of the P System. It integrates object-oriented thinking and can define a membrane with a certain function as a membrane class. Membranes can be used as a type of membrane, and when used, only one statement is needed to instantiate a membrane of that type. Membranes can also be inherited by another membrane, and the inherited membrane will have all the content of that membrane and can also have its own unique content. Meanwhile, in UPL, rules are described as having two parts: conditions and results, allowing the characteristics of the rules to be arbitrarily combined.
UPL will be described using the BNF paradigm. In UPL, define a membrane class, starting with the keyword ‘Membrane’, followed by the type of membrane (a combination of letters), and the membrane content enclosed in parentheses:
<MembraneDef> ::=“Membrane”<MemType> [ “extends”<MemType> { “,” <MemType> } ] “{”{<Submembrane> | <Objects> | <RuleDef> | <Properties>}“}”
<MemType> ::= <Letters>
The ‘extensions’ section declares which membrane classes this membrane class inherits from, and this section is optional.
After introducing UPL to describe the simulation model, the author also designed UPS simulation software, whose overall architecture is shown in Figure 11. When using the P System to solve problems, the problem can be decomposed into a series of subtasks. For each subtask, we can use one or more membranes to complete it, and each membrane that completes these tasks is a membrane class. After constructing all the required membrane classes, construct validation examples based on the problem, which is the simulation environment. Then use a recognizer to identify the environment and the string composed of all the membranes used. When the recognizer recognizes, it will continuously construct conditions, results, rules, objects, and membranes based on the identified content and place them inside the correct membranes. Finally, based on the identified simulation environment, a skin membrane is constructed. The skin membrane and its internal submembranes will evolve according to rules under the control of the controller, whose main function is to ensure parallelism and randomness during membrane execution. The user interface will display the status of the skin membrane in a timely manner, and users can also control the entire simulation process through the interface. The specific design of the P System description language and simulation software can be referred to in reference [23].

5.1.2. Simulation Examples

Taking 576/378 as an example, when ξ = 8, the initial interface is shown in Figure 12.
From Figure 12, it can be seen that the initial state in membrane m1 sets molecule 576 as the initial value of substance a, denominator 378 as the initial value of b (highlighted in red box in Figure 12), assigns the number of experimental parameters ξ to substance d in membrane a1, creates CreateSubMem to determine whether a new membrane is generated, and both c and t are used to control the cycle. The final experimental results are shown in Figure 13.
When the numerator is greater than or equal to the denominator (i.e., a b ), the experimental result is r/w in membrane m1. When the numerator is less than the denominator (i.e., a < b ), the experimental result is r 1 / w 1 in membrane M 1 . In this example, the reduction result of 576/378 is 32/21 (highlighted in red box in Figure 13), and the total number of steps consumed is 98.

5.2. Parameter Experiments

In this experiment, we randomly selected 100 sets of data and conducted validation analysis using UPSimulator to compare the steps (i.e., the number of time slices) obtained when introducing different parameters into the data. Group the digits with the larger value in the numerator and denominator, with a minimum digit of one and a maximum digit of six. A specific example of digit distribution is shown in Table 4.
Among them, for the first group with a maximum number of digits of four, we take the values of parameter ξ as 8, 20, 50, 100, 500, and 1000, respectively. For the second set of data in Table 4, add the parameter ξ = 10,000. Add an additional parameter ξ = 100,000 to the third set of data. This experiment is to observe how different values of parameter ξ will affect the execution efficiency of the system. Therefore, each parameter is randomly obtained within different digits from small to large and has no specific meaning. In each P System that combines the two, parameter ξ exists in the form of substance d in class A membranes, and the membrane rules are completely the same except for the different quantities of substance d in the initial state. Due to the fact that the intermediate value of each class A film needs to be compared with parameter ξ to determine whether to switch from a more phase derogation algorithm to a division algorithm. Therefore, in class A membranes, it is not allowed to transfer substance d to the parent or daughter membranes to prevent changes in the x value in each layer of the membrane. For each generation of a class A membrane, ξ d objects are fixed in the membrane and initialized. Due to the different ranges of parameter values, three sets of data were statistically analyzed separately.

5.2.1. Four-Digit Experimental Result

For forty randomly selected sets of data, each set of data will have six parameters substituted for the experiment, and the experimental results will be tabulated for statistical analysis. Because the number of steps may vary greatly when different parameters are used for experiments, in order to make the broken line of parameter ξ with the least number of steps more obvious, all the following line charts may be incomplete due to the long number of steps. This phenomenon is normal and not statistically incomplete.
According to the discount Figure 14 made based on the experimental results, it can be seen that out of the 40 randomly selected sets of data, 39 sets of data required the least number of steps for the experiment when the parameter ξ = 8, and only one set of data had the least number of steps when ξ = 100, while the experimental steps for each set of data reached the highest value when ξ = 1000. Therefore, a preliminary conclusion is drawn that in the reduction process of fractions with a maximum of four digits, it is more appropriate to use the combination of the more phase derogation algorithm and the division algorithm with parameter ξ = 8.

5.2.2. Five-Digit Experimental Result

For thirty randomly selected sets of data, each set of data will have seven parameters substituted for the experiment, and the experimental results will be tabulated for statistical analysis.
According to the discount Figure 15 made based on the experimental results, it can be seen that among the 30 randomly selected sets of data, each set of data requires the least number of experimental steps when the parameter ξ = 8, while the experimental steps for each set of data reach the highest value when ξ = 10,000. Therefore, a preliminary conclusion is drawn that in the reduction process of fractions with a maximum number of five digits, it is more appropriate to use the combination of the more phase derogation algorithm and the division algorithm and also take the parameter ξ = 8.

5.2.3. Six-Digit Experimental Result

For thirty randomly selected sets of data, each set of data will have eight parameters substituted for the experiment, and the experimental results will be tabulated for statistical analysis.
According to the discount Figure 16 made based on the experimental results, it can be seen that out of the 30 randomly selected sets of data, 29 required the least number of steps for the experiment when the parameter ξ = 8, and only one set of data had the least number of steps when ξ = 20, while the experimental steps for each set of data reached the highest value when ξ = 100,000. Therefore, a preliminary conclusion is drawn that in the reduction process of fractions with a maximum of six digits, it is more appropriate to use the combination of the more phase derogation algorithm and the division algorithm and also take the parameter ξ = 8.

5.2.4. Summary of Parameter Experiments

Based on the comparison results of the above experiments, we can draw a specific conclusion: for the vast majority of data sets, when the parameter ξ value is 8, the steps required for the UPS experiment are the least, while the larger the parameter ξ value, the more steps required for the UPS experiment. When the ξ value exceeds a certain range, the steps required for the experiment do not change.
Based on the properties and functions of parameter ξ, the smaller the value of parameter ξ, the longer it takes for the system to transition from more phase derogation to division. That is to say, when conducting experiments on the same set of data, the larger the proportion of execution time that is reduced, the higher the efficiency of the system. From the perspective of limit, when ξ gets smaller and smaller until it approaches zero, it means that only when the difference between the larger value and the smaller value is less than zero can it be converted to the Euclidean algorithm. For the positive integer fractional reduction membrane system designed in this article without considering symbols, there is no case where the difference is less than zero. Therefore, in the combination of the two methods, only the first part of the more phase derogation method is used, and only the rules in membrane M1 and class A membranes are executed. There is no need to use class B membranes for rolling and dividing to obtain the results. However, when ξ becomes larger and larger and the difference between the numerator and denominator is even larger, only membrane A1 of type A films normally executes the subtraction rule. After judging the difference and the size of ξ, directly use type B films to use the Euclidean algorithm method. At this time, the initial value of membrane B1 is the initial value of the numerator and denominator, which means that in this case, only the second part of the Euclidean algorithm is performed.
Through the above analysis on the limit, we have a new guess: when comparing the more phase derogation method, the Euclidean algorithm method, and the combination of the two methods, is the number of time slices for the more phase derogation the least?

5.3. Comparative Experiment of Three Methods

We will substitute all 100 sets of data into the combination of the more phase derogation algorithm, the division algorithm, and the optimal parameter ξ = 8 obtained from the experiment in Section 5.2 for experiments. The experimental results will be tabulated for statistical analysis.
According to the discount Figure 17 made based on the experimental results, it can be seen that out of the 100 randomly selected sets of data, 99 sets of data required the least number of steps when using the more phase subtraction method for the experiment, and only one set of data consumed the least number of steps when using the division algorithm. Ninety-nine percent of the data steps reached the highest value when using the division algorithm for the experiment. The number of steps consumed by ξ = 8 is mostly in the middle of the steps consumed by the more phase derogation algorithm and the division algorithm, and in a few cases, it overlaps with the division algorithm.
Analyzing the case of ξ = 8 in conjunction with Section 5.2.4: In the method of combining the two, regardless of the data values of the numerator and denominator, when the difference is less than eight, the P System needs to convert from a more phase derogation algorithm to a division algorithm for calculation. However, the implementation rules of a class A membrane in the first part are actually consistent with those of a class A membrane in the more phase derogation algorithm P System. If the maximum common divisor of the numerator and denominator is not less than eight, the final result can be obtained directly by the more phase derogation algorithm without passing out the intermediate value in the innermost membrane. At this point, the steps of combining the two in the P System are the same as the steps of reducing the loss of the P System, so it is necessary to focus on the impact of other rules on the time slices. However, the rule that multiset in all membranes realizes one-way transmission between membranes is only executed once, which has little impact on the total steps in the whole System. Therefore, the main reason for the increase in time slices is the rolling division.
According to the execution process of the Section 4.2.2 division membrane rules, it can be seen that our designed film rule actually converts division into subtraction: the process of dividing a larger value by a smaller value to obtain a remainder is converted into the process of subtracting a larger value by an integer multiple of the smaller value. When the P System determines that subtraction cannot continue, the remaining value is the remainder. Repeat this step until the maximum common divisor is found when there is no remainder. Therefore, only one subtraction is needed for each layer of class A membrane in the more phase derogation P System, and then the object is directly transferred to the submembrane, while the division P System is to subtract an integer multiple in each layer until the rules of this layer cannot be executed, then the Multiset can be transferred to the inner membrane, and then the same rules are executed in the inner membrane until the maximum common divisor is found. For this reason, in theoretical applications, every time a division is performed, it actually requires multiple subtractions in the P System, resulting in a much higher cumulative number of subtractions compared to using the more phase derogation method alone.
Therefore, the final experimental conclusion is drawn: in the process of fractional reduction, the efficiency is higher when using a more phase derogation algorithm P System. Or, to put it another way, it is also correct: in a combined P system, when the parameter ξ is set to 0, the efficiency of the system is the highest.

6. Conclusions

Membrane computing is a computational model abstracted from the functions and structures of living biological cells and the tissues or organs made up of cells and is a branch of biological computing. It is distributed, parallel and non-deterministic in nature. Membrane computing has developed very rapidly, and its methods have been applied to fields such as theoretical computing, image processing and bioinformatics. In this paper, we study the fraction simplification problem in numerical computation, improve the traditional fraction simplification method from the perspective of computational parallelism, and design three fractional reduction P System Π 1 , Π 2 and Π 3 . Among them, Π 1 is a P System design based on improved parallelization of the more phase derogation algorithm; Π 2 is a P System design based on improved parallelization of the division algorithm, and Π 3 is a P System designed by combining Π 1 and Π 2 Systems. The feasibility and effectiveness of these P System evolution rules are verified by experiments on the simulation software UPSimulator. From the comparison experiments of the three P Systems, it is clear that the P System Π 1 based on the more phase derogation algorithm has higher computational efficiency.
From another point of view, both the more phase derogation P System and the P System combining the two methods are more efficient than the Euclidean P System in finding the greatest common divisor. However, the rolling division is widely used. This algorithm can be used to obtain the least common multiple of two numbers and the maximum common subsequence, and it even has some connection with the RSA algorithm in Cryptography. In future research, we can also optimize other problems that can be solved by the Euclid algorithm so that the P System can achieve higher efficiency.
Fractional reduction is a frequently used calculation in numerical computation, and improving its computational efficiency is one of the most effective ways to improve numerical computation efficiency. Designing P systems with more efficient fractional reduction methods and fewer evolutionary rules is still worth further research.

Author Contributions

Conceptualization, H.N. and J.Z.; methodology, Y.K.; validation, Y.K., J.Z. and L.B.; formal analysis, M.Z.; investigation, H.N.; resources, M.Z.; data curation, Y.K.; writing—original draft preparation, J.Z.; writing—review and editing, Y.K. and J.Z.; visualization, J.Z.; supervision, H.N.; project administration, L.B. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by the Science and Technology Research Program of Chongqing Municipal Education Commission (Grant No. KJQN201901133).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available in insert article.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Table A1. The complete process of simplifying 15/40 using the combined P system Π 3 (complete data for Table 3).
Table A1. The complete process of simplifying 15/40 using the combined P system Π 3 (complete data for Table 3).
Time SliceRules for ImplementationResults of the Implementation
Initial StatusNoneM1: a15, b40, c, t;
A1: c, d20, CreateSubMem;
B1: c, CreateSubMem;
1M1: r1; A1: r2 M1: b25, c, t, g15;
A1: d20, e, j, k, CreateSubMem;
B1: c, CreateSubMem;
2M1: r3, r4;M1: c, t, b225;
A1: a40, b15, d20, e, Num40, j, k, CreateSubMem;
B1: a40, b15, c, Num40, CreateSubMem;
3A1: r3, r1;
B1: r14, r13;
M1: c, t, b225;
A1: d20, e, Num40, u25, x15, y15, i25, j, k, CreateSubMem, a125;
B1: c, Num40, λ55, CreateSubMem;
4A1: r4;M1: c, t, b225;
A1: e, Num40, u25, g20, x15, y15, i5, j, k, CreateSubMem, a125;
B1: c, Num40, λ55, CreateSubMem;
5A1: r5;M1: c, t, b225;
A1: e, Num40, u25, f5, g15, x15, y15, j, k, CreateSubMem, a125;
B1: c, Num40, λ55, CreateSubMem;
6A1: r6;M1: c, t, b225;
A1: e, Num40, u10, f5, g15, x15, j, lan15, k, CreateSubMem, a125;
B1: c, Num40, λ55, CreateSubMem;
7A1: r13, r7, r10;M1: c, t, b225;
A1: Num39, u9, f5, g15, x15, h, j, λ15, a125;
A2: c, d20, CreateSubMem;
B1: c, Num40, λ55, CreateSubMem;
8A1: r8, r14, r15;
A2: r2;
M1: c, t, b225;
A1: u9, f5, g15, h, j, λ15;
A2: a25, b15, d20, Num39, e, j, k, CreateSubMem;
B1: c, Num40, λ55, CreateSubMem;
9A2: r1, r3;M1: c, t, b225;
A1: u9, f5, g15, h, j, λ15;
A2: d20, Num39, e, u10, x15, y15, i10, j, k, CreateSubMem, a110;
B1: c, Num40, λ55, CreateSubMem;
10A2: r4;M1: c, t, b225;
A1: u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, g10, x15, y15, j, k, CreateSubMem, a110;
B1: c, Num40, λ55, CreateSubMem;
11A2: r16;M1: c, t, b225;
A1: u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, x15, y15, j, k, CreateSubMem, o10, a110;
B1: c, Num40, λ55, CreateSubMem;
12A2: r17, r18;M1: c, t, b225;
A1: u9, f5, g15, h, j, λ15, m25, n15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: c, Num40, λ55, CreateSubMem;
13A1: r30, r31;M1: c, t, m25, n15, b225;
A1: u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: c, Num40, λ55, CreateSubMem;
14M1: r6, r5;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: c, n115, m125, λ55, Num40, CreateSubMem;
15B1: r1, r15;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: c, m110, x15, Num39, λ55;
B2: CreateSubMem;
16B1: r16, r2;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1:m110, x15, λ55, y;
B2: Num39, CreateSubMem;
17B1: r3;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: d, m110, x15, λ55;
B2: Num39, CreateSubMem;
18B1: r5, r4;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: n115, c, m110, λ55;
B2: Num39, CreateSubMem;
19B1: r1;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: n15, c, x10, λ55;
B2: Num39, CreateSubMem;
20B1: r2;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: n15, x10, y, λ55;
B2: Num39, CreateSubMem;
21B1: r6;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: n15, x10, e, g, λ55;
B2: Num39, CreateSubMem;
22B1: r7;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: n15, x10, e, h, λ55;
B2: Num39, CreateSubMem;
23B1: r8, r9, r10;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55;
B2: n110, c, m15, Num39, CreateSubMem;
24B2: r1, r15;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55;
B2: n15, c, x5, Num38;
B3: CreateSubMem;
25B2: r2, r16;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55;
B2: n15, x5, y;
B3: Num38, CreateSubMem;
26B2: r6;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55;
B2: n15, x5, e, g;
B3: Num38, CreateSubMem;
27B2: r7;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55;
B2: n15, x5, e, h;
B3: Num38, CreateSubMem;
28B2: r8, r9, r10;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55;
B2: e;
B3: n15, m15, c, Num38, CreateSubMem;
29B3: r1, r15;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55; B2: e;
B3: c, Num37, x5; B4: CreateSubMem;
30B3: r16, r2;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55; B2: e; B3: y, x5;
B4: Num37, CreateSubMem;
31B3: r11;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55; B2: e;
B3: z, x5;
B4: Num37, CreateSubMem;
32B3: r12;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55;
B2: e, x5, z5;
B3: z; B4: Num37, CreateSubMem;
33B2: r12;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55, x5, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
34B1: r12;M1: c, t, b115, b225, a125, x5, z5;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
35M1: r7, r13;M1: c, t, f5, i5, b110, b225, a120;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
36M1: r8, r14;M1: e, f5, i5, b110, b225, a120;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
37M1: r9, r15;M1: d, f5, h, i5, b110, b225, a120;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
38M1: r10, r11, r16, r17;M1: c, t, z5, x5, k, l, b110, b225, a120;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
39M1: r7, r13, r20, r21 M1: c, t, f5, i5, k1, l1, b15, b225, a115;
A1: n115, m125, u9, f5, g15, k1, l1, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: k1, l1, e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
40A1: r19, r20;
M1: r8, r14;
M1: e, f5, i5, k1, l1, b15, b225, a115;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: d10, Num39, e, u10, k1, l1, y15, j, k, CreateSubMem, o10;
B1: k1, l1, e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
41A2: r21, r22;
M1: r9, r15;
M1: d, f5, i5, k1, l1, b15, b225, a115;
A1: n115, m125, u9, f5, g15, h, j, λ15;
A2: q, p, d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: k1, l1, e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
42A2: r24, r23;
M1: r10, r11, r16, r17;
M1: c, t, k1, l1, x5, z5, k, l, b15, b225, a115;
A1: r, n115, m125, u9, f5, g15, w, h, j, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: k1, l1, e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
43M1: r7, r13, r20, r21;
A1: r28, r29;
M1: c, t, k12, l12, f5, i5, b225, a110;
A1: n115, m125, l1, k1, f5, g15, h, j, p2, q, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: k12, l12, e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
44M1: r8, r14;
A1: r19, r20, r23, r24;
M1: r2, k12, e, l12, f5, w, i5, y, b225, a110;
A1: n115, m125, f5, g15, h, j, u9, λ15;
A2: d10, Num39, e, u10, l1, k1, y15, j, k, CreateSubMem, o10;
B1: k12, l12, e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
45M1: r9, r18, r22 r23;
A2: r21, r22;
M1: d, l12, k12, f5, i5, λ2, l, r1, b225, a110;
A1: n115, m125, f5, g15, h, j, u9, λ15;
A2: q, d10, Num39, e, u10, y15, j, k, CreateSubMem, o10, p;
B1: k12, l12, e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
46M1: r10, r11, r21 r24;
A2: r23, r24;
M1: c, l13, k12, f5, x5, w12, k, r1, b225, a110;
A1: n115, m125, l1, f5, g15, h, j, r, u9, w, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: k12, l13, e, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
47M1: r7, r20;
A1: r20, r28, r29;
M1: c, l13, k13, f5, i5, w12, r1, b225, a15;
A1: n115, m125, f5, k1, g15, h, j, p2, q, u9, λ15;
A2: d10, Num39, e, u10, l1, y15, j, k, CreateSubMem, o10;
B1: e, l13, k13, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
48M1: r8;
A1: r19, r23, r24;
A2: r22;
M1: r2, l13, k13, f5, w, i5, y, w12, r1, b225, a15;
A1: n115, m125, f5, g15, h, j, u9, λ15;
A2: q, k1, d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, l13, k13, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
49M1: r9, r22, r23;
A2: r21, r24;
M1: d, l13, k13, f5, i5, w12, lan2, r12, b225, a15;
A1: n115, m125, f5, g15, h, j, u9, w, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, l13, k13, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
50M1: r10, r11, r24;
A1: r28;
A2: r23;
M1: c, l13, k13, f5, x5, w14, k, r12, b225, a15;
A1: n115, m125, f5, g15, h, j, p, q, r, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10, p;
B1: e, l13, k13, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
51M1: r7, r20;
A1: r23, r24, r29;
M1: r, c, l13, k14, f5, w, i5, w14, r12, b225;
A1: n115, m125, f5, g15, k1, h, j, p, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10, p;
B1: e, l13, k14, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
52M1: r8, r22, r23;
A1: r19, r23;
M1: r, l13, k14, f5, i5, y, w14, λ, r13, b225;
A1: n115, m125, f5, g15, h, j, u9, λ15;
A2: d10, Num39, e, u10, y15, k1, j, k, CreateSubMem, o10;
B1: e, l13, k14, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
53M1: r12, r22, r24;
A2: r21;
M1: l13, k14, f5, i5, w15, λ, k, r13, b225;
A1: n115, m125, f5, g15, h, j, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10, p;
B1: e, l13, k14, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
54M1: r20, r24;
A2: r23;
M1: l13, k15, f5, i5, w16, r13, b225;
A1: n115, m125, f5, k1, g15, h, j, r, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, l13, k15, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
55A1: r19, r29;M1: l13, k15, f5, i5, w16, r13, b225;
A1: n115, m125, f5, g15, h, j, p, u9, λ15;
A2: d10, Num39, e, u10, k1, y15, j, k, CreateSubMem, o10;
B1: e, l13, k15, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
56A1: r23;
A2: r21;
M1: r, l13, k15, f5, i5, w16, r13, b225;
A1: n115, m125, f5, g15, h, j, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10, p;
B1: e, l13, k15, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
57M1: r22;
A2: r23;
M1: l13, k15, f5, i5, w16, r13, b225, λ;
A1: n115, m125, f5, g15, h, j, r, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, l13, k15, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
58M1: r24;
A1: r29;
M1: l13, k15, f5, i5, w17, r13, b225;
A1: n115, m125, f5, g15, h, j, p, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, l13, k15, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
59A1: r23;M1: r, l13, k15, f5, i5, w17, r13, b225;
A1: n115, m125, f5, g15, h, j, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, l13, k15, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
60M1: r22M1: l13, k15, f5, i5, w17, r13, b225, λ;
A1: n115, m125, f5, g15, h, j, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, l13, k15, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
61M1: r24M1: l13, k15, f5, i5, w18, r13, b225;
A1: n115, m125, f5, g15, h, j, u9, λ15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, l13, k15, λ55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
62No enforceable rules

References

  1. de Castro, N.L. Fundamentals of natural computing: An overview. Phys. Life Rev. 2007, 4, 1–36. [Google Scholar] [CrossRef]
  2. Păun, G.; Mario, J.P.-J. Membrane computing: Brief introduction, recent results and applications. Biosystems 2006, 85, 11–22. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  3. Păun, G. A quick introduction to membrane computing. J. Log. Algebraic Program. 2010, 79, 291–294. [Google Scholar] [CrossRef] [Green Version]
  4. Pérez Hurtado de Mendoza, I.; Orellana Martín, D.; Martínez del Amor, M.Á.; Valencia Cabrera, L. A Membrane Computing Framework for Social Navigation in Robotics. Comput. Electr. Eng. 2021, 95, 107408. [Google Scholar] [CrossRef]
  5. Mohan, B.S.; Mahmood, A.A.; Mohammed, M.Q.; Zaki, N.D. Replicating the MAP Kinase Cascade in Membrane Computing; IOP Publishing: Bristol, UK, 2021; Volume 1963, p. 012156. [Google Scholar]
  6. Frisco, P.; Gheorghe, M.; Pérez-Jiménez, M.J. Applications of Membrane Computing in Systems and Synthetic Biology; Springer: Berlin/Heidelberg, Germany, 2014; ISBN 3-319-03191-0. [Google Scholar]
  7. Ciobanu, G.; Păun, G.; Pérez-Jiménez, M.J. Applications of Membrane Computing; Springer: Berlin/Heidelberg, Germany, 2006; Volume 17. [Google Scholar]
  8. Atanasiu, A.; Carlos, M. Arithmetic with membranes. In Proceedings of the Workshop on Mutiset Processing, Dubrovnik, Croatia, 29 June 2000; pp. 1–17. [Google Scholar]
  9. Ciobanu, G. A Programming perspective of the membrane systems. Int. J. Comput. Commun. Control 2006, 1, 13–24. [Google Scholar] [CrossRef] [Green Version]
  10. Guo, P.; Jing, C. Arithmetic operation in membrane system. In Proceedings of the 2008 International Conference on BioMedical Engineering and Informatics, Sanya, China, 27–30 May 2008; Volume 1, pp. 231–234. [Google Scholar]
  11. Guo, P.; Zhang, H. Arithmetic operation in single membrane. In Proceedings of the 2008 International Conference on Computer Science and Software Engineering, Wuhan, China, 12–14 December 2008; Volume 3, pp. 532–535. [Google Scholar]
  12. Guo, P.; Luo, M. Signed numbers arithmetic operation in multi-membrane. In Proceedings of the 2009 First International Conference on Information Science and Engineering, Nanjing, China, 26–28 December 2009; pp. 393–396. [Google Scholar]
  13. Guo, P.; Liu, S.J. Arithmetic expression evaluation in membrane computing with priority. In Advanced Materials Research; Trans Tech Publications Ltd.: Stafa-Zurich, Switzerland, 2011; Volume 225, pp. 1115–1119. [Google Scholar]
  14. Guo, P.; Chen, H.; Zheng, H. Arithmetic expression evaluations with membranes. Chin. J. Electron. 2014, 23, 55–60. Available online: https://cje.ejournal.org.cn/article/id/8163 (accessed on 16 July 2022).
  15. Guo, P.; Chen, H. Arithmetic expression evaluation by P systems. Appl. Math 2013, 7, 549–553. [Google Scholar] [CrossRef] [Green Version]
  16. Guo, P.; Zheng, H.; Chen, H.; Chen, J. Fraction arithmetic operations performed by P systems. Chin. J. Electron. 2013, 22, 690–694. [Google Scholar]
  17. Rich, A.D.; Stoutemyer, D.R. Representation. Simplification and Display of Fractional Powers of Rational Numbers in Computer Algebra. arXiv 2013, arXiv:1302.2169. [Google Scholar]
  18. Guo, P.; Zhang, H.; Chen, H.; Liu, R. Fraction reduction in membrane systems. Sci. World J. 2014, 2014, 858527. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  19. Păun, G. From cells to computers: Computing with membranes (P systems). Biosystems 2001, 59, 139–158. [Google Scholar] [CrossRef] [PubMed]
  20. Martın-Vide, C.; Gheorghe, P.; Alfonso, R.-P. On P systems with membrane creation. Comput. Sci. J. Mold. 2001, 9, 26. [Google Scholar]
  21. Backhouse, R.; Joao, F.F. On Euclid’s algorithm and elementary number theory. Sci. Comput. Program. 2011, 76, 160–180. [Google Scholar] [CrossRef]
  22. Rogers, H. The Euclidean Algorithm as a Means of Simplifying Fractions. Arith. Teach. 1970, 17, 657–662. [Google Scholar] [CrossRef]
  23. Guo, P.; Quan, C.; Ye, L. UPSimulator: A general P system simulator. Knowl.-Based Syst. 2019, 170, 20–25. [Google Scholar] [CrossRef]
  24. Raghavan, S.; Chandrasekaran, K. Tools and simulators for membrane computing—A literature review. In Bio-Inspired Computing—Theories and Applications; Gong, M., Pan, L., Song, T., Zhang, G., Eds.; BIC-TA 2016; Communications in Computer and Information Science; Springer: Singapore, 2016; Volume 681, pp. 249–277. [Google Scholar] [CrossRef]
Figure 1. Structure of the cell-like P System. (a) Cell membrane; (b) Abstraction of membranes.
Figure 1. Structure of the cell-like P System. (a) Cell membrane; (b) Abstraction of membranes.
Applsci 13 08514 g001
Figure 2. Initial Pattern of the More Phase Derogation Algorithm P System.
Figure 2. Initial Pattern of the More Phase Derogation Algorithm P System.
Applsci 13 08514 g002
Figure 3. Flowchart of the fraction simplification solution of the more phase derogation algorithm P System. (a) Flowchart of the sequence x i , y i by more phase derogation algorithm; (b) Flowchart of the sequence { p i } , { q i } by more phase derogation algorithm.
Figure 3. Flowchart of the fraction simplification solution of the more phase derogation algorithm P System. (a) Flowchart of the sequence x i , y i by more phase derogation algorithm; (b) Flowchart of the sequence { p i } , { q i } by more phase derogation algorithm.
Applsci 13 08514 g003
Figure 4. Flowchart of the more phase derogation algorithm example.
Figure 4. Flowchart of the more phase derogation algorithm example.
Applsci 13 08514 g004
Figure 5. Initial pattern of the P System in the division algorithm.
Figure 5. Initial pattern of the P System in the division algorithm.
Applsci 13 08514 g005
Figure 6. Flow diagram of the division algorithm P System.
Figure 6. Flow diagram of the division algorithm P System.
Applsci 13 08514 g006
Figure 7. Process diagram for solving the example of the division algorithm P System. (a) Flowchart for finding the greatest common divisor x in the division algorithm; (b) Flowchart for simplifying the result of the division algorithm example.
Figure 7. Process diagram for solving the example of the division algorithm P System. (a) Flowchart for finding the greatest common divisor x in the division algorithm; (b) Flowchart for simplifying the result of the division algorithm example.
Applsci 13 08514 g007
Figure 8. Process diagram for solving the example of the rolling phase division P System.
Figure 8. Process diagram for solving the example of the rolling phase division P System.
Applsci 13 08514 g008
Figure 9. Flow chart for solving the combined method P System. (a) Flow chart for the combination of the two methods to find the intermediate values m, n; (b) Flow chart for finding the maximum common divisor by the division algorithm; (c) Flow chart for the sequence { p i } , { q i } by the more phase derogation algorithm.
Figure 9. Flow chart for solving the combined method P System. (a) Flow chart for the combination of the two methods to find the intermediate values m, n; (b) Flow chart for finding the maximum common divisor by the division algorithm; (c) Flow chart for the sequence { p i } , { q i } by the more phase derogation algorithm.
Applsci 13 08514 g009
Figure 10. Simplified flow chart for approximate differentiation of the two combined examples.
Figure 10. Simplified flow chart for approximate differentiation of the two combined examples.
Applsci 13 08514 g010
Figure 11. Software structure of UPS.
Figure 11. Software structure of UPS.
Applsci 13 08514 g011
Figure 12. Initial state of the instance.
Figure 12. Initial state of the instance.
Applsci 13 08514 g012
Figure 13. Example simulation results.
Figure 13. Example simulation results.
Applsci 13 08514 g013
Figure 14. Four-digit parameter comparison line chart.
Figure 14. Four-digit parameter comparison line chart.
Applsci 13 08514 g014
Figure 15. Five-digit parameter comparison line chart.
Figure 15. Five-digit parameter comparison line chart.
Applsci 13 08514 g015
Figure 16. Six-digit parameter comparison line chart.
Figure 16. Six-digit parameter comparison line chart.
Applsci 13 08514 g016
Figure 17. Step number comparison of three methods in a line chart.
Figure 17. Step number comparison of three methods in a line chart.
Applsci 13 08514 g017
Table 1. Time slice process of the more phase derogation algorithm procedure.
Table 1. Time slice process of the more phase derogation algorithm procedure.
Time SliceRules for ImplementationResults of the Implementation
Initial StatusNoneM1: m6, n15;
A1: c, CreateSubMem;
1r1M1: g6, n9;
2r3, r4M1: b9;
A1: a15, b6, c, Num6, CreateSubMem;
3r1, r2A1: c, Num6, u9, x6, y6, CreateSubMem, l9;
4r3, r4A1: Num6, u3, f, v6, x6, k, CreateSubMem, l9;
5r5, r7, r12A1: Num5, u2, v6, x6, h, l9;
A2: c, CreateSubMem;
6r8, r10, r13A1: u2, v6, h;
A2: a9, b6, c, Num5, CreateSubMem;
7r1, r2A2: c, Num5, u3, x6, y6, CreateSubMem, l3;
8r3, r4A2: Num5, f, v3, x6, y3, k, CreateSubMem, l3;
9r5, r7, r12A2: Num4, v3, x6, y2, i, l3;
A3: c, z, CreateSubMem;
10r8, r10, r13, r17A2: v3, y2, i, o;
A3: a6, b3, c, Num4, CreateSubMem;
11r1, r2A3: c, Num4, u3, x3, y3, CreateSubMem, l3;
12r3, r4A3: Num4, f, v3, x3, k, CreateSubMem, l3;
13r5, r12, r14A3: q, Num3, v3, x3, l3, p2;
A4: c, CreateSubMem;
14r13, r15, r16A3: p12, v3, x3, l3, q1;
A4: c, Num3, CreateSubMem;
15r18, r19A3: p12, v3, x3, l3, q1;
16r15, r16A2: p13, v3, y2, i, o, q12;
17r20, r21A1: q2, u2, v6, h, p5;
A2: p13, v3, y2, i, o, q12;
18r15, r16M1: b9, r5, w2; A1: p15, u2, v6, h, q12;
19r20, r21M1: b9, w15, r12;
20No enforceable rules
Table 2. Time slice process for the division algorithm.
Table 2. Time slice process for the division algorithm.
Time SliceRules for ImplementationResults of the Implementation
Initial StatusNoneM1: m6, n15, c, t; A1: c, CreateSubMem;
1r1M1: g6, n9, c, t;
2r3, r4M1: a6, b15, c, t;
A1: a15, b6, c, Num15, CreateSubMem;
3r1, r7A1: a9, c, Num14, x6; A2: CreateSubMem;
4r2, r14A1: a9, x6, y;
A2: Num14, CreateSubMem;
5r3A1: a9, x6, d;
6r4, r5A1: a9, b6, c;
7r1A1: a3, x6, c;
8r2A1: a3, x6, y;
9r3A1: a3, x6, d;
10r4A1: a3, b6, c;
11r1A1: b3, x3, c;
12r2A1: b3, x3, y;
13r6A1: b3, x3, e, g;
14r8A1: b3, x3, e, h;
15r9, r10 A1: e;
A2: a3, b3, c, Num14, CreateSubMem;
16r1, r7A2: c, Num13, x3; A3: CreateSubMem;
17r2, r14A2: x3, y; A3: Num13, CreateSubMem;
18r12A2: e, x3, z;
19r13A1: e, x3, z3; A2: e, z;
20r13M1: a6, b15, c, t, x3, z3; A1: e, z3; A2: e, z;
21r5M1: a6, b15, c, t, v3, w3, z3
22r6, r12M1: a3, b12, c, t, f3, i3, z3;
23r7, r13M1: a3, b12, e, f3, i3, y, z3;
24r8, r14M1: a3, b12, d, f3, h, i3, z3;
25r9, r10,r15,r16M1: a3, b12, c, t, v3, w3, z3, k, l;
26r6, r12M1: b9, c, t, f3, i3, z3, k, l;
27r7, r13M1: b9, e, f3, i3, y, z3, k, l;
28r11, r14M1: b9, f3, h, i3, z3, k2, l;
29r15, r16M1: b9, t, v3, i3, z3, k2, l2;
30r12M1: b6, t, f3, i3, z3, k2, l2;
31r13M1: b6, e, f3, i3, z3, k2, l2;
32r14M1: b6, f3, h, i3, z3, k2, l2;
33r15, r16M1: b6, t, v3, i3, z3, k2, l3;
34r12M1: b3, t, f3, i3, z3, k2, l3;
35r13M1: b3, e, f3, i3, z3, k2, l3;
36r14M1: b3, f3, h, i3, z3, k2, l3;
37r15, r16M1: b3, t, v3, i3, z3, k2, l4;
38r12M1:t, f3, i3, z3, k2, l4;
39r13M1: e, f3, i3, z3, k2, l4;
40r17M1: f3, i3, z3, k2, l5;
41No enforceable rules
Table 3. Partial time slice of a combinatorial P System Π 3 .
Table 3. Partial time slice of a combinatorial P System Π 3 .
Time SliceRules for ImplementationResults of the Implementation
Initial StatusNoneM1: a15, b40, c, t;
A1: c, d20, CreateSubMem;
B1: c, CreateSubMem;
2M1: r3, r4;M1: c, t, b225;
A1: a40, b15, d20, e, Num40, j, k, CreateSubMem;
B1: a40, b15, c, Num40, CreateSubMem;
7A1: r13, r7, r10;M1: c, t, b225;
A1: Num39, u9, f5, g15, x15, h, j, λ 15, a125;
A2: c, d20, CreateSubMem;
B1: c, Num40, λ 55, CreateSubMem;
13A1: r30, r31;M1: c, t, m25, n15, b225;
A1: u9, f5, g15, h, j, λ 15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: c, Num40, λ 55, CreateSubMem;
14M1: r6, r5;M1: c, t, b115, b225, a125;
A1: n115, m125, u9, f5, g15, h, j, λ 15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: c, n115, m125, λ 55, Num40, CreateSubMem;
34B1: r12;M1: c, t, b115, b225, a125, x5, z5;
A1: n115, m125, u9, f5, g15, h, j, λ 15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, λ 55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
54M1: r20, r24;
A2: r23;
M1: l13, k15, f5, i5, w16, r13, b225;
A1: n115, m125, f5, k1, g15, h, j, r, u9, λ 15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, l13, k15, λ 55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
61M1: r24M1: l13, k15, f5, i5, w18, r13, b225;
A1: n115, m125, f5, g15, h, j, u9, λ 15;
A2: d10, Num39, e, u10, y15, j, k, CreateSubMem, o10;
B1: e, l13, k15, λ 55, z5;
B2: e, z5; B3: z; B4: Num37, CreateSubMem;
62No enforceable rules
Table 4. Range of experimental data values.
Table 4. Range of experimental data values.
Serial NumberMaximum Number of DigitsValue RangeNumber of Groups
140–999940
25100–99,99930
361000–999,99930
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Nan, H.; Kong, Y.; Zhan, J.; Zhou, M.; Bai, L. P System with Fractional Reduction. Appl. Sci. 2023, 13, 8514. https://doi.org/10.3390/app13148514

AMA Style

Nan H, Kong Y, Zhan J, Zhou M, Bai L. P System with Fractional Reduction. Applied Sciences. 2023; 13(14):8514. https://doi.org/10.3390/app13148514

Chicago/Turabian Style

Nan, Hai, Yumeng Kong, Jie Zhan, Mingqiang Zhou, and Ling Bai. 2023. "P System with Fractional Reduction" Applied Sciences 13, no. 14: 8514. https://doi.org/10.3390/app13148514

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop