1 Introduction

Membrane systems were introduced in [11] as a multiset-rewriting model of computing inspired by the structure of cells and the way they function. Among the basic features of the original model are the hierarchical arrangement of the membranes and the parallel evolution of the objects contained in the membrane compartments. Usually a result is obtained if the computation halts, i.e., if no rule is applicable any more.

In this paper, we consider an additional feature also inspired by biology, namely the limited capacity of cells to include objects—in total or of a specific kind. When the number of cells is not bounded as in P systems with active membranes, this biological feature of limited capacity can be implemented by keeping the number of objects in every cell below a given fixed bound. On the other hand, in the standard hierarchical model with a static number of cells, or, even if we allowed membrane dissolution, with a fixed upper bound for the number of cells, we can only limit the number of specific objects and have to allow an unbounded number of other objects when aiming at non-trivial theoretical results.

When the number of cells is not bounded because of using membrane creation and/or membrane division (together with membrane dissolution), the number of objects in one cell/membrane can even be restricted to one, still allowing for obtaining computational completeness, thereby counting the number of membranes/cells instead of the number of objects in an output membrane/cell; for example, see [1, 3, 6].

In this paper, we investigate P systems limiting the number of (specific) objects to be contained in a membrane region and two different semantics of how to treat the situation when the application of a (multiset of) rule(s) would violate this limiting condition, either aborting or blocking computations which try to apply a multiset of rules leading to a violation of the limited capacity conditions. For the first variant, we show that it allows for real-time simulations of partially blind register machines, while the other variant allows for obtaining computational completeness.

The development of the fascinating area of membrane computing during the last 2 decades is documented in two textbooks, see [12] and [13]. For actual information, see the P systems webpage [15] and the issues of the Bulletin of the International Membrane Computing Society and of the Journal of Membrane Computing.

2 Definitions

For an alphabet V, by \(V^{*}\), we denote the free monoid generated by V under the operation of concatenation, i.e., containing all possible strings over V. The empty string is denoted by \(\lambda\). For any string w over V, |w| denotes the total number of symbols in w (also called the length of w), and for any \(a\in V\), \(|w|_a\) denotes the number of symbols a in w.

A multiset M with underlying set A is a pair (Af) where \(f:\,A\rightarrow {\mathbb {N}}\) is a mapping. For a multiset \(M=(A,f)\), its support is defined as \(supp(M)=\{x\in A \,|\,f(x)> 0\}\). A multiset M is called empty or finite if its support is the empty set or a finite set, respectively. If \(M=(A,f)\) is a finite multiset over A such that \(supp(M)=\{ a_1,\ldots ,a_k\}\), then it can also be represented by the string \(a_1^{f(a_1)} \dots a_k^{f(a_k)}\) over the alphabet \(\{ a_1,\ldots ,a_k\}\), and, moreover, all permutations of this string precisely identify the same multiset M. For any multiset M over V, |M| denotes the total number of symbols in M, and for any \(a\in V\), \(|M|_a\) denotes the number of symbols a in M.

For further notions and results in formal language theory, we refer to textbooks like [7] and [14].

2.1 Register machines

Register machines are well-known universal devices for computing (or generating or accepting) sets of vectors of natural numbers.

Definition 1

A register machine is a construct

$$\begin{aligned} M=\left( m,B,l_{0},l_{h},P\right) \end{aligned}$$

where

  • m is the number of registers,

  • P is the set of instructions bijectively labeled by elements of B,

  • \(l_{0}\in B\) is the initial label, and

  • \(l_{h}\in B\) is the final label.

The instructions of M can be of the following forms:

  • \(p:\left( \textit{ADD}\left( r\right) ,q,s\right)\), with \(p\in B\setminus \left\{ l_{h}\right\}\), \(q,s\in B\), \(1\le r\le m\).

    Increase the value of register r by one, and non-deterministically jump to instruction q or s.

  • \(p:\left( \textit{SUB}\left( r\right) ,q,s\right)\), with \(p\in B\setminus \left\{ l_{h}\right\}\), \(q,s\in B\), \(1\le r\le m\).

    If the value of register r is not zero then decrease the value of register r by one (decrement case) and jump to instruction q, otherwise jump to instruction s (zero-test case).

  • \(l_{h}:\)HALT.

    Stop the execution of the register machine.

A configuration of a register machine is described by the contents of each register and by the value of the current label, which indicates the next instruction to be executed. M is called deterministic if the ADD-instructions all are of the form \(p:\left( \mathrm{\textit{ADD}}\left( r\right) ,q\right)\).

In the accepting case, a computation starts with the input of an l-vector of natural numbers in its first l registers and by executing the first instruction of P (labeled with \(l_{0}\)); it terminates with reaching the HALT-instruction. Without loss of generality, we may assume all registers to be empty at the end of the computation.

