accepting array grammars with control mechanisms

24

Upload: uni-trier

Post on 15-Nov-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

ACCEPTING ARRAY GRAMMARSWITH CONTROL MECHANISMSHenning FERNAU Rudolf FREUNDWilhelm-Schickard-Institut f�ur Informatik, Institut f�ur Computersprachen,Universit�at T�ubingen, Technische Universit�at Wien,Sand13, D-72076 T�ubingen, Germany Resselgasse3, A-1040 Wien, AustriaAbstract. We consider (n-dimensional) array grammars in the accept-ing mode with various control mechanisms and compare these familiesof array grammars with the corresponding families obtained by arraygrammars in the generating mode.1 IntroductionAccepting grammars together with various control mechanisms were introducedin [1] for the string case. Recent ideas concerning these grammars were exposedin [2]. The main results of the paper concern the relations between the familiesof array languages obtained by accepting array grammars in this way and arraylanguages described by the corresponding types of generating array grammars.Compared with the string case, we �nd many similarities, e.g., acceptingprogrammed array grammars without appearance checking are just as powerfulas their generating counterparts, and accepting ordered grammars can describeevery recursively enumerable array language. On the other hand, the family ofaccepting regular programmed two-dimensional array languages with uncondi-tional transfer is incomparable with the corresponding family of generating reg-ular programmed array languages, while the respective string language classescoincide. Moreover, such incomparability results have not been observed in thestring case except for pure grammars [3].2 De�nitions and examplesIn the main part of this section, we will introduce the de�nitions and notationsfor arrays and sequential array grammars [5,11,14,17,19] and give some explana-tory examples, but �rst we recall some basic notions from the theory of formallanguages (for more details, the reader is referred to [18]).De�nition 2.1. For an alphabet V , by V � we denote the free monoid generatedby V under the operation of concatenation; the empty string is denoted by �,and V � n f�g is denoted by V +. Any subset of V + is called a �-free (string)language.A (string) grammar is a quadruple G = (VN ; VT ; P; S) ; where VN and VT are�nite sets of non-terminal and terminal symbols, respectively, with VN \VT = ;;P is a �nite set of productions � ! � with � 2 V + and � 2 V �; where V =

