Grammars controlled by petri nets with inhibitor arcs

A Petri net controlled grammar is a grammar equipped with a Petri net whose transitions are labeled with production rules of the grammar, and the associated language consists of all terminal strings which can be derived in the grammar and the sequence of rules in every terminal derivation corresponds to some occurrence sequence of transitions of the Petri net which is enabled at the initial marking and finished at a final marking of the net. In this paper we define grammars controlled by Petri nets with inhibitor arcs and investigate their computational capacities. | Formal grammars and languages | Grammars with regulated rewriting | Petri nets | Petri net controlled grammars | ® 2010 Ibnu Sina Institute. All rights reserved.


INTRODUCTION
The symbolic representation of a modeled system in the form of strings makes its processes by information processing tools very easy.Moreover, Coding Theory, Cryptography, Computation Theory, Computational Linguistics, Natural Computing, and many other fields directly use strings for the description and analysis of modeled systems.In the modeling we usually have to deal with infinite sets of strings.Thus, it is very important to define some finite devices which generate all the strings of these sets.If we consider strings as words, then a set of strings can be considered as a language and a generative device as a grammar.In general, a grammar consists of finite sets of terminal symbols, nonterminal symbols and production rules as well as the axiom (the start symbol).To generate a word in the language, one begins with the start symbol.Then production rules are applied in any order, until a word that contains neither the start symbol nor nonterminal symbols is produced.
With respect to the forms of production rules, grammars are divided into two major classes: context-free where the left-hand side of each production rule consists of a single nonterminal symbol and context-sensitive where the left-hand side of each production rule consists of a nonterminal symbol surrounded by a context of terminal and nonterminal symbols.Though context-free grammars have beautiful mathematical properties, and they are easily applicable in practical problems, they can't cover all aspect of modeled phenomena.
On the other hand, context-sensitive grammars are too powerful to be used in applications.In order to overcome this problem, we need some "context-free like" generative devices, which have as many context-free-like properties as possible, but are also able to describe the non-context-free features of the specific languages in the question.One of the solutions is that a context-free grammar should be considered with some additional (control) mechanism which restricts the application of the rules in order to avoid some derivations and obtain a subset of the language generated in usual way.The computational power of some grammars with control mechanism turns out to be greater than the power of context-free grammars.The consideration of different types of control mechanisms leads to the definition of different types of grammars with controlled (regulated) rewriting.For instance, in the monograph [5], we can find the detailed information on various types of grammars with regulated rewriting such as matrix, programmed, valence, random context, and tree controlled grammars, etc.
However, the rapid developments in present day industry, biology, and other areas challenge to deal with various tasks which need suitable tools for their modeling and investigation.We introduce Petri net controlled grammars as models for representing and analyzing of the systems such as automated manufacturing systems in industry and metabolic pathways in systems biology, where Petri nets are responsible for the structure and communication of the systems, and grammars represent generative processes in these systems.In our recent papers [1,2,3,4,7,8,9]  | 99 | and practical problems, and studied their mathematical properties.
Our study has shown that the use of place/transition Petri nets as control mechanisms for context-free grammars allows only generating families of languages, which are strict subclasses of the family of context-sensitive languages.Thus, it is interesting to consider grammars controlled by high level Petri nets (Petri nets with inhibitor arcs, colored Petri nets, etc.), which have a larger modeling and computational power.In this paper we define grammars controlled by Petri nets with inhibitor arcs and investigate their computational power.

