1 Introduction

Reaction systems are modelling interactions between biochemical entities using the mechanisms of facilitation and inhibition [13]. There exist two major assumptions in reaction systems: (1) threshold assumption: if a resource is present in the system, then it is present in a ‘sufficient amount’ such that several reactions needing such a resource will not be in conflict (from a mathematical point of view, this is equivalent to having an infinite multiplicity for each resource); (2) no permanency assumption: an entity will vanish from the current state unless it is produced by one of the reactions enabled in that state. In the standard setup, the set of reactions does not change over time and there are no constraints over rules. The existing extensions of the reaction systems deal with time [9], context [5, 6] and structure [7, 15]. In [11], there are considered reaction systems in which the set of reactions is allowed to change over time. A different approach is taken in [4], where a directed graph is used to define a priority relation among reactions; this mechanism is encoded in the reaction system using certain inhibitors. In this paper, we define restricted reaction systems such that the set of available reactions does not change over time, but there exists a relation that forbids two reactions to be applied in the same step. This relation is different from the relation used in [4], as it allows at any step only one rule (non-deterministically chosen) of the two involved rules to be applied.

Reversibility appears naturally in chemical and biological systems. Since it plays a crucial role in many processes, reversibility started to be taken into account in natural computing by extending the standard forwards-only mode of computation with the ability to execute also reversely, such that a computation can run backwards as naturally as it can go forwards. Two forms of reversibility are backtracking and causally consistent reversibility [10, 17]. Backtracking executes exactly the reverse order of the forward execution, and causally consistent reversibility executes effects before causes, but not necessarily in exact reverse order. Beyond backtracking and causally consistent reversibility, there is a more general form of reversibility (known as out-of-causal-order reversibility) which makes it possible to get to states which cannot be reached only by forward steps; such sequences of forward and reverse steps are important as they can lead to new chemical structures and new reactions which would not be possible without out-of-causal-order reversibility [21].

It is worth pointing out that there exist both controlled and uncontrolled reversibility. In controlled reversibility, the computation is reversed only when there exists a specific context, namely an environmental modification. Uncontrolled reversibility means that reversing a system is done without indicating exactly when backward steps are executed. While in [2], we investigated a controlled reversibility in reaction systems, in this paper, we consider uncontrolled reversibility in both reaction systems and restricted reaction systems.

The structure of the paper is as follows. Section 2 recalls the main notions of reaction systems. In Sect. 3, we define the restricted reaction systems, and study their behaviours in comparison with reaction systems. In Sect. 4, we demonstrate a close relationship between reaction systems and restricted reaction systems. In Sect. 5, we study the reversibility in both restricted reaction systems and reaction systems. Conclusion and references end the paper.

2 Reaction systems

Reaction systems (abbreviated as RS) are used for modelling processes driven by biochemical reactions; the fundamental idea in this framework is that the biochemical reactions are based on facilitation and inhibition [8]. Thus, a reaction is modelled as a triplet: a set of reactants, a set of inhibitors, and a set of products. A reaction can take place in a given state if all its reactants are present in that state, and none of its inhibitors are present; when triggered, the reaction creates its products. We recall in what follows some elementary notions and notations about reaction systems, as they are presented in [8].

First we recall some basic mathematical notions concerning sets. For a finite set X, |X| denotes its cardinality, \(2^X\) denotes the set of all subsets of X, and \(\emptyset \) denotes the empty set. For sets X and Y, \(X\backslash Y\) denotes their difference, \(X\cup Y\) denotes their union, \(X\cap Y\) denotes their intersection, \(X\times Y\) denotes their Cartesian product, while \(X\subseteq Y\) denotes the (not necessarily strict) inclusion of X in Y.

Let S be an alphabet; its elements are called molecules or symbols. A reaction over S is a triple \(a = (R, I, P)\), where R, I, P are non-empty subsets of S such that \(R \cap I = \emptyset \). R is the reactant set of a, I is the inhibitor set of a, and P is the product set of a; R, I, P are also denoted as \(R_a\), \(I_a\), \(P_a\), respectively. We denote by \(\mathrm{{rac}}(S)\) the set of all reactions in S.

Notice that the conditions \(R \ne \emptyset \) and \(I \ne \emptyset \) are required such that P is produced from at least one reactant, and that every reaction can be inhibited in some way. However, according to [8], we can also consider reactions with \(I=\emptyset \) due to the fact that a reaction without an inhibitor can be simulated by introducing a ‘dummy’ inhibitor that is never produced by any reaction. How this works is illustrated in Example 1, where such an inhibitor \(d_I\) is used.

Given a configuration \(T \subseteq S\) and a reaction \(a \in \mathrm{{rac}}(S)\), a is enabled by T (denoted by \(a~\mathrm{{en}}~T\)) if \(R_a \subseteq T\) and \(I_a \cap T = \emptyset \). The result \(\mathrm{{res}}(a,T)\) of a on T is defined by \(\mathrm{{res}}(a,T) = P_a\). This reaction can be written as a rewrite of the form \(T \xrightarrow {a} \mathrm{{res}}(a,T)\). If a is not enabled by T, then \(\mathrm{{res}}(a,T ) = \emptyset \); the fact that T cannot be rewritten by applying a is written as \(T \nrightarrow {a}\).

