Generating networks of genetic processors

The Networks of Genetic Processors (NGPs) are non-conventional models of computation based on genetic operations over strings, namely mutation and crossover operations as it was established in genetic algorithms. Initially, they have been proposed as acceptor machines which are decision problem solvers. In that case, it has been shown that they are universal computing models equivalent to Turing machines. In this work, we propose NGPs as enumeration devices and we analyze their computational power. First, we define the model and we propose its definition as parallel genetic algorithms. Once the correspondence between the two formalisms has been established, we carry out a study of the generation capacity of the NGPs under the research framework of the theory of formal languages. We investigate the relationships between the number of processors of the model and its generative power. Our results show that the number of processors is important to increase the generative capability of the model up to an upper bound, and that NGPs are universal models of computation if they are formulated as generation devices. This allows us to affirm that parallel genetic algorithms working under certain restrictions can be considered equivalent to Turing machines and, therefore, they are universal models of computation.


Introduction
In the framework of non-conventional computing, new models of computation have been proposed by introducing new operations on data inspired by the nature [11]. In this work, we focus our attention on biologically inspired models of computation. This approach is not new in the history of computing: Artificial Neural Networks and Genetic Algorithms were formulated many years ago by taking into account biological aspects of information processing in nature. Currently, these models can be considered classical models of computation. We are mostly interested in the new models that have been formulated with new operations based at the molecular level (mainly, the DNA recombination and mutation) or cellular level (mainly, by using the structure and organization of the living cell, and the way it processes information).
This work is highly related to the Networks of Evolutionary Processors (NEP) [9,10]. That model was inspired by point mutations and evolutive selection on DNA, in a similar way as in genetic algorithms mutation and INSDEL genome evolution. The Networks of Splicing Processors (NSPs) [13] directly use splicing operations over strings instead of point mutation of NEPs. Finally, the Networks of Genetic Processors (NGPs) [6], use only substitution mutations together with recombination (crossover), so it is an alternative way of formulating genetic algorithms working in parallel, in a distributed way. All these models can be considered as Networks of Bio-inspired Processors (NBPs) [4], and all these models have been proved to be equivalent to Turing machines, and they have been used to solve NP-complete problems in polynomial time (in several cases, with a constant number of processors) [7,9,[12][13][14].
In the last few years, the Networks of Polarized Evolutionary Processors (NPEP) have been proposed [1,5]. In this case, the operations over strings are those proposed in the NEP model, the processors are positively, negatively or neutral polarized and all the strings in the network are numerically valuated. Again, these models have been proved to be computationally complete, and they have been proposed to solve hard problems efficiently.
In this work, we study the computational power of Networks of Genetic Processors as generating devices. It has been proved that this model is equivalent to Turing machines as an accepting device [6]. In addition, it was proved that they are equivalent to parallel genetic algorithms with full migration rates and synchronization, and they can solve hard problems efficiently [7].
The structure of this work is the following: First, we introduce basic concepts on classical language theory and generative grammars. Then, we formally define the Generating Networks of Genetic Processors (GNGP), and we relate them directly to genetic algorithms showing the evidences about why GNGPs can be considered parallel and distributed genetic algorithms with certain restrictions in the migration and selection processes through fitness functions. We propose different network structures to characterize each of the language classes defined in the Chomsky hierarchy, and we define each of the processors involved in the mentioned structures. In addition, we formally establish, through an inductive v = v 1 v 2 , w = v 1 v 2 and → ∈ P . Observe that the direct derivation is a relation between strings formed by terminal and auxiliary symbols, and we can define the reflexive and transitive closure of ⇒ G as the derivation relation between any pair of strings v and w, that is denoted by v * ⇒ G w , and it is defined iff one of the following conditions hold: w (a positive number of rules are applied to obtain w from u).
In addition, we denote i derivation steps by the symbol The language generated by G = (N, T, P, S) is defined as follows The grammars G 1 and G 2 are equivalent if L(G 1 ) = L(G 2 ) , and The Chomsky hierarchy is a framework to study large formal language classes. It is based on the classification of generative grammars according to the forms of the production rules. It establishes four classes of grammars that we can enumerate as follows:

Regular grammars (right linear grammars)
The productions of the grammar must be in one of the following forms Context-free grammars The productions of the grammar must be in the form A → , with A ∈ N , and ∈ (N ∪ T) * . The Chomsky Normal Form for context-free grammars is defined whenever the productions are in one of the following forms: It is well known that for every context-free grammar there exists a quasiequivalent grammar in Chomsky Normal Form.

Context-sensitive grammars
The derivations of the grammar are length increasing (with the exception of the derivation of ). We can establish the Kuroda Normal Form for context-sensitive grammars. It is defined by the following production forms: In addition, we can add the production rule S → , whenever S does not appear in the right side of any production rule. In such a case, the grammar can generate the empty string.

Phrase structure grammars
There are no restrictions in the form of the production rules. Nevertheless, we can establish the following production rules, as an extended Kuroda Normal Form: The initial symbol S may appear only in the left-hand sides of the production rules. The Chomsky hierarchy establishes the relationship of the language classes defined by the previously established classes of formal grammars. So, REG, CF, CS and RE refer to the languages generated by the previously defined grammars, and we have the following inclusions (the Chomsky hierarchy):

Generating networks of genetic processors
In the following, we define the Generating Networks of Genetic Processors. The basic elements of the model are inspired by previous works on Networks of Evolutionary Processors (NEPs) [9,10], and Networks of Splicing Processors (NSPs) [13,14]. In addition, the main ingredients of Generating Networks of Genetic Processors were previously defined as Accepting Networks of Genetic Processors [6].
Given the alphabet V, a mutation rule a → b , with a, b ∈ V , can be applied over the string xay to produce the new string xby. A mutation rule can be viewed as a substitution rule introduced in [10].
A crossover operation is an operation over strings defined as follows: Let x and y be two strings, then x ⋈ y = {x 1 y 2 , y 1 x 2 ∶ x = x 1 x 2 and y = y 1 y 2 } . Observe that x, y ∈ x ⋈ y given that is a prefix and a suffix of any string. The operation is extended over languages as L 1 ⋈ L 2 = ⋃ x∈L 1 ,y∈L 2 x ⋈ y . The crossover operation is a splicing operation over strings where the contexts of the strings are empty [17].
Let P and F be two disjoint subsets of an alphabet V, and let w ∈ V * . We define the predicate as follows: 1 We can extend the predicate to act over segments instead of symbols. Let P and F be two disjoint sets of finite strings over V, and let w ∈ V * , then In the following, we work with this extension over segments instead of symbols. The predicate is based on random-context conditions defined by the sets P (permitting contexts) and F (forbidding contexts). Let V be an alphabet and L ⊆ V * , then (L, P, F) = {w ∈ L ∶ (w, P, F)}.
In the following, we define a genetic processor that can be viewed as an abstract machine that can apply mutation rules or crossover operations over a multiset of strings.
Definition 1 Let V be an alphabet. A genetic processor over V is defined by the tuple (M R , A, PI, FI, PO, FO, ) , where -M R is a finite set of mutation rules over V -A is a multiset of strings over V with a finite support and an arbitrary large number of copies of every string. 2 -PI, FI ⊆ V * are finite sets with the input permitting/forbidding contexts -PO, FO ⊆ V * are finite sets with the output permitting/forbidding contexts -∈ {m, c} defines the function mode as follows: -If = m the processor applies mutation rules.
-If = c the processor applies crossover operations, and M R = �.
In any genetic processor, and for any word w ∈ V * , there is an input filter (w) = (w, PI, FI) and an output filer (w) = (w, PO, FO) . That is, (w) (resp. (w) ) indicates whether or not the word w passes the input (resp. the output) filter of the processor. We can extend the filters to act over languages. So, (L) (resp. (L) ) is the subset of L with the words that can pass the input (resp. output) filter of the processor.
Once we have defined the main component of the model, that is the genetic processor, we can formulate the Generating Networks of Genetic Processors as follows: is a mapping that associates the genetic processor N i to the node i ∈ X G , and the processor N out ∈ {N 1 , ⋯ , N n } is the output processor.
A configuration of a GNGP = (V, V out , N 1 , N 2 , … , N n , G, N, N out ) is defined by the tuple C = (L 1 , L 2 , … , L n ) , where L i is a multiset of strings defined over V for all 1 ≤ i ≤ n . A configuration represents the multisets of strings that every processor holds at a given time (remember that every string appears in an arbitrarily large number of copies). The initial configuration of the network is C 0 = (A 1 , A 2 , … , A n ).
Every copy of any string in L i can be changed by applying a genetic step, according to the mutation rules or the crossover operations in the processor N i . Formally, we say that the configuration C 1 = (L 1 , L 2 , … , L n ) directly changes into the configuration C 2 = (L � 1 , L � 2 , … , L � n ) by a genetic step, denoted by C 1 ⇒ C 2 , if L ′ i is the multiset of strings obtained by applying the mutation rules or the crossover operations of N i to the strings in L i . Since an arbitrarily large number of copies of each string is available in every processor, after a genetic step, in each processor, one gets an arbitrarily large number of copies of any string, that can be obtained by using all possible mutation rules or crossover operations associated with that processor. If L i is empty for some 1 ≤ i ≤ n , then L ′ i is empty as well. In a communication step, each processor N i sends all copies of the strings to all the processors connected to N i according to G, provided that they are able to pass its output filter. In addition, it receives all the copies of the strings sent by the processors connected to N i according to G, provided that they can pass its input filter. Formally, we say that the configuration C ′ is obtained in one communication step from configuration C, denoted by C ⊢ C ′ , iff Observe that, if one string leaves any processor together with all its copies, and it cannot enter into any new processor due to its filter restrictions, then the string and all its copies are lost.
In the following, we will use the symbol ↦ to denote a genetic step followed by a communication step. That is, In addition, to emphasize that the computation is carried out in the network we denote it by the symbol ↦ . Consequently, the reflexive and transitive closure of ↦ is denoted by * ↦ . In addition, the symbol i ↦ denotes i genetic steps plus i communication steps in the usual alternating way. All the strings defined over V out which are in the output processor N out at any computation step belong to the language generated by the network. Let = (V, V out , N 1 , … , N n , G, N, N out ) be a GNGP with N out = N k , the language generated by is denoted by L( ) , and it is defined as follows.
Observe that according to the definition any finite language L can be trivially generated by a GNGP by defining A out = L . Hence, the empty string can be generated by including it as an element of A out . In the following section we will not consider the empty string since, according to the criteria defined above, it can be generated in a trivial way.

Generating networks of genetic processors are parallel genetic algorithms
Once we have defined the Networks of Genetic Processors as generating devices, we are going to relate them to the classical concept of genetic algorithms and, particularly, to the case of parallel genetic algorithms. We followed this approach in a previous work [6] where we could also formulate genetic algorithms as decision problem solvers, as opposed to the more classical view that implies their definition as optimization algorithms. We have followed fundamentally the reference [16] for the case of genetic algorithms, and [8] for the case of parallel genetic algorithms.
We can see that every string inserted in a genetic processor is an individual of its population with an undefined number of clones. In addition, the mutation and crossover operations are applied in this case in a non-uniform way (the genetic crossover of two individuals is considered as a case where the new individuals can extend their genetic code indefinitely). In our case, the fitness function, used for the selection of different individuals to generate new populations, is limited to the selection of individuals for the migration rates discussed below. In the case of GNGPs, the genetic operators are applied to the entire population without making any exceptions. Mutation and crossover ratios are kept uniform throughout the process and no elitism technique is applied to the selection of individuals. Finally, we want to note that the output processor of the network would contain individuals resulting from computation which, in the case of genetic algorithms, would be the population with all feasible solutions to a given problem.
For the case of parallel and distributed genetic algorihms, [3] and [2] define the main components to be established. We can enumerate these components as follows: 1. The distribution of the individuals in different populations. They can be organized in different topologies: master-slave, multiple populations or islands, finegrained populations or hierarchical and hybrid populations. In addition, the neighborhood connections can be rings, (m, n)-complete, ladders, grids, etc. 2. The synchronicity of evolution and communication of the populations 3. The migration phenomena: migration rates (the percentage of individuals that migrate from one population to a different one), migration selection (the selections of the individuals that migrate) and migration frequency.
The above three aspects are covered in the definition of the GNGPs. The topology of connection of populations, and their initial distribution is made by means of the configuration of the processors connection graph. The evolution and communication of the populations is carried out by means of the universal clock underlying the definition of the operating mode of the networks. Finally, the migration processes are regulated by the definition of the input and output filters of each processor. In other words, the filters defined in the processors are effective procedures for selecting the individuals who can migrate from one population to another. Therefore, we can conclude that the GNGPs definition meets the main ingredients of parallel and distributed genetic algorithms. In this way, we can initiate a formal study about the generative capacity of the genetic algorithms and how many populations acting in parallel are necessary to be able to generate different populations formalized under the paradigm of the theory of formal languages. This study will be addressed in the following section.

Generating formal languages through generating networks of genetic processors
In this section, we propose different Generating Networks of Genetic Processors to generate the formal languages according to the Chomsky hierarchy. The number of processors of every proposed network structure is important in order to generate every language class. A general criterion that has been followed to formulate the different topologies and their use in the theorem proofs is that processors that use crossover are used to increase the lengths of the strings that are generated in the grammar, while processors that use mutation are used to make effective the substitution of non-terminal symbols by new terminal or non-terminal symbols.
In the following, we denote a complete graph with n vertexes by K n and the identity function from processors to vertexes by id.
Our first result is related to the regular language class, defined by right linear grammars. We provide the following theorem.

Theorem 1 Every regular language can be generated by a GNGP with 3 processors.
Proof Let L = L(G) and G = (N, T, P, S) be a right linear grammar. We define the GNGP The processors in are defined as follows The network structure is shown in Fig. 1, and it simulates the derivation process in the regular grammar. Processor N 1 collects the output strings and it applies the productions of the grammar. Observe that the strings of the language cannot leave the processor due to the output filter definition. Processor N 2 is used for the case when a production in the form A → bC has been applied. It applies crossover in order to add a new symbol from N at the end of the string. Observe that, due to the PO 2 filter definition, all the symbols from N remain in the processor N 2 . Finally, processor N 3 substitutes the symbols from N and [TN] used by N 1 and N 2 in order to keep the derivation process of the grammar. We propose the following enunciate that allows the formal proof of the theorem: In order to prove the statement, we carry out an induction process over the number of derivation steps in the grammar G to obtain . So, we prove that if S * The following steps are carried out in : First, S mutates to [aB] in N 1 during the first genetic step, then the string [aB] is communicated to N 2 . Here, by applying the crossover operation, the string [aB]B is obtained and it is communicated to N 3 . The other strings that can be obtained by applying the crossover operations are sent out the processor N 2 , and they cannot enter into a new processor, so they are lost. In the processor N 3 , the symbol [aB] mutates to a and the symbol B mutates to B in the next two genetic steps. Finally, the string aB is communicated to N 1 and the statement is true.
Induction hypothesis Let us suppose that for every integer p such that S

Induction step
Finally, let us suppose that S p ⇒ G ⇒ G . Here, = wA with w ∈ T * and A ∈ N and, by our induction hypothesis, ({S}, A 2 , �) k ↦ (L 1 , L 2 , L 3 ) with wA ∈ L 1 . Now, we consider two cases to obtain from wA: First, A → b ∈ P , with b ∈ T , and = wb . In this case, the string wA mutates to wb in N 1 given that A → b ∈ M 1 . In the following communication step, wb does not leave the processor N 1 and the statement is true. The second case is established whenever A → bC ∈ P and = wbC . Here, the string wA is in processor N 1 by our induction hypothesis. Then, the string wA mutates to w [bC] given that A → [bC] ∈ M 1 . The string w[bC] is then communicated to N 2 and, in the next genetic step, by applying the crossover operation in N 2 the string w[bC]Ĉ is obtained and communicated to N 3 . In the next two genetic steps, the string w[bC]Ĉ mutates to wbC which is finally communicated to N 1 , and the statement is true.
The second part of the statement can be established as follows: Here, we can carry out the induction proof in a way similar to the previous one.
Given that for every string w ∈ L(G) , S * ⇒ G w , we have proved that there exists a configuration (L 1 , L 2 , L 3 ) with w ∈ L 1 which can be obtained during the network computation and, consequently, w ∈ L( ) . So, the theorem is proved to be true. ◻

Example 1 Let G be the regular grammar defined by the following productions
The grammar G generates the language L(G) = {a n ∶ n ≥ 2} ∪ {b n ∶ n ≥ 2}. We define a GNGP = (V, T, N 1 , N 2 , N 3 , K 3 , id, N 1 ) that generates L(G) as follows: The processor N 1 = (M 1 , {S}, {S, A, B}, FI 1 , PO 1 , �, m) where M 1 is defined by the rules:

3
The processor N 3 = (M 3 , �, PI 3 , �, V, FO 3 , m) where M 3 is defined by the rules: The functioning of the network is explained in the following: In processor N 1 , the productions of the grammar are effectively applied. For example, if the production is A → a then directly the mutation A → a is applied, while if the production A → aA is applied then the mutation A → [aA] mutates the auxiliary symbol. Then the mutated string with the [aA] symbol is sent to the N 2 processor. In processor N 2 , by means of crossover operations, strings with the segment [aA]Â are obtained. These strings are sent to processor N 3 . In processor N 3 the mutation symbols [aA] are changed to a and the mutation symbols Â are changed to A. The string, which already contains only auxiliary and terminal symbols of the grammar G, is sent back to processor N 1 and a new grammar derivation cycle can be applied. Note that those strings containing only terminal symbols do not leave the processor N 1 and they are the strings generated by the grammar G. ◻ For the class of context-free languages we use an additional processor with respect to the network structure used in the regular case. In Fig. 2, we show the network structure that we use in the following proof.   ↦ (L 1 , L 2 , L 3 , L 4 ) with 1 A 2 ∈ L 1 ∩ (N ∪ T) * . Now, we consider two cases to obtain from 1 A 2 : First, A → b ∈ P and = 1 b 2 . In this case, the string 1 A 2 mutates to 1 b 2 in N 1 given that A → b ∈ M 1 . In the following communication step, 1 b 2 does not leave the processors N 1 and the statement is true.

Theorem 2 Every context-free language can be generated by a GNGP with
The second case is when A → BC ∈ P and = 1 BC 2 . Here, the string 1 A 2 is in processor N 1 as it is established in our induction hypothesis, and it is transformed into the string 1 BC 2 through a sequence of operations in the processors N 2 , N 3 and N 4 as we have described before. The string 1 BC 2 enters into the processor N 1 , and the statement holds.
The second part of the statement can be established as follows: Here, we can carry out the induction proof in a way similar to the first part of the statement.

Fig. 3 GNGP structure for context-sensitive grammars
Given that every string w ∈ L(G) follows from S * ⇒ G w , we have proved that there exists a configuration (L 1 , L 2 , L 3 , L 4 ) such that w ∈ L 1 that can be obtained during the network computation and, consequently, w ∈ L( ) . Hence, the theorem is true. ◻ The following class in the Chomsky hierarchy is the class of context-sensitive languages. In this case, we use part of the constructions that we have shown before. In Fig. 3, we show the network structure that we propose in the following result.
As in the proof of Theorem 2, the processor N 1 collects the output strings. The network simulates the derivation process in the grammar G. Observe that G is in Kuroda Normal Form. Hence, the productions of the grammar can only be of the following forms: For the case of productions in the form (1) and (3), the network carries out a set of operations that simulate the rule application as we have described in the proof of Theorem 2. In the case of productions of type (3), the processors N 1 , N 2 , N 3 and N 4 carry out the sequence of transformations previously described. For the case of productions of type (2), the networks directly applies this production at processor N 1 in a way similar to productions of type (1). Now, we focus on the productions of type (4). The first transformation is carried out at processor N 1 , where, for any production in the form AB → CD , the symbol A mutates to the symbol [ACD] l . Then the string is sent out of processor N 1 and it enters into processor N 5 provided that the segment [ACD] l B appears in the string. Then, the symbol B mutates to [BCD] r , the string is sent out of the processor N 5 and it enters into processor N 6 where [ACD] l mutates to C and [BCD] r mutates to D. So, the application of rule AB → CD is completed and the transformed string returns to processor N 1 .
We must prove the following statement The proof is similar as in Theorem 2, with the new rule applications that we have explained before. ◻ Finally, we define a GNGP network for the last class in the Chomsky hierarchy, that is the phrase structure (non-restricted) grammars. In this case, we propose the network structure that is shown in the Fig. 4. Observe that we take advantage of the previously proposed topologies, and we add new processors in order to deal with grammar productions in the form AB → B . We enunciate the following theorem that can be considered as an universality result for the Generating Networks of Genetic Processors.

Theorem 4 Every recursively enumerable language can be generated by a GNGP with 8 processors.
Proof Let G = (N, T, P, S) be an arbitrary phrase structure (non-restricted) grammar with the productions in the form established at Sect. 2. We omit the case for the production S → .
We propose the network where N) . In this case, the new alphabets are defined in a way similar to the previous results. The processors are defined as follows: grammar rules in the form AB → B . We can summarize the rules application as follows: The rules in the form A → a or A → B are directly applied in processor N 1 through mutation rules. The rules in the form A → BC are simulated by the processors N 1 , N 2 , N 3 and N 4 in a way similar as in Theorem 2 and Theorem 3. The rules in the form AB → AC and AB → CB are simulated by the processors N 1 , N 5 and N 6 in a way similar as in Theorem 3 (observe that these rules are a restricted case of the rules in the form AB → CD ). Finally, the rules in the form AB → C are simulated as follows: First, at processor N 1 , the symbol A mutates to the symbol ⟨⟨AB⟩⟩ , and the mutated string is sent out of the processor N 1 . The string enters into the processor N 7 provided that it contains the segment ⟨⟨AB⟩⟩B . At processor N 7 the string Observe that if B is the symbol at the rightmost position then the mutated string should be ̃ ⟨⟨AB⟩⟩⟨BX⟩ . The string is sent out of the processor N 7 and it enters into the processor N 8 where only crossover is applied in order to eliminate the last symbol of the string. Observe that in processor N 8 only self-crossover is carried out, given that the only string at processor is the mutated one. Finally, after the last symbol elimination, the string enters into processor N 4 where all the marked symbols are restored to the symbols of the grammar and the string is sent out to the processor N 1 .
As in the previous theorems we can enunciate and prove the following statement:

Further remarks and conclusions
First, we remark some achievements of this work: we have proposed the Networks of Genetic Processors as a generative model of computation. In addition, we have justified its definition as parallel genetic algorithms that act with certain restrictions when applying genetic operations, fitness selection and migration procedures between populations. This allows us to see parallel genetic algorithms as computational mechanisms for information generation. We have carried out a study about the generative capacity of the model based on the number of processors that act simultaneously. In our case, the research framework has been that of formal language theory, which is a valid operating framework because it covers all computational processes from the point of view of theoretical computer science. We have been able to prove that three, four, six and eight processors are sufficient to generate the classes of languages according to Chomsky hierarchy which is a generally accepted framework for the study of computatbility theory.
Regarding some improvements that we can address on our proposal, provided that the unitary productions A → B with A, B ∈ N can be eliminated in the grammar, with ∈ L 1 ∩ (N ∪ T) * then the mutation rules A → B can be removed from the processors. Observe that the formulation of new normal forms for the grammars in the Chomsky hierarchy, can lead to new network structures. We think that the proposed networks are optimal with respect to the number of the processors for every language class, and we will analyze the question in future works. Nevertheless, this is not the case for the alphabet of the network and the filters used to apply the grammar productions. We think that these parameters should be deeply studied in order to produce optimal solutions for the descriptive complexity of the proposed model.
Finally, we would like to remark the roles of the operations in the network: The crossover operation is used only to add or remove new symbols in the strings, while the mutation rules together with the input and output filters are the main core of the processors to apply the grammar rules. Hence, the set of strings of a predefined length obtained in the grammar could be generated by applying only mutation rules. This opens a new aspect of Networks of Bio-inspired Processors in order to propose a complexity measure based in a (semi)uniform approach.
Funding Open Access funding provided thanks to the CRUE-CSIC agreement with Springer Nature.

Declarations
Conflict of interest On behalf of all authors, the corresponding author states that there is no conflict of interest.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/ licenses/by/4.0/.