A system model with pure context-free rules for picture array generation

9
Mathematical and Computer Modelling 52 (2010) 1901–1909 Contents lists available at ScienceDirect Mathematical and Computer Modelling journal homepage: www.elsevier.com/locate/mcm A P system model with pure context-free rules for picture array generation K.G. Subramanian a , Linqiang Pan b,* , See Keong Lee a , Atulya K. Nagar c a School of Mathematical Sciences, Universiti Sains Malaysia, 11800 Penang, Malaysia b Key Laboratory of Image Processing and Intelligent Control, Department of Control Science and Engineering, Huazhong University of Science and Technology, Wuhan 430074, Hubei, China c Intelligent and Distributed Systems Laboratory, Department of Computer Science, Liverpool Hope University, Hope Park Liverpool, L16 9JD, UK article info Article history: Received 23 September 2009 Received in revised form 25 December 2009 Accepted 31 January 2010 Keywords: Syntactic method 2D grammar P system Picture array generation abstract Syntactic models constitute one of the main areas of mathematical studies on picture array generation. A number of 2D grammar models have been proposed motivated by a variety of applications. A P system is a biologically motivated new computing model, proposed by Păun in the area of membrane computing. It is a rich framework for dealing with different problems, including the problem of handling picture array generation. In this paper, the generative power of the array-rewriting P system with pure 2D context-free rules is inves- tigated by comparing it with other 2D grammar models, thus bringing out the suitability of this P system model for picture array generation. © 2010 Elsevier Ltd. All rights reserved. 1. Introduction In the area of membrane computing, Păun [1] proposed a distributed, highly parallel but biologically motivated new computing model, now called as P system, inspired from the structure and functioning of living cells. The basic model of a P system consists of a membrane structure with a hierarchical arrangement of membranes, multisets of objects placed inside the regions of the membranes, evolution rules governing the processing of these objects, and transfer of objects from one membrane to another membrane as directed by certain commands. A P system is found to be a suitable framework for handling a variety of computational problems arising in different areas. In mathematical studies on image or picture generation and analysis, syntactic models constitute one of the main areas of study and are motivated by a variety of applications such as character recognition, pictorial information system design, pattern recognition and so on. Extending to two dimensions the well-known string grammar models [2–5] of formal lan- guage theory, several 2D grammar models generating picture array languages consisting of digitized rectangular and non- rectangular arrays, are proposed and studied in syntactic approaches to generation and recognition of picture patterns (see for example [6–17]). The problem of handling array languages using P systems was initially considered in [18], thereby linking the two areas of membrane computing and picture grammars. The kind of array P system in [18] is different from [19], where one works with vertical and horizontal concatenation operations. In recent years, the problem of generation of 2D picture languages using P systems has received more attention [20–24]. In this paper which is an expanded version of [25], the array-rewriting P system with pure 2D context-free rules introduced in [26] is investigated. The results relating to the generative power of these systems are obtained by comparing this array-rewriting P system with other 2D grammar models, thus bringing out the suitability of this P system model for picture array generation. * Corresponding author. Tel.: +86 27 87556070; fax: +86 27 87543130. E-mail addresses: [email protected] (K.G. Subramanian), [email protected] (L. Pan), [email protected] (S.K. Lee), [email protected] (A.K. Nagar). 0895-7177/$ – see front matter © 2010 Elsevier Ltd. All rights reserved. doi:10.1016/j.mcm.2010.03.040

Transcript of A system model with pure context-free rules for picture array generation

Mathematical and Computer Modelling 52 (2010) 1901–1909

Contents lists available at ScienceDirect

Mathematical and Computer Modelling

journal homepage: www.elsevier.com/locate/mcm

A P system model with pure context-free rules for picturearray generationK.G. Subramanian a, Linqiang Pan b,∗, See Keong Lee a, Atulya K. Nagar ca School of Mathematical Sciences, Universiti Sains Malaysia, 11800 Penang, Malaysiab Key Laboratory of Image Processing and Intelligent Control, Department of Control Science and Engineering, Huazhong University of Science and Technology,Wuhan 430074, Hubei, Chinac Intelligent and Distributed Systems Laboratory, Department of Computer Science, Liverpool Hope University, Hope Park Liverpool, L16 9JD, UK

a r t i c l e i n f o

Article history:Received 23 September 2009Received in revised form 25 December 2009Accepted 31 January 2010

Keywords:Syntactic method2D grammarP systemPicture array generation

a b s t r a c t

Syntactic models constitute one of themain areas of mathematical studies on picture arraygeneration. A number of 2D grammar models have been proposed motivated by a varietyof applications. A P system is a biologically motivated new computing model, proposed byPăun in the area of membrane computing. It is a rich framework for dealing with differentproblems, including the problem of handling picture array generation. In this paper, thegenerative power of the array-rewriting P systemwith pure 2D context-free rules is inves-tigated by comparing it with other 2D grammar models, thus bringing out the suitabilityof this P system model for picture array generation.

© 2010 Elsevier Ltd. All rights reserved.

1. Introduction

