Alternative space definitions for P systems with active membranes

The first definition of space complexity for P systems was based on a hypothetical real implementation by means of biochemical materials, and thus it assumes that every single object or membrane requires some constant physical space. This is equivalent to using a unary encoding to represent multiplicities for each object and membrane. A different approach can also be considered, having in mind an implementation of P systems in silico; in this case, the multiplicity of each object in each membrane can be stored using binary numbers, thus reducing the amount of needed space. In this paper, we give a formal definition for this alternative space complexity measure, we define the corresponding complexity classes and we compare such classes both with standard space complexity classes and with complexity classes defined in the framework of P systems considering the original definition of space.


Introduction
P systems with active membranes have been introduced in [27], considering the idea of generating new membranes through the division of existing ones. The exponential amount of resources that can be obtained in this way, in a polynomial number of computation steps, naturally leads to the definition of new complexity classes to be compared with the standard ones.
Initially, the research activity focused on the investigation of time complexity. It was proved that, to go beyond the complexity class P , the creation of new membranes is a necessary feature to gain enough computation efficiency [40], unless non-confluent systems are used [34]. In [35] it was proved that P systems with active membranes can solve all problems in the class PSPACE in polynomial time, a result which is valid also for uniform systems, as proved in [6]. Relations with the classes EXP and EXPSPACE were investigated in [33].
A series of works then defined various complexity classes characterized by P systems that make use of different features. For instance, the works [12,13] focused on the crucial role of membrane dissolution; polarizationless systems have been investigated in [4,5,11,14]; constraints on membrane division [22] or on the depth of membrane structure [16] have been the subjects of other works, while [37,38] focused on the role of cooperation.
More recently, other aspects have also been studied. In [1,25] a different kind of membrane division, called separation (since objects are separated between new membranes, rather than duplicated) is considered in the framework of P systems with active membranes; in [24] such kind of rules are applied in a different variant of P systems, having proteins on membranes. In [7,10] solutions for SAT are proposed which use different strategies than previously proposed solutions. Systems of a shallow depth are the subject of [17][18][19]. A recent survey on different strategies to approach computationally hard problems by P systems with active membranes can be found in [36].
A natural research topic that has been approached after the first works on time complexity concerns space complexity, a notion introduced for the first time in the framework of P systems in [29]. The definition was based on a hypothetical real implementation by means of biochemical materials such as cellular membranes and chemical molecules. Under this assumption, it was assumed that every single object or membrane requires some constant physical space, and this is equivalent to using a unary encoding to represent multiplicities. The relations between standard computational complexity classes and the space complexity classes defined in these terms have been studied, both when at least a linear amount of space is used [30,31], as well as when only sublinear [32] or even constant amount of space [15] is available. A recent survey concerning results obtained by considering different bounds on space can be found in [39].
When defining space complexity for P systems, a different approach can also be considered, focusing the definition of space on the simulative point of view. In fact, by considering an implementation of P systems in silico (like the ones in, e.g., [8,9]), it is not strictly necessary to store information concerning every single object: the multiplicity of each object in each membrane can be stored using binary numbers, thus reducing the amount of needed space.
In this paper, we consider this option: we introduce a formal definition for this alternative space complexity measure, we define the corresponding complexity classes and we compare such classes both with standard space complexity classes defined for Turing machines and with complexity classes defined in the framework of P systems considering the original definition of space [29]. We will give results concerning the use of a constant, polynomial or exponential amount of space, respectively, trying to understand whether or not the classes of solvable problems differ.
The paper is organized as follows. In Section 2 we recall some definitions concerning P systems with active membranes and space requirements in P systems computations. In Section 3, we introduce a different definition for measuring space (which we call binary space to underline that information concerning objects is stored in binary) and we give some results following immediately from this definition. In Section 4 we compare the new binary space complexity classes with standard complexity classes and with space complexity classes for P systems based on the standard definition of space. Finally Section 5 draws some conclusions and presents some future research topics on this subject.

