Research on P System with Chain Structure and Application and Simulation in Arithmetic Operation

Considering the advantages of distribution and maximum parallelism of membrane computing and availability of discrete Morse theory to deal with discrete structure, in this paper, combining discreteMorse theory andmembrane computing, a novelmembrane structure—P system with chain structure, is proposed, which is constructed on the basis of discrete gradient vector path of the discrete Morse theory. At the theoretical level, due to its unique chain structure, compared with traditional P system, its structure, object, and rule are described in details. In the practical aspect, a specific application example, P chain system for arithmetic operation, is presented to demonstrate the superiority, computational efficiency, and ability of P system with chain structure. Moreover, a simulation system of arithmetic operations based on P chain system is designed, giving a visual display of the implementation of P chain system for arithmetic operation, and verifying the feasibility and effectiveness of P chain system.


Introduction
Membrane computing is a new computational model proposed by Romanian scientist Pȃun in 1998, due to being introduced by Pȃun at the first time, it is also called P system [1].Membrane computing abstracts cell as the computational unit, permitting every computational unit to calculate dependently and the whole system to operate in the way of maximum parallelism, whose computational efficiency has been improved obviously [2][3][4][5].It has been proved that the computation capacity of membrane computing is equivalent with that of turing machines, so due to its strong parallel computing power it has been the highlight of the recent study.
Morse theory [6] is a useful tool in differential topology, applied for investigating the topology of smooth manifolds, particular for computer graphics, having been the focus of the research.Forman [7] extended it to the discrete aspect, which provides an effective tool to describe the topology of discrete object, such as simplex and simplicial complex and plays a vital role in pure mathematics and applied mathematics.Concepts in discrete Morse theory, such as simplex [8], discrete gradient vector path and so on, provide a useful tool to research the topology of discrete structure.
Generally, the structure of P system is abstracted as the nested structure of the cell wall and organelle, so it is a kind of nested and hierarchical structure.Of course, there are many other structures, such as reticular formation of neural network.Up to now, there are three main P systems, celllike P system, tissue-like P system and neural P system [3], and the study of cell-like P system has been well-developed.In literature [4], Pȃun pointed out that the focus of the next stage of membrane computing study was the nonhierarchical arrangement of membranes.In literature [9], the author has proposed a P system based on simplicial complexes, which is an innovative try in the aspect of nonhierarchical membrane structure.Inspired from this, in this paper, a P system with chain structure is introduced, which combines membrane computing with discrete Morse theory and constructs a P system based on the discrete gradient vector path, forming a new kind of nonhierarchical membrane structure-P chain system.To try to arrange a novel nonhierarchical structure of P system not only makes a contribution to knowledge but also makes a clear methodological contribution.
The organization of the reminder in this paper is described as follows: Section 2 is the part of theoretical discussion, reviewing theories and properties of discrete Morse theory and P system, which are the foundation of P system with chain structure, and then giving the specific description of structure, object, and rule of P chain system.In Section 3, a practical application of P chain system, P chain system for arithmetic operation, is proposed, displaying +, −, * , / four kinds of P chain systems.In Section 4, by a computer simulation, the specific implementation of P chain system for arithmetic operation is demonstrated, showing the computational efficiency and power of P system with chain structure.In Section 5, the summary and prospect are included.Here are some core definitions in discrete Morse theory, which are also essentials in this paper [6][7][8][9].
Definition 2 (simplex with orientation).For a -simplex   , there are ( + 1)! permutations of different sequences for its +1 vertices  0 ,  1 ,  2 , . . .,   ; when  > 0, there are two kinds of permutations; any two permutations of the same kind differ in even commutations, while any two permutations in different group differ in odd commutations.These two kinds are called two orientations of   .The simplex which has been given an orientation is called simplex with orientation, one denoted as   and the other as −  .

