• Keine Ergebnisse gefunden

On Pure Multi-Pushdown Automata that Perform Complete-Pushdown Pops

N/A
N/A
Protected

Academic year: 2022

Aktie "On Pure Multi-Pushdown Automata that Perform Complete-Pushdown Pops"

Copied!
12
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

On Pure Multi-Pushdown Automata that Perform Complete-Pushdown Pops

Tom´aˇs Masopust Alexander Meduna

Abstract

This paper introduces and discusses pure multi-pushdown automata that remove symbols from their pushdowns only by performing complete-pushdown pops. During this operation, the entire pushdown is compared with a prefix of the input, and if they match, the pushdown is completely emptied and the input is advanced by the prefix.

The paper proves that these automata define an infinite hierarchy of language families identical with the infinite hierarchy of language families resulting from right linear simple matrix grammars. If these automata are allowed to join their pushdowns and create new pushdowns, then they define another infinite hierarchy of language families according to the number of pushdowns.

1 Introduction

Indisputably, pushdown automata fulfill a crucial role in formal language theory. It thus comes as no surprise that this theory has introduced many variants of these automata over its history (see [1, 3, 5, 6, 7, 9, 10, 12, 14, 15] for more details). These variants also include pure multi-pushdown automata, which are pushdown automata that have several pushdowns, each of which always contains only input symbols—that is, no extra pushdown symbols are allowed in them (for an overview, see the paper by Fischer [4] and references therein). Recall that with a single input symbol, pure multi-pushdown automata are equiva- lent to multi-counter automata, which are equivalent to Turing machines. With two or more input symbols, however, pure one-pushdown automata define the family of all context-free languages.

The present paper continues with this classical topic of formal language theory. More specifically, this paper discusses pure multi-pushdown automata that can remove symbols from their pushdowns only by performing a complete-pushdown pop. During this operation, the entire pushdown is compared with a prefix of the input, and if they match, the pushdown is completely emptied and, simultaneously, the input is advanced by the prefix. The paper demonstrates that these automata define an infinite hierarchy of language families that is identical with the infinite hierarchy of language families resulting from these grammars and automata: (1) right linear simple matrix grammars (see [8]), (2) all-move self-regulating finite automata (see [11]), (3) multi-tape one-way non-writing automata (see [3]), and (4) finite-turn checking automata (see [14]). In addition, if we allow the pure multi-pushdown

Faculty of Information Technology, Brno University of Technology, Boˇzetˇechova 2, Brno 61266, Czech Republic, E-mail: masopust@fit.vutbr.cz, meduna@fit.vutbr.cz.

(2)

automata discussed in this paper to join two pushdowns and introduce a new pushdown, then they define another infinite hierarchy of language families dependent upon the number of pushdowns.

In its conclusion, this paper also formulates some open problems.

2 Preliminaries and Definitions

This paper assumes that the reader is familiar with the theory of automata and formal lan- guages (see [13]). For an alphabet (finite nonempty set)V,V represents the free monoid generated byV. The unit ofV is denoted byε. SetV+ =V− {ε}. Forw∈V and W⊆V,wR denotes the mirror image ofwandoccur(w,W)denotes the number of occur- rences of symbols fromW in w. Let LREG andLCS denote the families of regular and context-sensitive languages, respectively.

Acontext-free grammar is a quadrupleG= (N,T,P,S), whereN is a nonterminal al- phabet,T is a terminal alphabet such thatN∩T =/0,V =N∪T,S∈Nis the start symbol, andPis a finite set of productions of the formA→v, whereA∈Nandv∈V. For a pro- ductionA→v∈P, letrhs(p) =Aandlhs(p) =v. In this paper, we label the productions fromPby elements of a finite setQ;Qis chosen so that there is a bijectionlab:P→Q.

Then,Q=lab(P) ={lab(p):p∈P}is said to be a set ofproduction labels. In what fol- lows, instead ofA→v∈Pwithlab(A→v) =qwe writeq:A→v∈P. Ifq:A→v∈P, x,y∈V, thenGmakes a derivation step fromxAytoxvy, written asxAy⇒xvy[q]or, sim- ply,xAy⇒xvy. In the standard way, define⇒m, form≥0,⇒+, and⇒. To express that Gmakesx⇒my, for somex,y∈V, by using a sequence of productionsq1,q2, . . . ,qm, we writex⇒my[q1q2. . .qm]. The language generated by a context-free grammarGis defined asL(G) ={w∈T:S⇒w}. The family of languages generated by context-free grammars is denoted byLCF.