In the area of membrane computing, Păun [1] proposed a distributed, highly parallel but biologically motivated newcomputing model, now called as P system, inspired from the structure and functioning of living cells. The basic model ofa P system consists of a membrane structure with a hierarchical arrangement of membranes, multisets of objects placedinside the regions of the membranes, evolution rules governing the processing of these objects, and transfer of objects fromone membrane to another membrane as directed by certain commands. A P system is found to be a suitable framework forhandling a variety of computational problems arising in different areas.In mathematical studies on image or picture generation and analysis, syntactic models constitute one of the main areas

of study and are motivated by a variety of applications such as character recognition, pictorial information system design,pattern recognition and so on. Extending to two dimensions the well-known string grammar models [2–5] of formal lan-guage theory, several 2D grammar models generating picture array languages consisting of digitized rectangular and non-rectangular arrays, are proposed and studied in syntactic approaches to generation and recognition of picture patterns (seefor example [6–17]).The problem of handling array languages using P systems was initially considered in [18], thereby linking the two areas

of membrane computing and picture grammars. The kind of array P system in [18] is different from [19], where one workswith vertical and horizontal concatenation operations. In recent years, the problem of generation of 2D picture languagesusing P systems has received more attention [20–24].In this paper which is an expanded version of [25], the array-rewriting P system with pure 2D context-free rules

introduced in [26] is investigated. The results relating to the generative power of these systems are obtained by comparingthis array-rewriting P system with other 2D grammar models, thus bringing out the suitability of this P system model forpicture array generation.

∗ Corresponding author. Tel.: +86 27 87556070; fax: +86 27 87543130.E-mail addresses: [email protected] (K.G. Subramanian), [email protected] (L. Pan), [email protected] (S.K. Lee), [email protected] (A.K. Nagar).

0895-7177/$ – see front matter© 2010 Elsevier Ltd. All rights reserved.doi:10.1016/j.mcm.2010.03.040

1902 K.G. Subramanian et al. / Mathematical and Computer Modelling 52 (2010) 1901–1909

2. Preliminaries

In this section basic notions and notations are given that pertain to words and arrays and that are needed in the sequel.For notions of formal language theory we refer to [5] and for array grammars and 2D languages, we refer to [7,10,11,17].Let V be a finite alphabet which is a finite set of symbols. A word or a string s = s1s2 . . . sn (n ≥ 1) over V is a sequence

of symbols si, (1 ≤ i ≤ n) from V . The length of a word s is denoted by |s|. For example, if V = a, b, then abbaaba is aword of length 7. A word of the form aaaaa is written as a5 and in general, an stands for a · · · a (n times). The set of all wordsover V , including the empty word λwith no symbols, is denoted by V ∗. We call words of V ∗ horizontal words. For any words = s1s2 . . . sn, we denote by st the vertical word

s1...sn

We also define (st)t = s. We set λt as λ itself. A rectangularm× n arrayM over V (also called a picture array) is of the form

M =

a11 · · · a1n...

. . ....

am1 · · · amn

where each aij ∈ V , 1 ≤ i ≤ m, 1 ≤ j ≤ n. The set of all rectangular arrays over V is denoted by V ∗∗, which includesthe empty array λ. V++ consists of all the rectangular arrays of V ∗∗ excluding the empty array λ, i.e. V++ = V ∗∗ − λ.We denote respectively by and , the operations of column concatenation and row concatenation of arrays in V ∗∗. Theseoperations are partially defined, namely, for any A, B ∈ V ∗∗, A B is defined if and only if A and B have the same number ofrows. Similarly A B is defined if and only if A and B have the same number of columns. For example, let A be a rectangulararray withm rows and p columns and B, another rectangular array with n rows and q columns given by

A =

a11 · · · a1p...

. . ....

am1 · · · amp

and

B =

b11 · · · b1q...

. . ....

bn1 · · · bnq

withm, n, p, q ≥ 1. Then A B is defined form = n and is given by

A B =

a11 · · · a1pb11 · · · b1q...

. . ....

. . ....

am1 · · · ampbm1 · · · bmq

Likewise, A B is defined for p = q and is given by

A B =

a11 · · · a1p...

. . ....

am1 · · · ampb11 · · · b1p...

. . ....

bn1 · · · bnp

In the 2D grammar model introduced in [27], which we call as Siromoney regular or context-free matrix grammar, ahorizontal word S1 . . . Sn over intermediate symbols is generated by a Chomskian regular or context-free grammar. Thensimultaneously from each intermediate symbol Sj a vertical word of the same length over terminal symbols is derived toconstitute the jth column of the rectangular array generated. We denote the picture language classes of Siromoney regular,context-free matrix grammars by RML, CFML respectively.The Siromoney regular/context-freematrix grammars were extended in [28] by specifying a finite set of tables of rules in

the second phase of generation with each table having either right-linear nonterminal rules or right-linear terminal rules.At one step of derivation, the rules in a table are used for rewriting. The resulting families of picture array languages aredenoted by TRML and TCFML and are known [28] to properly include RML and CFML respectively.We briefly recall pure context-free grammars introduced in [29,30] and subsequently studied by many others.

K.G. Subramanian et al. / Mathematical and Computer Modelling 52 (2010) 1901–1909 1903

Fig. 1. DerivationM0⇒∗ M1 .

