of poly-slenderness coincides with the one of boundedness. Once more, the result was proved again by Raz [17]. In the case of regular languages, Szila

Similar documents
Note On Parikh slender context-free languages

INFORMATIQUE THÉORIQUE ET APPLICATIONS

Decision Problems Concerning. Prime Words and Languages of the

Note Watson Crick D0L systems with regular triggers

The commutation with ternary sets of words

On the robustness of primitive words

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

Insertion and Deletion of Words: Determinism and Reversibility

Descriptional Complexity of Formal Systems (Draft) Deadline for submissions: April 20, 2009 Final versions: June 18, 2009

Fine and Wilf s Periodicity on Partial Words and Consequences

Unbordered Factors and Lyndon Words

Properties of Fibonacci languages

Power and size of extended Watson Crick L systems

A shrinking lemma for random forbidding context languages

On the Equation x k = z k 1 in a Free Semigroup

Independence of certain quantities indicating subword occurrences

Finite Automata, Palindromes, Powers, and Patterns

About Duval Extensions

Laboratoire d Informatique Fondamentale de Lille

Substitutions, Trajectories and Noisy Channels

A Note on the Number of Squares in a Partial Word with One Hole

ON PARTITIONS SEPARATING WORDS. Formal languages; finite automata; separation by closed sets.

On Shyr-Yu Theorem 1

PERIODS OF FACTORS OF THE FIBONACCI WORD

Theoretical Computer Science. State complexity of basic operations on suffix-free regular languages

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

Binary words containing infinitely many overlaps

Languages and monoids with disjunctive identity

Solvability of Word Equations Modulo Finite Special And. Conuent String-Rewriting Systems Is Undecidable In General.

Balance properties of multi-dimensional words

Insertion operations: closure properties

Linear Algebra (part 1) : Vector Spaces (by Evan Dummit, 2017, v. 1.07) 1.1 The Formal Denition of a Vector Space

Aperiodic languages and generalizations

Elementary 2-Group Character Codes. Abstract. In this correspondence we describe a class of codes over GF (q),

Abstract This work is a survey on decidable and undecidable problems in matrix theory. The problems studied are simply formulated, however most of the

RINGS IN POST ALGEBRAS. 1. Introduction

On the number of occurrences of all short factors in almost all words

Jerey Shallit. Department of Computer Science. University of Waterloo. Waterloo, Ontario N2L 3G1. Canada

One Quantier Will Do in Existential Monadic. Second-Order Logic over Pictures. Oliver Matz. Institut fur Informatik und Praktische Mathematik

Combinatorial Interpretations of a Generalization of the Genocchi Numbers

290 J.M. Carnicer, J.M. Pe~na basis (u 1 ; : : : ; u n ) consisting of minimally supported elements, yet also has a basis (v 1 ; : : : ; v n ) which f

Words with the Smallest Number of Closed Factors

Some Operations Preserving Primitivity of Words

Parikh s theorem. Håkan Lindqvist

arxiv: v2 [math.co] 24 Oct 2012

Locally catenative sequences and Turtle graphics

On Chomsky Hierarchy of Palindromic Languages

Deletion operations: closure properties

ON HIGHLY PALINDROMIC WORDS

On the Simplification of HD0L Power Series

Simple equations on binary factorial languages

On Strong Alt-Induced Codes

A q-matrix Encoding Extending the Parikh Matrix Mapping

On an algebra related to orbit-counting. Peter J. Cameron. Queen Mary and Westeld College. London E1 4NS U.K. Abstract

Primitive partial words

State Complexity of Two Combined Operations: Catenation-Union and Catenation-Intersection

Semi-simple Splicing Systems

Maximum union-free subfamilies

How to Pop a Deep PDA Matters

CERNY CONJECTURE FOR DFA ACCEPTING STAR-FREE LANGUAGES

Product of Finite Maximal p-codes

A version of for which ZFC can not predict a single bit Robert M. Solovay May 16, Introduction In [2], Chaitin introd

On the classication of algebras