For n≥1, ann-right linear simple matrix grammar (defined in [8], see also [16]) is an(n+3)-tupleG= (N1,N2, . . . ,Nn,T,P,S), whereN1,N2, . . . ,Nnare pairwise disjoint non- terminal alphabets,T is a terminal alphabet,N=N1∪N2∪ · · · ∪Nn,S6∈N∪T is the start symbol,N∩T =/0, andPis a finite set of matrix productions of the following three forms:

1.[S→X1X2. . .Xn], Xi∈Ni, 1≤i≤n;

2.[X1→w1Y1,X2→w2Y2, . . . ,Xn→wnYn], wi∈T,Xi,Yi∈Ni, 1≤i≤n;

3.[X1→w1,X2→w2, . . . ,Xn→wn], Xi∈Ni,wi∈T, 1≤i≤n.

Letmbe a matrix, then m[i]denotes theith production ofm. For x,y∈(N∪T∪ {S}), x⇒yif and only if

1. eitherx=Sand[S→y]∈P, or

2. x=y1X1y2X2. . .ynXn,y=y1x1y2x2. . .ynxn, and[X1→x1,X2→x2, . . . ,Xn→xn]∈P.

As usual, define⇒m, form≥0,⇒+, and⇒. The language generated by ann-right linear simple matrix grammarGis defined asL(G) ={w∈T:S⇒w}. The family of languages generated byn-right linear simple matrix grammars is denoted byLRn.

A programmed grammar is a quadruple G= (N,T,P,S), where N is a nonterminal alphabet,T is a terminal alphabet such thatN∩T=/0,V =N∪T,S∈Nis the start symbol, andP is a finite set of productions of the form(q:A→v,g(q)), where q:A→v is a

(3)

context-free production andg(q)⊆lab(P). In every derivation ofG, any two consecutive steps, x⇒y⇒z, made by (p:A→u,g(p)) and (q:B→v,g(q)), respectively, satisfy q∈g(p). As usual, define ⇒m, for m≥0, ⇒+, and ⇒. The language generated by a programmed grammarGis defined asL(G) ={w∈T:S⇒w}. The family of languages generated by programmed grammars is denoted byLP.

LetDbe a derivation ofw∈VinGof the formw1⇒w2⇒. . .⇒wr, for somer≥1, whereS=w1 andwr=w. Set Ind(D,G) =max{occur(wi,N): 1≤i≤r}. Forw∈T, setInd(w,G) =min{Ind(D,G):Dis a derivation ofwinG}. TheindexofGis defined as Ind(G) =max{Ind(w,G):w∈L(G)}.

ForL∈LP, setInd(L) =min{Ind(G):L(G) =L,Gis a programmed grammar}. Fi- nally, setLPn={L∈LP:Ind(L)≤n}, for alln≥1.

2.1 Pure Multi-Pushdown Automata that Perform Complete-Pushdown Pops Let n≥1. A pure n-pushdown automaton that performs complete-pushdown pops, an nPPDA for short, is a quadruple

M= (Q,T,R,s),

whereQis a finite set of states,T is an alphabet of input symbols,R⊆S ×S is a set of rules, ands∈/S is the start state, whereS is a set defined asS =S1∪S2∪S3∪S4,

• S1={hq,popi:q∈Q}

• S2={hq,push,i,ai:q∈Q,1≤i≤n,a∈T∪ {ε}}

• S3={hq,new,ii:q∈Q,1≤i≤n}

• S4={hq,join,ii:q∈Q,2≤i≤n}.

A configuration ofMis a string over

(T{$} ∪ {ε})n×(S ∪ {s})×T.

Let 1≤k≤n and p→q∈R. Define the relation ⇒depending on the left-hand side of p→q∈R,p, as follows:

1. $nsw⇒$nqw;

2. wk$. . .$w2$w1$hp,popiwR1w⇒wk$. . .$w2$qw;

3. wk$. . .$wi$. . .$w1$hp,push,i,aiw⇒wk$. . .$wia$. . .$w1$qw, fori≤k;

4. wk$. . .$wi$. . .$w1$hp,new,iiw⇒wk$. . .$wi$$. . .$w1$qw, fori≤k<n;

5. wk$. . .$w1$hp,new,k+1iw⇒$wk$. . .$w1$qw, fork<n;

6. wk$. . .$wi$wi−1$. . .$w1$hp,join,iiw⇒wk$. . .$wiwi−1$. . .$w1$qw, fori≤k.

Remark 1. Note that the symbols$denote the top of M’s pushdowns.

In the standard way, define⇒m, form≥0, and⇒. Then, the language of annPPDA Mis defined as

L(M) ={w∈T: $nsw⇒q,for someq∈S}, where $nsw⇒qis called acomputationofMonw, and forI⊆ {1,2,3,4},

LIn= n

