Fraction Reduction in Membrane Systems

Fraction reduction is a basic computation for rational numbers. P system is a new computing model, while the current methods for fraction reductions are not available in these systems. In this paper, we propose a method of fraction reduction and discuss how to carry it out in cell-like P systems with the membrane structure and the rules with priority designed. During the application of fraction reduction rules, synchronization is guaranteed by arranging some special objects in these rules. Our work contributes to performing the rational computation in P systems since the rational operands can be given in the form of fraction.


Introduction
Membrane computing (also called P systems) is a branch of natural computing introduced by Pǎun in 1998 which abstracts computing models from the architecture and the functioning of living cells [1]. Membrane computing model takes the living cell as multihierarchical structural regions which are referred to as the membranes [2]. In the compartments defined by membranes there are objects that can evolve to other objects and pass through the membranes. After Pǎun proposed and proved that P systems based on membrane division can solve SAT problems in polynomial time [3], many variants of P systems, including cell-like [4,5], tissuelike [6], and neural-like ones [7], have been successfully used to design solutions for NP-complete problems. The introductions of the complexity, parallelism, decomposition of membrane, and hierarchical structure can be found in [8,9].
Based on cell-like P systems which are one kind of common systems in membrane computing, Atanasiu firstly constructs arithmetic P systems to implement arithmetic operations [10]. Reference [11] designs multilayer P systems without priority rules to lower the complexity of the operations. And, in [12], the membrane structure is simplified greatly and efficiency of the computations is also improved owing to arithmetic operations being performed in a single membrane without priority rules. Furthermore, multimembrane P systems are constructed for signed arithmetic operations [13] and the operational range of P system can be extended to the whole integer field. In [14] arithmetic expression is evaluated with primary arithmetical operations implemented in single membranes. Reference [15] proposes an algorithm and builds expression P systems without priority rules for evaluating arithmetic expression. And [16] implements primary arithmetic operations of fractions in P systems and builds a bridge between rational numbers and membrane computing. In cell-like P systems, the operands of the arithmetic operations are represented by multiset, which is composed by the objects and their cardinalities. The rational number can be given by the form of fraction, whose numerator and denominator can be represented by multisets, respectively, so the fraction can be a bridge for implementing the calculations of the rational numbers in P systems.
However, [16] has not further processed the computation results which need to be reduced to lighten the load of the subsequent fraction computations. This paper proposes a suitable method of fraction reduction and implements it in P systems. The rest of this paper is organized as follows: Section 2 introduces cell-like P systems, and Section 3 proposes and proves the fraction reduction method. In Section 4, 2 The Scientific World Journal based on cell-like P system, the rules for implementing fraction reduction are described in detail with the membrane structure designed. The conclusions are drawn in the final section.

Foundations
2.1. Cell-Like P Systems. Our work in this paper is based on cell-like P systems, and such system (of degree ≥ 1) can be defined formally as [1,2] Π = ( , , 1 , . . . , , 1 , . . . , , 1 , . . . , , ) , (1) where (i) is the alphabet of the system. Each symbol represents one kind of object. * is the finite and nonempty multiset over where is empty string; (ii) is a membrane structure with membrane, labeled by 1, 2, . . . , ; (iii) (1 ≤ ≤ ) is string over representing the multiset of objects placed in membrane . For example, there are 5 copies of object and 3 copies of object in membrane ; then we have = 5 3 ; = means that there is no object in membrane ; (iv) is output region of the system and it saves the final results; (v) 1 , 2 , . . . , are finite sets of possible evolution rules over associated with the regions 1, 2, . . . , of . The rules in (1 ≤ ≤ ) are of the form → | , with ∈ , ∈ + , = ( , ), or = ( , ) , ∈ * and = {here, out, in | 1 ≤ ≤ }: here means the product remains in the same region; out means goes out of the region and enters into another membrane which includes membrane as its submembrane; and in means goes into membrane which is a submembrane of membrane . Specifically, when = here, ( , ) can be abbreviated as . is a special symbol not in , and it means that the membrane which includes it will be dissolved and the contents of this membrane will be left in the outer membrane. Object is a promoter in the rule → | ; this rule can only be applied in the presence of object ; (vi) (1 ≤ ≤ ) defines a partial order relation among the rules in . If = { → > → } and both objects and are available, then only → can be applied although the two rules do not compete for any objects.
Beside the above rules, we also consider rules for membrane creation, which is of the form → [ ] , with ∈ , ∈ * , and is a number from a given list of the labels; the idea is that the object creates a new membrane labeled by , including multiset and associated with evolution rules [17].
In each membrane, rules are applied according to the following principles.
(i) Nondeterminism. Suppose rules compete for the reactants which can only support ( < ) rules to be applied; then the rules are chosen nondeterministically.
(ii) Maximal parallelism. All of the rules that can be applied must be applied simultaneously.
From now on we only deal with cell-like P systems with membrane creation and call them P systems for brevity.