If A is a finite set of reactions, then the result of A on T is defined by \(\mathrm{{res}}(A,T ) = \bigcup _{a \in A} \mathrm{{res}}(a,T )\). This can be written as \(T \xrightarrow {A} \mathrm{{res}}(A, T)\). The activity of a set of reactions A on a finite set T is defined by \(\mathrm{{en}}(A,T) = \{a \in A \mid a~\mathrm{{en}}~T\}\). Thus, \(\mathrm{{en}}(A,T)\) is the set of all reactions from A which are enabled by T. Note that \(\mathrm{{res}}(A,T) = \mathrm{{res}}(\mathrm{{en}}(A,T),T)\), namely only the reactions from A which are enabled on T contribute to the result of A on T. According to [14], a set of reactions A is consistent if \(R_A \cap I_A = \emptyset \), namely \(R_a \cap I_b = \emptyset \) for any two reactions \(a,b \in A\).

A reaction system is an ordered pair \({\mathcal {A}} = (S, A)\), where S is an alphabet and \(A \subseteq \mathrm{{rac}}(S)\). The dynamic behaviour of the reaction systems is captured through the notion of an interactive process defined as follows.

Definition 1

Let \({\mathcal {A}} = (S, A)\) be a reaction system. An interactive process \(\pi \) in \(\mathcal {A}\) is a pair \((\gamma , \delta )\) of finite sequences such that \(\gamma =C_0, C_1, \ldots , C_{n}\), \(\delta = D_1, \ldots , D_n\) with \(n \ge 1\), where \(C_0,\ldots ,C_{n}\), \(D_1,\ldots ,D_n \subseteq S\), \(D_1 = \mathrm{{res}}(A,C_0)\), and \(D_i = \mathrm{{res}}(A,D_{i-1} \cup C_{i-1})\) for each \(2\le i\le n\).

The sequences \(C_0,\ldots ,C_{n}\) and \(D_1, \ldots , D_n\) represent the context and result sequences of the interactive process \(\pi \), respectively. Context \(C_0\) is the initial state of \(\pi \) (the state in which the interactive process is initiated), and the contexts \(C_1, \ldots , C_{n}\) represent the influence of the environment to the computation. Just like in [16], this sequence formalizes the fact that we work with an open system, meaning that its behaviour (interactive processes in \(\mathcal {A}\)) is influenced by the environment. It is possible to consider also working with a closed system whose interactive processes are not influenced by the environment any longer after the initial context \(C_0\) is provided.

The sequence \(\mathrm{{sts}}(\pi ) = W_0, \ldots , W_n\) denotes the state sequence of the interactive process \(\pi \), where \(W_0 = C_0\) (the initial state), and \(W_i = D_i \cup C_i\) for all \(1\le i\le n\). The sequence \(\mathrm{{act}}(\pi )= E_0, \ldots , E_{n-1}\) of subsets of A such that \(E_i = \mathrm{{en}}(A,W_i)\) for all \(0 \le i \le n-1\) represents the activity sequence of the interactive process \(\pi \). Thus, the evolution of the system can be written as

$$\begin{aligned} W_0 \xrightarrow {E_0} W_1 \xrightarrow {E_1} \cdots \xrightarrow {E_{n-1}} W_n . \end{aligned}$$

Notice that, due to the threshold assumption, each molecule can evolve by means of several reactions (or can inhibit several reactions if it appears in inhibitor sets), while, due to the no permanency assumption, the computation continues with the set of molecules produced by the reactions to which is added the set of molecules provided by the context.

Example 1

To illustrate the reaction systems for the molecular heat-shock response introduced in [20], we present one of the reaction systems given in [4]. The heat-shock response in eukaryotes is a fundamental defence mechanism which allows cells to react to environmental changes, as an increase of environmental temperature might result in cell death. The key elements for the heat-shock response mechanism are

  • the proteins in the cell (\({ prot}\));

  • the heat-shock proteins (\({ hsp}\));

  • the misfolded proteins (\({ mfp}\));

  • the heat-shock factors (\({ hsf}\));

  • the dimerized heat-shock factors (\({ hsf}_2\));

  • the trimerize heat-shock factors (\({ hsf}_3\));

  • the heat shock-element (\({ hse}\)).

The reactions among these key elements for the heat-shock response mechanism are listed in Table 1.

Table 1 The molecular model for the eukaryotic heat-shock response [20]

Table 2 contains the simplified reactions obtained as a direct translation of the reactions of Table 1. The dummy variable \(d_I\) is used only to comply with the constraint of reaction systems requiring that the set of inhibitors of all reactions in a reaction system should not be empty.