Basic definitions
In this section, we shortly recall some definitions that will be useful while reading the rest of the paper. For a complete introduction to P systems, we refer the reader to The Oxford Handbook of Membrane Computing [28]. where: • is an alphabet, i.e., a finite non-empty set of symbols, usually called objects; in the following, we assume • is a finite set of labels for the membranes; • is a membrane structure (i.e., a rooted unordered tree, usually represented by nested brackets) consisting of d membranes, labelled by elements of in a one-to-one way, defining regions (the space between a membrane and all membranes immediately inside it, if any); • w h 1 , … , w h d , with h 1 , … , h d ∈ , are strings over describing the initial multisets of objects placed in the d regions of ; • R is a finite set of rules over .
Membranes are polarized, that is, they have an attribute called electrical charge, which can be neutral (0), positive (+ ) or negative (−).
A P system can make a computation step by applying its rules to modify the membrane structure and/or the membrane content. The following types of rules can be used during the computation: • Object evolution rules, of the form [a → w] h They can be applied inside a membrane labelled by h, having charge and containing at least an occurrence of the object a; the copy of the object a to which the rule is applied is rewritten into the multiset w (i.e., a is removed from the multiset in h and replaced by the objects in w).
They can be applied to a membrane labelled by h, having charge and such that the external region contains at least an occurrence of the object a; the copy of the object a to which the rule is applied is sent into h becoming b and, simultaneously, the charge of h is changed to .
They can be applied to a membrane labelled by h, having charge and containing at least an occurrence of the object a; the copy of the object a to which the rule is applied is sent out from h to the outside region becoming b and, simultaneously, the charge of h is changed to .
• Dissolution rules, of the form [a] h → b They can be applied to a membrane labelled by h, having charge and containing at least an occurrence of the object a; the copy of the object a to which the rule is applied is replaced by b, the membrane h is dissolved and its contents are left in the surrounding region.
They can be applied to a membrane labelled by h, having charge , containing at least an occurrence of the object a but having no other membrane inside (in this case the membrane is said to be elementary); the membrane is divided into two membranes having both label h and charges and , respectively; the copy of the object a to which the rule is applied is replaced, respectively, by b and c in the two new membranes, while the other objects in the initial multiset are copied to both membranes.
These rules operate just like division for elementary membranes, but they can be applied to non-elementary membranes, containing membrane substructures and having label h. Like the objects, the substructures inside the dividing membrane are replicated in the two new copies of it.
A configuration of a P system with active membranes is described by the current membrane structure (including the electrical charge of each membrane) and the multisets located in the corresponding regions. A computation step changes the current configuration according to the following set of principles: • Each object and membrane can be subject to at most one rule per step, except for object evolution rules: this means that inside each membrane several evolution rules can be applied simultaneously, but each membrane can be involved only in a single communication, dissolution, or division rule per step. • The application of rules is maximally parallel: each object appearing on the left-hand side of evolution, communication, dissolution or division rules must be subject to exactly one of them (unless the current charge of the membrane prohibits it, and according to the fact that a membrane can be involved in a single communication, dissolution, or division rule per step). The same principle applies to each membrane that can be involved in communication, dissolution, or division rules. In other words, the only objects and membranes that do not evolve are those associated with no rule, or only to rules that are not applicable due to the electrical charges. • When several conflicting rules can be applied at the same time, a nondeterministic choice is performed; this implies that, in general, multiple possible configurations can be reached as a result of a computation step. • In each computation step, all the chosen rules are applied simultaneously (in an atomic way). However, to clarify the operational semantics, each computation step is conventionally described as a sequence of micro-steps as follows. First, all evolution rules are applied inside the elementary membranes, followed by all communication, dissolution and division rules involving the membranes themselves; this process is then repeated on the membranes containing them, and so on towards the root (outermost membrane). In other words, the membranes evolve only after their internal configuration has been updated. For instance, before a membrane division occurs, all chosen object evolution rules must be applied inside it; in this way, the objects that are duplicated during the division are already the final ones. • The outermost membrane cannot be divided or dissolved, and any object sent out from it cannot re-enter the system again.
A halting computation of the P system is a finite sequence of configurations C = (C 0 , … , C k ) , where C 0 is the initial configuration, every C i+1 is reachable from C i via a single computation step, and no rules of are applicable in C k . If this last condition is never reached (that is, in each configuration of the sequence there is at least one applicable rule), then a non-halting computation C = (C i ∶ i ∈ ℕ) is obtained, that consists of infinitely many configurations, again starting from the initial one and generated by successive computation steps. P systems can be used as language recognizers by employing two distinguished objects yes and no ; exactly one of these must be sent out from the outermost membrane, and only in the last step of each computation, to signal acceptance or rejection, respectively; we also assume that all computations are halting.
In order to solve decision problems (i.e., recognize languages over an alphabet ), we use families of recognizer Each input x is associated with a P system x in the family that decides the membership of x in the language L ⊆ ⋆ by accepting or rejecting. The mapping x ↦ x must be efficiently computable for each input length [23].
These families of recognizer P systems can be used to solve decision problems as follows.
Definition 2 Let be a P system whose alphabet contains two distinct objects yes and no , such that every computation of is halting and during each computation exactly one of the objects yes, no is sent out from the skin to signal acceptance or rejection. If all the computations of agree on the result, then is said to be confluent; if this is not necessarily the case, then it is said to be non-confluent and the global result is acceptance if and only if there exists an accepting computation.