In the generating case, a computation starts with all registers being empty and by executing the first instruction of P (labeled with \(l_{0}\)); it terminates with reaching the HALT-instruction and the output of a k-vector of natural numbers in its last k registers. Without loss of generality, we may assume all registers except the last k output registers to be empty at the end of the computation.

In the computing case, a computation starts with the input of an l-vector of natural numbers in its first l registers and by executing the first instruction of P (labeled with \(l_{0}\)); it terminates with reaching the HALT-instruction and the output of a k-vector of natural numbers in its last k registers. Without loss of generality, we may assume all registers except the last k output registers to be empty at the end of the computation.

For useful results on the computational power of register machines, we refer to [10]; for example, for proving computational completeness results for specific variants of P systems, usually the following formulations of results for register machines generating or accepting recursively enumerable sets of vectors of natural numbers with k components or computing partial recursive relations on vectors of natural numbers are helpful:

Proposition 1

Deterministic register machines can accept any recursively enumerable set of vectors of natural numbers with l components using precisely \(l+2\) registers. Without loss of generality, we may assume that at the end of an accepting computation all registers are empty.

Proposition 2

Register machines can generate any recursively enumerable set of vectors of natural numbers with k components using precisely \(k+2\) registers. Without loss of generality, we may assume that at the end of an accepting computation the first two registers are empty, and, moreover, on the output registers, i.e., the last k registers, no \(\textit{SUB}\)-instruction is ever used.

Proposition 3

Register machines can compute any partial recursive relation on vectors of natural numbers with l components as input and vectors of natural numbers with k components as output using precisely \(l+2+k\) registers, where without loss of generality, we may assume that at the end of a successful computation the first \(l+2\) registers are empty, and, moreover, on the output registers, i.e., the last k registers, no \(\textit{SUB}\)-instruction is ever used.

In all cases it is essential that the output registers never need to be decremented.

2.2 Partially blind register machines

We now consider one-way nondeterministic machines which have registers allowed to hold positive or negative integers and which accept by reaching the HALT-instruction with all registers being zero. Such machines are called blind if their actions depend on state and input alone and not on the register configuration. They are called partially blind if they block when any register is negative (i.e., only non-negative register contents is allowed) but do not know whether or not any of the registers contains zero.

Definition 2

A partially blind register machine (PBRM) is a construct

$$\begin{aligned} M=\left( m,B,l_{0},l_{h},P\right) \end{aligned}$$

where

  • m is the number of registers,

  • P is the set of instructions bijectively labeled by elements of B,

  • \(l_{0}\in B\) is the initial label, and

  • \(l_{h}\in B\) is the final label.

The instructions of M can be of the following forms:

  • \(p:\left( \mathrm{\textit{ADD}}\left( r\right) ,q,s\right)\), with \(p\in B\setminus \left\{ l_{h}\right\}\), \(q,s\in B\), \(1\le r\le m\).

    Increase the value of register r by one, and non-deterministically jump to instruction q or s.

  • \(p:\left( \mathrm{\textit{SUB}}\left( r\right) ,q\right)\), with \(p\in B\setminus \left\{ l_{h}\right\}\), \(q\in B\), \(1\le r\le m\).

    If the value of register r is not zero then decrease the value of register r by one and jump to instruction q, otherwise abort the computation.

  • \(l_{h}:\)HALT.

    Stop the execution of the register machine.

Again, a configuration of a partially blind register machine is described by the contents of each register and by the value of the current label, which indicates the next instruction to be executed.

A computation works as for a register machine, yet with the restriction that a computation is aborted if one tries to decrement a register which is zero. Moreover, computing, accepting or generating now also requires all registers (except output registers) to be empty at the end of the computation.

2.3 P systems

The standard model of hierarchical P systems can be defined as follows, for example, see [13] for several variants:

Definition 3

A (hierarchical) P system of degree \(m\ge 1\) is a construct

$$\begin{aligned} \varPi =(O,\mu ,w_1,\ldots ,w_{m},R_1,\ldots ,R_{m},i_{0}) \end{aligned}$$

where

  • O is the alphabet of objects;

  • \(\mu\) is a membrane structure of degree m with membranes labeled in a one-to-one manner with the natural numbers \(1,\ldots ,m\);

  • \(w_1,\ldots ,w_{m}\in O^*\) are the multisets of objects initially present in the m regions of \(\mu\);

  • \(R_{i}\), \(1\le i\le m\), are finite sets of evolution rules over O associated with the regions \(1,2,\ldots ,m\) of \(\mu\); these evolution rules are of the forms \(u\rightarrow v\) where u is a multiset over O and v is a string from \((O \times \{ here,out,in\})^*\);

  • \(i_{0}\in \{0,1,\ldots ,m\}\) indicates the output region of \(\varPi\).

