Hybrid Networks of Evolutionary Processors Are ... - CiteSeerX

0 downloads 0 Views 202KB Size Report
Starting from the premise that data can be given in the form of words, [3] introduced ... the deletion operation can be performed at arbitrary position and nodes where the ..... Here, if its rightmost symbol is not ZX, the word will remain in the node.
Hybrid Networks of Evolutionary Processors Are Computationally Complete Erzs´ebet Csuhaj-Varj´ u1∗

Carlos Mart´ın-Vide2

Victor Mitrana2† 1

Computer and Automation Research Institute, Hungarian Academy of Sciences, Kende u. 13-17, H-1111 Budapest, Hungary. [email protected] 2

Research Group in Mathematical Linguistics, Rovira i Virgili University P¸ca. Imperial T`arraco 1, 43005 Tarragona, Spain {cmv,vmi}@correu.urv.es

Abstract A hybrid network of evolutionary processors (an HNEP) consists of several language processors which are located in the nodes of a virtual graph and able to perform only one type of point mutations (insertion, deletion, substitution) on the words found in that node, according to some predefined rules. Each node is associated with an input and an output filter, defined by some random-context conditions. After applying in parallel a point mutation to all the words existing in every node, the new words which are able to pass the output filter of the respective node navigate simultaneously through the network and enter those nodes whose input filter they are able to pass. We show that even the socalled elementary HNEPs are computationally complete. In this case every node is able to perform only one instance of the specified operation: either an insertion, or a deletion, or a substitution of a certain symbol. We also prove that in the case of non-elementary networks, any recursively enumerable language over a common alphabet can be obtained with an HNEP whose underlying structure is a fixed graph depending on the common alphabet only.

1

Introduction

This paper is a continuation of the investigations started in [1] and continued in [2] and [12], where a computing model inspired by cell biology, namely, a network of evolutionary ∗

Work supported in part by a grant from the NATO Scientific Committee in Spain and Hungarian Scientific Research Fund ”OTKA” Grant No. T 042529 † Work supported by the Centre of Excellence in Information Technology, Computer Science and Control, ICA1-CT-2000-70025, HUN-TING project, WP5.

1

processors (a NEP), is introduced and studied. The nodes of these networks are very simple language processors (language determining devices) which are able to perform one type of point mutations, namely an insertion, a deletion or a substitution of a symbol. These nodes are endowed with filters which are defined by some membership or random-context conditions. The processors of the network apply the above operations to the words found in their respective nodes and communicate these words to each other through the filters. Another source of inspirations for introducing this concept was an architecture for parallel and distributed symbolic processing, related to the Connection Machine [10] as well as the Logic Flow paradigm [5]. This architecture consists of several processors, each of them being placed in a node of a virtual complete graph. Each node processor acts on the local data associated with the respective node, in accordance with some predefined rules, and then local data become mobile agents which are able to navigate in the network, following a given protocol. Only data that are able to pass a filtering process can be communicated. This process requires the fulfillment of some conditions imposed by the sending processor, by the receiving processor or by both of them. All the nodes send simultaneously their local data and the receiving nodes handle also simultaneously all the arriving data, according to some strategies, see, e.g., [6, 10]. Starting from the premise that data can be given in the form of words, [3] introduced a concept, called networks of (parallel) language processors, with the aim of investigating the above architectures in the framework of formal grammars and languages. According to this general framework, the processors are represented by arbitrary language generating devices (grammars, Lindenmayer systems, etc.), and the filters are defined by different types of context conditions. Networks of evolutionary processors, introduced in [1] and [2, 12] represent a variant of a network of language processors with as simple language theoretic operations as possible. Furthermore, the way of applying these operations is very different and the context conditions which the definition of filters is based on are more general. Thus, a very simple processor, called an evolutionary processor, is placed in each node of the network. Each processor is able to perform only a simple rewriting operation, namely, either an insertion of a symbol, or a substitution of a symbol by another one, or a deletion of a symbol. We call the respective nodes an insertion, a deletion, or a substitution node, respectively. Although these mechanisms consist of extremely simple components, they are very powerful. It is shown that NEPs with at most six nodes having regular filters defined by the membership condition - to pass a regular filter, the word must be an element of the regular language given by the condition - are able to generate all recursively enumerable languages, irrespective the underlying graph structure [2]. However, this result is not surprising, since similar characterizations can be found in the literature, see, e.g., [4, 8, 9, 11]. If we consider these networks with nodes having filters defined by random-context conditions, which seems to be closer to the recent possibilities of biological implementation, then still rather complex languages, as non-context-free ones, can be generated. Moreover, using these simple mechanisms we can solve NP-complete problems in linear time. Such solutions are presented for the Bounded Post Correspondence Problem in [1], for the “3-colorability problem” in [2] (with simplified networks), and for the Common Algorithmic Problem in [12]. As a further step, in [12] the so-called hybrid networks of evolutionary processors are considered. In this case 2

each deletion node or insertion node has its own working mode (performs the operation at any position, in the left-hand end, or in the right-hand end of the word) and different nodes are allowed to use different ways of filtering. Thus, the same network may have nodes where the deletion operation can be performed at arbitrary position and nodes where the deletion can be done only at the right-hand end of the word. Since the computational power of these networks remained unsettled in [12], the goal of our paper is to fill this gap. As for the networks of evolutionary processors, we obtain that HNEPs are computationally complete devices. Moreover, we prove that all recursively enumerable languages over an n-letter alphabet can be generated by hybrid networks of evolutionary processors having the same underlying structure. The computational completeness can also be obtained if we restrict the networks to the so-called elementary hybrid networks of evolutionary processors, where the nodes cannot perform more than one instance of the specified operation, for example, the insertion of a certain symbol. Hybrid networks of evolutionary processors can be viewed as bio-computing models in the following sense: each node represents a cell having a genetic information encoded in DNA sequences which may evolve by local evolutionary events, that is, point mutations (insertion, deletion or substitution of a pair of nucleotides). Each node is specialized just for one of these evolutionary operations. Furthermore, the biological data in each node is organized in the form of arbitrarily large multisets of words (each word appears in an arbitrarily large number of copies), all copies are processed in parallel such that all the possible events that can take place do actually take place. Obviously, the computational process described here is not exactly an evolutionary process in the Darwinian sense. But the rewriting operations we have considered might be interpreted as mutations and the filtering process might be viewed as a selection process. Recombination is missing but it was asserted that evolutionary and functional relationships between genes can be captured by taking only local mutations into consideration [13]. In this paper, we are not concerned with a possible biological implementation, though a matter of great importance, we demonstrate that HNEPs are powerful and simple bio-inspired computational devices.

2

Preliminaries

We first summarize the notions we shall use throughout the paper. An alphabet is a finite and nonempty set of symbols. The cardinality of a finite set A is written as card(A). A sequence of symbols from an alphabet V is called a word over V . The set of all words over V is denoted by V ∗ and the empty word is denoted by ε; we use V + = V ∗ − {ε}. The length of a word x is denoted by |x|, while we denote the number of occurrences of a letter a in a word x by |x|a . For each nonempty word x, alph(x) is the minimal alphabet W such that x ∈ W ∗ . We say that a rule a → b, with a, b ∈ V ∪ {ε} is a substitution rule if both a and b are different from ε; it is a deletion rule if a 6= ε and b = ε; and, it is an insertion rule if a = ε and b 6= ε. The set of all substitution, deletion, and insertion rules over an alphabet V are denoted by SubV , DelV , and InsV , respectively. Given a rule σ, as above, and a word w ∈ V ∗ , we define the following actions of σ on w:

3

- If σ ≡ a → b ∈ SubV , then (

{ubv : ∃u, v ∈ V ∗ (w = uav)}, {w}, otherwise



σ (w) =

(

- If σ ≡ a → ε ∈ DelV , then (

σ r (w) =

σ ∗ (w)

=

{uv : ∃u, v ∈ V ∗ (w = uav)}, {w}, otherwise (

{u : w = ua}, {w}, otherwise

σ l (w) =

{v : w = av}, {w}, otherwise

- If σ ≡ ε → a ∈ InsV , then σ ∗ (w) = {uav : ∃u, v ∈ V ∗ (w = uv)}, σ r (w) = {wa}, σ l (w) = {aw}. Symbol α ∈ {∗, l, r} denotes the way of applying an insertion or deletion rule to a word, namely, at any position (α = ∗), in the left-hand end (α = l), or in the right-hand end (α = r) of the word, respectively. Note that a substitution rule can be applied at any position only. For every rule σ, action α ∈ {∗, l, r}, and L ⊆ V ∗ , we define the α-action of σ on L by S σ α (L) = w∈L σ α (w). For a given finite set of rules M , we define the α-action of M on a word w and on a language L by: M α (w) =

[

σ α (w)

and

M α (L) =

[

M α (w),

w∈L

σ∈M

respectively. In the following we shall refer to the rewriting operations defined above as evolutionary operations, since they may be viewed as formulations of local gene mutations in terms of formal languages. For two disjoint subsets P and F of an alphabet V and a word over V , we define the predicates ϕ(1) and ϕ(2) as follows: ϕ(1) (w; P, F ) ≡ P ⊆ alph(w) ∧ F ∩ alph(w) = ∅ and ϕ(2) (w; P, F ) ≡ alph(w) ∩ P 6= ∅ ∧ F ∩ alph(w) = ∅. The construction of these predicates is based on random-context conditions defined by the two sets P (permitting contexts) and F (forbidding contexts). In [12] other types of predicates are also defined: ϕ(3) (w; P, F ) ≡ ϕ(4) (w; P, F ) ≡

alph(w) ⊆ P P ⊆ alph(w)



F 6⊆ alph(w)

However, the first two predicates are sufficient for our goals so that the last two predicates will not be used in the sequel. For every language L ⊆ V ∗ and β ∈ {(1), (2))}, we define: ϕβ (L, P, F ) = {w ∈ L | ϕβ (w; P, F )}. An evolutionary processor over V is a 5-tuple (M, P I, F I, P O, F O) where: 4

- Either M ⊆ SubV or M ⊆ DelV or M ⊆ InsV . The set M represents the set of evolutionary rules of the processor. Note that every processor is dedicated to one type of the above evolutionary operations only. - P I, F I ⊆ V are the input permitting/forbidding contexts of the processor, while P O, F O ⊆ V are the output permitting/forbidding contexts of the processor. We denote the set of evolutionary processors over V by EPV . A hybrid network of evolutionary processors is a 7-tuple Γ = (V , G, N , C0 , α, β, i0 ), where the following conditions hold: • V is an alphabet. • G = (XG , EG ) is an undirected graph with the set of vertices XG and the set of edges EG , each edge is given in the form of a set of two nodes. G is called the underlying graph of the network. • N : XG −→ EPV is a mapping which associates with each node x ∈ XG the evolutionary processor N (x) = (Mx , P Ix , F Ix , P Ox , F Ox ). • C0 : XG −→ V ∗ is a mapping which identifies the initial configuration of the network. It associates a finite set of words with each node of the graph G. • α : XG −→ {∗, l, r}; α(x) gives the action mode of the rules of node x on the words occurring in that node. • β : XG −→ {(1), (2)} defines the type of the input/output filters of a node. More precisely, for every node, x ∈ XG , we define the following filters: the input filter is given as ρx (·) = ϕβ(x) (·; P Ix , F Ix ), and the output filter is defined as τx (·) = ϕβ(x) (·; P Ox , F Ox ). That is, ρx (w) (resp. τx ) indicates whether or not the word w can pass the input (resp. output) filter of x. More generally, ρx (L) (resp. τx (L)) is the set of words of L that can pass the input (resp. output) filter of x. • i0 ∈ XG is the output node of the HNEP. We say that card(XG ) is the size of Γ. If α(x) = α(y) and β(x) = β(y) for any pair of nodes x, y ∈ XG , then the network is said to be homogeneous. Note that in a homogeneous HNEP, the way of applying the evolutionary rules is ∗ for all nodes. If the set of rules in every node consists of at most one rule, then the network is said to be elementary. In the theory of networks some types of underlying graphs are common, these are for example, rings, stars, grids, etc. We shall investigate networks of evolutionary processors with these underlying graphs. Thus, an HNEP is said to be a star, ring, or complete HNEP if its underlying graph 5

is a star, ring, grid, or complete graph, respectively. The star, ring, and complete graph with n vertices is denoted by Sn , Rn , and Kn , respectively. A configuration of an HNEP Γ as above is a mapping C : XG −→ V ∗ which associates a set of words with each node of the graph. A component C(x) of a configuration C is the set of words that can be found in the node x in this configuration, hence a configuration can be considered as the sets of words which are present in the nodes of the network at a given moment. A configuration can change either by an evolutionary step or by a communication step. When changing by an evolutionary step, each component C(x) of the configuration C is changed in accordance with the set of evolutionary rules Mx associated with the node x and the way of applying these rules α(x). Formally, we say that the configuration C 0 is obtained in one evolutionary step from the configuration C, written as C =⇒ C 0 , iff C 0 (x) = Mxα(x) (C(x)) for all x ∈ XG . When changing by a communication step, each node processor x ∈ XG sends a copy of each of its words to every node processor which is connected with x, provided that this word is able to pass the output filter of x, and receives all the words which are sent by the node processors connected with x, providing that these words are able to pass the input filter of x. Formally, we say that the configuration C 0 is obtained in one communication step from configuration C, written as C ` C 0 , iff C 0 (x) = (C(x) − τx (C(x))) ∪

