1 Introduction

Membrane computing is a bio-inspired computing paradigm based on the structure and behaviour of living cells. There are several variants of P systems, the computational models of this paradigm. It was first introduced in Păun (2000), defining one of the main variants, cell-like P systems that abstract the hierarchical arrangement of membranes within a single cell. In Martín-Vide et al. (2003), the idea of the interactions of networks of cells (placed in the nodes of a directed graph) between cells and between cells and their environment is used to develop tissue-like P systems, named by the ensemble of cells in living beings. Another approach with the same structure are the so-called spiking neural P systems (Ionescu et al. 2006), SN P systems for short, inspired by the way that neurons communicate with each other by means of short electrical impulses (spikes).

Within these models, several variants can be defined only by changing syntactic and/or semantic ingredients, such as kinds of rules possible, length of rules, parallelism permitted, number of objects and so on. Computational complexity theory in the framework of Membrane Computing use special variants of P systems called recognizer membrane systems, devices that, given an initial configuration depending on an instance of a decision problem, they return yes or no depending of the answer of such instance. A deep vision of complexity can be seen in Pérez-Jiménez (2005); Pérez-Jiménez et al. (2003).

In this work, we focus on tissue P systems, which have been widely investigated from the computational complexity point of view, giving characterizations for most of their variants. For instance, in Gutiérrez-Naranjo et al. (2009) and Porreca et al. (2012), the borderline of efficiency for tissue P systems with symport/antiport rules and cell division by means of the length of communication rules is given, that is, passing from 1 object to 2 objects in the left-hand side of the rules means passing from non-efficiency to presumably efficiency. In Pan et al. (2012) and Pérez-Jiménez and Sosík (2012), a similar result is given for tissue P systems with symport/antiport rules and cell separation, but in this case, rules with length at most 3 are needed in order to solve efficiently computationally hard problems. Thus, three frontiers of efficiency can be found here: the first two frontiers are the ones described above; that is, by means of the length of the rules, and the third frontier is, while using rules with length at most 2, there is a borderline between separation and division rules.

Song et al. (2017), a new variant of tissue P systems is defined. Based on the chemical reactions within cells and how reactives evolve into new components, evolutional communication rules are described as a movement of components between different cells or a cell and the environment but within the reaction, objects can change into something new. It is interesting to study these systems from the computational complexity theory point of view, and in Pan et al. (2018), an efficient solution to the SAT problem is given by these systems with some restrictions about the length of their rules, more precisely, three objects are allowed in the left-hand side of the rules and two objects are allowed in the right-hand side of the rules. The main result is thus that \(\mathbf{NP} \cup \mathbf{co}-\mathbf{NP} \subseteq \mathbf{PMC}_{{\mathcal {TSEC}}(3, 2)}\). This leaves an unknown concerning to what happens if we restrict the number of object of the left-hand side also to two. In this work, we focus on this topic and we give an efficient solution to SAT with a family of P systems from \({\mathcal {TSEC}}(2, 2)\); that is, recognizer tissue P systems with evolutional communication rules and separation rules where both the lengths left-hand side and the right-hand side of the rules are limited to two, reducing the number of maximum objects of the left-hand side by one.

The paper is organized as follows: first, we recall some concepts that are going to be used through the work. In Sect. 3 the framework of tissue P systems with evolutional symport/antiport rules is introduced. After that, Sects. 4 and 5 are devoted to give a solution to SAT by means of a family of P systems with evolutional symport/antiport rules with cell separation and rules with length at most (2, 2) and a formal verification of a design. Finally, some conclusions and open research lines are exposed.

2 Preliminaries

In order to do this work self-contained, we introduce some concepts that are going to be used through the paper.

2.1 Alphabets and sets

An alphabet \(\Gamma \) is a non-empty set and their elements are called symbols. A string u over \(\Gamma \) is an ordered finite sequence of symbols, that is, a mapping from a natural number \(n \in {\mathbb {N}}\) onto \(\Gamma \). The number n is called the length of the string u and it is denoted by \(\mid u \mid \). The empty string (with length 0) is denoted by \(\lambda \). The set of all strings over an alphabet \(\Gamma \) is denoted by \(\Gamma ^{*}\). A language over \(\Gamma \) is a subset of \(\Gamma ^{*}\).

A multiset over an alphabet \(\Gamma \) is an ordered pair \((\Gamma , f)\) where f is a mapping from \(\Gamma \) onto the set of natural numbers \({\mathbb {N}}\). The support of a multiset \(m = (\Gamma , f)\) is defined as \(supp(m) = \{x \in \Gamma \mid f(x) > 0\}\). A multiset is finite (resp., empty) if its support is a finite (resp., empty) set. We denote by \(\emptyset \) the empty multiset, \(M(\Gamma )\) the set of all multisets over \(\Gamma \) and \(M^{+}(\Gamma ) = M(\Gamma ) \setminus \emptyset \)

Let \(m_{1} = (\Gamma , f_{1})\), \(m_{2} = (\Gamma , f_{2})\) be multisets over \(\Gamma \), then the union of \(m_{1}\) and \(m_{2}\), denoted by \(m_{1} + m_{2}\), is the multiset \((\Gamma , g)\), when \(g(x) = f_{1}(x) + f_{2}(x)\) for each \(x \in \Gamma \).

2.2 Decision problems

A decision problem X can be informally defined as one whose solution is either yes or no. This can be formally defined by an ordered pair \((I_{X}, \theta _{X})\), where \(I_{X}\) is a language over a finite alphabet \(\Sigma _{X}\) and \(\theta _{X}\) is a total Boolean function over \(I_{X}\). The elements of \(I_{X}\) are called instances of the problem X. Each decision problem X has associated a language \(L_{X}\) over the alphabet \(\Sigma _{X}\) as follows: \(L_{X} = \{u \in E_{X} \mid \theta _{X}(u) = 1\}\). Conversely, every language L over an alphabet \(\Sigma \) has associated a decision problem \(X_{L} = (I_{X_{L}}, \theta _{X_{L}})\) as follows: \(I_{X_{L}} = \Sigma ^{*}\) and \(\theta _{X_{L}}(u) = 1\) if and only if \(u \in L\). Then, given a decision problem X we have \(X_{L_{X}} = X\), and given a language L over an alphabet \(\Sigma \) we have \(L_{X_{L}} = L\).

It is worth pointing out that any Turing machine M (with input alphabet \(\Sigma _{M}\)) has associated a decision problem \(X_{M} = (I_{M}, \theta _{M})\) defined as follows: \(I_{M} = \Sigma ^{*}_{M}\), and for every \(u \in \Sigma ^{*}_{M}\), \(\theta _{M}(u) = 1\) if and only if M accepts u. Obviously, the decision problem \(X_{M}\) is solvable by the Turing machine.

3 Tissue P systems with evolutional communication rules

Definition 1

A tissue P system with evolutional symport/antiport rules and cell separation of degree \(q \ge 1\) is a tuple

$$\begin{aligned} \Pi = (\Gamma , \Gamma _0, \Gamma _1, {{\mathcal {E}}}, {{\mathcal {M}}}_{1}, \dots , {{\mathcal {M}}}_{q}, {{\mathcal {R}}}, i_{out}) \end{aligned}$$