A pure context-free grammar [30] is G = (Σ, P,Ω), where Σ is a finite alphabet, Ω is a set of axiom words and P is afinite set of context-free rules of the form a→ α, a ∈ Σ, α ∈ Σ∗.Derivations are done as in a context-free grammar exceptthat unlike a context-free grammar, there is only one kind of symbol, namely the terminal symbol. The language generatedconsists of all words generated from each axiom word.

Example 1. The grammar G1 = (Σ, P,Ω), where

Σ = a, b, c, P = c → aca, c → bcb, Ω = c,

is a pure context-free grammar generating words of the form

an1bm1 · · · ankbmkcbmkank · · · bm1an1 ,

where k ≥ 1, and ni ≥ 0,mi ≥ 0, for 1 ≤ i ≤ k.

We now recall pure 2D context-free grammars introduced in [31] for generation of rectangular picture arrays using purecontext-free rules.A pure 2D context-free grammar (P2DCFG) is a 4-tuple

G = (Σ, Pc, Pr ,M0), where

• Σ is a finite set of symbols;• Pc = tci |1 ≤ i ≤ m, Pr = trj |1 ≤ j ≤ n;Each tci , (1 ≤ i ≤ m), called a column table, is a set of context-free rules of the form a→ α, a ∈ Σ, α ∈ Σ∗ such thatfor any two rules a→ α, b→ β in tci , we have |α| = |β|, where |α| and |β| denote the lengths of α and β , respectively;Each trj , (1 ≤ j ≤ n), called a row table, is a set of context-free rules of the form c → γ T , c ∈ Σ and γ ∈ Σ∗ such thatfor any two rules c → γ T , d→ δT in trj , we have |γ | = |δ|;• M0 ⊆ Σ

∗∗− λ is a finite set of axiom arrays.

Derivations are defined as follows: For any two arrays M1,M2, we write M1 ⇒ M2 if M2 is obtained from M1 by eitherrewriting a column ofM1 by rules of some column table tci in Pc or a row ofM1 by rules of some row table trj in Pr .⇒

∗ is thereflexive transitive closure of⇒ .The picture array language L(G) generated by G is the set M|M0⇒∗M ∈ Σ∗∗, for someM0 ∈M0 of rectangular picture

arrays. The family of picture array languages generated by pure 2D context-free grammars is denoted by P2DCFL.

Example 2. Consider the pure 2D context-free grammar

G2 = (Σ, Pc, Pr , M0), whereΣ = x, y, z, b, Pc = tc, Pr = tr, tc = b→ bb, a→ aa,

tr =

ba → a

b,

ac → c

a

, M0 =

a b ac a ca b a

A sample derivationM0 ⇒ M1 in G2, on using the tables of rules tc, tr , tr in this order, is given in Fig. 1. Each of the arraysoccurring in the given derivation belongs to the picture language generated by G2. Note that if the symbol b is interpretedas a blank symbol, thenM1 will be in the shape of the alphabetic letter H.It is a well-known tool in formal language theory [5] to control the sequence of application of rules of a grammar by

controlwords formed over the labels of the rules. Generally, if the controlwords constitute a regular language, the generativepower of a grammar might not increase. By associating a regular control language with a P2DCFG, it is shown in [12,31] thatthe generative power increases. We recall the concept of P2DCFGwith a regular control.A pure 2D context-free grammar with a regular control is Gc = (G, Lab(G),C), where G is a pure 2D context-free

grammar, Lab(G) is a set of labels of the tables of G and C ⊆ Lab(G)∗ is a regular (string) language. The words in Lab(G)∗ arecalled control words of G. DerivationsM1⇒w M2 in Gc are done as in G except that if w ∈ Lab(G)∗ and w = l1l2 . . . lm thenthe tables of rules with labels l1, l2, . . . , lm are successively applied starting withM1 to yieldM2. The picture array language

1904 K.G. Subramanian et al. / Mathematical and Computer Modelling 52 (2010) 1901–1909

generated by Gc consists of all picture arrays obtained from the axiom array of Gwith the derivations controlled as describedabove. The family of picture array languages generated by pure 2D context-free grammars with a regular control is denotedby by P2DCFL(REG).We next recall the 2D P systemmodel introduced in [26], which is analogous to the array-rewriting P system of Ceterchi

et al. [18]. The difference is that the regions contain rectangular arrays and the tables of rules of a pure 2D context-freegrammar [31].An array-rewriting P system (of degreem ≥ 1) with pure 2D context-free rules is a construct

Π = (V , µ, F1, . . . , Fm, R1, . . . , Rm, io), where

V is the alphabet, µ is a membrane structure withmmembranes labelled in a one-to-one way with 1, 2, . . . ,m; F1, . . . , Fmare finite sets of rectangular arrays over V associated with them regions of µ; R1, . . . , Rm are finite sets of column tables orrow tables of context-free rules over V (as in a P2DCFG) associated with them regions ofµ; the tables have attached targetshere, out, in (in general, here is omitted), finally, io is the label of an elementary membrane of µ (the output membrane).A computation inΠ is defined in the sameway as in an array-rewriting P systemwith the successful computations being