The membrane structure and the multisets in \(\varPi\) constitute a configuration of the P system; the initial configuration is given by the initial multisets \(w_1,\ldots ,w_{m}\). A transition between configurations is governed by the application of the evolution rules, which is done in the maximally parallel way, i.e., only applicable multisets of rules which cannot be extended by further rules are to be applied to the objects in all membrane regions.

The application of a rule \(u\rightarrow v\) in a region containing a multiset M results in subtracting from M the multiset identified by u, and then in adding the multiset identified by v. The objects can eventually be transported through membranes using the targets in and out.

The P system continues with applying multisets of rules in the maximally parallel way until there remain no applicable rules in any region of \(\varPi\). Then, the system halts. We consider the number of objects from O contained in the output region \(i_{0}\) at the moment when the system halts as the result of the underlying computation of \(\varPi\). The set of results of all computations possible in \(\varPi\) is called the set of natural numbers generated by \(\varPi\) and it is denoted by \(N(\varPi )\) if we only count the total number of objects in the output membrane; if we distinguish between the multiplicities of different objects, we obtain a set of vectors of natural numbers denoted by \(Ps(\varPi )\). We refer to [13] for further details and examples.

A special variant of P systems uses so-called catalysts, which are objects which allow other objects to evolve, but never evolve themselves.

Definition 4

A catalytic P system of degree \(m\ge 1\) is a construct

$$\begin{aligned} \varPi =(O,C,\mu ,w_1,\ldots ,w_{m},R_1,\ldots ,R_{m},i_{0}), \end{aligned}$$

where \(C\subseteq O\) is the alphabet of catalysts; the evolution rules are of the forms \(ca\rightarrow cv\) or \(a\rightarrow v\), where c is a catalyst, a is an object from \(O\setminus C\), and v is a string from \(((O\setminus C) \times \{ here,out,in\})^*\); the other ingredients are defined as for hierarchical P systems in Definition 3. A catalytic P system is called purely catalytic if all rules are catalytic ones.

Since the beginning, the question how many catalysts are needed in catalytic and purely catalytic P systems for obtaining computational completeness has been a challenging theoretical question. The following result was shown in [9], establishing a lower bound for the computational power of catalytic P systems with only one catalyst:

Proposition 4

([9]) Catalytic P systems with only one catalyst have at least the computational power of partially blind register machines.

Example 1

In [9], it was shown that the vector set

$$\begin{aligned} S=\left\{ \left( n,m\right) \mid 0\le n, n\le m\le 2^n\right\} \end{aligned}$$

(which is not semi-linear) can be generated by some (even extended version of a) PBRM and, therefore, by a P system with only one catalyst and 19 rules.

As already shown in [8], register machines with \(n\ge 2\) decrementable registers can be simulated by catalytic P systems with n catalysts and by purely catalytic P systems with \(n+1\) catalysts. Hence, both catalytic P systems and purely catalytic P systems are computationally complete.

3 Limited capacity

In most of the variants of P systems considered in the literature, the number of objects in a membrane region is not limited. In [4], we proposed variants in which the number of objects a membrane may contain is bounded, with the bound already being given in the definition of the system, either limiting the total number of objects in a cell or only limiting the number of specific objects in a cell, respectively. The following definitions are given as in [4].

Definition 5

A P system with per-membrane limited capacity is a construct

$$\begin{aligned} \varPi = (O, \mu , w_1, \ldots , w_n, k_1, \ldots , k_n, R_1, \ldots R_n, i_0) \end{aligned}$$

where \(k_i \in {\mathbb {N}} \cup \{\infty \}\) is the total capacity of membrane i, \(1\le i \le n\), meaning that, for \(v_i\) denoting the contents of membrane i in the current configuration, the condition \(|v_i| \le k_i\) must always be enforced, unless \(k_i = \infty\); the other components of the tuple are as in Subsection 2.3.

Definition 6

A P system with per-symbol limited capacity is a construct

$$\begin{aligned} \varPi = (O, \mu , w_1, \ldots , w_n, K_1, \ldots , K_n, R_1, \ldots R_n, i_0) \end{aligned}$$

where \(K_i : O \rightarrow {\mathbb {N}} \cup \{\infty \}\) are functions defining the per-symbol capacity of membrane i, i.e., for w denoting the union of the contents of all membranes in the system, the condition \(|w|_a \le K(a)\) therefore must be enforced at all times, for any \(a \in O\), unless \(K(a) = \infty\); the other components of the tuple are as in Sect. 2.3.

3.1 Semantics of limited capacity