VN [ VT ; and S 2 VN is the start symbol. For x; y 2 V � we say that y is directlyderivable from x in G, denoted by x `G y, if and only if for some �! � in P andu; v 2 V � we get x = u�v and y = u�v. Denoting the re exive and transitiveclosure of the derivation relation `G by `�G, the (string) language generated byG is L(G) = fw 2 V �T j S `�G wg :The families of �-free (string) languages generated by arbitrary, monotonic,context-free, respectively regular grammars are denoted by L (enum) ; L (mon) ;L (cf) ; respectively L (reg) :The following relations are known as the Chomsky-hierarchy [18]: L (reg) $ L (cf) $ L (mon) $ L (enum) :De�nition 2.2. Let Z denote the set of integers, let N denote the set of pos-itive integers, N = f1; 2; :::g, and let n 2 N: Then an n-dimensional arrayA over an alphabet V is a function A : Zn ! V [ f#g ; where shape(A) =fv 2 Zn j A (v) 6= #g is �nite and # =2 V is called the background or blank sym-bol. We usually shall write A = f(v;A(v)) j v 2 shape(A)g :The set of all n-dimensional arrays over V shall be denoted by V �n: Theempty array in V �n with empty shape shall be denoted by �n. Moreover, wede�ne V +n = V �n n f�ng : Any subset of V +n is called a �-free n-dimensionalarray language.De�nition 2.3. Let v 2 Zn. Then the translation �v : Zn ! Zn is de�ned by�v(w) = w + v for all w 2 Zn, and for any array A 2 V �n we de�ne �v(A), thecorresponding n-dimensional array translated by v, by(�v (A)) (w) = A (w � v) for all w 2 Zn:The vector (0; : : : ; 0) 2 Zn is denoted by n, while (1; : : : ; 1) is denoted by En.Usually [5,17,19,20], arrays are regarded as equivalence classes of arrays withrespect to linear translations, i.e. only the relative positions of the symbols 6= #in the plane are taken into account: The equivalence class [A] of an array A 2 V �nis de�ned by [A] = fB 2 V �n j B = �v (A) for some v 2 Zng :The set of all equivalence classes of n-dimensional arrays over V with respectto linear translations shall be denoted by [V �n] etc. Most of the results elaboratedin this paper immediately carry over from the families of array languages weconsider to the corresponding families of array languages with respect to lineartranslations, therefore, in general we shall not consider these families of arraylanguages with respect to linear translations explicitely in the following anymore.In order to be able to de�ne the notion of connectedness of n-dimensionalarrays, we need the following de�nitions:De�nition 2.4. An (undirected) graph g is an ordered pair (K;E), where K isa �nite set of nodes and E is a set of undirected edges fx; yg with x; y 2 K: Asequence of di�erent nodes x0; x1; : : : ; xm; m 2 N , is called a path of length m ing with the starting-point x0 and the ending-point xm, if for all i with 1 � i � man edge fxi�1; xig in E exists. A graph g is said to be connected, if for any twonodes x; y 2 K; x 6= y, a path in g with starting point x and ending point y

exists. Observe that a graph (fxg ; ;) with only one node and an empty set ofedges is connected, too.Let W be a non-empty �nite subset of Zn. For any k 2 N [ f0g ; a graphgk (W ) = (W;Ek) can be assigned to W such that Ek for v; w 2 W containsthe edge fv; wg if and only if 0 < kv �wk � k; where the norm kuk of a vectoru 2 Zn; u = (u (1) ; : : : ; u (n)) ; is de�ned by kuk = maxfju (i)j j 1 � i � ng :Then, W is said to be k-connected if gk (W ) is a connected graph. Observethat W is 0-connected if and only if card (W ) = 1; where card (W ) denotes thenumber of elements in the set W:Now let V be a �nite alphabet and A an n-dimensional array over V; A 6=�n. Then A is said to be k-connected if gk (shape (A)) is a connected graph.Obviously, if A is k-connected then A is m-connected for all m > k; too. Thenorm of A is the smallest number k 2 N [ f0g such that A is k-connected, andis denoted by kAk : Observe that kAk = 0 if and only if card (shape (A)) = 1:Example 2.1. The n-dimensional array E (n; k) = f(n; a) ; (kEn; a)g 2 fag�nis m-connected only for every m � k, and therefore kE (n; k)k = k: 2De�nition 2.5. An n-dimensional generating array production p over V is atriple (W;A1;A2) ; where W � Zn is a �nite set and A1 and A2 are mappingsfrom W to V [ f#g ; p is called �-free if shape (A2) 6= ;; where we de�neshape (Ai) = fv 2W j Ai (v) 6= #g ; 1 � i � 2: The norm of the n-dimensionalarray production (W;A1;A2) is de�ned by k(W;A1;A2)k = maxfkvk j v 2Wg :We say that the array C2 2 V �n is directly derivable from the array C1 2 V �nby the n-dimensional array production (W;A1;A2) if and only if there existsa vector v 2 Zn such that C1 (w) = C2 (w) for all w 2 Zn n �v (W ) as well asC1 (w) = A1 (��v (w)) and C2 (w) = A2 (��v (w)) for all w 2 �v (W ) ; i.e. thesubarray of C1 corresponding to A1 is replaced by A2, thus yielding C2; we alsowrite C1 `p C2:As can already be seen from the de�nitions of an n-dimensional array produc-tion, the conditions for an application to an n-dimensional array B and the resultof an application to B, an n-dimensional array production (W;A1;A2) is a repre-sentative for the in�nite set of equivalent n-dimensional array productions of theform (�v (W ) ; �v (A1) ; �v (A2)) with v 2 Zn: Hence, without loss of generality, inthe sequel we shall assume n 2W as well as A1 (n) 6= #: Moreover, we oftenwill omit the set W; because it is uniquely reconstructible from the descriptionof the two mappings A1 and A2 by Ai = f(v;Ai (v)) j v 2 Wg ; 1 � i � 2: Thusin the sequel we will represent the n-dimensional array production (W;A1;A2)also by writing A1 !A2; i.e. f(v;A1 (v)) j v 2 Wg ! f(v;A2 (v)) j v 2Wg :De�nition 2.6. An n-dimensional (generating) array grammar is a quintupleG = (n; VN ; VT ;#; P; f(v0; S)g) ;where VN is the alphabet of non-terminal symbols, VT is the alphabet of terminalsymbols, VN \VT = ;; # =2 VN [VT ; P is a �nite non-empty set of n-dimensionalarray productions over VN [ VT and f(v0; S)g is the start array (axiom), v0 is

the start vector, and S is the start symbol. G is called �-free if every productionin P is �-free.We say that the array B2 2 V �n is directly derivable from the array B1 2 V �nin G, denoted B1 `G B2, if and only if there exists an n-dimensional array pro-duction p = (W;A1;A2) in P such that B1 `p B2: Let `�G be the re exive tran-sitive closure of `G. Then the (n-dimensional) array language generated by G,Lgen (G) ; is de�ned by Lgen (G) = fA j A 2 V �nT ; f(v0; S)g `�G Ag : The normof the n-dimensional array grammar G is de�ned by kGk = maxfkpk j p 2 Pg :An n-dimensional generating array production p = (W;A1;A2) in P is called{ monotonic, if shape (A1) � shape (A2) ;{ strictly monotonic, if shape (A2) = W and kpk = 1;{ #-context-free, if card (shape (A1)) = 1;{ context-free, if p is monotonic, card (shape (A1)) = 1, and A1 (n) 2 VN ;the condition A1 (n) 2 VN allows the representation of a context-free ar-ray production as (A; f(v;A2 (v)) j v 2Wg) or A ! f(v;A2 (v)) j v 2Wginstead of (W; f(n; A)g [ f(v;#) j v 2W n fngg ; f(v;A2 (v)) j v 2Wg) ;if card (W ) = 1; we only write A!A2 (n) ;{ strictly context-free, if p is strictly monotonic as well as context-free;{ regular, if either1. W = fn; vg for some v 2 Un;where Un = f(i1; : : : ; in) jPnk=1 jikj = 1g ; and A1 = f(n; B) ; (v;#)g ;A2 = f(n; a) ; (v; C)g ; with B;C 2 VN and a 2 VT ;(we also write Bv# ! avC), or2. W = fng ; A1 = f(n; B)g ; A2 = f(n; a)g ; with B 2 VN and a 2 VT(we also write B ! a).G is called an n-dimensional array grammar of type (gen;X) ; X 2fenum; #� cf; mon; smon; cf; scf; regg ; if every array production in P isof the corresponding type, i.e. a generating arbitrary (gen; enum), #-context-free(gen;#� cf), monotonic (gen;mon), strictly monotonic (gen; smon), context-free (gen; cf), strictly context-free (gen; scf), respectively regular (gen; reg) n-dimensional (generating) array production; the corresponding families of �-freen-dimensional array languages are denoted by L (n; (gen;X)) : If for two types(gen;X), (gen; Y ) with X;Y 2 fenum; #� cf; mon; smon; cf; scf; reggevery array production of type (gen;X) is also an array production of type(gen; Y ) ; we write (gen;X) � (gen; Y ) or even X � Y:Remark 2.1. Let G = (n; VN ; VT ;#; P; f(v0; S)g) be an n-dimensional (gener-ating) array grammar. If G is regular, strictly context-free, respectively strictlymonotonic, then according to the previous de�nition of regular, strictly context-free, and strictly monotonic n-dimensional generating array productions we im-mediately see that every array in Lgen (G) must be 1-connected. If G is context-free or monotonic, then kAk � kGk for all A 2 Lgen (G) : In the case of ar-bitrary n-dimensional array grammars, additional restrictive conditions on then-dimensional array productions in P are required in order to guarantee every

n-dimensional array in Lgen (G) to be kGk-connected or even to be 1-connectedas it is often required in the literature [5,17,19,20]. In the following, we alsoconsider the case of monotonic n-dimensional generating array grammars withnorm 1 and denote the corresponding family of array languages generated bysuch array grammars by L (n; (gen;mon1)) :Like in the string case, some of the families of array languages de�ned aboveform a strict hierarchy (compare with the results stated in [11,12,14]).Proposition 2.1. (Chomsky-Hierarchy of array languages) For all n 2 N ,L (n; (gen; reg)) $ L (n; (gen; scf)) $ L (n; (gen;mon)) $ L (n; (gen; enum)) :Obviously, the inclusionsL (n; (gen; scf)) $ L (n; (gen; smon)) and L (n; (gen; cf)) $ L (n; (gen;mon))are true, too, whereas the families L (n; (gen; cf)) and L (n; (gen; smon)) areincomparable. Furthermore, we have the inclusionsL (n; (gen; cf)) $ L (n; (gen;#� cf)) $ L (n; (gen; enum)) ;whereas L (n; (gen;#� cf)) and L (n; (gen;mon)) are incomparable.An interesting feature of n-dimensional (generating) array grammars is thefact that even regular and context-free array productions make use of some spe-cial context, namely the context of blank symbols #. This #-sensing ability(which is reduced to a minimum in the case of strictly context-free respectivelystrictly monotonic array grammars in contrast to context-free respectively mono-tonic array grammars) induces a relatively high generating power even of onlyregular two-dimensional-dimenensional array grammars and yields some ratherastonishing results, e.g. the set of all solid squares can be generated by a regulartwo-dimensional array grammar [20].As many results for n-dimensional arrays for a special n can be taken overimmediately for higher dimensions, we introduce the following notion:De�nition 2.7. Let n;m 2 N with n � m: For n < m; the natural embeddingin;m : Zn ! Zm is de�ned by in;m (v) = (v;m�n) for all v 2 Zn; for n = m wede�ne in;n : Zn ! Zn by in;n(v) = v for all v 2 Zn: To an n-dimensional arrayA 2 V +n with A = f(v;A (v)) j v 2 shape (A)g we assign the m-dimensionalarray in;m (A) = f(in;m (v) ;A (v)) j v 2 shape (A)g :3 Accepting array grammars: de�nitions and examplesFirst we introduce the concept of accepting array productions and grammars:De�nition 3.1. An n-dimensional accepting array production p over V is atriple (W;A2;A1) ; where W � Zn is a �nite set and A1 and A2 are mappingsfrom W to V [ f#g ; p is called �-free if shape (A2) 6= ;. We say that thearray C1 2 V �n is directly derivable (reducible) from the array C2 2 V �n by

the n-dimensional accepting array production (W;A2;A1) if and only if thereexists a vector v 2 Zn such that C1 (w) = C2 (w) for all w 2 Zn n �v (W ) aswell as C2 (w) = A2 (��v (w)) and C1 (w) = A1 (��v (w)) for all w 2 �v (W ) ; i.e.the subarray of C2 corresponding to A2 is replaced by A1, thus yielding C1; wealso write C2 `p C1: For short, if (W;A1;A2) is a generating array production,then (W;A2;A1) is the corresponding (dual) accepting array production; for theaccepting array production (W;A2;A1) the dual generating array production is(W;A1;A2).An n-dimensional accepting array grammar is a constructG = (n; VN ; VT ;#; P; f(v0; S)g) ;where VN is the alphabet of non-terminal symbols, VT is the alphabet of terminalsymbols, VN \VT = ;; # =2 VN [VT ; P is a �nite non-empty set of n-dimensionalaccepting array productions over VN [VT ; and f(v0; S)g is the �nal array (goal).G is called �-free if every production in P is �-free.We say that the array B1 2 V �n is directly derivable from the array B2 2 V �nin G, denoted B2 `G B1, if and only if there exists an n-dimensional acceptingarray production p = (W;A2;A1) in P such that B2 `p B1: Let `�G be the re ex-ive transitive closure of `G. Then the (n-dimensional) array language acceptedby G, Lacc (G) ; is de�ned by Lacc (G) = fA j A 2 V �nT ; A `�G f(v0; S)gg :For any X 2 fenum; #� cf; mon; smon; cf; scf; regg the accepting arrayproduction (W;A2;A1) is said to be of type (acc;X) ; if the dual generatingarray production (W;A1;A2) is of type (gen;X) : G is called to be of type(acc;X) ; if every accepting array production in P is of the corresponding type.The corresponding families of �-free n-dimensional array languages are denotedby L (n; (acc;X)) :For any n-dimensional (generating respectively accepting) array grammarG = (n; VN ; VT ;#; P; f(v0; S)g) ; the corresponding dual n-dimensional (accept-ing respectively generating) array grammar Gd = �n; VN ; VT ;#; P d; f(v0; S)g�is de�ned by P d = f(W;A2;A1) j (W;A1;A2) 2 Pg :The following result is obvious from our de�nitions:Lemma 3.1. If G is a generating (accepting, respectively) array grammarand Gd is its dual accepting (generating, respectively) array grammar, thenLgen (G) = Lacc �Gd� (and Lacc (G) = Lgen �Gd�, respectively). Hence, for ev-ery n 2 N and for every X 2 fenum; # � cf; mon; smon; cf; scf; regg weobtain L (n; (acc;X)) = L (n; (gen;X)) :Therefore, as in the string case we can also use the notation L (n;X) for bothL (n; (acc;X)) and L (n; (gen;X)) : We shall also omit the subscripts gen andacc, respectively, in Lgen (G) and Lacc (G) ; respectively, if the derivation modeis clear from the context.

4 Control mechanisms on array grammarsIn the following, we give the necessary de�nitions of ordered and programmed(graph controlled) array grammars and languages in the generating as well asin the accepting case. For detailed informations concerning these control mecha-nisms as well as many other interesting results about regulated rewriting in thetheory of string languages, the reader is referred to [6].De�nition 4.1. An ordered (string) grammar is a constructGO = (VN ; VT ; (P;<) ; S) ;where VN and VT are disjoint alphabets of non-terminal respectively terminalsymbols, S 2 VN is the start symbol, P is a �nite set of (string) productions overVN [ VT ; and < is a partial order relation on the productions in P: For v; w 2(VN [ VT )� we de�ne v `GO w if and only if there exists a production p 2 P suchthat w is the result of the application of p to v; whereas no other productionq 2 P with q > p is applicable to v: With `�GO denoting the re exive andtransitive closure of the derivation relation `GO the string language generatedby GO is Lgen(GO) = �w 2 V �T j S `�GO w :A programmed (string) grammar (or graph controlled (string) grammar)with appearance checking is a construct GP = (VN ; VT ; (R;Li; Lf ) ; S) ; VNand VT are disjoint alphabets of non-terminal and terminal symbols, respec-tively; S 2 VN is the start symbol; R is a �nite set of rules r of the form(l (r) : p (l (r)) ; � (l (r)) ; ' (l (r))) ; where l (r) 2 Lab (GP ) ; Lab (GP ) being aset of labels associated (in a one-to-one manner) to the rules r in R; p (l (r))is a string production over VN [ VT ; � (l (r)) � Lab (GP ) is the success �eldof the rule r; and ' (l (r)) is the failure �eld of the rule r; Li � Lab (GP )is the set of initial labels, and Lf � Lab (GP ) is the set of �nal labels.For r = (l(r) : p (l (r)) ; � (l (r)) ; ' (l (r))) and v; w 2 (VN [ VT )� we de�ne(v; l (r)) `GP (w; k) if and only if{ either p (l (r)) is applicable to v; the result of the application of the produc-tion p(l(r)) to v is w; and k 2 � (l (r)) ;{ or p (l (r)) is not applicable to v; w = v; and k 2 ' (l (r)) :The (string) language generated by GP isL (GP ) = fw 2 V �T j (S; l0) `GP (w1; l1) `GP : : : (wk; lk) ; k � 1;wj 2 (VN [ VT )� and lj 2 Lab (GP ) for 0 � j � k;wk = w; l0 2 Li; lk 2 Lfg :If the failure �elds ' (l (r)) are empty for all r 2 R; then GP is called a pro-grammed grammar without appearance checking. If ' (l (r)) = � (l (r)) for allr 2 R; then GP is called a programmed grammar with unconditional transfer.An ordered (string) grammar, or a programmed (string) grammar, respec-tively, is said to be of type enum; mon; cf; cf � �; or reg; respectively, ifevery production appearing in this grammar is of the corresponding type, i.e.

an arbitrary, monotonic, context-free, �-free context-free, respectively regularproduction. For the types X 2 fenum, mon, cf , cf � �, regg ; byL (gen;X) ; O (gen;X) ; Pac (gen;X) ; Put (gen;X) ; P (gen;X) ;we denote the �-free (string) languages generated by grammars of type Xand ordered grammars, programmed grammars with appearance checking, pro-grammed grammars with unconditional transfer, and programmed grammarswithout appearance checking, respectively, of type X:In the following we list some of the most important results known [6,8,9,15]for the control mechanisms de�ned above (for the sake of conciseness, we useU (X) instead of U (gen;X)):{ L (X) = Y (X) for X 2 freg, mon, enumg and Y 2 fO;Pac; Put; Pg ;{ L (cf � �) $ P (cf � �) $ Pac (cf � �) $ L (mon) ;{ L (cf � �) $ Put (cf � �) � Pac (cf � �) $ L (mon) ;{ P (cf � �) � P (cf) $ Pac (cf) = L (enum) ;{ O (cf � �) $ Put (cf � �) $ Put (cf) � Pac (cf) = L (enum) ;{ L (cf � �) = L (cf) $ O (cf � �) � O (cf) $ Put (cf) � L (enum) :The de�nitions of ordered grammars and graph controlled grammars can im-mediately be taken over for accepting (string) grammars as well as for generatingand accepting array grammars by taking accepting string productions or gener-ating and accepting array productions, respectively, instead of generating stringproductions in the de�nitions given above, e.g. an ordered array grammar is aconstruct G = (n; VN ; VT ;#; (P;<) ; f(v0; S)g) ; where VN ; VT ; P; and f(v0; S)gare de�ned as for an array grammar and < is a partial order relation on thearray productions in P etc.An ordered array grammar (generating or accepting, respectively) or a graphcontrolled array grammar (generating or accepting, respectively) is said to beof type X if every array production appearing in this grammar is of the corre-sponding type X, too.De�nition 4.2. For every X 2 fenum; #� cf; mon; smon; cf; scf; regg andevery � 2 fgen; accg ; by L (n; (�;X) ; O) ; L (n; (�;X) ; P ) ; L (n; (�;X) ; Put) ;L (n; (�;X) ; Pac) we denote the �-free array languages described by ordered ar-ray grammars, programmed array grammars without appearance checking, pro-grammed array grammars with unconditional transfer, and programmed arraygrammars with appearance checking, respectively, of type (�;X) :In the following we give some examples elucidating the control mechanismsde�ned above.Example 4.1. According to [20], the set RH of hollow rectangles of thickness oneover the one-letter alphabet fag (with the left lower corner lying in the origin)cannot be generated by a context-free array grammar. Yet the following regular

ordered array grammar G can generate RH ; i.e. RH 2 L (2; (gen; reg) ; O) :G = (2; fS;A;B;C;D;E; F;Qg; fag ;#; (P;<) ; f((0; 1) ; S)g) ;P = �#S ! Aa ; #A ! Aa ; A#! aB; B#! aB; B#! aC; C# ! aD ;D# ! aD ; D# ! aE ; #E ! Ea; #E ! Fa; #F ! Qa ; F ! a� :The order relation < only consists of F ! a < #F ! Qa ; which guaranteesthat F ! a is only applied when no blank symbol appears above the non-terminal symbol F; or otherwise the (forced) application of #F ! Qa introducesthe trap symbol Q:The derivation of a rectangle of side lengths n and m; n;m � 3; proceeds asfollows: The left vertical line of the hollow rectangle is generated by �rst usingthe rule #S ! Aa and then using n � 3 times the rule #A ! Aa : After applyingthe rule A# ! aB; the upper horizontal line of the rectangle is generated byusing m � 3 times the rule B# ! aB: The generation of the right vertical lineof the rectangle starts with applications of the array productions B#! aC andC# ! aD ; whereafter we can proceed with repeated applications of D# ! aD : Byapplying D# ! aE the generation of the lower horizontal line is started, whichproceeds by repeatedly applying #E ! Ea: After the application of #E ! Fathe �nal array production F ! a can only be applied, if with the non-terminalF we have arrived exactly below the starting point of our derivation; otherwisethe trap symbol Q is introduced by the application of #F ! Qa ; which is forcedby the order relation < : Hence, we concludeL (G) = ff((0; j) ; a) ; ((i; n� 1) ; a) ; ((m � 1; j + 1) ; a) ; ((i+ 1; 0) ; a) j0 � j � n� 2; 0 � i � m� 2g j n � 3; m � 3g = RH : 2For the generation of the set SH of hollow squares with the left lower cornerpositioned in the origin (see [14]) regular array productions are not su�cient,i.e. SH can only be generated by a context-free graph controlled array grammarwith appearance checking:Example 4.2. We consider the context-free graph controlled array grammarG = (2; fS; U;R;D;L;Qg ; fag ; (R; f0g ; f0g) ; f((0; 0) ; S)g) (with appearancechecking), where P contains the labelled rules listed in Figure 1. After usingthe initial rule 0, the generation of the hollow square of side length n � 3 pro-ceeds as follows: By repeatedly using rules 1 and 2 in a loop, the left vertical line

0 : #S # ! Ua R ; f1g ; ;!; 1 : #U ! Ua ; f2g ; ;!;�2 : R# ! aR; f1; 3g ; ;�; 3 : # #U ! a Da ; f4g ; ;!;�4 : R# ! aL; f5g ; ;�; �5 : D# ! aD; f6; 7g ; ;�; 6 : #L ! La ; f5g ; ;!; 7 : #L ! QL ; ;; f8g!;�8 : L! a; f9g ; ;�; �9 : D! a; f0g ; ;�:Fig. 1. The rule set belonging to Example 4.2and the lower horizontal line grow in a synchronized manner. After the applica-tion of the sequence 3 and 4, the upper horizontal line and the right vertical lineare grown in a synchronized manner by using the array productions 5 and 6 in aloop. Only if L has arrived just below D; the array production 7 can be skippedin the appearance checking mode without introducing the trap symbolQ, where-after the derivation is �nished by using the sequence of array productions 8 and9. Hence, we concludeL (G) = ff((0; i) ; a) ; ((i; n� 1) ; a) ; ((n� 1; i+ 1) ; a) ; ((i+ 1; 0) ; a) j0 � i � n� 2g j n � 3g = SH ;and therefore SH 2 L (2; (gen; scf) ; Pac) :By replacing empty success or failure �elds, respectively, in the rules aboveby the corresponding non-empty failure and success �elds, respectively, we im-mediately obtain a graph controlled array grammar with unconditional transfergenerating the same array language, i.e. SH 2 L (2; (gen; scf) ; Put) ; too. 2The previous two examples reveal an important di�erence between the ap-plicability of a context-free string production to an underlying string and theapplicability of a context-free array production to an underlying array: Whereasa context-free string production A! w is applicable to the underlying string ifand only if the non-terminal symbol A appears in this string, the applicabilityof a context-free array production (W;A1;A2) with A1 (n) = A to an under-lying array not only depends on the occurrence of the non-terminal symbol Ain the underlying array, but also on the "availability" of blank symbols in theneighbourhood of A on the relative positions v 2 W n fng : This #-sensingability is the basis of the some results proved in [14], i.e. in contrast to the stringcase, even #-context-free ordered array grammars can generate any recursivelyenumerable �-free array language.The following results directly follow from the de�nitions:Lemma 4.1. For all n 2 N; for all derivation modes � 2 fgen; accg ; and for alltypes X;Y 2 fenum;#�cf; mon; smon; cf; scf; regg withX � Y; as well as for

all control types U 2 fP; Put; Pac; Og we have L (n; (�;X) ; U ) � L (n; (�; Y ) ; U ) :Lemma 4.2. For all n 2 N; for all derivation modes � 2 fgen; accg ; and for alltypes X 2 fenum; #� cf; mon; smon; cf; scf; regg we haveL (n; (�;X)) � L (n; (�;X) ; P ) � L (n; (�;X) ; Pac) ;L (n; (�;X)) � L (n; (�;X) ; Put) � L (n; (�;X) ; Pac)as well as L (n; (�;X)) � L (n; (�;X) ; O) :Lemma 4.3. For every n 2 N and for every X 2 fenum; #� cf; mon; smon;cf; scf; regg; we have L (n; (gen;X) ; O) � L (n; (gen;X) ; Put) :Proof. Let G = (n; VN ; VT ;#; (R;<) ; f(v0; S)g) be an ordered generating arraygrammar of type X; and let Lab be the set of unique labels for the rules in R. Weconstruct an equivalent graph controlled generating array grammar with uncon-ditional transfer of type X; G0 = (n; VN [ fFg ; VT ;#; (R0; Lab; Lab) ; f(v0; S)g) ;in the following way: For each labelled rule r : (W;A1;A2) fromR; r 2 Lab; withF (r) = f(r; i) j 1 � i � k (r)g denoting the set of labels of the rules pr;i greaterthan r with respect to the order relation <; in R0 we take�(r; i) : pr;i; f(r; i+ 1)g ; f(r; i+ 1)g� for 1� i � k (r) and((r; k (r) + 1) : (W;A1;A2) ; Lab; Lab) ;where we identify the labels (r; 1) and r:For any generating array production p in R; p = (W;A1;A2) ; the cor-responding failure production p is de�ned by p = (W;A1; FW ), whereFW = f(v; F ) j v 2Wg : Such a failure production p therefore introduces thetrap symbol F whenever it cannot be skipped in the sequence controlling theapplication of an array production from R:In the regular case, for the rules of the form r : A ! a and of the formr : Av# ! avB; respectively, we need a slight modi�cation of the constructiongiven above: If the set F (r) contains a label identifying a production of theform A ! b we simply can forget about the rule r: Otherwise, we only have tocheck the applicability of the rules greater than r of the form Au#! CuD; andtherefore we can exclude all labels belonging to productions being not of thisform Au#! CuD from F (r) and then proceed as above with this reduced setof labels of productions greater than r. The corresponding failure production pfor p = Cu#! cuD is de�ned by p = Cu#! cuF: 2Lemma 4.4. For every n 2 N and for every X 2 fenum; #� cf; mon; smon;cf; scf; regg; we have L (n; (acc;X) ; O) � Lacc (n; (acc;X) ; Put) :Proof. Let G = (n; VN ; VT ;#; (R;<) ; f(v0; S)g) be an ordered accepting arraygrammar of type X; and let Lab be the set of unique labels for the rules in R. Weconstruct an equivalent graph controlled accepting array grammar with uncon-ditional transfer of type X; G0 = (n; VN [ fFg ; VT ;#; (R0; Lab; Lab) ; f(v0; S)g) ;in the following way: For each labelled rule r : (W;A1;A2) from R with

F (r) = f(r; i) j 1 � i � k (r)g denoting the set of labels of the rules pr;i greaterthan r with respect to the order relation <; in R0 we again take�(r; i) : pr;i; f(r; i+ 1)g ; f(r; i+ 1)g� for 1 � i � k (r) and((r; k (r) + 1) : (W;A1;A2) ; Lab; Lab) ;where we identify the labels (r; 1) and r:For any accepting array production in R; p = (W;A1;A2), the corre-sponding failure production p now is de�ned by p = �W;A1;AF2 �, whereAF2 = f(n; F )g[ f(v;A2 (v)) j v 2 (W n fng)g ; i.e. at the position n; whichis always occupied by a non-blank symbol, the trap symbol F is introducedinstead of the original symbol A2 (n) in case the production p has to beapplied. 2Observe that in the accepting case, the proof also works for the regular arraygrammars.As in the string case (see [1], [2]), it is easy to see that generating andaccepting programmed array grammars without appearance checking describethe same family of languages. Hence, we �nd:Lemma 4.5. For every n 2 N and for every X 2 fenum; #� cf; mon; smon;cf; scf; regg; we have L (n; (gen;X) ; P ) = L (n; (acc;X) ; P ) :Proof. The results directly follow from the duality of generating and acceptingarray productions, respectively, and the corresponding derivation mechanisms:Let G = (n; VN ; VT ;#; (R;Li; Lf ) ; f(v0; S)g) be a graph controlled gen-erating array grammar of type X without appearance checking. Then wecan construct a graph controlled accepting array grammar of type X with-out appearance checking Gd = �n; VN [ fFg ; VT ;#;�Rd; Ldi ; Ldf� ; f(v0; S)g� ;where F is a new non-terminal symbol =2 VN [ VT [ f#g : We take a newaccepting (regular) array production a ! F and assign a new label f toit, i.e. Rd contains (f : a! F; ;; ;) : Moreover, we de�ne Ldf = ffg andLdi = fs j r 2 � (s) for some r 2 Lfg : For (r : (W;A1;A2) ; � (r) ; ;) in R wetake �r : (W;A2;A1) ; ��1 (r) ; ;� into Rd; the set ��1 (r) is de�ned by ��1 (r) =fs j r 2 � (s)g for r =2 Li and ��1 (r) = fs j r 2 � (s)g [ ffg for r 2 Li: Hence,to every (generating) derivation in G;(f(v0; S)g ; r0) `G ::: (Bm�1; rm�1) `G (Bm; rm)of a terminal array Bm 2 V +nT with r0 2 Li and rm 2 Lf there corresponds the(accepting) derivation in Gd(Bm; rm�1) `Gd (Bm�1; rm�2) `Gd ::: (B1; r0) `Gd (f(v0; S)g ; f) :A similar construction allows us to build up a graph controlled generating ar-ray grammar of type X without appearance checking for a given graph controlledaccepting array grammar of type X without appearance checking. 2In the string case, the analogue of the following result (with the same ideaof a purely structural proof) has been shown in [3].

Lemma 4.6. For every n 2 N and for every X 2 fenum; #� cf; mon; cfg,L (n; (gen;X) ; Pac) � L (n; (acc;X) ; Pac) :Proof. Let G = (n; VN ; VT ;#; (R;Li; Lf ) ; f(v0; S)g) be a graph controlled gen-erating array grammar of type X. Then we can construct a graph controlledaccepting array grammar of type XGd = �n; VN [ fFg ; VT ;#; �Rd; Ldi ; Ldf� ; f(v0; S)g� ;Rd = R0 [R00; Ldi = fs0; s00 j r 2 � (s) for some r 2 Lfg ; Ldf = ff 0; f 00g ;where for (r : (W;A1;A2) ; � (r) ; ' (r)) in R we take�r0 : (W;A2;A1) ; ���1 (r)�0 [ �'�1 (r)�00 ; ;� into R0 and�r00 : (W;A1;A1) ; ;; ���1 (r)�0 [ �'�1 (r)�00� into R00;moreover, we take (f 0 : F ! F; ;; ;) into R0 and (f 00 : F ! F; ;; ;) into R00; thesets ��1 (r) ; ' �1 (r) are de�ned by��1 (r) = fs j r 2 � (s)g and '�1 (r) = fs j r 2 ' (s)g for r =2 Li and��1 (r) = fs j r 2 � (s)g [ ffg and '�1 (r) = fs j r 2 ' (s)g [ ffg for r 2 Li:For any set of labels L we de�ne L0 = fs0 j s 2 Lg ; L00 = fs00 j s 2 Lg :With the accepting array productions assigned to primed labels we simu-late the dual generating array production in the reverse direction, whereas whenchoosing a rule with a doubly primed label we can only proceed (without chang-ing the current array) if the corresponding generating array production couldnot be applied. 2Observe that the proof method used in the proof of the preceding lemma doesnot work for the types smon; scf; and reg; because the productions (W;A1;A1)we use are not of the desired type.In the regular case, the families of array languages L (n; (gen; reg) ; O) andL (n; (acc; reg) ; Pac) as well as L (n; (gen; reg) ; Pac) and L (n; (acc; reg) ; O) areeven incomparable for each n � 2; which we shall prove next.Lemma 4.7. For each n � 2;i2;n (RH) 2 L (n; (gen; reg) ; O) n (L (n; (acc; reg) ; Pac) [ L (n; scf)) :Proof. According to Example 4.1, i2;n (RH) 2 L (n; (gen; reg) ; O) ; because byreplacing every vector v occurring in the two-dimensional ordered array grammarthere by the corresponding n-dimensional vector i2;n (v) we immediately obtainan n-dimensional ordered array grammar generating i2;n (RH).On the other hand, no n-dimensional accepting graph controlled array gram-mar with appearance checking can exist that describes i2;n (RH) :After the �rst derivation step the underlying array contains exactly one non-terminal symbol. The rectangle is cut at some position, yet with accepting array

productions we cannot check the closure of the line to both directions from thisstarting position, hence if we proceed in one direction from the starting point,even the control mechanism of programming cannot guarantee that we close theline at the end of the analysing procedure. A usual pumping argument shows thatthe last of the four lines of the rectangle need not be analysed in total, whichwould allow the acceptance of arrays not in RH ; the details of this pumpingargument are left to the reader.As we proceed along a single line when analysing a rectangle, even by usingstrictly context-free accepting array productions we can follow the argumenta-tion in the preceding lines and conclude RH =2 L (2; (acc; scf)) : 2On the other hand, the arguments used in the previous proof do not carryover to ordered array grammars with regular accepting array productions as wellas array productions of the formf((0; 0) ; A) ; (v;#)g ! f((0; 0) ; B) ; (v;#)gfor some v 2 Z2 with kvk = 1; i.e. the construction in the following exampleusing only one rule of this special form already allows us to generate RH :Example 4.3. The set RH of hollow rectangles of thickness one over the one-letter alphabet fag (with the left lower corner lying in the origin) can be de-scribed by the following context-free ordered accepting array grammar G :G = (2; fS;A;B;C;D;E; F;Qg ; fag ;#; (P;<) ; f((0; 1) ; S)g) ;P = �Aa ! #S ; Aa ! #A ; aB ! A#; aB ! B#;aC ! B#; aD ! C# ; aD ! D# ; aE ! D# ;Ea! #E; Fa! #E; #F ! #Q; a! F� :The order relation < only consists of Fa! #E < #F ! #Q : The rule a! Finitiates the parsing process; this rule can only be applied once at the �rst stepof the derivation, otherwise the goal f((1; 0) ; S)g cannot be derived.In the second derivation step we have to apply the rule Fa! #E; which issupervised by the rule #F ! #Q introducing the trap symbolQ;which guaranteesthat above the starting position indicated by the generation of the symbol F wewill �nd a symbol a at the end of the derivation.The remaining rules accomplish the analysis of the array just in the oppositedirection as the generation of the same array was described by the correspondingdual rules in the ordered regular array grammar in Example 4.1. In sum, weobtain L (G) = RH ; i.e. we conclude RH 2 L (2; (acc; cf) ; O) :In fact, taking into account the duality of these two array grammars, the onlydi�erence between the ordered accepting array grammar in this example and

�1 : a! S; f2g ; ;�; �2 : Sa ! #S; f3g ; ;�;�3 : a! B; f2; 4g ; ;�; �4 : Sa ! #S; f5g ; ;�; 5 : aS ! S# ; f6g ; ;!; �6 : a! A; f5; 7g ; ;�; 7 : aS ! S# ; f8g ; ;!; �8 : BS ! S#; f8; 9g ; ;�;�9 : aS ! S#; f10g ; ;�; 10 : SA ! #S ; f10g ; ;!:Fig. 2. The rule set belonging to Example 4.4the ordered generating array grammar is that here we have to use the (context-free but non-regular) blank-sensing trap rule #F ! #Q instead of the (regulargenerating) trap rule #F ! Qa ; which not even is monotonic accepting. 2Observe that Lemma 4.6 is also valid for an extended regular case wherewe admit array productions of the form f(n; A) ; (v;#)g ! f(n; B) ; (v;#)g,since we then can simulate a generating rule (r : (W;A1;A2) ; � (r) ; ' (r)) withA1 = f(n; B) ; (v;#)g, A2 = f(m; a) ; (v; C)g; via r0 and r00 as de�ned in theproof of Lemma 4.6, because now the array production (W;A1;A1) used in r00is of this new form:Also the programmed use of strictly context-free accepting array productionsallows us to accept RH :Example 4.4. The set RH of hollow rectangles of thickness one over the one-letter alphabet fag (with the left lower corner lying in the origin) can be acceptedby the following strictly context-free graph controlled accepting array grammarG without appearance checking:G = (2; fS;A;Bg ; fag ;#; (R; f1g ; f10g) ; f((0; 1) ; S)g)with R containing the rules listed in Fig. 2.With each symbol a consumed by rule 2 on the lower horizontal line, a sym-bol B arises on the upper horizontal line, which symbol afterwards is consumedby rule 8. In the same way, a symbol A arises on the left vertical line with eachapplication of the rules 5 and 6, which then is consumed by an application ofrule 10. In this way we can control the corresponding lengths of the horizon-tal and the vertical lines, respectively. In sum, we obtain L (G) = RH ; i.e. weconclude RH 2 L (2; (acc; scf) ; P ) : 2Example 4.5. The set L1F of lines of thickness one over the one-letter alphabetfag with the starting point lying in the origin and ending with a free end can

be de�ned by being generated by the following context-free array grammar G :G = (2; fSg ; fag ;#; P; f((0; 0) ; S)g) ;P = ff((0; 0) ; S) ; (v;#)g ! f((0; 0) ; a) ; (v; S)g j v 2 U4g[ff((0; 0) ; S)g [ f(v;#) j v 2 U4 n fugg !f((0; 0) ; a)g [ f(v;#) j v 2 U4 n fugg j u 2 U4g ; whereU4 = f(0; 1) ; (0;�1) ; (1; 0) ; (�1; 0)g :On the other hand, the array language generated by this context-free arraygrammar G can also be accepted by an ordered regular array grammar G0 theconstruction of which is rather obvious but tedious and therefore left to thereader. 2Lemma 4.8. For each n � 2;i2;n �L1F � 2 (L (n; (acc; reg) ; O) \ L (n; cf)) n L (n; (gen; reg) ; Pac) :Proof. From the preceding example we immediately inferi2;n �L1F � 2 (L (n; (acc; reg) ; O) \ L (n; cf)) :A pumping argument shows that i2;n �L1F � =2 L (n; (gen; reg) ; Pac) : The detailsare left to the reader. 2We even conjecture thati2;n �L1F � 2 L (n; (gen; smon)) n L (n; (gen; scf) ; Pac) :Moreover, we conjecture that the array language i2;n (LF ) ; where LF is thearray language from L (n; (gen; cf)) de�ned in the following example, even isnot in L (n; (gen; smon) ; Pac) : So far proofs of these conjectures remain as openproblems.Example 4.6. The array language LF containing arrays representing an arbi-trary number of lines starting in the origin and ending with free ends is generatedby the following context-free array grammar:G = (2; fSg ; fag ;#; P; f((0; 0) ; S)g) ;P = ff((0; 0) ; S) ; (v;#)g ! f((0; 0) ; a) ; (v; S)g j v 2 U4g[ff((0; 0) ; S)g [ f(v;#) j v 2 U4 n fugg !f((0; 0) ; a)g [ f(v;#) j v 2 U4 n fugg j u 2 U4g[ff((0; 0) ; S) ; (v;#)g ! f((0; 0) ; S) ; (v; S)g j v 2 U4g : 2Most of the examples elaborated above cannot be taken over to the one-dimensional case. As a consequence, in the one-dimensional case, some morefamilies of array languages collapse into one class:Theorem 4.1. For every U 2 fO;P; Put; Pacg ; we haveL (1; reg) = L (1; (acc; reg) ; U ) = L (1; (gen; reg) ; U ) $ L (1; scf)

Proof. Obviously, L (1; reg) � L (1; scf) : The strictness of this inclusion followsfrom the fact that one-dimensional arrays generated by a regular array grammarcan grow only to the left or to the right from the start position, whereas strictlycontext-free array grammars can grow the array to the left as well as to the right;hence, e.g. ff((�i) ; a) j 1 � i � kg [ f((j) ; a) j 0 � j � mg j k � 0;m � 0g 2L (1; scf) n L (1; reg) : Therefore, it only remains to prove that we haveL (1; reg) � L (1; (�; reg) ; Pac) for � 2 fgen; accg.Yet these inclusions can be proved by the standard techniques known from thestring case, i.e. all we need for the control mechanism can be stored in the singlenon-terminal of the intermediate sentential forms together with the informationto which side from the start position the array is grown. The technical detailsare obvious and therefore left to the reader. 2When considering equivalence classes of arrays, we even obtain (see [12])Corollary 4.1. For every U 2 fO;P; Put; Pacg ; we have[L (1; reg)] = [L (1; (acc; reg) ; U )] = [L (1; (gen; reg) ; U )] = [L (1; scf)] :Proof. The inclusion [L (1; scf)] � [L (1; reg)] was proved in [12]. The remainingstatements then follow from Theorem 4.1. 2For families of strictly context-free one-dimensional array languages we ob-tain the following inclusions implied by the results in [13,14] and some resultspreviously proved in this paper.Theorem 4.2. For every U 2 fO;P; Put; Pacg we haveL (1; scf) $ L (1; (gen; scf) ; U ) $ L (1; smon) = L (1;mon1) $ L (1;mon) ;L (1; scf) $ L (1; (acc; scf) ; U ) � L (1; smon) ; and moreover,L (1; scf) $ L (1; (gen; scf) ; P ) $ L (1; (gen; scf) ; Pac) $ L (1;mon1) ;L (1; scf) $ L (1; (acc; scf) ; O) � L (1; (acc; scf) ; Put)� L (1; (acc; scf) ; Pac) $ L (1;mon1) :Proof. The strictness of the relation L (n; (gen; scf) ; U ) $ L (n;mon) wasproved in [13], where the array representation of the context-free string languageL = nxcxRdycyR j x; y 2 fa; bg+o(xR is the mirror image of x) was shown to be in L (1;mon)nL (1; (gen; scf) ; U ) ;from the proof given there it is clear that even for any n 2 N we havei1;n (L) 2 L (n;mon) nL (n; (gen; scf) ; U ) : 2In the string case, the analogue of the following result has been shown in [1].

Theorem 4.3. For every n 2 N; we have L (n;mon) � L (n; (acc; cf) ; O) :Proof. Combining the Kuroda-like normal form result for generating mono-tonic array grammars [14] with Lemma 3.1, we can assume that an arbitrarymonotonic array language is given by a monotonic accepting array grammarG = (n; VN ; VT ;#; P; f(v0; S)g)which only contains accepting array productions of one of the following forms:1. a! X; where X 2 VN ; a 2 VT ;2. Y ! X; where X 2 VN ; Y 2 VN ;3. f(n; B) ; (v; C)g ! f(n; A) ; (v;#)g ; where A;B;C 2 VN ;4. f(n; B) ; (v;#)g ! f(n; A) ; (v;#)g ; where A;B 2 VN ;5. f(n; B) ; (v; C)g ! f(n; A) ; (v;D)g ; where A;B;C;D 2 VN :As the �rst four kinds of rules are already accepting context-free, we onlyhave to show how the inherent non-context-free array productions of the formf(n; B) ; (v; C)g ! f(n; A) ; (v;D)g ; where A;B;C;D 2 VN ; can be simu-lated by using only context-free array productions together with the controlmechanism of an order relation:For each labelled array production r : f(n; B) ; (v; C)g ! f(n; A) ; (v;D)g ;r 2 Lab; we introduce the following accepting array productions:1. B ! [B; r; 0] less than (supervised by) [X; s; i]! F for all X 2 VN ; s 2 Lab;i 2 f0; 1; 2g ;2. C ! [C; r; 1] supervised by [X; s; i]! Ffor all X 2 VN ; s 2 Lab; i 2 f0; 1; 2g such that (X; s; i) 6= (B; r; 0) ;3. [B; r; 0]! [A; r; 2] supervised by:[B; r; 0]vY ! Fv# for all Y 2 VN [ VT [ f#g ;[B; r; 0]v [X; s; i] ! Fv# for all X 2 VN ; s 2 Lab; i 2 f0; 1; 2g such that(X; s; i) 6= (C; r; 1) ;[X; s; i] ! F for all X 2 VN ; s 2 Lab; i 2 f0; 1; 2g such that (X; s; i) =2f(B; r; 0) ; (C; r; 1)g ;4. [C; r; 1]! D supervised by:[C; r; 1](�v) Y ! F (�v) # for all Y 2 VN [ VT [ f#g ;[C; r; 1](�v) [X; s; i]! F (�v) # for all X 2 VN ; s 2 Lab; i 2 f0; 1; 2g suchthat (X; s; i) 6= (A; r; 2) ;[X; s; i] ! F for all X 2 VN ; s 2 Lab; i 2 f0; 1; 2g such that (X; s; i) =2f(A; r; 2) ; (C; r; 1)g ;5. [A; r; 2]! A supervised by [X; s; i]! Ffor all X 2 VN ; s 2 Lab; i 2 f0; 1; 2g such that (X; s; i) 6= (A; r; 2) :Hence, each derivation step in G using an accepting array production of theform f(n; B) ; (v; C)g ! f(n; A) ; (v;D)g is simulated by a sequence of �vecontext-free accepting array productions in the ordered accepting array grammarconstructed above: By the array productions B ! [B; r; 0] and C ! [C; r; 1] ;respectively, two positions in the underlying sentential form are marked. By

the supervising array productions in 3 it is guaranteed that we can only pro-ceed without generating the trap symbol F if in the �rst two simulation stepsa subarray of the desired form, i.e. f(w; [B; r; 0]) ; (w + v; [C; r; 1])g ; has beenmarked. No more than two symbols can be marked at the same time without�nally enforcing the generation of the trap symbol F: By the array productions[B; r; 0]! [A; r; 2] ; [C; r; 1]! D; and [A; r; 2]! A in 3, 4, and 5 we can �nishthe simulation of the array production labelled by r, thus yielding the subarrayf(w;A) ; (w + v;D)g : The supervising array productions guarantee the correctsequence of applying these simulating accepting array productions. 2Remark 4.1. As we shall show later in this paper, we even haveL (n;mon) = L (n; (acc; cf) ; O) :By also allowing accepting array productions of the form # ! A; A 2 VN ; inthe normal form given above, we immediately obtain a normal form for arbitraryaccepting array productions and grammars, respectively, as well as according tothe de�nition of the type #-context-free, we readily obtainL (n; enum) = L (n; (acc;#� cf) ; O) :In [14] it was already proved that (for n = 2; yet the result holds true for everyn � 1) we have L (n; enum) = L (n; (gen;#� cf) ; O) :Hence, according to the thesis of Turing and Church, for the arbitrary casewe can already state (also using Lemmas 4.2, 4.3, and 4.4 as well as results from[14]): L (n; enum) = L (n; (�;#� cf) ; U )for all � 2 fgen; accg and U 2 fO;Put; Pacg. 2In the monotonic accepting case, so far we have shown (see Lemma 4.2,Lemma 4.4, and Theorem 4.3) thatL (n;mon) � L (n; (acc; cf) ; O) � L (n; (acc; cf) ; Put) � L (n; (acc; cf) ; Pac) :In order to show that all these inclusions are equalities, it only remains toshow the following lemma:Lemma 4.9. For every n 2 N; L (n; (acc;mon) ; Pac) � L (n;mon) :Proof. Let G = (n; VN ; VT ;#; (R;Li; Lf ) ; f(v0; S)g) be a graph controlledaccepting monotonic array grammar, and let Lab be the set of unique la-bels of the rules in R as well as UG = fv 2 Zn j 0 < kvk � kGkg : Thenwe can construct an equivalent monotonic generating array grammar G0 =(n; V 0N ; VT ;#; P; f(v0; S)g) withV 0N = f[x; Y; s; u; U ] j x 2 VT ; Y 2 VN [ VT [ f#g ; u 2 UG; ; � U � UG;s 2 fA; I; Fg [ f(p; d) j p 2 Lab; d 2 fY;N;C;D;Rggg [ fSgand P containing the following array productions:

1. S ! [a; a;A;n; ;] for all a 2 VT :Such an array production starts the non-deterministic generation of an ar-bitrary array, which is continued by the array productions in 2.2. f(n; [a; a;A; u; U ]) ; (v;#)g !f(n; [a; a;A; u; U [ fvg]) ; (v; [b; b; I;�v; ;])gfor all a; b 2 VT ; u 2 UG [ fng ; v 2 UG; ; � U � UG:The quintuples of the form [x; Y; s; u; U ] contain the following information:(a) x is the symbol that �nally has to appear in the terminal array generatedby G0:(b) Y is the current symbol at this position during the simulation of G byG0:(c) The state s describes the current phase of the simulation at the under-lying position.(d) The vector u points to the relative position from which the underlyingposition has been reached �rst by an array production in 2 (except for thestarting position v0; which therefore contains n as fourth component).In this way, a connectivity tree (with the root in v0) is codi�ed.(e) The set U contains the relative positions of the children (successors) ofthe underlying position in this connectivity tree. Hence the fourth andthe �fth component allow us to go forth and back in the connectivitytree.3. f(n; [a; a;A; u; U ]) ; (v; [b; b; I; w;W ])g !f(n; [a; a; I; u; U ]) ; (v; [b; b; A;w;W ])gfor all a; b 2 VT ; u; w 2 UG [ fng ; v 2 UG; ; � U;W � UG:In the �rst phase, when generating an arbitrary array by using the arrayproductions in 1,2, and 3, exactly one position in the current sentential formcarries the active state A; whereas all the other non-blank positions carry thenon-active state I: The array productions in 3 allow us to move the activestate from one non-blank position to another one.4. [a; a;A;n; U ]! [a; a; (p; �) ; n; U ]for all a 2 VT ; ; � U � UG; p 2 Li; � 2 fY;Ng:The simulation of G is started by introducing an initial active state (p; �) ;which can be moved around by the array productions in 5.5. f(n; [a;X; (p; �) ; u; U ]) ; (v; [b; Y; I; w;W ])g !f(n; [a;X; I; u; U ]) ; (v; [b; Y; (p; �) ; w;W ])gfor all a; b 2 VT ; X; Y 2 VN [ VT [ f#g ; u; w 2 UG [ fng ; v 2 UG;; � U;W � UG; p 2 Lab; � 2 fY;Ng :6. f(n; [an ; Xn; (p; Y ) ; wn;Wn ])g[f(v; [av; Xv; I; wv;Wv]) j v 2 V g !f(n; [an ; Yn; (q; �) ; wn;Wn ])g[f(v; [av; Yv; I; wv;Wv]) j v 2 V gfor all av 2 VT ; Xv ; Yv 2 VN [ VT [ f#g ; wv 2 UG [ fng ; ; �Wv � UG;for v 2 V [ fng ; p 2 Lab; q 2 � (p) ; � 2 fY;Ng ;and the rule labelled with p isf(v;Xv) j v 2 V [ fngg ! f(v; Yv) j v 2 V [ fngg ; n =2 V:

If the application of the array production p has to be simulated, the activestate (p; Y ) is moved to a suitable position from which the simulation ispossible.7. [a;X; (p;N ) ; n; U ]! [a;X; (p; C) ; n; U ]for all a 2 VT ; X 2 VN [ VT [ f#g ; ; � U � UG; p 2 Lab:The check for the non-applicability of an array production p (which non-deterministically has been guessed by introducing the active state (p;N )) isstarted at the position v0 by the suitable array production in 7. From there,the state (p; C) is propagated forward to all non-blank positions along theconnectivity tree by the array productions in 8.8. f(n; [an ; Xn; (p; C) ; wn;Wn ])g[f(v; [av; Xv; I; wv;Wv]) j v 2 Wng !f(n; [an ; Xn; (p; C) ; wn;Wn ])g[f(v; [av; Xv; (p; C) ; wv;Wv]) j v 2Wngfor all av 2 VT ; Xv 2 VN [ VT [ f#g ; wv 2 UG [ fng ; ; � Wv � UG;for v 2Wn [ fng ; p 2 Lab:9. f(n; [an ; Xn; (p; C) ; wn;Wn ])g[f(v; [av; Xv; �v; wv;Wv]) j v 2 V1g [ f(v;#) j v 2 V2g !f(n; [an ; Xn; (p;D) ; wn;Wn ])g[f(v; [av; Xv; �v; wv;Wv]) j v 2 V1g [ f(v;#) j v 2 V2g ;where V1 and V2 are disjoint �nite subsets of Zn; V1 [ V2 � UG;for all av 2 VT ; Xv 2 VN [ VT [ f#g ; wv 2 UG [ fng ; ; � Wv � UG;for v 2 V1 [ fng ; p 2 Lab; �v 2 f(p; C) ; (p;D)g ;and the rule labelled with p is of the formf(v; Zv) j v 2 V1 [ V2 [ fngg ! f(v; Yv) j v 2 V1 [ V2 [ fngg ;Zv; Yv 2 VN [ VT [ f#g for v 2 V1 [ V2 [ fng ;but not of the formf(v;Xv) j v 2 V1 [ fngg [ f(v;#) j v 2 V2g !f(v; Yv) j v 2 V1 [ V2 [ fngg :At each position, from the state (p; C) the state (p;D) is generated if thearray production p cannot be applied here.10. [a;X; (p;D) ; u; ;]! [a;X; (p;R) ; u; ;]for all a 2 VT ; X 2 VN [ VT [ f#g ; u 2 UG [ fng :>From the leaves of the connectivity tree (indicated by the empty set as the�fth component), the information of the non-applicability of p is propagatedback to the root at position v0 by the array productions 10 and 11.11. f(n; [an ; Xn; (p;D) ; wn;Wn ])g[f(v; [av; Xv; (p;R) ; wv;Wv]) j v 2 Wng !f(n; [an ; Xn; (p;R) ; wn;Wn ])g[f(v; [av; Xv; I; wv;Wv]) j v 2 Wngfor all av 2 VT ; Xv 2 VN [ VT [ f#g ; wv 2 UG [ fng ; ; � Wv � UG;for v 2Wn [ fng ; p 2 Lab; Wn 6= ;:12. [a;X; (p;R) ; n; U ]! [a;X; (q; �) ; n; U ]for all a 2 VT ; X 2 VN [ VT [ f#g ; ; � U � UG;p 2 Lab; q 2 ' (p) ; � 2 fY;Ng :At the root, i.e. at position v0 marked with the fourth component being n;the successful check for the non-applicability of p allows us to guess the nextactive state (q; �) ; where q has to be from the failure �eld ' (p) :

13. f(n; [an ; S; (p; �) ; n;Wn])g [ f(v; [av;#; I; wv;Wv]) j v 2Wng !f(n; an)g [ f(v; [av;#; F; wv;Wv]) j v 2Wngfor all av 2 VT ; wv 2 UG; ; �Wv � UG; for v 2Wn [ fng ;p 2 Lf ; � 2 fY;Ng :14. f(n; [an ;#; F; wn;Wn ])g [ f(v; [av;#; I; wv;Wv]) j v 2Wng !f(n; an)g [ f(v; [av;#; F; wv;Wv]) j v 2Wngfor all av 2 VT ; wv 2 UG; ; �Wv � UG; for v 2Wn [ fng :When we reach a �nal state, indicated by the active state (p; �) with p 2Lf ; we can initiate the generation of the terminal array by applying anarray production 13, provided that at position v0 the third component isS; by introducing the active symbol F and then continue with the arrayproductions in 14, provided that at every other position the third componentis #. This terminating phase, indicated by the state F; successfully endsat the leaves of the connectivity tree (which have the empty set as �fthcomponent) if and only if we �rst have successfully guessed the initial arraygenerated by the array productions 1,2, and 3, and then have successfullysimulated an accepting derivation of the array in G by G0 �nally obtainingthe array f(v0; S)g encoded in the third components. 2Hence, for the monotonic case we have proved that for every n 2 N andevery U 2 fO;Put; Pacg:L (n;mon) = L (n; (acc; cf) ; U ) = L (n; (acc;mon) ; U ) = L (n; (gen;mon) ; U ) :Finally, let us mention that the proof of Lemma 4.7 given above is consider-ably more involved than its analogue in the string case, where a simulation ofnon-erasing grammars by linear bounded automata is quite obvious.Strictly monotonic array grammars cannot check for the context of blanksymbols as monotonic or even context-free array grammars can do by usingarray productions likef(n; A) ; (v;#)g ! f(n; B) ; (v;#)g ;which were inevitably used in the previous proofs. Surprisingly enough, appear-ance checking can overcome this di�culty when we restrict ourselves to arraygrammars with norm 1, which is shown in the following lemma:Lemma 4.10. For every n 2 N; if G is an n-dimensional monotonic generatingor accepting array grammar with kGk = 1; then we can construct an n-dimen-sional ordered strictly monotonic generating or accepting, respectively, arraygrammar G0 with kG0k = 1 such that L (G0) = L (G) :Proof. Let G = (n; VN ; VT ;#; P; f(v0; S)g) be a generating or accepting mono-tonic array grammar in normal form (see Theorem 4.3). Then we constructan equivalent ordered monotonic generating or accepting array grammar G0 =(n; V 0N ; VT ;#; (P;<) ; f(v0; S)g) ; with L (G0) = L (G) by eliminating the rules rof the form f(n; A) ; (v;#)g ! f(n; B) ; (v;#)g : We replace such a rule bythe following set of rules:

1. A! Ar supervised byXq ! F for all X 2 VN and all q that are labels of a rule of the form above;2. Ar ! B supervised byf(n; Ar) ; (v;X)g ! f(n; F ) ; (v; F )g for allX 2 VN[VT (which inevitablydestroys the normal form). Observe that the newly introduced array produc-tions are of the desired type. 2Summarizing some of the most important results elaborated in this paper, wecan state the following theorem (for the string case, analogous results concerningthe accepting mode of derivation were stated in Theorem 3.3 and Corollaries 3.5and 4.8 in [1]):Theorem 4.4. For every n 2 N and every U 2 fO;Put; Pacg, we haveL (n; enum) = L (n; (gen;#� cf) ; U ) = L (n; (acc;#� cf) ; U ) ;L (n;mon) = L (n; (gen;mon) ; U ) = L (n; (acc;mon) ; U ) ;L (n;mon) = L (n; (acc; cf) ; U ) � L (n; (gen; cf) ; U ) :5 Final remarksSeveral problems for accepting array grammars with various control mechanismshave remained open in this paper, but some problems for generating array gram-mars with various control mechanisms are still open, too.In [10], we discussed how to interpret generating array grammars in ananalysing manner for character recognition purposes. This is done in the fol-lowing way:1. productions are read from left to right, i.e. we use the generating rules asthey are given, indeed,2. a production is applicable if the result of the derivation step still matchesthe given pattern.Point (2) allows to prune subcases which can never lead to a complete matchwith the given pattern, hence reducing the non-deterministic choices inherent inChomsky-like grammars. In this way, we can accelerate the derivation consider-ably. Observe that there is a crucial di�erence between this interpretation of ananalysing grammar and the accepting grammars discussed in this paper. It is notobvious how to use the matching interpretation described above when applyingthe accepting grammars in the sense introduced in this paper. This remains asan interesting theoretical problem with possibly signi�cant impact on practicalalgorithms for syntactical pattern recognition.Acknowledgements. The work of the �rst author was supported by DeutscheForschungsgemeinschaft grant DFG La 618/3-1.

References1. H. Bordihn and H. Fernau, Accepting regulated grammars, IJCM 53 (1994), pp.1-18.2. H. Bordihn and H. Fernau, Accepting grammars and systems, JALC 1 (2) (1996).A short version appeared in: J. Dassow, G. Rozenberg, and A. Salomaa (eds.),Developments in Language Theory II (World Scienti�c Publ., Singapore, 1996),pp. 199{208.3. H. Bordihn and H. Fernau, Accepting pure grammars, 5th Theorietag der GI `Au-tomaten und Formale Sprachen', Rauischolzhausen 1995 (Technischer Bericht 9503of the Universit�at Gie�en, Arbeitsgruppe Informatik, 1995), pp. 4{16.4. E. Csuhaj-Varj�u, J. Dassow, J. Kelemen, and Gh. P�aun, Grammar Systems (Gor-don and Breach, London, 1994).5. C. R. Cook and P. S.-P. Wang, A Chomsky hierarchy of isotonic array grammarsand languages, Computer Graphics and Image Processing 8 (1978), pp. 144-152.6. J. Dassow and Gh. P�aun, Regulated Rewriting in Formal Language Theory(Springer, Berlin, 1989).7. J. Dassow, R. Freund, and Gh. P�aun, Cooperating array grammar systems, In-ternational Journal of Pattern Recognition and Arti�cial Intelligence 9 (6) (1995),pp. 1029-1053.8. H. Fernau, Membership for 1-limited ET0L languages is not decidable, J. Inform.Process. Cybernet. EIK 30 (4) (1994), pp. 191-211.9. H. Fernau, On unconditional transfer. In: W. Penczek, and A. Sza l las (eds.), Pro-ceedings MFCS'96, LNCS 1113 (Springer, Berlin, 1996), pp. 348{359.10. H. Fernau and R. Freund, Bounded parallelism in array grammars used for char-acter recognition. In: P. Perner, P. Wang, and A. Rosenfeld (eds.), ProceedingsSSPR'96, LNCS 1121 (Springer, Berlin, 1996), pp. 40{49.11. R. Freund, Aspects of n-dimensional Lindenmayer systems. In: G. Rozenberg, andA. Salomaa (eds.), Developments in Language Theory (World Scienti�c Publ., Sin-gapore, 1994), pp. 250{261.12. R. Freund, One-dimensional #-sensing context-free array grammars, Technical re-port, Universit�at Magdeburg, 1994.13. R. Freund and Gh. P�aun, One-dimensional matrix array grammars, J. Inform.Process. Cybernet. EIK 29 (6) (1993), pp. 1-18.14. R. Freund, Control mechanisms on #-context-free array grammars. In: Gh. P�aun(ed.), Mathematical Aspects of Natural and Formal Languages (World Scienti�cPubl., Singapore, 1994), pp. 97-137.15. D. Hauschildt and M. Jantzen, Petri net algorithms in the theory of matrix gram-mars, Acta Informatica 31 (1994), pp. 719{728.16. H. Maurer, G. Rozenberg, and E. Welzl, Using string languages to describe picturelanguages, Information and Control 54 (1982), pp. 155-185.17. A. Rosenfeld, Picture Languages (Academic Press, Reading, MA, 1979).18. A. Salomaa, Formal Languages (Academic Press, Reading, MA, 1973).19. P. S.-P. Wang, Some New Results on Isotonic Array Grammars, Information Pro-cessing Letters 10 (1980), pp. 129-131.20. Y. Yamamoto, K. Morita, and K. Sugata, Context-sensitivity of two-dimensionalregular array grammars. In: P. S.-P. Wang (ed.), Array Grammars, Patterns andRecognizers, WSP Series in Computer Science, Vol. 18 (World Scienti�c Publ.,Singapore, 1989), pp. 17-41.