the halting ones: each rectangular array in each region of the system, which can be rewritten by a column/row table of rules(rewriting as in a P2DCFG) associated with that region (membrane), should be rewritten; this means that one table of rulesis applied; the array obtained by rewriting is placed in the region indicated by the target associatedwith the table used (heremeans that the array remains in the same region, out means that the array exits the current membrane; and inmeans thatthe array is immediately sent to one of the directly lower membranes, nondeterministically chosen if several exist there; ifno internal membrane exists, then a table with the target indication in cannot be used). A computation is successful only if itstops, that is, a configuration is reached where no table of rules can be applied to the existing arrays. The result of a haltingcomputation consists of rectangular arrays over V placed in the membrane with label io in the halting configuration.The set of all such arrays computed or generated by a system Π is denoted by AL(Π). The family of all array languages

AL(Π) generated by systemsΠ as above, with at mostmmembranes, is denoted by APm(P2DCFG).We illustrate with an example how interesting classes of picture patterns can be generated. We use a well-known

technique of replacing the letter symbols in the generated picture arrays by ‘primitive patterns’. Each symbol of a rectangulararrayM over an alphabetΣ is considered to occupy a unit square in the rectangular grid so that a row of symbols or a columnof symbols in the array respectively occupies a horizontal or a vertical sequence of adjacent unit squares. Amapping i, calledan interpretation, from the alphabet Σ = a1, a2, . . . , an to a set of primitive picture patterns p1, p2, . . . , pm is definedsuch that for 1 ≤ i ≤ n, i(ai) = pj, for some 1 ≤ j ≤ m. Then i(M) is obtained by replacing every symbol a ∈ M by thecorresponding picture pattern i(a).Let

Π1 = (V , µ, F1, F2, F3, F4, R1, R2, R3, R4, io), where

• V = u, ut , ub, ul, u′l, v, vt , vb, vr , v′r , x, y, z, w, s, s1, s2;

• µ = [1[2[3[4]4]3]2]1 indicating that the system has four regions, one within another, i.e. region 1 is the ‘skin’ membranewhich contains region 2, which in turn contains region 3, and which in turn contains region 4;• i0 = 4 indicating that region 4 is the output region;• R1 = tc1, R2 = tc2, tr3, R3 = tr1, tr2, R4 = ∅. The tables of rules are given by

tc1 = ut → zutx, u→ yux, ub → wubx, s1 → ss1x, s→ ssx(in),tc2 = vt → vtz, v→ vy, vb → vbw, s2 → s2s, s→ ss(in),tr3 = u′l → ul, s→ s, s1 → s1, x→ x, s2 → s2, v′r → vr(out),tr2 = ul → u′l, s→ s, s1 → s1, x→ x, s2 → s2, vr → v′r(out),

tr1 =

ulul → y

u,

ss → y

s,

s1s1 → u

s

⋃ xx → x

x,

s2s2 → v

s,

vrvr → y

v

(in);

• F1 = M0, F2 = F3 = F4 = ∅,M0 =z z ut vt z zul s s1 s2 s vrw w ub vb w w

.

The interpretation i is given by i(ul) = i(ut) = i(ub) = i(u) = u, i(z) = z, i(x) = x, i(s1) = i(s2) = i(s) = s, i(vr) =i(vt) = i(vb) = i(v) = v, i(w) = w, i(y) = y.Starting with M0 in the region 1, the rules of the column table tc1 are applied and the array is sent to region 2 wherein

the rules of the column table tc2 are applied and the array is again sent to region 3. If in region 3, the rules of the row tabletr1 are applied, then the array is sent to the output region 4. It remains there forever and hence is collected in the languagegenerated. On the other hand, if in region 3, the rules of the row table tr2 are applied changing ul into u′l and vr into v

′r , then

the array is sent back to region 2 wherein the symbols u′l and v′r are respectively changed back into vl and vr and the array

is sent to region 1. The process then repeats. An arrayM generated byΠ1 is shown in Fig. 2. The interpretation i applied tothe arrayM gives a pattern called a ‘‘kolam’’ pattern (or a floor design) as in Fig. 4. The primitive kolam patterns are shownin Fig. 3 where a, b, c, d are called saddle, x, y pupil, u, v fan, s diamond and z, w drop.

K.G. Subramanian et al. / Mathematical and Computer Modelling 52 (2010) 1901–1909 1905

Fig. 2. An arrayM generated byΠ1 .

Fig. 3. Primitive patterns of a ‘‘kolam’’ pattern.

Fig. 4. A ‘‘kolam’’ pattern.

3. Comparison results

The generative power of the array-rewriting P system with P2DCFG rules is brought out in the following theorems. It isshown in Theorem1, that the array-rewriting P systemwith pure 2D context free rules and twomembranes ismore powerfulthan P2DCFG and if we allow three membranes, then it can generate languages in P2DCFL(REG), as seen in Theorem 2. Forcompleteness, correctness and clarity, we include here the details of the proofs of theorems in [26,25], elaborating themsuitably and carrying out a few needed corrections.

Theorem 1. (i) P2DCFL = AP1(P2DCFG).(ii) P2DCFL ⊂ AP2(P2DCFG).

Proof. The statement (i) is straightforward since there is only one membrane and so the arrays generated in this regionconstitute the picture array language generated. Since AP2(P2DCFG) allows at most two membranes, the inclusion instatement (ii) is clear. The proper inclusion is due to the fact that a language L consisting of all rectangular arrays of theformM1 M2, whereM1 is over a andM2 over bwith the number of rows ofM1 equal to the number of rows ofM2, can notbe generated by any P2DCFG [12,31] but the following system in AP2(P2DCFG) generates L. The system has two regions withregion 2 inside region 1. Region 1 has the axiom array c and the column tables tc1 = c → acb(here), tc2 = c → ab(in)

