Parallel Multiset Rewriting Systems with Distorted Rules

: Most of the parallel rewriting systems which model (or which are inspired by) natu-ral/artiﬁcial phenomena consider ﬁxed, a priori deﬁned sets of string/multiset rewriting rules whose deﬁnitions do not change during the computation. Here we modify this paradigm by deﬁning level- t distorted rules—rules for which during their applications one does not know the exact multiplicities of at most t ∈ N species of objects in their output (although one knows that such objects will appear at least once in the output upon the execution of this type of rules). Subsequently, we deﬁne parallel multiset rewriting systems with t -distorted computations and we study their computational capabilities when level-1 distorted catalytic promoted rules are used. We construct robust systems able to cope with the level-1 distortions and prove the computational universality of the model.


Introduction
Biological, social, and economic life are governed by different levels of uncertainty which usually regard the epistemic cases and facts related to incomplete knowledge due to unknown/faulty information. In general, any partially observable environment can induce uncertainty (as uncertainty reflects quantitative and qualitative aspects of limited information about the subject). Modeling uncertainty and embedding it into formal models is usually done due to lack of knowledge about the studied phenomenon and is often one of the sources of inaccuracy in computational model simulation, analysis, and validation. In this respect, a small local imprecision may determine profound effects during the computation of the model.
When defining a computational model, one might be interested about designing a "fault/deviation"-tolerant system which performs its intended operation even when some part of it is faulty, deviated (distorted from the initially assumed correct form), or one does not know the exact behavior (hence one has to include into the definition presumably true outcomes). Hence, the issue of building rewriting systems that are able to cope with uncertainty (at the level of parallelism of the rewriting, or regarding the execution time of the rewriting rules, or the non-determinism) and solve problems was addressed in several papers (see [1][2][3][4][5][6]). Yet another approach to model uncertainty was to dynamically construct rules at each step during the computation. In this respect we refer the reader to [7]. Designing a robust system usually means developing a self-stabilizing computation which is able to "recover" from a specified "fault" by being able to detect the "error" and drive towards an error-free state (possibly, starting over).
A P system is a computational model inspired by the parallel processes occurring in the living nature, especially by the bio-chemical reactions happening at the level of cells. Since its introduction in [8] many variants were proposed in order to capture various aspects of cellular processes, but their applicability in time proved to be also successful in covering phenomena raging from social, biological, economical, to ecological processes. Here we considered the simplified version of catalytic P systems with promoters and/or inhibitors at the level of the rules (see [9]) which does not take into account the hierarchical membrane structure -hence we explored the computational capabilities of parallel multiset rewriting systems with catalysts and promoters/inhibitors whose rewriting rules are distorted during computations. Intuitively, a distorted multiset rewriting rule expresses the idea that one knows the participants (objects) in the rewriting process but does not know the exact outcome (meaning that one knows which are the resulting objects but does not know their multiplicities). Correspondingly, when defining the computation, one might consider several levels of distortions as the multiplicities of different species of objects in the output of an applied rewriting rule might be different than the initially defined ones. We are interested in defining multiset rewriting systems with 1-distorted computations which are able to generate the same set of numbers regardless the distortions of the rules applied during the computation.
In Section 2 we outline the basic notions and results regarding multisets, register machines, and parallel multiset rewriting systems. Section 3 introduces parallel multiset rewriting systems with promoters/inhibitors and t-distorted computations. Some results regarding their computational power are presented. Finally, in Conclusions we discuss several open problems and future lines of research.

Prerequisites
In what follows, we recall the basic notions and notations that will be used in the paper; we recommend [10] for a comprehensive summary of results from the formal language theory and other related fields. We also present parallel multiset rewriting systems as a particular case of P systems (see [11]).