arxiv:math/ v1 [math.co] 11 Oct 2002

Periodicity in Rectangular Arrays

(1.) For any subset P S we denote by L(P ) the abelian group of integral relations between elements of P, i.e. L(P ) := ker Z P! span Z P S S : For ea

The cocycle lattice of binary matroids

TECHNISCHE UNIVERSITÄT DRESDEN. Fakultät Informatik. Technische Berichte Technical Reports. Daniel Kirsten. TUD / FI 98 / 07 - Mai 1998

On Locating-Dominating Codes in Binary Hamming Spaces

group Jean-Eric Pin and Christophe Reutenauer

Nordhaus-Gaddum Theorems for k-decompositions

On Shuffle Ideals of General Algebras

Invertible insertion and deletion operations

Note that neither ; nor are syntactic constituents of content models. It is not hard to see that the languages denoted by content models are exactly t

A new Cryptosystem based on Formal Language Theory

Counting and Constructing Minimal Spanning Trees. Perrin Wright. Department of Mathematics. Florida State University. Tallahassee, FL

The number of runs in Sturmian words

arxiv:math/ v1 [math.co] 10 Oct 2003

Vector Space Basics. 1 Abstract Vector Spaces. 1. (commutativity of vector addition) u + v = v + u. 2. (associativity of vector addition)

Mergible States in Large NFA

RECENT RESULTS IN STURMIAN WORDS 1. LITP, IBP, Universite Pierre et Marie Curie, 4, place Jussieu. F Paris Cedex 05, France

Notes on the matrix exponential

Analysis on Graphs. Alexander Grigoryan Lecture Notes. University of Bielefeld, WS 2011/12

DESCRIPTIONAL COMPLEXITY OF NFA OF DIFFERENT AMBIGUITY

2 I like to call M the overlapping shue algebra in analogy with the well known shue algebra which is obtained as follows. Let U = ZhU ; U 2 ; : : :i b

Power of controlled insertion and deletion

N.G.Bean, D.A.Green and P.G.Taylor. University of Adelaide. Adelaide. Abstract. process of an MMPP/M/1 queue is not a MAP unless the queue is a

Economics Bulletin, 2012, Vol. 32 No. 1 pp Introduction. 2. The preliminaries

On the reconstruction of the degree sequence

How Many Holes Can an Unbordered Partial Word Contain?

A New Shuffle Convolution for Multiple Zeta Values

THE STRUCTURE OF A RING OF FORMAL SERIES AMS Subject Classification : 13J05, 13J10.

Letter frequency in infinite repetition-free words

ON MINIMAL CONTEXT-FREE INSERTION-DELETION SYSTEMS

State Complexity of Neighbourhoods and Approximate Pattern Matching

Properties of θ-super positive graphs