and a row table tr1 =a → a

a,b → b

b,c → c

c

(here). There are no rules in the output region 2. The effect of applying

tr1 in region 1, starting with the axiom c is to ‘‘grow’’ the rows whereas the effect of applying tc1 is to grow a column of a′sto the left and a column of b′s to the right of the column of c ′s. Once the table tc2 is used, each of the c

′s changes into ab andthe array of the form M1 M2 is sent to the output region 2. Note that although the alphabet here is a, b, c, the arrays inthe output region are only over a, b and thus the symbol c acts like a ‘nonterminal’ of a non-pure grammar.

Theorem 2. AP3(P2DCFG) ∩ P2DCFL(REG) 6= ∅.

Proof. Consider the following array-rewriting P system with pure 2D context-free rules and three membranes

Π2 = (V , µ, F1, F2, F3, R1, R2, R3, io), where

V = a, b, c, d, e, f , µ = [1[2[3]3]2]1 (indicating that the system has three regions onewithin another i.e. region 1, denotedby [1]1, is the ‘skin’ membrane which contains region 2, denoted by [2]2, which in turn contains region 3, denoted by [3]3).

1906 K.G. Subramanian et al. / Mathematical and Computer Modelling 52 (2010) 1901–1909

Fig. 5. An array generated byΠ2 .

i0 = 3 indicating that region 3 is the output region. F1 = cdf , F2 = F3 = φ.R1 contains a column table tc1 and a row tabletr1 ; R2 contains two column tables tc2 and tc3; R3 = φ, where tc1 = c → acb(in), tc2 = d → de(out), tc3 = f → ef (in),

tr1 =a → a

a,b → b

b,c → c

c,⋃

d → dd,e → e

e,f → f

f

(here).

A rectangular array generated is shown in Fig. 5. This array has an equal number of columns of a′s, columns of b′s andcolumns of e′s. The idea of the computation is that starting from the array cdf (one row) rules of tr1 can be applied (as donein a P2DCFG) allowing the ‘growth vertically’ (producing rows) but the result remains in region 1 itself. The moment thetable tc1 is applied rewriting the column of c

′s, the rectangular array ‘grows horizontally’ (producing one column of a′s tothe left and one column of b′s to the right of the column of c ′s). The rectangular array is then sent to region 2 wherein if thetable tc2 is applied, a column of e

′s is produced to the right of the column of d′s but the array is then sent back to region 1. Theprocess can repeat. If in region 2, tc3 is applied, then the rectangular array (in the form shown in Fig. 5) is sent to region 3. Theregion 3 is the output region and the rectangular arrays collected here constitute the language generated byΠ2. On the otherhand, the language generated byΠ2 can be generated by a P2DCFG with the same tables tc1 , tc2 , tc3 , tr1 as given in the firstpart of the proof but with the targets removed and by having a regular control language tmr1tc1(tc1 tc2)

ntc3/m, n ≥ 0.

Comparison with the classes TRML, TCFML [28] and RML, CFML [27] is done in Theorem 3.

Theorem 3. (i) RML ⊂ TRML ⊆ AP2(P2DCFG).(ii) CFML ⊂ TCFML ⊆ AP2(P2DCFG).(iii) AP3(P2DCFG) \ TCFML 6= ∅.

Proof. It is known that [28] RML ⊂ TRML and CFML ⊂ TCFML. It suffices to prove the second inclusion in statement (ii) sinceTRML ⊂ TCFML [28]. The inclusion TCFML ⊆ AP2(P2DCFL) can be seen as follows: Given a language in TCFML, generated bya TCFMG Gwe can construct a systemΠ in AP2(P2DCFG)with two regions [1[2]2]1. The region 1 contains all the rules of thehorizontal phase of G in a column table with target here. The tables of nonterminal rules of the vertical phase of G are takenas the row tables in region 1 with target here. The tables of terminal rules of the vertical phase of G are also taken as rowtables with target in. The output region 2 has no rules. The axiom array in region 1 is the start symbol of G. The alphabet ofΠ in fact consists of all the symbols of G, nonterminals, intermediates, terminals. Note that in region 1 the application of thetables of rules will simulate derivations in the TCFMG and once the rectangular array is formed over terminals of G the arrayis sent and collected in region 2. This makes the nonterminals and intermediate symbols of the TCFMG not to be involvedin the final output of Π . The statement (iii) is a consequence of the language considered in the proof of Theorem 2 wherethe columns of a′s, b′s and e′s in the picture arrays have a ‘context-sensitive’ language [5] feature which cannot be handledby any TCFMG as it makes use of only context-free rules in the first horizontal phase and regular type rules in the secondvertical phase.

Another interestingmodel called tiling system (TS) describing rectangular picture arrays [7] is based on extending awell-known characterization of recognizable string languages. A ‘‘window’’ of size 2 × 2 is moved around a rectangular pictureor array of terminal symbols and a record is made of different 2× 2 rectangular arrays (or 2× 2 tiles) observed through thewindow. If the set of recorded 2×2 tiles is contained in a given set of 2×2 tiles, then the rectangular array is ‘accepted’ as amember of a ‘local picture language’ to be formed. A picture language of rectangular arrays is said to be tiling recognizable [7]if it is the image under a projection, which is a letter-to-letter mapping, of a local picture language. We now relate the classREC [7] of recognizable picture languages and the class LOC [7] of local picture languages with the array-rewriting P systemwith P2DCFG rules.