Fraction Arithmetic Operations.
Reference [16] discusses how to perform fraction arithmetic operations by P systems based on multiple membranes. In [16], the fraction arithmetical operations are written in the form as where 1 , 2 , 1 , and 2 are all integers; 2 > 0, 2 > 0, 1 ≥ 0, and 1 ≥ 0. Fraction operands are converted into the format which the integer arithmetic requires when the operation is processed. The process of initialization makes the fraction operand be represented in a unified form and it simplifies the operation rules since different operands can be represented by the same objects in the P systems. After initialization, [16] designs four kinds of fraction arithmetic P systems to implement primary arithmetic operations of fractions (namely, addition, subtraction, multiplication, and division).
The computation results obtained by the systems in [16] are not in reduced form. So they are required to be processed further for lightening the load of the subsequent fraction computations. However, the current methods for fraction reductions are not available in P systems. In this paper, we propose a method of fraction reduction and discuss how to carry it out in cell-like P systems.

A Method for Fraction Reduction
The goal of fraction reduction is to obtain the simplest fraction, and it means the numerator and denominator are coprimes. Generally, fractions can be reduced by the following methods.
(i) Numerator and denominator are divided by the prime factors that they share until their common factor is 1.
(ii) Numerator and denominator are divided directly by their greatest common factor.
These two methods are simple, but both of them are not suitable for being implemented in P systems owing to the following.
(i) For the first one, we need to enumerate the primes, such as 2, 3, 5,7, . . ., to find out the common prime factors of the numerator and denominator. This method involves large calculation and cannot be processed in parallel. If it is implemented in P system, a rule or several rules should be designed for testing whether a The Scientific World Journal 3 prime is their common factor. It means that the more prime factors they share, the more rules are designed and the more complex membrane structure is. (ii) For the second one, the greatest common factor of the numerator and denominator should be calculated by Euclidean algorithm, but it cannot be performed efficiently in P systems.
For designing a set of generally universal rules to implement fraction reduction in P systems, we present a new fraction reduction method, based on which the designed system works independently on the size of the input. In this section, some theories on the new method are given and the corresponding algorithm is proposed subsequently with its correctness ensured by the present theories.
Proof. let be the common factor of 1 and 2 . According to the construction of { }, we can obtain 1 = 1 × 2 + 3 , so is also the factor of 3 . Similarly, is the common factor of −1 and . It means that there are 1 and 2 , such that −1 = × 1 and = × 2 . According to the definition of −1 , we have That is, Namely, is the factor of 1. Hence, = 1. So 1 and 2 are coprimes.
According to the construction of { } and (11), we have The proofs of the above theories show that the proposed method is feasible for fraction reduction; namely, the simplest proper fraction can be obtained by this method for any fraction.

The Algorithm for Fraction Reduction.
Assume that we want to reduce the fraction / (0 < < ); from the discussion in Section 3.1, the procedure for fraction reduction can be described as follows: We can present an algorithm for fraction reduction in Algorithm 1.
In this algorithm, the complexity of the algorithm is (1) when is a multiple of the . Generally, for sequence { }, we know +1 = 0 if the algorithm performs mod operation for times. Comparing sequence { } with Fibonacci sequence { }, we have 0 = 1 ≤ and 1 = 1 ≤ −1 . And ≥ +1 + +2 can be obtained due to mod + 1 = + 2 (0 ≤ ≤ − 1). So ≥ − can be concluded by mathematical induction. Furthermore, we can obtain = 0 ≥ and = 1 ≥ −1 . That is to say, must be not less than −1 if our algorithm performs mod operation for times and vice versa. We have −1 ≥ (1.618) / √ 5 according to the feature of Fibonacci sequence; namely, ≥ (1.618) / √ 5 and ≤ log 1.618 ( √ 5 ), so the complexity of the algorithm is (log ) in the worst case.

Fraction Reduction in P Systems
In this section, a kind of P systems is designed for fraction reduction based on the algorithm proposed in Section 3.2.

