JID:TCS
AID:11079 /FLA
Doctopic: Theory of natural computing
[m3G; v1.205; Prn:3/03/2017; 13:29] P.1 (1-9)
Theoretical Computer Science ••• (••••) •••–•••
Contents lists available at ScienceDirect
Theoretical Computer Science www.elsevier.com/locate/tcs
Minimal reaction systems: Duration and blips Arto Salomaa Turku Centre for Computer Science, University of Turku, Quantum 392, 20014 Turun yliopisto, Finland
a r t i c l e
i n f o
Article history: Received 31 May 2016 Received in revised form 19 December 2016 Accepted 20 January 2017 Available online xxxx
a b s t r a c t We investigate reaction systems introduced in [5], in particular, the subclass of minimal reaction systems added with a feature of duration. It turns out that the model is computationally strong. Moreover, in some cases the lengths of the resulting sequences and cycles can be found out directly by arithmetical properties of the duration values. © 2017 Published by Elsevier B.V.
Keywords: Reaction system Duration Blip Decay Simultaneous congruences Cycles Termination
1. Introduction This paper falls in the line of research, very successful recently, dealing with reaction systems, a model for computing introduced by Ehrenfeucht and Rozenberg, [5]. From a purely mathematical point of view, the model offers a new approach in the study of functions from the set of subsets of a finite set S into itself. A reaction is simply a triple ( R , I , P ) (reactants, inhibitors, products) of nonempty subsets of S such that R and I do not intersect. Many variants, extensions and modifications of reaction systems have been introduced but we investigate the very basic model added with a feature of duration: each element has the possibility of staying around for some moments. Such a feature was introduced in [2] and investigated further in [15]. We are concerned with mathematical properties of the model of reaction systems rather than with eventual applications. Related work is contained in [4,7,10,9,11–15]. The model, provided with many variants and additions, turned out to be suitable in different setups. The paper [1] constitutes a survey. A related very general approach is presented in [6]. A widely investigated subclass of reaction systems has been the minimal ones, where the sets R and I consist of one element each. The reference [4] characterizes the class of functions definable by minimal reaction systems. It turns out that the class is very limited in comparison with the class of functions definable by arbitrary reaction systems. However, this defect can be compensated using some simple variations of reaction systems. One approach was presented in [14]. Another possibility is investigated in this paper. We consider full minimal reaction systems with duration, that is, there is a reaction in the system for every pair of reactant and inhibitor. It turns out that such a model is computationally strong. Moreover, the lengths of the resulting sequences and cycles can be found out, using the Chinese Remainder Theorem, by arithmetical properties of the duration values.
E-mail address: asalomaa@utu.fi. http://dx.doi.org/10.1016/j.tcs.2017.01.032 0304-3975/© 2017 Published by Elsevier B.V.
JID:TCS
AID:11079 /FLA
Doctopic: Theory of natural computing
[m3G; v1.205; Prn:3/03/2017; 13:29] P.2 (1-9)
A. Salomaa / Theoretical Computer Science ••• (••••) •••–•••
2
2. Definitions and auxiliary results We will now present formal definitions for the basic notions discussed in the paper. We begin with the central notion of a reaction system, as well as related operational notions. Everything happens within the framework of a finite set S, the background set. Essentially, we are dealing with functions from the set of subsets of S into itself. Throughout the paper, S refers to the background set. Definition 1. A reaction over the finite background set S is a triple
ρ = ( R , I , P ), where R , I and P are nonempty subsets of S such that R and I do not intersect. The three sets are referred as reactants, inhibitors and products, respectively. A reaction system A S over the background set S is a finite nonempty set
A S = {ρi | 1 ≤ i ≤ k}, k ≥ 1, of reactions over S. Note that P may or may not contain elements of R ∪ I . The cardinality of a finite set X is denoted by X . The empty set is denoted by ∅. We will omit the index S from A S whenever S is understood. We now come to the definitions dealing with functions and sequences. Definition 2. Consider a reaction ρ = ( R , I , P ) over S and a subset T of S. The set T is enabled (with respect to symbols enρ ( T ), if R ⊆ T and I ∩ T = ∅. If T is (resp. is not) enabled, then we define the result by
ρ ), in
resρ ( T ) = P (resp. = ∅). For a reaction system A = {ρ j | 1 ≤ j ≤ k}, we define the result by
resA ( T ) =
k
resρ j ( T ).
j =1
Definition 2 exhibits an important feature of reaction systems. Whenever an element is in a set, it is considered to be present for all reactions simultaneously. Thus, an element is not “consumed” in the application of the reaction but is also available for other reactions. In this sense no “conflicts” arise. This feature makes reaction systems different from many other models for computation. Sequences generated by reaction systems can be viewed as iterations of the operation resA . If resA (Y ) = Y , we use the notation
Y ⇒A Y , or simply Y ⇒ Y . If
resA ( X i ) = X i +1 , 0 ≤ i ≤ m − 1, we write briefly
X 0 ⇒ X 1 ⇒ . . . ⇒ Xm and call X 0 , X 1 , . . . , X m states of a sequence of length m + 1 generated (or defined) by the reaction system A. The reflexive and transitive closure of the relation ⇒ is denoted by ⇒∗ . It is important to notice that, whenever in a sequence X i = X j , i = j, then also X i +1 = X j +1 . As we will see, reaction systems with duration do not satisfy this condition. Since there are only 2 S subsets of S, one of the following two situations always occurs for a sequence
X 0 ⇒ X 1 ⇒ . . . ⇒ X m −1 , for large enough m. 1. resA ( X m−1 ) = X m1 , for some m1 ≤ m − 1. If m1 is the largest number satisfying this inequality, we say that the sequence has (or ends with) a cycle of length m − m1 .
JID:TCS
AID:11079 /FLA
Doctopic: Theory of natural computing
[m3G; v1.205; Prn:3/03/2017; 13:29] P.3 (1-9)
A. Salomaa / Theoretical Computer Science ••• (••••) •••–•••
3
2. X m = ∅, for some m. We say that the sequence is a terminating sequence of length m + 1. Thus in this case enρ ( X m−1 ) holds for no reaction ρ in A. Terminating sequences can be viewed as special cases of cycles of length 1. The states appearing in other cycles must always be proper nonempty subsets of the background set. An important issue about reaction systems is the number of resources, that is, the cardinality of the union of the sets of reactants and inhibitors. By definition, it is always ≥ 2. The reaction system is referred to as minimal if the cardinality equals 2 for every reaction. The reference [4] characterizes subset functions (that is, functions mapping the set of subsets of S into itself) definable by minimal reaction systems. The reference [12] investigates the difference between minimal reaction systems and those where every reaction has at most 3 resources. Below we will be concerned with minimal reaction systems. Remark. The definitions in [1,2,4,5] speak about interactive processes. This means that also a sequence C i , i = 1, 2, . . . , of subsets of S (considered as inputs from the “environment”) is taken into account in the computation steps. This sequence is not included in our definitions. We now come to the basic notion of duration. Each element a ∈ S is associated with a positive integer D (a), referred to as the duration of a. A produced element a always stays D (a) steps in the sequence of the reaction system A, even when it is not introduced in the product sets. Every time a is produced, a new count of D (a) steps begins. If D (a) = 1, for every a ∈ S, then the reaction system with duration behaves like a reaction system without duration. The formal definition given below follows the reference [15]. In the original definition, [2], duration does not apply to the first state of a sequence. (Issues relevant for the topics in this paper were discussed also in [8].) Definition 3. A reaction system with duration is a pair (A, D ), where A is a reaction system with the background set S, and D is a mapping of S into the set of positive integers. A sequence X i , with i = 0, 1, 2, . . . of (A, D ) is defined as follows. The first element X 0 is a nonempty subset of S. The next one is defined by
X 1 = resA ( X 0 ) ∪ {a ∈ X 0 | D (a) > 1} and, for i ≥ 1,
D (a)−1
X i +1 = resA ( X i ) ∪ {a ∈ X i |a ∈
resA ( X i − j )}.
j =1
Eventual sets X i with a negative i are defined to be empty. Moreover, it is formally assumed that resA ( X −1 ) = X 0 . The sequence may have two identical states with different continuations. This is due to the fact that an element can be in different stages of duration in the two states. The sequence may also begin with the whole set S. Although then no reactions are applicable, duration may produce a smaller set, where some reaction is applicable. The formal assumption concerning X 0 is needed to guarantee the duration of elements in X 0 . The set X 0 should be included in the defining union for sufficiently large values of D (a), which does not happen without our formal assumption. We will see below that duration leads to interesting questions about termination. One can also construct much longer sequences than in reaction systems without duration. This is obvious with large duration values but holds also when the values are small. Examples will be given in the sequel. Reaction systems can be reduced to product normal form, where the product set of every reaction is a singleton. Given a reaction system A, another reaction system A1 over the same background set S is constructed as follows. Every reaction ( R , I , { p 1 , . . . , pn }), n ≥ 1, is replaced by the set of reactions
( R , I , { p i }), 1 ≤ i ≤ n. (Thus, there is no change for reactions where n = 1.) The reaction system A1 is said to be in the product normal form. The following lemma is an immediate consequence of Definition 2. Lemma 1. For any subset T of the background set S,
resA ( T ) = resA1 ( T ). Following [2], we now distinguish certain elements of the background set. Definition 4. An element b ∈ S in a reaction system A S is a blip if, for every reaction ( R , I , P ) in A S , whenever b ∈ I then also b ∈ P .
JID:TCS
AID:11079 /FLA
Doctopic: Theory of natural computing
[m3G; v1.205; Prn:3/03/2017; 13:29] P.4 (1-9)
A. Salomaa / Theoretical Computer Science ••• (••••) •••–•••
4
We will see below that in some reaction systems with duration the behavior of blips is periodic. An example where this is not the case is provided by the minimal reaction system with duration and with the background set {a, b, c }, and reactions
({a}, {b}, {b}), ({b}, {a}, {c }), ({c }, {a}, {c }), as well as D (a) = D (c ) = 1, D (b) = 2. Now b and c are blips. In the sequence beginning with a, the element b appears in two consecutive steps but never after that. Other possibilities arise if the duration values are defined differently. The following result is an important number-theoretic tool needed in the sequel. It is one possible formulation of the result often referred to as the Chinese Remainder Theorem, [3]. Theorem 1. Let m1 , . . . , mk be positive integers and u 1 , . . . , uk arbitrary integers. Then the system of congruences
x ≡ u i (mod mi ), i = 1, . . . , k, has a solution x if and only if, for all i , j, 1 ≤ i , j ≤ k,
u i ≡ u j (mod gcd(mi , m j )).
(*)
Moreover, if x and y are any solutions and M is the least common multiple of the integers m1 , . . . , mk , then y ≡ x (mod M ). There are many simple algorithms for finding solutions for the system of congruences whose existence is characterized in Theorem 1. See [3]. To apply Theorem 1, one has to know that the congruences (*) hold for all i and j. This is clearly the case if the integers m1 , . . . , mk are relatively prime in pairs. The following simple corollary will be very useful in the sequel. The corollary follows because we are dealing with congruences 0 ≡ 0, 1 ≡ 1 and 0 ≡ 1, 1 ≡ 0. The former two are always valid, whereas the latter two are never valid if the modulus is greater than 1. Corollary 1. Let T be a subset of the background set S = {s1 , . . . , sk }, and let u 1 , . . . , uk be integers defined by, for 1 ≤ i ≤ k,
u i = 0 if si ∈ T , u i = 1 if si ∈ S − T . Let m1 , . . . , mk be positive integers. Then the system of congruences
x ≡ u i (mod mi ), i = 1, . . . , k, has a solution x if and only if, for all i , j, 1 ≤ i , j ≤ k, either si and s j are both in T , or else they are both in S − T . Moreover, if x and y are solutions and M is the least common multiple of the integers m1 , . . . , mk , then y ≡ x (mod M ). 3. Full minimal reaction systems We will now consider full minimal reaction systems and their variants. We begin with reaction systems without duration. A minimal reaction system A with the background set S = {x1 , . . . , xk } is termed full if, for every pair (i , j ), i = j, 1 ≤ i, j ≤ k, the reaction system A contains a reaction ({xi }, {x j }, P ). Since we are interested only in resA , we may assume by Lemma 1 that our full minimal reaction systems are in the product normal form. For a given pair (i , j ), our reaction systems may contain several reactions of the form ({xi }, {x j }, { y }). We obtain the following lemma. Lemma 2. Let A S be a full minimal reaction system and T a proper nonempty subset of S. If T ⇒A S T 1 , then T 1 consists of all elements y such that there is a reaction of the form ({xi }, {x j }, { y }), xi ∈ T , x j ∈ S − T , in A S . Proof. The result is a direct consequence of Definition 2. Every described element y must be in T 1 because, for every xi ∈ T , x j ∈ S − T , there is a reaction in A S . If xi ∈ S − T or x j ∈ T , the reaction is not enabled with respect to T . 2 The problem of sequence termination is particularly clear for full minimal reaction systems. Theorem 2. A sequence in a full minimal reaction system A S terminates if and only if a state consisting of the whole background set S is reached. A cycle in a minimal reaction system can be found by testing at most 2 S steps in the sequence. However, no polynomial upper bound in terms of S suffices in the general case. Proof. Consider the first sentence. If S is reached, then no reaction is enabled and, consequently, ∅ results. Some reaction is enabled with respect to every proper nonempty subset of S and, hence, the sequence continues. Observe also that X 0 is nonempty. The second sentence follows because the number of states in any terminating sequence is bounded by 2 S .
JID:TCS
AID:11079 /FLA
Doctopic: Theory of natural computing
[m3G; v1.205; Prn:3/03/2017; 13:29] P.5 (1-9)
A. Salomaa / Theoretical Computer Science ••• (••••) •••–•••
5
To prove the third sentence, consider the first n prime numbers p 1 , . . . , pn , as well as their sum and product n
p i , and
i =1
n
pi .
i =1
Consider the minimal reaction system A S with the background set p
S = {1 ≤ i ≤ n|a1i , . . . , ai i } and reactions j +1
j
({ai }, {ai
j +1
}, {ai
}), 1 ≤ i ≤ n, 1 ≤ j ≤ p i .
Here the addition in the upper indices is carried out modulo p i , that is, p i + 1 = 1. Now it is easy to verify that the cycle beginning with the state {a11 , . . . , an1 } is of length ni=1 p i . It is well known by number theory that this product is not n polynomial in terms of S = i =1 p i . 2 4. Full minimal reaction systems with duration Every element in the reaction system A S considered in the proof of Theorem 2 is actually a blip. Thus, the third sentence of the theorem holds for minimal reaction systems, not necessarily full. The reaction system A S is easily modified to a full minimal reaction system such that the conclusions still hold. We now consider full minimal reaction systems with duration. It turns out that blips are very significant in the construction of reaction systems with a very complex behavior. Such a construction can be carried out using a small background set and modest duration values. Moreover, questions concerning termination and cycles can be settled by arithmetical properties of the duration values. Consider a reaction system with duration (Ak , D ) with the background set S k = {x1 , . . . , xk }. The duration function D maps S k into positive integers. The reactions of the system (Ak , D ) are:
({xi }, {x j }, {x j }), xi , x j ∈ S k , xi = x j . Note that every element of the background set is a blip, and that Ak is a full minimal reaction system. Consider now a sequence Y 1 ⇒ Y 2 ⇒ . . . beginning with Y 1 ⊆ S k . Let y ∈ Y 1 and D ( y ) = d. Then
y ∈ Y i , 1 ≤ i ≤ d, y ∈ S k − Y d+1 , y ∈ Y d+i , 2 ≤ i ≤ d + 1, y ∈ S k − Y 2d+2 , . . . This follows by the definition of the reactions. As long as y is present, it cannot be introduced newly. But if it is absent, it is immediately introduced again, provided some other element is present. This means that the behavior of the sequence Y 1 ⇒ Y 2 ⇒ . . . is characterized by the associated decay sequence. The latter is a sequence of k-dimensional vectors j
j
V j = ( v 1 , . . . , v k ), j = 1, 2, . . . Here, for 1 ≤ i ≤ k,
v 1i
=
D ( xi ) 0
if xi ∈ Y 1 , if xi ∈ S 1 − Y 1 , j +1
j
and, for j ≥ 1, the component v i is the smallest nonnegative remainder of v i − 1 modulo ( D (xi ) + 1). Clearly, the sequence Y 1 ⇒ Y 2 ⇒ . . . terminates if and only if the associated decay sequence reaches the zero vector (0, . . . , 0). As an example, let k = 3 and D (x1 ) = 3, D (x2 ) = 2, D (x3 ) = 1. Consider the sequence beginning with {x1 , x2 }. The associated decay sequence
(3, 2, 0) ⇒ (2, 1, 1) ⇒ (1, 0, 0) ⇒ (0, 2, 1) ⇒ (3, 1, 0) ⇒ (2, 0, 1) ⇒ (1, 2, 0) ⇒ (0, 1, 1) ⇒ (3, 0, 0) ⇒ (2, 2, 1) ⇒ (1, 1, 0) ⇒ (0, 0, 1) ⇒ (3, 2, 0) leads to a cycle. Hence, the sequence beginning with {x1 , x2 } does not terminate. However, if we begin with {x1 , x3 }, the associated decay sequence
(3, 0, 1) ⇒ (2, 2, 0) ⇒ (1, 1, 1) ⇒ (0, 0, 0) reaches the zero vector. Thus, the sequence beginning with {x1 , x3 } terminates. The reason for this difference will become apparent below.
JID:TCS
AID:11079 /FLA
Doctopic: Theory of natural computing
[m3G; v1.205; Prn:3/03/2017; 13:29] P.6 (1-9)
A. Salomaa / Theoretical Computer Science ••• (••••) •••–•••
6
It will be convenient to consider also the vector V 0 , where v 0i is the smallest nonnegative remainder of v 1i + 1 modulo D (xi ) + 1, for 1 ≤ i ≤ k. Thus, in the decay sequence associated with the sequence beginning with Y 1 we have, for 1 ≤ i ≤ k,
v 0i =
0 1
if xi ∈ Y 1 , if xi ∈ S k − Y 1 .
The following result is now obvious. Lemma 3. For Y 1 ⊆ S k , the sequence Y 1 ⇒ Y 2 ⇒ . . . terminates if and only if the associated decay sequence V 0 , V 1 , V 2 , . . . reaches the zero vector. The zero vector is reached if and only if the system of simultaneous congruences
xi ≡ u i (mod mi ), 1 ≤ i ≤ k, where mi = D (xi ) + 1 and
ui =
0 1
if xi ∈ Y 1 , if xi ∈ S k − Y 1 .
has a solution. Our main result is now an immediate consequence of Corollary 1 and Lemma 3. Recall that by the length of a terminating sequence we understand the number of states in the sequence, including the first and the last state. Theorem 3. A sequence Y 1 ⇒ Y 2 ⇒ . . . in the reaction system (Ak , D ) terminates if and only if the following condition is satisfied. Whenever
gcd( D (xi ) + 1, D (x j ) + 1) > 1, i = j , 1 ≤ i , j ≤ k, then either xi , x j ∈ Y 1 or xi , x j ∈ S k − Y 1 . In the terminating case the length l of the sequence satisfies
l ≤ lcm( D (x1 ) + 1, . . . , D (xk ) + 1). In our example above, gcd( D (x1 ) + 1, D (x3 ) + 1) > 1. Thus, in a terminating sequence both x1 and x3 have to be in or both outside the beginning state. The sequence beginning with {x1 , x2 } does not satisfy this condition. The following corollary lists some cases, where the condition is satisfied. Corollary 2. A sequence S k ⇒ Y 2 ⇒ . . . terminates, independently of the duration values. The sequence Y 1 ⇒ Y 2 ⇒ . . . terminates, for any Y 1 , if the numbers D (xi ) + 1, 1 ≤ i ≤ k, are relatively prime in pairs. In both cases, the length of the sequence equals the least common multiple of these numbers. In our example we get the terminating sequence
{x1 , x2 , x3 } ⇒ {x1 , x2 } ⇒ {x1 , x3 } ⇒ {x2 } ⇒ {x1 , x2 , x3 } ⇒ {x1 } ⇒ {x1 , x2 , x3 } ⇒ {x2 } ⇒ {x1 , x3 } ⇒ {x1 , x2 } ⇒ {x1 , x2 , x3 } ⇒ ∅ of length lcm(4, 3, 2) = 12. If in (Ak , D ) we choose the duration values
D ( x i ) = p i − 1, 1 ≤ i ≤ k , where p i is again the ith prime, then the length of the terminating sequence is the following function, very fast growing in terms of S k = k:
f (k) =
k i =1
pi .
JID:TCS
AID:11079 /FLA
Doctopic: Theory of natural computing
[m3G; v1.205; Prn:3/03/2017; 13:29] P.7 (1-9)
A. Salomaa / Theoretical Computer Science ••• (••••) •••–•••
7
5. Further considerations. Cycles We begin with an example (Ak , D ) as defined in the preceding section. Let k = 6, and consider the duration values
D (x1 ) = 4, D (x2 ) = 10, D (x3 ) = 2, D (x4 ) = 3, D (x5 ) = 5, D (x6 ) = 7. We first list the (unordered) pairs (i , j ), i = j, 1 ≤ i , j ≤ 6, such that the numbers D (xi ) + 1 and D (x j ) + 1 are not relatively prime:
(3, 5), (4, 5), (4, 6), (5, 6). This implies, by Theorem 3, that a sequence beginning with a set T ⊆ S 6 terminates if and only if {x3 , x4 , x5 , x6 } ⊆ T , or else T {x3 , x4 , x5 , x6 } = ∅. There are 7 possibilities for such (nonempty) sets T . For instance, the choice T = {x1 , x2 } leads to the system of simultaneous congruences
x ≡ 0 (mod 5), x ≡ 0 (mod 11), x ≡ 1 (mod 3), x ≡ 1 (mod 4), x ≡ 1 (mod 6), x ≡ 1 (mod 8). By the two first congruences, x is divisible by 55. Since lcm(3, 4, 6, 8) = 24, we conclude that
x = 55 y ≡ 1 (mod 24), which gives the solution y = 7, x = 385. Arguing similarly, we get, for the initial choices
{x1 }, {x2 }, {x3 , x4 , x5 , x6 }, {x1 , x3 , x4 , x5 , x6 }, {x2 , x3 , x4 , x5 , x6 }, {x1 , x2 , x3 , x4 , x5 , x6 }, the lengths of the terminating sequence
1056, 1200, 936, 121, 265, 1320, respectively. We notice that all lengths are less than or equal to
lcm(5, 11, 3, 4, 6, 8) = 1320, as they should be, according to Theorem 3. We now turn our attention to cycles and lengths of cycles. Cycles can be viewed, for reaction systems with duration, in two different ways: 1. A set occurs twice in a sequence. 2. A set of pairs (x, dx ) occurs twice, where x ∈ S and dx is the remaining duration of x in the sequence. In other words, a vector occurs twice in the decay sequence. The second alternative removes the ambiguity otherwise present in sequences of reaction systems with duration. For any vector V in the decay sequence, the next vector is unique. Let us go back to the example A6 discussed above. By Theorem 3, the sequence beginning with the set {x1 , x2 , x4 , x5 , x6 } does not terminate. The beginning of the sequence is
{x1 , x2 , x4 , x5 , x6 } ⇒ {x1 , x2 , x3 , x4 , x5 , x6 } ⇒ {x1 , x2 , x3 , x4 , x5 , x6 } ⇒ {x1 , x2 , x5 , x6 } ⇒ {x2 , x3 , x4 , x5 , x6 } ⇒ {x1 , x2 , x3 , x4 , x6 } ⇒ {x1 , x2 , x4 , x5 , x6 }. Repetition occurs already in the third state, and the seventh state equals the starting state. Thus, we have short cycles and cycles within cycles. Neither phenomenon occurs if cycles in reaction systems with duration are viewed as in point 2 above. Indeed, the decay sequence beginning with the vector (corresponding to our starting state above) (4, 10, 0, 5, 3, 7) leads to a cycle of length 1320. Convention. From now on, cycles in reaction systems with duration refer to cycles in the decay sequence.
JID:TCS
AID:11079 /FLA
Doctopic: Theory of natural computing
[m3G; v1.205; Prn:3/03/2017; 13:29] P.8 (1-9)
A. Salomaa / Theoretical Computer Science ••• (••••) •••–•••
8
Let us go back to the connection between the length of a terminating sequence and the solution x of the corresponding system of simultaneous congruences. The solution x indicates the number of steps in the decay sequence from the vector V 0 to the zero vector, that is, the number of elements in the decay sequence from the vector V 1 to the zero vector. Denote again by M the least common multiple of the numbers D ( y ) + 1, where y runs through the elements of the background set S. It follows by the definition of the decay sequence that there are exactly M different vectors in the sequence, provided that we allow continuation also from the zero vector. Indeed, for S = {x1 , . . . , xk }, the ith component of the decay vector rotates the values
D (xi ), D (xi ) − 1, . . . , 1, 0, D (xi ), . . . , where 1 ≤ i ≤ k. Consequently, the initial vector is reached at the Mth step. No cycle can occur before the Mth step because, otherwise, the initial vector could not be reached. Thus, cycles are always of length M. Summarizing, we obtain the following extension of Theorem 3. Theorem 4. A sequence Y 1 ⇒ Y 2 ⇒ . . . in the reaction system (Ak , D ) terminates if and only if the following appearance condition is satisfied. Whenever
gcd( D (xi ) + 1, D (x j ) + 1) > 1, i = j , 1 ≤ i , j ≤ k, then either xi , x j ∈ Y 1 or xi , x j ∈ S k − Y 1 . In the terminating case the length l of the sequence satisfies
l ≤ lcm( D (x1 ) + 1, . . . , D (xk ) + 1). The equality holds only in case Y 1 = S. If the appearance condition is not satisfied, then a cycle of length lcm( D (x1 ) + 1, . . . , D (xk ) + 1) results. The example A6 above shows that the terminating sequences are, in general, much shorter than the least common multiple of the numbers
D ( x i ) + 1, 1 ≤ i ≤ k . 6. Conclusion We have settled the problems concerning lengths of terminating sequences and cycles in a particular class of minimal reaction systems with duration. It is an open problem to settle the cases where
• some elements of the background set are not blips, or • for some pairs (i , j ), there is no reaction ({xi }, {x j }, P ) in the reaction system.
Dedication This paper is dedicated to Jürgen Dassow on the occasion of his 70th birthday. Although the topic of the paper is not directly connected to Jürgen’s own work, I still consider the topic appropriate because of some joint biologically motivated work and also because Jürgen was always interested in new ideas and constructs. Indeed, he was the first in the “eastern zone” working in Lindenmayer systems. This happened at the time of our first meetings in the 70’s. Our cooperation soon extended to students and colleagues in the form of mutual visits and joint papers. Luckily it was relatively easy to travel between Finland and the communist countries. During his whole career, Jürgen Dassow has been an important contributor to the theory of automata and formal languages. This was apparent also in his editing a journal in the field and being the main organizer of the Second Conference Developments in Language Theory. Being Jürgen’s personal friend has been important for me. He was always helpful and considerate. In the turmoil of 1992 I got in Prague wrong information about the trains and arrived at Magdeburg six hours late, around 2 a.m. But Jürgen was meeting every train and took me safely to my quarters. Dear Jürgen, I wish you all the best, both in work and life in general. Turku, spring 2016
Arto Salomaa Acknowledgements I want to thank the two referees for useful comments, and Bianca Truthe for technical help with TCS.
JID:TCS
AID:11079 /FLA
Doctopic: Theory of natural computing
A. Salomaa / Theoretical Computer Science ••• (••••) •••–•••
[m3G; v1.205; Prn:3/03/2017; 13:29] P.9 (1-9)
9
References [1] R. Brijder, A. Ehrenfeucht, M. Main, G. Rozenberg, A tour of reaction systems, Internat. J. Found. Comput. Sci. 22 (2011) 1499–1517. [2] R. Brijder, A. Ehrenfeucht, G. Rozenberg, Reaction systems with duration, in: J. Kelemen, A. Kelemenová (Eds.), Computation, Cooperation, and Life – Essays Dedicated to Gheorghe P˘aun on the Occasion of His 60th Birthday, in: LNCS, vol. 6610, Springer-Verlag, Berlin, 2011, pp. 191–202. [3] C. Ding, D. Pei, A. Salomaa, Chinese Remainder Theorem. Applications in Computing, Coding and Cryptography, World Scientific Publishing Company, Singapore, 1996. [4] A. Ehrenfeucht, J. Kleijn, M. Koutny, G. Rozenberg, Minimal reaction systems, in: I. Petre, E. de Vink (Eds.), Special Issue on Computational Models for Cell Processes, in: LNBI, vol. 7625, Springer-Verlag, Berlin, 2012, pp. 102–122. [5] A. Ehrenfeucht, G. Rozenberg, Reaction systems, Fund. Inform. 7 (2007) 263–280. [6] A. Ehrenfeucht, G. Rozenberg, Zoom structures and reaction systems yield exploration systems, Internat. J. Found. Comput. Sci. 25 (2014) 275–305. [7] E. Formenti, L. Manzoni, A.E. Porreca, Cycles and global attractors of reaction systems, in: H. Jürgensen, J. Karhumäki, A. Okhotin (Eds.), Descriptional Complexity of Formal Systems, DCFS 2014, in: LNCS, vol. 8614, Springer-Verlag, Berlin, 2014. [8] E. Formenti, L. Manzoni, A.E. Porreca, On the complexity of occurrence and convergence problems in reaction systems, Nat. Comput. 14 (2015) 185–191. [9] A. Salomaa, Functions and sequences generated by reaction systems, Theoret. Comput. Sci. 466 (2012) 87–96. [10] A. Salomaa, On state sequences defined by reaction systems, in: R.L. Constable, A. Silva (Eds.), Logic and Program Semantics. Essays Dedicated to Dexter Kozen on the Occasion of His 60th Birthday, in: LNCS, vol. 7230, Springer-Verlag, Berlin, 2012, pp. 271–282. [11] A. Salomaa, Functional constructions between reaction systems and propositional logic, Internat. J. Found. Comput. Sci. 24 (2013) 147–159. [12] A. Salomaa, Minimal and almost minimal reaction systems, Nat. Comput. 12 (2013) 369–376. [13] A. Salomaa, Compositions of reaction systems, J. Autom. Lang. Comb. 19 (2014) 279–290. [14] A. Salomaa, Minimal reaction systems defining subset functions, in: C.S. Calude, R. Freivalds, I. Kazuo (Eds.), Computing with New Resources. Essays Dedicated to Jozef Gruska on the Occasion of His 80th Birthday, in: LNCS, vol. 8808, Springer-Verlag, Berlin, 2014, pp. 436–446. [15] A. Salomaa, Applications of the Chinese remainder theorem to reaction systems with duration, Theoret. Comput. Sci. 598 (2015) 15–22.