where:

  • \(\Gamma \) and \({{\mathcal {E}}}\) are finite alphabets whose elements are called objects, and \(\Gamma \) is non empty;

  • \(\{\Gamma _{0}, \Gamma _{1}\}\) is a partition of \(\Gamma \);

  • \({{\mathcal {E}}} \subseteq \Gamma \);

  • \({{\mathcal {M}}}_{1}, \dots , {{\mathcal {M}}}_{q}\) are multisets over \(\Gamma \);

  • \({{\mathcal {R}}}\) is a finite set of rules, of the following forms:

    1. 1.

      Evolutional communication rules:

      1. (a)

        \([ \, u \, ]_{i} [\quad ]_{j} \rightarrow [\quad ]_{i} [ \, u' \, ]_{j}\), where \(1 \le i,j \le q\), \(i \ne j\), \(u \in M^{+}(\Gamma )\) and \(u' \in M(\Gamma )\) (evolutional symport rules);

      2. (b)

        \([ \, u \, ]_{i} [ \, v \,]_{j} \rightarrow [ \, v' \, ]_{i} [ \, u' \, ]_{j}\), where \(1 \le i,j \le q\), \(i \ne j\), \(u,v \in M^{+}(\Gamma )\) and \(u',v' \in M(\Gamma )\) (evolutional antiport rules);

    2. 2.

      \([ \, a \, ]_{i} \rightarrow [ \, \Gamma _0 ]_{i} [ \, \Gamma _1 ]_{i}\), where \(i \in \{1, \dots , q\}, i \ne i_{out}\) and \(a \in \Gamma \); (separation rules);

  • \(i_{out} \in \{0, 1, \dots , q\}\).

A tissue P system with evolutional symport/antiport rules and cell separation of degree \(q \ge 1\)

$$\begin{aligned} \Pi = (\Gamma , \Gamma _{0}, \Gamma _{1}, {{\mathcal {E}}}, {\mathcal {M}}_{1}, \dots , {{\mathcal {M}}}_{q}, {{\mathcal {R}}}, i_{out}) \end{aligned}$$

can be viewed as a set of q cells, labelled by \(1, \dots , q\) such that (a) \({{\mathcal {M}}}_{1}, \dots , {{\mathcal {M}}}_{q}\) represent the multisets of objects initially placed in the q cells of the system; (b) \({{\mathcal {E}}}\) is the set of objects initially located in the environment of the system, all of them available in an arbitrary number of copies; (c) \(i_{out}\) represents a distinguished region which will encode the output of the system. We use the term region i (\(0 \le i \le q\)) to refer to cell i in the case \(1 \le i \le q\) and to refer to the environment in the case \(i = 0\).

A configuration at any instant of a tissue P system with evolutional symport/antiport rules and cell separation is described by the multisets of objects in each cell and the multiset of objects over \(\Gamma \setminus {{\mathcal {E}}}\) in the environment at that moment. The initial configuration of \(\Pi = (\Gamma , \Gamma _{0}, \Gamma _{1}, {{\mathcal {E}}}, {{\mathcal {M}}}_{1}, \dots , {{\mathcal {M}}}_{q}, {{\mathcal {R}}}, i_{out})\) is \(({{\mathcal {M}}}_{1}, \dots , {{\mathcal {M}}}_{q}; \emptyset )\).

An evolutional symport rule \([ \, u \, ]_{i} [\quad ]_{j} \rightarrow [\quad ]_{i} [ \, u' \, ]_{j}\) is applicable at a configuration \({{\mathcal {C}}}_{t}\) at an instant t if there is a region i from \({{\mathcal {C}}}_{t}\) which contains multiset u. By applying an evolutional symport rule, the multiset of objects in region i from \({{\mathcal {C}}}_{t}\) is consumed and the multiset of objects \(u'\) is generated in region j from \({{\mathcal {C}}}_{t+1}\).

An evolutional symport rule \([ \, u \, ]_{i} [ \, v \,]_{j} \rightarrow [ \, v' \, ]_{i} [ \, u' \, ]_{j}\) is applicable at a configuration \({{\mathcal {C}}}_{t}\) at an instant t if there is a region i from \({{\mathcal {C}}}_{t}\) which contains multiset u and there is a region j which contains multiset v. By applying an evolutional symport rule, the multiset of objects u in region i and multiset of objects v in region j from \({{\mathcal {C}}}_{t}\) are consumed and the multiset of objects \(u'\) is generated in region j and the multiset of objects \(v'\) in region i from \({{\mathcal {C}}}_{t+1}\).

A separation rule \([ \, a \, ]_{i} \rightarrow [ \, \Gamma _{0} \, ]_{i} [ \, \Gamma _1 \, ]_{i}\) is applicable at a configuration \({\mathcal {C}}_{t}\) at an instant t if there is a cell i from \({{\mathcal {C}}}_{t}\) which contains object a and \(i \ne i_{out}\). By applying a separation rule to such a cell i, (a) object a is consumed from such cell; (b) two new cells with label i are generated at configuration \({{\mathcal {C}}}_{t+1}\); and (c) objects from \(\Gamma _{0}\) from the original cell are placed in one of the new cells, while objects from \(\Gamma _{1}\) from the original cell are placed in the other one.

The rules of a tissue P system with evolutional symport/antiport rules and cell separation are applied in a maximally parallel manner, following the previous remarks, and taking into account that when a cell i is being separated at one transition step, no other rules can be applied to that cell i at that step.

A transition from a configuration \({{\mathcal {C}}}_{t}\) to another configuration \({{\mathcal {C}}}_{t+1}\) is obtained by applying rules in a maximally parallel manner following the previous remarks. A computation of the system is a (finite or infinite) sequence of transitions starting from the initial configuration, where any term of the sequence other than the first one is obtained from the previous configuration in one transition step. If the sequence is finite (called halting computation) then the last term of the sequence is a halting configuration, that is, a configuration where no rule is applicable to it. A computation gives a result only when a halting configuration is reached, and that result is encoded by the multiset of objects present in the output region \(i_{out}\).

A natural framework to solve decision problems is to use recognizer P systems.

Definition 2

A recognizer tissue P system with evolutional symport/antiport rules and cell separation of degree \(q \ge 1\) is a tuple

$$\begin{aligned} \Pi = (\Gamma , \Gamma _{0}, \Gamma _{1}, \Sigma , {{\mathcal {E}}}, {{\mathcal {M}}}_{1}, \dots , {{\mathcal {M}}}_{q}, {{\mathcal {R}}}, i_{in}, i_{out}), \end{aligned}$$

where

  • the tuple \((\Gamma , \Gamma _{0}, \Gamma _{1}, {{\mathcal {E}}}, {{\mathcal {M}}}_{1}, \dots , {{\mathcal {M}}}_{q}, {{\mathcal {R}}}, i_{out})\) is a tissue P system with evolutional symport/antiport rules of degree \(q \ge 1\).

  • Where \(\Gamma \) strictly contains an (input) alphabet \(\Sigma \) and two distinguished objects yes and no, and \({\mathcal {M}}_{i}\) (\(1 \le i \le q\)) are multisets over \(\Gamma \setminus \Sigma \);

  • \(i_{in} \in \{1, \dots , q\}\) is the input cell and \(i_{out}\) is the label of the environment;

  • for each multiset m over the input alphabet \(\Sigma \), any computation of the system \(\Pi \) with input m, represented as \(\Pi + m\), starts from the configuration of the form \(({{\mathcal {M}}}_{1}, \dots , {{\mathcal {M}}}_{i_{in}} + m, \dots , {{\mathcal {M}}}_{q}; \emptyset )\), it always halts and either object yes or object no (but not both) must appear in the environment at the last step.

For each ordered pair of natural numbers \((k_{1}, k_{2}), k_{1}, k_{2} \ge 1\), the class of recognizer P systems with evolutional symport/antiport rules and cell separation with evolutional communication rules of length at most \((k_{1}, k_{2})\) is denoted by \({\mathcal {TSEC}}(k_{1}, k_{2})\). This means that, given an evolutional communication rule \([ \, u \, ]_{i} [ \, v \, ]_{j} \rightarrow [ \, v' \, ]_{i} [ \, u' \, ]_{j}\) the LHS (resp., RHS) of any evolutional communication rule in a system from \({\mathcal {TSEC}}(k_{1}, k_{2})\) involves at most \(k_{1} = \mid u \mid + \mid v \mid \) objects (resp., \(k_{2} = \mid u' \mid + \mid v' \mid \) objects).

Next, we define the concept of solving a problem in a uniform way and in polynomial time by a family of recognizer tissue P systems with evolutional symport/antiport rules and cell separation.

Definition 3

A decision problem \(X = (I_{X}, \theta _{X})\) is solvable in a uniform way and in polynomial time by a family \(\mathbf{\Pi } = \{ \Pi (n) \mid n \in \mathbb {N}\}\) of recognizer tissue P systems with evolutional symport/antiport rules and cell separation if the following conditions hold:

  1. 1.

    the family \(\mathbf{\Pi }\) is polynomially uniform by Turing machines; that is, there exists a Turing machine capable of constructing the elements of such a family in polynomial time; and

  2. 2.

    there exists a polynomial encoding (cods) of \(I_{X}\) in \(\mathbf{\Pi }\) such that (a) for each instance \(u \in I_{X}\), s(u) is a natural number and cod(u) is an input multiset of the system \(\Pi (s(u))\); (b) for each \(n \in \mathbb {N}\), \(s^{-1}(n)\) is a finite set; and (c) the family \(\mathbf{\Pi }\) is polynomially bounded Footnote 1, sound Footnote 2 and complete Footnote 3 with regard to (Xcods) (Pérez-Jiménez et al. 2003).

The set of all decision problems that can be solved by recognizer tissue P systems with evolutional symport/antiport rules and cell separation with evolutional communication rules of length at most \((k_{1}, k_{2})\) in a uniform way and polynomial time is denoted by \(\mathbf{PMC}_{{\mathcal {TSEC}}(k_{1}, k_{2})}\).

4 Solution to SAT with evolutional communication rules and separation rules

Pan et al. (2018) an efficient solution to the SAT problem is given by means of a family of P systems from \({\mathcal {TSEC}}(3,2)\). A frontier of efficiency is given, but some open problems remain, as indicate Fig. 1 of Pan et al. (2018). It shows that the class of problems that can be solved by P systems from \(\mathbf{TSEC}(2,k)\) with \(k \ge 2\) is unknown. In this work we improve this borderline closing the previous open questions, giving an efficient solution of the SAT problems by means of a family of P systems from \({\mathcal {TSEC}}(2,2)\).

Let us briefly recall the description of the SAT problem: given a Boolean formula in conjunctive normal form (CNF), to determine whether or not there exists an assignment to its variables, called truth assignment, on which it evaluates true.

Theorem 1

SAT \(\in \) PMC \(_{{\mathcal {TSEC}}(2,2)}\)

For each \(n, p \in \mathbb {N}\), we consider the recognizer P system

$$\begin{aligned} \Pi (\langle n, p \rangle ) = (\Gamma , \Gamma _0, \Gamma _1, \Sigma , {{\mathcal {E}}}, {{\mathcal {M}}}_1, \dots , {{\mathcal {M}}}_q, {{\mathcal {R}}}, i_{in}, i_{out}) \end{aligned}$$

from \({\mathcal {TSEC}}(2,2)\) defined as follows:

  1. 1.

    Working alphabet \(\Gamma \):

    $$\begin{aligned}&\{\mathtt{yes}, \mathtt{no}, y_1, y_2, n_1, n_2, \#\} \\&\quad \cup \{ a_{i,j} \mid 1 \le i \le n, 0 \le j \le i\} \\&\quad \cup \{a'_{i,j} \mid 2 \le i \le n, 0 \le j \le i-1\}\\&\quad \cup \{ a^L_{i,j}, a^R_{i,j} \mid 2 \le i \le n, 1 \le j \le i-1\} \\&\quad \cup \{\alpha _j, \alpha '_j, \alpha ^L_j, \alpha ^R_j \mid 1 \le j \le p+1\}\\&\quad \cup \{t_i, f_i, t'_i, t''_i f''_i, t^L_i, t^R_i,f^L_i, f^R_i \mid 1 \le i \le n\} \\&\quad \cup \{ \beta _{l,k},\beta '_{l,k}, \beta ^L_{l,k}, \beta ^R_{l,k} \mid 0 \le k \le n, 1 \le l \le n\} \\&\quad \cup \{x_{i,j,k}, \overline{x}_{i,j,k}, x^*_{i,j,k} \mid 1 \le i \le n, 1 \le j \le p, 1 \le k \le n+j-1\} \\&\quad \cup \{ x'_{i,j,k}, \overline{x}'_{i,j,k}, {x^*}'_{i,j,k}, x''_{i,j,k}, \overline{x}''_{i,j,k}, {x^*}''_{i,j,k}, x'''_{i,j,k}, \overline{x}'''_{i,j,k}, {x^*}'''_{i,j,k}, \\&\quad \mid 0 \le i \le n, 1 \le j \le p, 1 \le k \le n\} \\&\quad \cup \{c_{j,k} \mid 1 \le j \le p, j \le k \le p\} \, \cup \, \{\delta _i \mid 0 \le i \le 4n+p+2\} \\&\quad \cup \{\delta '_i \mid 0 \le i \le 4n+p\}. \end{aligned}$$
  2. 2.
    $$\begin{aligned}&\Gamma _1 = \Gamma \setminus \Gamma _0,\\&\Gamma _0 = \{a^L_{i,j} \mid 2 \le i \le n, 1 \le j \le i-1\} \\&\quad \cup \{\alpha ^L_j \mid 1 \le j \le p+1\} \, \cup \, \{t^L_i, f^L_i \mid 1 \le i \le n\}\\&\quad \cup \{\beta ^L_{l,k} \mid 0 \le k \le n, k+1 \le l \le n\} \end{aligned}$$
  3. 3.

    Input alphabet \(\Sigma \): \(\{x_{i,j,0}, \overline{x}_{i,j,0}, x^*_{i,k,0} \mid 1 \le i \le n, 1 \le j \le p\}\).

  4. 4.

    Environment alphabet \({{\mathcal {E}}}\): \(\{\gamma \}\).

  5. 5.
    $$\begin{aligned}&{{\mathcal {M}}}_1 = \{\delta _0, \delta '_0\} \, \cup \, \{ \beta ^{n+p+1}_{l,0} \mid 1 \le l \le n\},\\&{{\mathcal {M}}}_2 = \{a_{i,0} \mid 1 \le i \le n\} \, \cup \, \{\alpha _j \mid 1 \le j \le p+1\}. \end{aligned}$$
  6. 6.

    The set of rules \({{\mathcal {R}}}\) consists of the following rules:

    1.1:

    Rules for \((4k+1)\)-th steps.

    $$\begin{aligned}&\left. \begin{array}{l} [ \, a_{i,i-1} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a'_{i,i-1} \, t'_i \, ]_2 [\quad ]_0 \end{array}\right. , \text{ for } \, 1 \le i \le n \\&\left. \begin{array}{ll} & [ \, t_i \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, t''_i \, ]_2 [\quad ]_0 \\ & [ \, f_i \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, f''_i \, ]_2 [\quad ]_0 \end{array}\right\} \text {for} \, 1 \le i \le n\\&\left. \begin{array}{l} [ \, a_{i,j} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a'_{i,j} \, ]_2 [\quad ]_0 \end{array}\right. , \text{ for } \, 2 \le i \le n, 0 \le j \le i-2 \\&\left. \begin{array}{l} [ \, \alpha _j \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, \alpha '_j \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p+1 \\&\left. \begin{array}{l} [ \, \beta _{l,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \beta '_{l,k} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \left\{ \begin{array}{l} 0 \le k \le n, \\ k+1 \le l \le n \end{array}\right. \\&\left. \begin{array}{ll}& [ \, x_{i,j,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x'_{i,j,k} \, ]_1 [\quad ]_0 \\ &\text{[ } \, \overline{x}_{i,j,k} \, ]_1 [ \, \gamma \ ]_0 \rightarrow [ \, \overline{x}'_{i,j,k} \, ]_1 [\quad ]_0 \\ & [ \, x^*_{i,j,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {x^*}'_{i,j,k} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \left\{ \begin{array}{ll} &1 \le i \le n, \\ & 1 \le j \le p, \\ & 0 \le k \le n-1 \end{array}\right. \end{aligned}$$
    1.2:

    Rules for \((4k+2)\)-th steps.

    $$\begin{aligned}&\left. \begin{array}{ll} &[ \, a'_{i,i-1} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a_{i,i} \, f^R_i \, ]_2 [\quad ]_0 \\ & [ \, t'_i \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, t^L_i \, ]_2 [\quad ]_0 \end{array}\right\} \text{ for } \ 1 \le i \le n \\&\left. \begin{array}{ll} &[ \, t''_i \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, t^L_i \, t^R_i \, ]_2 [\quad ]_0 \\ & [ \, f''_i \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, f^L_i \, f^R_i \, ]_2 [\quad ]_0 \end{array}\right\} \text{ for } \, 1 \le i \le n\\&\left. \begin{array}{l} [ \, a'_{i,j} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a^L_{i,j+1} \, a^R_{i,j+1} \, ]_2 [\quad ]_0 \end{array}\right. , \text{ for } \left\{ \begin{array}{l} 2 \le i \le n, \\ 0 \le j \le i-1 \end{array}\right. \\&\left. \begin{array}{l} [ \, \alpha '_j \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, \alpha ^L_j \, \alpha ^R_j \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p+1 \\&\left. \begin{array}{l} [ \, \beta '_{l,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \beta ^L_{l,k+1} \, \beta ^R_{l,k+1} \, ]_1 [\quad ]_0 \end{array}\right. , \, \text{ for } \left\{ \begin{array}{l} 0 \le k \le n, \\ k+1 \le l \le n \end{array}\right. \\&\left. \begin{array}{ll} &[ \, x'_{i,j,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x''^2_{i,j,k+1} \, ]_1 [\quad ]_0 \\ &\text{[ } \, \overline{x}'_{i,j,k} \, ]_1 [ \, \gamma \ ]_0 \rightarrow [ \, \overline{x}''^2_{i,j,k+1} \, ]_1 [\quad ]_0 \\ & [ \, {x^*}'_{i,j,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {x^*}''^2_{i,j,k+1} \, ]_1 [\quad ]_0 \end{array}\right\} , \, \text{ for } \left\{ \begin{array}{ll} &1 \le i \le n, \\ & 1 \le j \le p, \\ & 0 \le k \le n-1 \end{array}\right. \end{aligned}$$
    1.3:

    Rules for \((4k+3)\)-th steps.

    $$\begin{aligned}&\left. \begin{array}{l} [ \, a_{i,i} \, ]_2 \rightarrow [ \, \Gamma _0 \, ]_2 [ \, \Gamma _1 \, ]_2 \end{array}\right. , \, \text{ for } \ 1 \le i \le n \\&\left. \begin{array}{ll} &[ \, \beta ^O_{k,k} \, ]_1 [\quad ]_0 \rightarrow [\quad ]_1 [ \, \beta ^O_{k,k} \, ]_0 \\ & [ \, \beta ^O_{l,k} \, ]_1 [\quad ]_0 \rightarrow [\quad ]_1 [ \, \beta _{l,k} \, ]_0 \end{array}\right\} \text{ for } \left\{ \begin{array}{ll}& O \in \{L, R\}, \\ & 1 \le k \le n, \\ & k+1 \le l \le n \end{array}\right. \\&\left. \begin{array}{ll} &[ \, x''_{i,j,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x'''_{i,j,k} \, ]_1 [\quad ]_0 \\ & [ \, \overline{x}''_{i,j,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \overline{x}'''_{i,j,k} \, ]_1 [\quad ]_0 \\ & [ \, {x^*}''_{i,j,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {x^*}'''_{i,j,k} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \begin{array}{ll}& 1 \le i \le n, \\ & 1 \le j \le p, \\ & 1 \le k \le n \end{array} \end{aligned}$$
    1.4:

    Rules for (4k)-th steps.

    $$\begin{aligned}&\left. \begin{array}{ll} &[ \, a^O_{i,j} \, ]_2 [ \, \beta ^O_{k,k} \, ]_0 \rightarrow [ \, a_{i,j} \, ]_2 [\quad ]_0 \\ & [ \, r^O_i \, ]_2 [ \, \beta ^O_{k,k} \, ]_0 \rightarrow [ \, r_i \, ]_2 [\quad ]_0 \end{array}\right\} \text{ for } \left\{ \begin{array}{ll}& O \in \{L,R\}, \\ & r \in \{t,f\}, \\ & 1 \le i \le n, \\ & 1 \le j \le n, \\ & 1 \le k \le n\end{array}\right. \\&\left. \begin{array}{l} [ \, \alpha ^O_j \, ]_2 [ \, \beta ^O_{k,k} \, ]_0 \rightarrow [ \, \alpha _j \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \left\{ \begin{array}{l} O \in \{L, R\}, \\ 1 \le j \le p+1, \\ 0 \le k \le n \end{array} \right. \\&\left. \begin{array}{ll} &[ \, x'''_{i,j,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x_{i,j,k} \, ]_1 [\quad ]_0 \\ &\text{[ } \, \overline{x}'''_{i,j,k} \, ]_1 [ \, \gamma \ ]_0 \rightarrow [ \, \overline{x}_{i,j,k} \, ]_1 [\quad ]_0 \\ & [ \, {x^*}'''_{i,j,k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x^*_{i,j,k} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \left\{ \begin{array}{ll} &1 \le i \le n, \\ & 1 \le j \le p, \\ & 0 \le k \le n \end{array} \right. \\&\left. \begin{array}{l} [\quad ]_1 [ \, \beta _{l,k} \, ]_0 \rightarrow [ \, \beta _{l,k} \, ]_1 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 0 \le k \le n, k+1 \le l \le n. \end{aligned}$$
    2.1:

    Rules to check satisfied clauses.

    $$\begin{aligned}&\left. \begin{array}{ll}& [ \, t_i \, ]_2 [ \, x_{i,j,n+j-1} \, ]_1 \rightarrow [ \, c_{j,j} \, t_i \, ]_2 [\quad ]_1 \\ & [ \, t_i \, ]_2 [ \, \overline{x}_{i,j,n+j-1} \, ]_1 \rightarrow [ \, t_i \, ]_2 [\quad ]_1 \\ & [ \, t_i \, ]_2 [ \, x^*_{i,j,n+j-1} \, ]_1 \rightarrow [ \, t_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, x_{i,j,n+j-1} \, ]_1 \rightarrow [ \, f_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, \overline{x}_{i,j,n+j-1} \, ]_1 \rightarrow [ \, c_{j,j} \, f_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, x^*_{i,j,n+j-1} \, ]_1 \rightarrow [ \, f_i \, ]_2 [\quad ]_1 \end{array}\right\} \text{ for } \ 1 \le i \le n, 1 \le j \le p\\&\quad \left. \begin{array}{ll}& [ \, x_{i,j,n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x_{i,j,n+k+1} \, ]_1 [\quad ]_0 \\ & [ \, \overline{x}_{i,j,n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \overline{x}_{i,j,n+k+1} \, ]_1 [\quad ]_0 \\ & [ \, x^*_{i,j,n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x^*_{i,j,n+k+1} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \begin{array}{ll} &1 \le i \le n, \\ & 1 \le j \le p, \\ & 0 \le k \le j-2 \end{array}\\\&\left. \begin{array}{l} [ \, c_{j,k} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, c_{j,k+1} \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p, j \le k \le p-1. \end{aligned}$$
    3.1:

    Rules to check if all clauses are satisfied by a truth assignment.

    $$\begin{aligned}&\left. \begin{array}{l} [ \, \alpha _{p+1} \, ]_2 [ \, \delta '_{4n+p} \, ]_1 \rightarrow [ \, \alpha '_{p+1} \, ]_2 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \alpha _j \, c_{j,p} \, ]_2 [\quad ]_0 \rightarrow [\quad ]_2 [ \, \# \, ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p. \end{aligned}$$
    4.1:

    General counters.

    $$\begin{aligned}&\left. \begin{array}{l} [ \, \delta _i \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{i+1} \, ]_1 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 0 \le i \le 4n+p+1 \\&\left. \begin{array}{l} [ \, \delta '_{4i+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {\delta '}^2_{4i+2} \, ]_1 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 0 \le i \le n-1\\&\left. \begin{array}{l} [ \, \delta '_{4i+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_{4i+k+1} \, ]_1 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 0 \le i \le n-1, k \in \{0,2,3\}\\&\left. \begin{array}{l} [ \, \delta '_{4n+i} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_{4n+i+1} \, ]_1 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 0 \le i \le p-1. \end{aligned}$$
    4.2:

    Rules to give a negative answer.

    $$\begin{aligned}&\left. \begin{array}{l} [ \, \alpha _j \, \alpha '_{p+1} \, ]_2 [\quad ]_0 \rightarrow [\quad ]_2 [ \, n_1 \, ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p\\&\left. \begin{array}{ll} &[\quad ]_2 [ \, n_1 \, ]_0 \rightarrow [ \, n_1 \, ]_2 [\quad ]_0 \\ & [ \, n_1 \, ]_2 [ \, \delta _{4n+p+2} \, ]_1 \rightarrow [ \, n_2 \, ]_2 [\quad ]_1 \\ & [ \, n_2 \, ]_2 [\quad ]_0 \rightarrow [\quad ]_2 [ \, \mathtt{no} \, ]_0 \end{array}\right. \end{aligned}$$
    4.3:

    Rules to give an affirmative answer.

    $$\begin{aligned} \left. \begin{array}{ll} &[ \, \alpha '_{p+1} \, ]_2 [ \, \delta _{4n+p+2} \, ]_1 \rightarrow [ \, y_1 \, ]_2 [\quad ]_1 \\ & [ \, y_1 \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, y_2 \, ]_2 [\quad ]_0 \\ & [ \, y_2 \, ]_2 [\quad ]_0 \rightarrow [\quad ]_2 [ \, \mathtt{yes} \, ]_0 \end{array}\right. \end{aligned}$$
  7. 7.

    The input cell is the cell labelled by 1 (\(i_{in} = 1\)) and the output region is the environment (\(i_{out} = env\)).

Let \(\varphi = C_1 \wedge \dots \wedge C_p\) an instance of SAT problem consisting of p clauses \(C_j = l_{j,1} \vee \dots \vee l_{j,r_j}\), \(1 \le j \le p\), where \(Var(\varphi ) = \{x_1, \dots , x_n\}\), and \(l_{j,k} \in \{x_i, \lnot x_i \mid 1 \le i \le n\}\), \(1 \le j \le p, 1 \le k \le r_j\). Let us assume that the number of variables, n, and the number of clauses, p, of \(\varphi \), are greater than or equal to 2.

We consider the polynomial encoding (cods) from SAT in \(\mathbf{\Pi }\) defined as follows: for each \(\varphi \in I_{\mathtt{SAT}}\) with n variables and p clauses, \(s(\varphi ) = \langle n, p\rangle \) and

$$\begin{aligned} cod(\varphi )= & \{x_{i,j,0} \mid x_i \in C_j\} \, \cup \, \{\overline{x}_{i,j,0} \mid \lnot x_i \in C_j\} \\&\cup \, \{x^*_{i,j,0} \mid x_i \not \in C_j, \lnot x_i \not \in C_j\} \end{aligned}$$

For instance, the formula \(\varphi = (x_1 \vee x_2 \vee \lnot x_3) \wedge (\lnot x_2 \vee x_4) \wedge (\lnot x_2 \vee x_3 \vee \lnot x_4)\) is encoded as follows:

$$\begin{aligned} cod(\varphi ) = \left( \begin{array}{llll}x_{1,1,0} & x_{2,1,0} & \overline{x}_{3,1,0} & x^*_{4,1,0} \\ x^*_{1,2,0} & \overline{x}_{2,2,0} & x^*_{3,2,0} & x_{4,2,0} \\ x^*_{1,3,0} & \overline{x}_{2,3,0} & x_{3,3,0} & \overline{x}_{4,3,0} \end{array}\right) \end{aligned}$$

We use here matrix representation to make easier the view of the encoding, but let us recall that \(cod(\varphi )\) is a multiset of objects. We define \(cod_k(\varphi )\) as the set of elements of \(cod(\varphi )\) when the third subscript equals k. In the same way, we define \(cod'_k(\varphi )\), \(cod''_k(\varphi )\) and \(cod'''_k(\varphi )\) as the sets of elements of \(cod(\varphi )\) when the third subscript equals k and elements are primed, double primed and triple primed, respectively. For notation convenience, we define \(cod^j_k(\varphi )\) the subset of elements of \(cod_k(\varphi )\) with elements of \(C_j, \dots , C_p\). For instance, \(cod^2_4(\varphi )\) would be the following set:

$$\begin{aligned} cod^2_4(\varphi ) = \left( \begin{array}{llll} x^*_{1,2,4} & \overline{x}_{2,2,4} & x^*_{3,2,4} & x_{4,2,4} \\ x^*_{1,3,4} & \overline{x}_{2,3,4} & x_{3,3,4} & \overline{x}_{4,3,4} \end{array}\right) \end{aligned}$$

The Boolean formula \(\varphi \) will be processed by the system \(\Pi (s(\varphi )) + cod(\varphi )\). Next, we informally describe how that system works.

The solution proposed follows a brute force algorithm in the framework of recognizer tissue P systems with separation and evolutional communication rules, and it consists of the following stages:

  • Generation stage: using separation rules each 4 steps, we produce \(2^n\) membranes labelled by 2 containing each possible truths assignment. At the same time, we generate \(2^n\) copies of \(cod_n(\varphi )\). This stage spends n computation steps exactly, n being the number of variables of \(\varphi \).

  • First checking stage: With rules from 2.1, we can check which clauses from the input formula \(\varphi \) have been satisfied by a specific truth assignment. This stage takes exactly p steps.

  • Second checking stage: with rules from 3.1, we remove objects \(\alpha _j\) such that they are removed from a membrane if and only if the truth assignment associated to that membrane makes true clause \(C_j\). This stage takes exactly one step.

  • Output stage: with rules from 4.2 and 4.3, we can give an affirmative or a negative answer depending on if the input formula is satisfiable or not. This stage spends exactly 4 steps, regardless of whether the formula is satisfiable or not.

5 A formal verification

In this section, an exhaustive verification of the system is given.

5.1 Generation stage

At this stage, all truth assignments for the variables associated with the Boolean formula \(\varphi (x_1, \dots , x_n)\) are going to be generated, by applying separation rules from 1.2 in membranes labelled by 2. In such manner that in the \(4i+2\)-th step (\(1 \le i \le n-1\)) of this stage, separation rule associated with an object \(a_{i,i}\) is triggered, two new cells distributing \(t_i\) and \(f_i\) between them. In the last step of this stage, each membrane labelled by 2 will contain a truth assignment of the formula.

Proposition 2

Let \({{\mathcal {C}}} = ({{\mathcal {C}}}_0, {{\mathcal {C}}}_1, \dots , {{\mathcal {C}}}_q)\) be a computation of the system \(\Pi (s(\varphi ))\) with input multiset \(cod(\varphi )\), and let \(\mathcal {C}_{t}(h)\) the contents of the membrane labelled by h in the configuration \(\mathcal {C}_{t}\).

  • \((A_0)\) For each 4k (\(0 \le k \le n-1\)) at configuration \({{\mathcal {C}}}_{4k}\) we have the following:

    • \({{\mathcal {C}}}_{4k}(1) = \{\delta _{4k}, {\delta '}^{2^k}_{4k}, cod_k(\varphi )^{2^k}\} \cup \{ \beta ^{2^k}_{l,k} \mid k+1 \le l \le n\}\)

    • There are \(2^k\) membranes labelled by 2 such that each of them contains

      • objects \(a_{k+1,k}, \dots , a_{n,k}\);

      • objects \(r_1, \dots , r_k\), being \(r \in \{t, f\}\); and

      • objects \(\alpha _1, \dots , \alpha _{p+1}\).

  • \((A_1)\) For each \(4k+1\) (\(0 \le k \le n-1\)) at configuration \({{\mathcal {C}}}_{4k+1}\) we have the following:

    • \({{\mathcal {C}}}_{4k+1}(1) = \{\delta _{4k+1}, {\delta '}^{2^k}_{4k+1}, cod'_k(\varphi )^{2^k}\} \cup \{ {\beta '}^{2^k}_{l,k} \mid k+1 \le l \le n\}\)

    • There are \(2^k\) membranes labelled by 2 such that each of them contains

      • objects \(a'_{k+1,k}, \dots , a'_{n,k}\);

      • objects \(r''_1, \dots , r''_k\), being \(r \in \{t, f\}\)

      • an object \(t'_{k+1}\); and

      • objects \(\alpha '_1, \dots , \alpha '_{p+1}\).

  • \((A_2)\) For each \(4k+2\) (\(0 \le k \le n-1\)) at configuration \({{\mathcal {C}}}_{4k+2}\) we have the following:

    • \({{\mathcal {C}}}_{4k+2}(1) = \{\delta _{4k+2}, {\delta '}^{2^{k+1}}_{4k+3}, cod''_{k+1}(\varphi )^{2^{k+1}}\} \cup \)

      \( \{ {\beta ^O}^{2^k}_{l,k} \mid O \in \{L, R\}, k+1 \le l \le n\}\)

    • There are \(2^k\) membranes labelled by 2 such that each of them contains

      • objects \(a_{k+1,k}, \dots , a_{n,k}\);

      • objects \(r_1, \dots , r_k\), being \(r \in \{t, f\}\); and

      • objects \(\alpha _1, \dots , \alpha _{p+1}\).

  • \((A_3)\) For each \(4k+3\) (\(0 \le k \le n-1\)) at configuration \({{\mathcal {C}}}_{4k+3}\) we have the following:

    • \({{\mathcal {C}}}_{4k+3}(0) = \{{\beta ^O}^{2^k}_{k+1,k+1}\} \cup \{\beta ^{2^{k+1}}_{l, k+1} \mid k+2 \le l \le n\}\)

    • \({{\mathcal {C}}}_{4k+3}(1) = \{\delta _{4k+3}, {\delta '}^{2^{k+1}}_{4k+3}, cod'''_{k+1}(\varphi )^{2^{k+1}}\} \cup \{ \beta ^{2^k}_{l,k} \mid k+1 \le l \le n\}\)

    • There are \(2^{k+1}\) membranes labelled by 2 such that each of them contains

      • objects \(a_{k+1,k}, \dots , a_{n,k}\);

      • objects \(r_1, \dots , r_k\), being \(r \in \{t, f\}\); and

      • objects \(\alpha _1, \dots , \alpha _{p+1}\).

  • (B) \({{\mathcal {C}}}_{4n}(1) = \{\delta _{4n}, {\delta '}^{2^n}_{4n}, cod_{4n}(\varphi )^{2^n}\}\), and there are \(2^n\) membranes labelled by 2 such that each of them contains objects \(\alpha _1, \dots , \alpha _{p+1}\), as well as a different subset \(\{r_1, \dots , r_n\}\), being \(r \in \{t, f\}\).

Proof

\((A_{k}), 0 \le k \le 3\) is going to be demonstrated by induction on k.

\((A_0)\):

The base case \(k = 0\) is trivial because at the initial configuration we have: \({{\mathcal {C}}}_0(1) = \{\delta _0, \delta '_0, cod_0(\varphi )\} \cup \{\beta _{l,0} \mid 1 \le l \le n\}\) and there exists a single membrane labelled by 2 containing objects \(\alpha _1, \dots , \alpha _{p+1}\) and objects \(a_{1,0}, \dots , a_{n,0}\). Then, configuration \({{\mathcal {C}}}_0\) yields configuration \({{\mathcal {C}}}_1\) by applying the rules:

$$\begin{aligned}&\left. \begin{array}{l} [ \, a_{1,0} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a'_{1,0} \, t'_1 \, ]_2 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, a_{i,0} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a'_{i,0} \, ]_2 [\quad ]_{0} \end{array}\right. , \, \text{ for } \ 2 \le i \le n\\&\left. \begin{array}{l} [ \, \alpha _j \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, \alpha '_j \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p+1\\&\left. \begin{array}{l} [ \, \beta _{l,0} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \beta '_{l,0} \, ]_1 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le l \le n\\&\left. \begin{array}{ll} &[ \, x_{i,j,0} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x'_{i,j,1} \, ]_1 [\quad ]_0 \\ & [ \, \overline{x}_{i,j,0} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \overline{x}'_{i,j,1} \, ]_1 [\quad ]_0 \\ & [ \, x^*_{i,j,0} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {x^*}'_{i,j,1} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \ 1 \le i \le n, 1 \le j \le p\\&\left. \begin{array}{l} [ \, \delta _0 \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _1 \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_0 \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_1 \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$
\((A_1)\):

Thus, \({{\mathcal {C}}}_1(1) = \{\delta _1, \delta '_1, cod'_1(\varphi )\} \cup \{\beta '_{l,0} \mid 1 \le l \le n\}\) and in \({{\mathcal {C}}}_1\) there exists one membrane labelled by 2 such that its contents is the set of objects \(\{a'_{1,0}, \dots , a'_{n,0}\}\), the object \(t'_1\) and objects \(\alpha '_1, \dots , \alpha '_{p+1}\). Then, configuration \({{\mathcal {C}}}_1\) yields configuration \({{\mathcal {C}}}_2\) by applying the rules:

$$\begin{aligned}&\left. \begin{array}{ll} &[ \, a'_{1,0} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a_{1,1} \, f^R_1 \, ]_2 [\quad ]_0 \\ & [ \, t'_1 \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, t^L_1 \, ]_2 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, a'_{i,0} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a^L_{i,1} \, a^R_{i,1} \, ]_2 [\quad ]_0 \end{array}\right. , \text{ for } \ 2 \le i \le n\\&\left. \begin{array}{l} [ \, \alpha '_j \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, \alpha ^L_j \, \alpha ^R_j \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p+1 \\&\left. \begin{array}{l} [ \, \beta '_{l,0} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \beta ^L_{l,1} \, \beta ^R_{l,1} \, ]_1 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le l \le n \\&\left. \begin{array}{ll} &[ \, x'_{i,j,0} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x''^2_{i,j,1} \, ]_1 [\quad ]_0 \\ &\text{[ } \, \overline{x}'_{i,j,0} \, ]_1 [ \, \gamma \ ]_0 \rightarrow [ \, \overline{x}''^2_{i,j,0+1} \, ]_1 [\quad ]_0 \\ & [ \, {x^*}'_{i,j,0} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {x^*}''^2_{i,j,0+1} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \begin{array}{ll} &1 \le i \le n, \\ & 1 \le j \le p \end{array}\\&\left. \begin{array}{l} [ \, \delta _1 \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _2 \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_1 \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {\delta '}^2_2 \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$
\((A_2)\):

Thus, \({{\mathcal {C}}}_2(1) = \{\delta _2, {\delta '}^2_2, cod''_1(\varphi )\} \cup \{\beta ^O_{l,1} \mid O \in \{L, R\}, 1 \le l \le n\}\) and in \({{\mathcal {C}}}_2\) there exists one membrane labelled by 2 such that its contents is the set of objects \(\{a_{1,1}, \dots , a_{n,1}\}\), objects \(t^L_1\) and \(f^R_1\) and objects \(\alpha ^O_1, \dots , \alpha ^O_{p+1}\), for \(O \in \{L, R\}\). Then, configuration \({{\mathcal {C}}}_2\) yields configuration \({{\mathcal {C}}}_3\) by applying the rules:

$$\begin{aligned}&\left. \begin{array}{l} [ \, a_{1,1} \, ]_2 \rightarrow [ \, \Gamma _0 \, ]_2 [ \, \Gamma _1 \, ]_2 \end{array}\right. , \, \text{ for } \ 1 \le i \le n \\&\left. \begin{array}{ll} &[ \, \beta ^O_{1,1} \, ]_1 [\quad ]_0 \rightarrow [\quad ]_1 [ \, \beta ^O_{1,1} \, ]_0 \\ & [ \, \beta ^O_{l,1} \, ]_1 [\quad ]_0 \rightarrow [\quad ]_1 [ \, \beta _{l,1} \, ]_0 \end{array}\right\} \text{ for } \begin{array}{ll} &O \in \{L, R\}, \\ & 2 \le l \le n \end{array}\\&\left. \begin{array}{ll} &[ \, x''_{i,j,0} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x'''_{i,j,0} \, ]_1 [\quad ]_0 \\ & [ \, \overline{x}''_{i,j,0} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \overline{x}'''_{i,j,0} \, ]_1 [\quad ]_0 \\ & [ \, {x^*}''_{i,j,0} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {x^*}'''_{i,j,0} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \begin{array}{ll} &1 \le i \le n, \\ & 1 \le j \le p, \end{array}\\&\left. \begin{array}{l} [ \, \delta _2 \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _3 \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_2 \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_3 \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$
\((A_3)\):

Thus, \({{\mathcal {C}}}_3(1) = \{\delta _3, {\delta '}^2_3, cod'''_1(\varphi )\}\), at the environment there is the multiset \(\{\beta ^O_{1,1} \mid O \in \{L, R\}\} \cup \{\beta ^2_{l,1} \mid 2 \le l \le n\}\) and in \({{\mathcal {C}}}_2\) there exists two membranes labelled by 2 such that its contents is the set of objects \(\{a^O_{2,1}, \dots , a^O_{n,1}\}\) with \(O = L\) (resp., \(O = R\)), object \(t^L_1\) (resp., \(f^R_1\)) and objects \(\alpha ^O_1, \dots , \alpha ^O_{p+1}\), for \(O = L\) (resp., \(O = R\)). Hence, the result holds for \(k = 0\)

\(\bullet \) Supposing that, by induction, result is true for k (\(1 \le k \le n-1\)); that is,

  • \((A_0)\) For each 4k (\(0 \le k \le n-1\)) at configuration \({{\mathcal {C}}}_{4k}\) we have the following:

    • \({{\mathcal {C}}}_{4k}(1) = \{\delta _{4k}, {\delta '}^{2^k}_{4k}, cod_k(\varphi )^{2^k}\} \cup \{ \beta ^{2^k}_{l,k} \mid k+1 \le l \le n\}\)

    • There are \(2^k\) membranes labelled by 2 such that each of them contains

      • objects \(a_{k+1,k}, \dots , a_{n,k}\);

      • objects \(r_1, \dots , r_k\), being \(r \in \{t, f\}\); and

      • objects \(\alpha _1, \dots , \alpha _{p+1}\).

  • \((A_1)\) For each \(4k+1\) (\(0 \le k \le n-1\)) at configuration \({{\mathcal {C}}}_{4k+1}\) we have the following:

    • \({{\mathcal {C}}}_{4k+1}(1) = \{\delta _{4k+1}, {\delta '}^{2^k}_{4k+1}, cod'_k(\varphi )^{2^k}\} \cup \{ {\beta '}^{2^k}_{l,k} \mid k+1 \le l \le n\}\)

    • There are \(2^k\) membranes labelled by 2 such that each of them contains

      • objects \(a'_{k+1,k}, \dots , a'_{n,k}\);

      • objects \(r''_1, \dots , r''_k\), being \(r \in \{t, f\}\)

      • an object \(t'_{k+1}\); and

      • objects \(\alpha '_1, \dots , \alpha '_{p+1}\).

  • \((A_2)\) For each \(4k+2\) (\(0 \le k \le n-1\)) at configuration \({{\mathcal {C}}}_{4k+2}\) we have the following:

    • \({{\mathcal {C}}}_{4k+2}(1) = \{\delta _{4k+2}, , {\delta '}^{2^{k+1}}_{4k+2} cod''_{k+1}(\varphi )^{2^{k+1}}\} \cup \{ {\beta ^O}^{2^k}_{l,k} \mid O \in \{L, R\}, k+1 \le l \le n\}\)

    • There are \(2^k\) membranes labelled by 2 such that each of them contains

      • objects \(a_{k+1,k}, \dots , a_{n,k}\);

      • objects \(r^O_1, \dots , r^O_k\), being \(r \in \{t, f\}, O \in \{L, R\}\); and

      • objects \(\alpha ^O_1, \dots , \alpha ^O_{p+1}, O \in \{L, R\}\).

  • \((A_3)\) For each \(4k+3\) (\(0 \le k \le n-1\)) at configuration \({{\mathcal {C}}}_{4k+3}\) we have the following:

    • \({{\mathcal {C}}}_{4k+3}(0) = \{{\beta ^O}^{2^k}_{k+1,k+1}\} \cup \{\beta ^{2^{k+1}}_{l, k+1} \mid k+2 \le l \le n\}\)

    • \({{\mathcal {C}}}_{4k+3}(1) = \{\delta _{4k+3}, {\delta '}^{2^{k+1}}_{4k+3}, cod'''_{k+1}(\varphi )^{2^{k+1}}\}\)

    • There are \(2^{k+1}\) membranes labelled by 2 such that each of them contains

      • objects \(a_{k+1,k}, \dots , a_{n,k}\);

      • objects \(r^O_1, \dots , r^O_k\), being \(r \in \{t, f\}, O \in \{L, R\}\); and

      • objects \(\alpha ^O_1, \dots , \alpha ^O_{p+1}, O \in \{L, R\}\).

\(\bullet \) Then, by the induction hypothesis, we want to prove the result for \(k+1\).

  • \((A_0)\) Then, configuration \({{\mathcal {C}}}_{4k+3}\) yields configuration \({{\mathcal {C}}}_{4(k+1)}\) by applying the rules:

    $$\begin{aligned}&\left. \begin{array}{ll} &[ \, a^O_{i,j} \, ]_2 [ \, \beta ^O_{k+1,k+1} \, ]_0 \rightarrow [ \, a_{i,j} \, ]_2 [\quad ]_0 \\ & [ \, r^O_i \, ]_2 [ \, \beta ^O_{k+1,k+1} \, ]_0 \rightarrow [ \, r_i \, ]_2 [\quad ]_0 \end{array}\right\} \text{ for } \begin{array}{ll}& O \in \{L,R\}, \\ & r \in \{t,f\}, \\ & 1 \le i \le n, \\ & 1 \le j \le n\end{array}\\&\left. \begin{array}{l} [ \, \alpha ^O_j \, ]_2 [ \, \beta ^O_{k+1,k+1} \, ]_0 \rightarrow [ \, \alpha _j \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ O \in \{L, R\}, 1 \le j \le p+1\\&\left. \begin{array}{ll} &[ \, x'''_{i,j,k+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x_{i,j,k+1} \, ]_1 [\quad ]_0 \\ &\text{[ } \, \overline{x}'''_{i,j,k+1} \, ]_1 [ \, \gamma \ ]_0 \rightarrow [ \, \overline{x}_{i,j,k+1} \, ]_1 [\quad ]_0 \\ & [ \, {x^*}'''_{i,j,k+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x^*_{i,j,k+1} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \ 1 \le i \le n, 1 \le j \le p\\&\left. \begin{array}{l} [\quad ]_1 [ \, \beta _{l,k+1} \, ]_0 \rightarrow [ \, \beta _{l,k+1} \, ]_1 [\quad ]_0 \end{array}\right. , \, \text{ for } \ k+2 \le l \le n\\&\left. \begin{array}{l} [ \, \delta _{4k+3} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4(k+1)} \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_{4k+3} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_{4(k+1)} \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$

    Therefore, the following holds:

    • $$\begin{aligned} {{\mathcal {C}}}_{4(k+1)}(1)= & \{\delta _{4(k+1)}, {\delta '}^{2^{k+1}}_{4(k+1)}, cod_{k+1}(\varphi )^{2^{k+1}}\}\\&\cup \{ \beta ^{2^{k+1}}_{l,k+1} \mid k+2 \le l \le n\} \end{aligned}$$
    • There are \(2^{k+1}\) membranes labelled by 2 such that each of them contains

      • objects \(a_{k+2,k+1}, \dots , a_{n,k+1}\);

      • objects \(r_1, \dots , r_{k+1}\), being \(r \in \{t, f\}\); and

      • objects \(\alpha _1, \dots , \alpha _{p+1}\).

  • \((A_1)\) Then, configuration \({{\mathcal {C}}}_{4(k+1)}\) yields configuration \({{\mathcal {C}}}_{4(k+1)+1}\) by applying the rules:

    $$\begin{aligned}&\left. \begin{array}{l} [ \, a_{k+1,k} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a'_{k+1,k} \, t'_{k+1} \, ]_2 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{ll} &[ \, t_i \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, t''_i \, ]_2 [\quad ]_0 \\ & [ \, f_i \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, f''_i \, ]_2 [\quad ]_0 \end{array}\right\} \text{ for } \, 1 \le i \le k\\&\left. \begin{array}{l} [ \, a_{i,k+1} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a'_{i,k+1} \, ]_2 [\quad ]_0 \end{array}\right. , \text{ for } \ 2 \le i \le n\\&\left. \begin{array}{l} [ \, \alpha _j \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, \alpha '_j \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p+1 \\&\left. \begin{array}{l} [ \, \beta _{l,k+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \beta '_{l,k+1} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \ k+2 \le l \le n\\&\left. \begin{array}{ll} &[ \, x_{i,j,k+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x'_{i,j,k+1} \, ]_1 [\quad ]_0 \\ &\text{[ } \, \overline{x}_{i,j,k+1} \, ]_1 [ \, \gamma \ ]_0 \rightarrow [ \, \overline{x}'_{i,j,k+1} \, ]_1 [\quad ]_0 \\ & [ \, x^*_{i,j,k+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {x^*}'_{i,j,k+1} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \ 1 \le i \le n, 1 \le j \le p\\&\left. \begin{array}{l} [ \, \delta _{4(k+1)} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4(k+1)+1} \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_{4(k+1)} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_{4(k+1)+1} \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$

    Therefore, the following holds:

    • $$\begin{aligned} {{\mathcal {C}}}_{4(k+1)+1}(1)= & \{\delta _{4(k+1)+1}, {\delta '}^{2^{k+1}}_{4(k+1)+1}, cod'_{k+1}(\varphi )^{2^{k+1}}\}\\&\cup \{ {\beta '}^{2^{k+1}}_{l,k+1} \mid k+1 \le l \le n\} \end{aligned}$$
    • There are \(2^{k+1}\) membranes labelled by 2 such that each of them contains

      • objects \(a'_{k+2,k+1}, \dots , a'_{n,k+1}\);

      • objects \(r''_1, \dots , r''_{k+1}\), being \(r \in \{t, f\}\)

      • an object \(t'_{k+2}\); and

      • objects \(\alpha '_1, \dots , \alpha '_{p+1}\).

  • \((A_2)\) Then, configuration \({{\mathcal {C}}}_{4(k+1)+1}\) yields configuration \({{\mathcal {C}}}_{4(k+1)+2}\) by applying the rules:

    $$\begin{aligned}&\left. \begin{array}{ll}& [ \, a'_{k+1,k} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a_{k+1,k+1} \, f^R_{k+1} \, ]_2 [\quad ]_0 \\ & [ \, t'_{k+1} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, t^L_{k+1} \, ]_2 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{ll} &[ \, t''_i \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, t^L_i \, t^R_i \, ]_2 [\quad ]_0 \\ & [ \, f''_i \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, f^L_i \, f^R_i \, ]_2 [\quad ]_0 \end{array}\right\} \text{ for } \, 1 \le i \le k\\&\left. \begin{array}{l} [ \, a'_{i,k+1} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, a^L_{i,k+2} \, a^R_{i,k+2} \, ]_2 [\quad ]_0 \end{array}\right. , \text{ for } \ 2 \le i \le n\\&\left. \begin{array}{l} [ \, \alpha '_j \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, \alpha ^L_j \, \alpha ^R_j \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p+1 \\&\left. \begin{array}{l} [ \, \beta '_{l,k+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \beta ^L_{l,k+2} \, \beta ^R_{l,k+2} \, ]_1 [\quad ]_0 \end{array}\right. , \, \text{ for } \ k+2 \le l \le n\\&\left. \begin{array}{ll} &[ \, x'_{i,j,k+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x''^2_{i,j,k+2} \, ]_1 [\quad ]_0 \\ &\text{[ } \, \overline{x}'_{i,j,k+1} \, ]_1 [ \, \gamma \ ]_0 \rightarrow [ \, \overline{x}''^2_{i,j,k+2} \, ]_1 [\quad ]_0 \\ & [ \, {x^*}'_{i,j,k+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {x^*}''^2_{i,j,k+2} \, ]_1 [\quad ]_0 \end{array}\right\} \begin{array}{ll} &1 \le i \le n, \\ & 1 \le j \le p\end{array}\\&\left. \begin{array}{l} [ \, \delta _{4(k+1)+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4(k+1)+2} \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_{4(k+1)+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {\delta '}^2_{4(k+1)+2} \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$

    Therefore, the following holds:

    • \({{\mathcal {C}}}_{4(k+1)+2}(1) = \{\delta _{4(k+1)+2}, {\delta '}^{2^{k+2}}_{4(k+1)+2}, cod''_{k+2}(\varphi )^{2^{k+2}}\} \cup \{ \beta ^{2^{k+1}}_{l,k} \mid k+1 \le l \le n\}\)

    • There are \(2^{k+1}\) membranes labelled by 2 such that each of them contains

      • objects \(a_{k+2,k+1}, \dots , a_{n,k+1}\);

      • objects \(r_1, \dots , r_{k+1}\), being \(r \in \{t, f\}\); and

      • objects \(\alpha _1, \dots , \alpha _{p+1}\).

  • \((A_3)\) Then, configuration \({{\mathcal {C}}}_{4(k+1)+2}\) yields configuration \({{\mathcal {C}}}_{4(k+1)+3}\) by applying the rules:

    $$\begin{aligned}&\left. \begin{array}{l} [ \, a_{k+1,k+1} \, ]_2 \rightarrow [ \, \Gamma _0 \, ]_2 [ \, \Gamma _1 \, ]_2 \end{array}\right. , \, \text{ for } \ 1 \le i \le n \\&\left. \begin{array}{ll} &[ \, \beta ^O_{k+1,k+1} \, ]_1 [\quad ]_0 \rightarrow [\quad ]_1 [ \, \beta ^O_{k+1,k+1} \, ]_0 \\ & [ \, \beta ^O_{l,k+1} \, ]_1 [\quad ]_0 \rightarrow [\quad ]_1 [ \, \beta _{l,k+1} \, ]_0 \end{array}\right\} \text{ for } \ O \in \{L, R\}, k+2 \le l \le n\\&\left. \begin{array}{ll} &[ \, x''_{i,j,k+2} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x'''_{i,j,k+2} \, ]_1 [\quad ]_0 \\ & [ \, \overline{x}''_{i,j,k+2} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \overline{x}'''_{i,j,k+2} \, ]_1 [\quad ]_0 \\ & [ \, {x^*}''_{i,j,k+2} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, {x^*}'''_{i,j,k+2} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \begin{array}{ll} &1 \le i \le n, \\ & 1 \le j \le p \end{array}\\&\left. \begin{array}{l} [ \, \delta _{4(k+1)+2} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4(k+1)+3} \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_{4(k+1)+2} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_{4(k+1)+3} \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$

    Therefore, the following holds:

    • $$\begin{aligned} {{\mathcal {C}}}_{4(k+1)+3}(0)= & \{{\beta ^O}^{2^{k+1}}_{k+2,k+2}\}\\&\cup \{\beta ^{2^{k+2}}_{l, k+2} \mid k+3 \le l \le n\} \end{aligned}$$
    • \({{\mathcal {C}}}_{4(k+1)+3}(1) = \{\delta _{4(k+1)+3}, {\delta '}^{2^{k+2}}_{4(k+1)+3}, cod'''_{k+2}(\varphi )^{2^{k+2}}\} \cup \{ \beta ^{2^{k+1}}_{l,k+1} \mid k+2 \le l \le n\}\)

    • There are \(2^{k+2}\) membranes labelled by 2 such that each of them contains

      • objects \(a_{k+2,k+1}, \dots , a_{n,k+1}\);

      • objects \(r_1, \dots , r_{k+1}\), being \(r \in \{t, f\}\); and

      • objects \(\alpha _1, \dots , \alpha _{p+1}\).

  • In order to prove (B) it is enough to notice that, on the one hand, from \((A_3)\) configuration \({{\mathcal {C}}}_{4n-1}\)Footnote 4 holds:

    • \({{\mathcal {C}}}_{4n-1}(1) = \{\delta _{4n-1}, {\delta '}^{2^n}_{4n-1}, cod'''_n(\varphi )\}\).

    • There are \(2^n\) membranes labelled by 2 such that each of them contains

      • a different subset \(\{r^O_1, \dots , r^O_n\}\), being \(r \in \{t, f\}\) and \(O \in \{L, R\}\); and

      • objects \(\alpha ^O, \dots , \alpha ^O_{p+1}\), for \(O \in \{L, R\}\).

  • On the other hand, configuration \({{\mathcal {C}}}_{4n-1}\) yields configuration \({{\mathcal {C}}}_{4n}\) by applying the rules:

    $$\begin{aligned}&\left. \begin{array}{l} [ \, r^O_i \, ]_2 [ \, \beta ^O_{n,n} \, ]_0 \rightarrow [ \, r_i \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \begin{array}{l} O \in \{L,R\}, \\ r \in \{t,f\}, \\ 1 \le i \le n\end{array}\\&\left. \begin{array}{l} [ \, \alpha ^O_j \, ]_2 [ \, \beta ^O_{n,n} \, ]_0 \rightarrow [ \, \alpha _j \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ O \in \{L, R\}, 1 \le j \le p+1\\&\left. \begin{array}{ll} &[ \, x'''_{i,j,n} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x_{i,j,n} \, ]_1 [\quad ]_0 \\ & [ \, \overline{x}'''_{i,j,n} \, ]_1 [ \, \gamma \ ]_0 \rightarrow [ \, \overline{x}_{i,j,n} \, ]_1 [\quad ]_0 \\ & [ \, {x^*}'''_{i,j,n} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x^*_{i,j,n} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \ 1 \le i \le n, 1 \le j \le p\\&\left. \begin{array}{l} [ \, \delta _{4n-1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4n} \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_{4n-1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_{4n} \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$
  • Then, we have \({{\mathcal {C}}}_{4n}(1) = \{\delta _{4n}, {\delta '}^{2^n}_{4n}, cod_{4n}(\varphi )^{2^n}\}\), and there are \(2^n\) membranes labelled by 2 such that each of them contains objects \(\alpha _1, \dots , \alpha _{p+1}\), as well as a different subset \(\{r_1, \dots , r_n\}\), being \(r \in \{t, f\}\).

\(\square \)

5.2 First checking stage

Following the generation stage comes the first checking stage, where objects \(c_{j,j}\) are created in order to know if clause \(C_j\) has been satisfied by the truth assignment encoded in membranes labelled by 2. In each step, we fire rules for a single clause, therefore in p steps we can obtain objects \(c_{j,p}\) if this clause is satisfied. This can be because of two reasons:

  • Literal \(x_i\) appears in clause \(C_j\), and the truth value of variable \(x_i\) in a truth assignment is True. Then, we can say that such truth assignment satisfies this clause; or

  • Literal \(\lnot x_i\) appears in clause \(C_j\), and the truth value of variable \(x_i\) in a truth assignment is False. Then, we can say that such truth assignment satisfies this clause.

In any other way, variable \(x_i\) has nothing to do with clause \(C_j\). At the final step of this stage, membranes labelled by 2 will have objects \(c_{j,p}\) where \(C_j\) are clauses satisfied by such truth assignment. We obtain an object \(\alpha '_{p+1}\) to use it in the next stage.

Proposition 3

Let \({{\mathcal {C}}} = ({{\mathcal {C}}}_0, {{\mathcal {C}}}_1, \dots , {{\mathcal {C}}}_q)\) be a computation of the system \(\Pi (s(\varphi ))\) with input multiset \(cod(\varphi )\).

  1. (a)

    For each k (\(0 \le k \le p-1\)) at configuration \({{\mathcal {C}}}_{4n+k}\) we have the following:

    • \({{\mathcal {C}}}_{4n+k}(1) = \{\delta _{4n+k}, {\delta '}^{2^n}_{4n+k}, cod^k_n(\varphi )^{2^n}\}\)

    • There are \(2^n\) membranes labelled by 2 such that each of them contains

      • objects \(r_1, \dots , r_n\), being \(r \in \{t, f\}\);

      • objects \(\alpha _1, \dots , \alpha _{p+1}\); and

      • objects \(c_{1,k}, \dots , c_{k,k}\), where \(c_{j,k}\) represents that clause \(C_j\) has been satisfied by the truth formula encoded in such membrane.

  2. (B)

    \({{\mathcal {C}}}_{4n+p}(1) = \{\delta _{4n+p}, {\delta '}^{2^n}_{4n+p}\}\), and there are \(2^n\) membranes labelled by 2 such that each of them contains objects \(\alpha _1, \dots , \alpha _{p+1}\), a different subset \(\{r_1, \dots , r_n\}\) and objects \(c_j\) when clause \(C_j\) is satisfied in that membrane.

Proof

(a) is going to be demonstrated by induction on k.

  • (a) The base case \(k=0\) is trivial because at the initial configuration we have: \({{\mathcal {C}}}_{4n}(1) = \{\delta _{4n}, {\delta '}^{2^n}_{4n}, cod_{4n}(\varphi )\}\) and there exist \(2^n\) membranes labelled by 2 containing objects \(\alpha _1, \dots , \alpha _{p+1}\) and a different subset \(\{r_1, \dots , r_n\}\), being \(r \in \{t, f\}\). Then, configuration \({{\mathcal {C}}}_{4n}\) yields configuration \({\mathcal {C}}_{4n+1}\) by applying the rules:

    $$\begin{aligned}&\left. \begin{array}{ll} &[ \, t_i \, ]_2 [ \, x_{i,1,n} \, ]_1 \rightarrow [ \, c_{1,1} \, t_i \, ]_2 [\quad ]_1 \\ & [ \, t_i \, ]_2 [ \, \overline{x}_{i,1,n} \, ]_1 \rightarrow [ \, t_i \, ]_2 [\quad ]_1 \\ & [ \, t_i \, ]_2 [ \, x^*_{i,1,n} \, ]_1 \rightarrow [ \, t_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, x_{i,1,n} \, ]_1 \rightarrow [ \, f_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, \overline{x}_{i,1,n} \, ]_1 \rightarrow [ \, c_{1,1} \, f_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, x^*_{i,1,n} \, ]_1 \rightarrow [ \, f_i \, ]_2 [\quad ]_1 \end{array}\right\} \text{ for } \ 1 \le i \le n, 1 \le j \le p\\&\left. \begin{array}{ll} &[ \, x_{i,j,n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x_{i,j,n+k+1} \, ]_1 [\quad ]_0 \\ & [ \, \overline{x}_{i,j,n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \overline{x}_{i,j,n+k+1} \, ]_1 [\quad ]_0 \\ & [ \, x^*_{i,j,n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x^*_{i,j,n+k+1} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \ 1 \le i \le n, 2 \le j \le p\\&\left. \begin{array}{l} [ \, \delta _{4n} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4n+1} \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_{4n} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_{4n+1} \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$

    Thus, \({{\mathcal {C}}}_{4n+1}(1) = \{\delta _{4n+1}, {\delta '}^{2^n}_{4n+1}, cod^1_{4n+1}(\varphi )^{2^n}\}\) and in \({{\mathcal {C}}}_{4n+1}\) there exist \(2^n\) membranes labelled by 2 such that their contents are objects \(\alpha _1, \dots , \alpha _{p+1}\), a different subset \(\{r_1, \dots , r_n\}\), being \(r \in \{t, f\}\) and objects \(c_{1,1}\) if some literal present in \(C_j\) satisfies it.Footnote 5 Hence, the result holds for \(k=1\).

    Supposing that, by induction, result is true for k (\(0 \le k \le p-1\)); that is,

    • \({{\mathcal {C}}}_{4n+k}(1) = \{\delta _{4n+k}, {\delta '}^{2^n}_{4n+k}, cod^k_n(\varphi )^{2^n}\}\)

    • There are \(2^n\) membranes labelled by 2 such that each of them contains

      • objects \(r_1, \dots , r_n\), being \(r \in \{t, f\}\);

      • objects \(\alpha _1, \dots , \alpha _{p+1}\); and

      • objects \(c_{1,k}, \dots , c_{k,k}\), where \(c_{j,k}\) represents that clause \(C_j\) has been satisfied by the truth formula encoded in such membrane.

    Then, configuration \({{\mathcal {C}}}_{4n+k}\) yields configuration \({\mathcal {C}}_{4n+k+1}\) by applying the rules:

    $$\begin{aligned}&\left. \begin{array}{ll} &[ \, t_i \, ]_2 [ \, x_{i,k+1,n+k} \, ]_1 \rightarrow [ \, c_{k+1,k+1} \, t_i \, ]_2 [\quad ]_1 \\ & [ \, t_i \, ]_2 [ \, \overline{x}_{i,k+1,n+k} \, ]_1 \rightarrow [ \, t_i \, ]_2 [\quad ]_1 \\ & [ \, t_i \, ]_2 [ \, x^*_{i,k+1,n+k} \, ]_1 \rightarrow [ \, t_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, x_{i,k+1,n+k} \, ]_1 \rightarrow [ \, f_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, \overline{x}_{i,k+1,n+k} \, ]_1 \rightarrow [ \, c_{k+1,k+1} \, f_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, x^*_{i,k+1,n+k} \, ]_1 \rightarrow [ \, f_i \, ]_2 [\quad ]_1 \end{array}\right\} \text{ for } \ 1 \le i \le n, 1 \le j \le p\\&\left. \begin{array}{ll}& [ \, x_{i,j,n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x_{i,j,n+k+1} \, ]_1 [\quad ]_0 \\ & [ \, \overline{x}_{i,j,n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \overline{x}_{i,j,n+k+1} \, ]_1 [\quad ]_0 \\ & [ \, x^*_{i,j,n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, x^*_{i,j,n+k+1} \, ]_1 [\quad ]_0 \end{array}\right\} \text{ for } \ 1 \le i \le n, k+2 \le j \le p\\&\left. \begin{array}{l} [ \, c_{j,k} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, c_{j,k+1} \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p, k \le k \le p-1\\&\left. \begin{array}{l} [ \, \delta _{4n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4n+k+1} \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_{4n+k} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_{4n+k+1} \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$

    Thus, \({{\mathcal {C}}}_{4n+k+1}(1) = \{\delta _{4n+k+1}, {\delta '}^{2^n}_{4n+k+1}, cod^{k+1}_{4n+k+1}(\varphi )^{2^n}\}\) and in \({{\mathcal {C}}}_{4n+k+1}\) there exist \(2^n\) membranes labelled by 2 such that their contents are objects \(\alpha _1, \dots , \alpha _{p+1}\), a different subset \(\{r_1, \dots , r_n\}\), being \(r \in \{t, f\}\) and objects \(c_{1,k}, \dots , c_{k,k}\) if some literal present in \(C_j\) satisfies them.

In order to demonstrate (B) it is enough to notice that, on the one hand, from (a) configuration \({{\mathcal {C}}}_{4n+p-1}\) holds:

  • \({{\mathcal {C}}}_{4n+p-1}(1) = \{\delta _{4n+p-1}, {\delta '}^{2^n}_{4n+p-1}, cod^{p-1}_n(\varphi )^{2^n}\}\)

  • There are \(2^n\) membranes labelled by 2 such that each of them contains

    • objects \(r_1, \dots , r_n\), being \(r \in \{t, f\}\);

    • objects \(\alpha _1, \dots , \alpha _{p+1}\); and

    • objects \(c_{1,p-1}, \dots , c_{p-1,p-1}\), where \(c_{j,p-1}\) represents that clause \(C_j\) has been satisfied by the truth formula encoded in such membrane.

On the other hand, configuration \({{\mathcal {C}}}_{4n+p-1}\) yields configuration \({{\mathcal {C}}}_{4n+p}\) by applying the rules:

$$\begin{aligned}&\left. \begin{array}{ll}& [ \, t_i \, ]_2 [ \, x_{i,p,n+p-1} \, ]_1 \rightarrow [ \, c_{p,p} \, t_i \, ]_2 [\quad ]_1 \\ & [ \, t_i \, ]_2 [ \, \overline{x}_{i,p,n+p-1} \, ]_1 \rightarrow [ \, t_i \, ]_2 [\quad ]_1 \\ & [ \, t_i \, ]_2 [ \, x^*_{i,p,n+p-1} \, ]_1 \rightarrow [ \, t_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, x_{i,p,n+p-1} \, ]_1 \rightarrow [ \, f_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, \overline{x}_{i,p,n+p-1} \, ]_1 \rightarrow [ \, c_{p,p} \, f_i \, ]_2 [\quad ]_1 \\ & [ \, f_i \, ]_2 [ \, x^*_{i,p,n+p-1} \, ]_1 \rightarrow [ \, f_i \, ]_2 [\quad ]_1 \end{array}\right\} \text{ for } \ 1 \le i \le n, 1 \le j \le p\\&\left. \begin{array}{l} [ \, c_{j,p-1} \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, c_{j,p} \, ]_2 [\quad ]_0 \end{array}\right. , \, \text{ for } \ 1 \le j \le p-1\\&\left. \begin{array}{l} [ \, \delta _{4n+p-1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4n+p} \, ]_1 [\quad ]_0 \end{array}\right. \\&\left. \begin{array}{l} [ \, \delta '_{4n+p-1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta '_{4n+p} \, ]_1 [\quad ]_0 \end{array}\right. \end{aligned}$$

Then, we have \({{\mathcal {C}}}_{4n+p}(1) = \{\delta _{4n+p}, {\delta '}^{2^n}_{4n+p}\}\), and in \({{\mathcal {C}}}_{4n+p}\) there are \(2^n\) membranes labelled by 2 such that each of them contains a different subset \(\{r_1, \dots , r_n\}\), being \(r \in \{t, f\}\)Footnote 6, objects \(\alpha _1, \dots , \alpha _{p+1}\) and objects \(c_{j,p}\) when clause \(C_j\) has been satisfied by the truth assignment encoded in such membrane. \(\square \)

5.3 Second checking stage

Here, when rules from 3.1 are fired at the \((4n+p+1)\)-th step, objects \(\alpha _j\) within a membrane labelled by 2 are removed if and only if the truth assignment associated to that membrane makes true clause \(C_j\), that is, if there is at least one object \(c_j\) in such membrane. At configuration \({{\mathcal {C}}}_{4n+p}\) we have \({\mathcal {C}}_{4n+p}(1) = \{\delta _{4n+p}, {\delta '}^{2^n}_{4n+p}\}\) and each membrane labelled by 2 contains objects \(\alpha _1, \dots , \alpha _p\) and objects \(c_j\) such that the corresponding truth assignment satisfies the clause \(C_j\). By applying rules from 3.1 and rule \([ \, \delta _{4n+p} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4n+p+1} \, ]_1 [\quad ]_0\), object \(\delta _{4n+p}\) evolves into \(\delta _{4n+p+1}\) within the membrane labelled by 1, and in each membrane labelled by 2, objects \(\alpha _j\) such that their corresponding object \(c_{j,p}\) are “removed” from the system, and let the next stage to check whether or not they are present, besides the object \(\alpha _{p+1}\), that is prepared, evolving to \(\alpha '_{p+1}\), to react with the remaining objects \(\alpha _j\). This stage takes exactly one step.

5.4 Output stage

The output phase starts at the \((4n+p+2)\)-th step, and takes exactly four steps, regardless of whether the input formula \(\varphi \) is satisfied or not by some truth assignment.

  • Affirmative answer: if the input formula \(\varphi \) of SAT problem is satisfiable then at least one of the truth assignments from a membrane with label 2 has satisfied all clauses. Then, there will be a membrane labelled by 2 such that all objects \(\alpha _j\), with \(1 \le j \le p\) have disappeared in the previous step. At configuration \({{\mathcal {C}}}_{4n+p+1}\), we have \({{\mathcal {C}}}_{4n+p+1}(1) = \{\delta _{4n+p+1}\}\) and in each membrane labelled by 2 there remain objects \(\alpha _j\) if the corresponding truth assignment does not make true clause \(C_j\) and one object \(\alpha '_{p+1}\). In this step, only rule \([ \, \delta _{4n+p+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4n+p+2} \, ]_1 [\quad ]_0\) will be fired and rules \([ \, \alpha _j \, \alpha '_{p+1} \, ]_2 [\quad ]_0 \rightarrow [\quad ]_2 [ \, n_1 \, ]_0\) will be fired in membranes labelled by 2 such that at least one clause is not satisfied by the corresponding truth assignment. Then, at configuration \({{\mathcal {C}}}_{4n+p+2}\), we have \({{\mathcal {C}}}_{4n+p+2}(1) = \{\delta _{4n+p+2}, n^t_1\}\), being t the number of truth assignments that have at least one clause not satisfied by the corresponding truth assignment, and membranes labelled by 2 contains an object \(\alpha '_{p+1}\) if and only if the corresponding truth assignment makes true all clauses from \(\varphi \), and can contain objects \(\alpha _j\), \(1 \le j \le p\), if clause \(C_j\) is not satisfied by the corresponding truth assignment.

    In the next step, applying rules \([\quad ]_2 [ \, n_1 \, ]_0 \rightarrow [ \, n_1 \, ]_2 [\quad ]_0\) and \([ \, \alpha '_{p+1} \, ]_2 [ \, \delta _{4n+p+2} \, ]_1 \rightarrow [ \, y_1 \, ]_2 [\quad ]_1\), we obtain an object \(y_1\) in a membrane labelled by 2 if and only if the corresponding truth assignment makes true the input formula. Let us remark that more than one membrane labelled by 2 can contain a truth assignment that makes true \(\varphi \), but in this case, we as we want to know if at least one truth assignment makes true the input formula \(\varphi \), we only want one object \(y_1\). Then, at configuration \({{\mathcal {C}}}_{4n+p+3}\) we have that \({{\mathcal {C}}}_{4n+p+3}(1) = \emptyset \) and in membranes labelled by 2, we can have objects \(n_1\),Footnote 7 adding up to t in all membranes labelled by 2, being t the number of truth assignments that do not make true the input formula, an object \(\alpha '_{p+1}\) if the corresponding truth assignment makes true all clauses, excepting one membrane labelled by 2 which corresponding truth assignment makes true the input formula that will contain an object \(y_1\), and can contain objects \(\alpha _j\), \(1 \le j \le p\), if clause \(C_j\) is not satisfied by the corresponding truth assignment. In the next step the only rule that can be fired is \([ \, y_1 \, ]_2 [ \, \gamma \, ]_0 \rightarrow [ \, y_2 \, ]_2 [\quad ]_0\), that will be useful to synchronize the affirmative and the negative answer. Let us note that rule \([ \, n_1 \, ]_2 [ \, \delta _{4n+p+2} \, ]_1 \rightarrow [ \, n_2 \, ]_2 [\quad ]_1\) cannot be fired because object \(\delta _{4n+3}\) has been consumed in the previous step by an object \(\alpha '_{p+1}\). Then, at configuration \({{\mathcal {C}}}_{4n+p+4}\), we have that \({{\mathcal {C}}}_{4n+p+4}(1) = \emptyset \) and in membranes labelled by 2, we can have objects \(n_1\), adding up to t in all membranes labelled by 2, being t the number of truth assignments that do not make true the input formula, an object \(\alpha '_{p+1}\) if the corresponding truth assignment makes true all clauses, excepting one membrane labelled by 2 which corresponding truth assignment makes true the input formula that will contain an object \(y_2\), and can contain objects \(\alpha _j\), \(1 \le j \le p\), if clause \(C_j\) is not satisfied by the corresponding truth assignment. At the last step of the computation, rule \([ \, y_2 \, ]_2 [\quad ]_0 \rightarrow [\quad ]_2 [ \, \mathtt{yes} \, ]_0\) is fired, sending an object yes to the environment. Then, at configuration \({{\mathcal {C}}}_{4n+p+5}\), we have that \({{\mathcal {C}}}_{4n+p+5}(1) = \emptyset \) and in membranes labelled by 2, we can have objects \(n_1\), adding up to t in all membranes labelled by 2, being t the number of truth assignments that do not make true the input formula, an object \(\alpha '_{p+1}\) if the corresponding truth assignment makes true all clauses, excepting one membrane labelled by 2 which corresponding truth assignment makes true the input formula, and can contain objects \(\alpha _j\), \(1 \le j \le p\), if clause \(C_j\) is not satisfied by the corresponding truth assignment, and there will be an object yes in the environment. Here, the computation halts and returns an affirmative answer.

  • Negative answer: If the input formula \(\varphi \) of SAT problem is not satisfiable then none of the truth assignments encoded by a membrane labelled by 2 makes the formula \(\varphi \) true. Thus, some object \(\alpha _j\) (\(1 \le j \le p\)) will be within all membranes labelled by 2 will not remain in such membranes. At configuration \({{\mathcal {C}}}_{4n+p+1}\), we have \({{\mathcal {C}}}_{4n+p+1}(1) = \{\delta _{4n+p+1}\}\) and in each membrane labelled by 2 there remain objects \(\alpha _j\) if the corresponding truth assignment does not make true clause \(C_j\). In this step, only rules \([ \, \alpha _j \, \alpha '_{p+1} \, ]_2 [\quad ]_0 \rightarrow [\quad ]_2 [ \, n_1 \, ]_0\), for \(1 \le j \le p\) and rule \([ \, \delta _{4n+p+1} \, ]_1 [ \, \gamma \, ]_0 \rightarrow [ \, \delta _{4n+p+2} \, ]_1 [\quad ]_0 \) will be fired. Then, at configuration \({{\mathcal {C}}}_{4n+p+2}\) we have in the environment \(2^n\) copies of object \(n_1\), \({{\mathcal {C}}}_{4n+p+2}(1) = \{\delta _{4n+p+2}\}\) and membranes labelled by 2 will contain objects \(\alpha _j\) (\(1 \le j \le p\)) when clauses \(C_j\) are not satisfied by the corresponding truth assignment. In the \((4n+p+3)\)-th step, rule \([\quad ]_2 [ \, n_1 \, ]_0 \rightarrow [ \, n_1 \, ]_2 [\quad ]_0\) will be fired. Here, objects \(n_1\) will be sent to a membrane labelled by 2. Then, at configuration \({{\mathcal {C}}}_{4n+p+3}\) we have \({{\mathcal {C}}}_{4n+p+3}(1) = \{\delta _{4n+p+2}\}\) and membranes labelled by 2 contain objects \(\alpha _j\) (\(1 \le j \le p\)) if clause \(C_j\) is not satisfied by the corresponding truth assignment, and can contain t objects \(n_1\) (\(0 \le t \le 2^n\)). At the \((4n+p+4)\)-th step rule \([ \, n_1 \, ]_2 [ \, \delta _{4n+p+2} \, ]_1 \rightarrow [ \, n_2 \, ]_2 [\quad ]_1\) is fired, since object \(\delta _{4n+3}\) has not been consumed by any rule from 4.3, creating an object \(n_2\) in a membrane labelled by 2. Then, at configuration \({{\mathcal {C}}}_{4n+p+4}\) we have \({{\mathcal {C}}}_{4n+p+4}(1) = \emptyset \) and membranes labelled by 2 contain objects \(\alpha _j\) (\(1 \le j \le p\)) if clause \(C_j\) is not satisfied by the corresponding truth assignment, and can contain t objects \(n_1\) (\(0 \le t \le 2^n\)), and one of them contains an object \(n_2\). At the last step of the computation, rule \([ \, n_2 \, ]_2 [\quad ]_0 \rightarrow [\quad ]_2 [ \, \mathtt{no} \, ]_0\) is fired, sending an object no to the environment. Then, at configuration \({{\mathcal {C}}}_{4n+p+5}\) we have that \({{\mathcal {C}}}_{4n+p+5}(1) = \emptyset \) and membranes labelled by 2 contain objects \(\alpha _j\) (\(1 \le j \le p\)) if clause \(C_j\) is not satisfied by the corresponding truth assignment, and can contain t objects \(n_1\) (\(0 \le t \le 2^n\)), and there will be an object no in the environment. Here, the computation halts and returns a negative answer.

Fig. 1
figure 1

Computational efficiency of membrane systems from \(\mathbf{TSEC}(k_{1}, k_{2})\)

5.5 Result

Proof

The family of P systems previously constructed verifies the following:

  • Every system of the family \(\mathbf{\Pi }\) is a recognizer P systems from \({\mathcal {TSEC}}(2,2)\).

  • The family \(\mathbf{\Pi }\) is polynomially uniform by Turing machines because for each \(n,p \in \mathbb {N}\), the rules of \(\Pi (\langle n, p \rangle )\) of the family are recursively defined from \(n,p \in \mathbb {N}\), and the amount of resources needed to build an element of the family is of a polynomial order in n and p, as shown below:

    • Size of the alphabet: \(9n^2p+6n^2+\frac{3np^2}{2}-3np+22n+\frac{p^2}{2}+\frac{13p}{2}+14 \in \Theta (max\{n^2p,np^2\})\).

    • Initial number of cells: \(2 \in \Theta (1)\).

    • Initial number of objects in cells: \(n^2 + n(p+2) + p + 3 \in \Theta (n^2)\).

    • Number of rules: \(8n^3+\frac{27n^2p}{2}+4n^1+\frac{19np}{2}+23n+\frac{p^2}{2}+\frac{17p}{2}+11 \in \Theta (n^3)\).

    • Maximal number of objects involved in any rule: \(4 \in \Theta (1)\).

  • The pair (cods) of polynomial-time computable functions defined fulfil the following: for each input formula \(\varphi \) of SAT problem, \(s(\varphi )\) is a natural number, \(cod(\varphi )\) is an input multiset of the system \(\Pi (s(\varphi ))\), and for each \(n \in \mathbb {N}\), \(s^{-1}(n)\) is a finite set.

  • The family \(\mathbf{\Pi }\) is polynomially bounded: indeed for each input formula \(\varphi \) of SAT problem, the deterministic P system \(\Pi (s(\varphi )) + cod(\varphi )\) takes exactly \(4n+p+5\) steps, being n the number of variables of \(\varphi \) and p the number of clauses.

  • The family \(\mathbf{\Pi }\) is sound with regard to (Xcods): indeed, for each formula \(\varphi \), if the computation of \(\Pi (s(\varphi )) + cod(\varphi )\) is an accepting computation, then \(\varphi \) is satisfiable.

  • The family \(\mathbf{\Pi }\) is complete with regard to (Xcods): indeed, for each input formula \(\varphi \) such that it is satisfiable, the computation of \(\Pi (s(\varphi )) + cod(\varphi )\) is an accepting computation.

\(\square \)

Corollary 4

\(\mathbf{NP} \cup \mathbf{co-NP} \subseteq \mathbf{PMC}_{{\mathcal {TSEC}}(2,2)}\).

Proof

It suffices to notice that SAT problem is a NP-complete problem, SAT \(\in \) PMC\(_{{\mathcal {TSEC}}(2,2)}\), and the complexity class \(\mathbf{PMC}_{{\mathcal {TSEC}}(2,2)}\) is closed under polynomial-time reduction and under complement. \(\square \)

6 Conclusions and future work

Pan et al. (2018), a tight frontier of efficiency in the framework of tissue P systems with evolutional symport/antiport rules and cell separation is defined by the length of the right-hand side of communication rules; that is, passing from 1 object to 2 objects is enough to pass from non-efficiency to presumable efficiency while the length of the left-hand side is at least 3. This result was demonstrated by giving a solution of the SAT problem by means of a family of P system from \({\mathcal {TSEC}}(3,2)\). But an open problem was opened here: what happens with P systems from \({\mathcal {TSEC}}(k,2)\) (\(k \ge 2\))? Can we solve computationally hard problems restricting the length of the LHS to 2?

In this paper, we focus on this topic, and we give an efficient solution to the \(\mathbf{SAT}\) problem by means of a family of P systems from \({\mathcal {TSEC}}(2,2)\), filling the gap previously open. Then, we can conclude here with a similar figure to the one presented in Pan et al. (2018), but while in the reference there are question marks in the second column from (2, 2) upwards, we have closed this problem giving demonstrating that with these types of P systems presumably hard computational problems can be efficiently solved.

Of course, after this work we can define several clear research lines to continue investigating these kinds of P systems.

  • What happens when the environment “disappears”?

  • Do the structure matter? By this we mean using cell-like structure with this kind of rules.

  • In Song et al. (2017) another definition of length is given. Let k be the length of the rule defined as follows: if \(r \equiv [ \, u \, ]_{i} [ \, v \, ]_{j} \rightarrow [ \, v' \, ]_{i} [ \, u' \, ]_{j}\), \(k = \ \mid u \mid +\mid v \mid +\mid u' \mid +\mid v' \mid \). Then the complexity class of tissue P systems with evolutional communication rules with at most length k and cell separation is denoted by \(\mathbf{PMC}_{{\mathcal {TSEC}}(k)}\). What are the borderline here?

  • What is the upper bound of these systems? Leporati et al. (2017) a characterization of tissue P systems with symport/antiport rules and both cell division and separation is given matching their efficiency to the class \(\mathbf{P}^{\#\mathbf{P}}\), and it seems that this class of P system can reach the same complexity class.