What should happen if a membrane is about to exceed its capacity (total or per-symbol)? Multiple kinds of behaviors may be considered, for example, the following variants:

  1. 1.

    Blocking behavior Prohibit the application of (multisets of) rules which would produce more objects. Attempting to apply such rules blocks the system, and yields no result.

  2. 2.

    Destructive behavior Completely remove the offending membrane from the system, together with its contents.

  3. 3.

    Dissolutive behavior Dissolve the offending membrane, dumping its contents into its parent membrane; in this case, (one of) the parent membrane(s) must allow for more objects, as otherwise the whole system would be dissolved.

  4. 4.

    Separation behavior Divide the offending membrane separating its contents across the child membranes. Since every child membrane only receives a part of the contents of the parent, the capacity constraints may be satisfied.

The separation behavior may be useful for P systems with active membranes, whereas the first three behaviors may also be applied for hierarchical P systems. Yet in this paper, we will focus on P systems with per-symbol limited capacity, i.e., we limit the number of specific symbols.

Remark 1

We immediately remark that the flattening technique, which is folklore in the membrane computing community, can be applied in the case of P systems with per-symbol limited capacity. Without loss of generality, in Sect. 4 we will only consider 1-membrane systems, which can be written in a simplified version as follows with omitting the trivial membrane structure and taking the skin membrane 1 as the output membrane:

$$\begin{aligned} \begin{array}{lcl} \varPi &= & {} (O, w, K, R) \ \ \text{ and } \\ &= & {} (O, C, w, K, R) \ \ \text{ for } \text{ catalytic } \text{ P } \text{ systems }. \end{array}\end{aligned}$$

Although in this paper, we want to focus on the blocking behavior, (see variant 1 of the possible semantics of limited capacity above), there are still at least two possible semantics for the blocking behavior itself under the maximally parallel derivation mode:

  • Semantics 1 Take all the applicable multisets of rules in the maximally parallel derivation mode, but discard all those multisets which would violate the constraints.

  • Semantics 2 Take all the applicable multisets of rules in the asynchronous derivation mode, discard the multisets which would violate the constraints, and then pick the non-extendable, i.e., maximal multisets out of these applicable multisets of rules.

To illustrate the difference between these two semantics, consider the following 1-membrane system with limited capacity:

figure a

It can formally be written as

$$\begin{aligned} \varPi _{ab} = (\{a,b\}, ab, K_{ab}, \{a \rightarrow c, b \rightarrow c\}) \end{aligned}$$

where \(K_{ab}(c) = 1\) and \(K_{ab}(a) = K_{ab}(b) = \infty\).

In the case of Semantics 1, no multisets of rules not violating the constraint of limiting the capacity of symbols c in the resulting configuration would be applicable, and the P system will block/abort this computation.

On the other hand, under Semantics 2, \(\varPi _{ab}\) would be allowed to apply either \(a \rightarrow c\) or \(b \rightarrow c\), but not both.

4 Computational power

In this section, we investigate the computational power of P systems with limited per-symbol capacity: when operating with Semantics 1, they at least can simulate partially blind register machines in real time; when operating with Semantics 2, they can simulate purely catalytic P systems (and thus register machines) and therefore are computationally complete.

4.1 Semantics 1 allows for simulating a PBRM in real time

In this subsection, we will show that P systems with limited per-symbol capacity operating under Semantics 1 can simulate partially blind register machines (PBRM) in real time: an instruction of the register machine is simulated in one step of the P system. An additional cleanup procedure at the end of the computation takes 3 more steps. In comparison with the result stated in [9] showing that P systems with one catalyst can simulate partially blind register machines (without any further ingredients), we here obtain a real-time simulation, whereas the result there needs a cycle of \(n+3\) for each step of the register machine, with n being the number of decrementable registers.

Theorem 1

Catalytic P systems with one catalyst and per-symbol limited capacity operating with Semantics 1 can simulate partially blind register machines (PBRM) in real time, plus three additional cleanup steps at the end of the computation.

Proof

Consider an arbitrary partially blind register machine

$$\begin{aligned} M=\left( m,B,l_{0},l_{h},P\right) . \end{aligned}$$

The following proof is given for the most general case of a partially blind register machine computing a partial recursive relation on vectors of natural numbers with l components as input and vectors of natural numbers with k components as output as well as using n decrementable registers, no matter how many of them are the first l input registers and the working registers, respectively. Moreover, we may assume that on the output registers, i.e., the last k registers, no \(\textit{SUB}\)-instruction is ever used. On the other hand, the computation of the PBRM yields a result if and only if at the end of the computation all registers except the output registers are empty.

We now construct the P system

$$\begin{aligned} \varPi = (O, \{c\},w_0, K, R) \end{aligned}$$

with per-symbol limited capacity operating under Semantics 1 and simulating the PBRM M.