Theorem 4. AP2(P2DCFG) \ REC 6= ∅. In particular, AP2(P2DCFG) \ LOC 6= ∅.

Proof. The picture array language L consisting of arrays M = s c s, where s is a string over the symbol a (or in otherwordsM is a picture array with only one row), is known [7] to be not in REC and hence not in LOC , since LOC ⊂ REC . But itis generated by an array-rewriting P system (V , µ, F1, F2, R1, R2, 2), with two membranes having the membrane structureµ = [1[2]2]1,where V = a, c, d, F1 = d, F2 = ∅, R1 = tc1, tc2, R2 = ∅, tc1 = d→ ada (here) and tc2 = d→ c(in).

K.G. Subramanian et al. / Mathematical and Computer Modelling 52 (2010) 1901–1909 1907

Starting with d in region 1, the rule of the table tc1 can be applied any number of times generating equal number of a’s tothe left and right of d. The array (string) remains in membrane 1 itself. When the rule of tc2 is applied, d changes to c and thestring is sent to the region 2 due to the command in. Since there are no rules in the region 2, the array (string) is collectedin the language generated.

It is known [12,31] that the class P2DCFL is not closed under union, column catenation and row catenation . We denote

U(P2DCFL) = L : L = L1 ∪ L2, L1, L2 ∈ P2DCFL,(P2DCFL) = L : L = L1 L2, L1, L2 ∈ P2DCFL,(P2DCFL) = L : L = L1 L2, L1, L2 ∈ P2DCFL.

Theorem 5. (i) AP2(P2DCFG) ∩ (U(P2DCFL) \ P2DCFL) 6= ∅.(ii) AP2(P2DCFG) ∩ ((P2DCFL) \ P2DCFL) 6= ∅.(iii) AP2(P2DCFG) ∩ ((P2DCFL) \ P2DCFL) 6= ∅.

Proof. Let L1 = X1 (cn)T Y1 | X1 ∈ a++, Y1 ∈ b++, |X1|c = |Y1|c, where |X |c stands for the number of columnsof array X and L2 = X2 (cn)T Y2 | X2 ∈ x++, Y2 ∈ y++, |X2|c = |Y2|c. It is known [12,31] that L1 ∪ L2 cannot begenerated by any P2DCFG and hence belongs toU(P2DCFL)\P2DCFL. But L1∪L2 is generated by an array-rewriting P system(V , µ, F1, F2, R1, R2, 2) with two membranes having the membrane structure µ = [1[2]2]1, V = a, b, c, c1, x, y, c2, F1 =c1, c2, F2 = ∅,

R1 = tc1, tc2, tc3, tc4, tr1, tr2, R2 = ∅,tc1 = c1 → ac1b(here), tc2 = c1 → acb(in),

tr1 =a → a

a,b → b

b,c1 → c1

c1

(here),

tc3 = c2 → xc2y(here), tc4 = c2 → xcy(in),

tr2 =x → x

x,y → y

y,c2 → c2

c2

(here),

which generates L1 ∪ L2.Starting with c1, the application of the rules of the tables tc1 and tr1 in region 1, ‘grows’ an array of the form X1 (c

n1 )TY1.

Once the rule of the table tc2 is applied, the c1’s change to c so that the array becomes X1 (cn)T Y1 which is sent to region 1,

where it is collected in the language. Likewise, starting from c2 the application of rules of the tables tc3 , tc4 , tr2 play a similarrole. The other two statements (ii), (iii) can be similarly proved.

An extension of the pure 2D context-free grammar (P2DCFG) known as extended 2D context-free picture grammar(E2DCFPG) is proposed in [32] by allowing variables in the rules of a P2DCFG and collecting the picture arrays generatedover a set of terminal symbols. The extended picture grammar model E2DCFPG has more picture generative power thanthe P2DCFPG. We now compare the array-rewriting P system model that we have considered here with E2DCFPG in thefollowing theorem.

Theorem 6. AP4(P2DCFG) ∩ EP2DCFL 6= ∅.

Proof. It is known [32] that the picture language consisting of rectangular arrays over a, b, (onemember ofwhich is shownin Fig. 6) which represent the digitized form of the English letter T with equal ‘‘arms’’ and with the body of the letter madeof a’s when the letter b is interpreted as blank, is generated by a E2DCFPG but cannot be generated by any P2DCFG. Thispicture language can also be generated by an array-rewriting P system with four membranes and with pure context-freerules

Π3 = (V , µ, F1, F2, F3, F4, R1, R2, R3, R4, 4), where

µ = [1[2[3[4]4]3]2]1, V = s, e, d, x, y, z, c, a, b, F1 = M0 with M0 =a s ad y d , F2 = F3 = F4 = ∅, R1 = tc1,

R2 = tr1 , tr2, R3 = tc2 , tr3, R4 = ∅. The tables of rules are as follows: tc1 = s → asa, y → dzd, x → bxb(in), tc2 =