The P Systems for Fraction
Reduction. The P systems for fraction reduction can be defined as the form of (1) given in Section 2.1, where: 1 a m b n c M 1 Figure 1: The initial configuration of P system for fraction reduction.
(i) is the (finite and nonempty) alphabet of objects which occur in the rules in the designed P system; (ii) is the structure of the system and it can be decided by the rules presented subsequently; (iii) = 1, and it means that the final result can be found in membrane 1 when the whole system halts. Figure 1 describes the initial configuration of this P system: membrane 1 is responsible for keeping the final results and dissolving the other objects coming from membrane 1 , while fraction reduction is processed in membrane 1 . Except the two membranes, other membranes will be dynamically created during the reduction, and the rules in the new membranes are the same as the ones in membrane 1 . In Figure 1, objects and are used to label the denominator and numerator, respectively; and , which are the cardinalities of and , represent the absolute value of the denominator and numerator, respectively; object is used to trigger the rules in membrane 1 .
The algorithm proposed in Section 3.2 can be implemented by the P system as shown in Figure 2. In Figure 2, membrane 1 and the created membranes are responsible for computing { }, { }, and { }. These membranes are nested one by one: the new membrane 2 is created in membrane 1 , and another new membrane 3 is created in membrane 2 . Finally, membrane is created in membrane −1 ( is decided in Section 3.2).
The Scientific World Journal 5 a n 0 a n 3 a n 1 a n 2 a n −1 a n +1 a n −1 a n −2 a n b n 1  (i) In membrane 1 , multiset 0 is consumed with new multisets 2 and 1 produced by applying several rules. Furthermore, 2 and 1 are sent into membrane 2 , and 1 is kept in 1 .
(ii) When 2 and 1 are sent into 2 , they are converted to 2 and 1 , respectively. In membrane 2 , 1 is consumed with new multisets 3 and 2 produced. Furthermore, 3 and 2 are sent into membrane 3 , and 2 is kept in 2 .
(iv) Finally, and −1 leave membrane −1 and they are transferred to and −1 , respectively, after arriving in membrane . In membrane , −1 is consumed with the produced.
As shown in Figure 2(b), the procedure of calculating { } is as follows (the cardinalities of the objects are the items in { }).

6
The Scientific World Journal and ( is kept in membrane previously) are consumed with new multisets produced.
(iv) When membrane 1 sends 1 and 2 into membrane 1, the cardinalities of objects and compose the result of the reduction, namely, 2 / 1 .
For convenience, we have some conventions in the rest of the paper as follows.
(i) The rules should have priority, and they are described as the form ( → , ), where → is rewritten rule, and indicates the priority. The smaller value is set, higher priority the corresponding rule will have. When = 1, the corresponding rule will have the highest priority. For example, there are two rules in membrane 1 : 1 : ( → , 1) and 2 : ( → , 2), and the priority of 1 is higher than 2 , so the 1 will be applied firstly when both of them can be applied.
(ii) The created membranes named 2 , 3 , . . ., and and the rules in all of them are the same as the ones in membrane 1 .
(iii) The objects appearing in the rest of the paper have the same meaning, so they will not be explained any more once they are introduced previously.

The Rules for Fraction Reduction.
In this subsection the rules in the P systems for fraction reduction will be discussed in detail. There are two kinds of rules: one is in membrane 1 and the other is in membranes 1 , 2 , 3 , . . ., and . According to Section 3, we know that the fraction reduction mainly includes calculating { }, { }, and { }. So membrane 1 and the created membranes 2 , 3 , . . ., and should carry out the computations including division (for calculating { } and { }), multiplication and addition (for calculating { }).

