1 Introduction

Membrane systems or P systems were introduced in [1] as a computing model based on an abstract view of the processes taking place in living cells. They consist of a nested structure of membranes, and the regions delimited by these membranes contain different multisets of objects. These multisets are transformed step by step during the functioning of the system until the result is produced when the system reaches a halting configuration. In the basic variant of the model, the objects can be rewritten in each computational step by parallel application of multi-set rewriting rules, or they can be transferred (communicated) between neighboring regions. More details on the different variants and their computational properties can be found in the monograph [2] or in the handbook [3].

Besides the static rule sets associated to the regions (as considered in the original variant of the model), several methods were also introduced with the aim of making the rule sets more “dynamic”, that is, with the aim of constructing systems which are able to change not only the objects, but also the rules that are applicable to the objects. One of the first of these types of models were called generalized P systems, see [4], where the operators acting on the objects could also be changed by the system during the computation. Features like rule creation or the inhibiting/de-inhibiting of rules were also considered in [5] and in [6]. In this work, we focus on another one of these dynamic models called polymorphic P systems, which was introduced in [7].

Polymorphic P systems were motivated by the idea that the program of a computing device could be viewed as data. Therefore, it could also be changed during the course of the computation. In these types of P systems, rules are not statically defined, but are dynamically inferred from the contents of pairs of membranes: The contents of one member of the pair define the multiset representing the left-hand side of the rule, the contents of the other member define the right-hand side. As the membranes can contain further membranes, the contents of the pairs, and this way the left- and right-hand sides of rules may change dynamically during the computation. See the survey [8] for more information.

The initial results presented in [7] show the power of the model. With cooperative rules (rules with left-hand sides having more than one objects) any recursively enumerable set of numbers can be generated, but non-cooperative systems (systems with rules having just one object on the left-hand side) can also generate several interesting languages, mainly based on the fact that exponential, even super-exponential growth of the number of objects inside the system can be produced.

The study of non-cooperative variants of the model was continued further in [9] by considering the case of “no ingredients”, that is, when no special features (not even target indicators) are added to the system. The equivalence of so-called strong and weak polymorphism was shown, left polymorphism, right polymorphism, and general polymorphism was defined. As its main contribution, [9] presented a hierarchy of computational power based on the depth of the membrane structure, but in general, many questions concerning the computational capabilities of the non-cooperative variant remained open for further investigation.

In the present work, we intend to take some additional steps in this direction. We show that (1) Parikh sets of ET0L languages can be generated using non-cooperative polymorphic P systems (with no other ingredients) of depth three where all non-dynamical rules are “chain rules”, and that (2) ET0L systems can generate string languages corresponding to the multiset languages of non-cooperative polymorphic P system where the set of the possible contents of regions corresponding to right-hand sides of rules is finite. This gives us an exact characterization of the class of Parikh sets of ET0L languages in terms of restricted variants of non-cooperative polymorphic P systems. Polymorphic P systems were already considered in connection with Lindenmayer systems in [10], where so called bounded L systems were simulated by polymorphic P systems with target indicators.

In the following, after reviewing the necessary definitions, we present in Sect. 3 how ET0L systems can be simulated with non-cooperating polymorphic P systems of depth three. Then, in Sect. 4 we consider systems which may have unlimited depth, but a limited complexity in the sense that the behavior of their membranes can be described by finite transition systems. We show that these types of non-cooperating polymorphic systems, regardless of their depth, characterize the class of Parikh sets of languages generated by ET0L systems.

2 Preliminaries

In the following, we briefly define the basic notions we will use. See [11] for more on formal language theory, and [2, 3] for details about membrane computing.

An alphabet V is a finite non-empty set of symbols called letters. A string (or word) over V is a finite sequence of letters, the set of all strings over V (the free monoid generated by V) is denoted by \(V^*\), and \(V^+=V^* \setminus \{\lambda \}\) where \(\lambda\) denotes the empty string. For a string \(w\in V^*\), we denote by \(|w|_x\) the number of occurrences of the letter \(x\in V\) in w. If we fix an order \(V=\{a_1,a_2,\ldots ,a_n\}\) of the letters, then the vector \((|w|_{a_1},|w|_{a_2},\ldots ,|w|_{a_n})\) is called the Parikh vector of the word \(w\in V^*\).

Multisets can be thought of as sets with multiplicities associated to their elements. If \({\mathbb {N}}\) denotes the set of nonnegative integers, then a multiset over a set U is a mapping \(M:U\rightarrow {\mathbb {N}}\) where M(a), for all \(a \in U\), is the multiplicity of element a in the multiset M. If U is finite, \(U=\{a_1, a_2, \ldots a_n \}\), then M can also be represented by the vector \((M(a_1),M(a_2),\ldots , M(a_n))\) or by a string \(w=a_1^{M(a_1)} a_2^{M(a_2)} \ldots a_n^{M(a_n)}\) (and all permutations of this string) where \(a^j\) denotes the string obtained by concatenating \(j\in {\mathbb {N}}\) occurrences of the letter \(a\in V\) (with \(a^0=\lambda\)). Note that the vector representation of a multiset coincides with the Parikh vector of the string representations.

