Inference of bounded L systems with polymorphic P systems

In this paper, we are going to solve the inference problem of bounded L systems, namely such L systems which work on filaments having length up to a fixed size. We will show that these bounded L systems have considerable computational power as they can simulate linear-bounded automata. To carry out the inference, we are going to construct a specific polymorphic P system with target indication, which can reproduce the transitions of the examined bounded L system, and which is of size O(n|G|4)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$O(n|G|^4)$$\end{document}, where G is the alphabet of the bounded L system with n as the maximal size of the filaments.


Introduction
The inference problem was formulated for learning languages, grammar from samples and for different families of automata from their computations. Given an automaton, one could apply its rules starting from initial configurations to gain computations of the automaton. During inference one solves the inverse process, namely gaining the rules and the structure of an unknown automaton from its given computations. For a comprehensive view of the inference problem, see, for example, [6,8], or the proceedings of the International Colloquium on Grammatical Inference, see, for example, [21].
In this paper, we are going to consider the inference problem of L systems. A thorough investigation of this topic can be found in [5], and there is also a survey which covers this area up to 2009, see [3]. L systems were introduced by Lindenmayer in [12] to study cellular development with mathematical models. These systems had a great impact since, see [17][18][19][20]. They in fact have quite great computing ability as it is described in [7], where the author showed that for every Turing machine there exists a Lindenmayer system which simulates it.
Membrane computation and P systems were originally introduced by Păun in 1998, see [14]. For a comprehensive introduction to this field, see the books [15,16]. The most up-to-date results can be found on the P system web site [22], and at the bulletin of the International Membrane Computing Society [4]. Polymorphic P systems are special variants of P systems, which deduce the applied rules from the contents of their membranes, which ability combined with communication through target indication makes them good candidates for solving inference-related problems. These systems were first described in 2011, see [1]. For a survey about the development of these systems up to 2016, see [2].
Our goal is to give a method to construct polymorphic P systems which solve the inference problem of L systems. One problem arises, namely that L systems work on strings while membrane systems, although may process strings, mainly work on objects in their compartments. We concentrate on the case when the contents of the membranes are multisets. The missing information here is the sequentiality, which can be represented in the membrane structure or object encoding. Instead of representing sequentiality through some intricate method using the membrane structure, we look at the object encoding method.
The investigated representation is the encoding through indexing the letters in the filaments. Let G be the nonempty finite alphabet of the L system and define ∶= {a i |a ∈ G, i ∈ ℕ} . Using this set, define the ∶ G * → ℘( ) function as ( ) ∶= � and ( a) ∶= ( ) ∪ {a l( )+1 } , where a ∈ G , ∈ G * and a l( )+1 ∈ . For example, (abcb) = {a 1 , b 2 , c 3 , b 4 } . The indexing makes it possible to restore the original string uniquely, so this is a bijective method. Representing strings with arbitrary length would require an infinite alphabet; however, with a fixed integer n, the restriction ( )| l( )≤n requires a finite subset of of size only n|G|. The transition function for an L system is defined as ∶ G 3 → G * , so the system could produce a longer output than the input in a step of the computation. Taking this into consideration we could not use the previously established finite alphabet. We are going to overcome this by posing a restriction on the inferred L systems.
Myhill introduced the term linear-bounded automata, see [13], which is a deterministic Turing machine type working on a bounded tape segment (for more information, see [9]). We are going to show that these automata can be simulated by L systems, which work on filaments of fixed size. Linearbounded automata have considerable computational power, see [10,11], so the bounded version of L system which we create for their simulation has too. We will investigate the inference of such bounded L systems by constructing a polymorphic P system with target indication. The obtained polymorphic P system will be of size O(n|G| 4 ) , where G is the alphabet of the examined bounded L system and n is the maximal size of the filaments. The transitions of the bounded L system are processed in a teaching part by feeding the filaments of the transitions using an encoding into the polymorphic P system. After the teaching, the resulting polymorphic P system can reproduce the transitions of the examined sequence of filaments, when initiated with an encoded form of the initial filament.