Math 375 First Exam, Page a) Give an example of a non-abelian group of innite order and one of nite order. (Say which is

On Stateless Multicounter Machines

Decidability and Undecidability of Marked PCP Vesa Halava 1, Mika Hirvensalo 2;1?, and Ronald de Wolf 3;4 1 Turku Centre for Computer Science, Lemmink

Rings With Topologies Induced by Spaces of Functions

Transcription:

A characterization of poly-slender context-free languages 1 Lucian Ilie 2;3 Grzegorz Rozenberg 4 Arto Salomaa 2 March 30, 2000 Abstract For a non-negative integer k, we say that a language L is k-poly-slender if the number of words of length n in L is of order O(n k ). We give a precise characterization of the k- poly-slender context-free languages. The well-known characterization of the k-poly-slender regular languages is an immediate consequence of ours. Keywords: context-free language, poly-slender language, Dyck loop Introduction An innite sequence (# L (n)) n0 can be associated in a natural way to a language L: # L (n) is the number of words of length n in L. The idea is by no means new; for instance, in the rst ICALP, Berstel [3] considered the notion of the population function of a language L which associates, to every n, the number of words of length at most n in L. The notion of the number of words of the same length is certainly very basic one in language theory and this is why some results have been proved several times. We recall briey in the following the history of such results. When # L (n) is bounded from above by a xed constant, such languages are called semidiscrete in Kunze et al. [11] and slender in Andrasiu et al. [1]. The slender regular languages have been characterized as nite unions of sets of the form uv w in [11] but the result was not well known and it was proved again independently by Paun and Salomaa [16] and Shallit [19]. A similar situation is in the context-free case. The characterization of the slender context-free languages as nite unions of sets of the form fuv n wx n y j n 0g was proved by Latteux and Thierrin [12] (they called such nite unions iterative languages) but, again, the result was not widely known and the same characterization was conjectured in [16] and shown to be true by Ilie [9]. The proof of [9] is completely dierent from the one of [12]. The characterization has been strengthened in [10] where some upper bounds on the lengths of the words u; v; w; x; y are given. The case when # L (n) is bounded by a polynomial (we say L is poly-slender) has been considered by Latteux and Thierrin [13] who proved that for context-free languages the notion 1 This research was partially done during the rst author's visit to Leiden University. 2 Turku Centre for Computer Science TUCS, FIN-20520, Turku, Finland. 3 Research supported by the Academy of Finland, Project 137358. On leave of absence from Faculty of Mathematics, University of Bucharest, Str. Academiei 14, R-70109, Bucharest, Romania. 4 Department of Computer Science, Leiden University, P.O.Box 9512, 2300 RA Leiden, The Netherlands and Department of Computer Science, University of Colorado at Boulder, Boulder, CO 80309, U.S.A. 1

of poly-slenderness coincides with the one of boundedness. Once more, the result was proved again by Raz [17]. In the case of regular languages, Szilard et al. [20] gave a ne characterization based on the order of the polynomial which bounds # L (n). Besides the above mentioned results, there has been recently a lot of attention devoted to other aspects of slenderness. Some applications of the slender languages to cryptography are shown in [1], Shallit [19] investigated slender regular languages in connection with numeration systems, the slenderness of L-languages has been considered by Dassow et al. [5] and Nishida and Salomaa [15] and Honkala studied in [7] and [8] a generalization of the notion of slenderness, called Parikh slenderness, by considering languages for which the number of words with the same Parikh vector is bounded from above by a constant. In this note, we consider the situation when the degree of the polynomial bounding # L (n) is a xed non-negative integer; the obtained languages are called k-poly-slender. Generalizing the result of [12] and [9], we give a characterization of the k-poly-slender context-free languages. The structure of the Dyck language is the base for the structure of these languages. The corresponding characterization given in [20] for regular languages follows immediately from ours. Poly-slender languages We rst x some notations. For a word w and a letter a, jwj is the length of w, jwj a is the number of occurrences of a in w, and (w) denotes the primitive root of w. The conjugacy relation is denoted ; for two words u; v, u v i u = pq; v = qp, for some p; q. The empty word is denoted by ". For basic notions and results of combinatorics on words and formal languages we refer to [4, 14] and [18], respectively. For a language L, denote # L (n) = card(fw 2 L j jwj = ng); this is referred to as the complexity (function) of L. For an integer k 0, L is called k-poly-slender if # L (n) = O(n k ). L is poly-slender i it is k-poly-slender, for some k 0. A language L is called bounded if there are some words w 1 ; w 2 ; : : : ; w n 2 such that L w 1 w 2 : : : w n. It is clear that the class of poly-slender languages is the same with the class of languages with the population function polynomially limited. Therefore, the characterization theorem of [13] can be written as below (it appears in this form in [17]). Theorem 1 ([13, 17]). A context-free language is poly-slender i it is bounded. Dyck loops Consider the Dyck language of order k; k 1, D k f[ i ; ] i j 1 i kg. D k is generated by S?! SS j [ i S] i j ". Consider also a word z 2 D k with jzj [i = jzj ]i = 1; 1 i k, and some words u i ; v i ; w i 2, where \ f[ i ; ] i j 1 i kg = ;. For any integers n i 0; 1 i k, dene the morphism h n1 ;::: ;n k : ( [ f[ i ; ] i j 1 i kg)?!, by a?! a, for a 2, [ i?! u n i i, ] i?! v n i i, 1 i k. Put z = z 1 z 2 : : : z 2k ; z j 2 f[ i ; ] i j 1 i kg. Then D is a k-dyck loop if, for some u i, v i, w i, z as above, D = fh n1 ;::: ;n k (w 0 z 1 w 1 z 2 w 2 : : : z 2k w 2k ) j n i 0g: (1) 2

We shall call z an underlying word of D. (Clearly, z is not unique.) Also, h will stand for h 1;1;::: ;1 and will be called an underlying morphism of D. D is a Dyck loop i it is a k-dyck loop, for some k. Notice that if l < k, then any l-dyck loop is also a k-dyck loop. We give below two examples of Dyck loops which will be used also later. Example 2. For the underlying Dyck word z = [ 1 ] 1 [ 2 [ 3 [ 4 ] 4 [ 5 ] 5 ] 3 [ 6 ] 6 [ 7 ] 7 ] 2, we construct the Dyck loop L 1 = fa 2n 1 (ba) n 1 b(ab) 3n 2 b n 3 b 5n 4 b n 5 a 4n 5 (aba) n 3 b 3n 6 a n 7 b 2n 7 b n 2 j n i 0g: (2) About the underlying morphism we mention only that the images of any of ] 4 and ] 6 are empty. Example 3. The underlying Dyck word for the Dyck-loop L 2 = f(ab) 2n 1 a(ba) 3n 2 aab n 2 b 2n 3 b n 4 aba n 4 a 3n 3 a n 5 a 2n 1 j n i 0g; (3) is z = [ 1 [ 2 ] 2 [ 3 [ 4 ] 4 ] 3 [ 5 ] 5 ] 1 and we assume h(] 5 ) = ". Bounded languages The following result of Ginsburg and Spanier [6] will be essential for our purpose. Theorem 4 ([6]). The family of bounded context-free languages is the smallest family which contains all nite languages and is closed under the following operations: (i) union, (ii) catenation, (iii) (x; y)? L = S n0 xn Ly n, for x; y words. Remark 5. Clearly, Theorem 4 is still valid if, instead of nite languages, one starts from unary languages (that is, languages containing one word only). Moreover, if one starts from unary languages and uses only the operation (ii) and (iii) from Theorem 4, then what is obtained is always a Dyck loop. Conversely, any Dyck loop can be obtained in this way. Indeed, this is clear from the denition of the Dyck loops; the role of the production S?! SS is the same with the one of the catenation and the role of a production S?! [ i S] i is the same with the one of the operation?, in the sense that we use (u i ; v i )? L. Therefore, we get from Theorems 1 and 4 Theorem 6. For a context-free language L, the following assertions are equivalent: (i) L is bounded, (ii) L is poly-slender, (iii) L is a nite union of Dyck loops. Proof. First, (i) and (ii) are equivalent by Theorem 1. Second, (iii) clearly implies any of (i) and (ii). Third, (i) implies (iii) follows from Remark 5 and the distributivity of the catenation and \?" with respect to union. 3