[

(τy (C(y)) ∩ ρx (C(y))) for all x ∈ XG .

{x,y}∈EG

Let Γ an HNEP, a computation in Γ is a sequence of configurations C0 , C1 , C2 , . . ., where C0 is the initial configuration of Γ, C2i =⇒ C2i+1 and C2i+1 ` C2i+2 , for all i ≥ 0. If the sequence is finite, we have a finite computation. If we use HNEPs as language generating devices, then the generated language is the set of all words which appear in the output node under a finite computation in the network. Formally, the language generated by Γ is L(Γ) =

[

Cs (i0 ).

s≥0

3

Computational Completeness

We show that elementary HNEPs are as powerful as Turing machines. Then we prove that in the case of non-elementary networks any recursively enumerable language over a common fixed alphabet can be obtained with HNEPs with the same underlying graph structure. Theorem 1 Any recursively enumerable language can be generated by an elementary complete HNEP or an elementary star HNEP. Proof. Let G = (N, T, P, S) be a phrase-structure grammar in the Geffert normal form ([7]), namely with N = {S, A, B, C} and rules of the form S → x, x ∈ (N ∪ T )+ , and ABC → ε. We construct an elementary complete HNEP Γ = (U, Ks , N , C0 , α, β, Nf inal ) 6

which simulates the derivations in G by the so-called rotate-and-simulate method. The alphabet U of the network and the network size s are defined as follows: U

= N ∪ T ∪ {$} ∪ {ZX , X 0 | X ∈ (N ∪ T ∪ {$})} ∪ {Yr | 1 ≤ r ≤ m} ∪ (r,k)

{WA , WB , WC } ∪ {xk s = 28 + 2m + 2

m X

| r : S → x1 x2 . . . xpr , 1 ≤ k ≤ pr }

pr + 4 · card(T ).

r=1

The rotate-and-simulate method means that the words found in the nodes are involved into either the rotation of the rightmost symbol (the rightmost symbol of the word is moved to the beginning of the word) or a simulation of a rule of P . To guarantee the correct simulation, a marker symbol, $, is introduced for indicating the beginning of simulated word under the rotation, which is removed at the end of the computation provided it is the leftmost symbol. Let N 0 = N ∪ {$}. The constructed network consist of three parts which do not interfere with each other, despite that all nodes of the network are connected with each other. Each part, consisting of groups of nodes, is dedicated to exactly one type of tasks, that is, the rotation of a symbol, the simulation of a rule S → x or the simulation of the rule ABC → ε. Assume that the rules S → x ∈ P are labelled in a one-to-one manner by 1, 2, . . . , m. We first define that part of Γ which makes possible the rotation of symbols in N 0 ∪ T . The following table gives the description of the group of nodes which realize the rotation of a symbol X ∈ (N 0 ∪ T ), Γ contains such a group of nodes for each X in (N 0 ∪ T ). Node 1 Nrot (X) 2 Nrot (X) 3 Nrot (X) 4 Nrot (X)

M {X → ZX } {ε → X 0 } {ZX → ε} {X 0 → X}

PI {$} {ZX , $} {ZX , X 0 , $} {X 0 , $}

FI U \ (N 0 ∪ T ) {X 0 } ∅ {ZX }

PO {ZX } ∅ {X 0 } ∅

FO ∅ ∅ {ZX } {X 0 }

C0 {$S} ∅ ∅ ∅

α ∗ l r ∗

β (1) (1) (1) (1)

Table 1. 1 (X) with the aim of rotating symbol X, then X has to be If a word enters the node Nrot its rightmost symbol. First, an arbitrary occurrence of X is replaced by ZX . If the word has no occurrence of X, then it will never leave this node, since it cannot pass the output 2 (X) is able filter. Once the word has the symbol ZX , then it is sent out, but only node Nrot 2 0 to receive it. In Nrot (X) symbol X is appended to the word as its leftmost symbol. Then, the new word leaves the node through the output filter, and it is able to pass only the input 3 (X). Here, if its rightmost symbol is not Z , the word will remain in the node filter of Nrot X forever. Otherwise, this rightmost symbol is deleted and the word can leave this node. It can 4 (X), where X 0 is restored into the original symbol X. Thus, pass only the input filter of Nrot symbol X has been rotated. Table 2 describes a group of nodes of Γ which simulate one application of the rule r : S → x, x = x1 x2 . . . xpr for some pr ≥ 1. Γ has such a group of nodes for any rule of the form r : S → x, 1 ≤ r ≤ m. In Table 2, k ranges from 1 to pr and the set Ek is defined by

(

Ek =

∅, if k = 1 (r,pr −k+2) (r,pr −k+3) (r,p ) {xpr −k+2 , xpr −k+3 , . . . , xpr r }, if k > 1 7

Node 1 Nsim (r) k+1 Nsim (r)

M {S → Yr } (r,pr +1−k) {ε → xpr +1−k }

pr +2 Nsim (r)

{Yr → ε}

pr +2+k Nsim (r)

(r,k)

{xk

→ xk }

PI ∅ {Yr }∪ Ek {Yr }∪ Epr +1 (r,k) {xk }

FI U \ (N 0 ∪ T ) (r,pr +1−k) {xpr +1−k }

PO {Yr } ∅

FO ∅ ∅

C0 {$S} ∅

α ∗ l

β (1) (1)



Epr +1

{Yr }



r

(1)

{Yr }







(1)

(r,k)

{xk

}

Table 2.

The idea behind this construction is as follows: the simulation works only for words 1 (r) having S as their rightmost symbol. This occurrence of S which enter the node Nsim (r,p ) k+1 is replaced by Yr and then, by means of nodes Nsim (r), k = 1, 2, . . . , pr , symbols xpr r , (r,pr −1) (r,1) xpr −1 , . . . , x1 are appended in turn, in this order, to the beginning of the words. After all these symbols have been added, symbol Yr is deleted (it must be the rightmost symbol). (r,k) In the obtained words, symbols xk are restored into the original symbols xk , no matter pr +k+2 the order. These words are communicated among the nodes Nsim , 1 ≤ k ≤ pr , until all (r,k) symbols xk are restored. Note that these nodes of the network can interfere neither with nodes which simulate the application of any other rule nor with the nodes simulating the rotation of any symbol. We present now the simulation of an application of the rule ABC → ε. Table 3 describes the simulating nodes of Γ. Node 1 Ndel 2 Ndel 3 Ndel 4 Ndel 5 Ndel 6 Ndel

M {B → WB } {C → WC } {A → WA } {WB → ε} {WC → ε} {WA → ε}

PI ∅ {WB } {WB , WC } {WA , WB , WC } {WA , WC } {WA }

FI U \ (N 0 ∪ T ) {WC } {WA } ∅ {WB } {WC }

PO ∅ ∅ ∅ ∅ ∅ ∅

FO ∅ ∅ ∅ {WB } {WC } {WA }

C0 ∅ ∅ ∅ ∅ ∅ ∅

α ∗ ∗ ∗ r l r

β (1) (1) (1) (1) (1) (1)

Table 3.

We briefly explain the simulation which works for words of the form CαAB, where α ∈ (N 0 ∪ T )∗ . Since the symbols can be rotated, such a form can easily be obtained from words 1 having ABC as a subword (factor). First, the word in the form CαAB arrives in node Ndel where an occurrence of B is replaced by WB . If this occurrence is not the rightmost symbol, then the word will be lost later. Having an occurrence of WB , the word can enter only 2 , where an occurrence of C is rewritten to W . Again this occurrence must be the node Ndel C leftmost letter, otherwise the word will be lost later. Then the new word is forwarded to the 3 where an occurrence of A is replaced by W . As we shall see, this occurrence must node Ndel A be the second rightmost letter. The only possible continuation is to send the word to the 4 , where W is removed provided that it is the rightmost letter of the word. After node Ndel B 5 , where W is removed if it is the leftmost the successful deletion the word can enter node Ndel C 5 6 letter W is letter, otherwise the word remaining in Ndel forever. Finally, in the node Ndel A 8

deleted from the word. Now, WA must be the rightmost letter, therefore when an occurrence 3 it had to be the second rightmost letter. Due of A was replaced by WA in the node Ndel to the construction of this part of the network, this is the only way of successfully deleting a subword ABC from the word, moreover, during this phase of the work no rotation of a symbol or simulation of an application of a rule of the form S → x is possible. Finally, Γ has two more nodes, node N$c checks whether the word does not contain any non-terminal letter different from $, and it cancels the marker $ supposing that it is the leftmost symbol. The other node, Nf inal is the output node. These nodes are described by Table 4. Node N$c Nf inal

M $→ε ∅

PI ∅ ∅

FI U \ (T ∪ {$}) U \T

PO ∅ ∅

FO T T

C0 ∅ ∅

α l ∗

β (1) (1)

Table 4.

The reader can easily verify that Γ simulates all the derivations in G and nothing else. To obtain an elementary star HNEP generating the same language, we add one more node, Ninitial , defined as follows: the set of rules is empty, C0 (Ninitial ) = {$S}, all the permitting/forbidding condition sets are empty, α(Ninitial ) = ∗ and β(Ninitial ) = (1), and connects all the nodes defined above to this node in a star graph. 2 By the above proof, rotation of symbols is accomplished with insertion and deletion nodes using working modes l and r, only. In [12] the authors show how to construct an HNEP which generates a given regular (linear) language and whose underlying structure does not depend on the mode of generating or accepting the given language, but only on the number of the letters in the alphabet. In other words, any regular (linear) language over the same alphabet can be generated by an HNEP of the same size and underlying structure. A natural question arises: Is it possible to give a similar construction for any recursively enumerable language? We give a positive answer to this question in the next theorem. Theorem 2 1. Any recursively enumerable language over an alphabet V can be generated by a complete HNEP of size 27 + 3 · card(V ). 2. Any recursively enumerable language over an alphabet V can be generated by a star HNEP of size 28 + 3 · card(V ). Proof. The basic idea of the proof is the same as that of Theorem 1. For the same grammar G, in the Geffert normal form from the previous proof, we construct the following complete HNEP: Γ = (U, K27+3·card(T ) , N , C0 , α, β, Nf inal ) with U

= N ∪ T ∪ {$} ∪ {ZX , X 0 , X 00 , X 000 | X ∈ (N ∪ T ∪ {$})} ∪ {[x], [˜ x] | x ∈ (N ∪ T )≤k } ∪ {WA , WB , WC },

9

where k = max{|x| | S → x ∈ P } and (N ∪ T )≤k is the set of all words over N ∪ T of length smaller than or equal to k. Let, as above, N 0 = N ∪ {$}. The part of Γ which simulates the rotation of an arbitrary symbol in N 0 ∪ T is modified as shown in Table 5. Here Y ranges in the alphabet N 0 ∪ T . Node 1 Nrot 2 Nrot 3 Nrot (Y ) 4 Nrot

M {X → ZX | X ∈ N0 ∪ T} {ε → X 0 | X ∈ N0 ∪ T} {ZY → ε} {X 0 → X | X ∈ N0 ∪ T}

PI {$}

FI U \ (N 0 ∪ T )

PO ∅

FO ∅

C0 {$S}

α ∗

β (1)

{$} ∪ {ZX | X ∈ N0 ∪ T} {Y 0 , $} {$} ∪ {X 0 | X ∈ N0 ∪ T}

{X 0 | X ∈ N0 ∪ T} ∅ {ZX | X ∈ N0 ∪ T}

U





l

(2)

{Y 0 } U

{ZY } {X 0 | X ∈ N0 ∪ T}

∅ ∅

r ∗

(1) (2)

Table 5. 1 (X), As one can easily see, we put together in the same node, the rules of the nodes Nrot 2 (X), and N 4 (X), for X ∈ N 0 ∪ T , from the proof of Theorem 1, respectively. This Nrot rot 1 of this network change does not affect the rotation, since the words leaving the node Nrot 2 can enter only the node Nrot , and this is possible only if they have an occurrence of a symbol 1 will get such a symbol ZX for some X ∈ N 0 ∪ T . Notice that all nonempty words in Nrot 2 0 during the evolutionary step. In Nrot a symbol Y is appended to the left-hand end of each 3 (Y ) “select” those words in which Y 0 was appended in N 2 and have had word. Nodes Nrot rot 3 (Y ) after ZY in the right-hand end, in the sense that only these words are able to leave Nrot 4 the rightmost symbol ZY was removed. These words arrive in Nrot , where symbols Y 0 are restored.

Node 1 Nsim 2 Nsim (X) 3 Nsim (X) 4 Nsim 5 Nsim 6 Nsim 7 Nsim

M {S → [x] | S → x ∈ P} {ε → X 00 } {[αX] → [˜ α]} {X 00 → X 000 } {[˜ α] → [α] | α 6= ε} {[˜ ε] → ε} {X 00 → X, X 000 → X}

PI ∅

FI U \ (N ∪ T )

PO ∅

FO ∅

C0 {$S}

α ∗

β (1)

{[αX]} {X 00 } {[˜ α]} {X 000 }

∅ ∅ ∅ {X 00 }

U ∅ U U

∅ {[α]} {X 00 } {[˜ α]}

∅ ∅ ∅ ∅

l ∗ ∗ ∗

(2) (1) (2) (2)

{[˜ ε]} {X 00 , X 000 }

∅ {[α], [˜ α]}

∅ U

{[˜ ε]} {X 00 , X 000 }

∅ ∅

r ∗

(1) (2)

Table 6.

Now we describe that part of Γ which simulates the application of any rule S → x ∈ P . In Table 6, X is a generic letter in N ∪ T , and α is a generic word in (N ∪ T )≤k . We present some brief explanations about the way of simulation. All occurrences of S in all copies of 1 word z in node Nsim are substituted by symbols [x] for all x, provided that S → x is a rule in P . Later we shall see that only those words in which the rightmost occurrence of S was 1 substituted will not disappear. From Nsim the words having an occurrence of symbol [αX], ≤k 2 for some α ∈ (N ∪ T ) , enter Nsim (X), where X 00 is appended to their left-hand end. Then, 10

3 (X), where [αX] is replaced by [˜ these words enter Nsim α]. Now all the words above, for all 4 00 X ∈ N ∪ T , enter node Nsim , where each X is replaced by X 000 . Copies of those of them 6 , where [˜ which contain [˜ ε] will also be communicated to Nsim ε] is deleted, provided that it is 4 5 , where [˜ the rightmost symbol of the word. The words which leave Nsim will enter Nsim α] is ≤k replaced by [α] for all nonempty α ∈ (N ∪ T ) . Now the aforementioned process resumes 2 (X). with the nodes Nsim 6 . They enter N 7 , where they Let us follow the further itinerary of the words from Nsim sim 00 000 remain until all symbols X and X are restored. The obtained words represent the result of our simulation. The simulation of the rule ABC → ε is accomplished by the nodes described in Table 7.

Node 1 Ndel 2 Ndel 3 Ndel 4 Ndel

M {A → WA , {B → WB , {C → WC , {WB → ε} {WC → ε} {WA → ε}

PI ∅

FI U \ (N 0 ∪ T )

PO {WA , WB , WC }

FO ∅

C0 ∅

α ∗

β (1)

{WA , WB , WC } {WA , WC } {WA }

∅ {WB } {WC }

∅ ∅ ∅

{WB } {WC } {WA }

∅ ∅ ∅

r l r

(1) (1) (1)

Table 7. 1 must have at least one occurrence of Clearly, a word which goes out from the node Ndel 2 where the rightmost letter must be any symbol WA , WB , WC . Such a word arrives in Ndel 2 , the word has more than one occurrence of W , WB which is deleted. If, before entering Ndel B 2 the word is lost as soon as it leaves Ndel since it cannot pass any input filter. Remember 2 , the word enters that the underlying graph has no loop. After a successful deletion in Ndel 3 where an occurrence of W is removed provided that this occurrence is the leftmost Ndel C letter. When the new word goes out it must have no further occurrence of WC . Now, the 4 where an occurrence of W is deleted provided that this occurrence is the word enters Ndel A rightmost letter. No further occurrence of WA is allowed, otherwise the word is lost. Finally, we keep unchanged the description of the nodes in Table 4. In order to obtain a star HNEP generating the same language, we add the same node Ninitial defined in the previous proof. 2

The following result gives a general view, still incomplete, of the computational power of HNEPs. Theorem 3 1. Every language generated by an HNEP of size one is regular. 2. There exist context-free non-regular (even non-linear) languages which can be generated by elementary, complete, and free HNEPs of size 2. 3. There exist context-sensitive non-context-free languages which can be generated by complete HNEPs of size 4. 4. There exist non-recursive languages which can be generated by complete HNEPs of size 27. 5. There exist non-recursive languages which can be generated by complete HNEPs of size 28. 11

Proof. 1. If the network has only one node, say x, which is a deletion or a substitution node, then the generated language is finite. Let us consider that the node is an insertion node ; we assume that it contains the rules ε → ai , 1 ≤ i ≤ n, for some n ≥ 1. If α(x) is l or r, then the generated language is {a1 , a2 , . . . , an }∗ C0 (x) or C0 (x){a1 , a2 , . . . , an }∗ , respectively. If α(x) = ∗, then the generated language is ⊥ t ({a1 , a2 , . . . , an }∗ , C0 (x)), where the operation ⊥ t is the shuffle operation defined on two words x, y ∈ V ∗ by ⊥ t (x, y) = {x1 y1 x2 y2 . . . xn yn | n ≥ 1, xi , yi ∈ V ∗ , x = x1 x2 . . . xn , y = y1 , y2 . . . yn }. This operation may be naturally extended to languages by [

⊥ t (L1 , L2 ) =

⊥ t (x, y).

x∈L1 ,y∈L2

2. We consider the free HNEP defined in the following table Node x1 x2

M {ε → a} {ε → b}

PI ∅ ∅

FI ∅ ∅

PO ∅ ∅

FO ∅ ∅

C0 {ε} ∅

α ∗ ∗

β (1) (1)

Table 8.

If we take x1 as the output node, then the language generated by this network is {w ∈ {a, b}∗ : (|w|a = |w|b ) ∨ (|w|a = |w|b + 1)} which is context-free but not linear. Note that this HNEP is both elementary and homogeneous. 3. We define the following HNEP: Node x1 x2 x3 x4

M {ε → a0 } {ε → b0 } {ε → c0 } 0 {a → a, b0 → b, c0 → c}

PI ∅ {a0 } {b0 } 0 0 0 {a , b , c }

FI {b0 , c0 } {c0 } ∅ ∅

PO ∅ ∅ ∅ ∅

FO ∅ ∅ ∅ {a0 , b0 , c0 }

C0 {ε} ∅ ∅ ∅

α ∗ ∗ ∗ ∗

β (1) (1) (1) (1)

Table 9.

We give some explanations about the working mode of this network. In node x1 the word a0 is obtained; this word is forwarded to x2 which is the only node which is able to receive it. Here, two words, a0 b0 and b0 a0 , are produced. Both can leave this node but cannot pass any other input filter than that of x3 where c0 is inserted to any position in both words. All these new words leave x3 and enter x4 . Here, a0 , b0 , and c0 are replaced by a, b, c, respectively. All these three letters must be replaced in each word, the output filter of x4 prevents the words to leave the node before all the three letters have been replaced. Now, the process resumes from x1 . Then, the intersection of the language generated by this network in the output node x1 with the regular language {a, b, c}∗ is {w ∈ {a, b, c}∗ : |w|a = |w|b = |w|c } which is not context-free. Unlike in the previous example, this HNEP is homogeneous. It is worth mentioning that the aforementioned explanations can be carried to a ring HNEP of size four.

12

4. It is known that there exist non-recursive languages over one-letter alphabet. We consider a phrase-structure grammar in the Geffert normal form generating such a language L and construct the complete HNEP from the proof of Theorem 2 but removing the symbol $ together with the corresponding node in the part dedicated to symbol rotation as well as 1 the node having the role of deleting of $. We also discard the node Nf inal and take Nsim as the output node. Let us denote this HNEP of size 27 by Γ. Then, the intersection of the language generated by Γ with language {a}∗ is exactly L. Therefore, L(Γ) is non-recursive. 5. A similar construction works for star HNEPs.

2

We finish this section with two open problems: 1. Is it possible to generate an arbitrary recursively enumerable language over an alphabet V with a complete/star HNEP of a smaller size than 27 + 3 · card(V )? 2. What is the size of the smallest complete/star/ring HNEP which generates a noncontext-sensitive or non-recursive language? As it was expected, the next result with a standard proof, which is now omitted, shows that one needs deletion nodes in order to generate non-context-sensitive languages. Theorem 4 If Γ is an HNEP having no deletion node, then L(Γ) ∈ NSPACE(n).

References [1] J. Castellanos, C. Martin-Vide, V. Mitrana, J. Sempere, Solving NP-complete problems with networks of evolutionary processors, IWANN 2001 (J. Mira, A. Prieto, eds.), LNCS 2084, Springer-Verlag, 2001, 621–628. [2] J. Castellanos, C. Martin-Vide, V. Mitrana, J. Sempere, Networks of evolutionary processors, Acta Informatica, 39 (2003), 517-529.. [3] E. Csuhaj-Varj´ u, A. Salomaa, Networks of parallel language processors. In New Trends in Formal Languages (Gh. P˘aun, A. Salomaa, eds.), LNCS 1218, Springer Verlag, 1997, 299–318. [4] E. Csuhaj-Varj´ u, V. Mitrana, Evolutionary systems: a language generating device inspired by evolving communities of cells, Acta Informatica 36(2000), 913–926. [5] L. Errico, C. Jesshope, Towards a new architecture for symbolic processing. In Artificial Intelligence and Information-Control Systems of Robots ’94 (I. Plander, ed.), World Sci. Publ., Singapore, 1994, 31–40. [6] S. E. Fahlman, G. E. Hinton, T. J. Seijnowski, Massively parallel architectures for AI: NETL, THISTLE and Boltzmann machines. In Proc. AAAI National Conf. on AI, William Kaufman, Los Altos, 1983, 109–113. [7] V. Geffert, Normal forms for phrase-structure grammars. RAIRO/Theoretical Informatics and Applications, 25, 5(1991), 473–496. [8] L. Kari, Gh. P˘aun, G. Thierrin, S. Yu, At the crossroads of DNA computing and formal languages: Characterizing RE using insertion-deletion systems. Proc. 3rd DIMACS Workshop on DNA Based Computing, Philadelphia, 1997, 318–333.

13

[9] L. Kari, G. Thierrin, Contextual insertion/deletion and computability. Information and Computation 131, 1(1996), 47–61. [10] W. D. Hillis, The Connection Machine, MIT Press, Cambridge, 1985. [11] C. Martin-Vide, Gh. P˘aun, A. Salomaa, Characterizations of recursively enumerable languages by means of insertion grammars. Theoretical Computer Science 205, 1-2(1998), 195–205. [12] C. Martin-Vide, V. Mitrana, M. Perez-Jimenez, F. Sancho-Caparrini, Hybrid networks of evolutionary processors, In: Proc. of GECCO 2003, LNCS 2723, 2003, 401–412. [13] D. Sankoff et al. Gene order comparisons for phylogenetic inference: Evolution of the mitochondrial genome. Proc. Natl. Acad. Sci. USA, 89(1992) 6575–6579.

14