L systems
Let G be a finite nonempty set of symbols or cells, then G * denotes the set of all strings or filaments, being the empty string. It is assumed that in the case of a cell at the end of the filament the outside environment will act on this cell just as if it was a cell in some state. A Lindenmayer system or L system is a tuple L = (G, ) modifying filaments, where ∶ G 3 → G * is the transition function, which indicates the new symbols by which the middle one is replaced for any three neighbouring symbols. This function can be extended to � ∶ G × G * × G → G * , which indicates how a filament changes when it receives environmental input from both left (l) and right (r). The definition of ′ is, in this case, given as � (l, , r) ∶= , � (l, a, r) ∶= (l, a, r) and � (l, , r) ∶= � (l, � a 1 , a 2 ) (a 1 , a 2 , r) , where = � a 1 a 2 with � ∈ G * and a, a 1 , a 2 ∈ G . The computation of L is a finite sequence of filaments sequentially gained by the application of ′ starting from an initial ∈ G * filament and ending in a halting configuration, where no symbol changes due to the application of ′ .

Polymorphic P systems
A polymorphic P system with target indication is the construct where is a finite alphabet of objects, T is the subalphabet of terminal objects, H is the finite set of membrane labels, is a tree structure consisting of 2n + 1 membranes labelled with the elements of H, w s ∈ * is the multiset giving the contents of the skin membrane, ⟨w iL , w iR ⟩ are pairs of multisets giving the contents of membranes iL ∈ H and iR ∈ H (1 ≤ i ≤ n) , with w iL , w iR ∈ * . We require that, for every 1 ≤ i ≤ n , the membranes iL and iR have the same parent membrane. Furthermore, h i ∈ H and h o ∈ H ∪ {0} are the labels of the input and the output membranes, respectively, where 0 denotes the environment. Finally, the ∶ {1R, … , nR} → {in h |h ∈ H} ∪ {here, out} mapping assigns a target indication to every right-hand-side membrane. The target indication is interpreted as in the case of conventional P systems. Note that with these restrictions, we effectively allow ignoring the hierarchical membrane structure for communication purposes.
The rules of are not statically given in its description but instead dynamically inferred for each configuration based on the contents of the pairs of membranes iL and iR. Thus, if in a configuration of the system these membranes contain the multiset u and v, respectively, then, in the next step, their parent membrane h will evolve as if it had the multiset rewriting rule u → v associated with it. If, however, in some configuration, iL is empty, we consider the rule defined by the pair ⟨w iL , w iR ⟩ to be disabled, i.e. no rule will be inferred from the contents of iL and iR.
Polymorphic P systems evolve by applying the dynamically inferred rules in a maximally parallel way. A computation of a polymorphic P system is a finite sequence of configurations may successively visit, ending in a halting configuration in which no rules can be applied any more in any membranes. Like for other classes of P systems, the output of is the contents of the output membrane h o projected onto the terminal alphabet T.