Definition 3 (𝑄-chain). Suppose a fundamental constituent {𝑠
} of -complex , for an integer   , there is , and a linear combination with integer coefficient Definition 4 (discrete gradient vector field).For the gradient vector field  on a -complex , it is a series of ordered pair sets denoted as { () ,

P System Theory.
Membrane computing is a novel computational model abstracted from biochemical reactions in living cells, whose merit is internal maximum parallelism.The essential components of P system are membrane structure, objects, and rules.The formalization definition of P system is shown as follows: ∏ = (, , , ,  1 , . . .,   , ( 1 ,  1 ) , . . ., (  ,   )) .(1) Here  is the alphabet, representing the object;  is the output alphabet and  ∈ ;  is the catalyst and  ∈  − ;  is the set of membranes;   is the object multisets,  is the membrane label;   is the set of evolutionary rules, some rules are applied to reflect the chemical reactions, such as rewriting rules, and others are employed to simulate biological processes, such as communication rules, and   is the priority set of these rules.

Definitions and Properties of P Chain System
Definition 5 (P system with chain structure).Generalized P system with chain structure is written as , where   is integer and |  | represents the number of the membranes.Additionally, if ∀  > 0,   represents positive generalized P system with chain structure, especially if ∀  = 1,   denotes positive standard P chain system.Moreover, if ∀  < 0,   represents negative generalized P chain system, particularly if ∀  = −1,   denotes negative standard P chain system.Furthermore, if ∃  > 0 or ∃  < 0,   represents multiply generalized P chain system, especially if ∃  = 1 or ∃  = −1,   denotes multiply standard P chain system.
Generally, what we call P system with chain structure is referred to the standard P chain system.Here is an example for the above definition.There is a complex 1(a), and 0-simplex are these vertices so there are 0-chain  2 +  1 +  1 +  2 +  2 +  1 whose units come from  0 and 1-chain  2  1 +  1  1 +  1  2 +  2  2 +  2  1 whose units belong to  1 .And then membranes from 0-chain or from 1-chain can compose a P system with chain structure. 2 +  1 +  1 +  2 +  2 +  1 is an example of positive standard P chain system.5 2  1 + (− 1  1 ) +  1  2 + (−3 2  2 ) +  2  1 can be called multiply generalized P chain system shown in Figure 1(b), where twoway arrow represents the repeated appearance of membrane, figure denotes the number of repeated appearance of its front membrane, that is to say,  1 appears 5 times and  3 3 times, usually 1 is omitted.Property 1 (oriented property of P chain system).There are three orientations of P chain system due to the orientation of simplex.What we entitle as P chain system with the same direction is that all the membranes are the same orientation, specifically in order to determine the direction of the P chain system, we need to predefine the orientation of complex, that is to say, if we stipulate the positive surface   as positive, all the membranes from positive simplex of {  } form P chain system with positive orientation, marked by "+", its membrane called positive membrane.On the contrary, all the membranes from the negative simplex of {−  } constitute the P chain system with negative orientation, marked by "−", corresponding membrane called negative membrane.Moreover, if there are membranes from positive simplex or negative simplex at the same time in a P chain system, it is called P chain system with multiply orientation, marked by "×, " that is to say, in the P chain system with multiply orientation there are both positive membranes and negative membranes.
Take the P chain system 1 for example.If we define clocklike orientation as the positive direction, P chain system Property 2 (additive property of P chain system).Supposing that is also a -chain.For the addition, all the -chain of complex  are a free Abelian group, which is called -chain group of .
Property 3 (precursory and subsequent relationships between adjacent membranes in P chain system).Because P chain system is based on a discrete gradient vector path, the order of membranes is determined; that is, for a given P system with chain structure, the relationship between adjacent membranes is precursor or subsequent.For a P chain system The algorithm for constructing the P system with chain structure is shown in Algorithm 1.

Description of Structure, Object, and Rule of P Chain
System.For the structure of P chain system, we know that it is nonhierarchical, specifically if it is a chain structure based on discrete gradient vector path, while for the object, it is similar with the former P system, which is denoted by multisets, meaning that  = is used to represent objects of each membrane.But considering the oriented property of P chain system, the membrane is divided into positive and negative one, so objects in membrane with different orientations are different too; for example, supporting that object in positive membrane is marked as , then object in negative membrane is marked as   correspondingly. and   are antimatter, meaning that they cannot coexist; when they encounter each other, they will counteract immediately.This is similar with positive and negative spikes in spiking neural P system, where rule   →  makes their coexistence impossible.
Based on the rules of former P system, combining the particularities of P system with chain structure, there are three main rules of P chain system: rewriting rules, communication rules, and forgetting rules.
Rewriting rule is with the form of  → V, where  and V, from the alphabet , are the objects which represent the multisets, and this rule can be used in membrane  when and only when the object set  in  satisfies  ⊇ .Rewriting rules are used to control the type and number INPUT: discrete Morse function , the number of the membranes in P chain system  OUTPUT: P system with chain structure (1) Find out a discrete gradient vector path from the given discrete Morse function  by the algorithm proposed in literature [10]; (2) Find out sets   consisted by all the -simplex and  −1 consisted by all the ( − 1)-simplex from the discrete gradient vector path, noting that   and  −1 are ordered sets, ordered by the sequence of simplexes located in the discrete gradient vector path; (3) According to the number of membranes  in the P chain system, choosing adjacent  simplexes from   or  −1 as membranes in the P chain system, constituting -dimension or ( − 1)-dimension P system with chain structure.
Algorithm 1: Construction algorithm of P system with chain structure.
of objects in membrane.Here are some target indications used to manage the movement of objects.They include tar 1 = {here, out, in}, where "here" indicates that object remains in the membrane, "out" denotes that object leaves the membrane into its subsequence, and "in" shows that object is sent out to its precursor.So rewriting rule with target indication is formed as  → V, where  is a string representing multisets of objects from a given set , and V is a string over  * {here, out, in}.Usually they are formed as (, tar), where  is the object from  and tar is here (usually omitted) or in or out.For example, P chain system ; there are object  3  2  4 and rule  2  3 →  2 (, out)(, in) in membrane  2 ; the result of the execution of the rule is to produce 4, 1, 2, 1, where 1 and 1 will be sent into subsequence  3 and 1 and 1 will be sent into precursor  1 , eventually remaining  3  2  2 in membrane  2 .
Communication rules are used to manage the communication across the membranes, including symport rules and antiport rules.Here another target indication tar 2 = {pre, sub} is introduced, where "pre" indicates that which move to the precursor of the membrane and "sub" denotes that which move to its subsequence.So in communication rules, target indication is shown in pair, formed as (tar 1 , tar 2 ), where tar 1 = {here, out, in} and tar 2 = {pre, sub} and where tar 2 can be omitted, meaning that objects will be sent into the precursor or subsequence randomly.In a P chain system where the structure is determined, defining that the membrane where rule resides is Forgetting rule is defined as the form of  → , where  is object over alphabet  which is used to represent multisets, and  is null.The function of forgetting rule is to disappear some certain objects in membrane.A typical example of forgetting rule is objects ,   which are antimatter in membranes with different orientation, when they encounter with each other, they will counteract immediately, resulting from the execution of rule   → .In most situations, forgetting rule   →  does not appear explicitly, but is defaulted to execute with the highest priority.Note that when execute this rule, if there are object  or   in membrane where the rule resides, its objects  or   will be used at first, if there is no object  or   , supporting that there are enough object  or   in environment can be used to counteract the antimatter.

Formalization Definition of P Chain System.
The formalization definition of standard P system with chain structure is described as followed: ∏ = (, , , ,  0 ,  1 , . . .,   , syn, in, out) . ( (1)  is the alphabet, and the element from  is called object; (2)  is output alphabet, and  ∈ ; (3)  is catalyst ( ∈  − ); the element of  is unchanged during the evolutionary process of system; that is to say, the char of  does not disappear and there is no new char generated, but its participation is necessary for some certain rules to execute; (4)  is the set of membrane structures, each membrane and its enclosed area are expressed as label set ,  = {1, 2, . . ., }; (

P Chain System for Arithmetic Operation
The calculating power of P system has been concerned and researched generally, and previous study has proved that NP-hard problem can be resolved by P system in polynomial time [5].So there are crucial theoretical value and heightened practical significance if we can take advantage of the maximum parallelism of P system to improve computational efficiency for a series of calculation problems, such as arithmetic operation.The fundamental arithmetic operation includes addition, subtraction, multiplication, and division, which is the base of other complex operations.We try to achieve arithmetic operation with P chain system in order to explore more complex operation fulfilled by P chain system.Literature [11] has proved the possibility to fulfill arithmetic operation by P system.Based on this, P chain system for arithmetic operation is proposed here; compared with the former method, there are some improvements of both time performance and space performance.When designing the P chain system for arithmetic, standard P system with chain structure is chosen; that is to say, each membrane in P chain system appears only once.Moreover, we suppose that there are enough objects in environment which can be used for the execution of certain rules.Note that the P chain system for arithmetic operation designed now can only achieve the arithmetic operation between any two natural numbers, and the result of the calculation is shown as the number of object in output membrane.

P Chain System for Addition.
In order to fulfill addition by P chain system, we select P system with single direction; that is to say, there is only membrane with positive orientation or negative orientation.Here is the example of P chain system with positive orientation to carry out the addition operation of P chain system.P system with chain structure for addition is designed as Figure 2, and its formalization expression is described as follows: +: show that it is a P chain system with positive orientation; , here output membrane does not appear in Figure 2 and is represented by alphabet .
As shown in Figure 2, there are two membranes with positive orientation, where  and  represent two natural numbers to add, and  and  are the objects of the P chain system, using the number change of object  and  to achieve the addition between any two natural numbers, here the number of object  are used to represent the calculating result.The specific process of P system with chain structure to fulfill addition is stated as followed.First, due to that there are operable rules in both membrane  1 and  2 , in membrane  1 , rule  1 is executed and there will generate an object  sent into membrane  2 , at the same time, rule  2 in membrane  2 is performed too and produces an object  sent into output membrane.Reactions in membrane  1 and  2 are done at the same time in the mode of maximum parallelism, and it will continue until all the object  in membrane  1 are transformed into  and sent into membrane  2 .Then membrane  1 will go into stable condition, and in membrane  2 the rules will be used until all object  from membrane  1 or  2 are converted into  and sent into output membrane.Now membrane  2 reaches stable, meaning that the whole P system is stable and the calculation ends, left  +  object  in output membrane.Until then, the P chain system completes the addition  +  of arbitrary two natural numbers  and .

P Chain System for Subtraction.
In order to achieve subtraction by P chain system, we select P chain system with multiplied orientation; that is, there are both membrane with positive orientation and negative orientation.P chain system for subtraction is designed as Figure 3 and its formalization expression is described as followed.
As Figure 3 showed, there is one membrane with positive orientation and the other is with negative orientation, where  and  represent any two natural numbers to subtract, specifically  is subtrahend and  is minuend, and ,  and   which are antimatter are the objects in the P chain system, using the number variation of object  and   to achieve the subtraction between any two natural numbers, here the number of object   are used to represent the calculating result.The process of P system with chain structure to achieve subtraction is described as followed.At first, rule in membrane  1 with positive orientation will be used, where "/" denotes the condition for the rule to be executed, that is, only when the condition is met, the rule can be used.So rule  11 will be performed, producing  − 1 object  sent into membrane  2 with negative orientation, and when  and   encounter, they will disappear immediately by the defaulted rule   → .And then there is only one object  left in membrane  1 , which satisfies the executive condition of rule  12 , and objects  and  generated will be sent into membrane  2 .The appearance of object  activates the rule  2 , and  −  object   left in membrane  2 will be sent into output membrane.Until then, the P chain system completes the subtraction  −  of any two natural numbers  and .

P Chain System for Multiplication.
In order to complete multiplication by P chain system, we select P chain system with single orientation, membrane with positive orientation or negative orientation.Here take the P chain system with positive orientation for example, and P chain system for multiplication is designed as Figure 4 and its formalization expression is described as followed.
+: show that it is a P chain system with positive orientation;  = {, };  1 = {  As shown in Figure 4, there are two membranes with positive orientation, where  and  represent any two natural numbers to multiply, and  and  are the objects of the P chain system, using the number change of  and  to achieve the multiplication between any two natural numbers, here the number of object  are used to represent the calculating result.The process of P system with chain structure to fulfill multiplication is explained as followed.First, the existence of object  needed by rule  1 makes it usable in membrane  1 , due to the execution of rule  → (, out 2 ), the object  produced will be sent into membrane  2 , which will trigger rule  21 in membrane  2 .Here rule  2 is a chained rule, which contains two rule vectors.Referred to the literature [12], chained rule  is a vector set of rules, in the membrane if the first rule in the vector of chained rules  is applied, in the next step the rest of the rules from  will be applied in order in consecutive steps.And if any one rule from a vector of chained rules  which has already started to carry out cannot be used, the execution of  is dropped, that is, for the current application of , the remaining rules are not executed anymore.So by rule  21 , generate  object , and then the executive condition of rule  22 is satisfied.So in membrane  2 rule  22 will be used continuously until  object  in membrane  1 are used up, and the whole system reaches stable, calculation ending and  *  object  left in output membrane.Until then, the P chain system completes the multiplication  *  of arbitrary two natural numbers  and .Specific implementation is shown in Table 1.

P Chain System for Division.
In order to achieve division by P chain system, we use P chain system with single orientation.Here taking the P chain system with positive orientation for example, P chain system for division is designed as Figure 5 and its formalization definition is described as followed.
+: show that it is a P chain system with positive orientation; here output membrane does not appear in Figure 5 and is represented by alphabet .As shown in Figure 5, there are two membranes with positive orientation, where  and  represent any two natural numbers to divide, and  and  are the objects of the P chain system, using the number variation of object  and  to achieve the division between any two natural numbers, here the number of object  are used to represent the calculating result.Because at present the object defined in P chain system can only represent nonnegative integer, division taken into consideration here ignores the remainder.The process of P system with chain structure to fulfill division / is explained  as followed.First, there are operable objects for rule  1 in membrane  1 , so the rule   → (  , out 2 ) is used, generation  object  sent into membrane  2 , which activates the rule  21 .Here rule  2 is a chained rule too.So by rule  21 produce one object , and then the executive condition of rule  22 is met.So in membrane  2 rule  22 will be performed continuously until the object  is used up or less than  and rule  1 isn't executed any more, the whole system reaches stable, calculation ending and result is the number of object  left in output membrane.Until then, the P chain system completes the division / of arbitrary two natural numbers  and .Specific implementation of exact division is shown in Table 2, and Table 3 gives the computational process of an example of nonexact division 9/2.

The Analysis of System
Performance.Time complexity used in literature [11] is referred to the number of execution of all rules.Following this way, the comparison of time complexity of the two different methods is shown in Table 4.We can see that the time complexity of arithmetic operation fulfilled by P system with chain structure has been improved obviously, especially the division, which can testify the efficiency and improvement of the new method.Meanwhile, the design of membrane structure and rule is simpler, more effective and more conducive to simulate than the former P system.

Simulation of Arithmetic Operation P Chain System
The simulation of P system has a vital practical significance, and there has been a series of success P system simulation software which can be obtained from P system web page [13].Based on this, in this paper we try to do the simulation program of P chain system for arithmetic operation, as a result, it has stood out its lower time-cost and higher efficiency significantly.The development platform of the system is Microsoft Visual Studio 2008 on Windows 7 and the development language is C#.The whole system can operate normally, and can produce the executable file, which is with portability and robustness.

Description of Storage Mode of the Simulation System.
During the process to develop system, we need to choose the appropriate storage mode for different elements, and the specification is demonstrated as followed [14].
We have known that we need to store the membrane structure, object and rule.Here we abstract those contents in each P system instance as an input file, marked "pcs" as the expanded name, for example, the input file of a P system to achieve the addition operation is named as "Addition.pcs".And taking the addition operation for example, the input file which includes the definition of the membrane structure, object and rule is showed in Table 5.
After explain the structure, object and rule in a P chain system which need stored, how to store them is the next consideration, which is also the problem that needs to be resolved in the process of system initialization.
For the object multisets in the P chain system, it is stored by the form of nonnegative integer.The reason that we do not choose char is when the number of the object is large, the length of char may be very long, not only occupying large storage space, but also consuming much time when read.However, by using the INT array, huge amount of data can be denoted briefly.
For the rules in the P chain system, they are input into the system in the form of strings.If we want to fulfill the correspondence between the rules and object multisets, some rule transformations are needed.The way is that, first, determine the alphabets used in the P chain system, taking the P chain system for addition operation for example, the alphabet set {, } and the rule  → (, out 2 ) involved in membrane 1, we need divide the rule into two parts, namely the former and the latter, and store respectively.The former part of the rule is presented as [1,0], meaning that there are 1 object  and 0 object , and the latter part of the rule is denoted as [0, 0; 1] and [0, 1; 2], noting that the number 1 and 2 after semicolon display the membrane 1, 2, and the part before semicolon shows the change of numbers of objects.For the rule  → (, out 2 ), we know that after the operation of the rule, there are 1 object  consumed and no consumption of object  in membrane 1, and in membrane 2, the number of object  are unchanged and the object  is added one more.
For the storage of the structure of P chain system, due to the special chain structure, we choose linear structure to save.Specifically, it is a kind of linear list, that is to say, two elements which are adjacent logically are adjacent physically.Here we use the vector representation, and there are three marks in each storage unit, the node mark (), precursor node mark (Pre) and subsequent node mark (Sub).Take the P chain system 1 → 2 → 3 → 4 → 5 →  for example, its storage form showed as Table 6.
Following is the code of object and rule for P chain system for addition operation to illustrate the specific storage mode.Here line (1) and ( 2) are the storage way of objects, num1 and num2 are any two nature numbers to add; line (3)-( 4) are the storage of rule  → (, out 2 ), using two-dimension string array, where the first dimension shows the rule is divided to three parts, and the second dimension displays the number of object , object  and the label of membrane, for line (3) as an example, the last {1} means this is in the membrane 1, the {1, 0} denotes before rule execution there are 1 object  and 0 object , and {0, 0} explains after rule execution there are 0 object  and  left the membrane 1.

Description of Rules Selection
Algorithm.The strong computing power of membrane computing is largely due to its maximum parallelism, in the theoretical aspect, the rules in the membrane are allowed to perform freely until there are no rules can be selected.But in the specific process to fulfill the simulation of P system, we need to consider the order of the rule executed and the phenomenon "competition for resource" among the implement process of rules.
For the order of the rules execution, there are many exploratory researches, for example, in the literature [12] chained-rule was proposed, which is a new way to design rules in the P system, where rules are arranged as a form of a chain, meaning they are used by a sequence in the chain.Supposing that there is a chained rule , which contains several vectors of the rule  1 ,  2 , . . .,   , in the membrane if the first rule  1 of chained rule  is applied, then in the next step the rest of the rules from  will be applied in order in consecutive steps.Only when the condition of certain vector rule   is not satisfied or there is no more vector rules can be used, the chained rule  will halt.
In fact, all the ways to explore the order of rule execution are to solve the priority problem, here are two main rule priorities, the strong relationship and the weak one.The strong relationship is referred to that a rule can be used when and only when there is no prior rule can be used, while the weak relationship is defined as for a rule , if there are prior rules than it, meaning the condition to perform the prior is also met, no matter the prior rules are used or not, the rule  cannot be used.For example, for the objects    and rules 1:  → ; 2:  → ; 3:  → ; 4:  →  with priority 2 > 3 and 2 > 4, referring to the definition of strong relationship, there are three possible rule choices {1, 3}, {1, 4} and {2}, but considering the weak relationship, there are only two choices {1} and {2}, and this is because the condition that is satisfied to rule 1 is also met to rule 2, even if rule 2 is not used, when rule 1 is executed, rule 3 and 4 cannot be used.In this paper, we choose the weak one as the standard in the simulation of P chain system.And also some tentative algorithms are given to solve the problem of "competition of resource".The algorithm of rule selection for simulating P chain system is shown in Algorithm 2. Now we have set the executive priority of rules, which has reduced the problem of "competition for resource" in some extend, but for the rules without priority, the problem is also existed, here we make full use of another significant characteristic of P system-"Randomness", meaning that if there are two rules which compete for resource, randomly select one to use.The specific algorithm to handle "competition for resource" further is shown in Algorithm 3.

Demonstration of Simulation of P Chain
System.The interface of simulation software of P chain system for implementing arithmetic operation is shown in Figure 6(a).Here the first number and the second number represent the two positive integers used to operate, and there are four kinds of operators +, −, * , / to be chosen.When you have chosen a kind of operator and clicked on the "calculate" button, the calculating result will be shown in the resulting box, and when you have selected to use clear button, the data will be eliminated from the textbox and the next calculation is ready.

Summary and Prospect
In this paper, a novel P system with chain structure is introduced, which combines membrane computing and discrete Morse theory and takes use of the advantages of discrete INPUT: object multisets of membrane , rule set , priority set of rule execution P (P is represented by the ordered pairs of rule labels, such as 1 > 2, denoted as ⟨1, 2⟩; for the chained rules, P is showed as ⟨, ( + 1)⟩, ,  = 1, 2, . .., meaning to be performed by order); OUTPUT: rule set chosen to be used  (1) For every rule in the set , if each value in the INT vector corresponded to the former of the rule is no more than corresponding value in , rule  is put into the candidate rule set .  gradient vector path.As one of new P system, it has some theoretical and practical contributions.First, the definition of structure, object and rule of P system with chain structure is proposed, especially its differences with the former P system, mainly referred to its chain structure, such as its oriented property, additive property, and precursory and subsequent relationships.It contributes to enrich the theoretical framework of P system research.Second, the application on arithmetic operation by P chain system is demonstrated, and the specific model and rules of P chain system used are shown in detail.Compared with the former methods, the new thinking is more effective both in time and space complexity.Last, the simulation system of P chain system for arithmetic operation is given, and the feasibility of the system is proved, which demonstrates the computational feasibility and effectiveness of P system with chain structure.This is a good start to simulate P system, and is also an exploratory way to show and take full use of the advantages of P system to solve some practical problems.
While we should admit that there are some insufficiencies in this paper; for example, the application on arithmetic operation is not connected with the rules proposed so closely and does not display the computing power of P chain system obviously, and the function of the simulation system is a little easy.All of these should be taken into consideration for further study.Based on the work in this paper, there are many other studies can be furthered on.For example, there are some special properties of P chain system, and how to use these particularities to enhance the computational power of P system is a question deserved to think.Also, whether there are some special applications which may be solved by P chain system more efficiently or not is a meaningful question too.Moreover, the simulation of P system with chain structure to fulfill more functions is a big challenge and needed to study more.

Figure 1 :
Figure 1: The structure of P chain system.

Figure 2 :
Figure 2: P chain system for addition.

Figure 3 :
Figure 3: P chain system for subtraction.

Figure 4 :
Figure 4: P chain system for multiplication.

Figure 5 :
Figure 5: P chain system for division.

( 2 )Algorithm 2 :
For each ordered pairs ⟨, ⟩ in priority set P, setting  = , if rule   and   are both in L, then if  = ,  = ( + 1), then   ,   are left in , and the sequence is   ,   , otherwise delete the less prior rule   .Rule selection algorithm for simulation of P chain system.INPUT: rule set A (the output of Algorithm 2) OUTPUT: rule set   without competition for resource (1) Select one rule  form  randomly, adding  into   , and delete  from  at the same time.(2)For every rule   in  except , if there is competition for resource between   and , delete   from .If  is not null, return (1), else output   .Algorithm 3: Rule selection algorithm with "competition for resource".

Figure 6 :
Figure 6: Simulation interface of P chain system for arithmetic operation.
and its subsequence is  (in, tar 2 )) elaborates the specific precursor and subsequence.In fact, the target indication (tar 1 , tar 2 ) can be simplified as tar 1tar 2 , for example, symport rule (, (out, sub)) in membrane    can be expressed as (, out   +1 ), in the same way, antiport rule (, (out, tar 2 ); V, (in, tar 2 )) can be shown as (, out or (, (out, tar 2 ); V, (in, tar 2 )), where (, out; V, in) means that object  from membrane    is sent out into membrane   −1 or membrane   +1 randomly, at the same time, object V from the membrane   −1 or membrane    , while rule (, (out, tar 2 ); V, 5)  1 , . . .,   denote that there are  membranes with chain structure  1 , . . .,   , and membrane   is represented as   = (  ,   ), 0 ≤  ≤ , where A   ≥ 0 denotes the number of objects of membrane   at the beginning of calculation; B   shows the limited set of rules in membrane   , there are three main forms.(i) Rewriting rules are showed as  → V, where  from the alphabet  represents the multisets; V is the string over set  * {here, out, in}, written as (, tar), where  is the object from  and tar is here (usually omitted), out or in.(ii) Communication Rules include symport rules and antiport rules.Symport rules are formed as (, (tar 1 , tar 2 )), and antiport rules are showed as (, (tar 1 , tar 2 ); V, (tar 1 , tar 2 )), where , V are the objects of alphabet  representing the multisets, and tar 1 = {here, out, in}, tar 2 = {pre, sub}, tar 1 is used to control the direction of object in or out of the membrane, and tar 2 explains the object will be sent into which membrane.(iii) Forgetting Rules are formed as  → , where  is the object over  representing the multisets, and  represents null.The execution of forgetting rules makes the number of objects in membrane less.

Table 1 :
The implementation of P chain system for multiplication.

Table 3 :
The implementation of P chain system for nonexact division 9/2.

Table 4 :
Comparison of time complexity of two methods.

Table 6 :
Storage of P chain system.