Characterization of k-poly-slenderness We prove in this section our main result, that is, the characterization of the k-poly-slender context-free languages. In the case of 0-poly-slender languages, such a characterization was proved in [12] and [9]; using the above notations, the result of [12, 9] is written as Theorem 7 ([12, 9]). A context-free language is 0-poly-slender i it is a nite union of 1-Dyck loops. In what follows, we shall generalize Theorem 7 to Theorem 8. For any k 0, a context-free language is k-poly-slender i it is a nite union of (k + 1)-Dyck loops. Before proving the theorem we need several notions and a lemma. For three words u; w; v such that u and v are non-empty, we say that w links u with v, denoted link(u; w; v), i (u)w = w(v); it means that there are words p and q such that (u) = pq; (v) = qp, and w 2 (pq) p. The idea is that w links u with v when in words of the form u n wv m the period j(u)j is continued over w throughout v m (u n wv m is a prex of (u)! ), that is, one cannot really distinguish w there. Notice that, when w is empty, link(u; "; v) means precisely that u and v are powers of the same word, in accordance with the intuitive meaning of link. The following lemma will be a very useful tool in the proof. Lemma 9. Consider the words x i 2 + ; y i 2, and some non-negative integers n i ; m i. Denote w = y 0 x n 1 1 y 1x n 2 2 y 2 : : : x nr r y r, w 0 = y 0 x m 1 1 y 1x m 2 2 y 2 : : : x mr r y r and assume that link(x i ; y i ; x i+1 ) holds for no i. Then there is a constant N 0, depending only on the lengths of the words x i and y i, such that, if all n i ; m i are larger than N 0 and there is i with n i 6= m i, then w 6= w 0. Proof. We prove that N 0 = 1 (max min jx jy i j ij + 4 max jx i j) is good. Assume w = w 0. Without loss of generality, we may assume n 1 > m 1. If (n 1? m 1 )jx 1 j jy 1 j + jx 1 x 2 j, then, by Fine and Wilf's theorem and the choice of N 0, (x 1 ) (x 2 ) and, if (x 1 ) = pq; (x 2 ) = qp, then y 1 2 (pq) p. This means link(x 1 ; y 1 ; x 2 ), a contradiction. Otherwise, by the choice of N 0, we get, for some s 0, x n 1?m 1 1 y 1 = y 1 (x 2 ) s thus again link(x 1 ; y 1 ; x 2 ), contradicting our assumption. The lemma is proved. Proof of Theorem 8. One implication is obvious. For the other, the basic idea is to do the construction in Theorem 4 in a certain way, that is (roughly), anytime \?" is applied, the highest power of n in the complexity function # L (n) associated with the language L is increased by one and, anytime catenation is applied to two innite languages, the highest exponent in the complexity of the resulting language is the sum of the former two. Let us consider a context-free language L which is k-poly-slender. Then, by Theorem 6, L is a nite union of Dyck loops. If L contains no l-dyck loop with l > k + 1, then we are done. Assume then there is such a loop, say D, and that it has the form in (1) with l instead of k. We may assume, with no loss of generality, that u i v i 6= ", for any 1 i l, as otherwise we have a Dyck loop of smaller order. We shall consider very much in the sequel the links made by w i between the two adjacent images of h, h(z i ) and h(z i+1 ). But those images of h which are empty have no interest for 4

the language (this is why link is undened when the rst or the third component is empty) and therefore, for any 1 i 2l? 1, we dene next(i) as the smallest j i + 1 such that h(z j ) 6= ". If there is no link(h(z i ); w i w i+1 : : : w next(i)?1; h(z next(i))), then, by Lemma 9, any two dierent tuples of n i 's (n i 's are all assumed large enough { the complexity order is not aected) give dierent words of D. Therefore, # D (n) 6= O(n l?2 ), which contradicts the fact that L is k-poly-slender. Consequently, there are such links. We then group together the linked powers and apply Lemma 9 to those. In order to make things clear, we dene two relations on the set fi j 1 i 2l; h(z i ) 6= "g. (Recall that the positions i with h(z i ) = " are ignored.) The rst is chain(i; next(i)) i link(h(z i ); w i w i+1 : : : w next(i)?1; h(z next(i))). We say that i and j are in the same chain i ] chain (i; j), where ] chain is the equivalence generated by chain. The second is syst(i; j) i ] chain (i; j) or z i = [ p ; z j =] p, for some 1 p l. We say that i and j are in the same system i ] syst (i; j), where ] syst is the equivalence generated by syst. For the Dyck loop in (2), we have the following classes of ] chain : f1g, f2; 3g, f4; 5; 7g, f8g, f9g, f10g, f12g, f13; 14g and the classes of ] syst (unions of the former ones): f1; 2; 3; 12; 13; 14g, f4; 5; 7; 8; 9g, f10g. We next group together all powers in the same chain. For (2) this means that we write it as L 1 = fa 2n 1 b(ab) n 1+3n 2 b n 3+5n 4 +n 5 a 4n 5 (aba) n 3 b 3n 6 a n 7 b n 2+2n 7 j n i 0g: Now, the application of Lemma 9 gives a dierent result in the sense that the powers in the lemma are no longer single powers of our Dyck loop but linear combinations of those in the same chain. This means for (2) that any new tuple (2n 1 ; n 1 + 3n 2 ; n 3 + 5n 4 + n 5 ; 4n 5 ; n 3 ; 3n 6 ; n 7 ; n 2 + 2n 7 ) (recall that we assume the elements large enough) gives a new word. Incidentally, for (2), we get such a new tuple exactly when the tuple (n i ) 1i7 is new, due to the fact that the three systems corresponding to the classes of ] syst, namely 8 >< >: 2n 1 = 0 n 1 + 3n 2 = 0 n 7 = 0 n 2 + 2n 7 = 0 8 < : n 3 + 5n 4 + n 5 = 0 4n 5 = 0 n 3 = 0 3n6 = 0 have only trivial solutions. (It is worth noticing that the unknowns in the above systems are not the exponents but rather the dierencs of these for two dierent descriptions of the same word.) However, this need not be the case in general. As an example, consider the loop in (3). There are links and we have the classes of chain ] : f1; 2g, f3; 4; 5g, f6; 7; 8; 10g and only one class of syst ] : f1; 2; : : : ; 8; 10g. We write L 2 as L 2 = fa(ba) 2n 1+3n 2 aab n 2+2n 3 +n 4 aba 2n 1+3n 3 +n 4 +n 5 j n i 0g and, because the matrix of the associated system has more columns than rows, the associated system has also non-trivial solutions. Consider then, in the general case, the systems associated with the equivalence classes of syst ], as seen in the above example. (Notice that each system has as many equations as the number of classes of chain ] in the respective class of syst ].) As we noticed, if all such systems 5 (4)

have trivial solutions only, then we have the same situation as in the case of no links. Thus, the same contradiction with the k-poly-slenderness of L is obtained. Therefore, there are systems which have also non-trivial solutions. Consider one class of ] syst, say [i 0 ] ] syst such that its associated system, say j=1 a ij n j = 0; for all 1 i s; (5) has also non-trivial solutions. Here s is the number of chains (classes of ] chain ) in [i 0 ] ] syst and t is the number of n i 's involved, that is, the number of pairs [ i ] i involved. Let us show rst that s t + 1. We can view the class [i 0 ] ] syst as a graph with s vertices, which are the chaines, such that two vertices are connected by an edge only if there is a pair [ i ] i connecting them according with the denition of syst ([ i is in one chain and ] i is in the other). As the graph is connected, there are at least s? 1 edges, hence there are at least s? 1 pairs [ i ] i, which means t s? 1. Assume that s = t + 1 (as, e.g., in the rst system in (4)). The matrix of the system A = (a ij ) 1is, has one or two non-zero elements in each column and at least one in each row. 1jt Therefore, there is a row with exactly one non-zero element. The matrix obtained by eliminating the row and the column corresponding to this element has the same properties as A. Inductively, we obtain that rank(a)=t and hence the system (5) has only trivial solutions, a contradiction. Therefore, s t and rank(a) < t. If we denote the columns of A by A i ; 1 i t, then there exists a non-trivial linear dependence of A i 's, say c i A ji = sx d i A ki ; where c i 's and d P i 's are positive integers. Recall that we are interested in the values of the vector t n ia i, for all n i 0. Denote J = fj i j 1 i rg, K = fk i j 1 i sg; we may assume J \ K = ;. We claim that the following equality holds: n n i A i j n i 0 o = r[ n q=1 q i A ji + i62j m i A i + i6=q o m ji (c i A ji ) j m i 0; 0 q i c i? 1 : The inclusion \" is obvious. Let us prove the \" part. Consider some xed (n 1 ; n 2 ; : : : ; n t ) and put, for any 1 i r, n ji = n 0 j i c i + q i, 0 q i c i? 1. Take q; 1 q r, such that n 0 = minfn0 jq j i j 1 i rg. We have then n i A i = = i62j n i A i + q i A ji + i62j[k ((n 0 j i? n 0 jq )c i + q i )A ji + n 0 jq n i A i + sx (n ki + n 0 jq d i)a ki + 6 c i A ji i6=q (n 0 j i? n 0 jq )(c ia ji ) (6)

and the inclusion is proved. Now, in any set in the right-hand side of (6) we have essentially combinations of t? 1 vectors instead of t as we had initially, that is, in the left-hand side of (6). But, one A i less means exactly one pair of parentheses less in the underlying Dyck word z. That means, the l-dyck loop we started with can be written as a nite union of (l? 1)-Dyck loops just because l > k + 1. (Precisely, we proved that D can be decomposed as a union of r Q r c i (l? 1)-Dyck loops.) The above reasoning can be iterated, if needed, and therefore concludes the proof. We next give some examples of the construction in the proof of Theorem 8. Example 10. Consider the 5-Dyck loop in (3) which we have already discussed in the proof of Theorem 8. The matrix of the unique associated system is A = 0 @ 2 3 0 0 0 0 1 2 1 0 2 0 3 1 1 1 A We have the following simple relation between the columns A i ; 1 i 5, of A: A 3 = 2A 4 + A 5. It implies that n 5X o n 5X o n i A i j n i 0 = m i A i j m i 0 which allows us to write L 2 as i6=3 L 2 = fa(ba) 2m 1+3m 2 aab m 2+m 3 aba 2m 1+m 3 +m 4 j m i 0g: The pair of parentheses [ 3 ] 3 disappeared. But L 2 can be still reduced as the new matrix, say B = (B 1 B 2 B 3 B 4 ) = (A 1 A 2 A 4 A 5 ) has still more columns than rows. After noticing the linear combination 3B 1 + 2B 3 = 2B 2 + 8B 4, we get, according with the proof of Theorem 8, n 4X m i B i j m i 0 o = [ 2[ 2[ 1[ 1[ q 1 =0 q 3 =0 q 1 =0 q 3 =0 fq 1 B 1 + q 3 B 3 + p 2 B 2 + p 3 (2B 3 ) + p 4 B 4 j p 2;3;4 0g fq 1 B 1 + q 3 B 3 + p 1 (3B 1 ) + p 2 B 2 + p 4 B 4 j p 1;2;4 0g: Therefore, we obtain the following decomposition of L 2 as a nite union of 3-Dyck loops: L 2 = 2[ 1[ i=0 j=0 L 0 i;j [ 2[ 1[ L 00 i;j i=0 j=0 where, for any 0 i 2; 0 j 1, L 0 i;j = fa(ba)2i (ba) 3p 2 aab j b p 2+2p 3 aba 2i+j a 2p 3+p 4 j p 2;3;4 0g; L 00 i;j = fa(ba)2i (ba) 6p 1+3p 2 aab j b p 2 aba 2i+j a 6p 1+p 4 j p 1;2;4 0g; which cannot be reduced further as # L2 (n) = (n 2 ). 7

Example 11. Consider the 4-Dyck loop L 3 = fa n 1 a n 2 ba n 2 a n 3 ba n 3 a n 4 ba n 4 a n 1 j n i 0g: As above, we reduce it to L 3 = fa m 1 a m 2 ba m 2 ba m 4 ba m 4 a m 1 j m 1;2;4 0g [ fa m 2 ba m 2 a m 3 ba m 3 a m 4 ba m 4 j m 2;3;4 0g: We would like to notice that the 3-Dyck loop L 4 = fa n 1 a n 2 ba n 2 a n 3 ba n 3 a n 1 j n i 0g; which is actually very similar with L 2 cannot be reduced. The (essential) dierence is that the columns of the matrix corresponding to L 4 are linearly independent whereas the ones of L 3 are not. Consequences The rst of the consequences of Theorem 8 is the characterization of k-poly-slender regular languages. We say that the k-dyck loop D in (1) is degenerate if, for any 1 i k, at most one of the words u i and v i is non-empty. We get then immediately from Theorem 8 the following result which has been proved in [20]. Corollary 12. For any k 0, a regular language is k-poly-slender i it is a nite union of degenerate (k + 1)-Dyck loops. Consider next, for a language L, the following smoothening of the complexity function # L (n): # L (n) = max 1in # L(i): We have then from Theorem 8 Corollary 13. For any poly-slender context-free language L, there exists a k 0 such that # L (n) = (n k ). This means there is nothing in between integer powers, e.g., there is no context-free language the complexity of which is of order (n 3:4 ), (log n), (n log log n), etc. Acknowledgements We would like to thank the anonymous referees for useful remarks concerning especially the clarity of the proof of Theorem 8 and for pointing out the references [11] and [12]. References [1] Andrasiu, M., J. Dassow, Gh. Paun, and A. Salomaa, Language-theoretic problems arising from Richelieu cryptosystems, Theoret. Comput. Sci. 116 (1993) 339 { 357. [2] Autebert, J.-M., J. Bestel, and L. Boasson, Context-free languages and push-down automata, in G. Rozenberg, A. Salomaa, eds., Handbook of Formal Languages (Springer-Verlag, Berlin, Heidelberg, 1997) 111 { 174. 8

[3] Berstel, J., Sur la densite asymptotique de langages formels, in M. Nivat, ed., Automata, Languages, and Programming (North-Holland, 1972) 345 { 358. [4] Chorut, C., and J. Karhumaki, Combinatorics of Words, in G. Rozenberg, A. Salomaa, eds., Handbook of Formal Languages (Springer-Verlag, Berlin, Heidelberg, 1997) 329 { 438. [5] Dassow, J., G. Paun and A. Salomaa, On thinness and slenderness of L languages, Bull. EATCS 49 (1993) 152{158. [6] Ginsburg, S., and E. H. Spanier, Bounded ALGOL-like languages, Trans. Amer. Math. Soc. 113 (1964) 333 { 368. [7] Honkala, J., On Parikh slender languages and power series, J. Comput. System Sci. 52 (1996) 185 { 190. [8] Honkala, J., Decision problems concerning thiness and slenderness of formal languages, Acta Inform. 35 (1998) 625 { 636. [9] Ilie, L., On a conjecture about slender context-free languages, Theoret. Comput. Sci. 132 (1994) 427 { 434. [10] Ilie, L., On lengths of words in context-free languages, Theoret. Comput. Sci., to appear. [11] Kunze, M., H.J. Shyr, and G. Thierrin, h-bounded and semidiscrete languages, Inform. and Control 51 (1981) 147 { 187. [12] Latteux, M., and G. Thierrin, Semidiscrete context-free languages, Internat. J. Comput. Math. 14 (1983) 3 { 18. [13] Latteux, M., and G. Thierrin, On bounded context-free languages, Elektron. Informtionsverarb. Kybernet. 20 (1984) 3 { 8. [14] Lothaire, M., Combinatorics on Words (Addison-Wesley, Reading, MA., 1983). [15] Nishida, T., and A. Salomaa, Slender 0L languages, Theoret. Comput. Sci. 158 (1996) 161{176. [16] Paun, Gh., and A. Salomaa, Thin and slender languages, Discrete Appl. Math. 61 (1995) 257 { 270. [17] Raz, D., Length considerations in context-free languages, Theoret. Comput. Sci. 183 (1997) 21 { 32. [18] Salomaa, A., Formal Languages (Academic Press, New York, 1973). [19] Shallit, J., Numeration systems, linear recurrences, and regular sets, Inform. and Comput. 113 (1994) 331 { 347. [20] Szilard, A., S. Yu, K. Zhang, and J. Shallit, Characterizing regular languages with polynomial densities, Proc. of the 17th MFCS (Prague 1992) Lecture Notes in Comput. Sci., 629, Springer, Berlin-New York, 1992, 494 { 503. 9