s→ a, c → e, x→ a(here), tr1 =d→ d

b, z →yx

(out),

tr2 =d→ d

b, z →cx

(in), tr3 = d→ b, e→ a(in).

Starting from the array M0 in region 1, the rules of the column table tc1 are applied to the symbols s, y in the middlecolumn and the array is sent to region 2 due to the in command. If in region 2, the rules of the row table tr1 are applied, thearray is sent back to region 1 and the process repeats except that from this step onwards the rule for x is also used in region 1.But if in region 2, the rules of the row table tr2 are applied the array is immediately sent to region 3 wherein the rules of the

1908 K.G. Subramanian et al. / Mathematical and Computer Modelling 52 (2010) 1901–1909

Fig. 6. A rectangular picture array generated byΠ3 .

Fig. 7. A rectangular picture array generated byΠ4 .

column table tc2 and the row table tr3 are applied and the array is then sent to region 4. The rectangular array collected inthe output region 4 is as in Fig. 6 with equal number of a′s in the first row to the left and right of the middle column and thisequals the number of a′s in the middle column, counting from the second row. We note that the final rectangular picturearray collected in region 4 consists of only a′s and b′s although the alphabet of the systemΠ3 hasmore symbols. The rules inthe regions or membranes force the derivation to finally involve only a′s and b′s in the picture. Note also that the remainingsymbols play really the role of extension in the E2DCFPG.

Motivated by the fact that Siromoney matrix grammars [27] cannot describe picture arrays that maintain a proportionbetween the breadth and the width, array grammars (also called kolam array grammars) were introduced in [33]. Thesearray grammars are more powerful than the models in [27] but have not been explored very much. Here we consider one ofthe classes of these grammars, called (R : R)KAL [33] and notice that the array-rewriting P systems with pure context-freerules has nonempty intersection with (R : R)KAL.

Theorem 7. AP2(P2DCFG) ∩ (R : R)KAL 6= ∅.Proof. The language of picture arrays over two symbols x, · that describe digitized ‘right triangles’ of x′swhen the symbol ·is interpreted as blank, is known to belong to the class (R : R)KAL [33]. One member of this language is shown in Fig. 7. Thislanguage is generated by an array-rewriting P system

Π4 = (V , µ, F1, F2, F3, R1, R2, R3, 3), where

µ = [1[2[3]3]2]1, V = x, ·, b, y, F1 = M0 withM0 =b yx x , F2 = F3 = ∅, R1 = tr1, R2 = tc1 , tr2, R3 = ∅. The tables

of rules are as follows: tc1 = x→ xx, b→ by, (out), tr1 =y→ b

x, b→b.

(in), tr2 = b→ ., y→ x(in).

Starting with the axiom M0 in region 1, the rules of the table tr1 are applied ‘growing’ a row ·x and the array is sent toregion 2 where the rules of the column table tc1 could be applied and this will ‘grow’ a column (yxx)

t and the array is thensent to region 1. The process can repeat. If in region 2, the rules of the table tr2 are applied, then the array becomes amemberof the language considered and the array is sent to region 3, wherein it remains forever as there is no table of rules availablein this region.

4. Conclusion

We have investigated the generative power of the array-rewriting P system with pure context-free rules in generatingrectangular picture arrays. It remains to examine whether the number of membranes used in the constructions could bereduced. Also another problem of interest in the area of picture generation is generation of hexagonal arrays that occur inpicture processing and scene analysis. Pure 2D hexagonal context-free grammars which are analogs of P2DCFG are intro-duced in [12].We can consider hexagonal array-rewriting P systemswith pure context-free rules and examine its generativepower in hexagonal array generation by comparingwith other hexagonal arraymodels [34–37].Work in this directionwhichis in progress will be reported in future.

Acknowledgements

The authors K.G. Subramanian and S.K. Lee gratefully acknowledge support for this research by an FRGS Grant of theGovernment of Malaysia. The work of L. Pan was supported by National Natural Science Foundation of China (60674106 and30870826), and Natural Science Foundation of Hubei Province (2008CDB113 and 2008CDB180).

References

[1] Gh. Păun, Computing with Membranes: An Introduction, Springer-Verlag, Berlin, 2002.[2] K. Krithivasan, R. Rama, Introduction to Formal Languages, Automata and Computation, Pearson Education, New Delhi, 2009.

K.G. Subramanian et al. / Mathematical and Computer Modelling 52 (2010) 1901–1909 1909

[3] Gh. Păun, Marcus Contextual Grammars, Kluwer Academic Publishers, 1997.[4] G. Rozenberg, A. Salomaa, The Mathematical Theory of L Systems, Academic Press, New York, 1980.[5] A. Salomaa, Formal Languages, Academic Press, London, 1973.[6] C.R. Cook, P.S.P. Wang, A chomsky hierarchy of isotonic array grammars and languages, Comput. Graph. Image Process. 8 (1978) 144–152.[7] D. Giammarresi, A. Restivo, Two-dimensional languages, in: G. Rozenberg, A. Salomaa (Eds.), in: Handbook of Formal Languages, vol. 3, Springer Verlag,1997, pp. 215–267.