(i) Calculating { } and { }. Firstly multiset
is put in membrane 1 . In this membrane and the created membranes, object evolves to for controlling the division which is used to calculate { }, { }, and objects and label the denominator and numerator: in membrane 1 , objects and label 0 and 1 , respectively; in membrane 2 , objects and label 1 and 2 , respectively; in membrane 3 , objects and label 2 and 3 , respectively; . . .; in membrane , objects and label −1 and , respectively.
If > , 1 , 2 , 3 , 4 , and 5 should be applied in the order of { 1 , 2 } → 3 → { 4 , 5 } (for convenience, the rules 1 , 2 , . . ., and will be represented as { 1 , 2 , . . . , }, if they can be executed simultaneously). and are consumed by 1 with produced; it means that the values of the numerator and denominator are subtracted by simultaneously and ( − ) copies of object will remain. Object , which is produced by 2 , evolves to with the help of by applying 3 . Once occurs, evolves to by applying 4 and it means that the numerator is restored for the next division. evolves to by applying 5 . This procedure may be repeated for several times. Finally, the cardinality of object represents the quotient of the current division.
If < , 1 , 2 , 6 , 7 , 8 , 9 , 10 , and 11 should be applied in the order of { 1 , 2 } → 6 → { 7 , 8 } → { 9 , 10 , 11 }. 1 and 2 are applied as described previously, and ( − ) copies of object will remain. Object , which is produced by 2 , evolves to with the help of by applying 6 . By applying 7 , triggers to a new membrane to be created in the current membrane in the presence of object and the new membrane will be used to calculate new items in { } and { }. In the presence of object ℎ which is produced by 8 , 9 , and 10 will be applied: by 9 , evolves to (they will be sent into the new membrane), and it means that the numerator and denominator consumed by 1 will be restored in the created membrane; by 10 , evolves to ( will be sent into the new membrane). The applications of 9 and 10 mean that the numerator becomes the new denominator and the denominator becomes the new numerator in the new membrane for the next division since the division rules will not be triggered in the case of < (there is multiset in the new membrane). Object will be produced and sent into the new membrane by applying 11 . If = , 1 , 2 , 12 , 13 , and 14 should be applied in the order of { 1 , 2 } → 12 → 13 → 14 . evolves to by applying 12 . In the presence of , will be dissolved by applying 13 . Then will be dissolved by applying 14 . When occurs in the innermost membrane, it means that the calculations of { } and { } will be ended.
(ii) Calculating { }. The calculations of { } and { } will be terminated when object appears and does not appear in the innermost membrane. At this moment, the operations of multiplication and addition should be triggered to calculate { }.
Concerning (10) in Section 3, we know that in membrane in Figure 2(b), the copies of objects and will be produced at several steps. So we can design the rules to realize that multisets −1 and can be produced in membrane −1 while multisets and +1 are produced in membrane . Based on this consideration, we design the rules for calculating { } and they can be applied in several membranes The Scientific World Journal 7 simultaneously. For example, in membrane in Figure 2(b), several copies of objects and are sent into membrane −1 once they are produced and they will trigger the rules in membrane −1 . It means that the rules in membranes and −1 will be applied together at the subsequent steps. Maximal parallelism is implemented in the P systems for fraction reduction.
The rules for the operations of multiplication and addition can be designed as follows: Rule 15 is only applied in the innermost membrane and is responsible for evolving to . Object evolves to by applying 16 , and it means that 1 is assigned to +1 in membrane as shown in Figure 2(b). and represent the numerator and denominator, respectively. Object evolves to and is sent into the outer membrane in the presence of by applying 17 (it is only applied in membrane ); it means that is assigned to in membrane as shown in Figure 2(b). Rule 18 is only applied in membrane and is responsible for sending out multiset to the outer membrane −1 . Simultaneously, membrane is dissolved because of the occurrence of the special symbol when 18 is applied.
Except for the rules 15 ∼ 18 , the rest of the rules are available in −1 , −2 , . . ., and 1 . By applying 19 , object evolves to and is sent into the outer membrane for triggering rules 19 , 22 , and 23 in the outer membrane. Object coming from the inner membrane evolves to and is sent into the outer membrane by applying 20 . Rules 21 and 22 are applied to generate objects , , and V both in the presence of object and the new generated object is sent into the outer membrane. Rule 23 is applied to generate objects and ( is sent into the outer membrane). Rules 17 , 20 , 21 , and 23 are responsible for calculating { } as shown in Figure 2(b). Object V evolves to by applying 24 for triggering rules 25 ∼ 27 . Rules 25 and 26 are applied to consume objects and completely in the presence of object . Rule 27 is applied to dissolve the current membranes.

The Rule in Membrane 1.
There is only one rule in membrane 1 and it is responsible for keeping the final results and dissolving the objects coming from membrane 1 . The rule can be designed as where objects , , and sent from membrane 1 are dissolved.
Owing to maximal parallelism, the complexity of the P systems for fraction reduction must be not more than (log ).

The Instance for Fraction Reduction.
In this subsection, we will give an instance to show how to implement the fraction reduction in the P system designed previously. For example, 6/10 can be reduced by the P system as shown in Figure 3. The rules in this P system can be applied as follows.

Initial Configuration.
Firstly multiset 10 6 is put in membrane 1 , as Figure 4(a) shows: the cardinality of object is 10, and it is the denominator of the fraction; the cardinality of object is 6 and it is the numerator.