Linear-bounded automata
A linear-bounded automaton is specified by an A = (Q, , , q 0 , #, F, ) tuple, where Q is the nonempty finite set of states, ⊆ is the nonempty finite set of the input alphabet, is the nonempty finite set of the tape symbols, q 0 ∈ Q is the initial state, # ∈ is a dedicated boundary symbol, and F ⊆ Q is the set of final states; furthermore, the transition function is defined as where D ∶= {− 1, 0, + 1} , and therefore, the # boundary symbol is not affected during computation. The automaton functions as follows. It is given as input a tape blocked into squares containing a string #x# , where x ∈ * . Before operation on the input, the state of the automaton is set to q 0 . At the initial stage, it reads the left boundary symbol in the state q 0 . In general, the computation of the automaton is the same as a deterministic Turing machine, except if it runs off the end of the given tape, designated by a boundary symbol, and at this time it finds itself in one of the final states of F, then by definition, the string x is accepted, or otherwise, rejected, by the automaton. The set of all strings accepted is the language accepted by the automaton.

Results
First, we show how linear-bounded automata can be simulated using L systems.

Lemma 1 For every
l x# r ∈ G * initial filament, such that if A does not terminate, then L will not finish its computation, and if A terminates accepting (respectively, rejecting) with #y# on its tape, where y ∈ ( ⧵ {#}) * , then L finishes its computation accepting (respectively, rejecting) with filament # l y# r .
Proof Let A = (Q, , , q 0 , #, F, ) be our or iginal automaton and let L = (G, ) be the constructed L system. Let # ∶= ( ⧵ {#}) ∪ {# l , # r } and G ∶= {g, g q , g q,d | g ∈ # , q ∈ Q, d ∈ D} be the alphabet of L. We are going to mark the left and right boundary symbol with # l and # r , respectively. Now |G| ∈ O(| ||Q|) , which is an alphabet of polynomial size.
If and (⋅, c q,0 , ⋅) ∶= c q to remove the unnecessary information from the filament. The simulation of a step of automaton A can be seen in Fig. 1.
If the input of A is x ∈ * , then the initial filament of L is = # q 0 l x# r , so the head is at the left boundary symbol and the state is q 0 at the start of the computation. When we arrive at a filament which contains either # q,−1 l or # q,+1 r , then the computations are finished after the next application of ′ . If q ∈ F , then we finished the computation accepting otherwise rejecting. □ Now we turn to the problem of inferring these bounded L systems with the aid of polymorphic P systems. The inference method will consist of two parts, first the teaching and then the recalling. In the teaching part, we apply a special encoding to tell the polymorphic P system the transitions of the examined L system.
In the recall part, we input a filament of the given L system in -encoded form, extended with indexed environmental inputs up to a fixed length.
The rules are stored as the transitions performed by a function. So in the membranes where the conversion happens, a rule is stored in the form of the three initial neighbouring symbols together with the resulting new symbol which replaces the middle one. Exceptional ones are the membranes responsible for the handling of the symbols at the ends of the filament. These membranes require only two neighbouring symbols to perform the replacement. So one membrane is responsible for the transformation of a symbol at one index only, but it requires the symbols at the neighbouring places. That is why distributor membranes multiply the symbolwhich they are responsible for-into the proper membranes, where the rules are stored. The output of the transition arrives at the same membrane where the input came; therefore, the process will go on in a cyclic manner, see Fig. 2.
Let l, r ∉ G be the fixed left and right environmental input, respectively. Define G i ∶= {g i |g ∈ G} , the elements of the L system's G alphabet indexed with a given i ∈ ℕ integer. Let We are going to work with multisets of fixed size in the recall part, so we introduce the alphabet extended with the indexed environmental symbols as Fig. 1 Simulating a step of automaton A, where g i−1 , g i+1 ∈ # . We rewrite a to b, change the state from p to q and step in one of the directions {−1, 0, +1} where ∈ G * and l( ) ≤ n . We extend the encoded input with the indexed environmental symbols using this function.

T h e a l p h a b e t o f t h e t r a n s i t i o n s i s
We are going to encode the transitions with the ∶ ℘( ) × ℘( ) → ℘( ) function defined as where g 1 , g � 1 ∈ G 1 and when k > 1 , then Proposition 1 For fixed n > 0 integer, every L = (G, ) deterministic Lindenmayer system with ∶ G 3 → G , and ij ∈ G * , 1 ≤ l( ij ) ≤ n filaments with 1 ≤ i ≤ k and there exists a polymorphic P system with target indication, which after processing the inputs ( ij , ij+1 ) , where 1 ≤ i ≤ k and 1 ≤ j < k i , the contents of the skin membrane initiated with e ( i1 ) changes as Proof Let be the constructed polymorphic P system. Define the objects of the system as ∶= e ∪ ∪ {t 1 , t 2 , t 3 , t 4 } , where t 1 , … , t 4 ∉ e ∪ are symbols which will help us activate or inhibit rules. The output alphabet is defined as T ∶= e . e ( ) ∶= {l 0 , r l( )+1 , … , r n+1 } ∪ ( ), The labels, the membrane structure, the contents of the membranes and the target indication will be given as the proof goes. Where we do not state otherwise, the target of a rule is here.
The contents of the skin membrane are the iL, iR membranes, where 0 ≤ i ≤ n + 1 , the gL, gR membranes, where g ∈ e , and the L, R membranes, where ∈ . The iL, iR membranes are responsible for the processing of the ith cell in the filaments. The gL and gR membranes send the encoded symbols of the filaments into the iR membranes for processing; therefore, we are going to deal with these membranes in the discussion of the recall part. We store the rules and apply them in the iR membranes. Because of this, iL has no purpose, so w iL ∶= . The L, R membranes send the encoded transitions into the appropriate iR processing membranes. The structure of these rules can be seen in Fig. 3.
An iR membrane for 1 ≤ i ≤ n contains the i(g i−1 g i g i+1 )L, i(g i−1 g i g i+1 )R membranes, see Fig. 4. When a g i−1 g i g i+1 → g � i object arrives at iR, we store the left-hand side in i(g i−1 g i g i+1 )L and the right-hand side in i(g i−1 g i g i+1 )R . In the beginning, every such membrane pair realises the g i−1 g i g i+1 → g i transition; therefore, the represented rule will not change the g i object.
We set (i(g i−1 g i g i+1 )R) ∶= in s , so when the g i−1 g i g i+1 triplet arrives at iR, we transform g i to g ′ i and send it back to the skin membrane.
When a ∈ object arrives in iR for 1 ≤ i ≤ n , we store the transition using the membranes which can be seen in Fig. 5.
If we have not stored the given rule yet, then the i L, i R rule sends the t 1 t 2 t 3 t 4 objects into i R . This triggers the inclosed rules. The transition is rewritten in the appropriate membrane pair due to the presence of t 1 and t 2 . The t 3 object is sent to the i L membrane as a t 1 object for activation. There, the i L, i R rule activates the i L, i R rule, so when a object arrives again to the iR membrane, it will be simply erased. The whole learning mechanism is deactivated with the effect of the t 4 object, which is sent in the i L membrane as t 1 for deactivation.
If we have already stored a given rule, then the i L membrane will contain t 1 , so it will not be applied, whereas i L will contain only , so the i L, i R rule will delete the received object.
The 0R and (n + 1)R membranes are exceptions, there we only deal with sending the objects on the edges immediately Fig. 2 Partial sketch of the steps performed during the recall part. A i symbol is distributed into those membranes where its presence is required. After the stored rule is applied, it becomes ′ i in the same membrane where it started out as i , so the process repeats Fig. 3 Schematic for the L, R rules in the skin membrane, with ∈ having structure of = g i−1 g i g i+1 → g � i , where g i−1 ∈ i−1 , g i , g � i ∈ i and g i+1 ∈ i+1 for 1 ≤ i ≤ n back to the skin membrane. Because the 0R membrane receives g 0 g 1 , and we do not have to modify g 0 , 0R contains only the g 0 → (g 0 , in s ) and g 1 → rules for g 0 ∈ 0 and g 1 ∈ 1 . Also, because the (n + 1)R membrane receives g n g n+1 , and we do not have to modify g n+1 , (n + 1)R contains only the g n+1 → (g n+1 , in s ) and g n → rules for g n+1 ∈ n+1 and g n ∈ n . During the recall part, we input the e encoded form of an i1 ∈ G * initial string into the skin membrane, where 1 ≤ i ≤ k . The input symbols are sent as triplets into the appropriate iR membranes for 1 ≤ i ≤ n , using the g i L, g i R membranes, see Fig. 6. A g i ∈ i object triggers the g i L, g i R rule which sends t 1 t 2 t 3 into the g i R membrane. Therefore, due to the presence of these objects, g i is sent to the (i − 1)R , iR and (i + 1)R membranes separately.
The symbols on the edges of the input are handled separately with the g 0 L, g 0 R and the g n+1 L, g n+1 R membranes, see Figs. 7 and 8. Using the g 0 L, g 0 R rules, similar to the previous process, g 0 is sent into 0R and 1R, while using the g n+1 L, g n+1 R rules, g n+1 is sent to nR and (n + 1)R.
This way, an iR membrane receives the g i−1 g i g i+1 objects from the skin membrane for 1 ≤ i ≤ n , while 0R receives g 0 g 1 and (n + 1)R receives g n g n+1 .
The rules in the iR membranes for 1 ≤ i ≤ n change the triplets according to the learnt transitions. Because the target of every i(g i−1 g i g i+1 )R membrane is the skin membrane, the results of the g i−1 g i g i+1 → g � i transitions get back into the skin membrane. Even those objects get back into the skin membranes for which there was no transition presented during the learning phase, because in the beginning every i(g i−1 g i g i+1 )L, i(g i−1 g i g i+1 )R rule realises the g i−1 g i g i+1 → g i Fig. 4 Schematic for the i(g i−1 g i g i+1 )L, i(g i−1 g i g i+1 )R transition storing membranes, where g i−1 ∈ i−1 , g i , g � i ∈ i and g i+1 ∈ i+1 for 1 ≤ i ≤ n Fig. 5 Schematic for a iR membrane where 1 ≤ i ≤ n and the required membranes for the handling of a Schematic for a g i L, g i R rule when 1 ≤ i ≤ n g 0 g0L Schematic for a g 0 L, g 0 R rule g n+1 gn+1L Schematic for a g n+1 L, g n+1 R rule rule. The g 0 and g n+1 objects get back to the skin membrane due to 0R and (n + 1)R. Finally, we count the size of the system. Because | i | ∼ |G| , the number of L, R membranes is O(|G| 4 ) and because | e | ∼ n|G| the number of gL, gR membranes is O(n|G|) in the skin membrane. In every iR membrane, there are O(|G| 3 ) number of i(g i−1 g i g i+1 )L, i(g i−1 g i g i+1 )R membranes, and O(|G| 4 ) number of i L, i R and i L, i R membranes, so the number of membranes contributed by the iR membranes is O(n|G| 4 ) . Every membrane which we did not count contributes a constant multiplier to the membrane count, so we get that the total size membrane system is O(n|G| 4 ) which is polynomial. □

Conclusions
We have showed that L systems which work on filaments of fixed size have considerable computational power because they can simulate linear-bounded automata. We have given a method to construct a polymorphic P system for a given G alphabet and n size, which polymorphic P system is of size O(n|G| 4 ) , and it solves the inference problem of L systems defined over the G alphabet working on filaments having size at most n. It is still an open question that with what approach can one achieve the inference of arbitrary L systems using polymorphic P systems, so when we do not pose size limitations on the filaments of the examined L system. In this case, the indexing strategy surely will not work because it would introduce an infinite alphabet. It seems that one would have to resort to representing the filaments using the membrane structure of the polymorphic P system. This would require the introduction of membrane division, membrane dissolution, membrane creation and even dynamic targeting for polymorphic P systems (see the section of open questions in [2]).
It may be fruitful to approach the inference problem of Turing-complete systems with polymorphic P systems from a different angle, namely examining different types of machines. Queue automata make a very good candidate, see [9]. In this case, a great simplification can come from the fact that it can be easily decided which symbol(s) introduced which given change(s).