• Nem Talált Eredményt

Simplifying the programs: P colonies with inser- inser-tion/deletion

Membrane Systems - The Breadth of Rules and the

5.2 P system with symport/antiport rules

5.3.2 Simplifying the programs: P colonies with inser- inser-tion/deletion

In this section we continue with the investigation of a possible simplification of P colonies. We consider systems where the cells can only remove objects from the environment or insert objects into the environment. We will use so called insertion and deletion programs for this purpose.

Definition 5.3.5. P colonies with capacity of two may have

deletion programs, these are of the form ha, in;bc→di with a, b, c, d∈ V, specifying that ifbc is present inside the cell anda is present in the environment, then the objects inside are changed to dand ais brought in (a is “deleted” from the environment), or

insertion programs, these are of the formha, out;b→cdiwitha, b, c, d∈ V, specifying that if ab is inside the cell, then a is sent out (a is “in-serted” into the environment) and b is changed to cd.

Now we continue with the investigation of two object P colonies with insertion-deletion programs. It is not too difficult to see that if we allow a cell to contain both types of programs, then we can simulate the other types of programs in two steps, thus, it is more interesting to consider P colonies having cells which contain either insertion or deletion programs, but not both types at the same time.

Definition 5.3.6. A two object P colony Π = (V, e, of, IE, C1, . . . , Cn, k) with Ci = (Oi, Pi) is called a P colony with senders and consumers, if for eachi, 1≤i≤n,Pi contains either insertion programs or deletion programs, but not both. A senderis a cell with only insertion programs, aconsumeris a cell with only deletion programs.

Notation. Let us denote by PCOL(2, n, h, s-c) the class of sets of numbers generated by P colonies with senders and consumers having at most n ≥ 1 cells with at most h≥1 program each. We use ∗ in the notation if we need to express that one of the parameters is unbounded.

Example 5.3.1.

(a) A P colony with one sender cell can generate the Parikh set of a regular language L ⊆ T. Let G = (N, T, P, S) be a regular grammar such that L(G) =L.

For generating the Parikh vectors of the words in L, we use, for each S → aB of P, the programs he, out;e → eSi, he, out;S → aBi and then hx, out;A → aBi, x ∈ T for every A → aB in P. Finally, for every rule of the formA→a we need hx, out;A→aFi, x∈T, ha, out;F →F Fi, where F /∈T ∪N.

(b) A P colony with one consumer cell can “consume” the Parikh set of a regular language L. To see this, let M = (Q, T, δ, q0, F) be a deterministic finite automaton such that L(M) =L.

We need the programhe, in;ee→q0i,and to every transitionδ(qi, a) = qj in M, we introduce ha, in;xqi → qji, x∈ T ∪ {e}. If qj ∈ F in δ(qi, a) = qj

we have to add the programs ha, in;xqi →Fi, x∈T,where F /∈Q∪T. Now we show that three cells, one sender and two consumers are sufficient to generate all recursively enumerable sets of nonnegative integers. We will simulate a register machine in the proof, but let us first consider the following.

Remark 5.3.1. We can replace the instructions of type li : (CHECK(r), lj, lk) and li : (SUB(r), lj) of a register machine M = (m, H, l0, lh, P) (see Chapter 2 for the definition) with instructions of the type li : (CHECKSUB(r), lj, lk) in such a way, that the modified machine generates the same language as M. (The effect of theCHECKSUBinstruction is the same as in the previous section:

if the value stored in register r is not zero, then it is decremented and the machine continues with instruction lj, otherwise, if register r is empty, it is left unchanged and the next instruction is lk.)

To see that the replacement is possible, notice that the effect of li : (SUB(r), lj) can be obtained by li : (CHECKSUB(r), lj, lj), and that the effect of li : (CHECKSUB(r), lj, lk) is the same as the effect of li : (CHECK(r), lk, lj) and lj : (SUB(r), lj) (where ll is a new label).

Theorem 5.3.7. PCOL(2,3,∗, s-c) =NRE.

Proof. Consider an m-register machine M = (m, H, l0, lh, P), m ≥ 1 with CHECKSUB instructions instead of CHECK and SUB. (see Remark 5.3.1). We simulate M by representing the content of the register i by the number of copies of a specific objectaiin the environment. We construct the P colony Π = (V, e, of, IE, C1, C2, C3) with