The set of objects of the construction includes register symbols \(a_r\) for representing the contents of register r, the catalyst c, and the state symbols \(p\in B\). Moreover, we use decrement witness symbols \(\lambda _{r}\) for every decrementable register r, \(1\le r \le n\), the trap symbol \(\#\) and, finally, the additional symbols \(a_0,\lambda _{0},l_{h^{\prime }}\). As we will see later, \(a_0\) can be interpreted as a register symbol for an additional decrementable register 0, which during the whole computation has the value 1, i.e., in every configuration we have exactly one copy of \(a_0\), and it is only eliminated in the final cleanup procedure.

Now let \(B_{\mathrm{\textit{SUB}}(r)}\) denote the set of labels of \(\mathrm{\textit{SUB}}\)-instructions \(p:(\mathrm{\textit{SUB}}(r), q)\) of decrementable registers r, \(B_{\mathrm{\textit{SUB}}} = \bigcup _{1\le r\le n} B_{\mathrm{\textit{SUB}}(r)}\), and \(B_{\mathrm{\textit{ADD}}}\) denote the set of labels of \(\textit{ADD}\)-instructions, i.e., \(B = B_{\mathrm{\textit{ADD}}} \cup B_{\mathrm{\textit{SUB}}}\cup \left\{ l_{h}\right\}\).

Observing that \(n=m-k\), in total, we get the following set of objects:

$$\begin{aligned} \begin{array}{lcl} O &{}=&{} \{a_r \mid 0\le r \le m \} \cup B \cup \{l_{h^{\prime }}\} \cup D \cup \{c, \# \}, \\ D &{}=&{} \{\lambda _{r} \mid 0\le r \le n\}. \end{array} \end{aligned}$$

The capacity of the symbols in D is limited to 1, while all other symbols may appear in an unlimited number of copies:

$$\begin{aligned} \begin{array}{rclll} K(\lambda _r) &{}=&{} 1, &{} \ 0\le r \le n, \\ K(x) &{}=&{} \infty , &{} \ x \in O \setminus D. \end{array} \end{aligned}$$

Moreover, let \(D_{\emptyset }\) denote the multiset containing exactly one copy of each object in D and \(D_{r}\) the multiset containing exactly one copy of each object in D except \(\lambda _{r}\).

Then, the starting configuration of the P system is defined as

$$\begin{aligned} w_0 = c\, l_0\, D_{\emptyset }\, a_0 \, \alpha _0, \end{aligned}$$

where \(\alpha _0\) is the multiset encoding the initial values of the registers.

The set of rules now is going to be described in several parts below.

First, we want all symbols in D to disappear after one step:

$$\begin{aligned} \lambda _r \rightarrow \lambda \in R \mathrm {{\ for\ all\ }} \ 0\le r \le n. \end{aligned}$$

We also include the traditional trap rule \(\# \rightarrow \# \in R\).

Increment \(p:(\mathrm{ADD}(r), q, s)\):

To simulate the ADD instruction \(p:(\mathrm{ADD}(r), q, s)\) without letting the catalyst block the system or do unwanted decrements, the catalyst is forced to process the state symbol:

$$\begin{aligned} \begin{array}{ccc} c p \rightarrow c q a_r D_{\emptyset } \quad&c p \rightarrow c s a_r D_{\emptyset } \quad&p \rightarrow \#. \end{array} \end{aligned}$$

When a label of an ADD instruction is present in the configuration, the catalyst cannot act on any of the register symbols \(a_r, \ 0\le r \le m\), because this would leave the state symbol p to be transformed to \(\#\) due to the maximally parallel derivation mode. This evolution will not violate the capacity constraints, but introducing the trap symbol will prevent the system from ever halting. Therefore, the catalyst must be used in one of the two rules simulating the increment. Incidentally, these rules also replenish the supply of the symbols from D.

Decrement \(p:(\mathrm{SUB}(r), q)\) (no zero test):

Consider the configuration \(c\, p\, D_{\emptyset } \, a_0 \, \alpha\), where \(\alpha\) is a string of register symbols describing the current contents of the registers. The following rules have to be applied in this configuration:

$$\begin{aligned} \begin{array}{cc} p \rightarrow q D_{r} \quad &{} c a_r \rightarrow c \lambda _{r}. \\ \end{array} \end{aligned}$$

All the symbols from \(D_{\emptyset }\) from the current configuration will disappear in the next configuration. The rule \(p \rightarrow q D_{r}\) will reintroduce almost all of the symbols, except for the particular \(\lambda _r\) corresponding to the register to be decremented. This allows \(c a_r \rightarrow c \lambda _r\) to be applied in the current step, because in the next configuration, there is still room for \(\lambda _r\). All catalytic rules involving a wrong \(\lambda _{r^{\prime }}\) (and therefore a wrong \(a_{r^{\prime }}\)) cannot be applied, because they would introduce a second instance of \(\lambda _{r^{\prime }}\), thus blocking the system.

Therefore, the only possible evolution from the configuration \(c\, p\, D_{\emptyset } \, a_0 \, \alpha\) is to the configuration \(c\, q\, D_{\emptyset } \, a_0 \, \beta\) where \(\beta = \alpha - a_r\). Note that if the expected register symbol \(a_r\) is not present in \(\alpha\), then there will be no non-extendable multiset of rules including the correct \(c a_r \rightarrow c \lambda _p\), because then at least the rule \(c a_0 \rightarrow c \lambda _0\) described below would become applicable, thus blocking (aborting) the computation without producing any result. This behavior corresponds to a crash in the PBRM when it tries to decrement a register which is already empty.

Final zero test, cleanup, and halting

The simulation of the decrement instruction on register r only works correctly when there are still some register symbols \(a_r\) left. Indeed, as already mentioned above, to force the computation in the P system to abort if a decrement on an empty register would be tried, we at least would have the rule \(c a_0 \rightarrow c \lambda _0\), but as long as the decrement symbol \(\lambda _0\) is re-introduced by applying a rule \(p \rightarrow q D_{r}\) simulating a decrement on register r, the computation in the P system will be forced to crash as two symbols \(\lambda _0\) are not allowed in a configuration.

On the other hand, if finally, the PBRM has reached a configuration with all decrementable registers r, \(1\le r\le n\) being empty, we have to allow for a final zero test: in this case the rule \(c a_0 \rightarrow c \lambda _0\) is welcome to be applied if we have reached the final (halting) label \(l_h\):

$$\begin{aligned} \begin{array}{ll} l_h \rightarrow l_{h^{\prime }}D_{\lambda _0}, \quad&c a_0 \rightarrow c \lambda _0 \end{array} \end{aligned}$$

The additional label \(l_{h^{\prime }}\) is used to check whether all decrementable registers are empty as required for a computation of the PBRM to be successful:

$$\begin{aligned} \begin{array}{ll} l_{h^{\prime }} \rightarrow D_{\lambda _0}, \quad &{} c a_r \rightarrow c \# \lambda _{0}, 1\le r \le n \\ \end{array} \end{aligned}$$

In this step, the catalyst is free to use one of the rules \(c a_r \rightarrow c \# \lambda _{0}\) for any non-empty register r without violating the limiting condition for \(\lambda _{0}\), hence, the trap symbol \(\#\) is introduced if and only if any of the decrementable registers is not empty.

If all decrementable registers have been empty, in the final step, the system will just erase the symbols of \(D_{\lambda _0}\), which will disappear and the system will halt with only symbols \(a_r\) for the output registers \(n+1\le r \le m\).

This final cleanup phase takes one step to erase \(a_0\), one more step to test the presence of register symbols \(a_r\), \(1\le r \le n\), and one final step to erase the last symbols of \(D_{\lambda _0}\). Hence, in a successful computation, this final phase takes three steps.

In the case of the simulation of a non-successful computation of the PBRM, there may be many more steps applying rules \(c a_r \rightarrow c \# \lambda _{0}\), possibly already in the second step, but with the trap rule \(\# \rightarrow \# \in R\) causing an infinite computation we need not take care about this situation in detail. \(\square\)

Remark 2

(Trapping by limited capacity) When following the proofs as given in [8] for simulating register machines by [purely] catalytic P systems, often rules introducing the trap symbol \(\#\) as well as the rule \(\# \rightarrow \#\) are used to guarantee an infinite computation and thus any computation introducing it to not be successful. Instead of introducing the trap symbol \(\#\) and having the rule \(\# \rightarrow \#\) to guarantee that any computation introducing \(\#\) is not successful, we can limit its capacity to 1 and use rules of the form \(u \rightarrow v\#\#\) instead of \(u \rightarrow v\#\). Alternatively, we could limit the capacity of \(\#\) to 0, meaning that even having to pick the rule \(u \rightarrow v\#\) will already block the evolution. This means that, if all non-extendable multisets of rules contain a rule of the form \(u \rightarrow v\#\), then we must discard all multisets, thereby blocking the evolution without producing any result. This blocking of computations reflects the concept of using toxic objects as introduced in [2].

Taking advantage of the idea described in Remark 2, we can get an improved version of Theorem 1:

Corollary 1

Catalytic P systems with one catalyst and per-symbol limited capacity operating with Semantics 1 can simulate partially blind register machines in real time in a deterministic way, plus three additional cleanup steps at the end of the computation.

Proof

We follow the proof of Theorem 1 also taking into account Remark 2 with using \(K(\#)=0\).

Consider an arbitrary partially blind register machine

$$\begin{aligned} M=\left( m,B,l_{0},l_{h},P\right) . \end{aligned}$$

Let n be the number of decrementable registers; let \(B_{\mathrm{\textit{SUB}}(r)}\) denote the set of labels of \(\mathrm{\textit{SUB}}\)-instruction \(p:(\mathrm{\textit{SUB}}(r), q)\) of decrementable registers r, \(1\le r\le n\), \(B_{\mathrm{\textit{SUB}}} = \bigcup _{1\le r\le n} B_{\mathrm{\textit{SUB}}(r)}\), and \(B_{\mathrm{\textit{ADD}}}\) denote the set of labels of \(\mathrm{\textit{ADD}}\)-instructions, i.e., \(B = B_{\mathrm{\textit{ADD}}} \cup B_{\mathrm{\textit{SUB}}}\cup \left\{ l_{h}\right\}\).

We now construct the P system \(\varPi\) with per-symbol limited capacity operating under Semantics 1 for simulating the PBRM M; except for K, this is the same P system as constructed in the proof of Theorem 1.

$$\begin{aligned} \begin{array}{lcl}\varPi &= & {} (O, \{c\},w_0, K, R),\\ O &= & {} \{a_r \mid 0\le r \le m \} \cup B \cup \{l_{h^{\prime }}\} \cup D \cup \{c, \# \}, \\ D&= & {} \{\lambda _{r} \mid 0\le r \le n\},\\ w_0&= & {} c\, l_0\, D_{\emptyset }\, a_0 \, \alpha _0,\\ K&= & {} \{ (\#,0) \} \cup \{(\lambda _r,1)\mid 0\le r \le n \} \\ &\cup &\{(x,\infty )\mid x\in O \setminus (D\cup \{ \# \} \},\\ R&= & {} \{ c p \rightarrow c q a_r D_{\emptyset } , c p \rightarrow c s a_r D_{\emptyset },\\ & &\ \ p \rightarrow \# \mid p:(\mathrm{ADD}(r), q, s) \in P\}\\ &\cup &\{ p \rightarrow q D_{r} \mid p:(\mathrm{SUB}(r), q) \in P \} \\ &\cup &\{ c a_r \rightarrow c \lambda _{r},\ \lambda _{r}\rightarrow \lambda \mid 0\le r \le n \}\\ &\cup & \{ l_h \rightarrow l_{h^{\prime }}D_{\lambda _0}, l_{h^{\prime }} \rightarrow D_{\lambda _0}\}\\ &\cup &\{c a_r \rightarrow c \# \lambda _{0}\mid 1\le r \le n\}. \end{array} \end{aligned}$$

\(\alpha _0\) is the multiset encoding the initial values of the registers. \(D_{\emptyset }\) and \(D_{r}\) are defined as in the proof of Theorem 1.

The P system \(\varPi\) now works as described in the proof of Theorem 1 with the difference that no rules introducing the trap symbol \(\#\) can ever be used, as this would contradict the limiting condition \(K(\# )=0\), i.e., whenever such a rule would have to be applied according to the maximally parallel derivation mode, the computation is aborted immediately without yielding a result. This means that a computation in \(\varPi\) is aborted if the computation step of the PBRM would crash the PBRM because a decrement on an empty register would be carried out, whereas every allowed decrement is simulated in a deterministic way as required. \(\square\)

4.2 Semantics 2 allows for computational completeness

In this subsection, we show that P systems with limited per-symbol capacity are computationally complete when operating with Semantics 2 without any additional ingredients, especially without needing any catalyst.

Remark 3

(Simulating catalytic rules) We first observe that when operating with Semantics 2 we can limit the parallelism of a non-cooperative rule by producing a marker symbol whose capacity is limited to one. For example, consider the rule \(p : a \rightarrow u \lambda _p\) together with the rule \(\lambda _p \rightarrow \lambda\) and the limiting condition \(K(\lambda _p) = 1\), i.e., the symbol \(\lambda _p\) may not appear in more than one copy. Then, in any multiset of rules allowed to be applied, p may appear in at most one copy. This effectively prohibits applying p more than once in any step.

Moreover, we can ensure that the rules compete for the marker symbol just as catalytic rules would compete for a catalyst. For example, consider two catalytic rules \(c a \rightarrow c u\) and \(c b \rightarrow c v\). These two rules cannot be applied at the same time, even if both a and b are present, because the catalyst is only present in a single copy. We can ensure the same mutual exclusion by having the symbol \(\lambda _c\) with the capacity limited to 1 (\(K(\lambda _c) = 1\)), and the rules \(a \rightarrow u \lambda _c\) and \(b \rightarrow v \lambda _c\).

Remark 4

(No catalysts needed) As elaborated in Remark 3, catalytic rules can be replaced by non-cooperative rules, i.e., P systems with per-symbol limited capacity operating with Semantics 2 do not need catalysts for simulating purely catalytic P systems.

All together, these observations imply the following results:

Theorem 2

P systems with per-symbol limited capacity operating with Semantics 2 without catalysts can simulate purely catalytic P systems.

Proof

Let \(\varPi = (O, C, w, K, R)\) be an arbitrary purely catalytic P system. We now construct a P system \(\varPi ^{\prime }= (O, w, K, R^{\prime })\) with per-symbol limited capacity, operating with Semantics 2, without catalysts:

$$\begin{aligned} \begin{array}{lcl} \varPi ^{\prime } &{}=&{} (O, w, K, R^{\prime }),\\ w_0 &{}=&{} l_0\, \alpha _0,\\ K &{}=&{} \{(c,1)\mid c\in C \} \cup \{(x,\infty )\mid x\in O \setminus C \},\\ R^{\prime } &{}=&{} \{ a\rightarrow cu \mid ca\rightarrow cu \in R, c\in C \}\\ &{}\cup &{} \{ c \rightarrow \lambda \mid c\in C \}. \end{array} \end{aligned}$$

\(\alpha _0\) is the multiset encoding the initial values of the registers.

In the construction of \(\varPi ^{\prime }\) the symbols \(c\in C\) now are not catalysts any more as in \(\varPi\), but guarantee the same effect by their number being limited by 1.

As described in Remark 3, any catalytic rule \(ca\rightarrow cu \in R\), \(c\in C\), can be simulated by the non-cooperative rule \(a\rightarrow cu\). The limited capacity of the symbols c guarantees that for each catalyst c at most one catalytic rule \(ca\rightarrow cu \in R\) can be simulated, but on the other hand if one of these catalytic rules can be applied, according to the maximally parallel derivation mode also in \(\varPi ^{\prime }\) one of the corresponding non-cooperative rules has to be applied. As the “catalyst symbol” c immediately vanishes in the next step, the room is free for generating it again at most once in the next derivation step in \(\varPi ^{\prime }\) again. \(\square\)

Corollary 2

P systems with per-symbol limited capacity operating with Semantics 2 without catalysts can simulate catalytic P systems.

Proof

Let \(\varPi = (O, C, w, K, R)\) be an arbitrary catalytic P system. As in the Proof of Theorem 2 we construct a P system \(\varPi ^{\prime }= (O, w, K, R^{\prime })\) with per-symbol limited capacity, operating with Semantics 2, without catalysts:

$$\begin{aligned} \begin{array}{lcl} \varPi ^{\prime } &{}=&{} (O, w, K, R^{\prime }),\\ w_0 &{}=&{} l_0\, \alpha _0,\\ K &{}=&{} \{(c,1)\mid c\in C \} \cup \{(x,\infty )\mid x\in O \setminus C \},\\ R^{\prime } &{}=&{} \{ a\rightarrow cu \mid ca\rightarrow cu \in R, c\in C \}\\ &{}\cup &{} \{ a\rightarrow u \mid a\rightarrow u \in R \}\\ &{}\cup &{} \{ c \rightarrow \lambda \mid c\in C \}. \end{array} \end{aligned}$$

In fact, we have just added the non-cooperative rules \(a\rightarrow u\) from R to \(R^{\prime }\). \(\square\)

Since catalytic as well as purely catalytic P systems are computationally complete, for example see [8], we immediately derive the following corollary.

Corollary 3

P systems with per-symbol limited capacity operating with Semantics 2 are computationally complete, even without using catalysts.

5 Conclusion

In this paper, we have introduced the idea of bounding the number of symbols that may appear in the membranes of a P system. This is a quite natural restriction to consider, given that actual biological membranes are of limited capacity, too. We defined per-membrane and per-symbol limited capacities, and defined two possible semantics for handling the overflow. We then showed that Semantics 1 allows non-cooperative P systems to simulate partially blind register machines in real time, with 3 additional cleanup steps at the end of the computation. We also showed that non-cooperative P systems operating under Semantics 2 of limited capacity directly simulate purely catalytic and catalytic P systems (in real time), yet without needing catalysts, and therefore are computationally complete.

This paper only scratches the surface of the study of P systems with limited capacity. One immediate open problem is that of computational completeness of (catalytic, purely catalytic) P systems with limited capacity operating with Semantics 1 or else characterizing the computational power of these systems.

Furthermore, Sect. 3 gives three more different behaviors which P systems may adopt when their membranes overflow. In particular, the separation and the dissolutive behaviors may even better represent the phenomena one would expect to observe in overfull membranes in biological cells.