REGULATED GALIUKSCHOV SEMICONTEXTUAL GRAMMARS

Similar documents
Chapter 6. Properties of Regular Languages

CPSC 313 Introduction to Computability

ON MINIMAL CONTEXT-FREE INSERTION-DELETION SYSTEMS

Solution. S ABc Ab c Bc Ac b A ABa Ba Aa a B Bbc bc.

Linear conjunctive languages are closed under complement

CS375: Logic and Theory of Computing

Grammars (part II) Prof. Dan A. Simovici UMB

languages by semifilter-congruences

Semi-simple Splicing Systems

Insertion operations: closure properties

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Some Operations Preserving Primitivity of Words

The Pumping Lemma for Context Free Grammars

Some hierarchies for the communication complexity measures of cooperating grammar systems

Insertion and Deletion of Words: Determinism and Reversibility

Section 1 (closed-book) Total points 30

Theory of Computer Science

On Controlled P Systems

6.1 The Pumping Lemma for CFLs 6.2 Intersections and Complements of CFLs

A shrinking lemma for random forbidding context languages

The Accepting Power of Finite. Faculty of Mathematics, University of Bucharest. Str. Academiei 14, 70109, Bucharest, ROMANIA

Lecture 12 Simplification of Context-Free Grammars and Normal Forms

Languages. Languages. An Example Grammar. Grammars. Suppose we have an alphabet V. Then we can write:

Power of controlled insertion and deletion

Fundamentele Informatica II

Context Free Languages. Automata Theory and Formal Grammars: Lecture 6. Languages That Are Not Regular. Non-Regular Languages

UNIT II REGULAR LANGUAGES

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