V = {e, l, l, l′′, l′′′, liv, lv,¯l,¯l¯|l ∈H} ∪ {ai |1≤i≤m} ∪ {K, T1, T2, T3, T4, T5},

of = ai where register i is the output register, Ci = (ee, Pi) for 1≤i≤3, and

IE contains only an infinite supply of the objecte.

P colony Π starts its computation in the initial configuration (ee, ee, ee;ε).

We initialize the computation by generating the initial labell0with a program from P1, he, out;e→l0l0i ∈P1 obtaining (l0l0, ee, ee;ε).

The simulation of an instruction with labelli starts from a configuration (lili, ee, ee;w) where w ∈ V, the multiset of objects in the environment, represents the counter contents of M.

In the following, for easier readability, instead of listing all the programs of a cell explicitly, we will present them in the form of several tables, each table containing only some of the programs, those which are necessary for the execution of a certain computational task.

To simulate an nADD instruction, we use the programs of P1 and P3. For each li, lj, lk∈H withli being the label of an instruction li : (nADD(r), lj, lk), we have the following programs.

P1 P3

i1 : hli, out;li →arlji i1 : hli, in;ee →T1i i2 : hli, out;li →arlki i2 : he, in;liT1 →ei i3 : har, out;lj →ljlji i3 : hli, in; ¯¯liT5 →T1i i4 : har, out;lk→lklki

Using these programs, we obtain a sequence of configurations (lili, ee, ee;w)⇒(arl, ee, ee;liw)⇒(ll, ee, liT1;arw)

wherelis the label of the next instruction, that is, we either have (ljlj, ee, liT1; arw), or the configuration (lklk, ee, liT1;arw). The contents of cell C3, liT1, will change in the next step to ee independently of the several ways of the continuation of the computation, as we shall see later.

The program labeled with i3 is used if the instruction simulated before li was aCHECKSUB instruction (see below). In this case, the configuration in which the simulation of li starts is (lili, ee,¯liT4; ¯¯liw) and we need the steps (lili, ee,¯liT4; ¯¯liw) ⇒ (arl, ee,¯l¯iT5;liw) ⇒ (ll, ee, liT1;arw) and program i3 to obtain the same configuration as before.

To simulate a deterministic ADDinstruction li : (nADD(r), lj), we omit the programs denoted with i2 and i4 from the set P1.

Now we show how to simulate aCHECKSUB instruction. For each lj, lk, ll∈ H with lj being the label of an instruction lj : (CHECKSUB(r), lk, ll), and for all labels ls ∈H, we have the programs as seen in Figure 5.2.

To show how the programs of Figure 5.2 simulate the execution of the given CHECKSUB instruction, we use tables where each row represents a con-figuration of the system (with the columns corresponding to the contents of the cells, the environment, and the programs which are applied) to obtain the configuration of the next row of the table. To save space, we also use the sign “/” to separate the different possible multisets which might appear in the same column of a given table position.

First we consider the case when registerris not empty, that is, when there is at least one object ar present in the environment. We see that starting with a configuration where C1 contains the objects ljlj and the environment contains ar, in six steps we obtain a configuration where the object ar is

P1 P2 P3

j1 :hlj, out;lj →ljlji j1 : hlj, in;ee →ei j1 : hlj, in;ee→T1i j2 :hlj, out;lj →lj′′lj′′i j2 : har, in;elj →ei j2 : he, in;ljT1 →T2i j3 :hlj′′, out;l′′j →l′′′j livj i j3 : hl′′j, in;elj →ei j3 : hl′′j, in;eT2 →T3i j4 :hlj′′′, out;livj →¯lk¯lki j4 : hl′′′j , in;are→ei j4,s : h¯ls, in;l′′jT3 →T4i j5 :hljiv, out;l′′′j →¯ll¯lli j5 : he, in;l′′′j e→ei j5,s : h¯ls, in;eT2 →T4i j6 :h¯lk, out; ¯lk→¯l¯k¯l¯ki j6 : hlivj , in;are→Ki j6,s : h¯l¯s, in; ¯lsT4 →T5i j7 :h¯l¯k, out; ¯¯lk→lklki j7 : he, in;livj K →Ki j7,s : he, in; ¯¯lsT5 →ei j8 :h¯ll, out; ¯ll→¯l¯l¯l¯li j8 : he, in;eK →Ki