Table 2 The simplified model of the heat shock response as a reaction system [4]

The interactive process of this reaction system, when starting from context \(\{{ hsf}, { prot}, { hse}\}\) and using afterwards an empty context, enters a loop of length two as depicted in Fig. 1.

Fig. 1
figure 1

The interactive process of the simplified model of the heat-shock response [4], where the circles contain the \(D_i\) sets, while the sets \(C_i\) and \(r_i\) are placed on the arrows

Notice that the system allows a loop of length one when starting from the context \(\{{ hsf},{ hsf}_3\}\), using afterwards an empty context (see Fig. 2). According to [4], the system should not even allow the state \(\{{ hsf},{ hsf}_3\}\) because a single form of \({ hsf}\) should be present at any moment in the system.

Fig. 2
figure 2

An interactive process when \(C_0=\{{ hsf},{ hsf}_3\}\)

It turns out that the reaction system of Table 2 leads to a behaviour (see Fig. 1) that is different from the one given in [20]. To overcome this problem, in [4] is constructed a second reaction system based on constraints over states and on a concept of dominance graph capturing the competition on resources as in [20]. In this paper, we propose a different approach of this problem by introducing the ‘mutually exclusive rules’ in reaction systems.

3 Mutually exclusive reactions

In a reaction system \({\mathcal {A}}=(S,A)\), the set A of available reactions does not change over time. If W is the state of \({\mathcal {A}}\) at a certain step, then the reactions from A enabled by W transform W into \(\mathrm{{res}}(A,W)\) which together with the context set available at this step form the successor state of W. This setup is generalized in [11]: as a process advances from a state W to its successor \(W'\), also the set of available reactions changes from A in W to \(A'\) in \(W'\).

The approach in [4] presents the competition between two reactions a and b in terms of a directed graph, where an edge \(a \rightarrow b\) describes two reactions competing for a common resource, while reaction a has priority over reaction b. This means that if both reactions are enabled, then only reaction a is applicable. This mechanism is encoded in the reaction system using certain inhibitors such that the reaction b cannot be triggered if reaction a is enabled.

In what follows, we consider that the set of available reactions does not change over time, but we use a relation # that forbids two reactions a and b to be applied in the same step. The relation # is different from the relation presented in [4] because it allows in any step to apply only one of the two rules, a rule which is non-deterministically chosen.

The mutual exclusion relation \(\#\subseteq \{(a,b) \mid a,b \in A, a\ne b\}\) contains pairs of reactions that are mutually exclusive, namely they cannot be applied in the same step. It is used also the notation \(a\#b\) for \((a,b)\in \#\). We extend in what follows the notions defined in Sect. 2 to take into account also the effect of the mutual exclusion relation # . The activity of a set of reactions A on a finite set T with respect to # is defined recursively by \(\mathrm{{en}}(A,\#,T) =\).

\({\left\{ \begin{array}{ll} \{a\} \cup \mathrm{{en}}(A\backslash \{a,b\},\#,T), \{b\}\cup \mathrm{{en}}(A\backslash \{a,b\},\#,T)&{} \text{ if } a\# b, a~\mathrm{{en}}~T, b~\mathrm{{en}}~T\\ \{a\} \cup \mathrm{{en}}(A\backslash \{a,b\},\#,T) &{} \text{ if } a\# b, a~\mathrm{{en}}~T, T\nrightarrow {b}\\ \{a\} \cup \mathrm{{en}}(A\backslash \{a\},\#,T) &{} \text{ if } \not \exists b\ s.t.\ a\#b, a~\mathrm{{en}}~T \\ \emptyset &{} \text{ otherwise } \end{array}\right. }\).

In the first case, the fact that two mutually exclusive reactions are both enabled leads to the construction of two sets of reactions enabled in T with respect to the mutual exclusion relation \(\#\), namely the sets \(\{a\} \cup \mathrm{{en}}(A\backslash \{a,b\},\#,T)\) and \(\{b\}\cup \mathrm{{en}}(A\backslash \{a,b\},\#,T)\). The notation \(\{a\} \cup \mathrm{{en}}(A\backslash \{a,b\},\#,T)\) means that once reaction a is chosen to be applied, we no longer need to test for the application of reactions a and b anymore. In the second case, we consider the situation when a reaction a is enabled, and a mutually exclusive reaction is not enabled, while in the third case, we consider the situation when a reaction a that does not appear in \(\#\) is enabled.

Thus, \(\mathrm{{en}}(A,\#,T)\) is the set containing all sets of reactions from A that are enabled by T with respect to the mutual exclusion relation #. Notice that \(\mathrm{{res}}(A,\#,T) = \{ \mathrm{{res}}(B,T) \mid B \in \mathrm{{en}}(A,\#,T)\}\); this means that \(\mathrm{{res}}(A,\#,T)\) is the set containing all sets of products obtained only using the sets of reactions \(B \subseteq A\) which are enabled by T with respect to # and contribute to the results of A on T. Comparing with the classical reaction systems in which we get a single result, in this new approach we obtain a set of possible results. Thus, we move from a deterministic approach to a non-deterministic one.

A restricted reaction system is an ordered pair \({\mathcal {A}}_r = (S, A, \#)\), where S is an alphabet, \(A \subseteq \mathrm{{rac}}(S)\) and \(\#\subseteq \{(a,b) \mid a,b \in A, a\ne b\}\). The dynamic behaviour of the restricted reaction systems is captured through the notion of interactive processes.

Definition 2

Let \({\mathcal {A}}_r = (S, A,\#)\) be a restricted reaction system. An interactive process \(\pi \) in \(\mathcal {A}_r\) is a set of pairs \((\gamma , \delta )\) of finite sequences such that \(\gamma =C_0, C_1, \ldots , C_{n}\), \(\delta = D_1, \ldots , D_n\) with \(n \ge 1\), where \(C_0,\ldots ,C_{n}\), \(D_1,\ldots ,D_n \subseteq S\), \(D_1 \in \mathrm{{res}}(A,\#,C_0)\), and \(D_i \in \mathrm{{res}}(A,\#,D_{i-1} \cup C_{i-1})\) for each \(2\le i\le n\).

Just like in the traditional reaction systems, the sequences \(C_0,\ldots ,C_{n}\) and \(D_1,\ldots ,D_n\) are the context and result sequences of the interactive process\(~\pi \), respectively. The main difference is that instead of obtaining a unique sequence \(D_1, \ldots , D_n\), we obtain a set of possible sequences. Due to the finiteness of the set S, the set of possible sequences is also finite. Just like for the traditional reaction systems, an open restricted reaction system means that its behaviour (interactive processes in \(\mathcal {A}_r\)) is influenced by the environment, while a closed restricted reaction system means that its behaviour is influenced by the environment only through the initial context \(C_0\).

The sequence \(\mathrm{{rsts}}(\pi ) = W_0, \ldots , W_n\) denotes the restricted state sequence of the interactive process \(\pi \), where \(W_0 = C_0\) (the initial state), and \(W_i = D_i \cup C_i\) for all \(1\le i\le n\). The sequence \(\mathrm{{ract}}(\pi )= E_0, \ldots , E_{n-1}\) of subsets of A such that \(E_i \in \mathrm{{en}}(A,\#,W_i)\) for all \(0\le i\le n-1\) represents the restricted activity sequence of \(\pi \). Thus, each possible evolution of the system can be written as

We use two different notations to distinguish between the evolutions of reaction systems and of restricted reaction systems, namely \({\xrightarrow {}}\) and . Notice that our restriction on the application of the rules has no effect on the major assumptions imposed of the reaction systems: threshold and no permanency.

Example 2

As already discussed in Example 1, the state \(\{{ hsf},{ hsf}_3\}\) is bad; it should not be allowed because a single form of \({ hsf}\) should be present at any moment in the system. In our approach, we allow such an initial state. However, using the mutual exclusion relation # and due to the non-permanency assumption, we are able to control the evolution of the restricted reaction system such that all the continuations lead only to good states. This is depicted in Fig. 3, where only two evolutions are possible, and both evolve from the bad state to good ones only in one step.

Fig. 3
figure 3

The interactive processes when \(C_0=\{{ hsf},{ hsf}_3\}\) and \(\#=\{((i),(ii))\}\)

4 Traditional and restricted reaction systems

We present a strong relationship between traditional reaction systems and restricted reaction systems by showing how to simulate the behaviour of reaction systems by interactive processes in restricted reaction systems, and how to simulate the behaviour of restricted reaction systems by interactive processes in reaction systems. While simulation of reaction systems by restricted reaction systems works regardless if the reaction systems are closed or open, the reverse simulation of restricted reaction systems by reaction systems is possible only using open reaction systems. This means that the restricted reaction systems are more expressive than the reaction systems (due to the use of the mutual exclusion relation \(\#\)).

Proposition 1

Given a reaction system \(\mathcal {A}=(S,A)\) and an interactive process \(\pi \) with \(\mathrm{{sts}}(\pi ) = W_0, \ldots , W_n\) and \(\mathrm{{act}}(\pi ) = E_0, \ldots , E_{n-1}\), there exists a restricted reaction system \(\mathcal {A}_r=(S',A',\#)\) such that \(\mathrm{{rsts}}(\pi ) = W_0, \ldots , W_n\) and \(\mathrm{{ract}}(\pi ) = E_0, \ldots , E_{n-1}\).

Proof

It is easy to see that for a reaction system \(\mathcal {A}=(S,A)\) we can construct the restricted reaction system \(\mathcal {A}_r=(S',A',\#)\) with \(S'=S\), \(A'=A\) and \(\#=\emptyset \). As the mutual exclusion relation \(\#\) is empty, this means that \(\mathrm{{en}}(A,\#,T) =\{\mathrm{{en}}(A,T)\}\) for any \(T \subseteq S\).

Now we prove that for all \(0\le i \le n-1\), if \(W_i\xrightarrow {E_i} W_{i+1}\) in the reaction system \(\mathcal {A}\), then in the restricted reaction system \(\mathcal {A}_r\). From \(W_i\xrightarrow {E_i} W_{i+1}\), it results that \(E_i=\mathrm{{en}}(A,W_i)\), \(D_{i+1}=\mathrm{{res}}(A,W_i)\) and \(W_{i+1}=D_{i+1} \cup \; C_{i+1}\). Since \(\mathrm{{en}}(A,\#,W_i)=\{\mathrm{{en}}(A,W_i)\}\), then \(\mathrm{{res}}(A,\#,W_i)=\{\mathrm{{res}}(A,W_i)\}\); thus, \(E_i \in \mathrm{{en}}(A,\#,W_i)\) and \(D_{i+1} \in \mathrm{{res}}(A,\#,W_i)\), meaning that (as desired). \(\square \)

Proposition 2

Given a restricted reaction system \(\mathcal {A}_r=(S',A',\#)\) and an interactive process \(\pi '\) such that \(\mathrm{{rsts}}(\pi ') = W'_0, \ldots , W'_n\) and \(\mathrm{{ract}}(\pi ') = E'_0, \ldots , E'_{n-1}\), there exists a reaction system \(\mathcal {A}=(S,A)\) and an interactive process \(\pi \) with \(\mathrm{{sts}}(\pi ) = W_0, \ldots , W_n\) such that \(W'_i \subseteq W_i\) for all \(0\le i\le n\), and \(\mathrm{{act}}(\pi ) = E'_0, \ldots , E'_{n-1}\).

Proof

Let us consider a restricted reaction system \(\mathcal {A}_r=(S',A',\#)\) in state \(W'_i =C'_i \cup D'_i\). If there exists an \(E'_i \in \mathrm{{en}}(A',\#,W'_i)\), then it holds that , where \(W'_{i+1}=C'_{i+1} \cup D'_{i+1}\) and \(D'_{i+1} \in \mathrm{{res}}(A',\#,W'_i)\).

Starting from the restricted reaction system \(\mathcal {A}_r\) and an an interactive process \(\pi '\) such that , we can construct a reaction system \(\mathcal {A}\) and an interactive process \(\pi \) such that \(W_i \xrightarrow {E'_i} W_{i+1}\) such that \(W'_i \subseteq W_i\) for all \(0\le i\le n\). The construction is in such a way that each non-empty context set provides symbols to control the evolution by forbidding the application of some rule by means of proper inhibitors. For this, we consider the reaction system \(\mathcal {A}=(S \cup S',A')\) in which the set \(S'\) is built based on the pairs contained in the mutual exclusion relation # ; specifically, for each \(a\#b\) we add \(i_a\) and \(i_b\) in \(S'\). Since reaction systems work with sets, even if there exist \(a\#b\) and \(a\#c\), only one object \(i_a\) is added to \(S'\). For each rule \(a=(R,I,P)\in A\) in \(\mathcal {A}_r\), we add the rule \(a=(R,I \cup \{i_a\},P)\in A'\) in \(\mathcal {A}\). In this way, the application of reaction a can be controlled by either the existence or absence of the inhibitor \(i_a\).

Since in the restricted reaction system \(\mathcal {A}_r\) the set of reactions \(E'_i\) was applied to the state \(W'_i\), this means that the set of reactions \(E''_i=\mathrm{{en}}(A',W'_i)\backslash E'_i\) was enabled in \(W'_i\), but not applied due to the mutual exclusion relation \(\#\). For each \(a\in E''_i\), we add \(i_a \in C''_i\) such that the set offered in the interactive process \(\pi \) by the context at step i is \(C'_i \cup C''_i\). In this case, it holds that \(W_i=W'_i \cup C''_i = D'_i \cup (C'_i \cup C''_i) \xrightarrow {E'_i} D'_{i+1} \cup (C'_{i+1} \cup C''_{i+1})=W'_{i+1} \cup C''_{i+1}=W_{i+1}\), with \(W'_i \subseteq W_i\) for all \(0\le i \le n\). This means that the additional inhibitors from the sets \(C''_i\) in the contexts of \(\mathcal {A}\) are needed to obtain the same result sequence in the behaviour of the restricted reaction system \(\mathcal {A}_r\). \(\square \)

In [12], it was proven that there is a close relationship between reaction systems and finite transition systems. Due to this relationship and Propositions 1 and 2, it also holds that there is a close relationship between restricted reaction systems and finite transition systems.

Before specifying formally this relationship, we recall what a finite transition system is. A (possibly nondeterministic) finite transition system is \(T = (Q,\Sigma ,\delta )\), where Q is a finite non-empty set of states, \(\Sigma \) is a finite non-empty set of symbols (the input alphabet), while \(\delta \subseteq Q \times \Sigma \times Q\) is a transition relation. For \(n\ge 1\), a transition process in T is a pair \(\mu = (\rho ,\alpha )\), where \(\rho =q_0,\ldots ,q_n\) is a sequence of states and \(\alpha =x_1,\ldots ,x_n\) is a sequences of symbols such that \(q_i \in \delta (q_{i-1}, x_i)\) for each \(1\le i \le n\).

Proposition 3

Given a restricted reaction system \(\mathcal {A}\) and an interactive process \(\pi =(\gamma ,\delta )\) with \(\gamma =C_0,\ldots ,C_n\) and \(\delta =D_1,\ldots ,D_n\) for \(n\ge 1\), there exists a finite transition system \(T_{\mathcal {A}}\) such that \(\mu =(\rho ,\alpha )\) is a transition process in \(T_{\mathcal {A}}\) with \(\rho =W_0,\ldots ,W_n\), \(\alpha =X_1,\ldots ,X_n\) and \(X_i=C_i{\setminus } D_i\) for all \(1 \le i \le n\).

Proposition 4

Given a finite transition system T and a transition process \(\mu =(\rho ,\alpha )\) in T with \(\rho =q_0,\ldots ,q_n\), \(\alpha =x_1,\ldots ,x_n\) for \(n\ge 1\), there exists a restricted reaction system \(\mathcal {A}_T\) and an interactive process \(\pi =(\gamma ,\delta )\), with \(\gamma =q_0x_1, x_2, \ldots x_n,\emptyset \) and \(\delta =q_1,\ldots ,q_n\).

5 Reversibility in (restricted) reaction systems

Reversibility appears naturally in chemical and biological systems. It makes sense to deal with reversibility in any field of natural computing. In what follows, we prove some results concerning invariants in the states of reaction systems when reverse reactions are allowed; reversing a reaction \(a=(R_a,I_a,P_a)\) means that its reverse \(\tilde{a}\) is able to undo the effects of a.

Definition 3

The reverse of a reaction \(a=(R_a,I_a,P_a)\) is given by the reaction \(\tilde{a}=(P_a, I_a, R_a)\). Similarly, the reverse of a set A of reactions is the set \(\tilde{A}=\{\tilde{a} \mid a\in A\}\).

Since in Sect. 2 we imposed \(R \cap I =\emptyset \) for a reaction \(a=(R,I,P)\), according to this definition, the reverse \(\tilde{a}=(R',I',P')\) might not be a reaction because \(R'\cap I' \ne \emptyset \). For example, let us consider the reaction \(a = ({b}, {c}, {c})\). The resulting reverse reaction would be \(\tilde{a} = ({c}, {c}, {b})\), which is not a reaction because reactants and inhibitors have a non-empty intersection. To overcome this problem, we work only with reversible reactions a=(RIP) satisfying that \(R\cap I=P\cap I=\emptyset \).

By Definition 3, it holds that \(\tilde{\tilde{a}}=a\). This natural property is used in some of the results of this section in which we allow a mix of reactions to be applied, namely we do not impose that only forward or reverse rules to be applied in one step. Thus, if a rule and its reverse are enabled in the initial step, then the following two invariant properties are obtained in reaction systems.

Proposition 5

Let us consider a closed reaction system \(\mathcal {A}=(S,A)\) with a consistent set of reactions A. If \(a, \tilde{a}\in \mathrm{{en}}(A,W_0)\), then \(R_a\cup P_a\subseteq W_i\) for all \(i\ge 0\).

Proof

By induction on the last applied step.

  • Case i = 0. There was no step applied yet, and the system is in its initial state. From \(a, \tilde{a} \in \mathrm{{en}}(A,W_0)\) it follows that \(R_a \subseteq W_0\) and \(R_{\tilde{a}}\subseteq W_0\). From Definition 3, it follows that \(R_{\tilde{a}}=P_a\); thus, \(R_a \cup P_a \subseteq W_0\), as required.

  • Case \(i>0\). Assume \(R_a \cup P_a \subseteq W_{i-1}\). Then by Definition 3 it holds that \(R_{\tilde{a}}=P_a\), and so \(R_a \cup R_{\tilde{a}} \subseteq W_{i-1}\). Since we work within a closed system having a consistent set of reactions, this means that \(a, \tilde{a} \in \mathrm{{en}}(A,W_{i-1})\), and so \(D_i=\mathrm{{res}}(A,W_{i-1})=\mathrm{{res}}(\mathrm{{en}}(A,W_{i-1}),W_{i-1})=P_a \cup P_{\tilde{a}}~\cup \) \(\mathrm{{res}}(\mathrm{{en}}(A\backslash \{a,\tilde{a}\},W_{i-1}),W_{i-1})\). Since by Definition 3 we have \(R_{\tilde{a}}=P_a\), then it holds that \(P_a \cup R_a \subseteq D_i\). Since \(W_i=D_i \cup C_i\) and \(P_a \cup R_a \subseteq D_i\), then \(P_a \cup R_a \subseteq W_i\), as required.

\(\square \)

Proposition 6

Let us consider an open reaction system \(\mathcal {A}=(S,A)\). If \(a, \tilde{a}\in \mathrm{{en}}(A,W_0)\) and \(I_a =\emptyset \), then \(R_a\cup P_a\subseteq W_i\) for all \(i\ge 0\).

Proof

The proof proceeds in a similar manner as for Proposition 5. \(\square \)

By generalizing the previous results such that all reactions are enabled at the same time with their reverse, we obtain the following two invariant properties.

Proposition 7

Let us consider a closed reaction system \(\mathcal {A} = (S, A)\). If for all \(a \in \mathrm{{en}}(A,W_0)\) it exists \(\tilde{a} \in \mathrm{{en}}(A,W_0)\), then \(\mathrm{{res}}(A,W_0) \subseteq W_i\) for all \(i\ge 0\).

Proof

By induction on the last applied step.

  • Case i = 0. There was no step applied yet, and the system is in the initial state. By the definition of \(\mathrm{{res}}\), it holds that \( \mathrm{{res}}(\mathrm{{en}}(A,W_0),W_0)=\cup _{a\in \mathrm{{en}}(A,W_0)} P_a\). Since \(a, \tilde{a} \in \mathrm{{en}}(A,W_0)\), then \( \mathrm{{res}}(A,W_0)=\cup _{a,\tilde{a}\in \mathrm{{en}}(A,W_0)} (P_a \cup R_a)\). Using Proposition 5 and due to the fact that \(P_a \cup R_a \subseteq W_0\), it follows that \(\mathrm{{res}}(A,W_0)=\cup _{a,\tilde{a}\in \mathrm{{en}}(A,W_0)} (P_a \cup R_a) \subseteq W_0\), as required.

  • Case \(i>0\). Assume \(\mathrm{{res}}(A,W_0) \subseteq W_{i-1}\). Since we work with a closed system, it holds that \(\mathrm{{res}}(A,\mathrm{{res}}(A,W_0)) \subseteq \mathrm{{res}}(A,W_{i-1})=D_i\) (by the definition of \(\mathrm{{res}}\)). Since \(\mathrm{{res}}(A,W_0)=\cup _{a\in \mathrm{{en}}(A,W_0)} P_a =\cup _{a,\tilde{a}\in \mathrm{{en}}(A,W_0)} (P_a \cup R_a)\), then \(\mathrm{{res}}(A,\mathrm{{res}}(A,W_0))= \mathrm{{res}}(A,\cup _{a,\tilde{a}\in \mathrm{{en}}(A,W_0)} (P_a \cup R_a))= \cup _{a,\tilde{a}\in \mathrm{{en}}(A,W_0)} (R_a \cup P_a)=\mathrm{{res}}(A,W_0)\), and so \(\mathrm{{res}}(A,W_0) \subseteq D_i\). Since \(W_i = D_i \cup C_i\), \(\mathrm{{res}}(A,W_0) \subseteq D_i\) and \(C_i=\emptyset \), it follows \(\mathrm{{res}}(A,W_0) \subseteq W_i\), as required.

\(\square \)

Proposition 8

Let us consider an open reaction system \(\mathcal {A} = (S, A)\). If for all \(a \in \mathrm{{en}}(A,W_0)\) it exists \(\tilde{a} \in \mathrm{{en}}(A,W_0)\) with \(I_{\tilde{a}}=\emptyset \), then \(\mathrm{{res}}(A,W_0) \subseteq W_i\) for all \(i\ge 0\).

Proof

The proof proceeds in a similar manner as for Proposition 7. \(\square \)

If both forward and reverse rules are applied in a chemical step, a chemical equilibrium may be obtained [3]. By considering reaction systems insensitive to context, we obtain a sort of equilibrium in reaction systems as well.

Proposition 9

If for all \(a \in \mathrm{{en}}(A,W_0)\) it exists \(\tilde{a} \in \mathrm{{en}}(A,W_0)\) and \(C_i \subseteq D_i\), then \(\mathrm{{res}}(A,W_0) =W_i\) for all \(i\ge 1\).

Proof

By induction on the last applied step.

  • Case i = 1. By the definition of \(\mathrm{{res}}\), it holds that \(\mathrm{{res}}(A,W_0)=D_1\). Since \(C_1\subseteq D_1\), it follows that \(\mathrm{{res}}(A,W_0)=W_1\).

  • Case \(i>1\). Assume \(\mathrm{{res}}(A,W_{0}) =W_{i-1}\). By the definition of res, it holds that \(\mathrm{{res}}(A,\mathrm{{res}}(A,W_0)) = \mathrm{{res}}(A,W_{i-1})=D_i\). As \(\mathrm{{res}}(A,W_0)=\cup _{a\in \mathrm{{en}}(A,W_0)} P_a=\cup _{a,\tilde{a}\in \mathrm{{en}}(A,W_0)} (P_a \cup R_a)\), then \(\mathrm{{res}}(A,res(A,W_0))= \mathrm{{res}}(A,\cup _{a,\tilde{a}\in \mathrm{{en}}(A,W_0)} (P_a \cup R_a))=\cup _{a,\tilde{a}\in \mathrm{{en}}(A,W_0)} (R_a \cup P_a)=\mathrm{{res}}(A,W_0)\), and so \(\mathrm{{res}}(A,W_0) = D_i\). Since \(W_i=D_i \cup C_i\), \(\mathrm{{res}}(A,W_0) = D_i\) and \(D_i \subseteq C_i\), then \(\mathrm{{res}}(A,W_0) = W_i\).

\(\square \)

As claimed in [20], sometimes it is better to restrict the application of a rule and its reverse in a single step. The next result shows that a step in a reaction system can be simulated by a step in a restricted reaction system if and only if the set of enabled reactions does not contain both a reaction and its reverse.

Proposition 10

Let us consider the reaction system \(\mathcal {A}=(S,A)\) and the restricted reaction system \(\mathcal {A}_r=(S,A,\#)\), where \(\#=\{(a,\tilde{a}) \mid a\in A\}\). If it does not exist \(a\in A\) such that \(a,\tilde{a}\in E\), then   \(W\xrightarrow {E} W'\)if and only if.

Proof

\(\Rightarrow \) Let us assume \(W\xrightarrow {E} W'\); this means that \(E=\mathrm{{en}}(A,W)\) and \(D'=\mathrm{{res}}(A,W)=\cup _{a\in E} P_a\). Since it does not exist \(a\in A\) such that \(a,\tilde{a}\in E\), then \(\mathrm{{en}}(A,\#,W)=\{\mathrm{{en}}(A,W)\}\), and it follows that .

\(\Leftarrow \) Let us assume ; this means that \(E\in \mathrm{{en}}(A,\#,W)\), and due to the fact that \(\{(a,\tilde{a}) \mid a\in A\} \subseteq \#\), it also holds that \(\mathrm{{en}}(A,\#,W)=\{\mathrm{{en}}(A,W)\}\), and so \(W\xrightarrow {E} W'\). \(\square \)

The following result shows that a closed reversible reaction system enjoys a standard property of the reversible process calculi described by so-called loop lemma in [10], namely that backward reductions are the inverse of the forward ones and vice versa. Notice that the following result specifies the necessary conditions such that the reverse reactions are able to provide a way of ‘going back’ one step in the evolution of restricted reaction systems.

Proposition 11

If \(C'\subseteq D'\) and for all \(w\in W\) it exists \(a\in E\) such that \(w \in R_a\), then implies .

Proof

Assume . Then it holds that \(D'=\mathrm{{res}}(E,W)= \cup _{a\in E} P_a\). Since \(C' \subseteq D'\), it follows that \(W'=D'\). By the definition of \(\mathrm{{res}}\), it holds that \(\mathrm{{res}}(\tilde{E},W')=\mathrm{{res}}(\tilde{E},D') =\cup _{\tilde{a}\in \tilde{E}}P_{\tilde{a}}=\cup _{a\in E}R_a\). Due to the condition that for all \(w\in W\) it exists \(a\in E\) such that \(w \in R_a\) (meaning that all objects from W are obtained by the rules of E), it follows that \(W=\cup _{a\in E}R_a\), and so . \(\square \)

It is worth noting that due to Propositions 5 and 6, the statement of Proposition 11 holds also if \(\{(a,\tilde{a}) \mid a\in A'\} \subseteq \#\), where \(A' \subseteq A\). This condition means that in restricted reaction system, some (even all) rules and their reverses can be applied in parallel.

6 Conclusion

In this paper, we defined restricted reaction systems in which the set of available reactions does not change over time, but there exists a relation that forbids two reactions to be applied in the same step. This mutual exclusion relation allows only one non-deterministically chosen rule of the two rules to be applied. Such a relation changes the (standard) deterministic approach of reaction systems to a non-deterministic one. On the other hand, we reveal a close relationship between reaction systems and restricted reaction systems.

We also investigated the notion of reversibility in both reaction systems and restricted reaction systems (reversibility appears naturally in chemical and biological systems). We studied uncontrolled reversibility in both reaction systems and restricted reaction systems, and provided some invariant properties. Moreover, we specified necessary conditions such that a restricted reaction system can reverse its computation and reach a previous state.

Two established research fields in natural computing, namely membrane computing [18] and reaction systems [13], are inspired by the functioning of living cells. Membrane systems represent quantitative models using rules over multisets of symbols placed in the compartments of a membrane structure. Reaction systems represent qualitative models dealing with sets rather than multisets. Connections between these two research fields were considered in [19] by analyzing the assumptions of reaction systems from the point of view of membrane computing, and in [1] by simulating reaction systems using membrane systems.