(b) If G=({S}, {a}, {S SS}, S) find the language generated by G. [8+8] 2. Convert the following grammar to Greibach Normal Form G = ({A1, A2, A3},

Learning Context Free Grammars with the Syntactic Concept Lattice

C1.1 Introduction. Theory of Computer Science. Theory of Computer Science. C1.1 Introduction. C1.2 Alphabets and Formal Languages. C1.

Kybernetika. Miroslav Langer On hierarchy of the positioned eco-grammar systems. Terms of use: Persistent URL:

Parsing. Context-Free Grammars (CFG) Laura Kallmeyer. Winter 2017/18. Heinrich-Heine-Universität Düsseldorf 1 / 26

6.8 The Post Correspondence Problem

Left-Forbidding Cooperating Distributed Grammar Systems

Parallel Communicating Grammar Systems

Computability Theory

Watson-Crick ω-automata. Elena Petre. Turku Centre for Computer Science. TUCS Technical Reports

CSci 311, Models of Computation Chapter 4 Properties of Regular Languages

CPS 220 Theory of Computation

Finite Presentations of Pregroups and the Identity Problem

Theory of Computation (II) Yijia Chen Fudan University

Array Insertion and Deletion P Systems

Warshall s algorithm

1.A Sets, Relations, Graphs, and Functions 1.A.1 Set a collection of objects(element) Let A be a set and a be an elements in A, then we write a A.

Context-Free and Noncontext-Free Languages

On External Contextual Grammars with Subregular Selection Languages

Homework 1/Solutions. Graded Exercises

Harvard CS 121 and CSCI E-207 Lecture 12: General Context-Free Recognition

Computational Models - Lecture 3 1

1 Alphabets and Languages

P Systems with Symport/Antiport of Rules

Deletion operations: closure properties

Accepting H-Array Splicing Systems and Their Properties

Section Summary. Relations and Functions Properties of Relations. Combining Relations

k-local Internal Contextual Grammars

NPDA, CFG equivalence

DM17. Beregnelighed. Jacob Aae Mikkelsen

(NB. Pages are intended for those who need repeated study in formal languages) Length of a string. Formal languages. Substrings: Prefix, suffix.

Problem Session 5 (CFGs) Talk about the building blocks of CFGs: S 0S 1S ε - everything. S 0S0 1S1 A - waw R. S 0S0 0S1 1S0 1S1 A - xay, where x = y.

Formal Languages, Automata and Models of Computation

CSCI 6304: Visual Languages A Shape-Based Computational Model

FABER Formal Languages, Automata. Lecture 2. Mälardalen University

Computational Models - Lecture 3

CS 373: Theory of Computation. Fall 2010

Automata Theory and Formal Grammars: Lecture 1

Non-context-Free Languages. CS215, Lecture 5 c

Notes for Comp 497 (454) Week 10

Context Free Grammars

Computational Models: Class 3

Fall 1999 Formal Language Theory Dr. R. Boyer. Theorem. For any context free grammar G; if there is a derivation of w 2 from the

Context Free Language Properties

Chomsky and Greibach Normal Forms

Set Theory. CSE 215, Foundations of Computer Science Stony Brook University

55 Separable Extensions

A new Cryptosystem based on Formal Language Theory

Some Operations Preserving Primitivity of Words

arxiv: v1 [math.ra] 25 May 2013

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor

HW 3 Solutions. Tommy November 27, 2012

Hybrid Transition Modes in (Tissue) P Systems

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

BOUNDS ON ZIMIN WORD AVOIDANCE

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove

Context-free insertion deletion systems

Aperiodic languages and generalizations

Author: Vivek Kulkarni ( )

TAFL 1 (ECS-403) Unit- III. 3.1 Definition of CFG (Context Free Grammar) and problems. 3.2 Derivation. 3.3 Ambiguity in Grammar

Tree Adjoining Grammars

Computational Models - Lecture 4

CS 275 Automata and Formal Language Theory

HENNING FERNAU Fachbereich IV, Abteilung Informatik, Universität Trier, D Trier, Germany

Ogden s Lemma for CFLs

HW6 Solutions. Micha l Dereziński. March 20, 2015

Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017

Finite Automata and Formal Languages TMV026/DIT321 LP Useful, Useless, Generating and Reachable Symbols

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Theory of Computation Turing Machine and Pushdown Automata

Simple equations on binary factorial languages

Pushdown Automata. Reading: Chapter 6

Transcription:

KYBERNETIKA- VOLUME 26 (1990), NUMBER 4 REGULATED GALIUKSCHOV SEMICONTEXTUAL GRAMMARS MONICA MARCUS, GHEORGHE PĂUN We consider matrix, programmed, random context and regular control semicontextual grammars in Galiukschov sense ([4]), with and without appearance checking. The generative capacity of such grammars is investigated, compared with non-restricted semicontextual grammars and with Chomsky grammars. 1. INTRODUCTION The semicontextual grammars were introduced in [4] under linguistical motivation and they were investigated in [1], [6], [7], [8] from formal language theory point of view. These grammars are interesting counterparts of context sensitive Chomsky grammars (based on the process of rewriting nonterminals in given contexts) and of Marcus contextual grammars ([5]) (in which contexts are adjoined to strings), as they combine modified versions of such grammars: in Galiukschov grammars strings are adjoined in given contexts. The formal study of these grammars is therefore quite natural and the present paper relates the semicontextual grammars to an extensively investigated topic of formal language theory, namely the regulated rewriting (see [3] for a survey of the domain). Four of the most known regulating mechanisms are considered here, the matrix, the programmed, the regular control and the random context restrictions. Part of the results are the expected ones: all these mechanisms increase the generative capacity, whereas when adding the appearance checking feature the power is more increased. However, the four mechanisms do not lead to equivalent classes of regulated semicontextual grammars (as in the case of Chomsky context-free grammars; the same conclusion has been obtained for pure grammars in [2]). Some extensions of previous results about semicontextual grammars and languages are obtained too: infinite hierarchies introduced by grammars degree, inclusions into context-free languages family of random context semicontextual languages family of degree 1 (this extends a Galiukschov theorem). 316

2. SEMICONTEXTUAL GRAMMARS A semicontextual grammar is a system G = (V, B, P), where Vis a (finite and nonempty) vocabulary, B is a finite language over V, and P is a finite set of rewriting rules of the form xy -> xzy, with x, y, z e V*, x, y =)= X (V* is the free monoid generated by V under the operation of concatenation and the null element X). If w, w' e V*, w = uxyv, w' = uxzyv, u, v e V*, and x> -> xzy is a rule in P, then we write w => w'. Denote by =>* the reflexive transitive closure of this relation. The language generated by G is We denote L(G) = {w e V* I there is u e B such that u =>* w) deg (G) = max { xl there is y e V* such that xy > xzy e P or yx > yzx e P} where x denotes the length of the string x. This is the degree of the grammar G. Then we define J k = {L L= L(G), deg(g) ^ k}, k = 1, ^oo = U ^ (the family of languages generated by grammars of degree at most k and the family of all semicontextual languages, respectively). The following results are known from [4], [6], [7], [8]: J x c J 2 a... c= / M, strict inclusions,,/j c ^2 ' strict inclusion, J 2 - f 2 + 0 s {a"/3a" n = 1} ^ ^^ (j^,-, i = 0, 1, 2, 3, denote the families in Chomsky hierarchy). 3. REGULATED SEMICONTEXTUAL GRAMMARS A matrix semicontextual grammar is a system G = (V, B, M, F), where V is a vocabulary, B is a finite language over V, M is a finite set of sequences of the form (x 1 y 1 -^x 1 z 1 y i,..., x k y k -> x fe z fe >- fe ), k ^ 1, of semicontextual rules, and E is a set of occurrences of rules in M. For vv, w' e V* we write vv => vv' if there are vv,,...,w k + i in V* and (x 1 y 1 -> XJZJVI,...,x fe >' fe -> ~* A^zA3't) 'n M such that vv = w ls vv fe+1 = vv' and for each i, 1 ^ / ^ k, either 317