j9 :h¯l¯l, out; ¯¯lk→lllli j9 : hl′′′j , in;lj′′e →Ki j10 : he, in;l′′′j K → Ki j11 : hlivj , in;l′′je→ei j12 : he, in;livj e→ei

Figure 5.2: Programs to simulate an instruction lj : (CHECKSUB(r), lk, ll).

removed from the environment, and C1 either contains the label of the next instruction lk, or because of the presence of programj8, inP2, the computa-tion will never be able to halt.

configuration of Π programs to be applied

C1 C2 C3 Env P1 P2 P3

1. ljlj ee ? arw j1 − ?

2. ljlj ee ? ljarw′′ j2 j1 ?

3. l′′jlj′′ lje ee ljarw j3 j2 j1

4. lj′′′livj are ljT1 l′′jw j4/j5 − j2

5. ¯lk¯lk/¯ll¯ll are eT2 (l′′′j /ljiv)l′′jw j6/j8 j4/j6 j3

6. ¯l¯k¯l¯k/¯l¯l¯l¯l l′′′j e/ljivK l′′jT3 (¯lk/¯ll)w j7/j9 j5/j7 j4,k/j4,l

7. lklk/llll ee/eK (¯lk/¯ll)T4 (¯¯lk/¯l¯l)w k1/l1 −/j8 j6,k/j6,l

8. lklk/llll ee/eK (¯¯lk/¯l¯l)T5 (lk/ll)w k2/l2 k1/j8 j7,k/j7,l

9. lk′′l′′k/l′′ll′′l (lk/ll)e/eK ee (lk/ll)w k3/l3 k2/j8 j1

Now we show the simulation of the lj : (CHECKSUB(r), lk, ll) instruction when there is no object ar is present in the environment, that is, when

register r is empty. In this case, similarly to the previous one, we either get the objects lklk in the cell C1, or the computation will not be able to halt.

configuration of Π programs to be applied

C1 C2 C3 Env P1 P2 P3

1. ljlj ee ? w j1 − ?

2. ljlj ee ? ljw j2 j1 ?

3. lj′′lj′′ lje ee ljw j3 − j1

4. lj′′′livj lje ljT1 l′′jw j4/j5 j3 j2

5. ¯lk¯lk/¯ll¯ll lj′′e eT2 (lj′′′/livj )w j6/j8 j9/j11 − 6. ¯l¯k¯l¯k/¯l¯l¯l¯l l′′′j K/livj e eT2 (¯lk/¯ll)w j7/j9 j10/j12 j5,k/j5,l

7. lklk/llll eK/ee (¯lk/¯ll)T4 (¯¯lk/¯l¯l)w k1/l1 j8/− j6,k/j6,l

8. lklk/llll eK/ee (¯¯lk/¯l¯l)T5 (lk/ll)w k2/l2 j8/k1 j7,k/j7,l

9. l′′kl′′k/l′′ll′′l eK/(lk/ll)e ee (lk/ll)w k3/l3 j8/k2 j1

The programs to be applied and the objects contained by the cell C3 in row 1. and row 2. of the tables above depend on the instruction li which was simulated before lj. If li is anADD instruction, then we have liT1 in the first row, and applying the program i2 from P3 we get ee in the second row, where no program is applied until the next step. Also, w=w =w′′ in this case.

Ifli is aCHECKSUB instruction, then (as we can also see from row 7. and row 8.) the contents of the cellC3 is ¯ljT4 and ¯¯ljT5 in the first two rows where the programs i6,j and i7,j are applied. In this case w′′ = ¯¯ljw, andw =w.

As we have seen above, the P colony successfully simulates each instruc-tion of M and since there is no program to process lh, the label of the halt instruction, it also halts when the computation of M is finished. It is also easy to see thatM and Π compute the same set of non-negative integers.

5.3.3 Simplifying the cells: The number of symbols