Definition 3
Let L ⊆ ⋆ be a language, D a class of P systems (i.e. a set of P systems using a specific subset of features) and let = { x | x ∈ ⋆ } ⊆ D be a family of P systems, either confluent or non-confluent. We say that decides L when, for each x ∈ ⋆ , x ∈ L if and only if x accepts.
Complexity classes for P systems are defined by imposing a uniformity condition on and restricting the amount of time or space available for deciding a language.
Definition 4 Consider a language L ⊆ ⋆ , a class of recognizer P systems D , and let f ∶ ℕ → ℕ be a proper complexity function (i.e. a "reasonable" one, see [26,Definition 7.1]). We say that L belongs to the complexity class MC ⋆ D (f ) if and only if there exists a family of confluent P systems there exists a deterministic Turing machine which, for each input x ∈ ⋆ , constructs the P system x in polynomial time with respect to |x|; • operates in time f, i.e. for each x ∈ ⋆ , every computation of x halts within f(|x|) steps.
In particular, a language L ⊆ ⋆ belongs to the complexity class PMC ⋆ D if and only if there exists a semi-uniform family of confluent P systems = { x | x ∈ ⋆ } ⊆ D deciding L in polynomial time.
The analogous complexity classes for non-confluent P systems are denoted by NMC ⋆ D (f ) and NPMC ⋆ D .
Another set of complexity classes is defined in terms of uniform families of recognizer P systems: Definition 5 Consider a language L ⊆ ⋆ , a class of recognizer P systems D , and let f ∶ ℕ → ℕ be a proper complexity function. We say that L belongs to the complexity class MC D (f ) if and only if there exists a family of confluent P systems = { x | x ∈ ⋆ } ⊆ D deciding L such that: • is uniform, i.e. for each x ∈ ⋆ deciding whether x ∈ L is performed as follows: first, a polynomial-time deterministic Turing machine, given the length n = |x| as a unary integer, constructs a P system n with a distinguished input membrane; then, another polynomial-time deterministic Turing machine computes an encoding of the string x as a multiset w x , which is finally added to the input membrane of n , thus obtaining a P system x that accepts if and only if x ∈ L.
• operates in time f, i.e. for each x ∈ ⋆ , every computation of x halts within f(|x|) steps.
In particular, a language L ⊆ ⋆ belongs to the complexity class PMC D if and only if there exists a uniform family of confluent P systems = { x | x ∈ ⋆ } ⊆ D deciding L in polynomial time.
The analogous complexity classes for non-confluent P systems are denoted by NMC D (f ) and NPMC D .
As stated in the Introduction, the first definition of space complexity for P systems introduced in [29] considered a possible real implementation with biochemical materials, thus assuming that every single object and membrane requires some constant physical space. Such a definition (in the improved version from [20], taking into account also the space required by the labels for membranes and the alphabet of symbols) is the following:

Definition 6
Considering a configuration C of a P system , its size |C| is the number of membranes in the current membrane structure multiplied by log | | , plus the total number of objects from they contain multiplied by log | | . If C = (C 0 , … , C k ) is a computation of , then the space required by C is defined as The space required by itself is defined as the supremum of the space required by all computations of : Following what has been done for time complexity classes, we can define space complexity classes. By MCSPACE D (f (n)) (resp. MCSPACE ⋆ D (f (n)) ) we denote the class of languages which can be decided by uniform (resp. semi-uniform) families, , of confluent P systems of type D (for example, when we refer to P systems with active membranes, we denote this by setting D = AM ), where each x ∈ operates within space bound f(|x|).
In particular, the class of problems solvable in polynomial space by uniform confluent systems is denoted by PMCSPACE D , and the class of problems solvable in exponential space by uniform confluent systems is denoted by EXPMCSPACE D (adding a star in case of semi-uniform classes).
The corresponding classes for non-confluent systems are NPMCSPACE D and NEXPMCSPACE D .

An alternative definition of space complexity for P systems
In this section, we first give a different definition of space complexity for P systems with active membranes. This definition considers the information stored in the objects of the systems, and not the single objects themselves. In other words, we store, using binary numbers, the multiplicity of each object in each membrane, thus reducing the amount of needed space with respect to the definition of space given in the previous section. We will do this considering, for each region, a sequence of couples, describing how many occurrences of each object are present (only for objects having at least one occurrence in the region). As an example, considering an (ordered) alphabet = {a, b, c, d} , a multiset a 2 , b 5 , d 6 can be described by the sequence of couples (010, 00), (101, 01), (110, 11) (where (010,00) corresponds to 2 occurrences of the first symbol in , that is a, (101,01) to 5 occurrences of the second symbol b, etc.). Of course, different descriptions can also be considered: for instance, the bits describing the object can be avoided if we give, in order, the amount of each object, including objects having zero occurrences (sometimes this would allow to save space, but sometimes this would require more space, like in the case of sparse information -see, e.g., [21]). We leave as an open research topic the question whether or not different descriptions allow improvements in space usage.
We will refer to this definition of space by binary space, and we will add a symbol B where appropriate, to distinguish between the definitions referring to this new measure and the definitions recalled in the previous section.

Definition 7
Consider a configuration C of a P system . Let us denote by h 1 , h 2 , ..., h z the membranes of the current membrane structure (we stress the fact that z can be smaller, equal, or greater than the initial number of membranes d, due to dissolution and duplication of membranes; we also stress the fact that we do not need to store unique IDs for membranes having the same label as we can, for example, indicate multisets of objects inside a string-like bracketed expression), and by |O i,j | the multiplicity of object i within region j. The binary size |C| B of a configuration C is defined as: that is the number of membranes in the current membrane structure multiplied by log | | , plus the number of bits required to store the description of the multiset in each region.
is a computation of , then the binary space required by C is defined as The binary space required by itself is then obtained by computing the binary space required by all computations of and taking the supremum: Finally, let = { x ∶ x ∈ ⋆ } be a family of recognizer P systems, and let s ∶ ℕ → ℕ . We say that operates within binary space bound s if and only if | x | B ≤ s(|x|) for each x ∈ ⋆ .
We can thus define space complexity classes considering this newly introduced size measure, like we did in the previous section. By MCBSPACE D (f (n)) (resp. MCBSPACE * D (f (n)) ) we denote the class of languages which can be decided by uniform (resp. semi-uniform) families, , of confluent P systems of type D, where each x ∈ operates within space bound f(|x|), considering this new definition of binary space. Similarly, we can define the usual complexity classes like we did in the previous section, simply adding a B to underline the use of this new definition of space. For instance, the class of problems solvable by uniform (resp. semi-uniform) systems in polynomial binary space will be denoted by PMCBSPACE D (resp. PMCBSPACE * D ). Once these notions have been defined, we are ready to state some results obtained by considering various complexity classes defined in terms of binary space. Just like it happens with the classes based on the original definition of space given in [29], some results follow immediately from the definitions (we denote a result that holds for both semi-uniform and uniform systems by [⋆]):