Calculating { } and { }
(i) In Figure 4(a), rule 1 is applied 6 times to generate multiset 6 until 6 is consumed completely, and rule 2 is applied to generate at the same time. Then only rule 3 can be applied to generate multiset . Rule 4 is applied to restore 6 to 6 in the presence of object . At the same time, 5 is applied to generate multiset and there is multiset 4 6 in membrane 1 . In this case, due to the fact that the cardinality of is less than the one of , the available rules are applied in the order of { 1 , 2 } → 6 → { 7 , 8 } → { 9 , 10 , 11 } : 1 is applied 4 times to consume 4 completely; 6 is applied to generate multiset ; by applying 7 , a new membrane is created with the label 2 ; by applying 9 , 10 , and 11 , 4 and 2 are sent into the new created membrane as the new numerator and denominator with object ℎ also sent into the new membrane (see Figure 4(b)).
(ii) At this moment, there is multiset 6 4 in membrane  membrane is created with the label 3 ; by applying 9 , 10 , and 11 , 2 and 2 are sent into the new created membrane as the new numerator and denominator with object ℎ also sent into the new membrane (see Figure 4(c)).
(iii) There is multiset 4 2 in membrane 3 ; the available rules are applied in the order of 2 2 . Due to the fact that the cardinality of equals the one of , the available rules are applied in the order of { 1 , 2 } → 12 → 13 → 14 : 12 is applied to generate multiset ; 13 is applied 2 times to consume 2 completely; then will be dissolved by applying 14 (see Figure 4(d)).
(ii) There is multiset 2 in membrane 3 now. At this moment, 16 is applied to generate and is sent into the outer membrane. Then 17 is applied 2 times to generate 2 and 2 is sent into the outer membrane in the presence of object . Rule 18 is applied to generate multiset and is sent into the outer membrane. Simultaneously, membrane 3 is dissolved (see Figure 4(f)).
(iii) There is multiset 2 in membrane 2 . The following rules can be applied in a step: 19 and 20 are applied to generate objects , , , and (all of them are sent into the outer membrane); 21 and 22 are applied to generate objects , , and V both in the presence of object and the new generated object is sent into the outer membrane; 23 is applied to generate objects and ( is sent into the outer membrane) (see Figure 4(g)).
(iv) There are multisets 2 and V in membranes 1 and 2 , respectively. In membrane 1 , the following rules can be applied in a step: 19 and 20 are applied to generate objects , , , and (all of them are sent into the outer membrane); 21 and 22 are applied to generate objects , , and V both in the presence of object and the new generated object is sent into the outer membrane; 23 is applied to generate objects and ( is sent into the outer membrane). Simultaneously in membrane 2 , the available rules can be applied: 21 is applied to generate multiset in the presence of object and the new generated object is sent into the outer membrane; 23 is applied to generate multiset and is sent into the outer membrane, and 24 is applied to generate object at the same time (see Figure 4(h)).
(v) There are multisets 2 , 2 V, and in membranes 1, 1 , and 2 , respectively. In membrane 1, rule 28 is applied to consume multiset completely. In membrane 1 , the following rules can be applied in a step: 20 is applied to generate object ( is sent into the outer membrane); 21 is applied to generate objects and in the presence of object and the new generated object is sent into the outer membrane; 23 is applied to generate objects and ( is sent into the outer membrane); 24 is applied to generate object . In membrane 2 , rules 25 and 26 are applied to consume objects and completely; then membrane 2 is dissolved after applying 27 (see Figure 4(i)). The aforementioned rules in membranes 1, 1 , and 2 are applied simultaneously.
(vi) There are multisets 4 2 and in membranes 1 and 1 , respectively. In membrane 1 , the following rules can be applied in a step: 20 is applied to generate object ( is sent into the outer membrane); 21 and 22 are applied to generate objects , , and V both in the presence of object and the new generated object is sent into the outer membrane; 23 is applied to generate objects and ( is sent into the outer membrane). Then there is multiset V in membrane (vii) There is multiset 5 3 in membrane 1 (see Figure 4(j)). At this time, no rules can be applied, so the whole system halts. The cardinalities of and represent the values of the denominator and numerator, respectively, so the final result of reducing 6/10 is 3/5.

Conclusions
Fraction (rational number) computing is foundational in most of the computing models and systems, and the computation results of the fractions often need to be reduced to lighten the load of the subsequent computations. This paper proposes and proves a new suitable reduction method and implements it in P systems. Furthermore, we give an instance to illustrate how to carry out the fraction reduction effectively in this system. For the fact that the rational number can be given by the form of fraction, whose numerator and denominator can be represented by multisets, respectively, our work will contribute to implementing the computation of the rational numbers in P systems. Further, we will research the signed fraction reduction in P systems and the fraction reduction in the case that the denominator or numerator is 0.