[8] K. Morita, Two-dimensional languages, in: C. Martin-Vide, V. Mitrana, G. Paun (Eds.), Formal Languages and Applications, Springer-Verlag, 2004,pp. 427–437.

[9] K.Morita, Pattern formation in cellular automata and array grammars (invited talk), in: Proc. Int.WorkshoponTilings andCellular Automata, Auckland,2004, pp. 1–14.

[10] A. Rosenfeld, Picture Languages—Formal Models for Picture Recognition, Academic Press, New York, 1979.[11] A. Rosenfeld, R. Siromoney, Picture languages—a survey, Lang. Des. 1 (1993) 229–245.[12] K.G. Subramanian, R.M. Ali, M. Geethalakshmi, A.K. Nagar, Pure 2D picture grammars and languages, Discrete Appl. Math. 157 (2009) 3401–3411.[13] K.G. Subramanian, R. Siromoney, On array grammars and languages, Cybernet. Syst. 18 (1987) 77–98.[14] K.G. Subramanian, D.L. Van, P. Helen Chandra, N.D. Quyen, Array grammars and contextual operations, Fund. Inform. 83 (2008) 411–428.[15] P.S.P. Wang, Some New results on isotonic array grammars, Inf. Process. Lett. 10 (3) (1980) 129–131.[16] P.S.P. Wang, Parallel context-free array grammar normal forms, Comput. Graph. Image Process. 15 (1981) 296–300.[17] P.S.P. Wang, Array Grammars, Patterns and Recognizers, World Scientific, 1989.[18] R. Ceterchi, M. Mutyam, Gh. Paun, K.G. Subramanian, Array–rewriting P systems, Nat. Comput. 2 (2003) 229–249.[19] S.N. Krishna, K. Krithivasan, R. Rama, P systems with picture objects, Acta Cybernet. 15 (2001) 53–74.[20] K.S. Dersanaambika, K. Krithivasan, Contextual array P system, Int. J. Comput. Math. 81 (2004) 955–969.[21] K.G. Subramanian, P systems and picture languages, in: Lecture Notes in Computer Science, vol. 4664, Springer Verlag, 2007, pp. 99–109.[22] K.G. Subramanian, R.M. Ali, A.K. Nagar, M. Margenstern, Array P-systems and t-communication, Fund. Inform. 91 (2009) 145–159.[23] K.G. Subramanian, R. Saravanan, M. Geethalakshmi, P. Helen Chandra, M. Margenstern, P systems with array objects and array rewriting rules,

Prog. Nat. Sci. 17 (2007) 479–485.[24] K.G. Subramanian, R. Saravanan, T. Robinson, P systems for array generation and application to kolam patterns, Forma 22 (2007) 47–54.[25] K.G. Subramanian, L. Pan, S.K. Lee, A.K. Nagar, P systems and context-free 2D picture languages, in: Proc. of Fourth International Conference on Bio-

Inspired Computing: Theories and Applications, BIC-TA 2009, 2009, pp. 336–340.[26] K.G. Subramanian, M. Geethalakshmi, A.K. Nagar, S.K. Lee, Array P system model with pure context-free rules, in: Proceedings of UKSim 2009: 11th

International Conference on Computer Modelling and Simulation, England, 2009, pp. 274–278.[27] G. Siromoney, R. Siromoney, K. Krithivasan, Abstract families of matrices and picture languages, Comput. Graph. Image Process. 1 (1972) 234–307.[28] R. Siromoney, K.G. Subramanian, K. Rangarajan, Parallel/sequential rectangular arrays with tables, Int. J. Comput. Math. 6A (1977) 143–158.[29] A. Gabrielian, Pure grammars and pure languages, Int. J. Comput. Math. 9 (1981) 3–16.[30] H.A. Maurer, A. Salomaa, D. Wood, Pure grammars, Inf. Control 44 (1980) 47–72.[31] K.G. Subramanian, A.K. Nagar, M. Geethalakshmi, Pure 2D picture grammars (P2DPG) and P2DPG with regular control, in: Brimkov, et al. (Eds.),

Combinatorial Image Analysis, in: Lecture Notes in Computer Science, vol. 4958, Springer-verlag, Berlin Heidelberg, 2008, pp. 330–341.[32] K.G. Subramanian, M. Geethalakshmi, A.K. Nagar, S.K. Lee, Two-dimensional picture grammar models, in: Proceedings of the 2nd EuropeanModelling

Symposium, EMS2008, Liverpool Hope university, England, 2008, pp. 263–267.[33] G. Siromoney, R. Siromoney, K. Krithivasan, Picture languages with array rewriting rules, Inf. Control 22 (1973) 447–470.[34] M. Mahajan, K. Krithivasan, Hexagonal cellular automata, in: R. Narasimhan (Ed.), A Perspective in Theoretical Computer Science, World Scientific,

1989, pp. 134–164.[35] G. Siromoney, R. Siromoney, Hexagonal arrays and rectangular blocks, Comp. Graph. Image Process. 5 (1976) 353–381.[36] K.G. Subramanian, Hexagonal array grammars, Comp. Graph. Image Process. 10 (1979) 388–394.[37] K.G. Subramanian, M. Geethalakshmi, A.K. Nagar, S.K. Lee, Hexagonal picture languages, in: Proc. of the 5th AsianMathematical Conference, Malaysia,

2009, pp. 510–514.