and in particular
The results describing closure properties and providing an upper bound for time requirements of P systems operating in bounded binary space are still valid, too:

Proposition 3 The complexity classes PMCBSPACE
D , a n d NEXPMCBSPACE [⋆] D are all closed under polynomial-time reductions.
Proof Consider a language L ∈ PMCBSPACE ⋆ D and let M be the Turing machine constructing the family that decides L. Let L ′ be reducible to L via a polynomial-time computable function f.
We can build a Turing machine M ′ working as follows: on input x of length n, M ′ computes f(x); then it behaves like M on input f(x), thus constructing f (x) (we stress the fact that, for the corresponding result concerning the uniform case, the construction of the P system involves two Turing machines, both operating in polynomial time; in this case, we simulate the composition of the two machines). Since |f (x)| is bounded by a polynomial, M ′ operates in polynomial time and f (x) in polynomial binary space; it follows that � = { f (x) | x ∈ ⋆ } is a polynomially semi-uniform family of P systems deciding L ′ in polynomial binary space. Thus L � ∈ PMCBSPACE ⋆ D . The proofs for the three other classes and for the corresponding uniform classes are analogous. ◻ Proof By reversing the roles of objects yes and no , the complement of a language can be decided. ◻

Proposition 5
For each function f ∶ ℕ → ℕ Proof Let L ∈ MCBSPACE ⋆ D (f (n)) be decided by the semiuniform family of recognizer P systems in binary space f; let x ∈ with |x| = n and let C be a configuration of x .
The configuration C is described by the membrane structure and the objects inside it. The information concerning objects is stored using bits, as described above. The membrane structure can be stored directly using a bracketed expression. For z membranes the binary space allocated requires z × log(| |) bits; even by adding a constant number of bits for each bracket corresponding to each membrane, the space required is O(z × log(| |)) . The binary space required Since x is a recognizer P system, by definition every computation halts: then it must halt within 2 O(f (n)) steps in order to avoid repeating a configuration.
The same argument, with only some small differences, also works in the non-confluent case. All possible computations halt, even if not necessarily agreeing on the answer. Due to non-confluence, each computation can also contain repeated configurations. Nonetheless, for each computation containing a repeated configuration, there exists an equivalent one obtained by removing cycles in the computation path.
The proof for the uniform classes is analogous. ◻