PRELIMINARIES
Grammars.Let Σ be an alphabet, which is a finite nonempty set of symbols.A word over the alphabet Σ is a finite sequence of symbols from the alphabet Σ.The empty word is denoted by λ.The set of all words over the alphabet Σ is denoted by Σ * .A subset of Σ * is called a language.
A phrase structure grammar is a quadruple G = (V, Σ, S, R) where V and Σ are two disjoint alphabets of nonterminal and terminal symbols, respectively, S∈V is the start symbol and R ⊆ (V∪Σ) * V(V∪Σ) * ×(V∪Σ) * is a finite set of (production) rules.Usually, a rule (u,v)∈R is written in the form u→v. A rule of the form u→λ is called an erasing rule.A string x∈(V∪Σ) * directly derives a string y∈(V∪Σ) * in G, written as x[〉y, if and only if there is a rule u→v∈R such that x = x 1 ux 2 and y=x 1 vx 2 for some A phrase-structure grammar G = (V, Σ, S, R) is called context-sensitive if each rule u→v∈R has u = u 1 Au 2 , v = u 1 xu 2 for u 1 , u 2 ∈(V∪Σ) * , A∈V and x∈(V∪Σ) + (in context sensitive grammars S→λ is allowed, provided that S does not appear in the right-hand members of rules in R), and it is called context-free if each rule u→v∈R has u∈V.
The families of languages generated by contextsensitive and context-free grammars are denoted by CS and CF, respectively.The next strict inclusions hold (for details, see [6]).

Theorem 2.1 CF ⊂ CS ⊂ RE
A matrix grammar is a quintuple G = (V, Σ, M, S, B) where V, Σ and S are defined as in phrase structure grammars, M is a finite set of matrices each of which is a finite sequence m: (A 1 →w 1 , A 2 →w 2 , …, A n →w n ), n≥1, of context-free rules over (V∪Σ), and B is a finite set of occurrences of such rules on M. For some words x and y in (V∪Σ) * and a matrix m: we write x[m〉y iff there are words x 0 , x 1 , …, x n such that x 0 =x, x n =y, and for 1≤i≤n, either , and this occurrence of A i →w i appears in B. One says that the rules whose occurrences appear in B are used in appearance checking mode, and that a matrix grammar is defined with (without) appearance checking if B ≠ ∅ (B = ∅).The language generated by G is defined as L(G) = {w∈Σ * | S[〉 * w}.The family of languages generated by matrix grammars with appearance checking (without appearance checking) is denoted by MAT [λ]  ac (MAT [λ] ).The following theorem shows the relationships of the families of matrix languages (for details, see [5]).A transition t∈T is enabled by marking µ if and only if µ(p)≥φ(p,t) for all p∈ • t.In this case t can occur (fire).Its occurrence transforms the marking µ into the marking µ' defined for each place p∈P by µ'(p)=µ(p)−φ(p,t)+φ(t,p).We write µ[t)µ' to indicate that the firing of t in µ leads to µ'.A finite sequence t 1 t 2 ⋅⋅⋅t k , t i ∈T, 1≤i≤k, is called an occurrence sequence enabled at a marking µ and finished at a marking µ' if there are markings A marked Petri net is a system N = (P, T, F, φ, ι) where (P, T, F, φ) is a Petri net, ι is the initial marking.
A Petri net with final markings is a construct N = (P, T, F, φ, ι, M) where (P, T, F, φ, ι) is a marked Petri net and M is a set of markings which are called final markings.An occurrence sequence ν of transitions is called successful for | 100 | M if it is enabled at the initial marking ι and finished at a final marking τ of M.   We recall the definition of an s-Petri net, i.e. contextfree Petri nets with such additional places and arcs that these new places with input and output transitions of a net compose cycles with the common place (for details, see [1,8,9]).
An s-Petri net is a Petri net with final markings N s = (P∪Q, T, F∪E, ϕ, ξ, γ, µ 0 , τ) where The language generated by an s-Petri net controlled grammar G consists of all strings w∈Σ * such that there is a derivation S[r 1 r 2 ⋅⋅⋅r k 〉w∈Σ * and a successful occurrence sequence of transitions ν=t 1 t 2 ⋅⋅⋅t k of N s such that r 1 r 2 ⋅⋅⋅r k =γ( t 1 t 2 ⋅⋅⋅t k ).PN [λ]  s denotes the family of languages generated by s-PN controlled grammars.It was shown in [10] that Theorem 2.2.MAT [λ] = PN [λ]  s .
A Petri net controlled grammar is a tuple G = (V, Σ, S, R, N, γ, M) where V, Σ, S, R are defined as for a contextfree grammar and N = (P, T, F, ϕ, ι) is a (marked) Petri net, γ: T→R∪{λ} is a transition labelling function and M is a finite set of final markings (this definition uses the extended form of the transition labelling function γ: T * →R * ; this extension is done in the usual manner).
The language generated by a Petri net controlled grammar G consists of all strings w∈Σ * such that there is a derivation S[r 1 r 2 ⋅⋅⋅r k 〉w∈Σ * and an occurrence sequence ν=t 1 t 2 ⋅⋅⋅t s which is successful for M such that r 1 r 2 ⋅⋅⋅r k = γ( PN and PN λ denote the families of languages generated by PN controlled grammars without and with erasing rules, respectively.The computational power of Petri net controlled grammars has been investigated in [4,11].It was shown that Theorem 2.2.MAT ⊆ PN = PN [λ] = MAT [λ] .

THE EFFECT OF INHIBITOR ARCS
Definition 3.1.A Petri net controlled grammar G = (V, Σ, S, R, N, γ, M) is called a grammar controlled by a Petri net with inhibitor arcs (in short, a PNI controlled grammar) if N is a Petri net with inhibitor arcs.
The language L(G) generated by a PNI controlled grammar G is defined as usual manner.PNI and PNI λ denote the families of languages generated by PNI controlled grammars without and with erasing rules, respectively.Proof.Let place p 1 has k≥1 tokens.Inhibitor arcs (p 1 ,t 2 ) and (p 1 ,t 4 ) controls that all tokens are moved from place p 1 to place p 2 before transition t 2 or transition t 4 fires.Then place p 2 receives 2k tokens.In the next step transitions t 2 and t 4 are enabled.If transition t 2 (t 4 ) occurs, then transition t 4 (t 2 ) cannot occur until all tokens are removed from place p 3 (p 4 ).Thus only one of transitions t 2 and t 4 can occur.Inhibitor arc (p 2 ,t 3 ) ((p 2 ,t 5 )) controls that all tokens are moved from place p 2 to place p 3 (p 4 ).Inhibitor arc (p 3 ,t 1 ) controls that all tokens are moved from place p 3 to place p 1 until transition t 1 fires.Thus 2k tokens (i.e. the doubled number of the tokens) return to place p 1 .The occurrences of transition t 5 2k times remove all tokens from place p 4 and the execution of the Petri net reaches to the final marking.The corresponding derivation for this occurrence of transitions has the form Since in the initial marking place p 1 has only one token, Derivation D generates sentential forms 2 n S , n≥1.Then in order to terminate the derivation we replace all S's with A's, i.e.

D': S[〉
Next we prove the main results of the paper.
Proof.Let G = (V, Σ, S, M, B) be a matrix grammar with or without erasing rules.Without loss of generality we assume that G is without repetitions.Let R be the set of all rules occurred in M. By Theorem 2.6, we can construct an s-PN controlled grammar G' = (V, Σ, S, R, N s ) equivalent to the matrix grammar G'' = (V, Σ, S, M).
We modify the net N s = (P∪Q, T, F∪E, ϕ, ξ, γ, µ 0 , τ) as follows.Let r: A→α∈B with γ(t) = r, ξ(p) = A. Let r': A'→α' is the next rule after the rule r in the matrix, i.e. m: (…, A→α, A'→α', …).Let γ(t') = r' and ξ(p') = A'.We add a new transition t A labeled with r', an inhibitor arc (p,t A ), and an arc (t A ,q r' ) where q r' ∈Q∩ • t'.If the rule r: A→α is not applicable in a derivation, we can skip this rule, and we can apply the next rule r': A'→α' in the matrix since r∈B.Correspondingly, if r is not applicable, place p does not have any token, and transition t A can fire, correspondingly, the rule r': A'→α' can be applied.This modification of N s allows us to take into consideration of the checking of occurrences of nonterminals in sentential forms.Let N' s be the Petri net obtained from N s by the modification above.Then G''' = (V, Σ, S, R, N' s ) is a PNI controlled grammar where L(G) = L(G''').
We show that the inverse inclusion also holds for the λcase.Lemma 3.4.PNI λ ⊆ MAT λ ac .
Proof.Let G = (V, Σ, S, R, N, γ, M') be a PNI controlled grammar with N = (P, T, F, I, φ, ι).Let P = {p 1 , p 2 , …, p n }.We set V' = V∪P'∪{S', C, X} where P' = {p' | p∈P} is a set of new nonterminal symbols and S', C, X are new nonterminal symbols.Let for t∈T, We associate the following sequences of rules with each transition t∈T • σ X : p' i,k+1 →X, p' i,k+2 →X, …, p' i,l →X (3.4) where r = A→α = γ(t)∈R.Furthermore, we add the starting matrix ∏ be a derivation in G'.Since V∩P'=∅, we can write a derivation D'': S[r j,1 r j,2 ⋅⋅⋅ r j,k 〉w j,1 = w∈Σ * where r j,i is the rule of the non-erasing matrix m r,j,i , 1≤i≤k in D' and we omit those steps in D' in which erasing matrices are used.
The application of a matrix m r of the form (3.6) in D' shows that there are at least ϕ(p i,1 ,t) pieces of p' i,1 , etc., and at least ϕ(p i,k ,t) pieces of p' i,k in the sentential form, i.e. the input places p i,1 , p i,2 , …, p i,k of t have at least ϕ(p i,1 ,t), ϕ(p i,2 ,t), …, ϕ(p i,k ,t) tokens, respectively.Moreover, the rules of the form p' i,k+1 →X, p' i,k+2 →X, …, p' i,l →X control that places from °t do not have any tokens.Thus, the transition t, γ(t) = r, is enabled in N. We can construct the successful occurrence sequence ι[t j,1 t j,2 ⋅⋅⋅t j,k )µ k where γ( t j,i ) = r j,i , 1≤i≤k.Hence, D'' is a derivation in G. Thus L(G')⊆L(G).
Now let E: S[r j,1 r j,2 ⋅⋅⋅r j,k 〉w j,k = w∈Σ * be a derivation in G. Then we also have the derivation E': S'[m 0 〉SC[m j,1 m j,2 ⋅⋅⋅m j,k 〉w' j,k C in G' where w' j,k differs from w j,k only in letters p', p∈P.These letters and C can be erased with matrices (3.8).Thus L(G) ⊆ L(G').

CONCLUSION
In this paper we have defined and investigated grammars controlled by Petri nets with inhibitor arcs, where we have considered only arbitrary transition labeling and the finite set of final markings.The paper clearly establishes some basic facts.A topic is worth being investigated in this area is the consideration of different types of transition labeling strategies and the different definitions of final marking sets.Another interesting topic is the study of the hierarchy problems with respect to the number of inhibitor arcs.

Theorem 2 . 2
CF ⊂ MAT ⊂ MAT ac ⊂ CS and MAT ⊆ MAT λ ⊂ MAT λ ac = RE Petri nets.A place/transition Petri net (simply Petri net) is a construct N = (P, T, F, φ) where P and T are disjoint finite sets of places and transitions, respectively, F⊆(P×T)∪(T×P) is the set of directed arcs, φ: F→{1,2, …} is a weight function.A Petri net can be represented by a bipartite directed graph with the node set P∪T where places are drawn as circles, transitions as boxes and arcs as arrows.The arrow representing an arc (x,y)∈F is labelled with φ(x,y); if φ(x,y)=1, the label is omitted.A mapping µ: P→{0,1,2, …} is called a marking.For each place p∈P, µ(p) gives the number of tokens in p. Graphically, tokens are drawn as small solid dots inside circles.• x={y | (y,x)∈F} and x • ={y | (x,y)∈F} are called pre-and post-sets of x∈P∪T, respectively.For t∈T (p∈P), the elements of • t ( • p) are called input places (transitions) and the elements of t • (p • ) are called output places (transitions) of the transition t (the place p).

Figure 1 :
Figure 1: A Petri netA Petri net with inhibitor arcs is a 6-tuple N = (P, T, F, I, φ, ι) where (P, T, F, φ, ι) is a marked net and I ⊆ P×T is a set of inhibitor arcs.Graphically, an inhibitor arc is represented by a special arrow head.Figure2shows a Petri net with inhibitor arcs, which is obtained from the Petri net in Figure1by adding an inhibitor arc (p 2 ,t 3 ).Let °t = {p∈P | (p,t)∈I}.A transition t∈T can occur at a marking µ if and only if µ(p) = 0 for all p∈°t and µ(p) ≥ φ(p,t) for all p∈P−°t.

Figure 2 :Example 2 . 4 .
Figure 2: A Petri net with inhibitor arcs Petri net controlled grammars.The construction of the following type of Petri nets is based on the idea of using similarity between the firing of a transition and the application of a production rule in a derivation in which places are nonterminals and tokens are different occurrences of nonterminals.A context-free Petri net (a cf Petri net for short) with respect to a context-free grammar G = (V, Σ, S, R) is a tuple N = (P, T, F, φ, β, γ, ι) where • (P, T, F, φ) is a Petri net; • the labelling functions β: P→V and γ: T→R are bijections; • there is an arc from place p to transition t if and only if γ(t) = A→α and β(p) = A. The weight of the arc (p,t) is 1; • there is an arc from transition t to place p if and only if γ(t) = A→α and β(p) = X where |α| X >0.The weight of the arc (t,p) is |α| X ;

Figure 3 :
Figure 3: A context-free Petri net N 1

Figure 4 :
Figure 4: An s-Petri net N 2 (additional places are represented without labels)