We will also need the notion of a finite transition system which is defined as a triple \(M=(Q,{q},\delta )\) where Q is a finite set of states, \(q\in Q\) is the initial state, and \(\delta :Q\rightarrow 2^Q\) is the state transition mapping. A state \(q'\in \delta (q)\) is called the successor state of q, and \(q\in Q\) is called a halting state if \(\delta (q)=\emptyset\).

Lindenmayer systems (or L systems) are parallel rewriting systems introduced in [12] with the aim of describing the development of simple biological organisms in terms of formal languages. For more information on the area of L systems, see the book [13]. In the following, we will use the variants which are extended, tabled, and interactionless, that is, ET0L systems in short.

An ET0L system is a construct \(G=(V, T, U, w)\) where V is an alphabet, \(T\subseteq V\) is a terminal alphabet, \(w \in V^+\) is the initial word of G, and \(U=(P_1,\ldots ,P_m)\) where \(P_i,\ 1\le i\le m\), are finite sets of context-free productions over V (called tables), such that for each \(a\in V\), there is at least one rule \(a\rightarrow \alpha ,\ \alpha \in V^*\) in each table. In a computational step in G, all the symbols of the current sentential form are rewritten using one of the tables of U. The language generated by G consists of all terminal strings which can be generated in a series of computational steps (a derivation) starting from the initial word, that is, \(L(G)=\{u \in T^* \mid w\Rightarrow ^* u\}\) where \(\Rightarrow\) denotes a computational step, and \(\Rightarrow ^*\) is the reflexive and transitive closure of \(\Rightarrow\).

It is known (see [14], for example) that for each ET0L system with an arbitrary number of tables, there exists an ET0L system with only two tables generating the very same language.

Moreover, since we are going to relate ET0L languages to the multiset languages of P systems, we are not interested in the string generated by the ET0L system as a sequence of letters, but only in the multiplicities of different letters, that is, in the Parikh vectors of the generated strings. We will denote by Ps(G) the set of Parikh vectors corresponding the strings of L(G) (also called the Parikh set of L(G)), and by PsET0L the class of Parikh sets corresponding to the class of languages generated by ET0L systems.

Polymorphic membrane systems were introduced in [7]. Unlike in traditional membrane systems, the rules rules in polymorphic P systems are not fixed in advance, but they are defined by the contents of specific membrane regions corresponding to the left- and right-hand sides of the rule.

A polymorphic P system of degree \(2n+1\) for some \(n\in \mathbb N\) is a construct

$$\begin{aligned} \Pi = ( O, T, \mu , w_s, \left\langle w_{1L}, w_{1R} \right\rangle ,\ldots , \left\langle w_{nL},w_{nR}\right\rangle , h_o), \end{aligned}$$

where O is the alphabet of objects, \(T \subseteq O\) is the set of terminal objects, \(\mu\) is the membrane structure consisting of \(2n+1\) membranes labeled by a symbol from the set \(H=\{s, 1L,1R,\ldots ,nL,\) \(nR\}\), the elements of the multiset \(w_s\) are the initial contents of the skin membrane, the pairs of multi-sets \(\left\langle w_{iL},w_{iR} \right\rangle\) correspond to the initial contents of membranes iL and iR, \(1 \le i \le n\), and \(h_o\in H\) is the label of the output membrane.

The membrane structure is usually denoted by a string of labeled and matching parentheses, but it can also be represented by a tree with its root labeled by the label of the outermost membrane, and the descendant nodes of each node labeled by the labels of membranes enclosed by the region corresponding to the given node. In the following, the number of nodes encountered during the traversal of the longest path from the root to a leaf in such a tree representation will be called the depth of the membrane system. (For example, the system which only has one membrane is of depth 1, while the system with a pair of nested membranes is of depth 2.) Note that for every \(1 \le i \le n\), the membranes iL and iR have the same parent membrane, so they are located at the same depth.

The rules of \(\Pi\) are not given statically in the description, but are dynamically deduced for each configuration based on the content of the membrane pairs iL and \(iR,\ 1\le i\le n\). Thus, if in the configuration of the system these membranes contain the multisets u and v, then in the next step their parent membrane is transformed as if the \(u \rightarrow v\) multiset rewriting rule were added to it.

If there is at least one rule in a system \(\Pi\) where the number of objects in u (the multiset on the left-hand side) can grow to be greater than one, then we say that \(\Pi\) is a cooperative system, otherwise, it is a non-cooperative system. If iL is empty for some \(1\le i\le n\) in a configuration, then the rule defined by the pair iL, iR is considered disabled, that is, no rule will be inferred from the contents of iL and iR for use in the next computational step.

A computation of the system is a series of computational steps in which the rules associated to a given region are applied in a maximally parallel way, that is, as many rules have to be applied in parallel as possible (with the restriction that each object can be rewritten by at most one rule). A P system halts (reaches a halting configuration) when no more computational steps are possible, that is, when no rule can be applied in any of the regions.

The set of vectors generated by a P system \(\Pi\) with the terminal alphabet \(T \subseteq O\) is the set of vectors representing the multisets of the terminal objects appearing in the output region \(h_o\) in a halting configuration of \(\Pi\) which is reached by a computation starting in the initial configuration of the system.

We denote the classes of non-cooperative polymorphic membrane systems and the sets of vectors they generate as OP(polymncoo) and \({\mathcal {L}}(OP(polym, ncoo))\), respectively (polym stands for polymorphism, and ncoo means that the system is non-cooperative). To emphasize limited depth, we may also write \(OP^{k}(polym, ncoo)\) and \({\mathcal {L}}(OP^{k}(polym, ncoo))\) where k denotes the depth of the systems under consideration.

Now we recall an example of a simple polymorphic membrane system with super-exponential growth from [7].

Fig. 1
figure 1

The membrane structure and the initial configuration of the polymorphic P system \(\Pi _1\) of Example 1

Example 1

Consider the polymorphic P system

$$\begin{aligned} \Pi _1 =(\{a\}, \{a\}, \mu , a,\left\langle a, a \right\rangle , \left\langle a, aa \right\rangle , s ) \end{aligned}$$

with membrane structure \(\mu =[\ [\ ]_{1L}\ [\ [\ ]_{2L}\ [\ ]_{2R}\ ]_{1R}\ ]_s\) as illustrated in Fig. 1.

In the initial configuration, the rule corresponding to the contents of 1L, 1R (rule 1) is \(a\rightarrow a\), and it will be applied in the skin region. The rule corresponding to 2L, 2R (rule 2) is \(a\rightarrow aa\), and it will be applied in region 1R. In the first step, rule 1 is applied in the skin leaving the contents of the membrane intact, and rule 2 is applied in membrane 1R doubling the number of a’s, so rule 1 (the rule corresponding to 1L, 1R) will be changed to \(a\rightarrow aa\). In the second step, rule 1 will transform the multiset a in the skin into aa, and rule 2 will double the contents of region 1R again, so after this step, rule 1 becomes \(a\rightarrow a^4\). In general, after k derivation steps, the contents of 1R will be \({a^2}^k\), so rule 1 will have the form \(a\rightarrow {a^2}^k\). As the number of a’s in the skin will be \(2^{\frac{k(k-1)}{2}}\), the rate of growth of the contents of the skin membrane is super-exponential.

3 Polymorphic P systems with limited depth

In this section, we examine the relationship of languages generated by ET0L systems and simple polymorphic P systems, where simplicity is captured by non-cooperation and limited depth. We look at an example first.

Fig. 2
figure 2

The membrane structure and the initial configuration of P system \(\Pi _2\) of Example 2. Non-dynamical rules are given in a simplified rewriting-rule-like notation

Example 2

Consider the following ET0L system \(G = (V, T, U, w)\) with \(V =\{a_1,a_2\}\), \(T=\{a_1\}\), \(w=a_1a_2\), and two tables \(U=(P_1, P_2)\), each containing two rules

$$\begin{aligned} P_1= & {} \{a_1\rightarrow a_1a_2,\ a_2 \rightarrow a_2a_1a_1\}, \text{ and }\\ P_2= & {} \{a_1\rightarrow a_1,\ a_2 \rightarrow a_1\}. \end{aligned}$$

We construct a non-cooperative polymorphic P system \(\Pi _2\) with depth 3 that can perform the choosing between rules of \(P_1\) and \(P_2\), and therefore can simulate the operation of G.

Let \(O=\{a_1,a_2,a'_1,a'_2, a^0_1,a^0_2,a^1_1,a^1_2,{\bar{a}}_1,{\bar{a}}_2,\bar{{\bar{a}}}_1,\bar{{\bar{a}}}_2,\bar{\bar{{\bar{a}}}}_1,\bar{\bar{{\bar{a}}}}_2, b,c,d,F\}\), \(T'=\{a_1\}\) and

$$\begin{aligned} \Pi _2 =(O,T', \mu ,w_{s},\langle w_{1L},w_{1R}\rangle ,\ldots ,\langle w_{28L},w_{28R}\rangle , s ) \end{aligned}$$

where the membrane structure of \(\Pi _2\) is such that the skin membrane directly contains the membranes \(1L,1R,17L,17R,\ldots , 28L,28R\), and the rest of the membranes are contained by \(1L\) and 1R. In more detail, \(\mu\) is defined as

$$\begin{aligned} \mu =[\ [\ldots ]_{1L}\ [\ldots ]_{1R}\ [\ ]_{17L}\ [\ ]_{17R}\ \ldots [\ ]_{28L}\ [\ ]_{28R}\ ]_{s} \end{aligned}$$

where membrane 1L contains the inner membranes \([\ ]_{2L}\ [\ ]_{2R}\ldots [\ ]_{6L}\ [\ ]_{6R}\), and membrane 1R contains the inner membranes \([\ ]_{7L}\ [\ ]_{7R}\ldots [\ ]_{16L}\ [\ ]_{16R}\).

The graphical representation of \(\mu\) can be seen in Fig. 2 where also the initial membrane contents are depicted. Non-dynamical rules, that is, pairs of membranes \([\ w_{iL}\ ]_{iL},\ [\ w_{iR}\ ]_{iR}\) with constant contents (contents that never change during the computation) are given in a simplified notation as \(w_{iL}\rightarrow w_{iR}\). Note that in this example, we only have one rule that changes dynamically, rule 1 (the rule corresponding to the regions 1L, 1R), the other rules have the same form at each step of the computation.

The initial contents of the regions with non-constant contents are

$$\begin{aligned} w_{s}=a_1'a_2'c, \ w_{1L}=b, \ w_{1R}=b, \end{aligned}$$

the initial multisets contained by the rest of the regions are given (using the simplified notation) in Fig. 2.

Table 1 The first few computational steps of the polymorphic system \(\Pi _2\) of Example 2

The functioning of \(\Pi _2\) is demonstrated in Table 1. The first column contains the step number, the second column shows the form of rule 1 (defined by the membranes 1L, 1R) before the corresponding step, the third column contains the objects in the skin region, while the fourth, fifth, and sixth columns contain the rules we (need to) use in the same computational steps.

The general idea behind the functioning of \(\Pi _2\) is as follows: Rules 17–20 simulate the rewriting process of the tables of G. Those with left-hand side \({\bar{a}}_1\) or \({\bar{a}}_2\) simulate the first table, those with left-hand side \(\bar{{\bar{a}}}_1, \bar{{\bar{a}}}_2\) simulate the second table. The objects of the skin region correspond to the sentential form of G. Rule 1 is “dynamic”, it prepares the objects of the skin membrane for the application of the rules 17–20 in the appropriate order. At the beginning of a “simulating cycle”, rule 1 is used to rewrite \(a_1\) (more precisely, its variant, \(a_1'\)) to \({\bar{a}}_1\) or \(\bar{{\bar{a}}}_1\) selecting this way the table to be simulated. Then, rule 1 changes to rewrite \(a_2'\) according to the same selection while rules 17–20 proceed with the actual simulation of the chosen table. The rest of the rules are needed to synchronize the whole process.

Table 1 shows how the rewriting of \(a_1a_2\) to \(a_1a_2a_2a_1a_1\) by the first table of G is simulated in \(\Pi _2\). In the initial state, the form of rule 1 is \(b \rightarrow b\) which is not applicable because we only have objects \(a_1',a_2', c\) in the skin region, so we have to change rule 1 in the first step. In 1L we can use rule 2 (\(b\rightarrow a_1'\)) which rewrites b in \(1L\) to \(a_1'\) making rule 1 applicable. In parallel, we have to use rule 7 (\(b\rightarrow {\bar{a}}_1\)) or rule 10 (\(b\rightarrow \bar{{\bar{a}}}_1\)) in 1R depending on the table of the ET0L system we want to simulate. To simulate \(P_1\), we must use rule 7, to simulate \(P_2\), we must use rule 10. As we would like to simulate \(P_1\), we use rule 7. Rule 14 (\(b\rightarrow \bar{\bar{{\bar{a}}}}_1\)) is used only in the terminating phase of the computation, see below for more details.

As can be seen in the second row of Table 1, the form of rule 1 has changed, and now we can use it in the skin region to rewrite \(a_1'\) to \({\bar{a}}_{1}\). At the same time, the rules used in 1L and 1R (\(a_1'\rightarrow a_2'\), \({\bar{a}}_1\rightarrow \bar{{a}}_2\), respectively) change the form of rule 1 to \(a_2' \rightarrow \bar{{a}}_2\) in order to be able to start rewriting \(a_2'\)-s in the next step.

After we have used rule 1 and the objects in the skin region have changed, we can use rule 17 (\({\bar{a}}_1\rightarrow a_1^1a_2^1\)) which simulates the first rule from the table \(P_1\) of G. The upper indexing of the symbols on the right-hand side starts from 1, and it will decrease in each of the following steps until the symbols are written back into the original primed form (after counting down with the indices to zero) at the appropriate step, that is, at the step when the rewriting of the other symbol, \(a_2'\) is also finished.

Meanwhile, in step 3, rule 1 (\(a_2' \rightarrow \bar{{a}}_2\)) is also applied to rewrite \(a_2'\) (so the second rule of table \(P_1\) of G can also be simulated), and rule 1 is changed to \(c\rightarrow c\) (so it does not change the contents of the skin region in the next step).

Then, with rule 19 (\(\bar{{a}}_2\rightarrow a_2^0a_1^0a_1^0\)), the rule \(a_2\rightarrow a_2a_1a_1\) (the second rule of \(P_1\)) is simulated, while rules 21 and 23 decrement the upper indices of the objects introduced by the simulation of the previous rule, and the form of rule 1 is changed to \(b\rightarrow b\).

Now, as can be seen in row 5 of Table 1, the system is ready to prepare the next simulating cycle by rewriting the objects corresponding to the sentential form of G to their original primed versions, and changing rule 1 in the appropriate way. We can return to a state that is similar to the initial state by choosing between rule 7 and rule 10 again (to simulate another step from the ET0L system), and in parallel, by rewriting \(a_1^0\)-s and \(a_2^0\)-s to \(a_1'\)-s and \(a_2'\)-s with rules 22 and 24.

The simulation of the ET0L system can be stopped at the steps which precede the table selection phase of the simulation. If both 1L and 1R contain the object b and we want to stop the simulating process, we can choose rule 14 (\(b\rightarrow \bar{\bar{{\bar{a}}}}_1\)) instead of rule 7 or 10, which will change the symbols to their triple-barred versions in the skin membrane. As \(a_1\in T\), the symbol \(\bar{\bar{{\bar{a}}}}_1\) can be rewritten to the terminal symbol \(a_1\), but since \(a_2\not \in T\), the symbol \(\bar{\bar{{\bar{a}}}}_2\) is changed to F which will never result in a halting configuration (because of the rule \(F\rightarrow F\)). In the next step, rule 4 (\(a_2'\rightarrow c\)) and rule 16 (\(\bar{\bar{{\bar{a}}}}_2\rightarrow \lambda\)) is used in the regions 1L and 1R, respectively, so it will be possible to remove the symbol c from the skin, enabling the halting of the system in the case when no nonterminal symbols are present. Otherwise, if nonterminal objects were present in the beginning of the finishing phase, then the symbol F was introduced, so rule 27 (\(F\rightarrow F\)) prevents the halting of the system. The finishing phase of the computation is shown in Table 2.

Table 2 The last computational steps of a successful computation in the polymorphic system \(\Pi _2\) of Example 2

The halting of the system is also impossible if rule 6 (\(b\rightarrow d\)) is used “too early" (when rules \(14-16\) were not yet applied in region 1R) since the symbol c and the rule \(c\rightarrow c\) is present in the skin region. Thus, the result of a halting computation of \(\Pi _2\) is a multiset over \(T=\{a_1\}\) in the skin membrane (the output membrane of the system) which corresponds to the Parikh set of a string that can be generated by the ET0L system G.

Now we show how the idea presented in the example above can be generalized to arbitrary ET0L systems.

Theorem 1

\(PsET0L\subseteq {\mathcal {L}}(OP^{3}(polym, ncoo))\).

Proof

Let \(G=(V,T,U,w)\) be an ET0L system, let k denote the number of letters in the alphabet, \(V=\{a_1, a_2,..., a_k\}\), and let \(T=\{a_1,\ldots ,a_l\}\subseteq V\) for some \(l\le k\). Without loss of generality, we assume that G has exactly two tables, \(U=(P_1, P_2)\). We denote the jth rule of table \(i,\ 1\le i\le 2\) (and their left- and right-hand sides) as \(\alpha _{i,j} \rightarrow \beta _{i,j}\), where \(\alpha _{i,j} \in V\) and \(\beta _{i,j} \in V^*\), \(1\le j\le m\). In order to simplify the notation, we assume that the cardinality of the two tables are the same, \(m=|P_1|=|P_2|\). If this is not the case, that is, if \(|P_1|<|P_2|=m\), then \(\alpha _{1,j} \rightarrow \beta _{1,j}\) for \(|P_1|+1\le j\le |P_2|\) (or \(\alpha _{2,j} \rightarrow \beta _{2,j}\) for \(|P_2|+1\le j\le |P_1|\) if \(|P_2|<|P_1|=m\)) will denote the same rule as \(\alpha _{1,1} \rightarrow \beta _{1,1}\) (or \(\alpha _{2,1} \rightarrow \beta _{2,1}\)).

Let

$$\begin{aligned} O= & {} \{a'_i, a^n_i,{\bar{a}}_i,\bar{{\bar{a}}}_i,\bar{\bar{{\bar{a}}}}_i\mid 1\le i,n\le k\}\cup \{a_i\mid 1\le i\le l\}\cup \{ b,c,d,F\}, \\ T= & {} \{a_i\mid 1\le i\le l\}, \end{aligned}$$

and let

$$\begin{aligned} \Pi =(O,T, \mu ,w_{s},\langle w_{1L},w_{1R}\rangle ,\ldots ,\langle w_{pL},w_{pR}\rangle , s ) \end{aligned}$$

where \(p=(5k+8)+2m+k^{2}+2\) and the membrane structure of \(\Pi\) is such that the skin region directly contains the membranes with labels 1L, 1R and iLiR for \((4k+9)\le i\le p\), while the rest of the membranes are contained by 1L and 1R. In more detail, \(\mu\) is defined as

$$\begin{aligned} \mu =[\ [\ldots ]_{1L}\ [\ldots ]_{1R}\ [\ ]_{(4k+9)L}\ [\ ]_{(4k+9)R}\ \ldots [\ ]_{pL}\ [\ ]_{pR}\ ]_{s} \end{aligned}$$

with membrane 1L containing the membranes \([\ ]_{2L}\ [\ ]_{2R}\ldots [\ ]_{(k+4)L}\ [\ ]_{(k+4)R}\), and membrane 1R containing the membranes \([\ ]_{(k+5)L}\ [\ ]_{(k+5)R}\ldots [\ ]_{(4k+8)L}\ [\ ]_{(4k+8)R}\).

In 1L, the number of rules depends on the number of letters in the alphabet of the ET0L system, we have to apply \(k+2\) rules for each table simulation in succession (where \(k=|V|\)). In general, we specify the rules for the k letters as

$$\begin{aligned}{} & {} r_2: b\rightarrow a'_{1}, \ r_{i+2}:a'_{i} \rightarrow a'_{i+1}, \text{ for } 1 \le i \le k-1, \text{ and } \\{} & {} r_{k+2}:a'_{k} \rightarrow c,\ r_{k+3}:c\rightarrow b. \end{aligned}$$

These rules perform the same task as the rules of 1L in Example 2 do for two letters. In order to be able to finish the simulation, we also need the additional rule \(r_{k+4}:b\rightarrow d\) (see the end of the proof for more details).

Note that here we have used the simplified notation again for membranes with contents that remain constant for the whole computation. (Without this simplification we would have to write \(\langle w_{2L},w_{2R}\rangle\) and specify \(w_{2L}=b\), \(w_{2R}=a'_1\) instead of the rule \(r_2:b \rightarrow a'_{1}\), for example.)

Rules applied in 1R determine on the choice of the table, so we have to introduce rules for \(P_1\) and \(P_2\). We need

$$\begin{aligned}{} & {} r_{k+5}:b\rightarrow {\bar{a}}_{1}, \ r_{k+5+i}:{\bar{a}}_{i} \rightarrow {\bar{a}}_{i+1} \text{ for } 1 \le i \le k-1,\ \\{} & {} r_{2k+5}:{\bar{a}}_{k} \rightarrow c,\ \end{aligned}$$

to enable the simulation of \(P_1\), the rules

$$\begin{aligned}{} & {} r_{2k+6}:b\rightarrow \bar{{\bar{a}}}_{1}, \ r_{2k+6+i}:\bar{{\bar{a}}}_{i} \rightarrow \bar{{\bar{a}}}_{i+1} \text{ for } 1 \le i \le k-1, \\{} & {} r_{3k+6}:\bar{{\bar{a}}}_{k} \rightarrow c,\ \end{aligned}$$

to enable the simulation of \(P_2\), and one more rule \(r_{3k+7}:c\rightarrow b\) to finish the process.

To end the simulation, we need to be able to stop the functioning of \(\Pi\) in the case when the skin region contains (primed variants of) terminal letters only, that is, objects only from the set \(\{a_1',\ldots ,a_l'\}=\{a'\mid a\in T\}\). In order to do this, we introduce a mechanism that is similar to the simulation of the tables. To 1R, we add the rules

$$\begin{aligned}{} & {} r_{3k+8}:b\rightarrow \bar{\bar{{\bar{a}}}}_{1}, \ r_{3k+8+i}:\bar{\bar{{\bar{a}}}}_{i} \rightarrow \bar{\bar{{\bar{a}}}}_{i+1} \text{ for } \\{} & {} 1 \le i \le k-1, \ r_{4k+8}:\bar{\bar{{\bar{a}}}}_{k} \rightarrow \lambda .\ \end{aligned}$$

In the skin region, we go through the objects of the alphabet applying the rules of the chosen table to each of them in a sequence, the rules for the occurrences of one specific object at a time. For this reason, we use indexed variants of the symbols which are produced in the intermediate steps, so they are able to “wait” until the rules for the rest of the objects are also applied. To achieve this effect, we add extra rules decreasing the indices in such a way that we get back to the primed form \(a_1', a_2', \ldots , a_k'\) for all objects at the same computational step.

Recall our assumption that \(|P_1|=|P_2|=m\), and that we denote the jth rule of table \(i,\ 1\le i\le 2\), as \(\alpha _{i,j} \rightarrow \beta _{i,j}\) where \(\alpha _{i,j} \in V\) and \(\beta _{i,j} \in V^*\), \(1\le j\le m\). In the following we will use the notation \(\beta _{i,j}^l\) for some \(1\le l\le k\) to express that \(\beta _{i,j}^l\in \{a_1^l,a_2^l,\ldots ,a_k^l\}^*\) is the indexed version of the corresponding string \(\beta _{i,j}\in \{a_1,a_2,\ldots ,a_k\}^*\).

Now we add the following rules to the skin region. To simulate the rules of \(P_1\), we need

$$\begin{aligned} r_{4k+8+j}: {\bar{a}}_i \rightarrow \beta _{1,j}^{k+1-i} \text{ for } \text{ each } \text{ rule } \alpha _{1,j} \rightarrow \beta _{1,j} \in P_1 \end{aligned}$$

\(\text{ where } \alpha _{1,j}=a_i \text{ for } \text{ some } a_i \in \{a_1, a_2, \ldots a_k\}\) and \(1\le j\le m\).

For the simulation of \(P_2\), we have

$$\begin{aligned} r_{4k+8+m+j}: \bar{{\bar{a}}}_i \rightarrow \beta _{2,j}^{k+1-i} \text{ for } \text{ each } \text{ rule } \alpha _{2,j} \rightarrow \beta _{2,j} \in P_2 \end{aligned}$$

where \(\alpha _{2,j}=a_i \text{ for } \text{ some } a_i \in \{a_1, a_2, \ldots a_k\}\) and \(1\le j\le m\).

After rewriting with the rules above, we have to use rules to count down with the indices of the objects that were produced until the last element of the alphabet is rewritten (similarly to the way we count down in the example). To achieve this, for each \(a_i,\ 1\le i\le k\), we need

$$\begin{aligned} r_{4k+8+2m+(i-1)k+n}&:&a_i^{n} \rightarrow a_i^{n-1} \text{ for } 2 \le n \le k, \text{ and } \\ r_{4k+8+2m+(i-1)k+1}&:&a_i^{1} \rightarrow a_i^{'}. \end{aligned}$$

In order to stop the system, we use the rules

$$\begin{aligned}{} & {} r_{4k+8+2m+k^2+i}: \bar{\bar{{\bar{a}}}}_i \rightarrow \delta _i \text{ where } \delta _i=a_i \text{ if } a_i\in T \text{ or } \\{} & {} \delta _i=F \text{ if } a_i\not \in T, \end{aligned}$$

for \(1\le i\le k\) in the skin region. If the multiset in the skin region corresponding to the current sentential form of the simulated ET0L system contains primed versions of terminals only, that is, elements of the set \(\{a_1',\ldots ,a_l'\}\), then these rules rewrite them to terminal objects. Otherwise, if nonterminal objects are present (that is, if the simulation should not be stopped), they introduce the nonterminal F which prevents the halting of the system because the rule

$$\begin{aligned} r_{5k+8+2m+k^2+1}:F\rightarrow F \end{aligned}$$

is also present in the skin region.

The simulation of the ET0L system can be stopped as follows: If both 1L and 1R contain the object b, then choosing rule \(r_{3k+8}:b\rightarrow \bar{\bar{{\bar{a}}}}\) (instead of rule \(r_{k+5}:b\rightarrow {\bar{a}}\) or \(r_{2k+6}:b\rightarrow \bar{{\bar{a}}}\)) will change the symbols to their triple-barred versions and then to terminals in the skin membrane, and produce c and \(\lambda\) in region 1L and 1R, respectively, so the object c can also be removed from the skin region. Now, if rule \(r_{k+4}:b\rightarrow d\) is chosen to be applied in region 1L, then the system halts producing a multiset of terminals in the skin.

If nonterminal objects were still present in the skin region at the beginning of the finishing phase (that is, if the simulation should not produce any result), then the symbol F was introduced, so the rule \(r_{5k+8+2m+k^2+1}:F\rightarrow F\) prevents the halting of the system.

If rule \(r_{k+4}: b\rightarrow d\) is applied before the nonterminals are removed from the skin region, then the symbol c is still present, so if we also add the rule

$$\begin{aligned} r_{5k+8+2m+k^2+2}:c\rightarrow c, \end{aligned}$$

it prevents the halting of the system.

When \(\Pi\) halts, the result is a multiset over \(T=\{a_1, a_2, \ldots ,a_l\}\) which corresponds to a terminal string that can be generated by the ET0L system G.

To see that the P system \(\Pi\) cannot produce multisets that do not correspond to the Parikh set of a string generated by the ET0L system, observe the construction of \(\Pi\). Informally speaking, there are just a few points where the rule application in \(\Pi\) is not deterministic (apart from simulating the possibility when one symbol can be rewritten by more than one rule of the ET0L system). These nondeterministic steps involve the choice of the table of G to be simulated and the choice whether to finish or to continue the computation, so we might conclude that the behavior of the P system corresponds to an ET0L system derivation. \(\square\)

4 Polymorphic P systems with finite sets of instances of dynamic rules

Since there is no communication between the regions (as we consider P systems with “no ingredients”), the sequence of multisets appearing inside a given region as the computation proceeds only depends on the initial contents of the region itself. To formalize this idea, we introduce a successor relation defined on the contents of regions.

Let \(\Pi =(O,T,\mu ,w_s,\langle w_{1L},w_{1R}\rangle ,\ldots ,\langle w_{nL},w_{nR}\rangle , h_o)\) be a polymorphic P system, and let \(w_{j,h}\) for some \(h\in \{s,1L,1R,\ldots ,nL,nR\}\) denote the multiset contained by the region labeled by h after the jth step of the computation of \(\Pi\) for some \(j\ge 0\). We say that \(w_{j,h}'\) is in the successor set of \(w_{j,h}\), denoted as \(w_{j,h}'\in \sigma _{j,h}(w_{j,h})\), if \(w_{j,h}'\) can be obtained from \(w_{j,h}\) by the maximally parallel applications of the multiset rewriting rules associated to the region h, as can be deduced from the configuration of \(\Pi\) which is reached in the jth step of the computation.

If for the same \(w_{j,h}\) as above, we fix \(\sigma ^0_{j,h}(w_{j,h})=\{w_{j,h}\}\) for any \(j\ge 0\), and for \(k\ge 0\) we have \(\sigma _{j,h}^{k+1}=\sigma _{j+k,h}(\sigma ^k_{j,h}(w_{j,h}))\) (where we extend the range of the function from multisets to sets of multisets in the natural way), then we can define

$$\begin{aligned} \sigma ^*_{j,h}=\bigcup _{k\ge 0}\sigma _{j,h}^k(w_{j,h}). \end{aligned}$$

Definition 1

Given a polymorphic P system \(\Pi\) as above, we say that a region h of \(\Pi\) is finitely representable or FIN-representable in short, if the set of successor multisets of the initial contents of h, \(w_h\), is finite, that is, \(\sigma ^*_{0,h}(w_h)\) is finite.

First, we demonstrate the notion of FIN-representability on an example.

Fig. 3
figure 3

The initial configuration of the polymorphic P system \(\Pi _3\) of Example 3

Example 3

Consider the polymorphic P system

$$\begin{aligned} \Pi _3 =(O,T, \mu ,w_{s},\langle w_{1L}, w_{1R}\rangle ,\ldots , \langle w_{8L},w_{8R}\rangle , s ) \end{aligned}$$

where \(O=T=\{a,b,c,d,e\}\), and the membrane structure is \(\mu = [\ [\ldots ]_{1L}\ [\ldots ]_{1R}\ ]_s\), where the child membranes of 1 L are \([\ ]_{2L}\ [\ ]_{2R}\ldots [\ ]_{5L}\ [\ ]_{5R}\) and the children of 1R are \([\ ]_{6L}\ [\ ]_{6R}\ldots [\ ]_{8L}\ [\ ]_{8R}\). Let

$$\begin{aligned} w_{s}=a,\ w_{1L}=a, \ w_{1R}=aa, \end{aligned}$$

and using the simplified notation for static (non-dynamic) rules, let the rules applicable in 1L be

$$\begin{aligned} r_2:a \rightarrow c,\ r_3: a \rightarrow b,\ r_4: b \rightarrow a,\ r_5: c \rightarrow d, \end{aligned}$$

and the rules applicable in 1R be

$$\begin{aligned} r_6:a \rightarrow b,\ r_7: b \rightarrow a,\ r_8: a \rightarrow e, \end{aligned}$$

as can also be seen in Fig. 3.

In the following, we show that both 1L and 1R are FIN-representable. Concerning 1L, observe that \(\sigma ^*_{0,1L}(a)=\{a,b,c,d\}\) with \(\sigma _{0,1L}(a)=\sigma _{j,1L}(a)=\{b,c\}\), \(\sigma _{0,1L}(b)=\sigma _{j,1L}(b)=\{a\}\), \(\sigma _{0,1L}(c)=\sigma _{j,1L}(c)=\{d\}\), and \(\sigma _{0,1L}(d)=\sigma _{j,1L}(d)=\emptyset\) for all \(j\ge 0\), which can be represented with the graph in Fig. 4a.

Considering 1R, \(\sigma _{0,1R}(aa)=\sigma _{j,1R}(aa)=\{bb,be,ee\}\), \(\sigma _{0,1R}(ae)=\sigma _{j,1R}(ae)=\{be,ee\}\), \(\sigma _{0,1R}(bb)=\sigma _{j,1R}(bb)=\{aa\}\), \(\sigma _{0,1R}(be)=\sigma _{j,1R}(be)=\{ae\}\), and \(\sigma _{0,1R}(ee)=\sigma _{j,1R}(ee)=\emptyset\), thus, \(\sigma ^*_{0,1R}(aa)=\{aa,bb,ae,be,ee\}\), as can be seen on Fig. 4b.

The skin region is not FIN-representable, as the dynamical rule \(r_1\) given by the membranes labeled with 1L and 1R has more than one symbol on its right-hand side in each computational step, and this means that the number of symbols in the skin region is increasing with each rule application. To see this, consider the following. Initially, \(r_1:a\rightarrow aa\), so \(\sigma _{0,s}(a)=\{aa\}\). Then \(r_1\in \{c\rightarrow be, c\rightarrow ee, c\rightarrow bb, b\rightarrow be, b\rightarrow ee, b\rightarrow bb\}\), so it is not applicable, \(\sigma ^2_{0,s}(a)=\sigma _{1,s}(aa)=\{aa\}\). Then \(r_1\in \{d\rightarrow aa,d\rightarrow ae,d\rightarrow ee, a\rightarrow aa,a\rightarrow ae,a\rightarrow ee\}\), thus, \(\sigma ^3_{0,s}(a)=\sigma ^2_{2,s}(aa)=\sigma _{3,s}(aa)=\{aaaa,aaae,aaee,aeee,eeee\}\). As we see by the construction of the system, the rule \(a\rightarrow aa\) might appear arbitrary many times during the subsequent parts of the computation, the multiplicity of objects in the skin region might keep increasing, so this region cannot be FIN-representable according to Definition 1.

Fig. 4
figure 4

Graphical demonstration of the possible membrane contents of the P system \(\Pi _3\) of Example 3 with arrows indicating the initial contents and the successor relation between the multisets (which are given by their string representations)

Given a non-cooperative polymorphic system as defined above, left-hand sides of rules have at most one symbol, so the membranes with labels \(iL,\ 1\le i\le n\), are always FIN-representable. The situation is different, however, in the case of membranes \(iR,\ 1\le i\le n\). If at least one of the rules which is applicable (in an arbitrary number of computational steps) during a computation inside some right-hand membrane has more than one symbol on its right-hand side, then the corresponding dynamic rule has arbitrary many possible instances, so the region corresponding to its right-hand side cannot be FIN-representable.

Let us denote by OP(polymncoofin) the class of non-cooperative polymorphic membrane systems of degree \(2n+1\) where all right-hand side regions, \(iR,\ 1\le i\le n\), are FIN-representable, and let \({\mathcal {L}}(OP(polym,ncoo,fin))\) denote the class of vectors that they generate.

If a region is FIN-representable, we can describe the sequences of possible contents that can appear during the computations with a finite transition system.

Definition 2

Let \(\Pi \in OP(polym,ncoo,fin)\) be a FIN-representable polymorphic P system with \(\Pi =(O,T,\mu ,w_s,\langle w_{1L}, w_{1R}\rangle ,\ldots , \langle w_{nL},w_{nR}\rangle , s)\), and let \(M=(Q,q_0,\delta )\) be a transition system. We say that M represents the rule configurations of \(\Pi\) if the contents of the pairs of membranes labeled by \(1L,1R,\ldots , nL,nR\) of the configuration sequences of \(\Pi\)

$$\begin{aligned}{} & {} (w_s,w_{1L}, w_{1R},\ldots , w_{nL},w_{nR})\\{} & {} =(w^0_s,w^0_{1L}, w_{1R}^0,\ldots , w^0_{nL},w^0_{nR})\Rightarrow \\{} & {} \Rightarrow (w^1_s,w^1_{1L}, w^1_{1R},\ldots , w^1_{nL},w^1_{nR})\Rightarrow \ldots \Rightarrow \\{} & {} (w^i_s,w^i_{1L}, w^i_{1R},\ldots , w^i_{nL},w^i_{nR})\Rightarrow \ldots \end{aligned}$$

are in a one-to-one correspondence with the state sequences

$$\begin{aligned} q_0=q^0\Rightarrow q^1\Rightarrow \ldots \Rightarrow q^i\Rightarrow \ldots \end{aligned}$$

of the transition system M. Moreover, \(q^h,\ h\ge 0\), is a halting state of M, if and only if no rules are applicable in any of the regions \(1L,1R,\ldots , nL,nR\) in the corresponding configuration \((w^h_s,w^h_{1L}, w^h_{1R},\ldots , w^h_{nL},w^h_{nR})\) of \(\Pi\). Note that M, as the evolution of the rule configurations of \(\Pi\) can be nondeterministic.

In the following lemma, we describe how such a representation can be constructed.

Lemma 2

For any polymorphic P system \(\Pi \in OP(polym,ncoo,fin)\), we can construct a finite transition system \(M_\Pi\) which represents the rule configurations of \(\Pi\).

Proof

Let \(\Pi \in OP(polym,ncoo,fin)\) be a polymorphic P system with \(\Pi =(O,T,\mu ,w_s,\langle w_{1L}, w_{1R}\rangle ,\ldots , \langle w_{nL},w_{nR}\rangle , s)\), and let \(1L,1R,\ldots ,lL,lR\) for some \(l\le n\) be the labels of those regions which are directly enclosed in the skin membrane. We construct a finite transition system \(M_{1\ldots l}\) which represents the rule configurations of \(\Pi\) by describing how the k-tuples of rules corresponding to these regions are changing during the computations.

We start with constructing representations of the elementary membranes at the deepest level of the system, and continue upwards, level by level, finally arriving to those regions which are enclosed by the skin membrane.

(1) If a membrane labeled by \(h\in \{{1L},{1R}\ldots , {nL},{nR}\}\) is an elementary membrane, then let \(M_h=(Q_h,{{\bar{q}}}_h,\delta _h)\), where

  • \(Q_h=\{{{\bar{q}}}_h\}=\{(w_h,\emptyset )\}\), and

  • \(\delta _h:Q_h\rightarrow 2^{Q_h}\) such that \(\delta _h({{\bar{q}}}_h)=\emptyset\).

This transition system has a single state which is a pair of the unchanging membrane contents and an empty set, the set of rules that can be used for changing the contents.

As we move upwards in the hierarchy, a similar representation will be constructed for each region: the states of the transition systems are pairs of the (dynamically changing) membrane contents and sets of rules which can be used to transform them.

(2) If we have already constructed \(M_{iL}=(Q_{iL},{{\bar{q}}}_{iL},\delta _{iL})\) and \(M_{iR}=(Q_{iR},{{\bar{q}}}_{iR},\delta _{iR})\) for the pair of elementary membranes labeled by iLiR for some \(1\le i\le n\), we construct \(M_i=(R_i,{{\bar{r}}}_i,\delta _i)\) to represent the (non-dynamical) rule corresponding to this pair of membranes with

  • \(R_i=\{{{\bar{r}}}_i\}=\{({{\bar{q}}}_{iL},{{\bar{q}}}_{iR})\}\) where \({{\bar{q}}}_{iL}=(w_{iL},\emptyset ), {{\bar{q}}}_{iR}=(w_{iR},\emptyset )\), and

  • \(\delta _i:R_i\rightarrow 2^{R_i}\) such that \(\delta _i({{\bar{r}}}_i)=\emptyset\).

We also say that (using the above notation) \({{\bar{r}}}_i\) corresponds to the rule \(w_{iL}\rightarrow w_{iR}\).

(3) If the elementary membranes that are directly enclosed by the non-elementary membrane (their parent membrane) with label h are labeled by \(i_1L,i_1R,\ldots , i_kL,i_kR\), and we have already constructed \(M_{i_1},\ldots , M_{i_k}\) with \(M_{i_j}=(R_{i_j},{{\bar{r}}}_{i_j},\delta _{i_j})\) for all the pairs \(i_jL,i_jR,\ 1\le j\le k\), then we construct the representation \(M_h\) in two steps.

(3.1) We first construct \(M_{i_1\ldots i_k}=(R_{i_1\ldots i_k},{{\bar{r}}}_{i_1\ldots i_k},\delta _{i_1\ldots i_k})\) with

  • \(R_{i_1\ldots i_k}=\{{{\bar{r}}}_{i_1\ldots i_k}\}=\{({{\bar{r}}}_{i_1}, \ldots ,{{\bar{r}}}_{i_k})\}\), and

  • \(\delta _{i_1\ldots i_k}:R_{i_1\ldots i_k}\rightarrow 2^{R_{i_1\ldots i_k}}\) such that \(\delta _{i_1\ldots i_k}(r_{i_1\ldots i_k})=\emptyset\).

We say that \({{\bar{r}}}_{i_1\ldots i_k}\) corresponds to the set of rules \(\{w_{i_1L}\rightarrow w_{i_1R},\ldots , w_{i_kL}\rightarrow w_{i_kR}\}\).

(3.2) Given \(M_{i_1\ldots i_k}\) and the initial multiset \(w_h\), we can construct \(M_h=(Q_h,{{\bar{q}}}_h,\delta _h)\) as

  • \(Q_h= \sigma ^*_{0,h}(w_h)\times \{{{\bar{r}}}_{i_1\ldots i_k}\}\), the direct product of the possible contents of region h and the representation of the set of rules corresponding the pairs of (elementary) regions \(i_jL,i_jR,\ 1\le j\le k\),

  • \({{\bar{q}}}_h=(w_h,{{\bar{r}}}_{i_1\ldots i_k})\), the pair of the initial contents and representation of the set of rules associated to the region, and

  • \(\delta _h:Q_h\rightarrow 2^{Q_h}\) such that \((u'_h,{{\bar{r}}}_{i_1\ldots i_k})\in \delta _h(u_h,{{\bar{r}}}_{i_1\ldots i_k})\) if and only if

    • the multiset \(u_h'\) can be obtained from \(u_h\) by the maximally parallel application of the set of rules \(\{r_{i_1},\ldots ,r_{i_k}\}\) corresponding to \({{\bar{r}}}_{i_1\ldots i_k}\), denoted as \(u_h\Rightarrow _{\{r_{i_1},\ldots , r_{i_k}\}} u'_h\), or

    • if none of the rules corresponding to \({{\bar{r}}}_{i_1\ldots i_k}\) are applicable to \(u_h\), then the state \((u_h,{{\bar{r}}}_{i_1\ldots i_k})\) is a halting state in \(M_h\), \(\delta _h(u_h,{{\bar{r}}}_{i_1\ldots i_k})=\emptyset\).

Now we repeat the above procedure also for the non-elementary membranes as follows:

(4) If we have already constructed \(M_{iL}=(Q_{iL},{{\bar{q}}}_{iL},\delta _{iL})\) and \(M_{iR}=(Q_{iR},{{\bar{q}}}_{iR},\delta _{iR})\) for the pair of (not necessarily elementary) membranes labeled by iLiR for some \(1\le i\le n\), we construct \(M_i=(R_i,{{\bar{r}}}_i,\delta _i)\) to represent the dynamical rule corresponding to this pair of membranes. Let

  • \(R_i=Q_{iL}\times Q_{iR}\),

  • \({{\bar{r}}}_i=({{\bar{q}}}_{iL},{{\bar{q}}}_{iR})\), and

  • \(\delta _i:R_i\rightarrow 2^{R_i}\) such that \((q_{iL}',q_{iR}')\in \delta _i(q_{iL},q_{iR})\), if and only if

    • \(q_{iL}'\in \delta _{iL}(q_{iL})\) and \(q_{iR}'\in \delta _{iR}(q_{iR})\), or

    • if \(\delta _{iL}(q_{iL})=\emptyset\) and \(q_{iR}'\in \delta _{iR}(q_{iR})\) (or if \(\delta _{iR}(q_{iR})=\emptyset\) and \(q_{iL}'\in \delta _{iL}(q_{iL})\)) then \(q_{iL}'=q_{iL}\) (or \(q_{iR}'=q_{iR}\), respectively), or

    \(\delta _i(q_{iL},q_{iR})=\emptyset\), if and only if and \(\delta _{iL}(q_{iL})=\delta _{iR}(q_{iR})=\emptyset\).

(5) If the membranes that are directly enclosed by the non-elementary membrane (their parent membrane) with label h are labeled by \(i_1L,i_1R,\ldots , i_kL,i_kR\), and we have already constructed \(M_{i_1},\ldots , M_{i_k}\) \(M_{i_j}=(R_{i_j},{{\bar{r}}}_{i_j},\delta _{i_j})\) for all the pairs \(i_jL,i_jR,\ 1\le j\le k\), then we construct the representation \(M_h\) in two steps.

(5.1) We first construct \(M_{i_1\ldots i_k}=(R_{i_1\ldots i_k},{{\bar{r}}}_{i_1\ldots i_k},\delta _{i_1\ldots i_k})\) with

  • \(R_{i_1\ldots i_k}=R_{i_1}\times \ldots \times R_{i_k}\),

  • \({{\bar{r}}}_{i_1\ldots i_k}=({{\bar{r}}}_{i_1}, \ldots ,{{\bar{r}}}_{i_k})\), and

  • \(\delta _{i_1\ldots i_k}:R_{i_1\ldots i_k}\rightarrow 2^{R_{i_1\ldots i_k}}\) such that \((r_{i_1}',\ldots , r_{i_k}')\in \delta _{i_1\ldots i_k}(r_{i_1},\ldots ,r_{i_k})\), if and only if

    • \(r_{i_j}'\in \delta _{i_j}(r_{i_j})\) for all \(i_j,\ 1\le j\le k\), or

    • if \(\delta _{i_j}(r_{i_j})=\emptyset\), but there is at least one \(i_l\), such that \(\delta _{i_l}(r_{i_l})\not =\emptyset\), \(1\le j,l\le k\), then \(r'_{i_j}=r_{i_j}\), and

    \(\delta _{i_1\ldots i_k}(r_{i_1},\ldots ,r_{i_k})=\emptyset\), if and only if, \(\delta _{i_j}(r_{i_j})=\emptyset\) for all \(i_j,\ 1\le j\le k\).

(5.2) Given \(M_{i_1\ldots i_k}\) and the initial multiset \(w_h\), we can construct \(M_h=(Q_h,{{\bar{q}}}_h,\delta _h)\) as

  • \(Q_h=\sigma ^*_{0,h}(w_h)\times R_{i_1\ldots i_k}\), the direct product of the possible contents of region h and the representation of the possible k element sets of rules determined by the actual configuration of the pairs of regions \(i_jL,i_jR,\ 1\le j\le k\),

  • \({{\bar{q}}}_h=(w_h,{{\bar{r}}}_{i_1\ldots i_k})\), the pair of the initial contents and the set of rules represented by the initial configuration, and

  • \(\delta _h:Q_h\rightarrow 2^{Q_h}\) such that \((u'_h,r_{i_1\ldots i_k}')\in \delta _h(u_h,r_{i_1\ldots i_k})\) if and only if

    • the multiset \(u_h'\) can be obtained from \(u_h\) by the maximally parallel application of the set of rules of \(\{r_{i_1},\ldots ,r_{i_k}\}\) corresponding to \(r_{i_1\ldots i_k}\) denoted as \(u_h\Rightarrow _{\{r_{i_1},\ldots ,r_{i_k}\}} u'_h\), and

    • \(r'_{i_1\ldots i_k}\in \delta _{i_1\ldots i_k}(r_{i_1\ldots i_k})\), or if \(\delta _{i_1\ldots i_k}(r_{i_1\ldots i_k})=\emptyset\), then \(r'_{i_1\ldots i_k}=r_{i_1\ldots i_k}\), or

    • if \(r'_{i_1\ldots i_k}\in \delta _{i_1\ldots i_k}(r_{i_1\ldots i_k})\), but none of the rules \(\{r_{i_1},\ldots ,r_{i_k}\}\) corresponding to \(r_{i_1\ldots i_k}\) are applicable to \(u_h\), then \(u_h'=u_h\).

    If none of the cases above holds, that is, none of the rules corresponding to \(r_{i_1\ldots i_k}\) is applicable to \(u_h\), and \(\delta _{i_1\ldots i_k}(r_{i_1\ldots i_k})=\emptyset\), then \(\delta _h(u_h,r_{i_1\ldots i_k})=\emptyset\), thus, the state \((u_h,r_{i_1\ldots i_k})\) is a halting state in \(M_h\).

Based on the above steps, we can construct a finite transition system \(M_h\) for each FIN-representable region h, such that the states of \(M_h\) correspond to the possible pairs of contents and collections of applicable rules, and the state sequences of \(M_h\) correspond to the sequences of dynamically changing pairs of possible membrane contents and the corresponding rule collections.

If \(\Pi =(O,T,\mu ,w_s,\langle w_{1L}, w_{1R}\rangle ,\ldots , \langle w_{nL},w_{nR}\rangle , s)\) with \(1L,1R,\ldots ,lL,lR\), \(l\le n\) being the labels of those regions which are directly enclosed in the skin membrane, and we let \(M_\Pi =M_{1\ldots l}\), then the states of \(M_\Pi\) represent the dynamically changing collections of rules applicable in the skin region which can change as allowed by the possible transitions of \(M_\Pi\). In short, \(M_\Pi\) represents the rule configurations of \(\Pi\). \(\square\)

Example 4

Let us construct the representations of finitely representable membranes \(M_{\Pi _3}=M_1\) for the P system of Example 3. Starting with the elementary membranes, we get \(M_{2L}=(\{(a,\emptyset )\},(a,\emptyset ),\delta _{2L})\), \(M_{2R}=(\{(c,\emptyset )\},(c,\emptyset ),\delta _{2R})\) such that \(\delta _{2L}(a,\emptyset )=\delta _{2R}(c,\emptyset )=\emptyset\), and \(M_2=(R_2,{{\bar{r}}}_2,\delta _2)\) with \(R_2=\{(a,\emptyset )\}\times \{(c,\emptyset )\}=\{((a,\emptyset ),(c,\emptyset ))\}=\{{{\bar{r}}}_2\}\), and \(\delta _2({{\bar{r}}}_2)=\emptyset\). Similarly, we can construct \(M_i=(R_i,{{\bar{r}}}_i,\delta _i)\) for all \(i,\ 2< i\le 8\), which all have a similar structure.

Now, given the transition systems \(M_2,\ldots , M_5\) we construct \(M_{1L}\) as follows. We start with the construction of \(M_{2\ldots 5}=(R_{2\ldots 5},{{\bar{r}}}_{2\ldots 5},\delta _{2\ldots 5})\) as

  • \(R_{2\ldots 5}=\{{{\bar{r}}}_{2\ldots 5}\}\) where

  • \({{\bar{r}}}_{2\ldots 5}=({{\bar{r}}}_2,\ldots ,{{\bar{r}}}_5)\) with \({{\bar{r}}}_2=((a,\emptyset ),(c,\emptyset ))\), \({{\bar{r}}}_3=((a,\emptyset ),(b,\emptyset ))\), \({{\bar{r}}}_4=((b,\emptyset ),(a,\emptyset ))\), \({{\bar{r}}}_5=((c,\emptyset ),(d,\emptyset ))\), and

  • \(\delta _{2\ldots 5}({{\bar{r}}}_{2\ldots 5})=\emptyset\).

Note that the rule set corresponding to \({{\bar{r}}}_{2\ldots 5}\) (using the rule labels from Example 3 to denote the rules) is \(\{r_2,r_3,r_4,r_5\}=\{a\rightarrow c,a\rightarrow b, b\rightarrow a,c\rightarrow d\}\).

Now we can construct \(M_{1L}=(Q_{1L},{{\bar{q}}}_{1L},\delta _{1L})\) as follows. The set of possible states is \(Q_{1L}=\{a,b,c,d\}\times \{({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5)\}\), that is,

$$\begin{aligned} Q_{1L}=\{(a,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5)),\ (b,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5)), \\ (c,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5)), \ \ (d,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5)) \}, \end{aligned}$$

the initial state is \({{\bar{q}}}_{1L}=(a,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5))\), and the transition mapping is defined as

$$\begin{aligned} \delta _{1L}(a,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5))= & {} \{(c,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5)), (b,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5)\}, \\ \delta _{1L}(c,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5))= & {} \{(d,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5))\}, \\ \delta _{1L}(b,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5))= & {} \{(a,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5))\}, \\ \delta _{1L}(d,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5))= & {} \emptyset . \end{aligned}$$

With a similar construction, we can construct \(M_{1R}=(Q_{1R},{{\bar{q}}}_{1R},\delta _{1R})\) as

$$\begin{aligned} Q_{1R}=\{(aa,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8)),\ (bb,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8,)), \ (be,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8)), \\ \ \ (ae,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8)),\ (ee,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8))\}, \end{aligned}$$

where we use a similar notation as above with \({{\bar{r}}}_6=((a,\emptyset ),(b,\emptyset ))\), \({{\bar{r}}}_7=((b,\emptyset ),(a,\emptyset ))\), \({{\bar{r}}}_8=((a,\emptyset ),(e,\emptyset ))\), and

$$\begin{aligned} \delta _{1R}(aa,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8))= & {} \{(bb,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8)), \\{} & {} (be,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8)),(ee,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8))\}, \\ \delta _{1R}(bb,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8))= & {} \{(aa,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8))\}, \\ \delta _{1R}(be,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8))= & {} \{(ae,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8))\}, \\ \delta _{1R}(ae,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8))= & {} \{(be,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8)), (ee,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8))\}, \\ \delta _{1R}(ee,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8))= & {} \emptyset . \end{aligned}$$