w ; = upcjivi, w ;+1 = w ; x,z ; v,r ;, or w ; = w, + 1, w ; does not contain the substring x i y i and x ; y ; -> x ; z,r,- appears in E. The language generated by G is defined in the natural way. A programmed semicontextual grammar is a system G = (V, B, P), where V, B are as above and P is a finite set of quadruples of the form (b: xy -> xzy, E(/j), E(6)) where b is the label of this rule and E(b), F(b) are sets of labels of rules in P. A derivation in G has the form (w t, /3 t ) => (w 2, b 2 ) => (w 3, b$) =>... => (w, /3 ), where w, e B, and for each /, 1 ^ i fg A, w ; e F*, b { are labels of rules in P and (w ;, b ( ) => =>(wi+i, b i+1 ) holds if either w i = u i x i y i v i, w ;+, = w,-x ; z ; j' ; f ;, for (& f : x^,- -> -> XiZ-ji, E(b t ), F(bi)) in P and /3 ;+1 e E(/3 ; ), or w ; = vv ;+1, vv, does not contain the substring x ; j; ; for (Z> ; : x ;.y ; -> x ; z ; >; ;, E(/3 ; ), E(/3 )) in P and b i+, e E(6 ; ). A regular control semicontextual grammar is a system G = (V B, F, C, E), where V, B are as above, P is a set of labelled semicontextual rules, C is a regular language over Lab(P) (the set of labels for rules in P), and E is a subset of P. A derivation in G has the form where r t,...,r n are labels of rules in P, r 1 r 2...r n ec and w, =>'"'vv ;+1 if either vv, = = UiX-j^i, w ;+1 = M ; x ; z,y,y ;, r ; : xji -> x ; z ; y i5 or w ; = w ;+1, w ; does not contain the substring x,j/ ; and the rule r ; : x ; y ; -> x ; z ; y ; appears in E. A random context semicontextual grammar is a system G = (V, B, P), where V, P are as above and Pisa finite set of random context rules, that is triples of the form (xy > xzy, E, F) with E, E c V. Such a rule can be applied to a string vv in order to obtain a string w' if w = uxyv, w' = uxzyv, all symbols of E appear in w, but no symbol of E appears in w. (Note that we check the "random contexts" E, E in the whole string w, not in uv, outside the lefthand member of the applied rules, as usual [3].) In all the four cases, the starting set B of strings is included in L(G) by definition or by convention. For all these classes of grammars we can define the degree as for non-regulated semicontextual grammars. The families of languages generated by matrix, programmed, regular control and random context semicontextual grammars of degree at most k, k^ 1, are denoted by J/ k (ac), 0 > k(ac), ^k(ac), 0l k (ac), respectively; Jijac), 0 > ad(ac), ^m(ac), 0ljac) denote the families of languages as above, of arbitrary degree. When no appearance checking feature is present (that is E = 0 in matrix and regular control grammars, E = 0 in rules of random context grammars and F(b) 0 in rules of programmed grammars), then we write Ji k, 0* k, ( k, 0t k, Ji' co, 0 > ao, ( <XJ, 01^, respectively, for the corresponding families. 318

4. THE GENERATIVE CAPACITY OF NON-APPEARANCE CHECKING CASE The results of this section are summarized in the next theorem, proved in a series of lemmas. Theorem 1. The diagram in Figure 1 holds, where each arrow denotes a strict inclusion and the unrelated families are incomparable. Fig. 1. Lemma 1. fi) J\ c % k, k = 1, for all 3E e {Ji, 0>, %', 0t\ (ii) SC k SC k (ac), k = \. for all I'GJ1,^,^4 Proof. Obvious, from definitions. D Lemma 2. & t - 0> k + 0, k = i. Proof. Let us consider the language The grammar L A = {a&v n = /<} u {ab"f m e m c" \n = k,m = 1} u {db"c" n ^ /<} u {db"e m f m c" \n = k,m = l} G = ({a, b, c, d, e,f}, {ab k c k, db k c k }, {(be ~> 66cc, 0), (6c -> 6/cc, {a}), (/e ->//«?, 0), (bc-+befc,{d}),(ef-+eeff, )}) generates L k, hence L k e.#._. Suppose that L A = L(G'), for some programmed grammar G' = (V, B, P). As B is finite, only for finitely many n's we have ab"f m e m c" in fi, db"e m f m c" in fi. Therefore we have to perform derivations of the form ab r c r =>* ab"c", db r c r =>* db"c", re- 319

spectively, hence we need rules for introducing symbols e, f in strings not containing them. As B c L k, each string in B contains the substrings b k, c k. There are infinitely many derivations of the form and of the form D: (ab h c h, t x ) =>* (ab h c h, t 2 ) => (ab h f Jl e Ji c h, t 3 ) =>* (ab h f J2 e j2 c u, t 4 ) D': (db h 'c h ', t[) =>* (db h 'c h ', t' 2 ) => (db h 'e Jl 'f Ji 'c h ', t' 3 ) =>* (db w e h 'f h 'c w,! 4 ) Assume j'j ^ (._; the case i x >. i' x is similar. The rules in D can be applied in the same order to db ll 'c 11 ', thus obtaining a string of the form db i f J e J c\ which is not in L k, contradiction. fj Corollary. 0t x - J k 4= 0 for all k ^ 1. Lemma 3. Ji x - ^ 4= 0. Proof. Consider the language L = {a"ba"ca n \ n ^ 1} It can be generated by the matrix grammar of degree 1 G = ({a, b, c), {abaca}, {(ab -> aab, ba -> baa, ca > caa)}) Suppose L = L(G'), G' = (V, B, P) being a programmed grammar and consider an effective derivation w =>* a n ba n ca n => a m ba p ca q, m + p + q > 3n. The used rule is of the form xy -> xz>>, hence z = a 1, r _t 1, hence only one of m, p, q is different from n, that is m 4= P, or p 4= q; the obtained string is not in L, contradiction, fj Lemma 4. ^k <_.># k, k >. 1, strict inclusion. Proof. Let G = (V, B, P) be a random context grammar of degree k and construct the matrix grammar G' = (V, B, {(oc x _*!,..., _-» a_, xy -> xzj;) (x>- -> xzy, {a l5..., a m }) e e P, a. e {a.b, fra ; b e V], Hi'^ m}) Clearly, L(G) = L(G')> hence M k # k. The language L = {a"ba"ca" n ^ 1} considered in the above lemma is not in M x. For, if L = L(G"), G" a random context grammar, then, as each string in L contains all occurrences of symbols in V, the grammar G" can be considered a usual unrestricted semicontextual one. However, as we have proved, L^^x, contradiction. fj 320 Corollary. Ji x - M^ 4= 0- Lemma 5. & x - Ji' m 4= 0. Proof. Consider the language L = {a"b" I n ^ 1} u {a"/j n ^ 1}

generated by the programmed semicontextual grammar G - ({a, b}, {ab}, {(1: ab -> a 2 b 2, {1}), (2: ab -> a 2 6, {2})}) Suppose that L= L(G')> for a matrix grammar G' (V, B, M). A matrix which can be applied to a string a"b (leading to a string a m b, m > n) can also be applied to a string a"b", thus obtaining a string a m b", m > n > 1, which is not in L, contradiction. Corollary. ^ - #«, + 0. Lemma 6. //,. c < k, 0> k c # fc, k>.\, strict inclusions. Proof. In view of Lemmas 3 and 5, it is enough to prove the inclusions, and this can be done in the standard way followed for Chomsky grammars (see [3], Chapters 2, 3). Lemma 7. S k+1 - < k + 0 for all k _ 1. Proof. Consider the language L fe _ {fca 2fe+1 } u{a 2 " fe+1 rc = 1} generated by the semicontextual grammar of degree /c + 1 G = ({a, &},{fra 2fe+1, a 2fe+1,a 4fe+1 }, {a fe+1 a fe+1 -+a fe+1 a 2fe a fe+1 }) Suppose that L k = L(G'), G' _ (V, B, P, C) being a semicontextual grammar of degree k with control language C. Clearly, the string ba 2k+x must be in B: each rule xy -» xzj; has x[ = 1, j = 1, hence we cannot add the symbol b in the left hand side of a string a'.on the other hand, in order to obtain strings a 2nk+x with arbitrary n, we need derivations of the form a 2mk + x =>* a 2nk+x, for a 2mk+x eb and using rules xy -> xzv with x = a 1, y = a J, 1 = i, j = fe. The corresponding rules used in the order imposed by a string in C can be used also starting from ba 2k+x, thus obtaining string of the form ba 2rk+x, contradiction. fj Corollary. All inclusions M k c & k + u Jt k proper, k >. 1. c ^// /c+1, ^fc _ ^> fe+1, ^ c ^ are A problem of interest in this context is also the relation with j5f 2, the family of context-free languages. In [7], [8] it is proved that J 2 < 2 + 0. The language {a"ba"ca n \ n >. 1} in Lemma 3 is not context-free, hence Jt\ < 2 4= 0. A similar relation holds also for programmed semicontextual languages: the grammar ({a, b,c}, {abaca}, {(l: ab -» aa/3, {2}), (2: ba ~» 6aa, {3}), (3: ca -» caa, {1})}) generates the non-context-free language n+ I {a"ba"ca", a n+x ba"ca n, a"ba" +x ca", a"ba"cď + x ba"ca" +x,a"ba" +x ca" +x \ n = 1} 321

hence SP X 5 2 =# 0. As we shall see in the next section, M x c $? 2 (in fact, M x (ac) c c Sf 2 too). On the other hand, the linear language {a"ba"ba m n, m ^ 1} is not in (^00 : we need rules xy -> xa'y for modifying the suffix a m ; as jx is bounded, there are such rules with x = a r ba s, or x = a r, which can be applied in such a way to modify the second substring a" in a string a"ba"ba m with arbitrarily large n and m, thus obtaining a n ba r ba m, n + r. 5. THE GENERATIVE CAPACITY IN THE APPEARANCE CHECKING CASE The relationships between the considered families of regulated semicontextual languages generated with or without appearance checking are summarized in the next theorem. Theorem 2. The diagram in Figure 2 holds for all k ^ 1 (the dotted lines point out to open problems). ЄÍЛ.C) --. l-í) Fig. 2. We prove these relations (sometimes, stronger results) in a series of lemmas. Lemma 8. M x (ac) - M k (ac) 4= 0 for all k ^ 1. Proof. The language L k = {(a 2k b 2k )" f n ^ 1} u {6" n ^ 2} is generated by the random context grammar of degree 1 G = ({a, b}, {a 2k b 2k, b 2 }, {(ab -> ab 2k a 2k b, 0, 0), (bb -> 6/36, 0, {a})}) but L k^m k (ac): each matrix (r x,..., r f ) which is used in a derivation b l =>* b J and introduces at least a new symbol 6 can be also used for rewriting a string of the form (a 2fc 6 2k )' +1 into a string containing at least one substring 6 2fc and at least one substring 6 s, s =f= 2k. 322 Corollary. & k <= @t k (ac), fe_: 1, proper inclusion.

Lemma 9. 0g 1-0> k (ac) 4= 0, k = 1. Proof. We consider again the language L k in the proof of Lemma 2. Following the same argument and the fact that the derivation in a programmed grammar may begin by any rule, we start a derivation from ab k c k using a rule which introduces a substring ef; a string not in L k is obtained, hence L k $ ^k(ac). Lemma 10. Ji x - (SPjac) u Mjac)) #= 0. Proof. The language {a"ba"ca" n ^ 1} is in Ji x, but it is not in SPjac) u (the same arguments as in the proof of Lemmas 3, 4). Lamma 11. 0> x - Ji k (ac) u Mjac)) + 0, fc = 1. Proof. The language L k = {a" +1 b" +k n = 1} u {a"/j fc n = 1} Mjac) is in ^j (it is generated by ({a, b}, {ab k }, {(1: ab -> a 2 6 2, {!.}), (2:a/j -> a 2 /3, {2})}) but it is not in ffljac) (the random context restriction is of no use, as each string contains all symbols), nor in Ji k (ac) (each matrix used for rewriting a m + 1 b m + k can be used also for rewriting a"b k, thus obtaining parasitic strings. Corollary. Ji k (ac) c <$ k (ac), k 1, strict inclusion. Proof. The inclusion is obtained in the standard way and the above lemma proves that it is proper. Lemma 12. (Ji\(ac) n M x (ac)) - % k #= 0, k = 1. Proof. The language L k = {a k "b k "c 2k n = 2} u {b k "c 2k+1 n = 2} can be generated by the matrix grammar G = ({a, b,c},{a 2k b 2k c 2k, b 2k c 2k+ '}, {(aa -> aa k a, bb -> bb k b)}, {aa > aa k a}) as well as by the random context grammar G' = ({a,b,c},{a 2k b 2k c 2k, b 2k c 2k + x }, {(ab -> aa fc /j fc /j, 0, 0), (/JC ->fo/j fc c,0, {a})} The proof that L k ^k is similar to the proof of Lemma 7. Corollary. Ji k <= J4 k (ac), ^k c ( k (ac), k = \, strict inclusions. Lemma 13. 2P x (ac) - ( i k #= 0 for all k = 1. Proof. Consider the language L* = {a/j fc c fc, a/3 2fc c 2fc ) u {/j" fc c" fc n = 1} generated by the programmed grammar G = ({a, b, c}, {ab k c k, b k c k }, {(1: be -> 66 fc c fc c, {2}, 0), (2:a/3-+afc,0,{l})}) 323

Suppose L k = L(G') for a regular control grammar G' = (V, B, P, C) without appearance checking. The strings ab k c k, b k c k must be in B. Each derivation b rk c rh =>* =>* b" k c" k, b rh c rk e B, n > r, must use rules of the form xy > xzy, \x\ ^ k, \y\ ^ k, and all of them are effectively used, hence these rules can be applied also to ab k c k, in the same order, thus obtaining strings not in L k, contradiction. Corollary. & k <= & k (ac) is a strict inclusion for all k ^ 1. Lemma 14. All inclusions M k (ac) a M k+x (ac), Ji k (ac) a Ji k+l (ac), 0> k (ac) c. <= 0 > k+x(ac), k >. 1, are proper. Proof. The language L k in the proof of Lemma 7 is not in & k (ac), the language L k in the proof of Lemma 8 is not in Ji k (ac), whereas the language {ba 2k+l } u u [a 2nk+i b n ^ s) is not in,<% k (ac). All thess languages are in J k+x, hence the relations in Lemma follow. Open prajbms. Which are the relations between 0> k (ac), 0t k (ac) and < $ k (ac) c > (We know only that ^\(ac) (0^k(ac) u 0? k (ac)) 4= 0.) Are the inclusions ^k(ac) c_ c ^\+i(ac) proper? The last problem may seem surprising, but note that the language L k in the proof of Lemma 7 can be generated by a regular control grammar of degree 2: ({a, b}, {ba 2k+ \ a 2k+n h {(/-,: baa -+ baba), (r 2 : aa -> aa 2k a)}, {r] k r*r 2 }, {r,}) (each derivation starts by applying 2k times the rule r x, in the appearance checking mode, and ends by using at least one time the rule r 2 ; if we start from ba 2k+ \ after 2k applications of r,, the rule r 2 cannot be applied, therefore the derivation is blocked). Consider now the relation with families in Chomsky hierarchy. In [4] it is proved that./, <= < \\ a stronger result is true. Theorem 3. M x (ac) a if 2, strict inclusion. Proof. The language L k in the proof of Lemma 11 is linear, hence it is enough to prove the inclusion. For, consider a random context grammar G = (V, B, P), of degree 1. Define the sets B' = {a x (a x, a 2 )(a 2, a 3 )... (a k _ x, a k ) a x a 2... a k e B, a ; e V, 1 ^ i = k}, P' = {(a, b) -> (a,a 1 )(a x, a 2 )... (a fc _,, a k ) (a k, b) (ab -> aa x a 2... a k b, E, F) e P, a,- e V, 1 ^ i fs k} For a string x e (Vu V x V)*, denote by alph(x) the set of symbols in Vappearing in x (possibly in couples of V x V). For a subset T _; P, take the pure grammars G T (a, b) = (V x V, (a, b), T), (a,b)evxv, and define the substitution s r : (V x V)* -> 2 (KXK) *, s r ((a, b)) = L((G r (a, /J)), (a, b) e V x V (the languages L(G T (a, b)) are context-free). Moreover, for a rewriting rule r': (a, I?) -> z in P' associated to r: (a/3 -> aw6, E, E) in P, we consider the gsm g r, which replaces one occurrence of (a, b) by z, leaves unchanged the other symbols and checks whether 324

all the symbols in E are present, but no symbol in E appears in the processed string (a, simulates the application of the rule r). Consider now the subsets B ( 1 0), B ( 2 0),..., B (0) (i) B = U (0) (ii) B^0) n B (0) = 0 for i =t= j, I = i, j ^ n 0, of B' such that: (iii) alph(x) = alph(y) for x, y e B (0), 1 ^ i fs n 0, (iv) if x e B^0), y e B (0), i #= j, 1 ^ /, j = n 0, then a/p/z(x) #= alph(y). For a set C of strings, denote alph(c) = U alph(x). xec Starting from a family B['\..., B^ of sets of strings in (Ku V x V)* (initially we have i = 0 and the sets B (0), 1 ^ j S n 0, constructed as above), we consider the following procedure: For each B (I), 1 ^ j ^ n t, define Tj l) = \r' e P' r': (a, b) -* z is obtained from r: (a/3 -» awb, E, F) in P and alph(z) (fi ( j)), E c alph(b { p), F n alph(bp) = 0} and, for each rule r': (a, 6) -> z in P' such that alph(z) alph(b {i) ) 4= 0, consider the set a r (s r. (i) (B (l) )). The family of these sets is finite (the set P' is finite and the family of sets B { p is finite); denote these sets, in a given order, by B[ i+ n,..., B { n i+ ''. Some remarks about this procedure are worth mentioning: 1. alph(b { p) = alph(s Tjii) (B { p)) a alph(g r (s Tj(i) (B { p))) V, for all re Pas above. 2. As a consequence of the above point, we find that the procedure stops after a finite number of steps, as no further rules r'\ (a, b) -* z can be found such that alph(z) alph(b { p) + 0 for some B (,). Let t be this moment of procedure halting. 3. All sets Bp are context-free languages: we start from finite language B (0) and use finitely many context-free substitutions and gsm mappings (both preserve the context-free-ness). 4. Each substitution s r. (i) corresponds to a derivation in G which does not introduce new symbols in the current string; moreover the Tj l) definition ensures the fact that the random context restrictions are observed. Similarly, each use of a gsm corresponds to using the random context rule r for one step rewriting (this rule enlarges the set alph(x) of the current string). Consequently, the language C = [J B ( p is context-free and h(c) = L(G), where o g i g t 1^7'gni h: (Vu V x V)* > V* is the homomorphism defined by h(a) = a, a e V, h((a, b)) = = b, (a, b) e V x V. In conclusion, L(G) is a context-free language and the proof is terminated. (Received April 4, 1989.) 325

REFERENCES [1] G. Ciucar: On the syntactic complexity of Galiukschov semicontextual languages. Rev. Roumaine Lingv. CLTA 25 (1988), 1,23 28. [2] J. Dassow: Pure grammars with regulated rewriting. Rev. Roumaine Math. Pures Appl. 31 (1986), 8, 657-666. [3] J. Dassow and Gh. Páun: Regulated Rewriting in Formal Language Theory. Akademie Verlag, Berlin 1989. [4] B. S. Galiukschov: Semicontextual grammars (in Russian). Mat. logica i mat. lingv. Kalinin Univ. 1981, 38-50. Í5] S. Marcus: Contextual grammars. Rev. Roumaine Math. Pures Appl. 14 (1969), 10, 1525 to 1534. [6] Gh. Páun: On semicontextual grammars. Bull. Math. Soc. Sci. Math. R. S. Roumanie (N. S.) 28 (76) (1984), 1, 63-68. 17] Gh. Páun: Two theorems about Galiukschov semicontextual languages. Kybernetika 21 (1985), 5,360-365. 18] C.C.Squier: Semicontextual grammars: an example. Bull. Math. Sci. Math. R. S. Roumanie (N. S.) 32 (80) (1988), 2, 167-170. Monica Marcus, Dr. Gheorghe Páun, The Computer Centre of the University of Bucharest, Str. Academiei 14, Bucuresti 70109. Roumania. 326