Multisets, Distorted Multisets, and Related Concepts
An alphabet is a finite set of symbols Σ = {a 1 , a 2 , . . . , a n }, Σ = ∅. A string over Σ is a finite sequence of juxtaposed symbols from Σ, i.e., w = b 1 . . . b k , such that b i ∈ Σ, for all 1 ≤ i ≤ k. The empty string is denoted by λ. Σ * represents the set of all strings over Σ. The Parikh vector associated with a string w ∈ Σ * is Ψ Σ (w) = (|w| a 1 , . . . , |w| a n ). The Parikh image of a language L ⊆ Σ * is denoted by Ψ Σ (L) = {Ψ Σ (w) | w ∈ L}. Given a family of languages FL, by NFL (PsFL, respectively) we denote the family of length sets (Parikh images, respectively) of the languages from FL. We denote by ET0L the family of languages generated by ET0L systems and by RE the family of recursively enumerable languages. It is known that NET0L ⊂ NRE (see [12]   . . . a M(a n ) n be a multiset and 1 ≤ t ≤ card(supp(M)). A level-t strong distortion of w is a multiset w = a M(a 1 )+j 1 1 . . . a M(a n )+j n n such that for all 1 ≤ i ≤ n the following conditions are satisfied: , and at most t elements from {j 1 , . . . , j n } are not 0.
If in the relation (1) the inequality is strict, that is M(a i ) + j i > 0 if M(a i ) = 0, then the distortion is called weak.

Remark 1.
A weak distortion is a particular case of a strong one. More precisely, if w is a multiset andw a level-t weak distortion of w, then supp(w) = supp(w) and card(supp(w − w) ∪ supp(w − w)) ≤ t. On the other hand, in case of strong distortions, the assertion supp(w) = supp(w) is not necessarily true. We denote by dist t (w) the set of all level-t distortions of w.

Remark 2.
Assuming that w ∈ Σ * is a multiset such that card(supp(w)) = k > 0, then dist t (w) ⊆ dist t+j (w) for any 1 ≤ t ≤ k and j ≥ 0 such that t + j ≤ k.
A multiset rewriting rule is a pair (u, v) where u and v are multisets over Σ, u = λ. Typically, such a rule is written as r : u → v, where r is a label through which one can uniquely identify the rule in a set of rules. Given a rule r : u → v, let le f t(r) = u and right(r) = v.
Given a multiset w ∈ Σ * and a multiset rewriting rule r : u → v, we say that r is applicable to w if le f t(r) ⊆ w. Similarly, a multiset of multiset rewriting rules r k 1 Given a set of multiset rewriting rules R, a multiset w ∈ Σ * , and a multiset of rules ρ ∈ R * , we say that ρ is maximally applicable to w if • ρ is applicable to w; For a multiset of rules ρ = r k 1

Register Machines
A register machine is a tuple M = (n, P, l 0 , l h ) where n ≥ 1 is the number of registers (each register stores a natural number), P is a finite set of instructions bijectively labelled by elements from the set lab(P ) = {l 0 , . . . , l k−1 }, l 0 ∈ lab(P ) is the initial label, and l h ∈ lab(P ) is the final label. There are three types of instructions: increments the value stored by the register r and non-deterministically proceeds to the instruction labelled by l j or l k ; • l i : (sub(r), l j , l k ) where l i ∈ lab(P ) \ {l h }, l j , l k ∈ lab(P ), 1 ≤ r ≤ n, if the value stored by register r is 0 then proceeds to the instruction labelled by l k , otherwise decrements the value stored by register r and proceeds to the instruction labelled by l j ; • l h : halt stops the machine.
M is called deterministic if l j = l k for all increment instructions l i : (add(r), l j , l k ) ∈ P. M starts with all registers containing the value 0 and runs the program P, firstly executing the instruction with the label l 0 . Considering the content of register 1 for all possible computations of M which end with the execution of the instruction labelled l h : halt, one obtains the set generated by M (denoted here by N(M)).
The following result is due to Minsky [13].
Theorem 1. For any recursively enumerable set Q ⊆ N there exists a non-deterministic register machine with 3 registers generating Q such that when starting with all registers being empty, M computes and halts with k in register 1, and registers 2 and 3 being empty iff k ∈ Q.
The result mentioned in Theorem 1 stands true also for deterministic register machines accepting sets of numbers. More precisely, such a register machine starts by having the number k ∈ N in register 1 (all the other registers being empty) and accepts k if the computation halts, executing the instruction labelled l h : halt. As above, three registers are sufficient to accept any recursively enumerable set.

Parallel Multiset Rewriting Systems
A parallel multiset rewriting system (in short, a PMR system) represents a simplification of a membrane system whose hierarchical tree structure of membranes is reduced to one node (region)-see [11] and [14] for more details. More formally, a parallel multiset rewriting system with promoters/inhibitors and catalysts is a construct Π = (Σ, ∆, C, P, I, R, w 0 ) where Σ is an alphabet of symbols (objects), ∆ ⊆ Σ is the output alphabet, C ⊆ Σ is the set of catalysts, P ⊆ Σ is the set of promoters, I ⊆ Σ is the set of inhibitors, R is a set of multiset rewriting rules (which can be catalysed/promoted/inhibited), and w 0 is the initial multiset of objects.
A rule r ∈ R is of the form r : a → α (non-cooperative) or r : ca → cα (catalytic) where a ∈ Σ \ C, α ∈ (Σ \ C) * , and c ∈ C. The rules of mentioned types can be promoted (or inhibited, respectively), hence one defines promoted non-cooperative rule r : a → α| p , where p ∈ P (inhibited non-cooperative rule r : a → α| ¬i , where i ∈ I, respectively) and catalytic promoted rule r : ca → cα| p , where p ∈ P (catalytic inhibited rule r : ca → cα| ¬i , where i ∈ I, respectively).
As described in the preamble of the Section 1, a multiset of rules ρ ∈ R * is applicable to a multiset of objects w ∈ Σ * if there are enough objects in w to trigger all the rules from ρ with their corresponding multiplicity and, in case of promoted (inhibited) rules, if the specified promoters (inhibitors) are in w (are not in w). The applicable multiset of rules ρ is maximal if there is no applicable multiset of rules ρ ∈ R * to w and such that ρ ⊂ ρ (in the multiset sense).
It is worth mentioning that catalysts inhibits the parallelism of the system (as they are counted as any other objects) while the promoters/inhibitors only guide the computation (as the presence/absence of a promoter/inhibitor in the multiset of objects makes the corresponding promoted/inhibited rules to be available for application as many times as possible).
The system Π evolves by applying a maximal multiset of rules to the initial multiset (configuration), then applying iteratively another maximal multiset of rules to the multiset obtained in the previous step (i.e., the next configuration) and so on. In other words a transition between configurations C 1 and C 2 of Π is determined by an application of a maximal multiset of rules in parallel. More precisely, if ρ is a maximal multiset of rules on C 1 , then C 2 = C 1 \ input(ρ) + output(ρ).
A computation of Π is a sequence of configurations such that the first configuration in the sequence is the initial configuration and between each two consecutive configurations there exists a transition (which is determined by an application of a maximal multiset of rules). A computation is successful if this sequence is finite, namely there is no rule applicable to the objects present in the last configuration-in this case, the number or the Parikh vector corresponding to the multiset of objects from ∆ present in the last configuration of Π is considered to be the result of the underlying computation. By collecting the results of all successful computation of Π one gets the set of numbers/vectors of numbers generated by Π; they will be denoted by N(Π) and Ps(Π), respectively.
The familly of all sets of numbers (vectors) of numbers generated by PMR systems with a list of features f ∈ {ncoo, cat k , pro, inh} (indicating the usage of non-cooperative rules, catalytic rules with at most k catalysts, promoters, and inhibitors, respectively) is denoted by NOP( f ) (or PsOP( f ), respectively).

Towards "Distorted" Computations
Given a non-cooperative multiset rewriting rule r : a → α, a t-level distortion of r is a multiset rewriting ruler : a →α whereα ∈ dist t (α). Similarly, given a catalytic multiset rewriting rule r : ca → cα, a t-level distortion of r is a multiset rewriting ruler : ca → cα whereα ∈ dist t (α). Distorted non-cooperative or catalytic rules can be promoted or inhibited as described above.
A parallel multiset rewriting system with promoters and/or inhibitors with a t-distorted computation, where t > 0 (in short a PMRD t system) Π t = (Σ, ∆, C, P, I, R, w 0 ) has all the components defined as for a PMR system but with the semantics of the computation modified in the following way. To compute a step leading to a configuration C j+1 from a configuration C j (that is, to perform a transition between configurations), Π t non-deterministically selects a maximal applicable multiset of rules ρ and for each instance r of a rule in ρ, Π t applies a t-level strong distortion of r but such that at least one such application is weak for any given species of rules in ρ.
For example, let the selected multiset of rules be ρ = r k 1 1 . . . r k j j . Accordingly, for the species of rules r i , 1 ≤ i ≤ j, there will be k i applications of the (distorted) rule r i that Π t has to perform. Among these applications, at least one of them has to be a weak t-level distortion of r i (while the rest of them might be weak or strong distortions of r i ).
As defined for a PMR system, Π t starts from the initial configuration and performs transitions between configurations (consequently, yielding a sequence of configurations). The computation produces an output if this sequence of configurations is finite (that is, the last configuration in the sequence is the halting configuration in which no rule is applicable anymore).
By N(Π t ) (and Ps(Π t ), respectively) we denote the set of numbers (or vectors, respectively) of numbers generated by Π t . By NOP d=t ( f ) (or PsOP d=t ( f ), respectively) we denote the family of all sets of numbers (vectors) of numbers generated by PMRD systems with a list of features f ∈ {ncoo, cat k , pro, inh} and t-distorted computations.
A PMRD system Π t , t ≥ 1, is called to be permissive to distortion if, in any given configuration during the computation, no matter how a t-level distortionr of each instance of a rule r in the multiset of applicable rules ρ is selected, Π t generates the same set of numbers/vectors.

Example 2.
In order to better explain the functioning of a PMRD 1 system Π 1 = (Σ, ∆, C, P, I, R, w 0 ), assume that R = {r 1 : a → bd, r 2 : ca → ce} and Π 1 is in configuration C = ca 3 . Then one can notice that there exist two maximal applicable multisets of rules to C, namely r 3 1 and r 2 1 r 2 .
The system Π 1 is "highly non-deterministic" as it has to apply level-1 distorted rules. Here we present few (among many others) next configurations obtained by applying the multiset of rules r 3 1 on C (recall that in this case we have to apply 3 times the level-1 distorted ruler 1 ; at least one of them has to be a weak level-1 distortion of r 1 while the rest of them can be strong): cbd, cbd 3 , cb 3 d, cb 10 d 3 , cb 10 d 11 , etc. Similarly, if on configuration C is applied the multiset of rules r 2 1 r 2 then some examples of next configurations are: cebd, cebd 10 , ce 10 b 5 d 3 , etc. Recall that in this case a single weak level-1 distortion of r 2 was applied; additionally, it was applied one weak level-1 distortion of r 1 and one strong level-1 distortion of r 1 .

Example 3.
We sketch an example of a distorted P System with promoters and one catalyst which is able to generate the non-semilinear set {2 n | n ≥ 1}. A common approach to generate this set of numbers is to consider several rules whose iterative applications determine the system to double the number of an object (at each iteration); in addition, the constructed system has to provide the rules to break out the cycle, hence to end the computation.
As some of the techniques employed in what follows were also used to prove the equivalence between distorted P systems with mentioned features and register machines, here we only detail the rules that, starting from a configuration cXYa 2 k , determine the system to reach the configuration cX l 1 a 2 k+1 , where l 1 ≥ 1. The general idea employed in this example is to use the catalyst c to sequentially double the number of symbols a into a, checking at the same time if the distortion does not affect the number of target objects a produced during the application of the rules. The rules are grouped according to the moment of their execution.
In the first step, the distorted rule ca → caab|X is applied only once because the current multiset contains only one copy of object c. In this case, the level-1 distortion can affect either the number of output objects a or the number of output objects b. Using level-1 distorted catalytic rules and promoters, one can effectively check if the number of objects b is greater than 2 (hence one can determine if b was actually the subject of distortion). This is done in the steps 2 and 3 by the rules cb → cb|X 1 and cb → co|b (the last rule being applied only if there were more objects b present in the second configuration, hence implying that b was the subject of distortion). It follows that, in case the object o is generated, then the promoters X and Y are produced, hence the rewriting of another object a can start over. Proceeding in this way for all the objects from the initial multiset cXYa 2 k one gets in the last configuration 2 k+1 copies of the object a. It is important to highlight that in case all the objects a were rewritten, in the first step only the rule Y → Y 1 is executed; in the second step all the object Y 1 are deleted by the rule Y 1 → λ and the computation halts.
Finally, in order to generate the set {2 n | n ≥ 1} one has to provide the rules that rewrite all the objects a in their corresponding counterparts a. This can be done using a similar technique to the one presented above (that is, by sequentially rewriting a into a by using a level-1 distorted promoted catalytic rule and checking if the distortion did not affect the multiplicity of the output objects a).
The following result shows that the class of sets of numbers generated by PMRD systems with level-1 distorted non-cooperative multiset rewriting rules is at most equal to the class of sets of numbers generated by ET0L systems.
Proof. Let us consider a PMRD 1 system Π 1 = (Σ, ∆, C, P, I, R, w 0 ) with promoted noncooperative multiset rewriting rules (C = I = ∅) and with 1-distorted computation. Without loss of generality we may assume that all the rules of Π 1 are promoted (recall that a non-cooperative multiset rewriting rule a → β ∈ R can be written as a → β|a). Hence, let As mentioned in Section 2 we know that NOP(ncoo, pro) = NET0L, hence it is sufficient to construct a PMR system Π = (Σ, ∆, C, P, I, R, w 0 ) with promoted non-cooperative multiset rewriting rules (C = I = ∅) that simulates the computation of Π 1 .
Let us consider the finite sets Σ = {a | a ∈ Σ}, Σ = {a | a ∈ Σ}. We define Also, let the following morphisms be: The set of rules P is defined as follows: • for 1 ≤ i ≤ n, the following rules (type 1) are added to P: the following rules (type 2) are added to P: • for 1 ≤ i ≤ n, the following rules (type 3) are added to P: for 1 ≤ i ≤ n, 1 ≤ j ≤ k i , the following rules (type 4) are added to P: • the following rules (type 5) are added to P : • the following rules (type 6) are added to P: Rules of type 5 indicate a "control" branch in the computation of Π that is executed in parallel with the main branch responsible for the simulation of the level-1 distorted rules applied by Π. The cycle S → SXY|t produces at each step the objects X and Y, but only if an object t is present in the respective configuration of Π. The object t is produced during the applications of the rules from the main branch (also, in the main branch, the objects from Σ are rewritten programmatically into their corresponding counterparts by the morphisms h and h ). It is worth mentioning that in the case that the object t is not produced (recall that if present in a configuration, t is deleted by the type 6 rule t → λ) the cycle S → SXY|t is interrupted, hence Y will be produced (the rule Y → λ|t cannot run because the object t is missing; this allows the execution of the rule Y → Y|X). The object Ywill determine the rewriting of the type-6 rules h (a) → at|Y for all the symbols a ∈ Σ from the current configuration (hence the simulation can start over).
The main branch simulates the applications of the (distorted) rules of Π as follows. Firstly, the rules of type b i → h (b i )tr i |p i are applied. Their role is • to "paint" the objects that trigger the application of a multiset of rules of Π in a given configuration; • to produce a "witness" object t indicating that a simulation of an application of a rule is in progress; the object t will forbid the generation of Y in the control branch; • to produce a "selector" object r i -an object that will be used to select which distorsion of the simulated rule has to be applied.
Consequently the selector r i is rewritten by the type 2 rules into r (i,1) , . . . , r (i,k i ) . An object r (i,j) is used as a promoter to indicate the species of objects that will be affected by the distortion in rule i (namely b (i,j) ) Correspondingly, the rule of type 3 is executed: As described before, the "witness" object t prevents the generation of Y in the control branch.
Next, the rules of type 4 are executed. The rule r (i,j) → h (b (i,j) )r (i,j) t represents a cycle which generates objects h (b (i,j) ). Due to non-determinism, the cycle can be interrupted by the rule r (i,j) → h (b (i,j) )r i t. In this way, after the end of applications of sequences of rules for all possible cases (recall that one has to simulate a multiset of distorted rules of Π) the resulting configuration will contain the "painted" objects by morphism h (and no object r (i,j) ). At that time, because the object t is not generated anymore, the control cycle produces object Y. This will determine the execution of the rules h (a) → at|Y for all a ∈ Σ, hence the simulation can start over.
The simulation continues in the same manner until Π 1 stops (in the last configuration of Π 1 no rule can be applied). Correspondingly, Π stops as well because the rules of type 1 cannot be triggered.
In the next step, rule A l i → λ|X l i is used to clean-up all the remaining (if any) symbols A l i . Meanwhile, one has to check if the object a r was not affected by the distortion during the application of the level-1 distorted rule cA l i → ca r l i X l i |B l i . This is done by using the "dummy" object X l i ; more precisely, if Π 1 detects that in the current multiset there are several objects X l i then this means that the distorted rule cA l i → ca r l i X l i |B l i produced exactly one symbol a r (that is, the distortion affected the multiplicity of X l i ) hence the system has to proceed to the generation of the next label l j or l k . Correspondingly, if Π 1 executes in consecutive steps the rules cX l i → cX l i Y l i cX l i → cX l i |X l i it follows that the object X l i is produced and from here on the generation of objects l j or l k will take place (as one of the rules l i → l j |X l i or l i → l k |X l i will run; it is also worth to mention that although there is exactly one object l i , after applying the above mentioned rules there might exist multiple copies of objects l j or l k , respectively).
However, due to distortion it might happen that cX l i → cX l i |X l i is not executed (meaning that other symbol than X l i was the subject of distortion while cA l i → ca r l i X l i |B l i was applied or the distortion on the species X l i did not produce strictly more than one object). If this is the case, then the object Y l i will be rewritten (in several steps) into Y l i and it will be used as a promoter in rule l i → #|Y l i . Once the object # is generated the rule # → # will run forever, consequently yielding no result.
If the instruction that has to be simulated is the decrement instruction l i : (sub(r)l j , l k ) then Π 1 executes the rule l i → l i Y l i and possibly ca r → cX l i Y l i |l i . If the current configuration contains at least one object a r , then one instance of the object a r is deleted by the last mentioned rule. It is worth to point out that in the first step all the objects l i are rewritten by the rule l i → l i Y l i , hence ca r → cX l i Y l i |l i can be executed only once (as being promoted by l i ). Next, in the second step, the rules l i → l j |X l i , X l i → λ and Y l i → Y l i are executed, hence the object l j (corresponding to the label of the next register machine instruction) is generated. The object Y l i will be deleted later on by the rule Y l i → λ.
On other hand, if the rule ca r → cX l i Y l i |l i is not executed because there are no objects a r in the current configuration, then in the first step only the rule l i → l i Y l i will be executed. In the second step the rule Y l i → Y l i will run. Finally, in the third step the rules l i → l k |Y l i and Y l i → λ will generate the object l k (corresponding to the label of the next register machine instruction).
Finally we are pointing out that in case the object l h is produced then Π 1 stops. We also emphasize that the construction of the PMRD 1 system presented in the proof of Theorem 3 can be easily modified to simulate an arbitrary deterministic register machine which accepts a set of numbers. Moreover, the constructed system Π 1 is permissive to 1-level distortions.

Conclusions
Many mathematical models proposed to capture natural/artificial phenomena can be represented by using discrete input-output maps. In this paper we defined multiset rewriting systems with t-distorted computations. These types of P systems were proposed to reflect the uncertainty related with non-exact knowledge of the parallel rewriting processes (which, in particular, can model bio-chemical, physical, economical sociological, or other types of phenomena) for which one knows the inputs but does not know the exact outputs. To this aim we defined level-t distorted multiset rewriting rules which assumes that, if applied in a derivation step of a PMRD system, the multiplicities of at most t species (non-deterministically selected) of the objects in the output are not known. We succeeded to find an upper bound for the computational power of PMRD systems with level-1 distorted non-cooperative promoted rules, namely we succeeded to prove that NOP d=1 (ncoo, pro) ⊆ NET0L. On the other hand, when level-1 distorted catalytic promoted rules (with one catalyst) are used, the model proves to be computationally universal.
There are several problems left open. A promising research line regards the usage of other rewriting formalisms and types of rules. For example, although it was mentioned in this paper, the case of PMRD systems with inhibited rules was not investigated. However, for this types of PMRD systems we conjecture the existence of similar results (namely NOP d=1 (ncoo, inh) ⊆ NET0L and NOP d=1 (cat 1 , inh) = NRE). Moreover, the cases when d > 1 are also left open. Yet another research topic regards an extensive study of systems which are permissive to distortions. In this respect one might also consider developing ultimately confluent systems with distorted rules (see [9]).