Comparison with standard computational complexity classes
In this section, we compare the standard computational complexity classes with the complexity classes defined in the framework of P systems working in binary space.
Most results are an immediate consequence of the results given in [29], simply considering that Thus, recalling various results from [29], we have: Proposition 6 Let us denote by EAM and AM 0 the classes of P systems with active membranes using only elementary membrane division and without polarizations, respectively. The following results hold: Proof The inclusion P ⊆ MCSPACE ⋆ AM (O(1)) follows immediately from the definition of semiuniform P systems. Consider a language L in P and a string x; a deterministic Turing machine can create in polynomial time a P system having a single membrane and one single object yes or no , directly answering the question whether or not x ∈ L . The inclusion MCSPACE ⋆ AM (O(1)) ⊆ MCBSPACE ⋆ AM (O(1)) follows, as stated above, from the definition of binary space.
For the converse, we simply need to recall that a confluent semiuniform P system without membrane division can be simulated, in polynomial time, by a deterministic Turing machine, like it was shown in [40]. It is easy to see that the proof works both considering the standard space definition as well as the binary space definition for P systems. Even when the division of membranes is allowed, but the system can only use an amount of space that is limited to a constant, the total number of membranes is limited by a constant and, as a consequence, the total number of configurations is polynomially bounded. Hence, the same simulation is still valid. ◻ It follows that, for semiuniform systems, when we allow only a constant amount of space, the improved storage allowed by binary space does not lead to improved efficiency.
Another interesting result concerning the standard definition of space in the framework of P systems was presented in [30], and it focuses on the type of resources used. In particular, a solution for the PSPACE-complete problem Quantified 3SAT was given, for uniform systems using only communication rules (hence no evolution, membrane division and dissolution rules were used), thus proving the inclusion of PSPACE in this class. Once again, since the definition of binary space allows a more efficient allocation of space, the result is still valid: Proposition 8 Let us denote by AM(-ev,+com,-dis,-div) the class of P systems with active membranes using only communication rules (while rules for object evolution, dissolution, and division of membranes are not used). Then PSPACE ⊆ PMCBSPACE [⋆] AM(-ev,+com,-dis,-div) .
Once again, it would be interesting to understand whether or not the result remains valid for a smaller binary space class. In this case, the question can be answered negatively, by considering a result presented in [31]. In the article, it was shown that recognizer P systems with active membranes using polynomial space characterize the complexity class PSPACE . The result holds for both confluent and nonconfluent systems, and even in the case that non-elementary division is used. In particular, it was pointed out that such systems can be simulated by polynomial space Turing machines.
By considering the alternative definition for binary space, we can thus obtain the corresponding theorem: Theorem 9 Let be a nonconfluent P system with active membranes, running in binary space S. Then, it can be simulated by a deterministic Turing machine in space O(S 2 ).

Proof
We simulate by means of a non-deterministic Turing machine N. The current configuration of can be stored explicitly by N: the membrane structure is represented directly by using a bracketed expression, while multisets of objects inside each region are stored by means of tuples of integers encoded in binary. Of course, the same considerations we made in the proof of Proposition 5 hold also in this case.
For the simulation, we can use the same algorithm as in [31]: the space required by N to store further information needed to carry on the simulation is then limited by S. It follows that the total amount of space required by N is of the same order as the one required by , that is, O(S).
Using Savitch's theorem [26], it is straightforward to see that N (and thus ) can be simulated by a deterministic Turing machine in space O(S 2 ) . ◻ It follows immediately from this theorem, from the results in [31], and from Proposition 8: Hence, even when a polynomial amount of space is used, the complexity classes defined on the basis of the definition of binary space coincide with the complexity classes defined in terms of the original definition of space (for systems using at least communication rules).
In [3] it was shown that exponential space Turing machines can be simulated by polynomially uniform exponential-space P systems with active membranes. In view of this result and of Theorem 9, and of the definition of binary space, we have the following:

Theorem 11
The following equivalences hold for an exponential amount of space:

Conclusions
We have proposed an alternative space complexity measure for P systems with active membranes, where the multiplicity of each object in each membrane is stored by using binary numbers. We have defined the corresponding complexity classes and we have compared some of them both with standard space complexity classes and with complexity classes defined in the framework of P systems considering the original definition of space [29].
It turned out that, for various considered systems, the computational classes defined on the basis of binary space do not differ from the corresponding classes defined on the basis of the original space definition for P systems. Among the various systems for which we proved such a result, we underline in particular that this is the case when we consider systems using all features of P systems with active membranes and a polynomial or exponential amount of space, as well as for semiuniform systems working in a constant space.
It would be interesting to find other classes for which the improved store efficiency obtained by considering binary space does not make any difference in computational efficiency, and to understand which features can be used/ are necessary to obtain the same result. It also remains as an open problem to find, on the contrary, specific classes where this difference exists, thus proving that storing the information concerning objects in an efficient way can really be exploited in some cases. We conjecture, for instance, that this is the case for complexity classes defined by systems using a logarithmic amount of space. Another possible research direction is to consider further variants of definition for space, and compare them with standard and binary space, or to consider the space required to describe the whole system executing the computation, that is including not only the data (object and membranes, in our case) but also the program (the rules, in our case).