L(M):M= (Q,T,R,s)is annPPDA withR⊆[

i∈I

Si×[

i∈I

Si

o .

(4)

3 Main Results

In this section, we prove two infinite hierarchies generated by pure multi-pushdown au- tomata that perform complete-pushdown pops according to their pushdown operations and the number of pushdowns. First, however, we generalize the notion of these automata by allowing them to push the whole strings to their pushdowns.

3.1 GeneralizednPPDAs

Ageneralized pure n-pushdown automaton that performs complete-pushdown pops is an nPPDAM= (Q,T,R,s)withR⊆S×S, whereS is a finite subset ofS1∪S20∪S3∪S4, S1, S3, S4 are as in thenPPDA, and S20 ={hq,push,i,ui:q∈Q,1≤i≤n,u∈T}.

Correspondingly, the computational step is modified as follows:

3. wk$. . .$wi$. . .$w1$hp,push,i,uiw⇒wk$. . .$wiu$. . .$w1$qw, fori≤k.

The other computational steps are defined as in the classicalnPPDA.

First, by the common construction, we prove that this generalization has no effect to the generative power of pure multi-pushdown automata that perform complete-pushdown pops.

Lemma 1. Let M be a generalized nPPDA, for some n≥1. Then, there is an nPPDA, N, such that L(M) =L(N).

Informally, whatMdoes in one derivation step,Ndoes in the-length-of-the-added-string steps.

Proof. LetM= (Q,T,R,s)be a generalizednPPDA. Construct the followingnPPDAN= (Q0,T,R0,s)by the following algorithm (S is as in the definition in Section 2.1):

1. SetR0={p→q∈R:p,q∈S ∪ {s}}andQ0=Q;

2. For all p→ hq,push,i,a1a2. . .aki ∈Rwithai∈T, fori=1, . . . ,k,k≥2, add (a) statesqi,1a1a2...ak,qi,2a1a2...ak, . . . ,qi,ka1a2...aktoQ0;

(b) p→ hqi,1a1a2...ak,push,i,a1itoR0;

(c) hqi,a1ja2...ak,push,i,aji → hqi,a1j+1...ak,push,i,aj+1itoR0, for j=1, . . . ,k−1;

(d) forhq,push,i,a1a2. . .aki →r∈R, addhqi,ka1a2...ak,push,i,aki →rtoR0ifr∈S, otherwise toR.

3. IfR0 has been changed, go to 2.

It is not hard to see thatL(M) =L(N).

3.2 Language Families

Consider an arbitrary I ⊆ {1,2,3,4}. It is not hard to see that if 16∈I, then LIn= /0;

the automaton cannot remove $ from its configuration. In addition, if 1∈I and 26∈I, thenLIn={ε}; the automaton can remove all symbols $ but cannot read any nonempty input. Thus, there are only four sets of interest:{1,2},{1,2,3},{1,2,4},{1,2,3,4}. The following two lemmas are obvious.

(5)

Lemma 2. For n≥1,L{1,2}n ⊆L{1,2,3}n ⊆L{1,2,3,4}n andL{1,2}n ⊆L{1,2,4}n ⊆L{1,2,3,4}n . Lemma 3. L{1,2}1 =L{1,2,3,4}1 =LREG.

Consider an automaton with pop, push, and join operations. We show how to remove the join operation without changing the accepted language. Note that by the join operation applied to theith pushdown, the content of theith pushdown is added to the bottom of the (i−1)st pushdown. Skipping the join operation, to push a symbol to the jth pushdown in the original automaton, for some j≥i, means to push the symbol to the (j+1)st pushdown.

This can be done by a sequence of the formi1i2. . .imadded to states, for somem≤n, where ik ∈ {1,0}, fork=1, . . . ,m, and ik =0 if and only if theikth pushdown has been joined.

Thus, the automaton starts with a sequence ofn1s, 11. . .1, and to push a symbol to the ith pushdown means to push the symbol to the lth pushdown, wherel is the position of theith 1 in the sequence. Analogously, to make the pop operation, say from a state with 10. . .0il. . .ik, where 2≤l≤k andil =1, the new automaton makesl−1 pop operations and goes to a state withil. . .ik. Finally, to join theith pushdown means to replace theith 1 with 0 in the sequence by pushingε to the first pushdown.

Lemma 4. For all n≥1,L{1,2}n =L{1,2,4}n .

Corollary 1. For all n≥1,L{1,2}n =L{1,2,4}n ⊆L{1,2,3}n ⊆L{1,2,3,4}n .

This paper studies the L{1,2}n andL{1,2,3,4}n language families. Questions concerning theL{1,2,3}n language families are open.

3.3 L{1,2}n Language Families

Example 1. Consider an nPPDA M= ({s,q},{a1,a2, . . . ,an},R,s)with R having the fol- lowing rules:

1. s→ hq,push,1,a1i,

2. hq,push,i,aii → hq,push,i+1,ai+1i, for i=1, . . . ,n−1, 3. hq,push,n,ani → hq,push,1,a1i,

4. hq,push,n,ani → hq,popi, 5. hq,popi → hq,popi.

Then, L(M) ={ak1ak2. . .akn:k≥1}.

Next, we prove that the power of puren-pushdown automata that perform complete- pushdown pops with push and pop operations is precisely the power ofn-right linear simple matrix grammars. First, however, notice that any such automaton,M, has the property that there is exactlyn pop operations in any computation; clearly, the automaton has to popn pushdowns and no new pushdown can be created. Moreover, we can prove that there is an equivalent automaton,N, such that in any computation ofN, no pop operation precedes a push operation. To show this, letNsimulateMbut ifMpops the pushdown,Nskips the pop operation and increases the number of pop operations skipped so far recorded in its state.

Thus, in any time, N knows the number of pop operations applied in the corresponding computation of M, say 0≤k≤n. Then, if M pushes a symbol to the ith pushdown, N pushes this symbol to the(i+k)th pushdown. Clearly,N finishes (pops all its pushdowns one by one) only ifMhas performednpop operations.

(6)

Lemma 5. Let n≥1and L∈L{1,2}n . Then, there is an nPPDA, M, such that L(M) =L and its sequence of operations applied during any computation, starting from s, is of the form

s,push1,push2, . . . ,pushk,pop1,pop2, . . . ,popn

for some k≥1, pushi∈S2, for all i=1, . . . ,k, and popj∈S1, for all j=1, . . . ,n.

Proof. This follows from the previous arguments and the fact that if there is no push op- eration in a computation, then we can pushε to the first pushdown, i.e., for some statet, push1=ht,push,1,εi.

Lemma 6. For all n≥1,L{1,2}n ⊆LRn.

Proof. LetM= (Q,T,R,s)be annPPDA withR⊆(S1∪S2)×(S1∪S2)satisfying the condition from Lemma 5. Clearly, we can assume that pop1=· · ·=popn=hr,popi, for somer∈Q. Thus,S1={hr,popi}. LetG= (N1, . . . ,Nn,T,P,SG)and setNi= (S1∪S2)× {i}, for i=1,2, . . . ,n. Set P={SG→ hhr,popi,1ihhr,popi,2i. . .hhr,popi,ni:hr,popi ∈ S1}. Ifq→p∈Ris of the form

1. ht,push,i,ai → hr,popi, add

[hhr,popi,1i → hq,1i, . . . ,hhr,popi,ii →ahq,ii, . . . ,hhr,popi,ni → hq,ni]toP;

2. hr,push,i,ai → ht,push,j,bi, add

[hp,1i → hq,1i, . . . ,hp,ii →ahq,ii, . . . ,hp,ni → hq,ni]toP;

3. s→ p, add

[hp,1i →ε,hp,2i →ε, . . . ,hp,ni →ε]toP.

Note thatMstarts withs→ p, continues withp→q, then with p→ hr,popi, for some p,q∈S2, and finishes withhr,popi → hr,popi applied n-times. Denote the sequence of applied rules by s,p1, . . . ,pk,pop1, . . . ,popn, for some k ≥1. Then, G simulates M by the following sequence of productions: initial production (simulating allnpop operations), p0k, . . . ,p01,s0, wherep0kis constructed frompkas in 1, p0ifrompias in 2, fori=1, . . . ,k−1, ands0fromsas in 3.

Lemma 7. For all n≥1,LRn⊆L{1,2}n .

Proof. Let n≥1 and G= (N1, . . . ,Nn,T,P,S) be an n-right linear simple matrix gram- mar. Construct the following generalizednPPDAM= (Q,T,R,s), whereQ={(x,m):x∈ N1. . .Nn,m∈P} ∪ {S}andRis defined as follows:

1. Forα =X1. . .Xn∈N1. . .Nnandm= [X1→w1, . . . ,Xn→wn]∈Pwithwi∈T, for alli=1,2, . . . ,n, adds→ h(α,m),push,1,wR1itoR;

2. Forα=X1. . .Xn,β =Y1. . .Yn∈N1. . .Nn, andm0= [Y1→v1X1, . . . ,Yn→vnXn]∈P, addh(α,m),push,n,wRni → h(β,m0),push,1,vR1itoR;

3. Forα=Y1. . .Yn∈N1. . .Nnandm[i+1] =Yi+1→vi+1Xi+1withvi+1∈TandXi+1∈ N∪ {ε}, for alli=1, . . . ,n−1, add

h(α,m),push,i,vRii → h(α,m),push,i+1,vRi+1itoR;

4. Forα=X1. . .Xn, if there is[S→X1. . .Xn]∈P, add h(α,m),push,n,vRni → hS,popitoR;

(7)

5. AddhS,popi → hS,popitoR.

Clearly,Msimulates the derivation ofGbottom-up and whatGdoes in one derivation step, Mdoes innsteps. Then, according to Lemma 1, the proof is complete.

Theorem 1. For all n≥1,L{1,2}n =LRn.

Proof. This follows from the previous two lemmas.

Corollary 2. For all n≥1,L{1,2}n ⊂L{1,2}n+1.

Proof. This follows from the previous theorem and [8, Theorem 2.3].

3.4 L{1,2,3,4}n Language Families

The following lemma shows that any string accepted by a puren-pushdown automaton that performs complete-pushdown pops can be generated by a programmed grammar of index n+1.

Lemma 8. For all n≥1,L{1,2,3,4}n ⊆LPn+1.

Informally, to annPPDA M, we construct a programmed grammar, G, of index n+ 1 so that the ith nonterminal of G, hAi,ki, is associated with the ith pushdown, where 1≤k≤n+1. Specifically, if the current content ofM’s pushdowns is c2c1$b2b1$a2a1$ (corresponding to a string a1a2b1b2c1c2), then the sentential form of G is of the form hA1,4ia1a2hA2,4ib1b2hA3,4ic1c2hA4,4i. Then, the pop operation is simulated so that

hA1,4ia1a2hA2,4ib1b2hA3,4ic1c2hA4,4i is replaced with

a1a2hA1,3ib1b2hA2,3ic1c2hA3,3i.

The push operation pushing a onto the second pushdown, i.e. c2c1$b2b1a$a2a1$ corre- sponding to a stringa1a2ab1b2c1c2, is simulated by replacing

hA1,4ia1a2hA2,4ib1b2hA3,4ic1c2hA4,4i with

hA1,4ia1a2hA2,4iab1b2hA3,4ic1c2hA4,4i.

The new operation introducing a new, say the first, pushdown, i.e. c2c1$b2b1$a2a1$$, is simulated by replacing

hA1,4ia1a2hA2,4ib1b2hA3,4ic1c2hA4,4i with

hA1,5ihA2,5ia1a2hA3,5ib1b2hA4,5ic1c2hA5,5i.

Note that the previous first pushdown is the second from now on (till the other change).

Finally, the join operation of the first and the second pushdown (by a state of the form hr,join,2i), i.e.c2c1$b2b1a2a1$, is simulated by replacing

hA1,4ia1a2hA2,4ib1b2hA3,4ic1c2hA4,4i

(8)

with

hA1,3ia1a2b1b2hA2,3ic1c2hA3,3i. The formal proof follows.

Proof. LetM= (Q,T,R,s)be annPPDA. Construct the grammarG= (N,T,P,S), where N=Q× {1, . . . ,n+1} andPis constructed as follows. Set f(r) ={t:r→t∈R}, and g(f(r)) =Sp∈f(r)g(p)(the definition ofg(p)follows).

1. For any rules→p∈R, add

(S→ hA1,n+1ihA2,n+1i. . .hAn+1,n+1i,g(p))intoP;

2. For all p∈S1and 1≤l≤n+1, add

([p,l,p]:hA1,li →ε,{[/,2,l,p]:[/,2,l,p]∈lab(P)});

3. For all p∈S1∪S4and 1≤i,l≤n+1,i≥2, add

([/,i,l,p]:hAi,li → hAi−1,li,{[/,i+1,l,p]}), fori<l;

([/,l,l,p]:hAl,li → hAl−1,li,{[−,1,l,p]});

4. For all p∈S1∪S4and 1≤i,l≤n+1,l≥2, add

([−,i,l,p]:hAi,li → hAi,l−1i,{[−,i+1,l,p]}), fori<l−1;

([−,l−1,l,p]:hAl−1,li → hAl−1,l−1i,g(f(p)));

5. For all p∈S2and 1≤i,l≤n+1, add ([i,l,p]:hAi,li → hAi,lia,g(f(p)));

6. For all p∈S3and 1≤i,l≤n+1,i≤n, add

([∗,i,l,i,p]:hAi,li → hAi+1,li,{[∗,i+1,l,i,p]}), fori<l;

([∗,l,l,i,p]:hAl,li → hAl+1,li,{[n,i+1,l,p]});

7. For all p∈S3, 1≤l≤n+1 and 1<i≤n+1, add ([n,i,l,p]:hAi,li → hAi−1,lihAi,li,{[+,1,l,p]});

8. For all p∈S3and 1≤i,l<n+1, add

([+,i,l,p]:hAi,li → hAi,l+1i,{[+,i+1,l,p]}), fori<l+1;

([+,l+1,l,p]:hAl+1,li → hAl+1,l+1i,g(f(p)));

9. For all p∈S4and 1≤i,l≤n+1, add

([j,i,l,p]:hAi,li →ε,W),W ={[/,i+1,l,p]})ifi<l,W ={[−,1,l,p]}oth- erwise.

g(p)depends onpas follows:

p=hr,popi: g(p) ={[p,l,p]:[p,l,p]∈lab(P)};

p=hr,push,i,ai: g(p) ={[i,l,p]:[i,l,p]∈lab(P)};

p=hr,new,ii: g(p) ={[∗,i,l,i,p]:[∗,i,l,i,p]∈lab(P)};

p=hr,join,ii: g(p) ={[j,i,l,p]:[j,i,l,p]∈lab(P)}.

(9)

Consider a configuration wk$. . .$w2$w1$pw of M and the corresponding sentential form ofG,(hA1,k+1iw1hA2,k+1iw2. . .hAk,k+1iwkhAk+1,k+1i,g(p)). If p=hr,popi, Gsimulates the computational step as follows:

(hA1,k+1iw1hA2,k+1iw2. . .hAk,k+1iwkhAk+1,k+1i,{[p,k+1,p]})

⇒ (w1hA2,k+1iw2. . .hAk,k+1iwkhAk+1,k+1i,{[/,2,k+1,p]})

k (w1hA1,k+1iw2. . .hAk−1,k+1iwkhAk,k+1i,{[−,1,k+1,p]})

k (w1hA1,kiw2. . .hAk−1,kiwkhAk,ki,g(f(p))).

Ifp=hr,push,i,ai,Gsimulates the computational step as follows:

(hA1,k+1iw1. . .hAi,k+1iwi. . .hAk,k+1iwkhAk+1,k+1i,{[i,k+1,p]})

⇒ (hA1,k+1iw1. . .hAi,k+1iawi. . .hAk,k+1iwkhAk+1,k+1i,g(f(p))).

Ifp=hr,new,ii,Gsimulates the computational step as follows:

(hA1,k+1iw1. . .wi−1hAi,k+1iwi. . .wkhAk+1,k+1i,{[∗,i,k+1,i,p]})

k−i+1 (. . .wi−1hAi+1,k+1iwi. . .wkhAk+2,k+1i,{[n,i+1,k+1,p]})

⇒ (. . .wi−1hAi,k+1ihAi+1,k+1iwi. . .wkhAk+2,k+1i,{[+,1,k+1,p]})

k+2 (hA1,k+2iw1. . .wkhAk+2,k+2i,g(f(p))).

Ifp=hr,join,ii,Gsimulates the computational step as follows:

(hA1,k+1iw1. . .wi−1hAi,k+1iwi. . .wkhAk+1,k+1i,{[j,i,k+1,p]})

⇒ (. . .hAi−1,k+1iwi−1wihAi+1,k+1iwi+1. . . ,{[/,i+1,k+1,p]})

k−i (. . .hAi−1,k+1iwi−1wihAi,k+1iwi+1. . .wkhAk,k+1i,{[−,1,k+1,p]})

k (hA1,kiw1. . .hAi−1,kiwi−1wihAi,ki. . .wkhAk,ki,g(f(p))).

As any derivation ofGsimulates a computation ofM, we haveL(M) =L(G).

Next lemma shows that any string generated by a programmed grammar of indexnis accepted by a pure(n+1)-pushdown automaton that performs complete-pushdown pops.

Lemma 9. For all n≥1,LPn⊆L{1,2,3,4}n+1 .

The main idea of the proof is to simulate a derivation of a programmed grammar, G, of index n by a generalized pure (n+1)-pushdown automaton that performs complete- pushdown pops,M, so that whatGgenerates to the right of the rewritten nonterminal, say Aw1Bw2Cw3⇒Aw1Buw2Cw3, M pushes to its corresponding pushdown, wR3$wR2uR$wR1$.

If G generates a string, v, to the left of the rewritten nonterminal, say Aw1Bw2Cw3⇒ Aw1vBw2Cw3, thenMcreates a new pushdown just before the pushdown corresponding to the rewritten nonterminal,wR3$wR2$$wR1$, pushesvRto the new pushdown,wR3$wR2$vR$wR1$, and joins the two pushdowns,wR3$wR2$vRwR1$. By this,MputsvRto the bottom of the push- down. In case of the first pushdown, the join operation is replaced with the pop operation.

The formal proof follows.

Proof. LetG= (N,T,P,S)be a programmed grammar of indexn, for somen≥1. Construct a generalized pure(n+1)-pushdown automaton that performs complete-pushdown pops M= (Q,T,R,s)as follows.

(10)

1. Set Q= (lab(P)∪ {+})×Sk≤nNk× {0,1, . . . ,m+1}, for m=max{k:A→u∈ P,occur(u,N) =k};

2. For all p:A→u1B1u2B2. . .ukBkuk+1∈P, where ui ∈T and Bj ∈N, for all i= 1, . . . ,k+1, j=1, . . . ,k,k≥0, and for allh+,αAβ,0i ∈Q,l=occur(αA,N), add the following toR:

• s→ hh+,S,0i,push,1,εi,

• hh+,αAβ,0i,push,1,εi → hhp,αB1. . .Bkβ,k+1i,push,l+k−1,uRk+1i,

• hhp,αB1. . .Bkβ,k+1i,push,l+k−1,uRk+1i → hhp,αB1. . .Bkβ,ki,push,l+k−2,uRki,

• hhp,αB1. . .Bkβ,ki,push,l+k−2,uRki → hhp,αB1. . .Bkβ,k−1i,push,l+k−3,uRk−1i, ...

• hhp,αB1. . .Bkβ,2i,push,l,uR2i → hhp,αB1. . .Bkβ,1i,new,li,

• hhp,αB1. . .Bkβ,1i,new,li → hhp,αB1. . .Bkβ,1i,push,l,uR1i,

• ifl=1, add

– hhp,B1. . .Bkβ,1i,push,1,uR1i → hhp,B1. . .Bkβ,0i,popi, – hhp,B1. . .Bkβ,0i,popi → hh+,B1. . .Bkβ,0i,push,1,εi,

• ifl≥2, add

– hhp,αB1. . .Bkβ,1i,push,l,uR1i → hhp,αB1. . .Bkβ,0i,join,li, – hhp,αB1. . .Bkβ,0i,join,li → hh+,αB1. . .Bkβ,0i,push,1,εi.

We have proved thatL(M) =L(G), whereMis a generalized(n+1)PPDA. The proof then follows by Lemma 1.

Letn≥1. Analogously as in [2, Theorem 3.1.7], we can prove that the language Ln={b(aib)2n−1:i≥1} ∈LPn−LPn−1.

Lemma 10. For all n≥1, Ln∈L{1,2,3,4}n .

Informally, the automaton hasnpushdowns and each but the one of them containsaibai, for somei≥1. Thus, two symbolsaare put to a pushdown—one to the top and one to the bottom. Finally, the symbolbis pushed to the bottom of alln−1 pushdowns. Obviously, by the operations new and pop,baibcan be simulated and compared with the prefix of the input symbol by symbol during the computation. Thus, the automaton has readbaib, and each of n−1 pushdowns containsbaibai$, i.e., we have acceptedbaib(aib)2(n−1)=b(aib)2n−1. Proof. Letn≥2. Ifn=1, the proof is trivial; just pushbaibto the pushdown. Let M= (Q,{a,b},R,s)be a puren-pushdown automaton that performs complete-pushdown pops, whereQ={0,p,q,r,s,t,f}, andRis constructed as follows.

Phase 1.

1. s→ h0,push,1,bi,

2. h0,push,1,bi → h0,popi, 3. h0,popi → hp,push,1,bi, 4. for 2≤i<n−1,

(11)

4a. hp,push,i,bi → hp,push,i+1,bi, 4b. hp,push,n−1,bi → hq,new,1i, Phase 2.

5. hq,new,1i → hq,push,1,ai, 6. hq,push,1,ai → hq,popi, 7. hq,popi → hs,push,1,ai, 8. for 1≤i<n,

8a. hs,push,i,ai → hr,new,i+1i, 8b. hr,new,i+1i → hr,push,i+1,ai, 8c. hr,push,i+1,ai → hr,join,i+1i, 8d. hr,join,ii → hs,push,i,ai,i≥2, 8e. hr,join,ni → hq,new,1i,

8f. hr,join,ni → ht,new,1i, Phase 3.

9. ht,new,1i → ht,push,1,bi, 10. ht,push,1,bi → ht,popi, 11. ht,popi → ht,new,2i, 12. for 2≤i≤n,

12a. ht,new,ii → ht,push,i,bi, 12b. ht,push,i,bi → ht,join,ii, 12c. ht,join,ii → ht,new,i+1i, Phase 4.

13. ht,new,n+1i → hf,popi, 14. hf,popi → hf,popi.

Phase 1 readsb from the input and pushesbton−1 pushdowns. Phase 2 repeatedly readsafrom the input and pushesas to the top and bottom of alln−1 pushdowns. Phase 3 readsbfrom the input and pushesbto the bottom of alln−1 pushdowns. Finally, Phase 4 pops alln−1 pushdowns. Clearly, baibhas been read from the input and each of n−1 pushdowns containsbaibai$, where the top of the pushdown is on the right. By this,L(M) = Ln.

Corollary 3. For all n≥1,LPn⊂L{1,2,3,4}n+1 .

Proof. The inclusion follows from Lemma 9 and the strictness from Lemma 10.

The following corollary summarizes the power ofnPPDAs known so far.

Corollary 4. For all n≥1,L{1,2,3,4}n ⊆LPn+1⊂L{1,2,3,4}n+2 .

Proof. It follows immediately from Lemmas 8 and 9, and the previous corollary.

Analogously, we can prove that for alln≥2,

Kn+1={ak1ak2. . .akn+1:k≥1} ∈L{1,2,3,4}n . Corollary 5. For all n≥2,L{1,2}n ⊂L{1,2,3,4}n .

Proof. Ibarra [8] proved thatKn+16∈LRn=L{1,2}n .

By the trick pushing the content of one pushdown to the bottom of the other, we can prove that for alln≥1,K2n−1∈L{1,2,3,4}n .

Open Problems

Letn≥1. We believe that L{1,2,3,4}n ⊂L{1,2,3,4}n+1 , however, we do not know any proof.

Next, the question whether for alln≥2,L{1,2}n+1 ⊆L{1,2,3,4}n is open. Moreover, the ques- tion whether{www:w∈ {a,b}} ∈L{1,2,3,4}2 is open, too. Finally, as mentioned above, questions concerning theL{1,2,3}n language families, for alln≥2, are open.

(12)

Acknowledgements

This work was supported by the Czech Ministry of Education under the Research Plan No.

MSM 0021630528 and the Czech Grant Agency project No. GA201/07/0005.

References

[1] B. Courcelle. On jump deterministic pushdown automata. Math. Systems Theory, 11:87–109, 1977.

[2] J. Dassow and Gh. P˘aun. Regulated Rewriting in Formal Language Theory. Springer- Verlag, Berlin, 1989.

[3] P. C. Fischer and A. L. Rosenberg. Multitape one-way nonwriting automata. J. Com- put. System Sci., 2:88–101, 1968.

[4] Patrick C. Fischer. Multi-tape and infinite-state automata—a survey. Commun. ACM, 8(12):799–805, 1965.

[5] S. Ginsburg, S. A. Greibach, and M. A. Harrison. One-way stack automata. J. ACM, 14:389–418, 1967.

[6] S. Ginsburg and E. Spanier. Finite-turn pushdown automata.SIAM J. Control, 4:429–

453, 1968.

[7] S. A. Greibach. Checking automata and one-way stack languages.J. Comput. System Sci., 3:196–217, 1969.

[8] Oscar H. Ibarra. Simple matrix languages.Inform. and Control, 17(4):359–394, 1970.

[9] A. Meduna. Simultaneously one-turn two-pushdown automata. Int. J. Comp. Math., 80:679–687, 2003.

[10] A. Meduna. Deep pushdown automata.Acta Inform., 42(8–9):541–552, 2006.

[11] A. Meduna and T. Masopust. Self-regulating finite automata.Acta Cybernet., 18:135–

153, 2007.

[12] J. Sakarovitch. Pushdown automata with terminating languages. Languages and Au- tomata Symposium, RIMS 421, Kyoto University, pages 15–29, 1981.

[13] A. Salomaa.Formal languages. Academic Press, New York, 1973.

[14] R. Siromoney. Finite-turn checking automata. J. Comput. System Sci., 5:549–559, 1971.

[15] L. Valiant. The equivalence problem for deterministic finite turn pushdown automata.

Inform. and Control, 81:265–279, 1989.

[16] D. Wood.m-paralleln-right linear simple matrix languages.Util. Math., 8:3–28, 1975.

Referenzen

ÄHNLICHE DOKUMENTE

Before looking at the problem of deciding inclusion of the languages accepted by two tree automata and its generalization to the weighted case, we will motivate our interest in

Before looking at the problem of deciding inclusion of the languages accepted by two tree automata and its generalization to the weighted case, we will motivate our interest in

Specifically, given a control language R, an R-sPDA is a pushdown automaton which has a special set of distinguished states (so-called checking states) in which the machine makes

There the automata are given a control language over the alphabet of pushdown symbols, and an input string is accepted whenever the pushdown automaton accepts it by a computation

For this purpose, standard reasoning tasks like deciding emptiness or complementing automata over finite or infinite words have been generalized to the weighted setting, and

In this paper, we discussed two variants of pure multi-pushdown automata that perform complete pushdown pops and proved two infinite language hierarchies they characterize with

Similarly, we prove that n-turn all-move self-regulating finite automata give rise to an infinite hierarchy of language families coinciding with the hierarchy resulting from (n

By characterizing tense in TACs as a relative tense that takes the matrix event time as its evaluation time, Ogihara's relative tense hypothesis accounts for the restrictions on