Now, given \(M_{1L}\) and \(M_{1R}\) we can construct \(M_1=M_{\Pi _3}\) as \(M_1=(R_1, {{\bar{r}}}_1,\delta _1)\) where

$$\begin{aligned} R_1=Q_{1L}\times Q_{1R}, \end{aligned}$$

is the set of states, and \({{\bar{r}}}_1=((a,\ ({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5) ), (aa,\ ({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8) ))\) is the initial state corresponding to the rule \(a\rightarrow aa\).

If we denote \(({{\bar{r}}}_2,{{\bar{r}}}_3,{{\bar{r}}}_4,{{\bar{r}}}_5)\) and \(({{\bar{r}}}_6,{{\bar{r}}}_7,{{\bar{r}}}_8)\) as \({{\bar{r}}}_{2\ldots 5}\) and \({{\bar{r}}}_{6\ldots 8}\), respectively, then the transition relation is defined as follows.

$$\begin{aligned}{} & {} \delta _1((a, {{\bar{r}}}_{2\ldots 5}),(aa, ({{\bar{r}}}_{6\ldots 8})) =\{((b,{{\bar{r}}}_{2\ldots 5}),(bb, ({{\bar{r}}}_{6\ldots 8})),\ \\{} & {} ((b,{{\bar{r}}}_{2\ldots 5}),(be, ({{\bar{r}}}_{6\ldots 8})), \\{} & {} \ \ ((b,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8})),\ ((c,{{\bar{r}}}_{2\ldots 5}),(bb, ({{\bar{r}}}_{6\ldots 8})), \\{} & {} \ \ ((c,{{\bar{r}}}_{2\ldots 5}),(be, ({{\bar{r}}}_{6\ldots 8})),\ ((c,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((b,{{\bar{r}}}_{2\ldots 5}),(bb, ({{\bar{r}}}_{6\ldots 8}))=\{((a,{{\bar{r}}}_{2\ldots 5}),(aa, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((b,{{\bar{r}}}_{2\ldots 5}),(be, ({{\bar{r}}}_{6\ldots 8}))=\{((a,{{\bar{r}}}_{2\ldots 5}),(ae, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((b,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8}))=\{((a,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((c,{{\bar{r}}}_{2\ldots 5}),(bb, ({{\bar{r}}}_{6\ldots 8}))=\{((d,{{\bar{r}}}_{2\ldots 5}),(aa, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((c,{{\bar{r}}}_{2\ldots 5}),(be, ({{\bar{r}}}_{6\ldots 8}))=\{((d,{{\bar{r}}}_{2\ldots 5}),ae)\}, \\{} & {} \delta _1((c,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8}))=\{((d,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((a, {{\bar{r}}}_{2\ldots 5}),(ae, ({{\bar{r}}}_{6\ldots 8}))=\{((c,{{\bar{r}}}_{2\ldots 5}),(be, ({{\bar{r}}}_{6\ldots 8})),\\{} & {} ((c,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8})), \\{} & {} \ \ ((b,{{\bar{r}}}_{2\ldots 5}), (be, ({{\bar{r}}}_{6\ldots 8})),\ ((b,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((a, {{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8}))=\{((c,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8})),\ \\{} & {} ((b,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((d,{{\bar{r}}}_{2\ldots 5}),(aa, ({{\bar{r}}}_{6\ldots 8}))=\{((d,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8})),\ \\{} & {} ((d,{{\bar{r}}}_{2\ldots 5}),(be, ({{\bar{r}}}_{6\ldots 8})), \\{} & {} \ \ ((d,{{\bar{r}}}_{2\ldots 5}),(bb, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((d,{{\bar{r}}}_{2\ldots 5}),(ae, ({{\bar{r}}}_{6\ldots 8}))=\{((d,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8})),\ \\{} & {} ((d,{{\bar{r}}}_{2\ldots 5}),(be, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((d,{{\bar{r}}}_{2\ldots 5}),(bb, ({{\bar{r}}}_{6\ldots 8}))=\{((d,{{\bar{r}}}_{2\ldots 5}),(aa, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((d,{{\bar{r}}}_{2\ldots 5}),(be, ({{\bar{r}}}_{6\ldots 8}))=\{((d,{{\bar{r}}}_{2\ldots 5}),(ae, ({{\bar{r}}}_{6\ldots 8}))\}, \\{} & {} \delta _1((d,{{\bar{r}}}_{2\ldots 5}),(ee, ({{\bar{r}}}_{6\ldots 8}))=\emptyset . \end{aligned}$$

We can now prove the following theorem.

Theorem 3

\({\mathcal {L}}(OP(polym,ncoo,fin))\subseteq PsET0L\).

Proof

Let \(\Pi =(O,T,\mu ,w_s,\langle w_{1L}, w_{1R}\rangle ,\ldots , \langle w_{nL},w_{nR}\rangle , s)\) be a polymorphic P system, \(\Pi \in OP(polym,ncoo,fin)\), and let us assume (without loss of generality) that the membranes that are directly contained in the skin region are labeled by the labels \(1L,1R,\ldots ,kL,kR\), \(k\le n\). Since both the left- and right-hand membranes \(iL,iR,\ 1\le i\le k\), are FIN-representable, we can construct the transition system \(M_\Pi =(R_{\Pi },{{\bar{r}}}_{\Pi },\delta _{\Pi })=M_{1\ldots k}=(R_{1\ldots k},{{\bar{r}}}_{1\ldots k},\delta _{1\ldots k})\) as described in the proof of Lemma 2. For any \(q=(r_1,\ldots ,r_k)\in R_\Pi\), let us denote the set of rules corresponding to \((r_1,\ldots ,r_k)\) by rules(q).

Now, based on \(M_\Pi\), we construct an ET0L system \(G=(V,T,U,w)\), where V is the alphabet, T is the terminal alphabet with \(T \subseteq V\), w is the initial string, and U is a set of tables, \(U=\{P_q\mid q\in R_\Pi \}\cup \{P_{{\underline{q}}}, P_{{\underline{q}}, halt}\mid q\in R_\Pi \text{ is } \text{ a } \text{ halting } \text{ state }\}\cup \{P_{halt}\}\) containing at most three tables for each state of \(M_\Pi\) and one additional table.

The ET0L system G is defined as follows:

$$\begin{aligned} V= & {} \{a'\mid a\in O\} \cup \{D_{q},D_{{\underline{q}}},D_{\underline{q},halt} \mid q \in R_\Pi \} \cup \{F, D_{halt}\} \cup T. \end{aligned}$$

Given a state \(q\in R_\Pi\), let us denote for a rule \(r:u\rightarrow v\in rules(q)\) by \(r':u'\rightarrow v'\) the rule \(h(u)\rightarrow h(v)\) where if \(w=a_1\ldots a_t\), \(a_i\in O,\ 1\le i\le t\), then \(h(w)=h(a_1)\ldots h(a_t)\) for \(h(a)=a'\in V\).

The axiom is given as

$$\begin{aligned} w= & {} D_{{\overline{r}}_\Pi }w_s', \end{aligned}$$

where \(w_s'=h(w_s)\), the primed version of a string corresponding the initial contents of the skin region of \(\Pi\).

We construct a table \(P_q\) for each state \(q\in R_\Pi\) as

$$\begin{aligned} P_q= & {} \{r'\mid r\in rules(q)\}\cup \{ D_q\rightarrow D_{{s}} \mid {s} \in \delta _{\Pi }(q)\} \cup \\{} & {} \{D_q \rightarrow D_{\underline{q}} \mid \delta _\Pi (q)=\emptyset \} \cup \\{} & {} \{D_z \rightarrow F\mid D_z \ne D_q\}. \end{aligned}$$

Note that the rules \(D_q \rightarrow D_{\underline{q}}\) can be applied when q is a halting state. The rule \(D_z \rightarrow F\) ensures that the table is only applied when the computation is in the appropriate state, since the symbol F functions as a trap: if the rule \(D_z \rightarrow F\) is applied during the computation, the system will never produce a terminal string.

Note also that for each object x that does not have a rule above, we assume that \(x \rightarrow x\) is present in each table.

It must be checked that the table belonging to the halting state can only be used in the appropriate step. In order to achieve this, it is necessary to introduce new tables for each \(q\in R_\Pi\), which can only be used if q is a halting state. For each halting state q, we construct the tables \(P_{\underline{q}}\) and \(P_{\underline{q},halt}\) as follows. Let

$$\begin{aligned} P_{\underline{q}}= & {} \{ r'\mid r\in rules(q)\} \cup \{ D_{\underline{q}} \rightarrow D_{\underline{q}}, D_{\underline{q}} \rightarrow D_{\underline{q}, halt} \}\cup \\{} & {} \{D_x \rightarrow F\mid D_x \ne D_{\underline{q}}\}. \end{aligned}$$

Since \(q\in R_\Pi\) is a halting state, the rule configuration represented by q does not change in the P system \(\Pi\) any more during the computation. Thus, \(\Pi\) reaches a halting state, if and only if the rules represented by \(\underline{q}\) are not applicable in the skin membrane. G guesses that this is the case by introducing the symbol \(D_{{\underline{q}}, halt}\). After applying the rule \(D_{\underline{q}} \rightarrow D_{\underline{q}, halt}\), the table \(P_{\underline{q}, halt}\) makes sure that the current rules are not applicable by introducing trap symbols if any of them are. This is achieved by

$$\begin{aligned} P_{\underline{q},halt}= & {} \{u' \rightarrow F \mid u\rightarrow v\in rules(q)\} \cup \\{} & {} \{ D_{\underline{q}, halt} \rightarrow D_{halt}\}\cup \\{} & {} \{ D_x \rightarrow F \mid D_x \ne D_{\underline{q}, halt} \}. \end{aligned}$$

In the case of the corresponding configuration of \(\Pi\) being a non-halting configuration, the use of this table causes all rewritable symbols to be rewritten to F and the computation will not produce any result.

In the case of a proper halting configuration (if the symbol F is not introduced), an additional table, table \(P_{halt}\) must be used. This table deletes the marker symbols and rewrites the remaining letters to terminals as follows.

$$\begin{aligned} P_{halt}= & {} \{ X \rightarrow \lambda \mid X \in O\setminus \{a'\mid a\in T\} \} \cup \\{} & {} \{ a' \rightarrow a \mid a \in T \}\cup \\{} & {} \{D_{x} \rightarrow F\mid D_x\not =D_{halt} \}. \end{aligned}$$

By the construction above, \(a_1 a_2 \ldots a_k \in L(\Pi )\) implies that \(a_1 a_2 \ldots a_k\) is an element of L(G). The other way around, we may also see that if \(a_1 a_2 \ldots a_k\) is successfully produced by G, then \(a_1 a_2 \ldots a_k\) must also be an element of \(L(\Pi )\). \(\square\)

Corollary 4

\({\mathcal {L}}(OP(polym,ncoo,fin))= PsET0L\).

Proof

By observing the proof of Theorem 1, we may see that for any ET0L system G, the right-hand regions of the P system \(\Pi \in OP^3(polym,ncoo)\) constructed to simulate G are FIN-representable. Combining this observation with Theorem 3 we obtain our statement. \(\square\)

Example 5

Consider the polymorphic P system of Example 3 which can be seen in Fig. 3. Let us construct an ET0L system \(G=(V,T,U,w)\) simulating this membrane system based on the transition system \(M_{\Pi _3}=M_1=(R_1,{{\bar{r}}}_1,\delta _1)\) from Example 4. The nonterminal alphabet of G includes O, a set of labeled symbols and trap symbol in addition, the terminals correspond to the terminal objects of the P system, and the axiom corresponds to the initial contents of the skin region and the initial rule configuration of the P system.

Recall that according to the above construction, we need the nonterminals \(D_q\), \(D_{{{\bar{q}}}}\), and \(D_{{{\bar{q}}}, halt}\) in the alphabet of the ET0L system for all states \(q\in R_1\), and for the initial state, for example, these would be written as \(D_{((a,{{\bar{r}}}_{2\ldots 5}),(aa,{{\bar{r}}}_{6\ldots 8}))}\), \(D_{\underline{((a,{{\bar{r}}}_{2\ldots 5}),(aa,{{\bar{r}}}_{6\ldots 8}))}}\), and \(D_{\underline{((a,{{\bar{r}}}_{2\ldots 5}),(aa,{{\bar{r}}}_{6\ldots 8}))}, halt}\). Since the rules corresponding to the (elementary) membranes \(2L,2R,\ldots , 8L,8R\), that is, \({{\bar{r}}}_{2\ldots 5}=({{\bar{r}}}_2,\ldots ,{{\bar{r}}}_5)\) and \({{\bar{r}}}_{6\ldots 8}=({{\bar{r}}}_6,\ldots ,{{\bar{r}}}_8)\) do not change during the computation, for the sake of simplicity, we use the symbols \(D_{a\rightarrow aa}\), \(D_{\underline{a\rightarrow aa}}\), and \(D_{\underline{a\rightarrow aa},halt}\), that is, \(D_{r}\), \(D_{\underline{r}}\), and \(D_{\underline{r},halt}\) for \(r\in {rules(q)}\) instead of the more general and precise notation that would be necessary for more complicated membrane structures. Thus, we have

$$\begin{aligned} V= & {} \{a,a',b,b',c,c',d,d',e,e'\}\cup \{D_{r}, D_{\underline{r}}, D_{\underline{r},halt} \mid \\{} & {} r\in rules(q),\ q\in R_1\}\cup \\{} & {} \{D_{halt}, F\}, \\ T= & {} \{a,b,c,d,e\}, \\ w= & {} D_{a\rightarrow aa}a'. \end{aligned}$$

We start by constructing the first table which contains the current instance of the rule associated to the skin membrane, that is, the rule corresponding to \({{\bar{r}}}_1\), the relabeling rules, and additional rules for identical rewriting of the other symbols (because ET0L systems rewrite every symbol at every step) which we do not indicate in the tables below, for the sake of brevity.

Fig. 5
figure 5

The graph structure representing the order in which the tables constructed in Example 4 can be applied after each other. The labels denote the states of \(M_{\Pi _3}\) and the corresponding rules

The construction of the relabeling rules is based on the number of different configurations that can be obtained after the next computational step. Since there are six possible configurations that the P system can reach in the first step, the symbol \(D_{a\rightarrow aa}\) can be relabeled in six ways, either to \(D_{b \rightarrow bb}\), \(D_{c \rightarrow bb}\), \(D_{b \rightarrow be}\), \(D_{c \rightarrow be}\), \(D_{b \rightarrow ee}\), or \(D_{c \rightarrow ee}\).

$$\begin{aligned} P_{{{\bar{r}}}_1}= & {} \{D_{a \rightarrow aa} \rightarrow D_{\alpha \rightarrow \beta } \mid \alpha \in \{b,c\}, \beta \in \{bb, be, ee\}\}\cup \\{} & {} \{D_z \rightarrow F\mid D_z \ne D_{a \rightarrow aa}\} \cup \{ a' \rightarrow a'a'\}. \end{aligned}$$

Based on similar considerations, we construct tables for each non-halting state \(q\in R_1\).

$$\begin{aligned} P_{q}= & {} \{D_{r} \rightarrow D_{r'}, D_z\rightarrow F \mid r\in rules(q), r'\in rules(q') \text{ for } \\{} & {} q' \in \delta _1(q), z\not = {r}\} \cup \\{} & {} \{\alpha ' \rightarrow \beta ' \mid \alpha \rightarrow \beta \in rules(q)\}. \end{aligned}$$

As \(q_{11}\) with \(d\rightarrow ee\in rules(q_{11})\) is a halting state of \(M_1\), we have

$$\begin{aligned} P_{{d\rightarrow ee}}= & {} \{D_{{d\rightarrow ee}} \rightarrow D_{\underline{d\rightarrow ee}}, D_z\rightarrow F \mid z\not ={d\rightarrow ee}\}\cup \\{} & {} \{d' \rightarrow e'e' \}, \\ P_{\underline{d\rightarrow ee}}= & {} \{D_{\underline{d\rightarrow ee}} \rightarrow D_{\underline{d\rightarrow ee}}, D_{\underline{d\rightarrow ee}} \rightarrow D_{\underline{d\rightarrow ee},halt},\\{} & {} D_z\rightarrow F \mid z\not ={\underline{d\rightarrow ee}}\} \cup \\{} & {} \{d' \rightarrow e'e' \}, \\ P_{\underline{d\rightarrow ee},halt}= & {} \{D_{\underline{d\rightarrow ee},halt} \rightarrow D_{halt}, D_z\rightarrow F \mid z\not ={\underline{d\rightarrow ee},halt}\} \cup \\ & \{d'\rightarrow F\}, \end{aligned}$$

and finally

$$\begin{aligned} P_{halt}= & {} \{D_{halt} \rightarrow \lambda , D_z\rightarrow F \mid z\not ={halt}\} \cup \\{} & {} \{x'\rightarrow x\mid x\in \{a,b,c,d,e\} \}. \end{aligned}$$

Figure 5 shows a graph which is based on the order in which the application of the tables constructed above can be applied.

5 Conclusion

We have shown how ET0L systems can be simulated by restricted variants of non-cooperative polymorphic P system of depth three, then showed that the simulation also works the other way around, even if the depth of the simulated P systems is not limited, but the regions are finitely representable. Thus, a precise characterization of Parikh sets of ET0L languages can be obtained in term of polymorphic P systems. Our work is intended to be an initial step in the investigation of the computing power of non-cooperative polymorphic systems with limited depth or FIN-representable regions.