\A
Algebraic Th "'Automata and
This page intentionally left blank
Algebraic Th Of
Automata and Languages
Masami ...
90 downloads
1119 Views
10MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
\A
Algebraic Th "'Automata and
This page intentionally left blank
Algebraic Th Of
Automata and Languages
Masami Ito
v N E W JERSEY
LONDON
World Scientific
SINGAPORE
.
BElJlNG * SHANGHAI
HONG KONG * TAIPEI
CHENNAI
Published by World Scientific Publishing Co. Re. Ltd. 5 Toh Tuck Link, Singapore 596224 USA ofice: Suite 202, 1060 Main Street, River Edge, NJ 07661 UK ofice: 57 Shelton Street, Covent Garden, London WC2H 9HE
British Library Cataloguing-in-PublicationData A catalogue record for this book is available from the British Library.
ALGEBRAIC THEORY OF AUTOMATA AND LANGUAGES Copyright 0 2004 by World Scientific Publishing Co. Re. Ltd. All rights reserved. This book or parts thereoj may not be reproduced in any form or by any means, electronic or mechanical, including photocopying, recording or any information storage and retrieval system now known or to be invented, without written permission from the Publisher.
For photocopying of material in this volume, please pay a copying fee through the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, USA. In this case permission to photocopy is not required from the publisher.
ISBN 981-02-4727-3
Printed in Singapore by World Scientific Printers (S)Pte Ltd
In Memory of Professor Jurgen Duske
This page intentionally left blank
Preface The theory of formal languages began with the classification of languages by N. Chomsky in Syntactic Structures in 1957. Now, this classification is called the Chomsky hierarchy of languages. On the other hand, the theory of automata was initiated by M.O. Rabin and D. Scott in 1959. Their work can be regarded as the most important first step in the theory of automata in spite of its simplicity. Since then, these two fields have been developed by many researchers as two important theoretical foundations of computer science. In this book, we will mainly handle formal languages and automata from the algebraic point of view. In the first two chapters, we will investigate the algebraic structure of automata and then we will deal with a kind of global theory, i.e. partially ordered sets of automata. In the following four chapters, we will study grammars, languages and operations on languages. In the last section, we will introduce special kinds of automata, i.e. directable automata. The subjects in the book seem to be unique compared to other books with similar titles. The contents of the book are based on the author’s work which started in the mid 1970s. The author recognizes the importance of much research completed prior to the beginning of his own work. He would like t o thank his co-authors of the joint papers which have become the basis of this book, i.e. Prof. G. Thierrin, Dr. S.S. Yu, Dr. L. Kari, Dr. P.V. Silva, Dr. B. Imreh, Dr. M. Katsura and Dr. M. Steinby. He would like t o dedicate this book to Prof. J. Duske who passed away in 2000. In 1982, Prof. Duske invited the author t o stay in Hannover vii
viii
PREFACE
for four months and offered the author the opportunity to do joint work with him. During this collaboration, the author was able to learn much from him from the points of view of mathematics and humanity. We were able to publish in a very short time two joint papers of which the author is very proud. One of these papers was a paper on directable automata which has become a foundation of this book as well. The author is also grateful to Mr. T . Kadota for his assistance in making files of the manuscript of this book. The author appreciates Mr. Y. Kunimochi, Mr. H. Onoda and Dr. M. Toyama very much for their assistance in editing this book. He thanks also Mr. C. Everett for proofreading the English in the book. The author thanks to Dr. Cs. Imreh and Dr. K. Tsuji for their careful reading of the manuscript and useful comments. Dr. Tsuji is the most recent of the author’s co-author of a paper related t o this book. Finally, the author is thankful t o the staff at the World Scientific Publishing Company for their assistance. Especially, he would like to express his gratitude to Dr. J . T . Lu for the extended patience and encouragement to the author.
January 2004
Masami Ito
Contents vii
Preface 0 Introduction
1
1 Group-Matrix Type Automata 1.1 Strongly connected automata . . . . . . . . . . . . . . 1.2 Group-matrix type automata . . . . . . . . . . . . . . 1.3 Representations of automata . . . . . . . . . . . . . . 1.4 Equivalence of regular systems . . . . . . . . . . . . . 1.5 Characteristic monoids and input sets . . . . . . . . . 1.6 Direct product of automata . . . . . . . . . . . . . . . 1.7 Factor automata . . . . . . . . . . . . . . . . . . . . . 1.8 Prime order case . . . . . . . . . . . . . . . . . . . . . 1.9 Regularities . . . . . . . . . . . . . . . . . . . . . . . . 1.10 Application to factor automata . . . . . . . . . . . . . 1.11 Application to direct products . . . . . . . . . . . . . . 2 General Automata 2.1 Generalized representations . . . . . 2.2 Some properties . . . . . . . . . . . . . 2.3 Representations of general automata 2.4 Regularities . . . . . . . . . . . . . . . 3 Classes of Automata as Posets
5 6 9 19 22 30 35 38 41 43 46 47
51 . . . . . . . . . . 51 ......... 54 . . . . . . . . . . 57 ......... 61
63 3.1 Introductory notions and results . . . . . . . . . . . . 63 3.2 Classes of automata . . . . . . . . . . . . . . . . . . . 65 3.3 Classes which do not form lattices . . . . . . . . . . . 69
ix
CONTENTS
X
3.4 Classes which form lattices . . . . . . . . . . . . . . . 71 3.5 Computation of [ A* B ].(. ) . . . . . . . . . . . . . . . 76 4
5
Languages and Operations 4.1 Grammars and acceptors . . . . . . 4.2 Operations on languages . . . . . . 4.3 Shuffle products and n-insertions . 4.4 Decompositions . . . . . . . . . . . . 4.5 Equations on languages . . . . . . 4.6 Shuffle closures . . . . . . . . . . . . Shuffle Closed Languages 5.1 Sh-closed and ssh-closed languages 5.2 Sh-free languages and sh-bases . . 5.3 Commutative regular languages . . 5.4 Regular ssh-closed languages . . . 5.5 Hypercodes . . . . . . . . . . . . . .
.
83 . . . . . . . . . . 83 . . . . . . . . . . 93 . . . . . . . . . . 94 ......... 96 . . . . . . . . . . 99 . . . . . . . . . 102
. . . . .
113 . 113 . 114 . 117 . 122 124
. . . . .
6 Insertions and Deletions 6.1 Insertion closures . . . . . . . . . . . . 6.2 Deletion closures . . . . . . . . . . . . 6.3 Ins-closed and del-closed languages . 6.4 Combination of operations . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......... .
. . .
127 ........ 127 . . . . . . . . 130 . . . . . . . . . 135 . . . . . . . . . 137
7 Shuffles and Scattered Deletions 141 7.1 Shuffle residuals and closures . . . . . . . . . . . . . . 141 7.2 Maximal shuffle residuals . . . . . . . . . . . . . . . . 145 7.3 Scattered deletion closure . . . . . . . . . . . . . . . . 151 8 Directable Automata 8.1 Deterministic case . . . . . . . . . . 8.2 Nondeterministic case . . . . . . . 8.3 Classes of regular languages . . . . 8.4 Commutative case . . . . . . . . . .
157
. . . .
. . . .
. . . . . . . . 158 . . . . . . . . . 162 . . . . . . . . . 164 . . . . . . . . 181
Bibliography
189
Index
197
Chapter 0
Introduction Let A be a nonempty set. Throughout this book, by IAl we denote the cardinality of A. Let A , B be sets and let p be a mapping of A into B . Then p is called a surjection if p(A) = { p ( a ) 1 a E A } = B and p is called an injection if, for any a,a‘ E A, a # a’ if and only if p(a) # p(a’). If a mapping is a surjection and at the same time an injection, then it is called a bzjection. An algebraic system ( A ,.) is called a semigroup if it satisfies the following conditions: (1) a b E A for any a,b E A. ( 2 ) a . ( b . c ) = (a.b) - c for any a , b, c E A. A semigroup A having the identity e is called a monoid where a e = e . a = a for any a E A. Let a , b E A. If there is no danger of confusion, we denote A and ab instead of ( A ,.) and a . b. A group G is a monoid having the inverse element 9-l of any g E G satisfying the condition: gg-’ = g - l g = e. A subset H E G is called a subgroup of a group G if H itself is a group. An important subgroup of a group is a normal subgroup. Let H be a subgroup of a group G. Then H is called a normal subgroup of G if g-lHg g H holds for any g E G. A normal subgroup induces a quotient group. Let H C G be a normal subgroup of G . Then G can be decomposed into G = H glH g2H . . . where gi E G, i 2 1 and stands for a disjoint union. For the set { H ,g1H, gzH, . . .}, we can introduce the multiplication operation as follows: (1) H . H = H . ( 2 ) H . g i H = g i H . H = giH for a n y i 2 1. (3) giH.gjH = gigjH for any i ,j 2 1. Together with this operation, the set { H ,g1H, g2H, . . .} forms a group, called the quotient group, and denoted by G / H . It is %
+
+
+
+
+
2
CHAPTER 0. INTRODUCTION
obvious that any group G has { e } and G, itself as normal subgroups where e is the identity of G. A group G whose normal subgroups are only { e } and G is called a simple group. A semigroup (monoid, group) A is said to be commutative if ab = ba for any a, b E A . Let A and A’ be monoids (groups) and let p be a mapping of A into A’. Then p is called a homomorphism if p(ab) = p ( a ) p ( b ) and p ( e ) = e‘ for any a , b E A where e and e‘ are the identities of A and A’, respectively. Moreover, if p is a bijection, then p is called an isomorphism. In this case, p(A) = A’ and we denote A M A’. A homomorphism of a monoid into itself is called an endomorphism and an isomorphism of a monoid (group) onto itself is called automorphism. Let p be a homomorphism of a group G onto a group G‘. Then the set { g E G 1 p ( g ) = e‘ where e’ is the identity of G’} is called the kernel of p and denoted by Ker(p). Ker(p) is a normal subgroup of G and G‘ M G/Ker(p). Conversely, if H is a normal subgroup of a group G, then we have the following homomorphism cp called the natural homomorphism of G onto G / H : cp(g) = gH for any g E G. Moreover, H = Ker(cp). Let X be a finite nonempty set. In formal language theory, X is called an alphabet. By X+ we denote the set of all finite sequences of the elements of X . X+ is called the free semigroup generated by X and it has the following operation, called the concatenation: For any 2,y E X + , z y E X + . Adjoining the identity E to X+,we obtain X* which is called the free monoid generated by X . Any element of X* is called a word over X and E is called the empty word. Any subset of X * is called a language over X. The study of words and languages is one of our main goals. There is a system which produces a language, called a grammar. A grammar is described by a quadruple = ( V , X , P , S ) . In this book, we will mainly deal with regular grammars and context-free grammars. Languages generated by regular grammars and context-free grammars are called regular languages and context-free languages, respectively. Let C C X+ and let u1, u2,. . . , ur,v1, w2,. . . ,v, E C where r and s are positive integers. If ulu2.. u, = ~ 1 ~. . 2v, .implies that r = s and ui = vi for any i = 1 , 2 , . . . ,T , then C is called a code over X . +
CHAPTER 0. INTRODUCTION
3
In this book, to investigate several properties of languages, we will deal with some codes, e.g. prefix codes, s u f i x codes, bafix codes, infix codes and hypercodes. Another important notion is an automaton. A triple A = (S,X , b ) is called an automaton. Moreover, a quintuple A = ( S ,X,6, so, F ) whose initial triple ( S ,X, 6) constitutes an automaton is called an acceptor or a finite acceptor. Acceptors accept (or recognize) regular languages. We will also define a pushdown acceptor which accepts (or recognizes) a context-free language. A relation 5 on a set A is called a partial order if it satisfies the conditions: (1) a 5 a for any a E A . (2) a = b if a 5 b and b _< a for any a,b E A . (3) a 5 c if a 5 b a n d b 5 c for any a , b , c E A . A set is called a partially ordered set (or in short, a poset) if it is followed by a partial order. A poset is called a lattice if there exist a least upper bound and a greatest lower bound for any two elements. Consider the following problem. Let 0 be a collection of objects, let R be a finite set of rules and let P be a property. If there is a procedure to decide whether or not any given A from 0 has property P after a finite time’s usage of rules from R, then the procedure is called an algorithm and the problem is called decidable. If there is no algorithm to decide the above problem, then the problem is called undecidable. Let 0 be again a collection of objects and let R be a finite set of rules. Let A be any object from (3. If there is a procedure to construct A with a finite time’s usage of rules from R,then this procedure is also called an algorithm and the construction is said to be eflectively constructed. In this book, sometimes the logical symbols b’ and 3 will be used. For instance, ’”da E A , 3 b E B , a = f(b)” means that ”for any a E A , there exists b E B such that a = f ( b ) holds”. On the other hand, ”3a E A, b’b E B , a = f(b)” means that ”there exists a E A such that a = f(b) holds for any b E B”. As basic references, the following books are recommended: [12] and [13] for semigroups, [22] for groups, [15], [24], [23], [62] and [70] for automata, formal languages and acceptors in general, [19] for context-free languages, [8] and [65] for codes and [56] for combinato-
4
CHAPTER 0. INTRODUCTION
rial properties of words, and [9] for lattices. This book consists of the following 9 chapters. In Chapter 1, we will mainly deal with the automorphism groups of strongly connected automata and (n,G)-automata, i.e. representations of strongly connected automata. In Chapter 2, we will genralize the results in Chapter 1 to the class of general automata. In Chapter 3, we will consider partially ordered sets of automata where partial orders are induced by homomorphisms of automata. In Chapter 4, we will deal with the compositions and decompositions of regular languages under n-insertion and shufle operations. Moreover, we will consider a decidability problem with respect to the shuffle closures of regular commutative languages. In Chapter 5, we will determine the structure of a shuffle closed language. In Chapter 6, insertion and deletion operations will be treated in details. In Chapter 7, shuffle and scattered deletion operations will be dealt with. In Chapter 8, first we will provide the concept of directable automata and later we will deal with nondeterministic directable automata.
Chapter 1
Group-Matrix Type Automata The study of endomorphism monoids and automorphism groups of automata was started by [17] and [68] and followed by [18],[69], [3], ~ 7 1 151, , PI, [41, ~ 3 and 1 [571. In this chapter, we will deal with a method to determine the structures of strongly connected automata whose automorphism groups are isomorphic to a given finite group. For this purpose, we provide representations of strongly connected automata, called regular group-matrix type automata. In the first four sections, we will deal with correlations between strongly connected automata and regular group-matrix type automata. The last three sections contain applications of related results to the theory of automorphism groups of automata. As for input sets of automata, we will avoid an abstract treatment. That is, we will restrict them to finite alphabets instead of general semigroups, so that the actions of automata will be described in the concrete form by means of state transition diagrams. However, our theory will be easily transferred to the general case. The contents of this chapter are mainly based on the results in [31], [32], [34] and [35]. 5
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
6
1.1
Strongly connected automata
In the present section, we provide some concepts on strongly connected automata and their automorphism groups, and present their fundamental results. Most of results were obtained by Fleck [17]. Definition 1.1.1 An automaton A = ( S ,X , 6) consists of the following data: (1) S is a finite nonempty set, called a state set. ( 2 ) X is a finite nonempty set, called an alphabet. (3) 6 is a function, called a state transition function of S x X into S . The state transition function b can be extended to the function of S x X* into S a s follows: (1) S ( S , E ) = s for any s E S. (2) S(s, a u ) = 6 ( 6 ( s ,a ) ,u)for any s E S, a E X and u E X*. Definition 1.1.2 Let A = ( S ,X, 6) and B = ( T ,X, 7 )be automata and let p be a mapping of S into T . If p(6(s, a ) ) = y ( p ( s ) , a ) holds for any s E S and any a E X, then p is called a homomorphism of A into B . If p is a bijection, then p is called an isomorphism of A onto B. If there exists an isomorphism of A onto B , then A and B are said to be isomorphic to each other and denoted by A M B . Moreover, if A = B , then a homomorphism is called an endomorphism and an isomorphism is called an automorphism. The set E ( A ) ( G ( A ) of ) all endomorphisms (automorphisms) forms a monoid (group) and it is called the endomorphism monoid (automorphism group) of A . Now we define a special kind of automaton. Definition 1.1.3 An automaton A = ( S ,X , 6) is said to be strongly connected if for any pair of states s , t E S there exists an element z E X* such that S(s,z) = t.
It can be easily seen that an endomorphism of a strongly connected automaton is surjective and hence bijective. Thus E(A) = G(A)for a strongly connected automaton A . Proposition 1.1.1 If A = ( S ,X , 6 ) is a strongly connected automaton and g , h are elements in G(A) such that g(s0) = h ( s 0 ) f o r some SO E S , then g ( s ) = h ( s ) for any s E S .
1.1. STRONGLY CONNECTED AUTOMATA
7
Proof Assume that g(s0) = h(s0). Since A is stronly connected, there exists z E X*such that s = SO, z). Hence g ( s ) = g(6(so, x)) = J ( g ( s o ))., = S(h(so), = h(J(so,.)) = h ( 4 . Proposition 1.1.2 If A = ( S ,X , S ) is a strongly connected automaton, then IG(A)I divides IS\.
Proof Let s, t E S . If there exists some g E G(A)such that t = g ( s ) , then we write s t . Then it can be shown that the relation is a congruence relation on S. Let [s]be a congruence class containing s E S, i.e. [s]= { g ( s ) 1 g E G ( A ) } .By Proposition 1.1.1,g ( s ) # h ( s ) for any s E S if g , h E G ( A )and g # h. This means that I[s]I = that S is a disjoint union of { [ s ]I s E S}. Hence ( G ( A ) ( Notice . IG(A)I divides JSI N
N
Definition 1.1.4 An automaton A = ( S , X , S ) is said to be commutative if 6(s,zy) = S(s, 9.) for any s E S and any z, y E X * . If, in addition, A is strongly connected, then A is said to be perfect. Proposition 1.1.3 If A = ( S , X , S ) is a perfect automaton, then G ( A ) is commutative and IG(A))= IS/.
Proof Let z E X*. By g r , we denote the following mapping: g z ( s ) = 6(s,z) for any s E S. Let s E S and let u E X . From the fact that A is commutative, it follows that g r ( 6 ( s , a ) ) = 6(6(s, a ) ,z)= 6 ( s ,u z ) = 6(s,za) = 6(6(s,z),u ) = b(g,(s), u ) . Hence gr E E ( A ) . Since A is strongly connected, gz E G ( A ) . Let s , t E S . As A is strongly connected, there exists z E X* such that t = S(s,z), i.e. t for any s, t E S. Consequently, t = gz(s). This means that s G ( A ) = { g z 1 z E X * } and IG(A)J= JSJ.Now let g , h E G ( A ) . Then there exist z,y E X* such that g2 = g and g y = h. Let s E S . Then g ( s ) = S(s,z) and h ( s ) = S(s,y). Notice that A is commutative. Hence g h ( s ) = 6(h(s),z) = S(d(s, y), z) = S(s, zy) = 6(s,yz) = 6(6(s,y),z) = S ( h ( s ) , z )= g h ( s ) , i.e. g h = hg. Thus G ( A )is commutative.
-
Proposition 1.1.4 Let A = ( S , X , S ) be a strongly connected automaton. Then zf G(A) is commutative and IG(A)J= IS], A is perfect .
8
CHAPTER 1. GROUP-MATRIX TYPE AUTOMATA
Proof Let x,y E X * and let s E S. Since A is strongly connected, and IG(A)J= JSJ,there exist g , h E G ( A ) such that g ( s ) = 6(s,x) and h ( s ) = S(s,y). Hence 6(s,xy) = 6 ( 6 ( s , x ) y, ) = 6 ( g ( s ) , y ) = g ( S ( s ,Y)) = 9 h ( 4 = h 9 ( s ) = h(6(s,4) = 6 ( h ( s )4 , = S ( b ( s ,Y > ,4 = 6(s, y x ) , i.e. A is commutative. Therefore, A is perfect.
Definition 1.1.5 An automaton A = ( S ,X , 6) is called a permutation automaton if b(s,a ) is a permutation on S for any a E X. Proposition 1.1.5 Let A = ( S , X , 6 ) be a strongly connected automaton. T h e n i f ( G ( A ) = ( IS(, A is a permutation automaton. Let s , t E S with s # t. Since IG(A)I = IS]there , exists g E G ( A ) such that t = g ( s ) . Suppose 6(s, a ) = 6 ( t ,a ) for some a E X . Then 6(s, a ) = S ( g ( s ) ,a ) = g ( 6 ( s , a ) ) . By Proposition 1.1.1,g is the identity of G ( A ) , i.e. t = s, which is a contradiction. Therefore, 6 ( s ,a ) # 6 ( t ,u ) for any a E X . Thus A is a permutation automaton. Proof
Proposition 1.1.6 If A and B are automata such that A then G ( A ) is isomorphic t o G ( B ) ,i.e. G ( A ) M G ( B ) .
M
B,
Proof Let A = ( S , X , 6 ) and B = ( T , X , y ) be automata and let p be an isomorphism of A onto B. First, we prove that p-' is an isomorphism of B onto A . Let t E T and let a E X . Since p is surjective, there exists s E S such that p(s) = t , i.e. s = p-'(t). Notice that p(6(s, a ) ) = y ( p ( s ) ,u ) . Hence p(S(p-'(t), u ) ) = y ( t , a ) . Thus 6 ( p - ' ( t ) , a ) = p - ' ( y ( t , a ) ) . This means that p-l is an isomorphism of B onto A . Now we prove that p9p-l E G ( B ) for any g E G ( A ) . Let t E T and a E X . Then p g p - ' ( r ( t , a ) ) = Ps(s(P-'(t),a>>= p ( s ( g p - l ( t ) , a ) ) = Y(PSP-'(t), 4. Therefore, we have p g p - l E G ( B ) .The correspondence g t--$ p g p - l is one-to-one and hence G ( A ) M G ( B ) .
Definition 1.1.6 An automaton A = ( S , X , 6 ) is said to be simplified if for any pair of inputs a,b E X with a # b there exists an element s E S such that 6 ( s ,u ) # S(s, b ) .
9
1.2. GROUP-MATRIX TYPE AUTOMATA
1.2
Group-matrix type automata
In Section 1.3, we will give representations of strongly connected automata. This section provides the theoreical basis for Section 1.3. Definition 1.2.1 Let G be a finite group. Then Go is the set GU{O} in which we introduce two operations . and +: (1) For any g , h E G, we define g . h as the group operation in G.
(2) For any g
E
G, we define g . O = 0 . g = 0 and 0 - 0 = 0.
(3) For any g E G, we define g (4) For any g , h E G , g
+ 0 = 0 + g = g and 0 + 0 = 0.
+ h is not defined. S
We will use sometimes the notations g h and c g i instead of g . h i=l S
and g1+ g2
+ . . . + gs. Notice that the sum c g i is defined only if at
most one of gi, i = 1 , 2 , . . . , s , is not zero.
i= 1
Definition 1.2.2 Let G be a finite group and let n be a positive integer. We consider an n x n matrix (fpq), fpq E Go,p , q = 1,2, . . . ,n. If an n x n matrix ( f p q ) satisfies the following conditions, then (fpq) is called a group-matrix of order n on G:
For any p' = 1 , 2 , .. . , n , there exists a unique number 4' = 1 , 2 , .. . ,n such that fp,q/ # 0.
We denote by Then
cnthe set of all group-matrices of order n on G.
Fn forms a semigroup under the following operation: / n
\k=l
Definition 1.2.3 Let G be a finite group and n be a positive integer. We consider a vector (fp), fp E Go,p = 1 , 2 , . . . ,n. A vector (fp) is called a group-vector of order n on G , if there exists a unique number p' = I, 2 , . . . , n such that fp/ # 0. We denote by G^, the set of all
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
10
group-vectors of order n on G. For any (f,) E G^, and any (g,,) we define the following multiplication:
E
c,
Under this operation, we have ( f p ) ( g p q )E En.
Definition 1.2.4 Let G be a finite group and n be a positive integer. An automaton A = ( G , X , & p ) is called a group-matrix type automaton of order n on G, or simply an (n,G)-automaton, if the following conditions are satisfied (1)
G^, is the set of states.
(2) X is a set of inputs.
(3)
Sq, is
a state transition function and it is defined by
SQ(~,a ) = $@(a),g E G, a E X where KD is a mapping of X into
z.
Remark 1.2.1 The mapping 9 can be extended to the mapping of X*into as follows:
Fn
9 ( ~=)(ep,), e,, = 0 if p
# q, and em
= e where e is the identity of G, and 9 ( a u ) = Q(a)S(u)for any a E X and
u E x*.
In this case, we can easily see that any x E X*.
Sq,(G,x)= @a(.)
holds for
The following two results are obvious:
(G,
Proposition 1.2.1 Let A = X , 6,) be an ( n ,G)-automaton. Then A is simplified af and only af 9 is a injective mapping of X into
c.
Proposition 1.2.2 Let A be a (1,G)-automaton. Then A is a permutation automaton.
1.2. GROUP-MATRIX TYPE AUTOMATA
11
Example 1.2.1
ll b h
we-/ I
s3
Figure 1.1: State transition diagram of A
(c,
Theorem 1.2.1 Let A = X , Sq) be an ( n ,G)-automaton. Then G is isomorphic to a subgroup of G(A). Proof For any g E G, we will define the following mapping pg of Gn onto itself p,(h) = ( g h p ) , p = 1 , 2 , .. . , nfor any h E G,, where h = ( h p ) , h p ~ G 0 , p = 1,..., , 2 n. By the definition, we can easily see that pg is a permutation on h
,
G.
.
A
Now, we prove that p,(S,p(k, u ) ) = Jq(p(h),u ) for any h E G^, and any a E X. To this end, put h = ( h p ) hp , E Go,p = 1 , 2 , .. . ,n. Then we have: pg(d&,a)) = pg(h*(a)) = p g ( ( h p ) * ( u ) ) = (ghp)*(a) = Pg(Q%4
=WP&),
4.
CHAPTER 1. GROUP-MATRIX TYPE AUTOMATA
12
Therefore, we have pg E G ( A ) . Next, we prove that the mapping g -+ p g is a homomorphism. For this purpose, put g ---t pg , g’ -+ p g / , and h = ( h p ). Then we have: Pgg4Q
= ((SS’)hP) = (SS’hP) = pg((g’h,)) = P g ( P g @ ) )
= PgPg‘(Q.
This means that gg‘ + pgpg! holds, i.e. the mapping g + pg is a homomorphism. We can easily see that the mapping g -+pg is a surjective mapping. Therefore, the mapping g -+ pg is an isomorphism of G onto a subgroup of G(A ) . Definition 1.2.5 An (n,G)-automaton A is said to be regular if A is strongly connected and G ( A ) M G holds. Concerning the strong connectedness, we have the following result: Theorem 1.2.2 An ( n , G ) - a u t o m a t o n A = (G^n,X,b,p)i s strongly connected i f and only if the following condition i s satisfied: For a n y p’, q’ = 1 , 2 , .. . , n and a n y g E G , there ex= g where ists s o m e element x an X* such that q!JPtq’(z) QI(x) = (q!JP&)),
Proof First, assume that A is strongly connected. Put q/= (e,’) = p’-th (0, . . . , 0 , e , 0 , . . . , 0 ) E G , where e is the identity of G (for the notation, see Remark 1.2.1). q’-th NOW, we put % = (ge,,’) = (0, . . . ,0, 9 ,0, . . . ,0) E G^, for any g E G. Since A is strongly connected, there exists some element x E X * such that S , p ( q , x )= %. Thus we have &,tqf(z)= g. Conversely, assume that the condition is satisfied. For any pair ---.of elements tj,h E G,, there exist some elements g’, h’ E G and = some numbers p’, q’ = 1 , 2 , . . . ,n such that 6 = (g’epp/) and (h’ePq/).By the assumption, there exists some element z E X* such that &yq’(z) = g’-’h’. In this case, S Q ( ~ , X )= iQ(z) = h holds. Therefore, A is strongly connected. h
1.2. GROUP-MATRIX T Y P E AUTOMATA
13
-
First, we will give a necessary and sufficient condition on Q ( X )or @(X*) in order that a group-matrix type automaton A = (Gn,X, Sq) may be regular in the cases n = 1 and n = 2. The general case and the case that n is a prime number will be also treated. Theorem 1.2.3 Let A =
(6, X , 6,)
be a (1, G)-automaton. Then if A is strongly connected, A is regular.
Proof We have to prove that G ( A ) is isomorphic to G. To this end, it is enough to show that for any p E G ( A ) there exists some element g E G such that p = pg (for the reason and the notation, see Theorem 1.2.1). Assume p E G ( A ) . Then we have p ( b q ( i , z ) ) = b ~ ( p ( i ) , z ) for any h = ( h ) E G ,h E G and all z E X * . This means that p ( & Q ( z ) ) = p ( k ) Q ( z ) holds for any i= ( h ) E G I ,h E G and any 5
E
x*.
&
Notice that for 6 = (e) E there exists some element g E G such that p(e) = ( 9 ) E where e is the identity of G. By the strong connectedness of A, for any h E G there exists some element z E X * such that Q(z) = ( h ) . Thus for any i= ( h ) E we have the following:
G,
Therefore, we have p = pg.
(G,
Theorem 1.2.4 Let A = X , 6,) be a strongly connected ( 2 ,G ) automaton. Then A is not regular i f and only i f there exist an automorphism cp of G , an element k in G, and two subsets A, I?, I' # 0 of G such that cp(k) = k , cp2(g) = kgk-' for any g E G, and
Proof Assume that A is not regular. Then there exists some element p E G ( A ) such that p # pg for any g E G (see Theorem 1.2.1). Moreover, there exist two transformations p1, p 2 on G such that P ( ( s , O ) ) = ( 0 7 p 2 ( g ) )and ~ ( ( 0 , h )=) (pi(h),O) for any g,h E G. Because, if it is not true, there exist some elements g', h' E G such
,
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
14
that either p((g’,O)) = (h’,O) or p((0,g’)) = (0, h’) holds. Consider the former case. In this case, since p(Sip((g’, 0), z)) = S+(p((g’, 0 ) ) , x) holds, we have p((g’, O)iP(z))= p((g’, O))$P(x)= (h’,O)Q(z) for any II: E X * . By the strong connectedness of A, we can find an element z’ E X * such that $P(z’) =
( ”Yg )
, u , v E Go a n d u + v E Gfor any g E G. Substituting this value into the equality p((g’, O)@(z’))= (h’,O)@(x’),we have p((g,0)) = (h’g’-lg, 0 ) for any g E G. In the same manner, we can find an element z” E X* such that 0 g‘-1 Q(x”) = u I v l , u’, v‘ E Go and u’ v‘ 6 G for any h E G.
(
)
+
By the equality p((g’, O)\k(z’’))= (h’,O)q(x”),we have p((0, h ) ) = (0, h’g’-’h) for any h E G. Thus p must be equal to p h 1 ~ l - 1 .This is a contradiction. Hence there exist two transformations p1, p2 on G. We consider an element in Q ( X * ) of the form u , v E Go and u
+ v,g
E
( :e )
where and
G. Since (e,O) we have
(e))
( ;;)
= (pz(e)u, pz(e)v). Therefore, u = 0 and
pz(g) holds. This means that, if
have
( ) ( 9
0
=
(: )
E
v = pz(e)-l
iP(X*)holds, then we
u v
Now, consider an element in @ ( X * )of the form u , v E Go and u
+ v,g
E G. Since (e,O)
(
f)
where and
we have Therefore
and
1.2. GROUP-MATRIX T Y P E AUTOMATA = 0 hold. This means that, if
have
( ) ( u v
(
)
E
15
Q ( X * ) holds, then we
0
=
From these facts and the strong connectedness of A , we have the following: There exist two permutations cp, [ on G such that for any g , h E G we have that
@ ( X * )and that conversely all elements in % ( X * )can be represented in the above form. Since Q ( X * )is a semigroup, we have the following four equalities.
Now we show that there exist k , A and r which satisfy the conditions in the theorem. Recall that we have already proven the existence of an automorphism cp of G.
16
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
1.2. GROUP-MATRIX TYPE AUTOMATA Thus p E G ( A ) . However, since p regular.
# pg for
17 any g E G, A is not
Example 1.2.2 The automaton A mentioned in Example 1.2.1 is regular. The reason is obvious from Theorem 1.2.4. Example 1.2.3 The following automaton A is strongly connected, but not regular. G = { e , g } , e = g2 and e is the identity of G , X = { a , b}, @ ( a )=
( : ),
Q(b) =
( :),
A = (G^z, X,6,).
h
G2 =
{sl, ~21.33, s4},
= (e,O>,s 2 = ( 9 , 0 ) , s3 = (ole), s 4 = (0,g). 6&1,a) = s2, 6 d s 1 , b ) = s4, & 7 ( S 2 , 4 = s1, 6 d s 2 , b ) = s3, b ( s 3 , a ) = s4, b ( s 3 , b) = s2, 6 q ( s 4 , a ) = s3, b ( s 4 , b) = si.
31
I a
t a
a
a
Figure 1.2: State transition diagram of A In the case n > 2, we have the following result. The proof of the necessity is due to [55].
(c,
Theorem 1.2.5 Let A = X , bq) be a strongly connected (n,G)automaton. T h e n A is regular i f and only i f there exists a number 'i = 1,2, . . , , n which satisfies the following condition:
For any a = 1 , 2 , .. . ,n,i # a', there exist some elements x,y E X* and number q' = 1 , 2 , .. . , n such that $ i ~ ~ ( = x) $ i / q ( y ) f o r any q = 1 , 2 , .. . , n and that $ i q / ( x )# $ i q / ( y ) where Q(4= ( $ p q ( x ) ) and @'(?A= ( $ p q ( Y ) ) .
18
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
Proof (*) Assume that the condition is not satisfied. Then there exist i , j = 1 , 2 , . . . ,n,i# j such that for any z,y E X*,$,(X) = $ j q ( y ) if and only if $jq(x) = $ j q ( y ) for any q = 1 , 2 , . . . , n. We define a mapping p as follows: p(e',Q(z)) = % Q ( x ) for any 2 E X*. Notice that, by the assumption, p is well defined as a mapping. Moreover, since A is strongly connected, p is a bijection of G, onto itself. Now we show that p is an automorphism of A. Let g E G^,. Since A is strongly connected, there exists z E X* such that g = e',Q(z). Let u E X. Then p(Sq(g,a)) = p ( g Q ( u ) ) = h
p(.^iQ(z)Q(a)) = p(e',Q(za)) = . q q z a ) = S Q ( z ) Q ( u ) = p(g)*(u) = S,p(p(g),u ) . Consequently, p E G(A). On the other hand, p(e',) = e j . Hence p # pg for any g E G. Thus A is not regular. This means A
that the condition holds if A is regular. (e) It is enough to show that for any p E G(A)there exists some element g E G such that p = pg. Therefore, we assume that p E G(A).Hence for any h E G^, and any z E X*, p ( h ) Q ( x ) = p ( h Q ( z ) )holds. Now, put h = (.pi/). Then there exist some element k E G and number i = 1 , 2 , . . . , n such that p(h) = (kepi). Assume that i = 2'. Let j = 1 , 2 , . . . ,n and let g E G. Since A is strongly connected, there exists x E X* such that $ij(x) = g where Q(z) = ($+,*(z)). Then &p(h,z)= hQ(z) = ( g e p j ) . Therefore, p ( g e p j ) = P(S&Z)) = S , ( P ( A , 4 ) = p(h>Q'(.) = ( J w p j ) . Thus p = Pk.
Now, assume that i # i'. Then by a condition in the theorem, there exist some elements z, y E X* and number 4' = 1 , 2 , . . . ,n such that $gq(x)= $i/q(y) for any q = 1 , 2 , . . . , n and that $i,t(x) # $i!/(y). By the above relationship and by the equalities p ( h ) Q ( x )= p(hQ(z)), p(L)Q'(y) = p(LQ(y)), = ( e p z t ) and P(L) = (kepz),i # i', the following contradiction follows:
L
p(LQ(z)) # p(hQ(y)), thoughLQ(z) = h*(y).
Therefore, i = 'i must hold and thus A is regular.
1.3. REPRESENTATIONS OF AUTOMATA
19
1.3 Representations of automata In this section, we will give representations of strongly connected automata by group-matrix type automata. As preparation, the following lemma is provided:
Lemma 1.3.1 Let G and G' be two isomorphic groups. Moreover, assume that A = X, 6 q ) is an (n,G)-automaton. Then there X, S q l ) such that A M A'. If, exists an (n,GI)-automaton A' = in addition, A is regular, then A' is also regular.
(g,
Proof
(G,
Let @ be an isomorphism of G onto GI. We define @'(a) =
(6(gPq(a))) for any a E X where 6 is the extension of @ on Go with @(O) = 0 and @ ( a )= ($Jpq(a)). With the above Q', we define A' = X, Sq,). First, we prove that A M A'. To this end, we put p(g) = ( 6 ( g p ) ) for any 6 = ( g p ) E G,. Then p is a bijective mapping of G, onto By the definition of @' and the fact that @ is an isomorphism of G onto GI, it is obvious that p(&p(g,a)) = G ~ / ( p ( g ) , a )This . means that A M A'. Next, assume that A is regular. Then G(A) M G holds. By Proposition 1.1.6, we have G(A) x G(A'). On the other hand, G M G' holds because of the assumption. Therefore, we have G(A') M G'. This means that A' is regular.
(G,
h
h
e.
Theorem 1.3.1 Let A = ( S ,X, 6) be a strongly connected automaS 1 = nlG(A)I where n is a positive integer. Moreover, ton such that I assume that G is a finite group such that G M G ( A ) . Then there exists a regular ( n ,G)-automaton which i s isomorphic to A .
Proof By Lemma 1.3.1, it is enough to show that A is isomorphic to a regular (n, G(A))-automaton, As preparation to prove this, we recall the following relation on S : For s , t E S , s t means that there exists some element g E G(A) such that t = g ( s ) . N
Since classes.
N
is an equivalence relation on S , it induces n equivalence
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
20
Let Si, i = 1 , 2 , . . . , n be an equivalence class by the relation N on S. We choose si E Si, i = 1 , 2 , . . . , n and put T = { S I , ~ 2 , .. . , s ~ } . Then for any a E X and any sp E T , there exists a unique pair spt E T , h E G(A) such that S ( s p , a )= h ( s p / ) .Making use of these p , p' and h, we define the following mapping @ of X into G G ) n : *(a) = (+,,(a))fora E Xwhere +,r(a)
= hand$Jpq(a) = 0,q
# p'.
Thus we obtain an (n,G(A))-automaton A' = (G@)n, X, 6,). Now, we will prove that A x A'. To this end, we define the mapping p as follows:
S where e is the identity of G ( A ) , i and h are, respectively, a number and an element in G(A) uniquely determined such that si E T and s = h(si). p ( s ) = (hepi)for s E
h
Then p ( s ) E G(A)n and p is a surjective mapping of S onto G(A)n. Now, we will prove that for any s E S and any a E X we have p(S(s, u))= S,(p(s>, u). Let s = h(si) where h E G ( A ) . Then we have p ( s ) = (hepi). On the other hand, we have the following equality : h
Assume that +ipr(a)E G ( A ) and +i,(u) = 0 , p # p'. Then by the definition of (u), we have S( si, a)= qip/ (a)(spr). Therefore, we have 6 ( s ,a) = b(h(si),a) = h(S(si,a))= h(+ip'(a)(spt))= (h+ip/(a))(~p/). Cosequently, if we put p(6(s,a)) = ( q p ) ,then qpr = h+ipr(u) and qp = 0 , p # p' hold because of the definition of p. Thus we have Sq(p(s),u) = p(6(s,u)). Therefore, A x A' holds and also A' is strongly connected. Moreover, by Proposition 1.1.6, G(A) M G(A') holds. This means that A' is regular.
*
Corollary 1.3.1 Let A = ( S , X , S ) be a perfect automaton and let G be a group such that G M G(A). Then A is isomorphic to some (1,G)-automaton.
1.3. REPRESENTATIONS OF A UTOMATA
21
Corollary 1.3.2 (the same as Proposition 1.1.5) Let A = ( S ,X, 6 ) be a strongly connected automaton. T h e n if IS1 = IG(A)I, A i s a permutation automaton.
Proof By JSJ= JG(A)J,A is isomorphic to some (1,G)-automaton. Then by Proposition 1.2.2, A is a permutation automaton.
(c,
Remark 1.3.1 Let A = X , 6,) be a regular ( n ,G)-automaton. = n ( G Jand G(A) M G hold. Then Consequently, we have the following result:
T h e determination of any distinct strongly connected automata whose automorphism groups are isomorphic to a given finite group G is equivalent t o that of any distinct regular group-matrix type automata of each positive integer's order o n G . Notice that we do not consider two isomorphic automata as distinct ones. Thus the following problem will be induced:
W h a t conditions are required in order that two groupmatrix type automata m a y be isomorphic t o each other? This problem will be treated in the following section.
Example 1.3.1 Figure 1.3 denotes the state transition diagram of a strongly connected automaton A = ( S ,X , 6 ) . We will obtain a representation of A by a group-matrix type automaton of order ISl/lG(A)I on G(A). G(A) = { e , p} where e is the identity of G(A) and p = ( p q ) ( t r ) , i.e. P(P> = 4 , p ( q ) = P, p ( t ) = r and p(r) = t. ISI/IG(A)( = 2, x = { a , b , c ) , s = { P , q , r , t ) , s1 = b , q ) , s2 = { t , r ) , T = { p , t ) , J(p,a) = q = p ( p ) , J ( t , a ) = t = e ( t ) , +(a) =
t
=
e(t),b(t,b) = p = e(p), Q(b) =
6(t,c)= r
= p ( t ) , ~ ( c=)
Then A' = ( G @ ) 2 , X , 6 q )
M
A.
22
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
Figure 1.3: State transition diagram of A
1.4 Equivalence of regular systems In this section, we will deal with the problem as noted in the previous page.
Definition 1.4.1 Let G be a finite group, let n be a positive integer and let E be a subset of Then E is called a regular system in if there exists some regular (n,G)-automaton A = X, )6, such that E = @(X).
c.
(cn,
En.
Definition 1.4.2 Let E and F be two regular systems in Then we say that E and F are equivalent to each other and denote E F if there exist some permutation 0 on G^, and isomorphism CP of E* onto F* such that the following two conditions are satisfied: N
(a) F = @ ( E ) .
(b) O ( g Y ) = 0 ( g ) @ ( Yfor ) any
c,
4 E G^, and any Y E E .
Here, K * , K C denotes the monoid generated by the elements of K U { ( e p q ) }where e is the identity of G. Notice that, in this case,
1.4. EQUIVALENCEh OF REGULAR SYSTEMS
2 23
--
induces an equivalence relation on the set of all regular systems in Grl.
Before considering the relationship between regular systems and G)-automata, we introduce the concept of the following regular (n, generalized isomorphism. Definition 1.4.3 Let A = (S,X , 6) and B = ( T ,X , 7 )be automata. Then A is said to be isomorphic t o B in the wider sense, denoted by A M, B, if there exist a bijective mapping p of S onto T and a permutation E on X such that p(S(s, a ) ) = y ( p ( s ) ,[ ( a ) ) for any s E S and a E X . Remark 1.4.1 It can be easily seen that B M, A if A
M,
B.
Proposition 1.4.1 Let A = ( S , X , 6 ) and B = ( T , X , y ) be automata. I f A M, B,t h e n G(A) M G ( B )
Proof Since A M, B ,there exist a bijective mapping p of S onto T and a permutation E on X such that p ( 6 ( s , a ) ) = y ( p ( s ) , < ( a ) ) for any s E S and a E X . Let g E G(A), let t E T and let b E X . Consider the mapping pgp-l. Since t E T and b E X , there exist s E S and a E X such that t = p ( s ) and b E E ( a ) . Then P g P - Y Y ( t , b ) ) = PgP-'(Y(P(S), [ ( a ) > = P s P - l ( P ( @ , 4 ) )= Pg(% 4 ) = P ( S ( 6 ( S , 4 ) )= P ( G ? ( S ) , 4 ) = 7 ( p ( g ( s ) ) , [ ( a ) )= Y(PS p - ' ( t ) , b ) . Hence pgp-' E G ( B ) . Since the correspondence g tt pgp-l is one-to-one and gg' tf pgg'p-' = ( p g p - l ) ( p g ' p - l ) for any g,g' E G ( A ) , we have G(A) M G ( B ) . Now we consider the relationship between regular systems and
(n, G)-automata. In this case, it is enough to consider only simplified regular (n,G)-automata. Theorem 1.4.1 Let A = ( c , X , S q ) and A' = ( C , X , S q , ) be simplified regular (n,G) -, and (m,G ) - a u t o m a t o n , respectively. T h e n A M, A' i f and only if t w o regular systems Q ( X ) and W ( X ) are equivalent.
h h h
Proof Assume that A M, A’. Then n = rn holds because of lGnl = - Therefore, Q(X)and W(X)are regular systems in the same G,. Moreover, since A x, A’, there exist a permutation p on G, and a permutation ( on X such that p(&p(g,u)) = Sq,/(p(g),J(a)) for any i j E G, and any a E X. By this fact, we can verify easily that p(g@(al)Q(a2). . . Q ( Q ) ) = p(g)Q’([(al)>Q’([(az)) . . . Q’(<(Q)) holds for any ai E X,i = 1 , 2 , . . . ,1,1 2 1. Now we consider the following mapping:
Icl.
A
h
(1) Q,(Q(u)) = @’(((a))for any a E X. for
(2) any (3)
First, we show that the above @ can be well defined as a mapping. That is, we must show that Q’([(u1))Q’([(u2)) . . . *’(<(a[))= Q”(E(bl))Q’(t(b2)) * . . Q”(t(W if Q(a1)Q(a2) . * ’ Q@Z) = Q(WQ(b2) . . . Q(b,) whereai,bj E X,i= 1 , 2 , .. . , l , j = 1 , 2 , . . . , r , l , r 2 1,holds and that Q’(<(a1))Q’(t(a2)). . . Q’(c(ul))= ( e p q )if Q(ul)Q(u2) . . . Q ( a l ) = ( e p q ) ai , E X,i= 1 , 2 , . . . ,1,1 2 1 holds. For this purpose, we assume that Q(u1)Q(u2) . * * Q(ul) = Q(b1)Q ( b 2 ) . * . Q ( b r ) where ai, bj E X,i= 1 , 2 , . . . , 1 , j = 1 , 2 , .. . , r , 2,r 2 1 holds. Then we have gQ(u1)Q(u2) . . . * ( a [ ) = gQ(bl)Q(b2) . . . Q(b,) for any g E G,. By the application of the mapping p to the above equality, we have P(g>Q’(E(.l))Q’(E(a2>) . . . Q’(E(Q)) = p(G)Q’(J(h)) ~ ’ ( g b 2 ) .) . for any 6 E G^,. Since p is a surjective mapping of G, onto Gm(= G,) and we can choose an arbitrary element E h
.x(<(bd
G,Q’(t(a1))Q’(E(a2)). . . Q ’ ( t ( a l ) >= Q’(t@l))Q’(t@2)). . . Q ’ ( t ( b ) )
must hold. Thus, we obtain the first part. As for the second part, we can prove it in a similar way. Consequently, Q, is well defined. Next, we can prove easily that Q, is a surjective mapping of Q(X)*(= Q(X*)) onto Q’(X)*(= Q’(X*)). Moreover, it is easily seen that @ is a homomorphism. Thus Q> is an isomorphism of Q(X)* onto Q’(X)* such that W ( X ) = Q > ( Q ( X ) )Therefore, . we have the condition (a) in Definition 1.4.2.
1.4. EQUIVALENCE OF REGULAR SYSTEMS
25
Now, put 0 = p . Moreover, notice that @(@(a)) = @’(<(a))holds for any a E X. Then we have @(ij@(a))= p(g@(u)) = p ( S ~ ( i j , a ) ) . On the other hand, O(ij)Q,(@(u))= p(g)@’(<(a))= S~f(p(g),<(a)) holds. Since A M~ A’, we have O(g@(a))= O(ij)Q,(Q(a))for any g E &. This means that the condition (b) is satisfied. Thus @(X)and @’(X) are equivalent. Conversely, assume that @(X)and W ( X ) are equivalent. Then, obviously we have n = m. Remember that 9 and @’ are one-to-one because of Proposition 1.2.1. Moreover, let @ be an isomorphism of @ ( X ) *onto @‘(X)*which satisfies the condition (a). Now, consider the mapping which is defined as follows:
<
@’(<(a))= @ ( @ ( u for ) ) anya E X. In this case, we can see that [(a)is determined uniquely for each a E X ,from the fact that Q, satisfies the condition (a) and that @, @’ are surjective mappings. We can also see that is a permutation on X. Next, we put p = 0. Obviously, p is a surjective mapping of G, onto G,. Then we have the following result:
<
h
h
For any 6 E & and any a E X , p ( S ~ ( ga)) , = p ( g @ ( a ) )= @(G@(a))= @(G)@(Q(a)) = P ( i W ’ ( t ( 4 ) = S Q M 9 ) l <(a>) holds. Therefore, we have A
M,
A’.
By Proposition 1.4.1, we have: Corollary 1.4.1 The set of all simplified regular ( n,G)-automata equals { A = (G^n,X,cT~)1 Q ( X ) : a regular system inG,} Remark 1.4.2 Notice that, in the case n = 1, the condition (a) implies the condition (b) in Definition 1.4.2. Thus we have the following:
(G?,
(G?,
Corollary 1.4.2 Let A = X , SQ) and A‘ = X , S Q ~ )be simplified regular (1,G)-automata. Then A M , A’ if and only if there exists an automorphism @ of G such that W ( X )= @ ( @ ( X ) ) .
CHAPTER 1. GROUP-MATRIX TYPE AUTOMATA
26
Example 1.4.1 Let S(3) be the symmetric group on {1,2,3}. Put E = ((1 2), (1 3)) and F = ((1 2), (1 2 3)). Then -E and F are not equivalent though either is a regular system in S(3)l. The condition in order that two regular systems may be equivalent is not so concrete except for the case n = 1. However, even in the general case, we can provide a criterion for the equivalence of regular systems in a concrete form. First, we provide the following lemma:
cn,
Lemma 1.4.1 Let E and F be two equivalent regular systems in i.e. E F . Moreover, assume that 0 and CP are a permutation o n G^, and a n isomorphism of E* onto F*, respectively, which satisfy the condition ( a ) and the condition (b) in Definition 1.4.2. T h e n there exist a permutation r on {1,2,3, . . , ,n} and n permutations @% . z, - 1 , 2 , . . . , n o n G such that f o r any ij = (g1,92,. . . ,gn) E N
‘
G^, -
we have @(i) = ( & ( g T ( i ) ) > &(g,(2)), . . . , & ( g T ( n ) ) ) where each Oi, i = 1 , 2 , . . . ,n, is the extension of @i o n Go with K(0) = 0.
Proof Assume that the statement in the lemma is not true. Then there exist some elements g , g’, h, h’ E G, g # h and numbers i ,j , k = 1 , 2 , . . . , n , j # k such that @((ge,i)) = (g’e,j) and @ ( ( h e p i ) )= (h’e,k). On the other hand, by Definition 1.4.1 and by the proof of Theorem 1.4.1, there exist two regular (n,G)-automata A = X, Sq), A’ = X, SQ!) and a permutation 5 on X such that Q ( X ) = E , W ( X )= F and @(Sq(ij,u))= Sql(@(tj),((u))for any ij E and any u E X. Then by the proof of Proposition 1.4.1, for any q E G(A) we have 0qO-l E G(A’). Now, put q = phg-l E G(A) and compute the value @q@-l(g’e,j). We have @ q W 1 ( g ’ e p j )= @q((ge,)) = Ophg-l((ge,i)) = @((he,)) = (h’epk). Then 0qO-l E G(A’) is not represented by the form @q@-l = pg for any g E G. This contradicts the fact that A‘ is regular. Thus the assertion of the lemma must be true.
(G,
(cn, cn
Making use of the above lemma, we can obtain the following result:
1.4. EQUIVALENCE OF REGULAR SYSTEMS
27
G.
Theorem 1.4.2 Let E and F be regular systems in Then E and F are equivalent if and only if there exist n elements ki,i = 1 , 2 , .. . ,n in G, a n automorphism p of G and a permutation r o n { 1 , 2 , 3 , .. . , n } such that F = {(k;l$(xT(p)T(q))kq) I ( x p q )E E } where $5 is the extension of p o n Go with $(O) = 0 and kl = e .
Proof (+) Let 0 and Q be a permutation on G^, and an isomorphism of E* onto F * , respectively, which satisfy the condition (a) and the condition {b) in Definition 1.4.2. Then by Lemma 1.4.1, there exist a permutation r on {1,2,3,. . . , n } and n permutations Oi, i = 1 , 2 , .. . ,n on G such Gn we - that for any g = (91,g 2 , . . . ,g n ) E where each Oi, i = have O(g) = ( & ( g T ( l ) ) , 0 2 ( g 7 ( 2 ) ) , . . . , 1 , 2 , . . . , n is the extension of Oi on Go with &(O) = 0. Now, put Y = ( y p q ) E E* and Q{Y)= ( x p q ) E F * . Notice h
K(gT(n)))
that k=l
k=l
holds for any ij = ( g l , ~ 2 , ... ,gn) E Gn. Applying the mapping 0 to the above equality, we have:
Thus we have
The above equality implies that
for any j = 1 , 2 , . . . ,n. Notice that
CHAPTER 1. GROUP-MATRIX TYPE AUTOMATA
28
holds for any j = 1 , 2 , . . . , n. By the fact that E is a regular system in Gn, for any i = 1 , 2 , . . . ,n we can choose gT(i) = e. Then we have gT(U)= 0 for any u,u# i. From this result, we obtain @i(e)zij = @ j ( ~ ~ ( ~ for ) ~ any ( ~ )i ,) j =
-
-
. . , n. That is, 1 , 2 , . . . ,n.
zij = @ i ( e ) - l @ j ( g T ( i ) T ( j ) )holds
for any i , j =
Thus we can conclude as follows:
-
= (h,'@q(~T(p)T(q))) @ ( e ) E G, i = 1 , 2 , .. . ,n. '((~pp))
Let
for any
( ~ p q )E
E E*. Then (Ypq)(YLq) =
( Y p q ) , )Y (,;
E* where hi =
c1 ) CYpkY&
E
E*.
Since @ is an isomorphism of E* onto F * , we obtain @((ypq))@((yhq)) = a?
((
$YPkYLq))
'
Hence we have
(
(hpl%(YT(p)T(q) 1) (hi'% ( Y ! r ( p ) T ( q ))) = hF'% n
and we have
-
(YT(Z)T(k
k= 1
))
6(9:
(ggT(p)k&(q)
n ( k ) ~ ( )j ) =
6
(YT(2)k
k=l
)) Y ; ~ ( j ))
for any i , j = 1 , 2 , . . . , n. By the fact that E is a regular system in G,, we can see that for any g E G there exist some group-matrices (ypq), ($,) E E" such that yT(+(i) = g and yb(i)T(j) = e. Thus we have @i(g)h,lhj = @ j ( g ) for any g E G and i , j = 1 , 2 , . . . ,n. Let O((e,O,..., 0)) = (0, . . . ,ht,O,..., o ) , t = 1 , 2, . . . ,n. P u t cp(g) = h ; l @ d g ) , g E G and ki = hF1hi E G , i = 1 , 2 , . . . , n. Then we have h ; ' O j ( g ) = h;l&(g)h;'hj = k i l @ ( g ) k j for any g E Go a n d i , j = 1 , 2 , . . . ,n. First we prove that cp is an automorphism of G. To this end, it is enough t o show that cp(gg') = cp(g)cp(g') holds for any g , g / E G. Since E is a regular system in G,, there exist Y,Z E E* such that the (1,l)-entries of Y and Z are g and g', respectively. Then the (1,1)-entry of Y Z becomes gg'. Notice that ( e ,0 , . . . ,O)Y = ( g , O , . . . ,O),(e,O, . . . ,O)Z = (g', 0 , . . . , 0 ) and ( e ,0 , . . . ,O)YZ = (gg', 0 , . . . , O ) . Therefore, we have O ( ( g , O , .. . , O ) ) = @ ( ( e , O , .. . ,O)Y)= @((el0 , . . . , O))@(Y) = ( 0 , . . . ,o, ht, 0 , . . . ,O)@(Y) = (0,. . . ,o,e t ( g ) ,
1.4. EQUIVALENCE OF REGULAR SYSTEMS
29
0 , . . . , O ) , O ( ( g ' , 0 , . . . , O ) ) = O ( ( e ,0 , . . . , O)Z) = O ( ( e ,0 , . . . , O))@(Z) = (0,. . . , 0, ht, 0 , . . . , O)@(Z)= ( 0 , . . . , O , O t ( g ' ) , 0 , . . . , 0) and O ( ( g g ' , 0 , . . . , O ) ) = O ( ( e ,0 , . . . , O)YZ)= O ( ( e ,0 , . . . , O ) ) @ ( Y Z=) (0,. . . ,0, ht,O,. . . ,O)@(YZ)= (0,. . . ,O,Ot(gg'), 0 , . . . , O ) . Hence the ( t ,t)entries of @ ( Y )@(Z) , and @(YZ) are h F I O t ( g ) ,h r l O t ( g ' ) and hFIOt (gg'), respectively. Notice that @ ( Y Z )= @(Y)@(Z). Consequently, hF1@t(gg') = h ; ' O t ( g ) h F 1 O t ( g ' ) and cp(gg') = cp(g)'p(g'). Furthermore, we have F = @ ( E )= { @ ( ( y p q ) )I ( y p 4 ) E E } = {(hF'&(4(yT(p)T(Q))) I ( Y p q ) E , = {(kF1@(YT(p)T(q))kq)I (!h) (-+) Assume that there exist cp, ki, i = 1,2,, . . , n and T in the theorem. Let O ( ( g 1 , ~ 2. ,* . 7 g n ) ) = ( @ ( 9 ~ ( 1 ) ) ~(P(gT(2))hr 17 * * * > @(g.r(n)) k n ) , (91,92, . . . ,g n ) E Gn. Then O is a permutation on Gn. Let @ ( Y = ) (k;1@(yT(p)T(4))kq)for any Y = ( y p q ) E E and let @ ( ( e p q )= ) ( e p q ) .Moreover, let Y = ( g p q ) E E and let Z = (zp4)E E . h
h
n
Then we have
@( y ) @ (> '
=
(cF'
(P (97(p)T (2) ) @ ('T(
2) T ( 4 )) ' 4 )
=
i=l
n
(C F ' i= 1
n
@ (YT (p)i'27 (4)) ' q = (F ' (P (C?/7 ( p )i '27 (4) ) k q )
= @(
Hence @ is an isomorphism of E* onto F*. Now we prove that O ( g Y ) = O(ij)@(Y)for any g E Y E E. Let g = ( g l , g 2 , . . . , g n ) E Gn and let Y = ( Y p q ) E E . h
n
n
n
t=l
t=l
t=l
Then we have
n
'
i=l
t=l
t=l n
t=l
n
G^, and any
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
30 n
. . .> C q ( g t ) q ( y t T ( n ) ) k n ) . t=l
Consequently, O ( i Y ) = O ( i ) @ ( Yholds ) and hence E
1.5
-
F.
Characteristic monoids and input sets
This section consists of two applications of our method. One is concerned with the characteristic monoids of automata, and the other is concerned with the input sets of automata. Definition 1.5.1 Let A = ( S , X , S )be an automaton and let z,y E X * . Then x and y are equivalent to each other and we denote x y if S ( s , x ) = 6(s,y) holds for any s E S . We denote by ?E the set of all y E X * such that x y and by C ( A ) the set of all such classes, i.e. C ( A )= {T I x E X*}.Notice that C ( A )forms a monoid under the = where x,y E X * . This monoid is natural operation, i.e. 3 . ?j called the characteristic monoid of A . N
N
Proposition 1.5.1 Let A = ( S , X , 6 ) and B = ( T , X , y ) be two
isomorphic automata. T h e n C ( A )= C ( B ) . Proof Let p be an isomorphism of A onto B.Then for any x,y E X* and s E S , S ( s , x ) = S(s,y) if and only if y(p(s),x) = y ( p ( s ) , y). Since p is a bijective mapping, this means that, for any s E S , 6 ( s ,x) = 6(s, y) if and only if ~ ( sz) , = y(s, y). Hence C ( A )= C ( B ) .
(G,X , 6,p) be a n (n,G)-automaton. T h e n the characteristic monoid of A is isomorphic to Q f ( X * ) .
Proposition 1.5.2 Let A =
Proof Obvious from the fact that, for any x,y E only if @(z)= @(y).
X*,x
-
y if and
From the above proposition, to study the structure of the characteristic monoid of a strongly connected automaton, it is enough to study that of the corresponding regular group-matrix type automaton. Thus the following result in [57] can be proved by our method.
1.5. CHARACTERISTIC MONOIDS A N D INPUT SETS
31
Proposition 1.5.3 Let A = ( S , X , 6 ) be a strongly connected automaton. Then C ( A )forms a group if and only if A is a permutation automaton.
-
Proof By Theorem 1.3.1, we can assume that A is a regular groupmatrix type automaton, i.e. A = (Gn,X,6,). (-+) In this case, for any Y E ' k ( X * )there exist a permutation 7 on {1,2, . . . , n} and elements g i j E G, i, j = 1 , 2 , . . . , n such that Y = (gPqePT(,))where e is the identity of G. Let m be a positive integer such that T~ = 1 where 1 is the identity permutation on {1,2, . . . ,n}. Then there exist some elements hij E G, i , j = 1 , 2 , . . . , n such that Y m = (hpqepq) E '@(X*). Since G is a finite group, there exists a positive integer r such that (Y")' = ( e p q ) .Notice that (epq)is the identity of ' k ( X * )and that ' k ( X * )is a finite monoid. Therefore, ' k ( X * )must be a group. By Proposition 1.5.2, C ( A )forms a group. (+) For any Y E '@(X*), Y is of the form gpqepT(q) where g i j E G, i, j = 1 , 2 , . . . , n and 7 is a permutation on {1,2,. . . , n}. Because, if' it is not the case, Y m# (epq)for any positive integer m. This contradicts the assumption that C ( A )is a group. Thus the assertion is true and in this case, A is a permutation automaton.
(
)
Now, we establish a relationship between the input sets and the state sets of strongly connected automata.
Theorem 1.5.1 Let A = ( S ,X,6 ) be a strongly connected automaton whose automorphism group is isomorphic to a finite group G. Then we have lSllXl 2 I(G)IGI where I ( G ) = min{(H( 1 H G, [HI = G } and [HI is the subgroup of G generated b y the elements of H . Proof We can assume that A is of the form A = (E,X,&p), i.e. A is a regular (n,G)-automaton. Then it is enough to show that n IGI 1x1 2 I ( G ) IGI. Let 'k(a)fl be the set of all nonzero components of Q ( a ) where a E X. Then obviously l'@(a)gl 5 n holds. By the strong connectedness of A , we obtain immediately
= G. Thus we have
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
32
2 I ( G ) . On the other hand, n l X l 2 Hence we have n (GI (XI1 I ( G ) (GI. From the above theorem, we can see that there is no strongly connected automaton A = ( S , X , 6 ) such that < I ( G ) / n where n = IS(/ ( G ( A ) (and G ( A ) M G . Thus we may have the following question:
1x1
C a n we construct a n automaton with the smallest cardinality of input set among the strongly connected automata whose automorphism groups are isomorphic t o a given finite group?
In response to this question, for a finite group G and a positive integer n, we define the number J ( n ,G) as follows: J ( n , G ) = m i n { ) X ) I A = ( S ,X, 6) is a strongly connected automaton such that G ( A ) M G and I S1 = nlG(A)I}. Let r be a positive number. By I T ] , we denote the positive integer rn such that rn - 1 < r < rn. Then we have the following result. Theorem 1.5.2 Let G be a finite group and let n be a positive integer. T h e n [ I ( G ) / n ] J ( n , G ) 5 [ I ( G ) / n l + p ( n ) where p(1) = 0 and p ( n ) = 1 f o r n 2 2.
<
Proof Obviously, the theorem holds true for the case n = 1. Therefore, we consider the case n >_ 2. The inequality rI(G)/nl 5 J ( n ,G ) is immediate from Theorem 1.5.1. Hence we have to prove the inequality J ( n ,G ) 5 [ I ( G ) / n l P(4. By the definition of I ( G ) ,there exists a set of generators H of G , i.e. [HI = G such that H = {hi I hi E G , i = 1 , 2 , . . . , I ( G ) } . Now, put X = Y U { z } where Y = {yi I i = 1 , 2 , .. . , [I(G)/%l}.Moreover, for any i = 1 , 2 , . . . , [ I ( G ) / n l ,we can define Q ( y i ) E Gn such that all elements of Q(yi)d are gathered only into the first column of Q(yi),
+
[I(G)/nl Q(Yi)
#
WYj)
(2
# j ) and H
=
u
i=l
Q(YiY.
1.5. CHARACTERISTIC MONOIDS A N D INPUT SETS
33
Put T = (12 3 . . . n ) be the element of the symmetric group S ( n ) on { 1,2,3,. . . , n}. Moreover, we assign Q ( z ) = e F ( q l ) E where e is the identity of G. Thus we can define an (n,G)-automaton A= X,Sq).
(
(c,
Now, we prove that A is regular.
Proof of the strong connectedness of A First, we prove that, for any i , j = 1 , 2 , ,. . ,n and all h E H , there exists an element z E X* such that the (i,j)-entry of Q(z) is equal to h. By the assignment of Q ( Y ) ,for any h E H there exist some integers s = 1 , 2 , . , . , n and t = 1 , 2 , . . . , [ I ( G ) / n l such that the ( s ,1)-entry of Q(yt) equals h. Now, put z = z2lytzn--j+l where u = i - s (mod n) and u > 0. Then it can be seen that the (i,j)-entry of Q(z) equals h. From this fact and the finiteness of G , it follows that, for any i, j = 1 , 2 , . . . , n and any g E G, there exists an element x E X*such that the (i,j)-entry of Q ( x ) is equal to g . By Theorem 1.2.2, this indicates the strong connectedness of A . Proof of the regularity of A Let y be an arbitrary element of Y , let g be the (1,1)-entry of Q(y) and let k be the order of g . Then the (1,l)-entry of Q ( y k ) is equal to e. On the other hand, the (1,l)entry of 9 ( z " ) is also equal to e. By a comparison of these two group-matrices and by Theorem 1.2.4 and 1.2.5, A is regular. Thus the existence of an automaton A = ( S , X , S ) such that G ( A )M G, I S 1 = n IG(A)I and = [ I ( G ) / n l 1 has been shown. This completes the proof of the theorem.
+
1x1
Example 1.5.1 Let G be the Klein's four group whose generators are g and h, satisfying the defining relations g2 = e, h2 = e and ghg-lh-' = e. Then we can obtain the following two-input regular (2, G)-automaton A = ( G , X6,). , G = {e,g, h,gh}, X = 9 0 O e h h } , @ ' ( a > =( h 0 ) - W ) = 0).
(
s5
Now, we put s1 = (e,O), s2 = ( g , O ) , s3 = ( h ,0 ) , s 4 = (gh,O), = (0,e ) , S6 = (O,g), s7 = ( 0 ,h ) and Ss = (0,gh). Then we obtain
the following state transition diagram of A:
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
34
a a
s6
s5
a a Figure 1.4: State transition diagram of A
Theorem 1.5.3 Let G be a finite group. T h e n there exists a strongly connected automaton A = ( S ,X , 6 ) such that G ( A ) z G and 5 2.
1x1
Proof To prove the theorem, it is enough to show that min{J(n,G) ln > - 1) 5 2. This is immediate from the fact that J ( n , G ) 5 [I(G)/nl + p ( n ) and min{[I(G)/nl + p ( n ) I n 2 1) i 2. Remark 1.5.1 There is the case J ( n , G) = [I(G)/nl. For instance, we consider the following case. Let G be the symmetric group [ { g ,h, k } ] c S(9) where g = (12 3), h = (456) and k = (789). Then obviously we have I ( G ) = 3 and thus CI(G)/21 = 2. Now, put X = { a , b } , * ( a ) =
9(b)=
(
O k k 0
1'
and
Then A = (Gz, X, 6 ~ is )a regular (2, G)-automaton. Notice here 0 k3 a role of b 3 , i.e. * ( b 3 ) = k 3
(
) ( ). =
Thus we have J ( 2 , G ) = [I(G)/21 = 2.
In the same way as the above, we can prove: Theorem 1.5.4 Let n and k be positive integers which are relatively prime, and let G be a finite group such that I ( G ) 1 (mod n).
1.6. DIRECT PRODUCT OF AUTOMATA
35
Moreover, assume that there exist a set of generators H of G and a n element h E H such that IHI = I(G) and o(h) = k (mod n) where o ( h ) means the order of h. T h e n we have J ( n , G) = [I(G)/nl. Corollary 1.5.1 Let G be a finite group such that I ( G )[GI is a n odd number. T h e n we have J ( 2 , G ) = [I(G)/21.
Proof This is the case where we put, in the above theorem, n = 2, k = 1, I ( G ) = 1 (mod 2) and o(h) = 1 (mod 2). Here, h is an arbitrary element in H .
1.6
Direct product of automata
In this section, we will deal with direct products of group-matrix type automata and their automorphism groups. Definition 1.6.1 Let A = (S,X , 6 ) and B = (T,X , y) be two automata. The direct product, A x B,is the automaton A x B = ( S x T , X , 6 x y) where 6 x y ( ( s , t ) , a ) = ( S ( s , a ) , y ( t , a ) )for any ( s , t ) E S x T and a E X .
Before introducing the notion of the direct product of groupmatrix type automata, we define the product of two group-matrices. Definition 1.6.2 Let H and K be subgroups of a finite group G, respectively. Moreover, assume that Y = (yij), i , j = 1 , 2 , . . . , n and 2 = ( z p q )p,, q = 1 , 2 , . . . , rn are groupmatrices of order n on H and of order rn on K , respectively, i.e. Y E and Z E Fm. Then the K-product (Kronecker product) Y @ 2 of Y = (yij) and Z = ( z p q )is defined as follows:
-
Notice that Y @ Z is a group-matrix of order nrn on G, i.e. Y @ Z E
Grim .
36
CHAPTER 1. GROUP-MATRIX TYPE AUTOMATA The following proposition can be easily proved.
Proposition 1.6.1 Let H and K be subgroups of a finite group G such that h k = k h f o r any h E H and any k E K . Then we have (Yi 8 2 1 ) (Y2 8 2 2 ) = (fiY2)8 ( 2 1 2 2 ) f o r any Y1,YZ E and & , 2 2 E
K.
-
Definition 1.6.3 Let H and K be subgroups of a finite group G. Moreover, - we assume that 9 and II are mappings of X , into H, and into K,, respectively. Then the K-product 9 I8 II of 9 and II is defined as follows:
9 8 I I ( a ) = * ( a ) 8 I I ( a ) for any a E X . Under the same notations as above, we have:
Proposition 1.6.2 Assume that h k = k h holds f o r any h E H and any k E K . Then we have 9 8 II(z) = a(.) I8 II(z) f o r any z E X * . Here 9 8 II, 9 and II are extended, respectively, to the mappings of X * in the natural way as indicated in Remark 1.2.1. Definition 1.6.4 Let H and K be subgroups of a finite group G. Moreover, we assume that A = (H,,X,Sq) and B = ( K , X , b n ) are an ( n , H ) - , and an (m,K)-automaton, respectively. Then the K-product A 8 B of A and B is the (nm,G)-automaton A I8 B = ( G G , 6*@II). h
x,
In what follows, we will deal with the case G = H x K .
Theorem 1.6.1 Let G be the direct product of finite groups H and K , i.e. G = H x K . Moreover, assume that A = ( z , X , 6 q ) and B = (K^,,X,Sn) are a n ( n , H ) - , and a n ( m , K ) - a u t o m a t o n , respectively. T h e n we have A 8 B M A x B .
Proof For any f = ( h l ,ha,. . . , h,, k l , k 2 , . . . , k,) define the mapping p as follows:
h
E
-
H, x K,, we
p(f) = ( h l k l , h l k 2 , . . . , h l h , h2k1, h2k2,. . . , hzkrn,. . . , h n h , hnk2,. . . , hnkrn).
1.6. DIRECT PRODUCT OF AUTOMATA
37
Then p ( f ) E Gim-holds. Moreover, since G = H x K , p is a bijective mapping of H, x K m onto Grim. Now, we prove that p(6q x 6 , ( f , a ) ) = 6q,n(p(f),a) holds for any a E X and any f E Hn x K m . Let f = ( h l , h 2 , . ..,h,,kl,k2 ,..., km) E Hn x Km, let u E X and let 6q x 6n(f, U ) = ((hi, h2,. . . , hn)Q(U), ( k i , k 2 , . . . , k r n ) n ( ~ = )) ( h i ,hb, . . . , hk, k i , kb, . . . , k&). Then we have the following: h
0
h
-
h
s=l
t=l
Here, we have put *(a) = (gPg(u)), p , q = 1 , 2 , . . . , n and n ( u ) = (7r,,(a)) , T , s = 1 , 2 , . . . ,m. Hence the [(i - 1)rn j]-th entry of p(6q x 6n(f, a)),E GTm is computed as follows:
+
On the other hand, we put 6q,,,(p(f),
u ) = p ( f ) (Q 8 11) ( u ) =
(~1,~2,...,~nrn).
Now, we compute the value ~ ( i - l ) ~ First, + ~ . notice that h&, s = 1 , 2 , . . . , n, t = 1 , 2 , . . . , rn is the [(s- 1)m t]-th entry of p ( f ) . Put here (Q 8 11)(a)= ( t a p ) , a , p = 1 , 2 , . . . , nm. Thus we have Y ( ~ - ~ ) ~ + ~
+
= Chsktt[(s-l)rn+tl[(i-l)rn+ji.since s,t
is an and matrix, holds. Consequently, we have fore, we have
Thereand thuss
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
38
Corollary 1.6.1 Let G be the direct product of finite groups H and K , i.e. G = H x K . Moreover, we assume that A = X , SQ) and B = ( K , X , S n ) are a n ( n , H ) - , and a n (m,K)-automaton, respectively. Then A x B is a strongly connected automaton with G ( A 2 B) M G i f and only i f {Q @ I I ( a ) I a E X } is a regular system in Grim. If, in addition, A and B are regular, then G ( A x B ) M G mentioned above can be replaced b y G ( A x B) M G(A) x G ( B ) .
(z,
1.7 Factor automata In this section, we will consider the factor automata of group-matrix type automata. An application will appear in a decomposition theorem of automata. Definition 1.7.1 Let A = (S,X , 6 ) be an automaton and let G(A) be its automorphism group. Moreover, assume that H is a subgroup of G(A). Then the factor automaton A / H is the automaton A / H = X , G ) where = (3 I s E S},3 = {t I t E S and there exists h E H such that t = h ( s ) }and G(3, a ) = S(s, a ) for any 3 E and a E X . any
(5,
To investigate factor automata of group-matrix type automata, we define the following: Definition 1.7.2 Let A = (&, X , 6 ~ be ) an (n,G)-automaton and let t be a homomorphism of G onto some group. Then A t is the (n,t(G))-automaton A t = (t(Z$n, X , St[,]) such that t [*I] ( a ) =
( c ( $ p q ( a ) ) ) for any a E X where
c
is the extension of
< on Go
with c(0)= 0, and @ ( a )= ($pq(a)). The following result is immediate. Proposition 1.7.1 Let A = (&,X,S,p) be a strongly connected ( n ,G)-automaton. Then A t is also strongly connected.
The following theorem plays a fundamental role in this section.
1.7. FACTOR AUTOMATA
39
(c,,
Theorem 1.7.1 Let A = X , 6,) be a regular (n,G)-automaton and E be a homomorphism of G onto some group. Then we have At M A/Ker(<) where Ker(E) means the kernel of J, i.e. Ker(t) = J - l ( ( ( e ) )(e is the identity of G). Remark 1.7.1 In the above, we identify G ( A )with G. That is, we identify ps E G ( A ) with g E G (for the notation, see the proof of Theorem 1.2.1). Consequently, Ker([) is assumed to be a subgroup of G ( A ) .This assumption will be taken throughout this section.
Proof of Theorem 1.7.1 X , G). Then for f^ the following:
(z, -
Put H = K e r ( J ) & G and A / H = = (fp) E G,, k = ( k p ) E G^, we have h
-
-
f^ =
holds if and only if there exists an element E h E H such that f = h($) = p h ( i ) = ( h k p ) . h
Now, we define the mapping Z as follows: h
= (F(gp))
for any i j = ( g p ) E G,.
Then, Z is welEefined as a mapping and it is a surjective mapping of onto J ( G ) n . _ _ Now, we will show that At M A / H holds. Since b ~ ( g , a = ) b w-( g-, a ) = g*(a) holds for any i j E En and any a E X , we have E ( b H ( g , a ) ) = E(gq(a)). Now, we put i j = ( g p ) E G, and * ( a ) =
5
h
( & ~ q ( ~ ) )Then .
we have G*(a) =
xgk'$kp(a) (krl
(&?k)F(c.tr(ai))
= (ngp,)
(F(ipd4)
)
.
= =(Z)J[*l(a)
= 6C[Q](=
k=l
(a,Therefore, 4. we have A€
M
A/H.
Corollary 1.7.1 Let A = (G^,, X , 6,) be a regular (n,G)-automaton and E be a homomorphism of G onto some group. Then J(G) is isomorphic to a subgroup of G ( A /Ker(<)).
40
CHAPTER 1. GROUP-MATRIX TYPE AUTOMATA
Proof The proof is immediate from the above theorem and Theorem 1.2.1. By the so-called homomorphism theorem, we have the following Fleck's result [18]. Corollary 1.7.2 Let A = ( S ,X , 6) be a strongly connected automaton and H be a normal subgroup of G ( A ) . T h e n G ( A ) / H is isomorphic to a subgroup of G ( A / H ) .
(G,
Corollary 1.7.3 Let A = X , 6,) be a regular (1,G)-automaton and J be a homomorphism of G onto some group. T h e n J(G) is isomorphic to G ( A / Ker(()). By Theorem 1.7.1, we have A, w A/Ker(E). Therefore, G ( A t ) M G(A/Ker(()) holds. On the other hand, by Proposition 1.7.1, A, becomes strongly connected and thus regular. Consequently, we have J(G) M G ( A t ) ,i.e. ((G) M G(A/Ker(<)).
Proof
The following F'reck's result [18] is an immediate consequence of the above theorem. Corollary 1.7.4 Let A = ( S ,X , 6 ) be a strongly connected automat o n such that IS( = ( G ( A ) (and let H be a normal subgroup of G ( A ) . T h e n G ( A ) / HM G ( A / H ) holds. By Theorem 1.2.4 and Proposition 1.7.1, we have the following theorem.
(6,
Theorem 1.7.2 Let A = X,6,) be a strongly connected ( 2 ,G)automaton and ( be a homomorphism of G onto some group. T h e n A t is not regular if and only if there exist some automorphism 7 of ((G), some element k' E E(G), two mappings A, y of G into 2G\{0}, 2G means the set of all subsets of G ) and two subsets A, r, # 0 of G, such that ~ ( k ' )= k', $ ( g ' ) = k'g'kl-l for any g' E E(G), A(g) C J-'qE(g) and y ( h ) C ( - ' v J ( h ) J - ' ( k ' ) for any g E A and any
r, and Q ( u ) = { A, h E r}. hE
1.8. PRIME ORDER CASE
41
Immediately, we have:
Corollary 1.7.5 Let A = ( S ,X , S ) be a strongly connected automuton such that IS(= 2 IG(A)I and let H be a normal subgroup of G(A). T h e n if A is not a permutation automaton, G ( A ) / H M G ( A / H ) holds. Remark 1.7.2 The above result will be extended in the following section. Finally, we apply our method to the proof of an elementary decomposition theorem of automata by Fleck [18].
Theorem 1.7.3 Let A = ( S ,X, S) be a strongly connected uutomat o n such that I S1 = IG(A)I. Moreover, assume that G(A) is the direct product of groups H and K, i.e. G(A) = H x K . T h e n A M A I H x A I K holds. Proof We can assume that G(A) = G = H x K and A is a regular (1,G)-automaton of the form A = X,8,). Now, put c ( g ) = h and q ( g ) = k for any g = h k E G where h E H and k E K . Then ,$ and q are well defined as homomorphisms of G onto H and onto K , respectively. Moreover, we have Ker([) = K and Ker(q) = H. Consequently, by Theorem 1.7.1, we have A I H M A, and A I K M A,. Put A, = (f?1,X,S,pq), A, = ( K , X , S , [ q ) and Q ( a ) = ($(a))for any a E X. Then we have E [Q] (u)= (<($(a))) and q [Q] (u)= ( q ( $ ( a ) ) ) .By the assumption that G = H x K, we have $(a)= q [a](a)( [Q] ( a ) . Consequently, we have ( q [Q] 8 [Q]) (u)= ( $ ( a ) ) = Q ( a 1 That is, q [Q] I8 Ep]= holds. Therefore, we have A, @ A, = (G1, X , 6,[,],,[,]) = (G1, X , Sq) = A . By Theorem 1.6.1, we have A, x A, M A, @ A,. On the other hand, A I H x A I K M A, I8 A, holds. Thus we have A x A I H x A I K .
(G,
1.8
Prime order case
In the previous section, we dealt with group-matrix type automata. Especially, in Theorem 1.2.5, we gave a necessary and sufficient con-
42
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
dition for a strongly connected (n, G)-automaton to be regular. However, the condition seems not easy to handle. In this section we will deal with clear and simple cases, i.e. the cases that the orders of strongly connected group-matrix type automata are prime. Moreover, we apply our results to problems concerning factor automata and direct products of strongly connected automata.
(cn,
Theorem 1.8.1 Let A = X, 6 ,) be a strongly connected (n, G)automaton where n is a prime number. T h e n A is either regular or isomorphic t o some group-matrix type automaton of order 1.
Proof There exist some positive integers p and g such that IG(A)I = plGl and n J G I = lGnl = gJG(A)I. Consequently, we have nlGJ = pqIGI,namely, n = pq. Since n is a prime number, either ( p , q ) = (1,n) or ( p ,g) = (n,1) holds. Case ( p , q ) = (1,n). It follows from IG(A)I = /GI that A is regular. Case ( p , g) = (n, 1). From IG1= IG(A)I and Theorem 1.3.1, it follows that A is isomorphic to some strongly connected (1,G(A))automaton. h
Corollary 1.8.1 Let A be a strongly connected (n,G)-automaton where n is a prime number. T h e n if A is not a permutation automaton, A is regular.
Proof This is immediate from the above theorem and Proposition 1.2.2. Remark 1.8.1 When n is not a prime number, the above is not true. Example 1.8.1 The following strongly connected (4, G)-automaton A is not regular though it is not a permutation automaton: A= X, 6 ~ where ) G = { e , g } ,g2 = e and e is the identity of G and X = ( a , b, c ) . g o o 0 O e O O
(G,
o o g o
o o g o
O O e O
43
1.9. REGULARITIES
G^4
Proof Here, we put the permutation p on as follows: p((h,0, 0,O)) = (O,O, h, 01, P((O,O, h, 0)) = ( h ,o,o, 01, P((0, h, o,o>> = (O,O,O, h ) and p((O,O,O, h ) )= (0, h,O,O) for any h E G. Then we have p E G(A). But, since we cannot represent p in the form p = ps ( g E G), G(A) M G does not hold. Thus A is not regular. Now, let us determine the automorphism group G(A) of A in the case that A is not regular. For this problem, we have the following result.
Theorem 1.8.2 Let A = (Cn, X, 6 ,) be a strongly connected (n,G)automaton where n is a prime number. T h e n G ( A ) is isomorphic t o 9(X*) i f A is not regular.
Proof By Theorem 1.8.1,there exists astrongly connected (1,G(A))automaton A’ isomorphic to A. Therefore, we have G(A) M G(A’) and C ( A ) M C(A’). On the other hand, C(A’) x G(A’) and C(A) M Q ( X * )hold. Consequently, we have G(A) M 9 ( X * ) .
1.9
Regularities
We will consider, in this section, the regularities of strongly connected (n, G)-automata. First, we give the following lemma. Lemma 1.9.1 Let A = ( S , X , 6 ) be a strongly connected automat o n isomorphic to some (1,G) -automaton. Furthermore, assume that there exist some so E S and x,y E X* such that SO, x) = SO, y ) . T h e n for any s E S we have 6(s, x) = 6(s, y ) .
Proof Notice that we can assume that A itself is a strongly connected (1,G)-automaton of the form A = (Gl,X,6*), i.e. S = G I and 6 = 6,. Then S(s0,x) = 6(s,,y) implies so@(x)= soQ(y), and h
h
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
44
thus we have Q(z) = Q ( y ) . Therefore, for any s E S (= have sQ(z) = sQ(y).
= G) we
The following is the main theorem in this section.
Theorem 1.9.1 Let A = (Fn, X ,6 ,) be a strongly connected (n,G)automaton where n is a p r i m e number. T h e n A is not regular if and only if the following two conditions are satisfied: (1)
For any Y E Q ( X * ) there exist some IJ f S ( n ) and G, i, j = 1 , 2 , . . . ,n such that Y = ( g p q e p c ~ q ~ ) .
(2)
Let Y = ( y p q ) and 2 = (zpq)be two elements in Q ( X * ) . T h e n if there exist some i , j = I, 2 , . . . ,n such that yij = zij # 0 , we have Y = 2 .
gij E
Proof (+) The proof of (1) is immediate from Theorem 1.8.1 and Proposition 1.5.3. Now, we prove (2). Let y and z be elements in X' such that Q ( y ) = Y and Q ( z ) = 2. Furthermore, we put g = ( e p i ) . Then y ) = (yije,j) = (zije,j) = Sq(g,z).By Lemma 1.9.1, we have 6q(G, b ~ @y ,) = a*(?, z ) holds for any Lj E G^,. Consequently, we have Y = 2. (+) Notice that H = Q ( X * ) forms a group from (1). Here, we X , b q l ) where @'(a)= @(a) for any a E X . put A' = Now, let us prove that A is isomorphic to A'. Let p be a mapping of G^, into H such that
(g,
i-th i-th
p ( ( 0, . . . ,0, 9 , 0, ' " , 0)) =
0 0
..*
* * ***
9
* *
* "
***
:)
*** *
E H
for any g E G and any i = 1 , 2 , . , . , n. By (2) and by the strong connectedness of A , we can verify that p is uniquely determined as a surjective mapping of G, onto H I (= H ) . We will prove that p(bq(g^,u ) ) = bq/(p(G),u ) for any G E G*-, and any a E X . Put G = (ge,i),g E G and *(a) = ( y p q ) . Then we have h
h
1.9. REGULARITIES
45 Here, assume that
Thus we have
Consequently, we have:
0 0
...
p‘- t h 0 gyzp’ 0
* * *** * * * *** *
*
*
...
* *** * *** *
On the other hand, we have 6q/(p(G),a ) = p(G)Q’(a) = p(G)*(a) i-th
0
...
* *** *
*
* *** *
p‘- t h
0
...
* *** * * *** *
*
*
* *** * *** *
By (a), p(b*(g^,u))= &(p(G),u) holds. Thus we have A M A’. Consequently, A’ is a strongly connected (1,H)-automaton. Therefore, G(A’) x H holds. On the other hand, since G(A) M G(A’), we have IG(A)I = / H I . By (2) and by the strong connectedness of A , we can obtain easily IH1 = nIGI. Thus we have IG(A)I = nlGI. Since n > 1, we have IG(A)I > IGI. Consequently, we have G(A) $ G, and this means that A is not regular. Example 1.9.1 The following (3, G)-automaton A satisfies the conditions of Theorem 1.9.1: A = X, 6,) where G = {e, g} , g 2 = e and e is the identity of G, and X = { a , b}.
(G,
g o o O O e g 0 ) and*@)= ( e 0 0 ) . 0 0 9 O e O
*(a)= ( 0
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
46
Thus A is not regular, and we have
O e O
O a O
e O O
O O e Now, Put s1 = ( e ,0, O), s2 = (9,0, O), s 3 = (0, e, 01, ‘94 = (0,9,O), (O,O,e) and 36 = (O,O,g). Then we obtain the following state transition diagram of A: s5 =
b
Figure 1.5: State transition diagram of A
1.10
Application to factor automata
In this short section, we apply our results to the problem developed in Section 1.7. Let A = X, 6 ,) be a strongly connected (n, G)-automaton where n is a prime number. Furthermore, assume that is a homomorphism-of of G onto some group. Then as mentioned in Section 1.7, At = (<(G)n,X, bt[,p~)is a strongly connected (n, <(G))-automaton. Moreover, by means of Theorem 1.9.1, we can decide whether At is regular or not.
(G,
<
1.11. APPLICATION T O DIRECT PRODUCTS
47
For example, we have the following theorem. Theorem 1.10.1 Let A be a strongly connected (n, G)-automaton where n is a prime number. Furthermore, assume that 5 is a homomorphism of G onto some group. T h e n if A is not a permutation automaton, A, is regular.
Corollary 1.10.1 Let A = ( S , X , 6 ) be a strongly connected automaton such that IS\= n (G(A)I where n is a prime number. Furthermore, assume that H is a normal subgroup of G ( A ) , T h e n i f A is not a permutation automaton, we have G ( A ) / H M G ( A / H ) .
1.11
Application to direct products
In this section, we provide a relationship between the direct product of automata and its automorphism group. Theorem 1.11.1 Let A = ( S , X , 6 ) and B = (T,X,y) be strongly connected automata such that IS( = IG(A)( and [TI = nlG(B)I, where n is a prime number. Furthermore, assume that A x B is strongly connected. T h e n if one of the following two conditions is satisfied, G(A x B ) M G(A) x G ( B ) holds. (1)
(2)
B is not a permutation automaton. IG(A)I and ( n - l)! are relatively prime, and so are IG(A)) and IG(B)I.
Proof By Theorem 1.3.1, there exist a regular (1,G(A))-automaton A’ = ( G ( A ) l ,X, 6,) and also a regular (n, G(B))-automaton B’= (G@)n, X , 6 ,) such that A M A’ and B M B’. Hence, by Theorem 3.6.1, A’xB’ M A’8B’holds. Here, A’8B’ = ((G(A) T G ( B ) ) n , X , 6qmn). Since A x B M A’ 8 B’, we have G ( A x B) M G(A’ 8 B’). Therefore, to prove the theorem, it is enough to verify that A’ 18 B‘ is regular. First, notice that A’@ B’is strongly connected as well as A x B. h
Proof of the regularity of A’ 18 B’ Case 1. Consider the case that B’is not a permutation automaton. Then A’ 8 B’is not also a
48
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
permutation automaton. Therefore, in this case, by Corollary 1.8.1, A' 8 B' becomes regular. Case 2. Now, assume that B' is a permutation automaton. Then obviously, so is A' 8 B'. First, prove that there exist an element z E X * and two positive integers i , j = 1 , 2 , . . . ,n, i # j such that n(z) = (ypq),yii = e and yjj # e where e is the identity of G ( B ) .
Proof of the above assertion Since B' is regular, by Theorem 1.9.1, there exist some elements y , z in X* and positive integers i, z',j,j' = 1 , 2 , . . . , n, i # j such that II(y) = ( y p q ) , n ( z ) = ( z p q ) , yip = z"22/ # 0 and yjj! # z y . Since B' is a permutation automaton, there exists some positive integer rn > 1 such that I I ( Y )=~ n ( y m ) = ( e p q ) . Here, we put z = zym-'. Thus II(x) = (ypq), yii = e and y j j # e. We have the following two cases. (i) y j j = 0. (ii) e
# y j j # 0.
Case (i). Put Q(z) = g E G(A) (= G ( A ) l ) . Then (98 Il)(z) = ( g y p q ) . Since A' @ B' is a permutation automaton, there exist some f p q E G ( B ) , p4, = 1 , 2 , . . . ,n and a permutation T on { 1 , 2 , 3 , .. . , n} such that ~ ( i=)i, ~ ( j# )j and (Q @ II)(x) = ( g y p q ) = (gfpqep.r(q)). Now, we calculate (upq)= (Q @ II)(d)where t = IG(A)I.From the assumption that (G(A)Iand ( n - l ) ! are relatively prime, uii = e and u j j = 0. On the other hand, (Q 18 II)(E) = ( e p q ) . Therefore, by Theorem 1.9.1, A' C3 B' becomes regular. Case (ii). Put 9 ( x ) = g E G(A) (= G(A)l). Then (Q@II)(x)= ( g y p q ) holds. Let t be a positive integer and put (9 C3 II)(z:")= ( v p q ) . Then we have vii = gt and v j j = S t y 33 ? . . Now, we put t = IG(A)I. Since g E G ( A ) ,e # yjj E G ( B ) and, IG(A)I and IG(B)I are relatively prime, we have vii = e and vjj # e. On the other hand, (9@ TI)(&) = ( e p q ) . Therefore, by Theorem 1.9.1, A' C3 B' becomes regular.
Remark 1.11.1 In the above theorem, neither of two conditions of (2) can be eliminated. First, consider the case that IG(A)I and ( n - l ) ! are not relatively prime.
2.11. APPLICATION T O DIRECT PRODUCTS
49
Example 1.11.1 Let H = { e , h } , h2 = e , K = { e } and H x K = { e , h } where e is the identity of H x K . Put X = {a,b}, \I.(.) = k , e O O O e O Q ( b ) = e, n(u)= 0 0 e and! (II = 0 0 e O e O e O O Then A = X, 6yr) and B = (K3,X, 6,) are regular groupmatrix type automata. Notice that ( G ( A ) = ( IH( = 2 and ( n- l)!= 2. Moreover, A 8 B = ( ( H x K ) 3 ,X,Syr@n).
( )
( ).
(H?,
h
E ( H F K ) 3 and ( Q @ I I ) ( b )=
Here, ( Q @ I I ) ( u )=
Then we can calculate easily:
e O O
O e O
O O e
O O e
e O O
O e O
(:: (:'d; :), ('d; : ')}. "),
O O h
O h 0
h O O
From the above, we can see that A 123B is strongly connected, but not regular. Thus G ( A x B) rn G ( A ) x G ( B ) does not hold. Now, we consider the case that (G(A)Iand IG(B)I are not relatively prime. Example 1.11.2 For the following automata A and B, G ( Ax B ) M G ( A ) x G ( B ) does not hold.
H = { e , g } , g 2 = e , K = { e , h } , h 2= e,gh = hg and e is the identity of H x K . H x K = { e , g , h , g h } ,A = X , S,) and B = (g2, X , 8,) where X = {a, b } .
(a,
50
CHAPTER 1. GROUP-MATRIX T Y P E AUTOMATA
Then we have G ( A ) M H and G ( B ) M K . Moreover, IG(A))= IG(B)I = 2. On the other hand, A @ B = ( ( H T K ) 2 , X , b g m ) where P ! @ l l ( a )=
( )
and \k
@I@)
=
(::).
It is easy to verify that A @ B is not regular. Thus G(A x B) M G ( A )x G ( B ) does not hold.
Figure 1.6: State transition diagram of A @ B
Chapter 2
General Automata In the previous chapter, we discussed the automorphism groups of strongly connected automata. To this end, we introduced the representations of automata, called group-matrix type automata. However, the strong connectedness of automata was indispensable for these sorts of representations. Thus we felt the necessity of introducing some other representations of automata connecting with the automorphism groups of general automata. In the following sections, we will attempt to generalize our results developed in the previous chapter for the case of general automata. For this purpose, we will introduce generalized group-matrix type automata as representations of general automata and we will also provide several properties of these sorts of automata. The contents of this chapter are based on the results in [33].
2.1
Generalized representations
In this section, we will define a generalized group-matrix type automaton. To this end, we will introduce the notion of the SP-condition for a finite group G and a family of subgroups of G. Lemma 2.1.1 Let H and K be subgroups of a given finite group G , respectively. Moreover, let g be a n element in G . T h e n H C_ 9 K g - l holds i f and only if ( g ' H ) ( g K ) C gIgK holds f o r any g' E G.
51
CHAPTER 2. GENERAL AUTOMATA
52
Proof (+) ( g ' H ) ( g K )C g'gKg-lgK = g'gK. (+) Let g' = e where e is the identity of G. Then H g K Hence Hg C gKg-l.
gK.
Definition 2.1.1 L e t G b e afinite group and l e t I d n ) = { H I ,H2, H3, . . . , H n } be a family of subgroups of G satisfying the following condition: n
n(i=ln g H i 9 - l )
= {el.
gEG
Henceforth, we call this condition the separation condition (or in short, the SP-condition). Now, we define generalized groupmatrices.
A matrix (gpqHq)is called a generalized group-matrix of order n ouer ( H ( n ) , G )and denoted (gpqHq)E G ( H ( " ) )if the following two conditions are satisfied:
(1)
(gpq) E
G,.
(2) If g i j # 0, then Hi
gijHjgij 1 .
Definition 2.1.2 Let H and K be subgroups of a given finite group G, respectively. We introduce two operations (.) and (+) as follows:
(I) For g , h E G, we put ( g H ) . ( h K ) = ghK if it is well-defined. (2) For any g , h E G, we define 0 ( h K ) = ( g H ) . O = 0 . 0 = 0 where 0 . H = 0 . K = 0. (3) For any g
E
G, we define ( g H )
o+o=o.
+ 0 = 0 + ( g H ) = gH
(4) For any g , h E G, we do not define ( g H )
and
+ (hK). S
We will use sometimes the notations ( g H ) ( h K )and C g i H i ini=l stead of ( g H ) . ( h K ) and g1H1 g2H2 . . . g,H,. Notice that the
+
+ +
S
sum X g i H i is defined only if at most one of giHi, i = 1 , 2 , . . . , s is i=l nonzero.
2.1. GENERALIZED REPRESENTATIONS
53
Proposition 2.1.1 Let H and K be subgroups of a given finite group
G, respectively. Moreover, assume that there exzsts an element h E K such that H C hKh-l. Then for anyg E G we can define ( g H ) ( h K ) . Proof
Obvious from Lemma 2.1.1.
Definition 2.1.3 Let (gpqHq)and (hpqHq)be elements in G ( H ( n ) ) . Then we define the multiplication (gpqHq)( hpqHq)as follows:
)
n ( g p q H q ) (hpq H q ) =
(k=l ( g p k Hk) (hkqHq) = ( & I p k h k q H q )
In this case, (gpqHq)(hpqHq) is well-defined and it is contained in H (.I).
G(
Adequacy of the definition E
It is enough to show that, for g i k , h k j
G, (gikHk)(hkjHj)is well-defined, i.e. we have to show that Hk
h k j Hj h;;.
However, this is obvious from the fact that (hpqHq)E (?(H(n)). Proof .f(g,,H$(h,,H,)
E
G(fW
Let
(fpqHq) =
(gpqHq)(hpq
holds for any i , j = 1 , 2 , . . . ,n. k=l It follows that ( f p q ) E from the fact that (gpqHq), (hpqHq)E G ( H ( , ) ) . Therefore, it is enough to prove that, if f i j # 0, then Hi C fijHj First, notice that, for f i j # 0, we can find some r = 1 , 2 , . . . , n
H q ) . Then
fij = x g i k h k j
fzT'.
n
# 0 and k=l h r j # 0 , we have Hi C_ girHrg,' and Hr & hrjHjhG1. Thus we have Hi C_ (g~rh~j)Hj(girhrj)-',i.e. Hi C_ f i j H j f i l . This completes the proof of (gpqHq)(hpqHq) E G(H(,)).
such that
fij =
C g i k h f i j = g i r h r j . From the fact that gir
Definition 2.1.4 Let H ( n ) = { H I ,Hz, H3,. . . , H,} be a family of subgroups of a given finite group G satisfying the SP-condition. Then a vector ( f p H p )is called a generalized group-vector of order n over ( H ( n ) , G )and denoted ( f p H p )E 6 ( H ( n ) )if (fp) E G^, holds.
CHAPTER 2. GENERAL AUTOMATA
54
For any ( f p H p )E e ( H ( n ) )and any (gpqHq)E 6(Idn)), we define the following multiplication:
Under this operation, we obtain (fpHp)(gp,H,) E z ( H ( n ) ) . Definition 2.1.5 Let = { H I ,H2, H 3 , . . . ,H,} be a family of subgroups of a given finite group G satisfying the SP-condition. An automaton A = (G(Idn)), X ,6 ,) is called a generalized group-matrix , (or in short, an G)type automaton of order n over ( H ( n )G) automaton) if A consists of the following data:
(1) e ( H ( n ) )is the set of states. (2) X is a set of inputs.
(3) bq is a state transition function and it is defined by
b ( ( f p H p ) , a= ) ( f p H p ) 9 ( a for ) (j$Hp) E 6(ldn)) and a E X where 9 is a mapping of X into G ( H ( n ) ) . Remark 2.1.1 The mapping 9 can be extended to the mapping of X * into G ( H ( ~as ) )follows: Q((E)= (epqHq)and Q(zy) = 9(z)Q(y) for any z, y E X*.
In this case, we can easily see that 6 q ( ( f p H p ) , z= ) (fpHp)Q(z) holds for any ( f p H p )E (??(H(n))and any z E X * .
2.2
Some properties
In this section, some properties of generalized group-matrix type automata are described. First, notice that, in the definition of generalized group-matrix type automaton, if Hi = {e} for any i = 1 , 2 , . . . , n where = { H I ,H2, H 3 , . . . , H n } , then an ( H ( n ) G)-automaton , is regarded as an (n, G)-automaton.
2.2. SOME PROPERTIES
55
Proposition 2.2.1 Let A be an ( H ( l ) G)-automaton , where = { H } . Then if H is a normal subgroup of G, A is a (1, G) -automaton.
Proof By the SP-condition, we have n 9 H g - l = { e } . Since H is SEG
a normal subgroup of G, 9Hg-l = H holds for any g E G. Thus we have H = { e } . This means that A is a (1,G)-automaton. Remark 2.2.1 In the above, the assertion of the proposition is not true when H is not a normal subgroup of G. For example, let G be the alternating group A(5) of degree 5 and let H be a subgroup of G such that { e } # H # G. Then since A ( 5 ) is
a simple group, the normal subgroup
ngH9-l must be equal to {e}.
SEG
Thus satisfies the SP-condition. Now, put X = {a} and Q(a) = ( H ) . Then it is easily seen that A = ( G ( H ( ' ) )X , , bip) is an ( H ( l ) G), automaton. Therefore, there exists an ( H ( l ) G)-automaton , which is not a (1,G)-automaton. Proposition 2.2.2 A strongly connected (Idn), G)-automaton is an (n, G)-automaton.
Proof Let A be a strongly connected (Idn),G)-automaton with I d n ) = { H I ,Hz, H 3 , . . . , Hn}. By the strong connectedness of A , for any g, h E G and any i, j = 1 , 2 , . . . ,n, there exists some Y E * ( X * ) such that ( 0 , . . . , O,gHi, 0 , . . . ,O)Y = ( 0 , .. . , 0 , h H j , 0 , . . . , O ) . From the above, we can see that, for any f E G and any i, j = 1 , 2 , . . . , n, n
Hi2 fHjf-l holds. Thus we have HiC
( n f H j f - l ) for any f EG j=1
i = 1 , 2 , . . . ,n. By the SP-condition, we have Hi = { e } for any a = 1 , 2 , .. . ,n. Consequently, A is an (n, G)-automaton. Remark 2.2.2 Similar results can be obtained for a weakly connected automaton and a singly generated automaton. For these sorts of automata, see Bavel [6].
CHAPTER 2. GENERAL AUTOMATA
56
Theorem 2.2.1 Let G be a finite group and let A = ( e ( H ( n ) )X, , 6,) be an ( H ( n )G)-automaton. , Then G is isomorphic to a subgroup of G(A)* Proof For any g E G, we define the following mapping pg of onto itself Pg((fpHp)) =
(gfpHp) for any ( f p H p ) E
G(Idn))
Ww.
First, it is easily seen that pg is well-defined as a permutation on G(H ( n )) . Now we show that pg(6q((0,.. . , 0 , giHi,O, . . . , 0), a ) ) = dq(p,((O, . . . ,0, g&, 0 , . . . ,O)), a) holds for any a E X and any gi E G, i = 1 , 2, . . . ,n. Let a be an element in X and let @ ( a )= (hpqHq).Assume that hij # 0. Notice that j 2 1 is determined uniquely with respect to i. Then we have S q ( ( 0 , . . . ,O,giHi, 0 , . . . , 0), u ) = (0,. . . ,O,giHi, 0 , . . . , O)@(a)= (0,. . . , 0 , gihijHj, 0 , . . . , O ) . Thus we have pg(6q((0,. . . , 0,gi Hi, 0 , . . . , O ) , a ) ) = (0,. . . , O , ggihijHj, 0 , . . . , 0). On the other hand, we have 6 q ( p g ( ( 0 , .. . ,O,giHi, 0 , . . . , O ) , a) = d q ( ( 0 , . . . ,o, ggzHz,O,. . . ,O), a ) = (0,. . . ,o, ggiHi,o,. . . ,O)@(a)= (0, . . . , 0, ggi hij Hj , 0, . . . , 0) . Hence we have pg(Sq((O,. . . , 0 , giHi, 0 , . . . , O ) , u ) ) = 6 q ( p g ( ( 0 , .. . , 0, giHi, 0 , . . . , 0)),a ) . Since pg is a permutation on 6(fdn)), we have Pg E G ( 4 . pg is an isomorphism of Next, let us prove that the mapping g G into G ( A ) . Since it is almost obvious that the mapping g 4pg is a homomorphism, we prove only that g -+ pg is an injective mapping. Assume that pg = ph holds for g , h E G. Then for any i = 1,2, . . . , n and any f E G, we have pg((O,. . . , O , f H i , O , . . . , O ) ) = p h ( ( 0 , . . . , O , f H i , O , . . ., 0)). Thus g f H i = h f H i holds for any i = --f
n (nfI3if-l). n
1 , 2 , . . . , n and any
f
E
G, and this implies h-lg E
f E G i=l
By the SP-condition, we have h = g . This means that g -+ pg is an injective mapping, and hence we complete the proof of the Theorem.
Definition 2.2.1 An G M G(A) holds.
(H("), G)-automaton A
is said to be regular if
2.3. REPRESENTATIONS OF GENERAL AUTOMATA
57
We will discuss later the regularities of generalized groupmatrix type automata.
2.3
Representations of general automata
In this section, we deal with representations of general automata by regular generalized group-matrix type automata. Lemma 2.3.1 Let A = ( G ( H ( n ) )X, , 6,) be an (H(,), G)-automaton
and G' be a group isomorphic to G . Then there exist a family of = { H i , Hh, H i , . . . , Hh}, satisfying the SPsubgroups of G', condition, and an (HI(,), GI)-automaton A' isomorphic to A. Proof Let = { H I ,H2, H 3 , . . . , H n } . From the fact that G M G', there exists an isomorphism 'p of G onto G'. Here, we put Hi = 'p(Hi) for any i = 1 , 2 , . . . ,n. Then it is easily seen that HI(") = { H i , Hh, H i , . . . , Hh} satisfies the SP-condition. Now, we define a set of inputs X' and a mapping Q' of X into G(H'("))as follows:
(1) X' = {a'
1 a E X}.
(2) *'(a') =
(cp(gpq)q),
if Q(a>=
(gpqffq).
Thus an (H'("),GI)-automaton A' = ( C ( H ' ( , ) ) , X ' , S,/) can be defined. It can be easily seen that, there exist an injective mapping p of G(H(,)) onto G?(H'(")) and an injective mapping E of X onto X ' , such that P(6d(SpHp),a>>= 6w(p((gpHpN,[ ( a ) ) for any ( g p H p )E g ( H ( " ) )and any a E X . For example, it is enough to put
p ( ( g p H p )= ) (@(gp)HA)and [ ( a ) = a' for any (gpHp)E G(H(,)) and any a E X. This means that A' is isomorphic to A. Theorem 2.3.1 Let A = ( S ,X , 6) be an automaton and let G be a finite group such that G M G ( A ) . Then there exist a positive integer n, a family of subgroups of G, H ( n )= { H I ,H2, H 3 , . . . , H,} satisfying the SP-condition and a regular ( H ( " ), G )-automaton isomorphic to A .
CHAPTER 2. GENERAL AUTOMATA
58
Proof By Lemma 2.3.1, we can assume that G = G ( A )without loss of generality. Let n be the cardinality of the set of all equivalence classes by on S (for the relation -, see the proof of Theorem the relation N
n
1.3.1). Then we have S = US. and Si
n Sj = 0 , i # j
where each
i=l
Si = {g(si) 1 g E G ( A ) } , i= 1 , 2 , .. . , n is an equivalence class by the relation on S. Now, we put Hi = { g E G ( A ) I g(si) = si} for any i = 1 , 2 , . . . ,n. First, we prove that each Hi, i = 1,2, . . . ,n is a subgroup of G ( A ) . To this end, since G ( A ) is a finite group, it is enough t o verify that g h E Hi holds for any g , h E Hi. Let g and h be elements in Hi. Then by the definition of Hi, g(si) = h(si) = si holds. Therefore, we have gh(si) = g(si) = si, i.e. g h E Hi. Next, we prove that H ( n ) = { H I ,H2, H3,. . . , H,} satisfies the
-
SP-condition. Let h E
n
n (i=ln g H i g - l ) , i.e. h
E gHi9-l for any g E
G(A)
gEG(A)
and any i = 1 , 2 , . . . , n. Notice that, for any s E S , there exist some i = 1 , 2 , . . . , nand gi E G ( A ) such that s = gi(si). For this g i , we have h E giHig211,namely hgi E giHi. This implies hgi(si) = gi(si). Since s = gi(si), we have h ( s ) = s. This means that h = e holds. n
Thus we have
n (ngHig-l)
= {el.
gEG(A) i=l
Now, notice that, for any i = 1 , 2 , .. . , n and any a E X, we can find a unique integer k = 1 , 2 , . . . , n and an element h E G ( A ) such that 6 ( s i , a ) = h ( s k ) . Hence we can define a mapping Qj of X into G Q ) ( H ( ~ ) as ) follows: @(a) = (gpqHq)where
gij = h
if j = k, and
gij = 0
if j
# k.
Adequacy ofthe definition Let 6(si,a ) = gij(sj) = gij(sj) where I g i j , g i j E G ( A ) . From the above, g2G1gij(sj)= s j holds. By the definition of H j , we have gt71g:j E H j , namely gijHj = g!211.Hi. Proof of @(a) E G g ) ( H ( n ) ) It is obvious that, for any i = 1 , 2 , . . . ,n, there exists a unique integer j = 1 , 2 , . . . ,n such that g i j # 0.
2.3. REPRESENTATIONS OF GENERAL AUTOMATA
59
Therefore, we will prove only that, if gij # 0, then Hi C gijHjg,'. Since g i j # 0, we have 6(si,a) = gij(sj). Let g be an element in Hi. Then g(si) = si holds. Thus we have gij(sj) = 6(si,a) = b(g(si),a) = g(6(si,a))= g g i j ( S j ) . Cosequently, ggij E gijHj holds and hence we have g E gijHjg;'. This means that Hi 2 gijHjg;' holds.
, A' = (GG)(H(n)), X, Thus we have an ( H ( n )G(A))-automaton 8,). Now, we will prove that A M A'. To this end, we define first [ as the identity mapping on X, i.e. c ( a ) = a for any a E X. Next, we define the mapping p as follows: p ( s ) = (0, . . . , 0, giHi, 0 , . . . ,0) for s E S where i and gi are an integer and an element in G(A), respectively, determined with respect to s such that s = gi(si). Adequacy of the definition Assume that s = gi(si) = gi(si) holds for g i , g i E G(A). Then it is directly shown that giHi = giHi holds. Moreover, it is obvious that p is a mapping of S onto G(A) (Idn)). Now, we prove that p is a surjective mapping. Suppose that p ( s ) = p ( t ) holds where s , t E S . Then there exist an integer i = 1,2,.. . ,n and elements g i , hi E G(A) such that s = gi(si), t = hi(si) and giHi = hiHi. By giHi = hiHi, we have gi(si) = hi(si), and hence s = t. This means that p is a surjective mapping. Finally, we show that p(6(s,a)) = G q ( p ( s ) , [ ( a ) ) holds for any s E S and any a E X. Suppose that s = gi(si) and 6 ( s i ,a) = gij(sj) where gi,gij E G(A). Then we have p(S(s,a)) = p(S(gi(si),a))= p(g2(6(sz, 4 ) )= P ( 9 2 9 i j ( S j ) ) = ( 0 , . . . , 0, SiSijHj, 0 , . . . ,0). On the other hand, we have: h
= (0,. . . , 0 , (giHi)(gijHj),O,.. . , 0 ) = ( 0 , .. . ,O,gigijHi,O,. . . , O ) .
CHAPTER 2. GENERAL AUTOMATA
60
Thus we have p ( S ( s , u ) ) = 6 q ( p ( s > , u ) = 6q,(p(s),<(u)). Hence A' holds. To conclude, we prove the regularity of A'. Since A' N" A , we have G(A')M G ( A ) .This means that A' is regular.
A
M
Example 2.3.1 Fig. 2.1 describes the state transition diagram of an automaton A = ( S ,X , 6). We will give a representation of A by a regular generalized group-matrix type automaton.
G ( A )= { e , ( p q ) ,( s t ) ,( p q ) ( s t ) }where e is the identity of G ( A ) .
6(sl,u ) = 6 ( p , a) = T
= e ( s z ) , 6(s2,u ) = 6(~, u) = T = e(sz),
6(s3,u ) = 6 ( s ,u ) = s = e ( s 3 ) , 6(sl, b) = b(p, b ) = p = e ( s l ) , b(s2,b) = 6(~, b) = T = e ( s z ) , 6(s3,b ) = 6 ( s ,b) = t = ( s t ) ( s 3 ) .
A' = ( G P ) ( f d 3 ) {) a, , b ) , 6qj)
M
A.
2.4. REG ULA RITIES
61 b a
Figure 2.1: State transition diagram of A
2.4
Regularities
In the present section, we will investigate the regularities of generalized groupmatrix type automata. However, we will deal with only a very special case for a generalized group-matrix type automaton of order 1. First, let K = { k E G I 3a: E X * , & p ( H , z ) = k H } for an (If('), G)-automaton A = ( E ( H ( ' ) ) ,X, )6, where H ( ' ) = {H}. Notice that H K holds and that K forms a subgroup of G. Then we have the following result.
Theorem 2.4.1 If K satisfies the following two conditions, then A is not a regular.
(2)
gKg-'
= {e}
where e is the identity of G.
SEG
Let f E K \ H. We consider the following mapping p of e ( H ( ' ) )into itself: p ( g H ) = f g H if g E K , and p ( h H ) = hH if h
Proof
4 K. Then p E G ( A ) and p # pe. Now, suppose that A is regular. Then there exists d E G such that p = pd. Thus we have p ( g H ) = f g H = pd(gH) = dgH for any g E K . Therefore, we have d E f g H g - ' 2 K . On the other hand, we have p ( h H ) = hH =
CHAPTER 2. GENERAL AUTOMATA
62
pd(hH) = dhH for any h f K , and hence d E
0
hKh-l. Thus
hEG\K
d E
gKg-l holds. Hence d = e must be satisfied. However, this SEG
contradicts the fact that p Thus A is not regular.
# pe.
Remark 2.4.1 In connection with the condition (l),consider the following: It is easy to deal with an ( H ( l ) G)-automaton , with H = K . For this automaton, we obtain easily G(A) M S( IGI / [ H I )where S ( p ) denotes the symmetric group of degree p . In particular, we have G M S(lGl/ / H I )if A is regular. Therefore, IGI = ([GI/ IHI)! holds. This indicates a very special case. Remark 2.4.2 Strictly speaking, the condition (2) can be replaced bY ( gHg-l) =
Kn n
SEG\K
as shown in the proof of Theorem 2.4.1. However, it seems that the condition (2) is enough from the practical point of view. For this, see the following corollary.
Corollary 2.4.1 Let G be a simple group. Then A is a (1,G), A is regular. automaton if an ( H ( l ) G)-automaton Proof In the case [GI 5 2, by Proposition 2.2.1, the assertion of the corollary holds true. Thus we assume that [GI > 2. When K = G, A is strongly connected. Then by Proposition 2.2.2, A is a (1,G)-automaton. Now, let A not be a (1,G)-automaton and K # G. Then H # {e} holds where = { H } . Suppose that H = K . By Remark 2.4.1, G is a symmetric group of degree (GI. However, this contradicts the fact that G is simple. Consequently, H # K holds. By K # G, gKg-' (# G) of G must be equal to {e}. the normal subgroup SEG
Thus by Theorem 2.4.1, A is not regular. This is a contradiction, and hence A is a (1,G)-automaton.
Chapter 3
Classes of Automata as Posets In this chapter, we will discuss a few classes of automata as partially ordered sets (posets) whose orders are induced by homomorphism relation. For some classes of automata called strong classes, we will provide a systematic method to compute the minimal elements in the set of all upper bounds for any given two elements. Moreover, for a class which forms a lattice, we provide a method to obtain the greatest lower bound of any given two elements as well. In both methods, the direct product of automata plays an important role. This means that the direct product of automata is not only a formal definition but also contains much useful information. The contents of this chapter are based on the results in [36]. A category-theoretic and a more general treatment can be also seen in [37] and [42]. The contents of this chapter represent a kind of decomposition theory of automata. As for a standard decomposition theory of automata, i.e. Krohn-Rhodes theory, see e.g. [16] and [20].
3.1
Introductory notions and results
In this chapter, almost all notions of which we need to develop the contents have been already introduced, but we will mention them and their related results again. 63
64
CHAPTER 3. CLASSES O F AUTOMATA AS POSETS
Definition 3.1.1 An automaton (more exactly an X-automaton) A, denoted by A = (S,X ) , consists of the following data: (i) S is a finite nonempty set of states. (ii) X is a finite nonempty set of inputs. (iii) There exists a function b~ of S x X * into S , called a state transition function such that S A ( S , U V ) = S A ( S A ( S , U ) , V ) and S A ( S , E ) = s for any s E S and any u, v E X * where X * is the free monoid generated by X and E is its identity, i.e. the empty word. In what follows, suA will be used t o denote
~ A ( su). ,
Definition 3.1.2 Let A = ( S ,X ) and B = (TIX ) be two automata. If T C S and tuB = tuA for any ( t , ~E )T x X * , then B is called a subautomaton of A . Definition 3.1.3 An automaton A = ( S I X ) is said to be cyclic, if there is a state s E S satisfying the following condition: For any t E S there exists an u E X * such that suA = t . In the above definition, s is called a generator of A and the set of all generators of A is denoted by Gen(A). Moreover, if S = Gen(A), A is said to be strongly connected.
Definition 3.1.4 Let A = (S,X ) and B = ( T ,X ) be two automata. Then the automaton A x B = ( S x T ,X ) is called the direct product of A and B. Here the state transition function S A ~ Bis defined as ( s , t ) a A x B= (saA,taB)for any ( s , t ) E S x T and all a E X . Two automata A and B,whose direct product A x B is strongly connected, are said to be strongly related. For a condition such that two automata may be strongly related, see [21]. Definition 3.1.5 Let A = (S,X ) and B = (TIX ) be two automata. If there exists a mapping p of S onto T such that for any ( s ,a ) E S x X we have p ( s a A ) = p ( s ) a B , then p is called a homomorphismof A onto B and B is called a homomorphic image of A. We denote the set of all homomorphisms of A onto B by Hom(A, B). Moreover, if p is a bijection, then p is called an isomorphism of A onto B and A is said to be isomorphic to B. The set of all isomorphisms of A onto B is denoted by I s o ( A , B ) .
3.2. CLASSES OF AUTOMATA
65
Definition 3.1.6 In the above definition] if A = B ,then we denote Iso(A, A) by Aut(A) and we call an element of Aut(A) an automorp h i s m of A. Aut(A) forms a group with mapping composition and is called the automorphism group of A. Definition 3.1.7 An automaton A = ( S , X ) is said t o be transitive if the following condition is satisfied: For any ( s , t ) E S x S, there exists p E Aut(A) such that t = p ( s ) . Moreover, a transitive automaton is said to be quasiperfect, if it is strongly connected. Definition 3.1.8 Let A = ( G , X ) be an automaton satisfying the following conditions: (i) G is a finite group. (ii) There exists a mapping of X into G such that * ( X ) = { * ( a ) 1 a E X } is a generating set of G. (iii) The state transition function b~ is defined as g a A = g@(a)for any (9, a) E G x X . Then an automaton A = (G, X ) is called a group-type automaton (more exactly, a group-type automat o n with group G ) (or ( 1 , G ) - a u t o m a t o n ) .
*
Theorem 3.1.1 A group-type automaton A = ( G , X ) is quasiperfeet and Aut(A) = G holds where M denotes a n isomorphism relation between two groups. Conversely, a quasiperfect automaton A = ( S , X ) is isomorphic t o some group-type automaton A' = ( G , X ) such that G M Aut(A). Definition 3.1.9 An automaton A = (27, X ) is said to be abelian (or commutative) if the following condition is satisfied: For any s E S and all a , b E X , we have s ( a b ) A = ~ ( b a ) Moreover] ~. an abelian automaton is said t o be perfect if it is strongly connected. Theorem 3.1.2 A perfect automaton A = ( S , X ) is quasiperfect and Aut(A) is a n abelian group. Consequently, a perfect automaton is isomorphic t o some group-type automaton with a n abelian group. Conversely, a group-type automaton with an abelian group is a perfect automaton.
3.2
Classes of automata
We consider first the set of all automata as a poset where the partial order is given by homomorphism relation.
66
CHAPTER 3. CLASSES OF AUTOMATA AS POSETS
Definition 3.2.1 Let A = ( S ,X)and B = (T,X)be two automata. Then A 5 B means that A is a homomorphic image of B.Moreover, we identify A with B, denoted by A = B,if A is isomorphic to B. By this definition, the set of all X-automata forms a partially ordered set (poset) in which the order is given by I.In what follows, we denote this set by Vx(Au),or simply by V ( A u ) . We will deal with subposets of V ( A u ) .
Definition 3.2.2 We denote the set of all X-automata (notice that isomorphic automata are identified) having a property P by V x ( P ) (or simply V ( P ) )and we call it a class. Then V x ( P )is considered as a subposet of Vx(Au).Moreover, if the property P is preserved by homomorphism relation (i.e. if A E V ( P )and Hom(A,A’) # 0, then A‘ E V ( P ) ) V , ( P )is called a strong class. Definition 3.2.3 Let V ( P )be a class and let A , B E V ( P ) .Then [ Ao B],(,)denotes the set of all minimal elements in the set of all upper bounds of the set {A, B} in V ( P ) .Namely, C E [A o B ] V ( P ) means the following: C E V ( P ) ,C 2 A and C 2 B , and for any D E V ( P )such that D 2 A , D 2 B and C 2 D , we have C = D . Dually, we can define the set of all maximal elements in the set of all lower bounds of the set { A , B } in V ( P ) and we denote it by [ A* B I V ( P ) . We will try to compute [A o B],(,)for any A , B
E
V(P).
Definition 3.2.4 Let A = ( S ,X), B = (T,X)and C = (U,X)be automata. Assume that g E Hom(C, A ) and h E Hom(C, B). Then, b y g x h ( C ) , we denote theautomatongxh(C) = ( g x h ( U ) , X ) where g x h ( U ) = {(g(u),h(u)) I u E U } and the state transition function S g x h ( ~is ) defined as (g(u), h ( u ) ) ~ g = ~ (~g ((u~) a)A h(u)uB) , for any ( u , a ) E U x X. Remark 3.2.1 Notice that, in the above definition, g x h ( C ) is well defined as an automaton and it is a subautomaton of A x B. In particular, if A and B are strongly related, then g x h ( C )= A x B. The following result is obvious.
3.2. CLASSES OF AUTOMATA
67
Lemma 3.2.1 C 2 g x h ( C ) 2 A , B . For a strong class, we have the following result.
Lemma 3.2.2 L e t V ( P ) be a strong class. A s s u m e C E [ Ao BIv(,), g E Hom(C, A ) and h E Hom(C, B). T h e n we have C = g x h ( C ) . By Lemma 3.2.1, we have C 2 g x h ( C ) 2 A , B . Since V(P)is a strong class, we have g x h ( C )E V ( P ) .Therefore, by the definition of [ Ao BIv(,), we have C = g x h ( C ) . Proof
By Remark 3.2.1, the following result can be obtained. Proposition 3.2.1 Let V ( P )be a strong class and let A , B E V ( P ) be strongly related automata. T h e n [ Ao B],(,)C - {AxB}.
We will give a method t o find elements of [ A o B ] , ( , ) for any
A , B E V(P)when V(P)is a strong class. Theorem 3.2.1 Let V ( P ) be a strong class. Assume A = (SIX) and B = ( T ,X ) are elements of V ( P ) and that C = (U,X ) is a n element of [ Ao B],(,). T h e n C i s a subautomaton of A x B . Moreover, let ITA and T B be the mappings such that T A ( ( s , ~ ) )= s and 7 r B ( ( s , t ) ) = t for any (sit) E S x T . T h e n we have T A ( U ) = { T A ( U ) I u E U } = S and T B ( U ) = { 7 r ~ ( uI )u E U } = T . Next, let C‘ = ( U ’ , X ) E V(P)be a subautomaton of A x B such that TA(U’) = S , 7 r ~ ( U ’ = ) T and IU’( = min{(U( I C = ( U , X ) E V(P) is a subautomaton of A x B such that T A ( U )= S and TB(U) =T} where IKI denotes the cardinality of the set K . T h e n we have C’ E [ AO B IV ( P )’ Proof of the First Part Let C E [ Ao B],(,).Then there exist g E Hom(C, A ) and h E Hom(C, 9). By Lemma 3.2.2, we have C = g x h ( C ) . Thus, by Remark 3.2.1, C is a subautomaton of A x B . Moreover, by the fact that g and h are surjections, we have T A ( U )= S , and 7 r ~ ( U=) T . Proof of the Second Part Let C‘ be an automaton satisfying the condition in Theorem 3.2.1. Then it can be proved that C’ 2 A , B .
68
CHAPTER 3. CLASSES OF AUTOMATA A S POSETS
Now, suppose C’ @ [A o BIv(,). Since C’ 2 A, B and C’ E V ( P ) , there exists an automaton C = ( U , X ) such that C’ 2 C and C E [A o B],(,). By the proof of the first part of the theorem, we can see that C = ( U , X )E V ( P )is a subautomaton of A x B such that TA(U) = S and T B ( U )= T . On the other hand, since C‘ 2 C and C’ # C , we have IU’I > IUI. However, this is a contradiction. Thus, we have C’ E [A o BIv(,). Let V x ( A u ) ,V x ( C )and V x ( S )be the classes of all automata, cyclic automata and strongly connected automata, respectively. Then all these classes are strong classes. For these classes, we have the following results. Corollary 3.2.1 For any A , B E V ( A u ) ,we have [A o B]v(A,)# 8 and [A o B],(A,) { C I C = (U,X) is a subautomaton of A x B such that T A ( U ) = S and ~ r g ( U= ) T } . Moreover, let C’ = (U’, X ) be a subautomaton of A x B such that TA(U‘) = S , ~ r g ( U ’= ) T and IU’I = min{lUI I C = ( U , X ) is a subautomaton of A x B such that T A ( U )= S and rp,(U) = T } . T h e n we have C’ E [ Ao B]v(Au).
Proof Notice that A x B E V ( A u )and A x B 2 A , B . Thus we have [A o B]v(A,)# 8. The rest of the corollary can be proved by Theorem 3.2.1. Corollary 3.2.2 For any A, B E V ( C ) ,we have [A o B],(,)# 0 and [AoB],(,) C { C I C = ( U , X ) is a cyclic subautomaton of A x B such that T A ( U ) = S and TB(U)= T } . Moreover, let C‘ = ( U ’ , X ) be a cyclic subautomaton of A x B such that TA(U’) = S , ~ r g ( U ’ )= T and IU’I = min{lUI I C = ( U , X ) is a =T}. cyclic subautomaton of A x B such that T A ( U )= S and TB(U) T h e n we have C’ 6 [A o B],(,). Let ( s , t ) E Gen(A) x Gen(B) and U [ s , t ]= { ( s u A , t u B )I u E X*}. Then we have the automaton C [ s , t ] = ( U [ s , t ], X ) such that the state transition function SC[s,t] is defined as (s’, t’)ac[s,t]= (s’aA,t’aB) for any (s’,t’) E U [ s , t ] and all a E X . Then it can be proved that C [ s , t ]is a cyclic subautomaton of A x B such that T A ( U [ s , t ] )= S , r r g ( U [ s , t ] )= T and C [ s , t ] 2 A , B . Thus, we
Proof
3.3. CLASSES WHICH DO NOT FORM LATTICES have [A o B],(,) Theorem 3.2.1.
# 8.
69
The rest of the corollary can be proved by
Notice that we have the following: {C I C = ( U , X ) is a cyclic subautomaton of A x B such that 7 r ~ ( U= ) S and 7r~?(U)= T} = {C [ s ,t] I ( s ,t ) E Gen(A) x Gen(l3)). Corollary 3.2.3 For any A , B E V ( S ) ,we have [A o B],(,)# 8 and [ AO BI,(S) C - { C 1 C is a strongly connected subautomaton of A x B } . Moreover, let C‘ = (U’,X ) be a strongly connected subautomaton of A x B such that JU’J = min{lUI 1 C = (U,X ) is a strongly connected subautomaton of A x B } . T h e n we have C’E [A OBI,(,).
Proof Let C = (U,X)be a subautomaton of A x B . Since A and B are strongly connected, T A ( U ) = S, 7r~g(U)= T and C 2 A , B . Thus we have [ Ao B],(,)# 8. The rest of the corollary can be proved by Theorem 3.2.1. Now, we deal with the relationship among classes. Proposition 3.2.2 Let V ( P ) be a strong class and let V ( Q ) be a class. Moreover, assume that V ( P ) V ( Q ) . T h e n f o r any A , B E v(p),we have [A B ] V ( p ) [A B ] V ( Q ) .
c
Proof Assume C E [A o B],(,). By C E V ( P ) ,we have C E V ( Q ) . Moreover, by C 2 A , B , there exists some D E V ( Q )such that C 2 D 2 A , B and D E [A o B ] v ( Q ) .Since V ( P )is a strong class, we have D E V ( P ) . Therefore, by the definition of [A o B],(,), we have C = D . Consequently, we have C E [AoB],(Q), i.e.
[A
3.3
BIV(P)
[A
BIV(Q).
Classes which do not form lattices
In this section, we will provide some classes which do not form lat2 2) does not form a lattice tices. First, we prove that Vx(S) though V x ( S )forms a lattice for a singleton set X.
(1x1
70
CHAPTER 3. CLASSES OF AUTOMATA AS POSETS
Let A = ( G ,X ) be a grouptype automaton with group G having a generating set { g 1 , g 2 , . . . , g n } where X = { a l ,u2,. . . ,a,} and the state transition function b~ is defined as gaf = ggi for any g E G and any i = 1 , 2 , . . . ,n. Moreover, let H be a subgroup of G . Then the automaton A / H = ( G / H , X ) where G / H = { H g g E G } and the state transition function 6 A I H is defined as H g a f I H = Hggi for any g E G and any i = 1 , 2 , . . . ,n, is given and we have A/H E V ( S ) and A 2 A / H .
I
Lemma 3.3.1 Let H and K be subgroups of G. If [A/H o A / K ] v ( s ) is a singleton set, then there exists s E G satisfying the following property: For any r E G, there exists Q E G such that H n r-’Kr o - l ( H n s-lKs)a.
Proof Let A / H x A / K = ( G / H x G / K , X ) .For any ( f , g ) E G x G , we put S [f,g ] = {(Hfx, K g x ) I x E G } 5 G / H x G / K . Then we have the strongly connected subautomaton [A/H x A / K ] ( f , g )= ( S [f,g ] , X ) of A / H x A / K . Consequently, there exists some (f’,9’) E G x G such that [ A / H x A / K ] (f’,g’) = [ A / H o A/KIv(,). Thus, for any ( f , g ) E G x G, we have H o m ( [ A / H x A / K ] ( f , g )[, A / H x A / K ] ( f ’ , g ’ ) )# 8. Now, we put s = g’f’-l. Notice that for any r E G and all x E H n r - l K r we have Hx = H and K r x = K r . Since (91, g 2 , . . . , g n } is a generating set of G , there exists some z E X’ such that for any ( f , g ) E G x G we have ( H f , K g ) z A I H X A I K= ( H f x , K g z ) . Therefore, we have (H,K r ) z A I H x A I K= ( H x , K r x ) = ( H ,K r ) . Let $ be an element of Hom([A/H x A / K ] ( e r, ) , [A/H x A / K ] ( f ’9’)) , where e is the identity of G. Since [ A / Hx A / K ] (f’, 9’) is strongly connected, there exists ,O E G such that $ ( ( H , K r ) ) = ( H f ’ P , Kg’P). Since q!~E H o m ( [ A / H x A / K ] ( e , r )[,A / H x A / K ] ( f ’ , g’)), $(P, K r ) zA / H x A / K ) = $ ( ( H , K T ) ) ~ ~ I Consequently, ~ ~ ~ I ~ . we have ( H f ‘ P , Kg’P) = ( H f ‘ P x , Kg’Px). That is, Hf’P = Hf‘Px and Kg‘P = Kg‘Px. Put Q = f’P (since P depends on T , Q depends on r ) . Then we have J: E a - l ( H n s - l K s ) a . Thus we have H n r - l K r C a - l ( H n s-IKs)a. Theorem 3.3.1 For any X
(1x12 2 ) , Vx(S)is not a lattice.
Proof To prove the theorem, it is enough t o find groups G , H and K which do not satisfy the condition in the above lemma. Let G = Ss =
3.4. CLASSES WHICH FORM LATTICES
where by
71
we denote the group generated by E.
We prove that H n s-lKs # H for any s E G. Let u E K . Then 4 2 ) = 2. Let s E G = Ss. There exists i = 1 , 2 , .. . , 5 such that s ( i ) = 2. hence s-lus(i) = s-lu(2) = s-'(2) = i. Consequently, (12)(345) E H but (12)(345) $!. s-'Ks. Therefore, IH ns-lKsl 5 3. If H n s-lKs # ({(345))), then Icr-l(H n s-lKs)al 5 2 for any a E G. In this case, we can take e as r and (Hnr-lKr(= ( H n K (= I(((345))) I = 3. Thus Hnr-lKr 2 cr-l(Hns-lKs)cr does not hold for any cr E G. On the other hand, if Hns-lKs = ({(345))), then H r) s-lKs is a cyclic group of order 3 and hence a-'(H n s-'Ks)a is also a cyclic group of order 3 for any Q E G. In this case, we can take (23) E G as r . Then r-lKr 3 (23)(13)(23) = (12) and H n r-IKr = (((12))). Since this group is a cyclic group of order 2, H n r-lKr C_ cu-l(H n s - l K s ) a does not hold for any Q E G. Hence the above groups G, H and K do not satisfy the condition in the above lemma.
1x1
Corollary 3.3.1 Let 2 2 and let V x ( P ) be a class such that V x ( S )C V x ( P ) . Then V x ( P )is not a lattice. By Corollary 3.2.3 and Theorem 3.3.1, there exist A , B E V x ( S )such that I[A o B]vx~sll 2 2. Then we have A , B E V x ( P ) Proof
I
and, by Proposition 3.2.2, we have I[A0 BIVx(p) 2 I[A0 B]vx(s)12 2. This means that V x ( P )is not a lattice. From the above result, V x ( A u ) and V x ( C ) are not lattices if
1x1 2 2. For the case that 1x1 = 1, it can be shown that V x ( C )is a lattice, but V x ( A u )is not so.
3.4 Classes which form lattices In the previous section, we showed that some classes are not lattices. In this section, we will deal with three classes which are lattices. One class is not a strong class, i.e. the set of all quasiperfect automata.
72
CHAPTER 3. CLASSES OF AUTOMATA AS POSETS
The other two classes are strong classes, i.e. the set of all perfect automata and the set of all strongly directable automata. The following result is obvious.
Lemma 3.4.1 Let V ( P ) be a class such that [A * B],(,) # 0 f o r any A, B E V ( P ) .If V ( P )is a n upper semilattice, i.e. [ Ao B],(,) is a singleton set f o r all A , B E V ( P ) ,then V ( P ) is necessarily a lattice. Remark 3.4.1 There is a class V ( P )such that 0 E V ( P )where 0 is the l-state automaton. For instance, a strong class is one such. Notice that, for such a class, we have [A * BIV(,)# 8 for any A, B E V ( P )and therefore, to prove that V ( P )forms a lattice, it is enough to show that V ( P )is an upper semilattice. In what follows, we do not distinguish the element of a singleton set from a singleton set itself. Now we prepare to handle the class of all quasiperfect X-automata.
Lemma 3.4.2 Let A = ( S , X ) and B = ( T , X ) be strongly connected automata. If one of the following three conditions is satisfied, then [A o B],(,) is a singleton set: (a) A is a quasiperfect automaton. (ii) B is a quasiperfect automaton. (iii) A x B is a transitive automaton. Proof Since the idea is the same for any case, we prove only the case (i). First, it follows from Corollary 3.2.3 that [A o B],(,) # 8 . Assume C1, C2 E [A o B],(,). Here, notice that Ci = (Ui,X ) ,i = 1 , 2 , is a strongly connected subautomaton of A x B. By the strong connectedness of B, we can choose s,s” E S and t E T such that ( s ,t ) E U1 and (s”, t ) E U2. Since A is transitive, there exists some f E Aut(A) such that s“ = f ( s ) . We define the mapping p of Ul into U2 as p((s’,t’)) = (f(s’),t’) for any (s’,t’) E U1. Now, we prove that p is a homomorphism of C1 onto C2. By the strong connectedness of CI, for any (s’,t’) E U1 there exists some u E X* such that (s,t ) u A x B= (s’, t’). Namely, suA = s‘ and tuB = t’. By f E Aut(A), we have f ( s ’ ) = f ( s u A )= f ( s ) u A = s”uA. Therefore,
3.4. CLASSES WHICH FORM LATTICES
73
we have (f(s’),t’) = (s”, t ) u A x BE U2. Thus we have verified that p i s a mapping of Ul onto U2. On the other hand, for any (s’,t’) E U1 and all a E X , we have p((s’, t’)acl) = p((s’, t’)uAxB)= p((s’aA, t’uB))= (f ( S ’ U A ) , t’aB) = ( f ( s ’ ) a A ,t’aB) = (f(s’),t’)aAXB = p((s’, t’))a”. This means that p is a homomorphism of C1 onto C Z .That is, we have C1 2 C2. By C1,Cz E [AoB],(,), this implies C1 = C2. Consequently, [ Ao B],(,)is a singleton set. We denote the set of all quasiperfect automata by Vx(Qp).As will be shown in Theorem 3.4.1, Vx(Qp)is a lattice but it is not a strong class.
Proposition 3.4.1 For any X class.
(1x12 2),
Vx(Qp)is not a strong
Proof Notice that there are a finite group G and its subgroup H such that H is not a normal subgroup of G. Consider a grouptype automaton A = ( G , X ) and automaton A / H . Then, by Theorem 3.1.1, A E V(Qp) and A/H 5 A . Suppose that V(Qp) is a strong class. Then A / H = ( G / H , X ) E V(Qp). Since A is a group-type automaton, for any h E H there exists u E X*such that ( H g ) u A I H= ( H g ) h for any g E G. Let g E G . Since A / N is transitive, there exists 4 E A u t ( A / H ) such that 4 ( H ) = H g . Consider + ( H u A I H ) . Then q5(HuAIH) = 4 ( H ) u A I H = Hgh. On the other hand, 4 ( H u A I H )= 4 ( H ) = Hg, i.e. Hg = H g h . This implies that H = g - l H g . Consequently, H is a normal subgroup of G, which is a contradiction. Therefore, V(Qp)is not a strong class. In general, if V(P)is not a strong class, then [ Ao B],(,)does not consist of subautomata of A x B. Hence, in this case, we have some difficulty in computing [A o B]v(,). However, for the class V(Qp),we can show that it is a lattice.
Lemma 3.4.3 For any A,B E V(Qp),[ Ao B],(,)is an element of V(Qp).Notice that, by Lemma 3.4.2, [ A o B],(,)is a singleton set and therefore it is considered as an element.
Proof By Lemma 3.4.2, [ Ao B],(,)is a singleton set for any A = ( S , X ) , B = ( T , X ) . Let (f,g)E Aut(A) x Aut(B). We define the
74
CHAPTER 3. CLASSES OF AUTOMATA A S POSETS
s
mapping ( f l d as ( f , g ) ( ( s , t ) )= ( f ( s ) , g ( t ) )for any ( s d ) E x T . Then we have ( f , g ) E Aut(A x B). Thus, we have Aut(A) x Aut(B) C Aut(A x B).This implies that A x B is a transitive automaton. Let C = [A o B],(,). Since A x B is transitive and C is a strongly connected subautomaton of A x B, C is transitive, i.e. C = [A 0 Blv(s) E ~ ( Q P ) .
Theorem 3.4.1 V ( Q p ) is a lattice. Proof First notice that 0 E V ( Q p ) . By Remark 3.4.1, to prove the theorem, it is enough to show that, for any A , B E V ( Q p ) , [ A o B],(Qp)is a singleton set. To this end, we show first that Let C E [AoB],(QP). Then we [AoB],(Qp) C [AoB],(,). have C 2 A , B and C E V ( S ) . Consequently, there exists some D E [A o B],(, such that C 2 D 2 A , B. By Lemma 3.4.3, we have D E V ( Q p ] and thus we have C = D . Namely, we have C E [A o B],(,). From this, we have [A o B ] V ( Q p ) C [ A0 B],(,). This means that [A o B ] V ( Q p ) has at most one element. But, [ Ao B],(,) is a singleton set and, by Lemma 3.4.3, it is an element of V ( Q p ) . That is, we have [A 0 B]v(Qp)# 8. Therefore, [ A0 B],(Qp)is a singleton set. Now, we deal with the class of perfect automata. By V x ( P e ) we denote the set of all perfect X-automata. The following result is obvious.
Proposition 3.4.2 V x ( P e ) is a strong class.
Theorem 3.4.2 V ( P e ) is a lattice. Proof By Theorem 3.1.2, we have V ( P e ) C V ( Q p ) . Moreover, by the above proposition, V ( P e ) is a strong class. Therefore, by Proposition 3.2.2 and Theorem 3.4.1, to prove that V ( P e ) is a lattice, it is enough to show that for any A , B E V ( P e ) we have [AoB],(,,) # 0. By the commutativities of A and B, A x B is abelian. Therefore, its subautomaton [A o B],(,)is also abelian. Consequently, we have [A o B],(s) E V ( P e ) . On the other hand, we have [A o B],(,)2 A , B. Thus, we have [A o B],(,,) # 8.
3.4. CLASSES WHICH FORM LATTICES
75
Definition 3.4.1 An automaton A = ( S ,X ) is said to be directable if the following condition is satisfied: For any s , t E S, there exists some u E X * such that suA = tuA.
By V x ( D i r )we denote the set of all directable automata. The following two results are obvious. Proposition 3.4.3 V x ( D i r ) is a strong class. Proposition 3.4.4 For any A , B E V x ( D i r ) , we have A x B E
Vx( D i r ). From the above result, we have: Proposition 3.4.5 For any A , B E V ( D i r ) ,we have [ Ao B]v(DiT)
# 0. However, V x ( D i r )is not a lattice. The reader can give an example that there are directable automata A and B with ( [ A0 B]v(Dir) 2 2 for any X(lXl 2 2). Now, consider a subclass of V x ( D i r ) .
I
Definition 3.4.2 A directable automaton is said to be strongly directable if it is strongly connected. By Vx(Sdir)we denote the set of all strongly directable X-automata.
The following result is obvious. Proposition 3.4.6 V x ( S d i r ) is a strong class. Theorem 3.4.3 V x ( S d i r ) is a lattice.
Proof Let A = ( S , X ) and B = ( T , X ) be elements of V ( S d i r ) . By Proposition 3.4.4, we have A x B E V ( D i r ) . Therefore, for any C E [ A O B ] ~ we ( ~have ) , C E V ( D i r )n V ( S ) = V ( S d i r ) . From this, we have [ Ao B]v(sDir) # 0. On the other hand, since V ( S d i r )is a strong class, to prove that [ Ao B]V(Sdir) is a singleton, by Proposition 3.2.2, we need only to show that [ Ao B],(,) is a singleton. Let C1, C2 E [ Ao B],(,), let C1 = ( U l ,X) and let C2 =
CHAPTER 3. CLASSES OF AUTOMATA AS POSETS
76
(U2,X) where C1 and
C2
are strongly connected subautomata of
A x B. For any ( s , t ) E U1 and all (s’,t’) E U2, by the fact that A x B is directable, there exists some u E X* such that ( s , t)uC1= ( s , t ) u A x B= (s’,t’)uAxB= (s’,t’)uC2(= (s”,t”)). Notice that each element of U1 (of U2) does not go out from UI (from U2) by any input. This is because C1 and C2 are strongly connected subautomata of A x B. Thus we have ( s ” , t”) E U1 f l U2. Consequently, we have U1 n U2
# 0.
This means that we have
C1 = C2.
To conclude this section, we provide the following algorithm. Algorithm Let V x ( P )be one of V x ( V Q p ) ,V x ( P e ) and V x ( S d i r ) . Moreover, let A , B E V x ( P ) . Then we can obtain the least upper bound of { A , B }in V x ( P ) as follows: (i) Construct A x B.(ii) Let S[X] be the set of all strongly connected X-subautomata of A x B. (iii) Let C be an automaton (from S[X])whose cardinality of state set is minimum. (iv) Then C is the least upper bound of { A , B }in V X ( P ).
Computation of [ A* B],(,)
3.5
In the previous section, some examples of classes which are lattices were given. In the present section, we study how to compute the value [ A* B],(,) , A , B E V ( P ) for a class V ( P )which is a lattice. First, let C = (U,X) be a subautomaton of A x B = ( S x T ,X ) , denoted by C c A x B, such that T A ( U )= S and T B ( U )= T . For ( s , t ) ,(s’,t’) E U , ( s , t ) (s’, t’) means that we have s = s‘ or t = t‘. And ( s , t ) M (s/,t’) means that there exists some n 2 2 such that ( s n , t n ) = (s’,t’). (s2,tz) . . . (Sn-1,tn-1) ( % t )= ( S l , t l ) Moreover, for s , s’ E S ( t ,t’ E T ) , s tf s’ ( t * t’) means that there exist some t , t’ E T (s, s‘ E S) such that (s,t ) M (s’, t’).
-
- -
The following result is obvious.
Lemma 3.5.1 The relation * is a congruence relation o n S (on T ) . That is, f o r any u E X” we have suA t+ s’uA (tuB * t’uB) zf s
t+
s’
(t * t/).
3.5. COMPUTATION OF [ A* B],(,)
77
Now, for any s E S and t E T , we put 5 = { s ’ l s * s‘} and {t’ I t * t‘}. Then we have the automaton f = ((51 s E S } , X) and the automaton g = I{;( t E T } ,X ) such that 5aA = ,aA for any ( ~ , a E) S x X and ;aB = t a B for any ( t , z ) E T x X . By Lemma 3.5.1, 2 and g are automata such that A 2 2 and B 2 g.
- -
h
t
=
- -
Lemma 3.5.2
f
=
Proof For any s E S , we put p(5) = ;if there exists some ( s , t ) E U . h
We show that p is well defined as a mapping. Let 5 = s’ where (s,t ) ,(s’, t’) E U . Now, we prove that ;= ?. By 5 = s‘, there exist some (s, r ) , (s’, r’) E U such that (s,r ) M (s’, r’). Notice that we have ( s , t ) ( s , ~ )and ( s ’ , ~ ’ ) ( d t ’ ) . Therefore, we have ( s , t ) M (s’,t‘). That is, we have ?= 2.Next, by TB(U) = T , p is a surjection. Now, we prove that p is a homomorphism. First, we put s E S, a E X and p(5) = Note that p(F) = ;implies (s,t ) E U and thus ( s a A ,t a B ) E U . The last one implies p ( s a A ) = t a B . Consequently, we have the following equality: p(FaA) = p ( s a A ) = t a B = t a B = p(5)aB. This means f 2 In the same way, we have f3 2 2. Therefore, we have 2 =
-
-
h
h
h
h
h
g.
E.
Definition 3.5.1 By 6(C), we denote
A
(=
g).
Thus we have the following: Theorem 3.5.1 A
2 S(C) and B 2 S(C).
Theorem 3.5.2 Let D = (W,X ) be an automaton such that A 2 D and B 2 D . Then there exists a subautomaton C of A x B such that D = S(C).
Before proving the above theorem, we provide the definitions of a pullback system and a pullback automaton.
Definition 3.5.2 Let D be an automaton such that A 2 D and B 2 D , and f and g be elements of Hom(A, D ) and of Hom(B, D ) , respectively. Then a 5-tuple X = ( A ,B,f,9,D ) is called a pullback system and the automaton p [XI = (V, X ) induced by it is called the
78
CHAPTER 3. CLASSES OF AUTOMATA A S POSETS
pullback automaton of X . Here V = { ( s ,t ) E S x TI f ( s ) = g ( t ) } and the state transition function 6 , [ ~ ]is defined as ( ~ , t ) a ” [=~ ] ( s a A ,t a B ) for any (s,t ) E V and a E X . Then p [XI is a subautoma) S and T B ( V = ) T. ton of A x B such that K A ( V=
Proof of Theorem 3.5.2
Let X = ( A ,B,f,g , D ) be a pullback system and let p [XIbe its pullback automaton. P u t C = p [XI. Now, we prove that 6(C) = D . Let apply the &operator t o C = g~ [XI. Notice that for any s, s’ E S the following three conditions are equivalent: (i) F = 2. (ii) There exist some t , t‘ E T such that ( s , t ) x (s’,t’). (iii) There exist some t,t’ E T such that f ( s ) =
d t ) = f ( 4 = dt’). From the above, it follows that p(Z) = f ( s ) ,s E S is well defined as a bijection of the state set of 2 onto W . By f E H o m ( A , D ) , it can be proved that p is a homomorphism as follows: p(FuA) = p ( s 2 ) = f ( s u ~= > f ( s ) u o = p ( ~ ) ) for a ~ any ( s , a ) E x X . h
s
We will use the above result for obtaining [ A* B],(,).
Lemma 3.5.3 Let C = ( U , X ) and C’ = ( U ’ , X ) be automata such that TA(U’)= S , 7rrg(U’) = T and C’ C C C A x B . T h e n we have S(C’)2 6(C).
Proof For any s E S , by Z we denote the equivalence class in U containing s by *, and by $ we denote the equivalence class in U’ containing s by *. For s , s’ E S , we assume that F = s‘. That is, there exist some t,t’ E T such that ( s , t ) ,(s’,t’) E U’ and ( s , t ) M (s’,t’). By C’ c C , we have ( s , t ) ,(s’,t’) E U and ( s , t ) x (s’,t’). Thus, we have Z= s’. Consequently, p(S) = 5 (s E S ) is well defined as a mapping. It is obvious that this mapping is a surjection. Since , , . . s and F are equivalence classes by congruence relations, respectively and $ C_ ( s E S),p is a homomorphism. h
A
-
h
From the above result, for any strong class V ( P ) ,we have the following: Proposition 3.5.1 [ A * B ] V ( PCl {S(C) I C = ( U , X ) c A x B , T A ( U )= S, ng(U)= T and C‘ = C ZfC 2 C’= ( U ’ , X ) , T A ( U ’ ) = S and 7rg(U’) = T } .
3.5. COMPUTATION OF [A * B],(,)
79
If V ( P )C V ( S )in the above, then we can choose only strongly connected subautomata of A x B as C. Moreover, if V ( P )forms a lattice and two arbitrary strongly connected subautomata of A x B are isomorphic to each other (= [A o B],(,)) through an element of Aut(A) x A u t ( B ) , we can choose only [A o B],(,) as C. Thus we have the following result. Notice that the class V ( Q p )can be treated like other strong classes though it is not a strong class. Theorem 3.5.3 Let V ( P ) be one of V(Qp),V ( P e ) and V(Sdir). Then for any A, B E V(P)we have [A * B],(,)= S([A o B],(,)). Example 3.5.1 For the automata A , B E V(Sdir) in Fig. 3.1, compute [ AO B I V ( S d i 4 and [A * B l V ( S d i r . ) .
A:
B:
Figure 3.1: A, B
80
CHAPTER 3. CLASSES OF AUTOMATA AS POSETS
Figure 3.2:A x B
Figure 3.3: [ Ao B]V(Sdir)
3.5. COMPUTATION OF [ A* B]v(p)
A:
T2
BE
81
A
Ea
a
(1,l’)NN (1,3’) (3,2’) 6
1 = (1) 2 = {2,3}
A = B = 6( [ A
1’=
0
(2,2’)
{1‘,3’} 2’ = (2’)
h
Figure 3.4:
M
BIV(sdir))
Figure 3.5: [ A* B]V(Sdir)
This page intentionally left blank
Chapter 4
Languages and Operations A subset of the free monoid generated by a finite nonempty set is called a language. Our objective in this chapter is to study some languages generated (accepted) by grammars (acceptors). In Section 4.1, we will introduce regular and context-free grammars (finite and pushdown acceptors). These mechanisms define languages called regular and context-free languages. In Sections 4.2 and 4.3, we will consider operations on languages called n-insertion and shufJEe. After providing a few properties of these operations, in Sections 4.4 and 4.5 we will deal with decompositions of regular languages into nontrivial regular languages by these operations. The existence of an algorithm to decide whether or not the shuffle closure of a regular language is regular is unknown. In Section 4.6, we will give a partial solution to this open problem. The contents of this chapter are based on the results in [45], [38] and [27].
4.1
Grammars and acceptors
Let X* denote the free monoid generated by a finite nonempty alphabet X and let ' X = X*\ {e} where e denotes the identity of X*.For the sake of simplicity, if X = { a } , then we write a+ and a* instead of {a}+ and {a}*, respectively. Let A C X*. Then A is called a language over X . By lAl, we denote the cardinality of A . If 83
84
CHAPTER 4 . LANGUAGES AND OPERATIONS
A G X * , then AS denotes the set of all concatenations of words in A and A* = AS U { E } . In particular, if A = {w}, then we write w+ and w* instead of {w}+ and {w}*, respectively. Let u E X * . Then u is called a word over X . Especially, E is called the empty word. If u E X * , then I u I denotes the length of u. Moreover, if a E X , then the number of the occurences of the letter a in the word u is denoted by I&. Let A X * be a language. Then the principal congruence PA of A is defined as follows: For any u,v E X * ,u = PA) if and only if ( m y E A ++ m y E A ) for any 2,y E X * .
s
Definition 4.1.1 A grammar G = (V,X , P, S ) consists of the following data: (1) V and X are finite nonempty sets, called the set of variables and an alphabet, respectively such that V n X = 8. (2) P is a finite subset of ( X * V + X * ) *x ( X U V ) * ,called the set of production rules. (3) S E V is called a start symbol. Moreover, a grammar G = (V,X , P, S ) is said to be regular (contezt-free) if P (V x (Xu {E})V)u (V x ( X u { E } ) ( P 2 v x ( X u V ) * ) .
Let G = ( V , X , P , S ) be a grammar and let ( u , v ) E P . Then usually we denote u -+ v instead of ( u ,w). Let u + v E P . Then crup + avp for any a , p E ( X U V ) " . By +*, we denote the transitive closure of +, i.e. (1) u =+* u for any u E (V u X ) * , ( 2 ) u J* v if u = uo, u1,u2,. . . ,un-l,u, = v for some positive integer n and ui + ui+l for any i = 0 , 1 , . . . , n- 1. Then u +*w ,u , v E ( V U X ) * ,is called a derivation from u to v. For a grammar S = (V,X , P, S ) , the language L(G) generated by G is defined as follows: L(G) = {u E X * I J*u}. A language L & X * is said to be regular (contezt-free) if there exists a regular (context-free) grammar 6 such that L = L(G).
s
Remark 4.1.1 Consider a grammar G = (V,X , P, S ) with P X * V ) U (V x X * ) . Then notice that L(G) is regular.
(Vx
Remark 4.1.2 A context-free grammar G = (V,X , P, S ) is said to be in the Greibach normal f o r m if P C (V x X V * )U { S E } . Notice that there exists a context-free grammar 4 in the Greibach normal form with L = L(G) for any context-free language L 2 X * . ---f
Now we define finite acceptors.
4.1. GRAMMARS A N D ACCEPTORS
85
Definition 4.1.2 A finite acceptor A = ( S , X , S , s o , F ) consists of the following data: (1) S is a finite nonempty set, called a state set. (2) X is a finite alphabet. (3) 6 is a function, called a state transition function, of S x X into S. (4) SO E S is called the initial state. ( 5 ) F S is called the set of final states.
The state transition function 6 can be extended to the function of S x X* into S as follows: (1) ~ ( s , E=) s for any s E S , (2) b(s,au) = 6(6(s,a ) , u)for any s E S, a E X and u E X*. Let A = ( S ,X,6, SO, F ) be a finite acceptor. Then the language I ( A ) = {u E X* S ( s 0 , u ) E F } is called the language accepted (or recognized) by A .
I
As a more general case, we consider nondeterministic acceptors. Definition 4.1.3 A nondeterministic acceptor A = ( S ,X,6, SO,F ) consists of the following data: (1) S , X are the same materials as in the definition of finite acceptors. (2) 6 is a relation such that 6 ( s , a ) C S for any s E S and a E X. (3) So E S is called the set of initial states. (4) F C S is called the set of final states.
As in the case of finite acceptors, 6 can be extended to the following relation in a natural way, i.e. (1) 6(s,E ) = { s } for any s E S , ( 2 ) S ( s , a u ) = UteG(s,a) 6(t,u) for any s E S , a E X and u E X*. Then the language I ( A ) accepted (or recognized) by A is defined as T ( A )= { U E X* 1 3s0 E So,6(so,U ) n F # 0). Let T C S . We denote 6(T,u)= UtET6 ( t ,u ) for u E X*. Thus 7 ( A )= { U E X * 1 SO, U ) n F # 0}. Remark 4.1.3 In Definition 4.1.3, the state transition relation can be generalized as follows: 6 is a relation such that 6 ( s , a ) C S for any s E S and a E XU { E } . Under this condition, a nondeterministic acceptor with 6 ( s ,E ) \ {s} # 0 for some s E S is called a nondeterministic acceptor with E-move. Notice that, for a nondeterministic acceptor A with €-move, there exists a nondeterministic acceptor B without €-move such that I ( A ) = ‘ T ( B ) .
86
CHAPTER 4 . LANGUAGES AND OPERATIONS
Proposition 4.1.1 Let A be a nondeterministic acceptor. there exists a finite acceptor such that 7 ( A )=
7(z).
Then
Proof Let A = ( S ,X , 6, So, F ) be a nondeterministic acceptor. We X , 3,S O , F): ( 1 ) 3 = construct the following finite acceptor 7f = (3, {T I T S } , (2) so = SO. ( 3 ) a(T,u) = S(T,a) for any T C S and u E X . (4) F = {T I T C S, T n F # O}. Let u E I ( A ) . Then Now we prove that 7 ( A ) = S(S0,u)n F # 0. Hence SO, u ) E F and u E 7(l"i). Consequently, 7 ( A )C 7 @ ) . Conversely, let u E 7 @ )Then . ;8(so,u)n F # 0, i.e. S(S0,u)n F # 0. Hence u E 7 ( A )and 7(7f) C 7 ( A ) . Therefore, 7 ( A )= 7(l"i). This completes the proof of the proposition.
7(x).
Proposition 4.1.2 Let L E X* be a language over X . T h e n L i s regular if and only if L i s accepted by a finite acceptor.
Proof (+) Let L X * be a regular language and let G = (V, X, P, S ) be a regular grammar with L = L ( 4 ) . We construct the following nondeterministic acceptor A = (T,X , 6, {to}, F ) : (1) T = V U {#} with # $ V , (2) B E S ( A , a ) if ( A -+ aB) E P for any a E X , and A , B E V , (3) # E 6(C,a) if (C --+ a ) E P for any a E X and C E V , (4)to = S , (5) F = {#} U { S } if ( S -+ E ) E P and F = {#} if ( S + E) 4 P . First, we prove that L(G) 2 I ( A ) .Let u E L(G). If u = E , then ( S -+ E ) E P and t o = S E F . Hence u = E E I ( A ) .Assume u # E . Then u = a l a 2 . . . U k , a l , a2,. . . ,U k E x. Since u E L(G), we have { s -+ alT1,Ti + ~ 2 T 2 ., .. , T k - 2 -+ U k - i T k - 1 , T k - i + ak} P . Thus 6(to, U l U p . . . ak) 2 6(6(to,U l U 2 . . * a k - l ) , ak) 2 S ( T k - 1 , ak) 2 {#}, i.e. 6(to, a l a 2 . . . a k ) n F # 0. This means that u = a l a 2 . - .ak E I ( A ) ,i.e. L(G) C 7 ( A ) . Now we prove that 7 ( A ) L(G). Let u E 7 ( A ) . If u = E , then S E F and ( S -+ E ) E P . Hence u = E E L(G). Assume u # E. Then u = a l a 2 . . . U k , a l , u 2 , . . . ,U k E X . Since u E 7 ( A ) ,there exist T I ,2'2,. . . ,Tk-1 E V such that TI E 6(S,a l ) , T 2 E 6 ( T l , a 2 ) , . . . > T k -El 6 ( T k - 2 , a k - l ) , # E J(Tk-1,ak) or s E fi(Tk-1, a k ) . Thus { s -+ alT1,Ti -+ ~ 2 T 2 ., .. ,Tk-2 --t ak-iTk-1,Tk-i --t a k } & P or { s -+ alT1,Tl + a2T2,. . . , T k - 2 -+ ak-lTk-l,Tk-1 --f
4.1. GRAMMARS AND ACCEPTORS
87
s
C_ P . Consequently, J*a l a 2 . . . arc and hence u = a1a2. * . arc E C(G), i.e. 7 ( A )5 C(G). Therefore, ?-(A)= C(G). By Proposition 4.1.1, there exists a finite acceptor such that ?-(A)= U k S , S -+ E }
7 @ )Thus . L is accepted by a finite acceptor. (+) Let A = (S,X,6, so, F ) be a finite acceptor with L = 7 ( A ) . We construct the following regular grammar: G = (V, X, P, so) where (1) V = S , (2) P = P' U { S O -+ E} if SO E F and P = P' if so 4 F where P' = {s us' I a E X , S , S ' E S , S ( s , a ) = s'} U { S -+ a 1 a E x,s E s,S(s, a) E F } . We prove that C(G) = ?-(A). Let u E ?-(A). If u = E, then so E F , i.e. (so --t E) E P. Hence u E C(G). Assume u # E . Let u = a1a2. . . arc, a l , a2, . . . , Uk E X. Then there exist S O = t l , t 2 , . . . ,t k E S such that S ( t 1 , a l ) = t 2 , S ( t 2 , u2) = t 3 , . . . , S(trc-1, arc-1) = trc, b ( t k , arc) E F . This means that {so a l t z , t 2 -+ aats, . . . ,t k - 1 arc-ltk, t k ak} C P . Hence S O J* a l u 2 . . . u k holds. Therefore, u E C(G) and 7 ( A ) W). Now let u E C(G). If u = E, then (SO -+ E ) E P , i.e. so E F and hence u = E E ?-(A).Assume u # E . Then u = alaz . . . ak,a ~az, , ..., ak E X and so +*a l a 2 . . . arc. Thus {so -+ a l t 2 , t 2 azt3,. . . ,tic-1 + ~ ~ - ~-+ t arc} ~ , tP ~or {so -+ alt2,t2 -+ a2t3,.. . , t k - l --f
--f
-+
-+
s
-+
-+
a,<k,tk
-+
akso,So
t 2 , 6 ( t 2 , ~ 2 =) t 3 , . .
---f
E}
P . Therefore,
S(So,al)
=
6(tl,al) =
. ,S ( t k - 1 ,
~ - 1 = ) t k , S ( t k , arc) E F . Thus S(SO, a 1 ~ 2 F , i.e. u = u l a 2 . . . u k E ?-(A).Hence C(G) C_ ?-(A)and C(G) = I ( A ) .Therefore, L is regular.
...arc) E
Proposition 4.1.3 Let L C X* be a language over X . Then L is regular i f and only i f the principal congruence PL is of finite index, i.e. the number of congruence classes of PL is finite. Proof (=+) Let L C X* be a regular language. By Proposition 4.1.2, there exists a finite acceptor A = ( S , X , S , s o , F ) such that L = ?-(A). For any u E X*, we define the mapping fu of S into S as fu(s) = S ( s , u ) For any s E S . We show that fu = fv implies u = ~ ( P Lfor ) any u , v E X*. Let zuy E L for z , y E Then b(S0, x w ) = S(S(S(so,4,v>,Y) = S ( f v ( q S 0 , z)),y) = S(fU(S(so, z)), Y) = S(S(S(so, z), u), Y) = SO, zw)E F . Therefore, z v y E L . Conversely, x v y E L implies zuy E L . Hence u = ~ ( P L ) .
x*.
CHAPTER 4. LANGUAGES A N D OPERATIONS
88
uf{I
Since I u E X*}l 5 ISllsl, the number of congruence classes of PL is less than or equal to (SIIsl. (+) Let u E X* and let [u]= {w E X * I u _= ~ ( P L ) }For . any u E X * and a E X ,we define S as S([u],a)= [uu].Since [u]= [w] implies [uu]= [wu]for u,w E X * and a E X , 6 is well defined as a function of S x X into S where S = { [u]I u E X * } . Notice that S is finite. Thus we can construct the finite acceptor A = ( S ,X , 6,[ E ] , {[u] I uE L})* We show that L = I ( A ) . Let u E L . Then ~ ( [ E ] ,=u [u] ) and hence u E I ( A ) .Therefore, L E 7 ( A ) . Let u E I ( A ) . Then ~ ( [ E ] , u = ) [u] E {[u] I u E L } and hence u E L where we notice that ‘u E L if u E L and [u]= [w]. Thus I ( A ) L and L = I ( A ) G L . This completes the proof of the proposition. The following problems are decidable. Proposition 4.1.4 (1) For a given finite acceptor (nondeterministic acceptor) A, it is decidable whether I ( A ) = 0, \‘T(A)\< 00 or I‘T(A)I = 00. (2) For given two finite acceptors (nondeterministic acceptors) A , B , it is decidable whether I ( A )= T ( B ) .
Proof (1) Let A = ( S , X , 6 , s o , F ) be a finite acceptor. Assume I ( A ) # 0. Let u E X * be one of the shortest words with u E I ( A ) . Suppose IuI 2 IS[.Then u = aoala2...uk where a0 = E , 01, a2,.. . , ak E X . Consider SO, ao), SO, aoal), SO, aoala2), . . . , S(s0, aoala2. . . ak). Since k 2 15’1, there exist nonnegative integers i ,j = 0 , 1 , . . . , k such that SO, a o a l . . . ai) = SO, aoal . . . ai . . . aj). Let u‘ = aoala2.~~aiaj+l .‘.ak.Then S(s0,u) = b(s0,u’). Hence u‘ E I ( A ) and Iu’I = IuI - ( j - i) < IuI. This contradicts the u I < IS[. This result provides the minimality of IuI. Therefore, I following algorithm to decide whether I ( A ) = 8: (1) For any u E Ui 21SI. Then u = a o a l a 2 ~ ~where E , al,a2,.. . , ak E X . By the preceding method, there exist non-
4.2. GRAMMARS AND ACCEPTORS
89
negative integers i ,j = 0 , 1 , 2 , .. . , I S1 such that SO, aOa1.. . ui) = &(so,aOa1 . . . ai . . . u j ) . Let u‘ = aOa1 . . . aiaj+l . . . ak. Then SO, u’) = S ( s 0 , u ) E F and u’ E 7 ( A ) . By the minimality of (uIand 0 < j - i 5 ISI,we have I S1 5 Iu’I< 21SI.On the other hand, assume S1 5 lul < 21SI. Then 21 = that there exists u E 7 ( A )such that I boblb2.. . bt where bo = E , b l , b2,. . . , bt E X . Then there exist nonnegative integers p , q, 0 5 p < q 5 I S1 such that S ( s 0 , bob1 bp) = SO, bob1 . . . b p . . . b,). Let z = bob1 . . . bp, y = bp+lbp+a. . . b,, z = b,+l...bt . Then u = zyz and zyzz E 7 ( A ) for any i , i 2 1 because 6(so,zyiz) = S(s0,zyz) E F . Notice that IyI 1. Hence II(A)I = 00. These results provide the following algorithm: (1) For any u E Ulslc.i<21slXi, check whether u E 7 ( A ) . (2) If there exists u E Ulsl~i
+
>
Definition 4.1.4 A pushdown acceptor A = ( S ,X , r,6, S O , yo) is defined as follows: (1) S is a state set. (2) X is a finite alphabet. (3) r is a finite nonempty set consisting of symbols, called stuck symbols. (4)S O E S and yo E r. (5) S is the relation satisfying the following property: S ( s , a , y) C S x r*for any s E S,y E r and a E X u { E } . Then the computation by A is performed as follows: (au,s , a y ) FA (u, t , ay’) where a E X U { E } , u E X * , s , t E S, y E r,a , y’ E I?* and ( t ,7’) E S ( S , a,7). Moreover, the language N ( A ) accepted by a pushdown acceptor A is {u E X* I (u,so,yo) k> ( E , ~ , E ) } where t E S and k; is the transitive closure of FA.
90
CHAPTER 4 . LANGUAGES A N D OPERATIONS
Example 4.1.1 The language {anbn I n 2 1) can be accepted by the following pushdown acceptor A = ({so, SI}, { a , b}, {yo, +}, 6,S O , yo): (I) S(sO,a,yo) = ( S O , + ) . (2) J(so,b,yo) = 0. (3) S ( S O , ~ , + ) = (SO,++). (4) S(so,b,+) = ( s i , ~ ) .( 5 ) S(si,b,+) = ( ~ 1 1 ~ ) . (6) 6(sl,a,+) = 0. Proposition 4.1.5 A language accepted by a pushdown acceptor is a context-free language. Conversely, a context-free language over X is accepted b y a pushdown acceptor. Outline of the proof Let A = ( S , X , r , S , s o , y ~be ) a pushdown acceptor and let L = 7 ( A ) . We construct the context-free grammar G = ( V , X , P , S ) as follows: (1) V = {[s,y,t] I s,t E S,y E I?} u { T } where T is a new symbol. (2) (2.1) {T 3 [SO, yo,s] 1 s E S } p. (2.2) {[~,~,slI 3 I a E x u { E } , k = 0,1,2, * * ' , y , y 1 , y 2*,. . , Y k E r, s, s1, s2, . . . 1 S k S 1 E a if S,(sl,y1y2. yk) E b(s, a, y)} C P. Notice that [s,y,s1] k = 0, i.e. (SI,E ) E S(s,a, 7). Then it can be shown that (u, S O , yo) 12 (E, t , e ) , u E X * ,t E S if and only if T + [so,yo, s] ** u , s E S . Thus L = L(G). Conversely, let G = ( V , X , P , S ) be a context-free grammar in the Greibach normal form (see Remark 4.1.2) and let L = L(G). We construct a pushdown acceptor B = ( { s } , X , V , 6 , s , S ) as follows: (1) 6(s,a,A) = ((s,AkAk-l...Al) 1 ( A + aAlA2...Ak)E P,k = 1 , 2 , . . . , Al,A2, . . . ,A k E V } ~ { ( S , I E(A ) a) E P} for a E X , A E V . ( 2 ) 6 ( s , e , S ) = { ( s , ~ )if} ( S + E ) E P and S(s, E , S ) = 0, otherwise. Then it is obvious that S +*u , u E X * if and only if (u, s, S ) -I; ( E , s , E ) . Hence L = I(B).
c
~[S~,Y~,SZI[SZ,Y~-I,S~]...[~~,~~,~~+~I --f
--f
Regarding regular languages and context-free languages, we have the following iteration properties:
Proposition 4.1.6 (1) Let L C X * be a regular language. Then there exists a positive integer n ( L ) determined only b y L satisfying the following property: If u E L and Iu(2 n ( L ) , then u can be decomposed into u = vwx and vw*x L where w E X + , IwI 5 n ( L ) and u , x E X * . (2) Let L C X* be a context-free language. Then
4.1. GRAMMARS A N D ACCEPTORS
91
there exists a positive integer n ( L ) determined only b y L satisfying the following property: If u E L and I uI 2 n ( L ) , then u can be decomposed into u = vwxyz and {vwixyiz 1 i 2 0) G L where v,w , z, y , z E X * ,w y E X + and Iwzyl 5 n ( L ) . Proof (1) Let L G X * be a regular language and let A = (S,X , 6, S O , F ) be a finite acceptor with L = I ( A ) .Let n ( L ) = IS(. By the proof of Proposition 4.1.4 (l),u = v w x , v , w E X*,O < J w J5 n ( L ) and vw*x & L, if u E L and IuI 2 n ( L ) . (2) Let L C X * be a context-free language and let S = (V, X, P, S ) be a context-free grammar with L = C(S). Moreover, let p = IVI and let q = rnaz(lP1 1 a P E P } . Put n ( L ) = q p + 1. If u E L and l U J -> n ( L ) ,then we have the derivation: S J* v T z J* v w T y z J* v w z y z = u where v, w , z, y , z E X * , 1x1 2 1 and T E V. In the above, T J* w T z and T +*x are used. Notice that we can assume that 0 < IwyJ 5 n ( L ) . Since T J* wiTyi and T 3 ' x hold for any i 2 0, we have the derivation S J* v T z J* vwixyiz for any i 2 1. Hence u = vwxyz and vwixyiz E L for any i 2 0. --f
Remark 4.1.4 For regular languages, we can show the following iteration property: Let L C X* be a regular language. Then there exists a positive integer n ( L ) determined only by L satisfying the following property: If u = vn E L holds for some v E X f and n 2 n ( L ) , then there exists a positive integer p 5 n ( L ) such that vnfiP E L holds for any i 2 0. It seems that the same kind of iteration property holds true for context-free languages. However, the following example shows that the situation is very different for context-free languages. Let a,b E X , a # b and let 17 = (X, V, P, S ) be the following context-free grammar where V = { S , T , B } , P= { S t a T B , T --+ a T B , T + b, B --+ a B , B -+ ab}. Let L = .C(S). We will show that (u'"b)+n L = (akb)'"++lfor any IC 2 1. For any k 2 1, the derivation S+*akbBk is uniquely determined. After that, for any ( i l , 2 2 , . . . ,ik) E. "C, we have akbBk+*akbai1bai2b . . . azkb. Thus (a'"b)+n L = ( d b ) ' " + ' . Consequently, for any positive integer p , ( ~ ~ b ) ~E +L ' but (aPb)nf L for any n > p 1. Therefore, the above kind of iteration property does not hold for context-free languages.
+
92
CHAPTER 4 . LANGUAGES AND OPERATIONS
For the details of context-free languages and pushdown acceptors, see [24] and [62]. Now, we introduce a few closure properties:
Proposition 4.1.7 (1) T h e union of two regular (context-free) languages is regular (context-free). (2) T h e intersection of two regular languages is regular. (3) T h e intersection of two context-free languages is not necessarily context-free. (4) T h e intersection of a regular language and a context-free language i s context-free. Proof (1) Let Li G X * , i = 1 , 2 be regular (context-free) languages and let Si = (x,X,Pi,Si),i = 1 , 2 be regular (contextfree) grammars such that Li = C ( S i ) , i = 1 , 2 . We can assume that Vi n VZ = 8. We construct the following grammars: S = (hU Vz U { S } , X , P l U P 2 U {S S1,S t S 2 } , S ) where S is a new variable with S $ V1 U Vz. Then it is obvious that G is a regular (context-free) grammar and C ( S ) = C(&) U C(&) = L1 U L z . (2) Obvious from the proof of Proposition 4.1.4 (2). (3) Let X = { a , b,...}. Then L1 = {unbnam I n,m 2 1) and Lz = {an b ma m I n,m 2 l} are context-free. However, L1 n L2 = {anbnun I n 2 1) is not context-free (use the iteration property for context-free languages in Proposition 4.1.6). (4) Let L C_ X* be a regular language and let M C_ X* be a context-free language. Then there exist a finite acceptor A = (S,X, 6,so, F)and a pushdown acceptor B = (T, X, r,8,t o , yo) such Consider the following pushdown that L = I ( A ) and M = I(B). acceptor A x B = ((Sx T)u { u o } ,X, 6 x 8,r u {#}, uo,yo): (1) # $ r, (2) uo $ s x T , (3) 6 x W U O , E , Y O ) = { ( ( S o , t o ) , # Y o ) ~ , (4) 6 x Q ( ( s , t ) , a , y ) = {((6(s,a>,t’),r’)I (t’,?’) E V , a , r ) } for any ( s , t ) E S x T , y E r and a E X U { E } , (4) 6 x O ( ( s , t ) , ~ , # = ) { ( ( s , t ) , ~ )if} s E F . Then it is obvious that u E 7 ( Ax B) if and Hence L f’ M is context-free. only if u E I ( A )n I(B). ---f
Remark 4.1.5 The following two results can be easily verified: (1) Let A , B G X*. Then the language A B = {uv I u E A,v E B } is called the concatenation of A and B . Then the concatenation of two regular (context-free) languages is regular (context-free). (2)
4.2. OPERATIONS ON LANGUAGES
93
Let X, Y be finite alphabets and let p be a mapping of X* into Y * . Then p is called a homomorphism of X * into Y *if p(uv) = p(u)p(v) holds for any u,v E X * . Then the image of a regular (context-free) language by a homomorphism is regular (context-free).
4.2
Operations on languages
There are some basic operations on languages related to computation. Especially, the shuffle operation can be regarded as a mathematical model of parallel computation and it has been intensively studied in formal language theory. For instance, some types of regular expressions of shuffle operators were dealt with in [l],[2], [49] and [50]- [53].A constrained form of shuffle product, i.e. the literal shuffle is defined in while a special kind of literal shuffle product of a language is studied in [46]. In this book, many problems related to shuffle operations will be discussed.
[?I,
First we define the n-insertion and shuffle product of words and languages.
Definition 4.2.1 Let u,v E X * and let n be a positive integer. Then the n-znsertzon of u into v,denoted by u PIn]v, is (v1u1v2u2 . . . vnU,vn+l I u = U ~ U* Z . ' U n , ~ 1~ 2, , ... , U , E X*,'U = ~ 1 ~ v,t~u,+1, 2 ~11,712,. . . ,w,, E X * } . For languages A, B C X * , the n-insertion A D[,] B of A into B is UuEA,vEBu I>[.] v. For u,v E X*, the shuffle product uov is defined as U n > l up["] v. Moreover, the shufle product - A I>[,] B. A o B of languages A, B ?*is defined as Un>l 9
.
.
In Section 4.3, we will provide some properties of n-insertions. For instance, the n-insertion of a regular language into a regular language is regular but the n-insertion of a context-free language into a context-free language is not always context-free. However, it can be shown that the n-insertion of a regular (context-free) language into a context-free (regular) language is context-free. In Section 4.4, we prove that, for a given regular language L C_ X * and a positive integr n, it is decidable whether L = A D [ ~B] for some nontrivial regular languages A, B X * . Here a language C C X* is said to be nontrivial if C # { E } .
CHAPTER 4 . LANGUAGES AND OPERATIONS
94
4.3 Shuffle products and n-insertions First, we consider the shuffle product of languages.
Lemma 4.3.1 Let A , B 2 X * be regular languages. Then A o B is a regular language.
x
Proof By we denote the new alphabet {ii I a E X } . Let A = ( S ,X,6, so, F ) be a finite deterministic acceptor with I ( A )= A and let B = ( T ,X , 8, to, G-) be a finite acceptor with 7(B) = B. Define the acceptor B = (T,X , 8, to, G ) as 8(t,a) = 8 ( t ,a)for any t E T and a E X . Let p be the homomorphism of ( X Ux)*onto X * defined as p(a) = p ( i i ) = a for any a E X. Moreover, let I ( B )= B. Then p(B) = { p ( E ) 1 E E B } = B and p(A 03)= A o B . Hence, to prove the lemma, it is enough to show that A o B is a regular language over XUX. Consider the acceptor AoB = ( S x T , XUX, 608, (so,t o ) , F x G ) where 6 0 8 ( ( s , t > , a )= ( S ( s , a ) , t )and 6 o e ( ( s , t ) , a )= ( s , e ( t , a ) ) for any ( s ,t ) E S x T and a E X . Then it is easy to see that w E 7 ( Ao B)if and only if w E A o B,i.e. A o B is regular. This completes the proof of the lemma. Proposition 4.3.1 Let A, B C X* be regular languages and let n be a positive integer. Then A PIn] B is a regular language.
- Proof Let the notations of X , B and p be the same as in Lemma 4.3.1. Notice that AD[~]B = ( A o B ) n ( x * X * ) n X *Since . is regular, A I>[.] B is regular. Consequently, A D [ ~B] = p ( A D [ ~B) ] is regular.
(x"X*)"x*
Remark 4.3.1 We show that the n-insertion of a context-free language into a context-free language is not always context-free. For instance, A = {anbn 1 n 2 1) and B = {cndn 1 n >_ l} are contextfree languages over { a, b ) and { c, d } , respectively. However, since ( AI > [ ~ ]B ) f l a+c+bsd+ = {ancmbndm I n , rn 2 1) is not context-free (use Proposition 4.1.6), A D [ ~B] is not context-free. However, as will be shown in Corollary 4.3.1, A D [ ~B] is a context-free language for any context-free languages A and B (see also [54]). Usually, a l-insertion is called an insertion.
4.3. SHUFFLE PRODUCTS A N D N-INSERTIONS
95
Now consider the shuffle product of a regular language and a context-free language. Proposition 4.3.2 Let A C X* be a regular language and let B C X * be a context-free language. T h e n Ao B is a context-free language.
Proof The notations which we will use for the proof are assumed to be the same as the previous cases. Let A = ( S ,X , 6, SO, F ) be a finite acceptor with I ( A ) = A and let B = ( T ,X , I?, 8 , t o , yo) be a pushdown acceptor with N ( B ) = B. Let = (T,X,r,8,to,yo) be a pushdown acceptor such that e ( t , a , y ) = 8 ( t , a , y ) for any t E T , a E X U { E } and y E I?. Then p(N(B))= B . Now define the pushdown acceptor AoB = ( S x T ,X U F ,r U { # } , So$, (SO, to), yo) as follows: (1)v a E X U { E ) , 6O$((SO,t o ) , a , yo) = {(@(so,a ) ,t o ) , #yo)}, s o ~ ( ( s o , t o ) , G Y o=) {((so,t’),#y’) I (t’,y’) E W o , a , Y o ) } . (2) v a E X , Y ( S > tE ) s x T , b E r u { # ) , s o W , t ) , a , y ) = {((6(s,a>,t),r)>. ( 3 ) ~ Ea X U { E } , ~ ( S , E~ SxT,vy ) E r , 6 0 e ( ( s , t ) , G i , y )= {((s,t’),y’) I (t’,7’) E s ( t , W ) )(4) . q s-, t ) E F x T , born, t ) ,6 , #) = {((s, t ) ,4 ) . Let w = ~ 1 ~ 1 ? ? 2 * ~.ztnunVn+1 2 . where u1, ~ 2 ,. . , un E X * and V l ,212, . . . ,U n + 1 E fT*. Assume 608((so, to),w, yo) # 0. Then we have SO, ~ 1 ~ 2* un), . . the following computation: ((so,t o ) , w, yo) t ’ ) , E , # . . . # y ’ ) where (t’,?’) E e ( t o , V 1 V 2 . . . 2 ) , + 1 , ~ 0 ) . If w E N ( A o B),then SO, ~ 1 ~. .2un), . t’),E , # . * #y’) t-ioz SO, ~ 1 ~ . .2un), . ( ~ ( s o , u. .~. un),t’) u~ E F x T and y’ = E . This ~ ’ ) , E , E )Hence . means that ulu2 . un E A and V l , U 2 , . . . ,Vn+l E B. Therefore, w E A x B.Now let w E A x B. Then by the above configuration, we have ( ( S O , t o ) , W ,70)kioz S SO, u1u2 . . . un),t’),E , # . ’ #) t-ioz S SO, ~ 1 ~ 2. un), . . t’),E , E ) and w E N ( A o B ) .Thus A o B = N ( A o B) and A o B is context-free. Since p ( A o B) = A o B , A o B is context- free.
t-ioB
9
+ .
Regarding the n-insertion of a regular (context-free) language into a context-free (regular) language, we have: Proposition 4.3.3 Let A C X* be a regular (context-free) language B and let B C X * be a context-free (regular) language. T h e n A is a context-free language.
96
CHAPTER 4 . LANGUAGES A N D OPERATIONS
Proof We consider the case that A 2 X* is regular and B 2 X* is context-free. Since AD[,]B = (AoB) n(x*X*),x* and is regular, A D [ ~is] context-free. B Consequently, AD[,] B = AD[,] B ) is context-free.
(x*X*)"x*
Corollary 4.3.1 Let A, B & X* be context-free language. A I>['] B is context-free.
Then
Let GA = (VA,X,PA,SA)be a context-free grammar with C(GA)= A. Consider the language SA I>[1]B over X U { S A } .By the above proposition, SAD[l] B is a context-free language over XU { S A } . Let & = (Vc,X, Pc, Sc)be a context-free grammar such that VAn Vc = 8 and L(&) = SA D['] B . Let GD = (vcU { S A } ,Pc U PA,sc). Then GD is a context-free grammar and C(GA) = A D[~] B. This completes the proof of the corollary. Proof
4.4
Decompositions
Let L C X * be a regular language and let A = ( S , X , 6 , s o 1F) be a finite acceptor accepting the language L , i.e. I ( A ) = L . For u , v E X * , by u v we denote the equivalence relation of finite index on X * such that 6 ( s , u ) = 6 ( s , v ) for any s E S . Then it is = {v E X * I u v} for obvious that u F ~ ( P Lif) u w. Let [u] u E X * . It is easy to see that [u] can be effectively constructed using A for any u E X * . Now let n be a positive integer. We consider the decomposition L = A Din] B . Let K, = {([ul], [u2],.. . , [u,]) 1 ul, u2,.. . ,u,E X*}.Notice that K, is a finite set.
-
-
-
Lemma 4.4.1 There is an algorithm t o construct K,.
Proof Obvious from the fact that [u]can be effectively constructed for any u E X * and {[u] 1 u E X*}= {[u]1 u E X * , ( u (5 ISl'sl}. Here IuI and I S 1 denote the length of u and the cardinality of S , respectively. For u E X * , we define p,(u) by {([u1], [u2], . . . , [un]) I u = ~ 1 ~ 2. . u,,ul,u2,.. . ,unE X * } . Moreover, let p = ([uI],[w], . . . , [u,]) E K, and let B, = {v E X * I 'dv = ~ 1 ~ 2. u,v,+i, . . wi,~ 2 ,... .un, v,+i E X*, {vl}[ul]{~Z}[u2]~~.{v,}[~,]{vn+l} G L).
.
4.4. DECOMPOSITIONS
97
Lemma 4.4.2 B, C_ X* is a regular language and it can be e.ffectively constructed. Let i = 0,1, . . , , n, let S(i) = {di)I s E S } and let S = UOfor any a E X. Let v E 7(A'). Then &(SO, ~ 1 ~ 1 ~ 2. v,u,w,+l)(n) ~ 2 . . E $(sf), v1 . v,v,+l) n \ ~ ( ~ for 1 )some v = v l w 2 . . . v,vn+l, v1, v 2 , . . . , v,, wn+l E X*. Hence ~ 1 ~ 1 ~ 2. v,u,v,+1 ~ 2 . . $ L , i.e. v E X*\ B,. Now let v E X*\ B,. Then there exists v = v1v2 . . . v,v,+1, v1,V Z , . . . ,v,, v,+l E X* such that ' ~ 1 ~ 1 ~. .2vnu,v,+l ~ 1 . $ L. Therefore, -6(so ( 0 ), v l v z . . . v,v,+1) E S(n)\F(n), i.e. w = wlv2.. . v,w,+1 E I ( A '). Consequently, B, = X * \ I ( A ' ) and B, is regular. Notice that X*\ 7(A') can be effectively constructed.
Proof
(s(~)
Symmetrically, we will consider v = ([vl], [v2], . . . , [v,], [vn+l]) E K,+1 and A, = {u E X* Vu = u l u p . . . u,,u1, u2,. . . , u, E X*,[vl] {u1}[v2]{u2}. . * [ V n I { ~ n > [ ~ n +Gl l L } .
I
Lemma 4.4.3 A, & X* is a regular language and it can be effectively constructed.
+
Let S(2) = {dz) I s E S } , 1 5 i 5 n 1, and let 3 = $2). Then we define the following nondeterministic acceptor B' = (3, X, -8, SO, vl)(')}, S(,+') \ F(,+')) with €-move where F(,+') = {s(,+') I s E F } . The state transition relation -8 is defined as follows: X(s(Z),a ) = {6(s, a ) ( i ) ,S ( S , aui+l)(Z+l)} for any a E XU{E} and any i = 1 , 2 , . . . ,n. In the same way as in the proof of Lemma 4.4.2, we can prove that A, = X*\ 7 ( 3 )Therefore, . A , is regular. Notice that X*\ I(@) can be effectively constructed.
Proof
Ulliln+l
Proposition 4.4.1 Let A , B X* and let L C X* be a regular language. If L = Ar>fnjB , then there exist regular languages A', B' & X* such that A A', B C B' and L = A' D [ ~B'. ]
98
CHAPTER 4 . LANGUAGES AND OPERATIONS
pROOF Put B’ = n p c p n ( A ) Bp . Let ZI E B and let p E pn(A). Since p E pn(A), there exists u E A such that p = ([ul],[‘zL~], . . . , [u,]) and u = ~ 1 ~ 2 . . u1, u2,. . . ,u, E X*. By u D[,] v L , we have { Z I l } [ ~ l I { v 2 } [ ~ 2 1 .‘ . { 4 [ 4 { Z I n + l ) L for any 21 = v1v2.. . vn%2+1, Thus B C q , v 2 ,..., W,,ZI,+I E X*. This means that ZI E B,. Now assume u E A and w E B’. Let u = n p E p n ( A ) B p = B‘. u1u2 * * . u,,u1, u2,. . . , u, E X* and let p = ([ul], [212], . . . , [u,]) E pn(u)G pn(A).Since ZI E B’ 5 B,, we have ~ 1 ~ 1 2 1 2* ~* V,U,ZI,+I 2. E { ~ 1 } [ ~ 1 1 { ~ 2 } [ *w . ]. { v n } [ ~ n ] { ~ n + l } L for any v = ~ 1 ~ 2. ZI,ZI,+~, . . v l , v 2 , . . . ,w,, wn+l E X * . Hence u I>[,] v E L and A I>[,] B’ C L . On = L. the other hand, since B C B’ and Ar>tnIB= L , we have Ar>[n]B’ Symmetrically, put A’ = n,,Epn+l(Bt) A,,. By the same way as the above, we can prove that A A’ and L = A’ I>[,] B’. From Lemma 4.4.2 and Lemma 4.4.3, it follows that A’ and B’ are regular. v u , ,
c
c
c
Theorem 4.4.1 For any regular language L 2 X* and a positive integer n, at is decidable whether L = A >I],[ B for some nontrivial regular languages A , B X * .
c
Proof Let A = { A , I u E K,+1} and let B = {B, I p E K,}. By the preceding lemmata, A, B are finite sets of regular languages which can be effectively constructed. Assume that L = A I>[,] B for some nontrivial regular languages A , B G X * . In this case, by Proposition 4.4.1, there exist regular languages A C A‘ and B B’ which are an intersection of languages in A and an intersection of languages in B, respectively. It is obvious that A’, B’ are nontrivial languages. Thus we have the following algorithm: (1) Take any languages from A and let A’ be their intersection. (2) Take any languages from B and let B’ be their intersection. (3) Calculate A’ B’. (4)If A’ I>[.] B’ = L , then the output is ”YES”. (5) If the output is ”NO”, search another pair of {A‘,B‘} until obtaining the output ”YES”. (6) This procedure terminates after a finite-step trial. ( 7 ) Once we get the output ”YES”, then L = AD[,]B for some nontrivial regular languages A, B C_ X*. (8) Otherwise, there are no such decompositions.
4.5. EQUATIONS ON LANGUAGES
99
Let n be a positive integer. By . F ( n , X ) , we denote the class of finite languages { L E X * 1 rnaz{lul 1 u E L } _< n}. Then the following result by C. Ciimpeanu et al. [14] can be obtained as a corollary of Theorem 4.4.1.
Corollary 4.4.1 For a given positive integer n and a regular language A C X * , the problem whether A = B o C for a nontrivial language B E F ( n , X ) and a nontrivial regular language C & X * is decidable. Proof Obvious from the following fact: If u,'u E X * and Iu( 5 n, then u o z ~= u ~ ['u. ~ l The proof of the above corollary will be given in a different way in Section 4.5.
Remark 4.4.1 A decompositon L = A Din] B of a regular language L C_ X * is said to be maximal if L = A D["] B = A' B',A C_ A',B C B' imply that A = A' and B = B'. Following the above method, it can be shown that A S X * , B 2 X * are regular for any maximal decomposition L = A B . Moreover, we can obtain all maximal decompositions of a regular language L X * . Remark 4.4.2 Let u, z1 E X * and let n be a positive integer. Then uo[n]w= {U121~U2212* . * u,v, I u = u1u2.. . u,,u1, u2,. . . ,u, E x*, 21 = 211212 * . . v,, q , 212,. . . , v, E X * } is called the n-shufle of u and w and u ofn]v is called the n-shufle of for languages A, B C X * ,UUEA,VEB A and B . Then the analogous results as in the case of n-insertions (including the decomposition results) can be obtained.
4.5
Equations on languages
In this section, we consider the following problem: Let A , B 2 X * be regular languages. Then can we obtain a solution C C_ X * of the language equation A = B o C? Obviously, this problem is equivalent to a partial shuffle decomposition problem for regular languages. Now let A = (S,X , S,so, F ) be a finite acceptor with I ( A )= A and let B = ( T , X , y , t o , G ) be a finite acceptor with 7 ( B )= B .
CHAPTER 4 . LANGUAGES AND OPERATIONS
100
We will look for a regular language C over X such that A = B o C . By we denote the alphabet { a I a E X} with X fl = 0. Let B = (T,X u u {#}, 7, to, G ) where 7is defined as follows: For t E T and a E X , =$,a) = t , %(t,a)= y ( t , a ) . Moreover, y ( t ,#) = t if t E G. Then the following can be easily shown.
x,
x
x
Fact Let ala2 - .' a , E X* where ai E X,i= 1 , 2 , . . . , n. Then ala2...an E I ( B ) if and only if ulalu2E2 . . . ~ ~ ? i , ~ , + i # E I(B) where u1,u2,. . . , u, E X*.
{#},s,
{ a , w } ) and let A2 = (3, XU X u {#}, 5, SO, { a } )where 3 = ( U a E ~ U ~ E ) SU( a{ )a),w } . Here S(') is regarded as S where E is the empty word. For s E S, t E S \ F , t' E F , a E X U { E } , b E X and {#}, 3 is defined as follows:
-
Let A1 =
(3,X
UX U
SO,
-
b) = S(s, b ) ( a ) , s ( s ( a ) ,= b )6(s, b ) ( b ) , T ( t ( a#) ) , = { a } and 6 ( t ' ( a ) , #) = { w } .
-
We consider the following two acceptors: C1 = (3x T,X U X U x 7,( S O ,t o ) , ( a , ~x}G ) , C2 = (3x T ,X U U {#}, x 7, ( S O , t o ) , { a } x G ) where x T( ( S , t ) ,a) = (s(.,a),7(t,a>) for ( 3 , t ) E S x T and a E X . Now consider the following homomorphism p of (XU U {#})* into X*:p(a) = a,&) = E for a E X and p ( # ) = E.
x
s
{#},a
x
Lemma 4.5.1 The acceptors accepting the languages p ( I ( c 1 ) ) and p ( I ( c 2 ) ) can be eflectively constructed.
Proof Let i = 1,2. From Ci,we can construct a regular grammar Gi such that .L(Gi) = I(Ci)with the production rules of the form A + aB ( A ,B are variables and a E X U X U {#}). Replacing every rule of the form A + aB in Gi by A --+ p ( a ) B , we can obtain a new grammar Gi. Then it is clear that p ( I ( C i ) ) = .L(Gi). Using this grammar Gl, we can construct an acceptor Di such that I ( D i ) = C(G:) i.e. p ( ' T ( C i ) ) = I ( D i ) . Notice that all the above procedures are effectively performed. This completes the proof of the lemma. Proposition 4.5.1 Let u E X * . Then {u}o B
E P ( V X\ ) P(VW).
C A if
and only if
4.5. EQUATIONS ON LANGUAGES
101
Corollary 4.5.1 I n the above, B o ( p ( T ( c 1 )\ )p ( T ( C 2 ) ) ) S A . Let L G X* be a regular language over X . By # L , we denote the number rnin{ISI I 3A = (S, X,6,SO, F ) ,L = T ( A ) }where IS( denotes the cardinality of S.Moreover, Z(n,X ) denotes the class of languages { L 5 X* I # L 5 n}.
Theorem 4.5.1 Let A & X" and let n be a positive integer. T h e n it is decidable whether there exist nontrivial regular languages B E Z ( n ,X ) and C C X * such that A = B o C . Proof Let A C X * be a regular language. Assume that there exist nontrivial regular languages B E Z ( n ,X)and C G X*such that A = B o C . Then by Proposition 4.5.1 and its corollary, C C p(T(c1)) \ p(T(C2))and B o (p(T(c1)) \ p ( T ( c 2 ) ) ) E A . Hence A = B o ( p ( T ( c 1 ) )\ p ( l ( C 2 ) ) ) . Thus we have the following algorithm: (1) Choose a nontrivial regular language B X* from Z ( n , X ) and construct the language p ( T ( c 1 ) )\ p ( T ( c 2 ) ) (see Lemma 4.5.1). (2)
102
CHAPTER 4 . LANGUAGES AND OPERATIONS
Let C = p ( l ( C 1 ) )\ p ( ' T ( C a ) ) . (3) Compute B o C . (4)If A = B o C , then the output is "YES" and "NO", otherwise. (4)If the output is "NO", then choose another element in T ( n ,X ) a s B and continue the procedures (1) - (3). ( 5 ) Since T ( n , X ) is a finite set, the above process terminates after a finite-step trial. Once one gets the output "YES", then there exist nontrivial regular languages B E T ( n , X ) and C 2 X* such that A = B o C. Otherwise, there are no such languages. From the above theorem, we can obtain the same result by C. CBmpeanu et al. [14] as a corollary. Corollary 4.5.2 For a given positive integer n and a regular language A X * , the problem whether A = B o C f o r a nontrivial language B E .F(n,X) and a nontrivial regular language C C_ X* i s decidable.
Proof Obvious from the fact that F(n,X ) 5 Z(IXln+l,X ) .
4.6
Shuffle closures
In this section, we will study the shuffle closures of commutative regular languages and present a characterization of those commutative regular languages whose shuffle closures are also regular. Our characterization provides an algorithm to decide whether the shuffle closure of a given commutative regular language is regular. The corresponding decidability problem for general regular languages is still open. Let A G X * . By alph(A) we denote the alphabet of A , i.e. a E alph(A) if and only if a occurs in at least one word of A. We will apply this notation to words as well, i.e. alph(u) denotes the set of those letters which occur in the word u. Let N = {0,1,.. .}, let X = { a l , . . . , a n } and let u E X*. The mapping XU of X * into the set N n defined by
w-4= (IUla1, . , Iula,) ' '
is called the Parikh mapping. For a language A 5 X * , we define Q(A) = { S ( u ) I u E A } . Moreover, if S C N n , then XU-'(S) = { u
4.6. SHUFFLE CLOSURES
I
103
u E X * , @(u) E S } . The language A is called commutative if
A =W1@(A). We recall that, by the shuJ3CEe product of words u , v E X * , we mean the set u o v = {w I w = ~ 1 ~ 1 ~ 2' U k~v k2, u. .= u 1 . . ' U k , v = v1 "'Vk,'7hi,vj E O b v i o u s l y , u o v = v o u a n d ( u o w ) o w = u o ( v o w ) holdfor any u, v, w E X*. Now, let A, B 2 X * . Recall that, by the shuffle product of A and B , we mean the set U2LEA,V& uov which is denoted by AoB. It is easy to see that A o B = B o A and ( A o B )o C = A o ( B o C ) for any A , B , C X*. It is worth noting that the shuffle product of commutative languages is also a commutative language. Let A C X * . The language A' determined as the union of all finite shufRe products of words in A is called the shufle closure of A. The language obtained by adjoining the empty word t o A' is denoted by A". It is obvious that if A = 0, then A' = 8 and A" = { E } . Moreover, if A = { E } , then A' = A" = { E } . For the sake of simplicity, if A = {u} for some word u E X * , then we write uo and u" instead of {u}' and {u}', respectively. We will use the following notations. Let m 2 2 be an arbitrarily fixed integer. We denote the language o A by Am' where A'' = A. Moreover, the language Ulci<mAiois denoted by Amol. By the definitions, we have A' = For a finite index set I = {zl,z2,. . . , z k } and languages Fit, t = 1,.. . , k , the language Fi, oFi20.. .oFi, is denoted by Fj. In particular, if I = 0, then let ng,,Fj = { E } .
x*}.
uizl>. ng,,
The following statement has already been proven in Lemma 4.3.1:
If A, B 2 X * are regular languages, then A o B is regular as well. To prove our main result, we need some preparation. First of all, observe that if A = 8 or A = { E } , then both A and A' are regular. Therefore, in what follows, throughout this section, A X * will denote a language with A # 8 and A # { E } .
Lemma 4.6.1 I f A 2 X*is commutative and A' as regular, then E # u E A, a E alph(u) and a+ n A = 8 imply atX* n ( An alph(u)*)# 0 for a n y positive integer t . Proof Let
E
$1 u E A, a E alph(u), a+ n A = 0 and suppose that
104
CHAPTER 4 . LANGUAGES AND OPERATIONS
the statement does not hold. Since E # u E A and a E alph(u), there exists at least one positive integer t such that atX* n(Analph(u)*)# 8. On the other hand, observe that a t X * n (Analph(u)*)# 0 implies d X * n ( A n alph(u)*) # 8 for any j = 1,.. . , t . Thus, from our assumption it follows that there exists a greatest integer t o > 0 such that d o X *n(Analph(u)*) # 8. Consequently, by the commutativity of A, we have )qIa I: to for any q E A n alph(u)*. Now, let atow E A where w E (alph(u) \ {a})*. By atox* n (A n alph(u)*) # 0,such a word exists. Then @Owh E Ao for any positive integer h. On the other hand, A' is regular and thus there exist positive integers k , p with ak = u"+P(Pp). Choosing an ho satisfying hato >_ k , by the above relation, we have ahoto+mpwhoE A' for any nonnegative integer m. Choose an appropriate large mo for which m o p 2 hoto(w(.Since 210 = uhotofmoPwho E A' and alph('u0) C alph(u), there exist u l , . . . ,us E A n alph(u)+ such that vo = a ~ o t o + ~ o P w ~Eo u 1 0 . .'OU,.
From a+ n A = 0 it follows that any word in Analph(u)+ contains at least one letter from alph(u) \ { u } . Therefore, by the above relation, we have s I: holw). On the other hand, )qIa I: to for any q E A n alph(u)+. Consequently, Iujl. 5 t o , j = 1 , .. . , s and thus we have JwJ, 5 sto 5 hotolw) for any 'u E ~ 1 0 ..ou,. . But J V O ) = ~ hoto+mop > hotolwl which is a contradiction. This completes the proof of Lemma 4.6.1. Lemma 4.6.2 I f A S X * is a commutative regular language, then there exists a finite nonempty commutative language F C A such that A' = AlxloJ o F".
Proof Let X = {al,. . . ,a,}. Without loss of generality, we may assume that alph(A) = { a l , . . . ,a,} for some 1 5 r 5 n. First, we define a suitable set F . Since A is a regular language, there exist positive integers k , p such that as = a"+P(P~) for any j = 1,.. . , r . 3 Now, define the set F as follows: F = {u I u E A,Vj = 1,...,r, Iuluj < k + p } . Then F C A and F is a finite commutative language. Moreover, it is easy to see that F # 8. Let B = AnoL o F". It is obvious that
4.6. SHUFFLE CLOSURES
105
Ao 2 B . To prove the converse inclusion, let u E A" be an arbitrary word. If u = E , then u E B holds as well. Assume that u # E . Then u can be decomposed into the form u E u1 o . o um where m 2 1 and uj E A, j = 1,.. . ,m. If m 5 n, then we immediately obtain that u E B . Now, assume that m > n . Let lUilaj = t i j , i = 1,.. . , m , j = 1 , .. . , r . Since A and B are commutative, we may assume that k - k+P u' a -- utzl 1 * . . u : ~ ,i = 1,.. . , m. Using the relations u j = u j (PA), j = 1,. . . ,r , we define a new shuffle decomposition for u as follows. If ti1 < k p for any i = 1,.. . ,m, then let til = ti1 for any i = 1 , .. . , m. In the opposite case, there exists at least one i E (1, . . . , m } satisfying t i 1 2 k p . Without loss of generality, we may assume that tll 2 k p . Now, for any i E (2,. . . ,m}, let ni = 0 if ti1 < k p and let ni such an integer for which k 5 ti1 - n i p < k + p holds if ti1 2 k p . Moreover, let t!,l = t i 1 - n i p . Finally, define til by til = tll (712 . . . n,)p. Consider the words:
+
+
+
+
+
+ + +
Then u!') E A, i = 1 , .. . , m and u E uy)o...oug) where ti1 < k + p for any i, i = 2 , . . . , m. Using the same idea as above, we can construct a further sequence of words ZL:~) = uSz1 1 * . . a,SzT,i = 1,.. . , rn, such that u12) E A, i = 1,.. . , m and u E up' 0 . .* o U (m2 ) where sil < k p if i E ( 2 , . . . ,m }
+
+
and si2 < k p if i E ( 3 , . . . , m } . Continuing this procedure, finally we obtain such a sequence of words ui ). = uF1 . . . a?, , i = 1,. . . , m, for which ui(7-1 E A, i = 1,. . . ,m with u E u r )0 .. 0 (TI and, for any t E (1, . . . , r } , pit < k p holds if i E (1 t , . . . , m}. Now, observe ,: ) E F and thus we have u E A'" o F" 2 Anal o F". that u ( T~) +. . ~. ,u Consequently, u E B which completes the proof of the lemma. +
+
+
Lemma 4.6.3 Let A C X * be a Commutative regular language and 2 = ( u 1 u E X,uSn A # 8). I f € # u E A, u E alph(u) and a+ n A = 0 imply atX* n ( A n alph(u)*) # 0 for any positive integer t , then there exists a positive integer M such that 20'
C AMoLo
n
aEZ
"(a*n A * )
CHAPTER 4. LANGUAGES AND OPERATIONS
106
holds f o r any w E A Proof Denote the elements of 2 by b l , . . . , b, and let Y = X \ 2 = { a l , . . . ,ar}. We notice that 2 u Y # 0. By the regularity of A , there exist positive integers k,p’ such that a: = a j PA) for any j = 1,.. . ,r and bf = b:+”(pA) for any z, i = 1,.. . , s. On the other hand, for any bi E { b l , . . . ,b s } , we have bf n A # 0 and thus there exists a smallest positive integer pi with E A. Let t = l.c.m.{pl,. . . ,ps} if 2 # 0. Then bk E A* for any i = 1,.. . , s. Now, let if 2 = 0, p = (PI l.c.m.{p’, t } otherwise. Then we have a3k.-- a .3k+P ( P A ) ) j = l , . - . ) r ) bki =- bk+P (pA ) ,. z = ,..., ~ S,
(1)
E A*, i = 1,.. . ,s. Let f be the smallest positive integer for which f p 2 (k p)n holds where n = We define the integers q and A4 by q = k f p and M = np pq - 1. Now, we are ready to prove the lemma. For this purpose, let w E A be an arbitrary word. If w = E , then obviously the lemma holds true. Assume that w # E . Depending on alph(w), we distinguish the following three cases. Case 1: alph(w) n Y # 0 and alph(w) n 2 # 0. Without loss of generality, we may assume that alph(w) fl Y = { a l , . . . ,ad} and alph(w) n 2 = { b l , . . . ) b e } for some positive integers d 5 r and e 5 s. By our assumption, there exist X I , . . . , Xd E alph(w)* such that a:xj E A , j = 1,.. . ,d. Moreover, by (l),we may assume that, for any g = 1 , . . . , d , )xglaj< k p, j = 1,.. . , d. Let j E (1,. . . , d } be an arbitrary integer. From (1) and the definition of q, it follows that A contains the members of the following sequence:
+
+
1x1.
+
+
+
+
Now, observe that, for any mj, mj E {- f p , -f p 1,-f p 2, + ..}, there are not necessarily distinct p words in the above sequence such
4.6. SHUFFLE CLOSURES
107
that their shuffle product contains the word aF+m'Pxy. Therefore,
Consider the above sequence of words for any j = 1,.. . ,d . Now, taking any shuffle product which contains one and only one member from each sequence, we have apq+mlP Pq+mZP.. 1 a2
. a P q + m d P x y . . . xpd
Adpo
d
+
+
+
for any (ml, . . . , m d ) E { -fp , -f p 1, -f p 2, -f p 3, . . . } d . Since lxglaj< k p , j = 1,.. . , d hold for any g = 1,.. , d,
+
a1
+
tzp a2
. . . u tdd p b y @ . . . b:eP
E
fp-lQ(zy . . .
where t j < ( k + p ) d , j = 1,.. . , d and vi Since ~~p is commutative,
+
4)
< (k + p)d,
z = 1 , .. . , e .
+
for any (ml,. . . ,m d ) E {- fp,-fp 1,-fp 2, . . . } d . Then by t j < (k p ) d , j = 1,.. . , d and the definition of f , for arbitrary positive integers 61,.. . , 6 d , there exist mj E {- fp, -fp 1,-fp 2, -fp 3 , . .}, j = 1,.. . ,d , such that p q (mj t j ) p = Gjpq, j = 1,. . . ,d. Consequently,
+
+
+
(2)
af1Pq
+
. . . a 6dd P q b y l P . . . b z e P
+
+
+
E AdpO
for any (61,.. . ,6,) E {I,2, * . . } d . Now, let m be an arbitrary positive integer. We will prove that
CHAPTER 4 . LANGUAGES AND OPERATIONS
108
2 (k+p)n 2 (k+p)d >
definitions o f f and q , we have Pimq 2 k + f p wi, i = 1 , .. . , d. Therefore, orlmpq.. u1 = a1
. a cdr d m p q b 1v l p . . . b : e P b y1l p . . . bFP
E
@I-~Q(~~)
where ~i = P i m q - wi > 0 , i = 1,.. . , e. Now, observe that, by (2), we have acvlmpq.. 1
.a f f d m p q b y l p , . . bleP d
EAdW.
On the other hand, by the definition of p , 1
n
. bpp E
' ( a * n A*).
aEZ
Therefore, u1 E A d P o o n:Ez(a* AdPoo (a* n A*),we have
n",,,
n A*). By
Q-'Q(ul) & Adpoo
n
the commutativity of
' ( a * n A*).
aEZ
But w m P q o C Q-lQ(u0) = Q-lQ(ul) and d 5 n which imply the required inclusion, i.e.
c AWoL o n O(a*nA*)
wmPqo -
(3)
aEZ
holds, for an arbitrary positive integer m. Since wo = Ui>l wiO, it is enough t o prove that wiO E AMoLo n&(a* n A*) forany i, i = 1 , 2 , . . .. For this purpose, let i be an arbitrarily fixed positive integer. If i < pq, then wiO
c -AiO c - A(P4-1)ol c - AMoL0
n
O ( , *
(-
A*),
aEZ
If i 2 pq, then there exist integers m > 0 and 0 5 (Y < p q such that i = m p q + a. On the other hand, wao = w m P q o o w"O. Now, w"O 5 A ( P q - ' ) O l . Moreover, w m P q o C AnPL o n&(a* n A*) from (3). Therefore,
4.6. SHUFFLE CLOSURES
109
which completes the proof of Case 1. Case 2: alph(w) n 2 = 0. Without loss of generality, we may assume that alph(w)nY = {al, . . . , ad}. Observe that d > 1. Indeed, in the opposite case, aizl E A for some z1 E alph(w)* = a; and t > 0 from our assumption and thus E A which contradicts the fact that a1 E Y . Then in a similar way a s Case 1, we have
for any (61,.. . ,6d) E { 1 , 2 , . . .}d. In this case, w E @-'@(a:' . . . adad) where aj = Iwlaj > 0, j = 1,.. . , d . Now, let m be a positive . a:dmpq). On the other hand, integer. Then wmPqo C aalmpq 1 . . . a:dmpq E A d P from (4). Since A d p o is commutative, we have wmPqo C A d P C - AnWl for any positive integer m. Now, in the same way as above, it can be proved that wiO AMoL holds for any i, i = 1 , 2 , . . . and thus
c
wo
c -
c - AMOL o
n
'(a* n A*)
aEZ
which completes the proof of this case. Case 3: alph(w) n Y = 8. Without loss of generality, we may assume that alph(w) n 2 = { b l , . . . , be}. Then w E W 1 Q ( b T 1 . . ' b p ) where pi = JwJb, > 0, i = 1,.. . , e . Now, let m be an arbitrary positive integer. We show that wmpw
c - AMOL o
n
'(a*n A * ) .
aeZ
If m = 1, then wpq' Then
c Apqo C- AMolon;,,(a*nA*).
c
Now, let m > 1.
Observe that @-lQ(bflpq . * . b p p q ) 5 Apqo AMoJ. Furthermore, by the definition of p , we have bp(m-l)pq E A*, i = 1,.. . , e and thus
110
CHAPTER 4 . LANGUAGES A N D OPERATIONS
Consequently, WmPqo C - AM01
o
n
'(a* n A*)
aEZ
holds for any positive integer m. Using this inclusion, we can prove, in the same way as the previous cases, that wiO C AMoJOrI:Ez(a* n A*) for any i, i = 1 , 2 , . . *, which implies wo
AMoJo
n
' ( a * n A*).
aEZ
This completes the proof of Lemma 4.6.3. Now, we are ready to prove the following theorem.
Theorem 4.6.1 Let A X* be a commutative regular language. Then A' is regular i f and only i f E # u E A , a E alph(u) and a+ n A = 0 imply atX* n ( A n alph(u)*) # 0 for any positive integer
t. Proof (+) Obvious from Lemma 4.6.1. (+) Assume that the above condition holds. We prove that A' is regular. Let X = { a l , . . . ,an}. Then by Lemma 4.6.2, we have A' = AnoL o F" where F E A and F is a finite nonempty commutative language. It is easy to see that F" = By Lemma 4.6.3, there exists an M > 0 such that uo C AMoJo n:,z(a* n A*) for any u E F . Consequently, F" E { E } u AMIFloJ o n",,z(a* n A * ) ,and thus we have
n",F~o.
On the other hand, each member of the right-side is contained in A', and hence
4.6. SHUFFLE CLOSURES
Ao = A(n+MIFl)ol0
111
n
o(a*
n A*),
aEZ
Finally, observe that, by Lemma 4.6.2, both A(n+MIFl)oJ and n i E Z ( a * nA*) are regular and thus A' is regular as well. This completes the proof of Theorem 4.6.1. Using Lemma 4.6.1 and the same idea as in the above proof, we obtain the following theorem which presents the fact that if A' is regular, then it is equal to a shuffle product of a union of finite shuffle powers of A and a regular language. More precisely, we have the following result. Theorem 4.6.2 Let A X* be a commutative regular language. Moreover, let 2 = { a a E alph(A),a+ n A # 0). T h e n A' is regular i f and only i f there exists a positive integer N such that A' = ANoJo niEZ(a* nA * ) .
I
Notice that it is decidable whether or not the condition of Theorem 4.6.1 is satisfied and thus it is decidable whether Ao is regular for a commutative regular language A . Using Theorem 4.6.2, we can provide another algorithm to decide whether A' is regular for a commutative regular language A 5 X* as follows: In Theorem 4.6.2, the value of N is given by A , e.g. N = ( n + l ) p ( k + p + l ) ( k + p ) p . Using this N , we can check whether or not A(N+l)OL C - ANobnO,EZ(a*nA*). If A(N+l)O1C - ANoLo niEz(a*n A * ) , then A' is regular. Otherwise, A' is not regular.
This page intentionally left blank
Chapter 5
Shuffle Closed Languages In the previous chapter, we dealt with the shuffle closure of a commutative regular language. The shuffle closure of a language is a s h u f i e closed language defined below. In this chapter, we will deal with the structures of commutative regular shuffle-closed and regular strongly shuffle-closed languages. Moreover, we will prove that every hypercode is finite. The contents of this chapter are based on the results in [47].
5.1
Sh-closed and ssh-closed languages
Let L C X * and let u,u E X*.We consider the following conditions on a nonempty language L: (1) U , V E L
+ uou c_ L .
(2)u
E
L , U O Vn L #
0 + u E L.
Definition 5.1.1 A language satisfying the condition (1) is said to be shuffle closed or sh-closed. A language satisfying the conditions (1) and (2) is said to be strongly s h u f i e closed or ssh-closed. Every sh-closed language is a subsemigroup of X * and, since u o u,every ssh-closed language contains E and is consequently a submonoid of X * . c =
Example 5.1.1 Let X = { a , b } and let k 2 1. Then: (1) L k ( a ) = {u E X+ I Iu1, 2 k} is sh-closed, but not ssh-closed if k 2 2. (2) Lab = {u E Xf I IuI, = I u I b } is ssh-closed.
113
114
CHAPTER 5. SHUFFLE CLOSED LANGUAGES
Let L 5 X * . Then Lo and Lo are sh-closed. Moreover, Lo is the smallest sh-closed language containing L . Fact (1) L1 C_ L2 =+-Ly C L; and LT E Ls for'any L1, L2 (2) (LO)' = Lo and ( L O ) " = Lo for any L X * .
C X*.
If L & X * , then the following properties are equivalent: (1) xuvy E L implies xvuy E L . (2) If u E L , then a(u)2 L where a(u)is the set of all permutations of the letters of u.
A language having one of the above equivalent properties is called a commutative language.
Proposition 5.1.1 Every ssh-closed language is Commutative. Proof Let xuvy E L . Since L is sh-closed, xxuvuvyy E L and since L is ssh-closed, xvuy E L. Every submonoid of X * that is a commutative language is shclosed, but it is not in general ssh-closed. For example, the language L = {aaa,ab, ba}" is sh-closed and commutative, but not ssh-closed.
5.2
Sh-free languages and sh-bases
A language L C X+ is called sh-free if it is nonempty and if u1,u2, . . . , L , k 2 2, implies u1 o u2 o . * o U k n L = 0. A typical class of sh-free languages is the class of hypercodes. A hypercode H is a nonempty subset of X+ such that ulu2 . . . U k E H , ~ 1 ~ 1 x . ukxk+l 2 ~ 2 ~E H ~ implies 2 1 = 2 2 = . . - = Zk+l = E (see [64] - [661). In Chapter 6 (Section 6.2), we will introduce the notion of codes. A hypercode is a code and it is sh-free. An sh-free language is not necessarily a code. For example, if X = {a,b,c,d}, then A = {ab, abc, cd, d } is sh-free but it is not a code. Uk E
+
Definition 5.2.1 Let L C X * be an sh-closed language. Then by J ( L ) we denote the language ( L \ { E } ) \ ( ( L\ {E}) o ( L \ ( 6 ) ) ) and we call it the shufle base (or in short, sh-base) of L .
5.2. SH-FREE LANGUAGES AND SH-BASES
115
It is obvious that the sh-base J ( L ) of an sh-closed language is sh-free. The following result shows that, if L is a regular sh-closed language, then its shuffle base is also regular.
Proposition 5.2.1 If L is a regular sh-closed language, then its shbase J ( L ) is regular and L = J(L)O or L = J ( L ) " .
Pro0f Since L is regular, L \ { E } and ( L \ { E } ) o ( L\ { E } ) are regular and thus J ( L ) is regular. From the definition of sh-base, it follows that L = J(L)O if E $! L and L = J ( L ) " if E E L. Lemma 5.2.1 Let x E u o v and let x = ~ 1 x '2' xp where xi E X * , i = 1 , 2 , . . . , p . Then there exist u 1 , u 2 , .. . ,uP,v1,v2,. . . , u p E X* such that u = u l u 2 ' * 'up, v = v1v2 . . ' u p , x 1 E u 1 o ~ 1 ~ E x 2u 2 o v2,.. . , xp E up 0 up.
Proof We prove the lemma by induction and for that it is enough to deal with the case p = 2. Let x E u o v. Then it is easy to see t h a t x = u 1 v ~ u 2 v 2 ~ ~ . U Tw v Th e r e u i , v i E X U { ~ } , i = 1 , 2 ..., , r. u = u 1 u 2 . . * Ur and v = vlv2 . . . v,. Let x = yz where y, z E X*. Then there exists some i = 1,2, . . . , k such that y = ~ 1 ~ 1 . .~. uk-lvk-luk 2 ~ 2 or y = u1v1U2v2 ' * * uk-lvk-1ukvk. Let y = u12/1u2v2 ' ' * Uk-lvk-lUk. Then kt ui = U 1 U 2 * . ' U k - 1 U k 7 ui = uk+1 .."ur, v; = v1v2..-vk-1 I 1 and let vh = VkVk+l+ .v,. Obviously, u = uiuh,v = v1v2, y E uiovl, and z E u;ovh. Now if y = ~ 1 ~ 1 ~ 2 . ~Uk-lVk-lUkVk, 2 . . then let ui = I U 1 U 2 . * . u k , U 2 = Uk+l . . * U T lV i = 'U1V2.. . vk and let Vk = vk+l . . . V r . Obviously, u = uiuh,v = vivh, y E ui o v; and z E uh o v;. This completes the proof of the lemma. Lemma 5.2.2 Let x E y1 o y2 o - .. o yk for some x,y1,yz,... ,yk E X*.If x XI, i.e. af x = 2 1 x 2 ~ 3 ~and 4 X I = ~ 1 x 3 2 2 ~for 4 some X I ,~ 2 ~ xx4 3 ,E X*,then there exist y;, y;, . . . , y(, E X* such that y1 yi, y2 y;,.. . , y k yi and x1 E yl, o yk o . . . o yi. N
N
N
Proof
N
We prove the lemma by induction and for that it is enough t o deal with the case Ic = 2. Let x E y o z for some x,y, z E X*. Assume x XI. Since x E y o z , by Lemma 5.2.1 there exist N
Y1,Y21 Y3,Y4,217 z27 z37
CHAPTER 5. SHUFFLE CLOSED LANGUAGES
116
Proposition 5.2.2 If L C X* is sh-closed, then L i s commutative if and only if the sh-base J ( L ) of L is commutative.
Proof (+) Let zuvy E J ( L ) . Since L is commutative, zvuy E L . Suppose xwuy J ( L ) . Then zvuy E p o q for some p , q E L n X+. By Lemma 5.2.2, x u v y E p' o q' where p p' and q 4'. From the assumption that L is commutative, we have p', q' E L n X+.This contradicts the assumption that x u v y E J ( L ) . Hence J ( L ) must be commutative. (e) Let x u v y E L . Then xuwy E y1 o y2 o . - o y,+ for some y1, y2,. . . yk E J ( L ) . By Lemma 5.2.2, we have x v u y E yl,oyio.. .oyk where yi yl, i = 1 , 2 , . . . k. Since J ( L ) is commutative, yi E J ( L ) and hence m u y E J(L)O C L. Therefore, L is commutative. ,-+
N
N
Proposition 5.2.3 If a language L # { E } is ssh-closed, then the sh-base J ( L ) of L as a cornmutative hypercode.
Proof By Proposition 5.1.1, L is commutative. Moreover, from Proposition 5.2.2, it follows that J ( L ) is commutative. Let u , v E J ( L ) where u # v. Suppose that u
Fact The sh-closure of a commutative hypercode as not always a n ssh-closed language. Example 5.2.1 Let X = { a , b } and let H = X2\a2. Then H is a commutative hypercode, but H" is not ssh-closed. Notice that b2 E H and abab E a20b2. Moreover, abab E aboab C H " . Therefore, if H" is ssh-closed, then a2 E H " , which is a contradiction.
5.3. C O M M U T A T I V E R E G U L A R L A N G U A G E S
117
Recall that a l p h ( L ) denotes the set of all elements of X occurring in words of L.
Proposition 5.2.4 Let L c X * be regular and sh-closed. If J ( L ) , the sh-base of L, is finite, then a+ n J ( L ) # 0 f o r any a E a l p h ( L ) . Proof Since L is regular, for any a E a l p h ( L ) there exist k , p 2 1 such that ak = ak+p ( P L )where PL is the principal congruence defined by L . From a E a l p h ( L ) , it follows that z a y E J ( L ) for some z , y E alph(L)*. Then z k a k y k E L . Hence zkak+nPyk E L for any n 2 1. Let p = max{]z] 1 2 E J ( L ) } and k + n p > ( p - 1 ) k J z y l . Then it is easy to see that zkak+npyk E z1o 22 o . . * o z,, z iE J(L), i = 1:2 , . . . , s and xj E a+ for some j = 1 , 2 , . . . , s. This means that a+ n J ( L ) # 0. Fact The above proposition does not hold true i f J ( L ) is infinite. Let X = { a , b} and let L = ( a U bsa)". Then J ( L ) = a U b+a and L = ( a U b+a)*. Hence L is regular, but b+ n J ( L ) = 0 .
5.3
Commutative regular languages
In this section, we will determine the structure of commutative regular sh-closed languages. Let X be a finite alphabet with J X ]= r and let Q : X * + N' be the Parikh mapping of X* onto N T . The following proposition is immediate.
Proposition 5.3.1 (1) A language L is commutative i f and only i f Q-'Q(L) = L . (2) A language L is sh-closed and commutative if and only if Q ( L ) is a subsemigroup of N' and V I Q ( L ) = L . (3) A nonempty language H 5 X+ is a commutative hypercode i f and only if Q - l Q ( H ) = H and any two distinct elements of Q ( H ) are incomparable with respect t o the following partial order on N': ( m l , m 2 , . . . , m , ) I (n17n2,...,~-) ml I n1,m2I n 2 , . . . , m r I
*
72'.
CHAPTER 5. SHUFFLE CLOSED LANGUAGES
118
Proposition 5.3.2 Every commutative code C
C X* is a hypercode.
Proof Suppose C is not a hypercode. Then x
<
Proposition 5.3.3 Let C C Xf be a code, let L = C” and let J ( L ) be the sh-base of L. T h e n L is commutative i f and only i f J ( L ) is a commutative hypercode. Proof
(e) Obvious.
(+) It is obvious that H is a commutative code. By Proposition 5.3.2, J ( L ) is a hypercode. Every submonoid (subsemigroup) M of X* has a unique minimal generating set K , called the root of M , and M = K* ( M = K+).
Remark 5.3.1 Let L C X * be an sh-closed language. Then L is a subsemigroup of X * . Let K be the root of L. Since K = ( L 2\ ( 6 ) ) \ ( L \ ( E } ) , L is regular if and only if K is regular. Recall that the shuffle product of two regular languages is regular.
Lemma 5.3.1 L e t ( a l , a a , . . . , a,} E X , l e t p l , p 2 , . . . , p r L o a n d l e t z E
X * . T h e n @ - l Q ( z ( a ~ ’ ) * ( a ~ z ) *( a. .p. ) * ) =
u
((. . . ((y o
y ErIr - 1 rIr (z)
(a’;l)*)o (a?)*) . . .) o (a$?)*. Proof
Obvious from the above remark.
Lemma 5.3.2 Let { u l ,u2,. . . ,a,} G X , let p l , p 2 , . . . , p , 2 0 and . . . (a$?)*) i s regular. let z E X * . T h e n @-’@ (x(a~l>*(a~)* Proof
Obvious from Lemma 5.3.1.
5.3. COMMUTATIVE REGULAR LANGUAGES
119
Definition 5.3.1 Let a,p E N' and let p 1 , p2, . . . ,pr 2 0. Here Q /3 (mod(pl,pz,. . . ,pT))means that ai 2 bi and ai G bi (mod p i ) for any i = 1 , 2 , . . . ,r where a = ( a l ,az, . . . , a,) and ,O = ( b l ,bz, . . . , br). We determine now the structure of a commutative regular shclosed language L C X*. Without loss of generality, we can assume that E E L . Let a = (ml,mz, . . . ,mT)and let ,B = (n1,n2,. . . ,n,) where mi, nj, i,j = 1,2, . . . ,r are nonnegative integers. By a 5 ,B we mean that mi 5 ni for any i = 1,2, . . . ,r .
s
Proposition 5.3.4 Let L X* with E E L . Then L is a commutative regular sh-closed language if and only if L is represented as
where (a) Y = { a l l a s , .. .,a,} 2 X and 6, = (&I, b , ~ , . . . , 6,i E ( 0 , l ) for any u E F and any i = 1 , 2 , . . . , r , (b)
P1,P2,...,Pr
2 1,
(c) F is a finite language over Y with E (c)-(1)
where
E
F satisfying
there exist qi,qZ,. . . , q r 2 1 such that qi 2 pi for any i = 1 , 2 , . . . ,r and, for any u E F , we have 0 5 ci I qi, i = 1 , 2 , . . . , r where Q(u) = ( c l , c2,. . . , G),
(c)-(2) for any u,v
and S, SV
E
F , there exists w
E
F such that
I 6,.
Proof (+) Let Y = aZph(L) = { a l , a2,. . . ,ar}. Since L is regular, there exist ki,pi 2 1,i = 1 , 2 , . . . , r such that a? (PL) for any i = 1,2, . . . ,r . Let qi = ki pi - 1,i = 1 , 2 , . . . , r and let F = {U E L 1 Q(u) = ( ~ 1 ~ ~. .2,c,), , . 0 5 ~1 I q1, 0 I cz I qZr...,05 C, I qr}.
+
120
CHAPTER 5. SHUFFLE CLOSED LANGUAGES
Let u E F and let i = 1 , 2 , . . . ,T . Then let 6,i = 0 if ci bui = 1 if C i 2 ki where * ( u ) = ( ~ 1~, 2 .,. . , c,). By for any i = 1 , 2 , . . . ,T , we have
UP
< ki and let (PL)
for any u E F . Now we assume that w E L\F. Let Q(w) = (dl,dz,.. . ,d,). Then there exists i, 1 5 i 5 T such that di > q i . Since afla$ . . . u p . . . & E !P-lQ(w) C L and a: = a?+pi ( P L ) , we have ud1ad2 1 2 ..'a>-mpi . . . a $ E L for some m 2 1 where ki 5 di - m p i 5 q i . Let w1 = ald l a2d2 " . a idi-mpi . . . a$. Then we have w E *-'\Zr(vl(afi>*) C L. If w1 E L\F, then we continue the same procedure. Finally, we have
for some u E F . This completes the proof that
Now let u,w E F . If uw E F , then obviously (c)-(2) holds. If uw $! F , then by the above procedure
where w E F . This means that *(uw)2 * ( w ) (mod((S,l)pl, (SW2)p2, . . . , (S,,)p,). Moreover 6,, 6, 5 6, holds. (+) By Lemma 5.3.2, L is regular. It is obvious that L is commutative. Now we show that L is sh-closed. Let U , V E L . Then
and
where
Consequently,
5.3. COMMUTATIVE REGULAR LANGUAGES
for some w
E
121
F . Therefore, U o D 2 L and L is sh-closed.
Now consider a commutative sh-closed language whose sh-base is finite. Proposition 5.3.5 Let L C X* with E E L . T h e n L is a commutative regular sh-closed language, whose sh-base is finite, if and only if L is represented as
where
(c) F is a finite language over Y with
E
E
F satisfying
(c)-(1) there exist q1,q2,. . . ,q, 2 1 such that qi 1 pi for any a = 1 , 2 , . . . , r and for any u E F we have 0 5 ci 5 qi, i = 1 , 2 , .. . , T where Q(u) = (c1,c2,. . . , C r ) , (c)-(2)
for any u , v E F there exists w E F such that Q ( u v ) 2 Q(w>(mod(Pl,P2,.. . , P r ) .
Proof (+) By Proposition 5.2.4, we can choose ki,pi 11, i = 1 , 2 , . . . , T in the proof of Proposition 5.3.4 as those satisfying the conditions a? E ( P L )and a? E L for any i = 1,2, . . . ,T . In this case, since L is sh-closed, we have
C H A P T E R 5. SHUFFLE C L O S E D L A N G U A G E S
122
(+) The proof can be carried out in the same way as in Proposition 5.3.4 after assuming that 6, = (1,1,. . . ,1,1) for any u E F , and after observing that the sh-base of L is contained in F u {a:', a y , . . . , a p } . Proposition 5.3.6 Let L C X* be a commutative sh-closed language whose sh-base J(L)is finite. T h e n L is regular af and only if a+ n J(L)# 8 for any a E aZph(L).
This part has already been proven (see Proposition Proof (3) 5.2.4). (+) Let { a l , a2,. . . , a r } = a l p h ( L ) , let {a:', a?, . . . ,a?} J(L) and let J = ( u l , u 2 , . . . , u s } = J(L)\{a:', a?, . . . ,a?} and let p = max{IuI I u E J}. Put q = 1.c.m. { p l , p z , . . . , p r } and n = pqs. Let F =
u
@-'@(x).
Obviously, F is a finite language.
z E J * , IzI5n
Now let u E L. Then u f W1Q( a ( a : l ) * ( a ~ ) * - - . ( a ~ where )*) a E J*, i.e. @ ( u )2 S ( a ) ( m o d ( p l , p z,...,p r ) ) . If la1 > n, then a E Q-'Q(a'u;) for some a' E J* and i = 1 , 2,..., s. It is obvious that up E @ [ I - l @ ( ( a ~ ' ) * ( a. .~.)(*u p ) * ) . Consequently, u E S - l S ( a ' ( a : ' ) * ( u y ) * . . . ( a p ) * ) ,i.e. $(u) Q ( a ' > ( ( m o d ( p l , p 2 , . . , p r ) ) . We continue the same procedure if la'[ > n and we have ,8 E J* such that 5 n and u E @ - l @ ( P ( a y ' ) * ( a y ) ** * . (a?)*), i.e. @(u) @(P)(mod(pl,p:!,. . . , p r ) ) . Let qi = n,i = 1 , 2 , . . . , r . Then q i , i = 1 , 2 , . . . ,r satisfies the conditions (c)-(1) and (c)-(2) of Proposition 5.3.5. Hence L is regular.
5.4
Regular ssh-closed languages
In this section, we will determine the structure of regular ssh-closed languages.
X*.T h e n L is a regular ssh-closed Proposition 5.4.1 Let L language if and only af L is represented as
where
5.4. REGULAR SSH- CLOSED LANG UAGES ( a ) y = {a1,a2, * (b) P I , ~
2 , ... ,P,
..
I
a, 1
123
c x,
L 1,
(c) F is a finite language with E E F satisfying
for any u E F we have 0 I ci I pi, i = 1 , 2 , . . . , r where Q(.> = (c1,c2,. . ., 4 , (c)-(2) for any u,v E F , there exists w E F such that Q ( u v ) 2 Q(w)(mod(p1,p2,.. . 7 1 3 , ) ) and + (c)-(3) for a n y u,v E F , there exists w E F such that Q ( u w ) = w J ) ( m o d ( P l ,P 2 , . . . ,P r ) . (c)-(1)
Proof (+) First, notice that the ssh-base of L is a hypercode and hence finite (see the next section). From the fact that L is ssh-closed, it follows that a? E L and E = a? (PL)for any i = 1 , 2 , . . . ,T in the proof of Proposition 5.3.5. Therefore, we can assume that Ici = 1, i.e. qi = p i for any i = 1 , 2 , . . . ,T . Therefore, it is enough to show (c)-(3). Let u, v E F where * ( u ) = (cl, c2,. . . , c,) and let Q ( v ) = ( d l ,d2, . . . , d,). If di 2 ci for any i = 1 , 2 , .. . ,T , then let w E *-‘{(dl L C 1 , d 2 - c2,. . . , d , - c,)}. In this case, since uw E Q-’Q(v) and L is ssh-closed, w E L. On the other hand, w E F because di - ci I di I pi for any i = 1 , 2 , . . . , T . Now assume ci > di for some i = 1 , 2 , , . . , T . Without loss of generality, we can assume that c1 > d l , c2 > d 2 , . . . , c1 > dl and dl+l 1 cl+1, d1+2 L cl+2,. . . ,d, 2 c, for some I = 1 , 2 , .. . , T . Notice that dl pl 2 Cl,d2 P2 L c2, * . . ,dl Pl 2 Cl,dl+l 2 C1+1,’.*Id, L c,. Let w E Q-l(dl+pl-Cl, da+p2-c2 7 . . * ,dl+Pl-cl, dl+l-cz+l,. . . , dr-c,). Then u w E Q-’ (vuy’a? . . . a?) C L. Since L is ssh-closed, w E L. Moreover, d l p1 - c1 I p l , d2 p2 - c2 I p 2 , . . . , dl pl - cl I p l , dl+l - cl+1 I p l + l , . . . , d, - c, I p,. Hence w E F and Q ( u w ) 2 (mod(Pl,Pz,... , P r ) ) . (e) It follows from Proposition 5.3.5 that L is a regular sh-closed language. Now let u, v E L and let v = uw for some w E Y * . Since u, v E L , there exist u’, v’ E F such that u E Q-’Q(u’(ay’)*(u?)*. . . ( a f T ) * )and v E W 1 Q(v’(u~l)*(a?)*. . . (up)*). By (c)-(3), there exists w’ E F such that Q(u’w’) Q(v’) ( m o d ( p l , p ~ ., . ,p,)) ,i.e. u’w’
+
+
+
+
+
+
124
CHAPTER 5. SHUFFLE CLOSED LANGUAGES
(Y'(u~~)*(u;~)* . . . (a?)*). Hence uw' E @ ' - l @ ( ~ ' ( a ~ ' ) * ( a ~ ) * . . . (a?)*), i.e. uw' E @-1S(~'(a~1)k1(a~)k2 . - (up)") for some ki 2 0, i = 1 , 2 , . . . , r . On the other hand, Y E Q ' - 1 Q ( ~ ' ( a ~ ' ) * ( a ; 2 ) * . . . (a?)*) implies that v E @-'Q (~'(a:l)~l( u ; ' ) ~ Z . . . for some ti 2 0, i = 1 , 2 , . . . ,T . Thus UW'(U:')~' . E XP- 1 * ( Y ( a ; l ) * . .. (a?)*). From v = uw, it follows that w ' ( u : ' ) ~.~. . E @-l@(w (a~')*(ap)* . . . (a?)*). Since w' E F , w E Q - ' ~ ( W ' ( U ~ ' ) * ( U ~ ~ .) .* . ( a f T ) * ) .Thus w E L. This means that L is ssh-closed. E @-'@
* *
5.5
Hypercodes
In this section, we will prove that every hypercode is finite. The proof is essentially due to [64] and [65]. On X * , we have already defined an order relation, called the embedding order and denoted by sh. For two words u , v E X * , we denote u Ih Y if there exists a w E X* such that Y E u o w. Recall that a language H C_ Xs is called a hypercode if any distinct words U , Y E H are incomparable with respect to the order
Lemma 5.5.1 Let K C X * be an infinite language. Assume that any hypercode contained an K as finite. Then there exists wi E K , a 2 1 such that wi+l E hDes(wi) for any i 2 1. Proof Let K' = {wi, w;, . . .} be an infinite subset of K such that IwiI < lw;I < and let H = {wi E K' I K' n hDes(wi) = 8). If H = 8, then there exists an infinite subsequence ni,i 2 1 such that n1 = 1,wni E K' and Wni+' E K' n hDes(wni) for any i 2 1. In this case, the lemma holds true. Assume H # 8. Then H X* is a hypercode. Thus (HI < 0;) and there exists a positive integer ko such that K' n hDes(wi) # 8 for any i 2 ko. Hence there exists an infinite subsequence ni,i 2 1 such that n1 = ko, wni E K' and w , ~ + ~E K' f l hDes(wni)for any i 2 1. Therefore, the lemma holds true. This completes the proof of the lemma. s . .
Now we are ready to prove that any hypercode is finite.
5.5. HYPERCODES Proposition 5.5.1 Let H
125
X * be u hypercode. Then H is finite.
1x1
Proof Let = 1, i.e. X = { a l } . Then it is obvious that any hypercode over X is finite. Now assume that the proposition holds x1 < n. Suppose that the proposition does not hold true for X with 1 true for X with = n. Let X = { u l ,u 2 , . . . , un-l,un}. Then there exists an infinite hypercode H X*. Let IFt = { H 5 X * I H is a hypercode such that \HI = m}. Let u E H for some H E 'FI such that Jul = min{ Iwl I 3H E 'FI, w E H } . If u = b E X , then H \ {u} is a hypercode over X \ {b}. Thus by the induction hyposis, H \ {u}is finite and hence H is finite, which is a contradiction. Assume that u = blb2 . . . b, where r 2 2 and bi E X for any i = 1 , 2 , . . . , T . Let w = blb2 . . . br-l. Consider the set D = { w I w E H,vsh w}. If D is a finite set, then ( H \ 0) U {w} is an infinite hypercode, which contradicts the minimality of IuI. Hence D is an infinite hypercode. Let { w ~ , w z ., .} . be an infinite subset of D such that Iw1I < lw2l < .... Then for any i > 1, wi can be represented as wi = uilb1ui2b2. . . bi~r-2)ui(r-~)br-1uir where uil E ( X \ ( b l } ) * ,ui2 E ( X \ { b 2 } ) * , * . . , ui(r-1) E (X\ {br-l)*} and uir E ( X \ {b,})*. By the induction hypothesis, for each i 1, a hypercode contained in {uit I t 2 1) is finite. By Lemma 5.5.1, there exists an infinite subset {wd 1 i 2 1) of { w l , w2,. . .} such that wi = u~,b1ui2b2... br-2ui(r-1)br-1uir,i 2 1 and, Ih u(i+1It for any i 2 1 and any t = 1 , 2 , . . . , T . However, this contradicts the assumption that H is a hypercode. Consequently, IHI < m if H X * is a hypercode. This completes the proof of the proposition.
1x1
>
s
This page intentionally left blank
Chapter 6
Insert ions and Deletions In Chapter 4, we dealt with n-insertions, shuffle operations and related languages. In this chapter, we will consider the insertion operation, i.e. 1-insertion operation, and its inverse operation, i.e. deletion operation in details. First we will introduce the notions of insertion residual and insertion closure of a language and we will provide several properties with respect to these notions. Then we will introduce the notion of deletion closure of a language. In Chapter 5, we determined the structure of commutative regular shuffle closed languages. In this chapter, we will provide some properties of regular insertion closed languages. Finally, we will also deal with a problem related to the combination of two operations, i.e. insertion closure and insertion residual operations. The results in this section are due to [40].
6.1
Insertion closures
First we recall that the insertion of u into Y is the language u D Y = {VIUVZ I Y = Y I Y Z , ~ ~ , Y E Z X"}. Notice that, in Chapter 4, we X*. Then the insertion denoted u D [ l ]Y instead of u D u. Let L residual inRes(L) of L is defined as : inRes(L) = {x E X* 1 Vu E L,zDzLCL}.
Example 6.1.1 Let X = { a , b } . Then (1) i n R e s ( X * ) = X * . ( 2 ) ZnReS(Lab)= Lab where Lab = {X E X* I 1ZJa = IZlb}. (3) ZnReS(L) 127
128
CHAPTER 6. INSERTIONS AND DELETIONS
I
= { E } for L = {anbn n 2 O } . (4) inRes(L1) = L1 and inRes(L2) = L1 for L1 = (a2)*and L2 = aL1. ( 5 ) inRes(L) = b* for L = b*ab*. ( 6 ) inRes(L) = L for L = aX*b.
For a commutative language, we have the following result.
Proposition 6.1.1 Let L G X * . Then inRes(L) as a submonoid of X " . Moreover, af L as a commutative language, then inRes(L) is
also a commutative language. Proof Let 2 , y E inRes(L) and let u = ulu2 E L. Then ulxu2 E L and hence ulzyu2 E L . Therefore, xy E inRes(L). Since E E inRes(L),inRes(L)is a monoid. To prove that inRes(L) is commutative, it is enough t o show that xuvy E inRes(L) implies xwuy E inRes(L). If w E L and w = w1w2, then wlxuvyw2 E L and hence wlxvuyw2 E L. Therefore, xvuy E inRes(L). Now recall the notion of insertion. Let L1, L2 be two languages over X . The insertion of L2 into L1 is defined as: L1 D L2 = {ulvu2 I Ulu2 E L2,v E L1}. The iterated insertion can also be defined as follows:
u (L1 m
L1 D* L2 =
Dn L2)
n=O
where L1 DoL2 = L1 and L1 DZ+' L2 = L1 D (L1 DZ L2) For any z 2 0.
Lemma 6.1.1 Let L inRes( L ) .
5 X * and let u , u E inRes(L). Then w D* u C
Proof Let w E (v D* u ) . There exists k 2 0 such that w E (uD'u). We will show, by the induction on k , that w E inRes(L). If k = 0, then w = v E inRes(L). Assume the assertion holds true for k and take w E (v D ' + ~ u) and z = zlz2 E L . Then w = wlvw2 where w1w2 E (v D'u) 5 inRes(L). Consequently, zlwlw2z2 E L . This, together with the fact that v E inRes(L) imply that z1w1vw2z2 E L. Since z = zlz2 was an arbitrary word in L , we deduce that w E inRes(L ) .
6.1. INSERTION CLOSURES Proposition 6.1.2 Let L ( i n R e s ( L ) )= i n R e s ( L ) .
129
CX*.
Then we have inRes2(L)= inRes
Proof Assume u E inRes(inRes(L)). As E E inRes(L), we have u = EU E i n R e s ( L ) ,i.e. inRes(inRes(L)) inRes(L). Assume now that w E inRes(L). Let u = u1u2 E inRes(L). Consider u1vu2 i n X * . Obviously, v1uv2 E v D* u. By Lemma 6.1.1, ulvuz E inRes(L) and hence v E inRes(inRes(L)),i.e. inRes(L) E inRes(inRes(L)). Proposition 6.1.3 If a language L is regular, then inRes(L) is reg-
ular.
. zuy E inRes(L) Proof Let u,w E X* and let u = ~ ( P L )Assume for x , y E X * . Let w = wlw2 E L. Then w l z u y w ~ E L and hence wlxvyw2 E L . Thus m y E inRes(L). Symmetrically, xvy E i n R e s ( L )implies m y E inRes(L). This means that u = ' u ( P ~ ~ ~ ~ ~ Consequently, the number of congruence classes of PinRes(L) is finite and hence inRes(L) is regular. A language L such that L C inRes(L) is called insertion closed (or in short, ins-closed). A language L is ins-closed if and only if u = u1u2 E L and v E L imply u1vu2 E L. Consequently, every ins-closed language is a subsemigroup of X*. Notice that a language L is ins-closed if and only if L D L C_ L , and hence L D *L C L . Therefore, L D *L is an ins-closed language f9r any language L G X * and L D* L is the smallest ins-closed language containing L , which is called the inserttion closure of L . Theorem 6.1.1 Let
1x1 2 2.
Then we have: (i) If L is context-free, then the insertion closure of L is context-free. (ii) If L is regular, then the insertion closure of L is not always regular.
Proof (i) Let L 2 X* be context-free and let G = ( V , X , P , S ) be a context-free grammar with L = C(G). Moreover, let p(A) = A for any A E V and p(a) = [a]for any a E X U { E } . Now we construct the context-free grammar = X,P , S) a s follows: (1) = V U = { A -+ P(&(Q12) -P(%) I (A {[a1 I a E u (2) ~ 1 ~ 2. a k. ). E P } u { [ a ] [ .IS, [u]-+ S[a]I a E X u { E } } u { [ u ]--+ a
x
w.
-+
(v,
--+
CHAPTER 6. INSERTIONS AND DELETIONS
130
Ia
E X U
{E}}. Then it can be easily verified that the grammar
G generates the insertion closure of L . Consequently, the insertion closure of L is context-free. (ii) Let X = { a , b, . . .} and let L = {ab}. Then L is regular. However, since ( LD* L ) n a f b + = { an b I.211, the insertion closure of L is not regular. Remark 6.1.1 Let L be a context-free language which is accepted by a pushdown acceptor A . Making use of A, we can construct the pushdown acceptor which accepts the insertion closure of L. We leave this problem to the readers.
6.2
Deletion closures
We start this section with providing some operations on words and languages. Definition 6.2.1 Let u , v E X * . Then u --+ w = {u1u2 I u = ~ 1 2 1 ~ 2is) called the deletion of Y from u. For languages L1, L2 C X * , L1 L2 = { U ~ U ZE X * 1 u1vu2 E L1,v E L2) is called the deletion of L2 from L1. Moreover, we can define the iterated deletion
-
n(L1 n=O 00
of L2 from L1 as follows: L1* .
L2 =
,
L1 --+O L2 = L1 and L1 i 2 0. For u , v E X * , u -*
Lp = (L1 -iZ L2) v means {u} -* {v}.
-Z+l
-
L2) where L2 for any
Proposition 6.2.1 The deletion of a regular language from a regular language is regular.
Proof Let L , K C X * be regular languages. Let A = ( S ,X,6, so, F ) and B = ( T ,X , y,to, G ) be finite acceptors such that I ( A )= L and l(B)= K , respectively. Moreover, let X’ = {a’ I a E X } . Consider the following finite acceptors A’ = ( S ,X U X I , 6’,so, F ) and B‘= ( T ,X U X‘, y’,t o , G): (1)saA‘ = salA’ = saA for any s E S and any a E X . (2) taB‘ = t for any t E T and any a E X , and talB‘ = t a B for any t E T and any a’ E X’. Let p be the following homomorphism of ( X U XI)* onto X * : p ( a ) = a and p(a’) = E for any a E X .
6.2. DELETION CLOSURES
-
131
Now we prove that p ( I ( A ’ )fl I ( B ’ )fl X * X ’ * X * ) = L K. Let u E p ( l ( A ’ ) n I ( B ’ ) n X * X ’ * X * )Then . there exist v‘ E XI* and u1,u2 E X * such that u = p(ulv’u2) = u1u2 and ulv’u2 E I ( A ’ )n ‘T(I3’).Let t9 be the homomorphism of ( X U XI)* onto X * such that @ ( a )= O(a’) = a for any a E X . Thus ult9(v’)u2 E I ( A )= L and e(v’) E I ( B ) .Hence u = 2112~2E L K. On the other hand, let u = ulu2 E L K . Then there exists v E X * such that u1vu2 E L and v E K . Hence there exists v’ E XI* such that v = 8(v’). Consequently, ~ 1 2 1 ’ 2 ~ E 2 I ( A ’ )fl I(B’) fl X * X ’ * X * . This means that u = ulu2 = p(ulv’u2) E p ( I ( A ’ )n I ( B ’ )fl X * X ’ * X * ) ,i.e. p ( I ( A ‘ )n I ( B ’ )n X * X ’ * X * ) = L ---t K . Since I ( A ’ )fl I ( B ’ )n X*X’*X* is regular, L K is regular. --f
--f
-
It is noticed that the above proposition does not hold for contextfree languages. For instance, let X = { a , b, c, d } , let L = {anbncmdm I n, m 1 l} and let K = {bkcc“1 k 2 1). By the iteration property for context-free languages, L K = {anbn-kcm-kdm I n,m L k 1 1} is not context-free though L and K are context-free.
-
Let L X * and let Sub(L) = {u E X * I xuy E L } , i.e. Sub(L) is the set of the subwords of the words in L. Then, by deZ(L) we denote the following language: del(L) = {z E Sub(L) 1 for any u E L , u = ulzzl2 implies u1u2 E L } .
Example 6.2.1 Let X = {a,b}. Then (1) d e l ( X * ) = X * . ( 2 ) del(L,b) = Lab where Lab = { U E X * I IuIa = Iulb}. (3) deZ(L) = L for L = {anbn I n 2 0). (4)deZ(L) = b* for L = b*ab*. Proposition 6.2.2 Let L C X * . Then we have: (i) If 2 , y E deZ(L) and xy E Sub(L), then xy E del(L). (ii) If Sub(L) is a submonoid of X * , then del(L) is a submonoid of X * . (iii) If L is a commutative language, then del ( L ) is also commutative. Proof (i) Let z, y E deZ(L) with zy E Sub(L). If u = u1zyu2 E L, then u1yu2 E L and consequently ulu2 E L. Therefore zy E del(L). (ii) Let z, y E deZ(L). Then z, y E Sub(L) and zy E Sub(L). By (i), zy E deZ(L). Since E E deZ(L),deZ(L) is a submonoid of X * .
132
CHAPTER 6. INSERTIONS AND DELETIONS
(iii) It is enough to show that xuvy E del(L) implies xvuy E del(L). Since L is commutative, ulxuvyu2 E L if and only if ulxvuyu2 E L. As xuvy Edel(L),we have ulu2 E L. This implies that xvuy E del(L) as well.
A language L is called deletion closed (or in short, del-closed) if w E L and ulvu2 E L imply u1u2 E L. For example, X* and Lab are del-closed languages that are also ins-closed. Notice that both languages are submonoids of X*. The notion of a del-closed language is strongly connected t o the operations of deletion and iterated deletion. Notice that a language L G X * is del-closed if and only if L L L.
-
-
Proposition 6.2.3 Let L C X* be an ins-closed language. Then L is del-closed af and only af L = L L.
-
Proof (+) Since L is del-closed, L + L G L. Now let u E L. Since L is ins-closed, uu E L. Therefore u E L L , i.e. L G L --i L . Hence L = L -+ L. (+) Since L L C L , L is del-closed.
-
If L is a nonempty language and if DL is the family of all delclosed languages Li containing L , then the language
n Li
Li E D L
is a del-closed language called the deletion closure (or in short, delclosure) of L. The del-closure of L is the smallest del-closed language containing L. We will now define a sequences of languages whose union is the del-closure of a given language L.
Do(L) = L
6.2. DELETION CLOSURES
133
... Clearly Dk ( L ) 2 Dk+l ( L ). Let
Proposition 6.2.4 D ( L ) is the del-closure of the language L .
Proof Clearly L D ( L ) . Let 'u E D ( L ) and ulvu2 E D ( L ) . Then E D i ( L ) and ulvu2 E D j ( L ) for some integers i , j 2 0. If k = m a z { i , j } , then 'u E Dk(L) and u1vu2 E D k ( L ) . This implies ulu2 E Dk+1 ( L ) 2 D ( L ). Therefore D ( L )is a del-closed language containing
'u
L.
Let M be a del-closed Ianguage containing L = Do(L). Since M is del-closed, if D k ( L ) C M then Dk+l(L) C M . Hence D i ( L ) M for any i 2 1. Thus D ( L ) 2 M and D ( L ) is the del-closure of L . For the class of regular languages, we have the following result. Theorem 6.2.1 If L
X * is regular, then D ( L ) is regular.
Proof First, consider the case 1x1 = 1, i.e. X = { u } . If L is finite, then D ( L ) is finite and hence regular. Assume L is infinite. Let an E L for some n 2 1. Let M = {ai J 0 5 i 5 n, Jui(an)*n L J= co}. Then it can be seen that D ( L ) = M(an)*U F where F X * is finite. Consequently, D ( L ) is regular. Now consider the case 2 2. We can assume that a regular language L C X * contains the empty word without loss of generality. Let A = (S,X , 6, SO, F ) be a nondeterministic acceptor accepting L , i.e. Do(L). For any ( t , u ) E S x X , let & ( t , a ) = 6 ( t , a )U { q E S I 3 p E d ( t , a ) , 3u E L, q E 6 ( p ,u)}.Moreover, let 5'1 = SOU { q E S I 3 p E S0,3u E L , q E 6 ( p , u ) } . Now let A1 = ( S , X , 6 1 ,S1, F ) . Then A1 can be effectively constructed and D1(L) G T(A1) D ( L ) where T(A1)is the language accepted by A1. In the same way, we can construct a nondeterministic acceptor A 2 with the same state set S
c
1x1
c
CHAPTER 6. INSERTIONS AND DELETIONS
134
such that D2(L) 5 T(A2) E D ( L ) . Continuing the same procedure, for any n 1 3 we can construct a nondeterministic acceptor A, with the state set S such that D,(L) 5 I ( A , ) C D ( L ) . By the finiteness of S , this procedure stops after a finite number of steps m and we have D m ( L ) = I ( A , ) = D ( L ) . This means that D ( L ) is regular. However, for the class of context-free languages, the situation is different. Before describing the situation, we provide the notion of codes though at the moment we need only the notion of infix codes.
C X + be a language over X . Moreover, let u1,u2,. . . ,u,, . . . ,us E C where r and s are positive integers. If u1u2 . . . u, = 211212 . us implies that r = s and u i = wi for any i = 1 , 2 , . . . , r , then C is called a code over X . A typical code is a prefix (sufflx) code. A code C C X + is called a prefix code (sufiia: code) if u,uw E C (u, wu E C) implies that w = c , i.e. C n C X + # 0 (C n X+G # 0). A code C X + is called a bifix code if C is a prefix code and at the same time a suffix code. A code C E X+ is called a maximal code if C U {u}is not a code for any u E X + \ C. In the same way, a prefix (suffix) code C C X+ is called a maximal prefix code (maximal s u f i x code) if C U {u}is not a prefix (suffix) code for any u E X + \ C. It Let C
111,212,
e
is well known that a maximal prefix (suffix) code is a maximal code. Moreover, a prefix (suffix) code C C X + is maximal if and only if u E C X * (uE X*C)or C n d * # 0 (CnX*u# 0) for any u E X * . Let C C X + . Then C is called an infix code if w,uww E C implies that uw = E . It is obvious that an i n k code is a bifix code and hence a code.
1x1
Proposition 6.2.5 If >_ 2, then there exists a context-free language L C X* such that D ( L ) is not context-free.
1x1
Proof First, assume 2 4. Let X = {$, a,b, c, . . .}. Consider the following language: L = {$ai1cb2i~aizcb2iz . . . aikcb2ak$ I k 1 l , i t >_ 1,1 5 t 5 k } U {ba}. Since the set {$u$I u E ( X \ {$})*} is an i n k code [65], D ( L ) = L +* {ba} and hence D ( L ) n $ac+b+$ = {$ackb2k$ 1 k 2 I}. Therefore, D ( L ) is not context-free though L is context-free.
6.3. INS-CLOSED A N D DEL-CLOSED LANGUAGES
135
For the general case, i.e. X = { a , b, . . ,}, consider the following coding for the letters $, a,b and c in the above: $ bbbbb, a + abaaa, b -+ abbaa, c -+ abbba. Moreover, consider the following language: M = { (bbbbb)(abaaa)i1(abbba)(abbaa)2i~(abaaa)i2(abbba) (abbaa)2i2... (abaaa)ik(abbba)(abbaa)2ik(bbbbb) 1 k 2 l,ii 2 1, t = 1 , 2 , . . . , k} U { (abbaa)(abaaa)}. Then {(bbbbb)u(bbbbb) 1 u E {abaaa, abbaa, abbba}*} becomes an infix code over X. On the other hand, since {(abbaa)(abaaa)} does not contain any word in the language {(bbbbb)u(bbbbb)1 u E {abaaa, ab baa,abbba}+} as a subword, D(A4) = ( M +* {(abbaa)(abaaa)}). Moreover, since (abbaa)(abaaa) can be found only at the position between the suffix of (abbaa)Z and the prefix of (abaaa)j, D ( M ) n (bbbbb)(abaaa)(abbba)+(abbaa)+(bbbbb) = { (bbbbb)(abaaa)(abbba)k(ab baa)2k(bbbbb)1 k 2 l } . Therefore, D ( M ) is not context-free though M is context-free. ---f
Ins-closed and del-closed languages
6.3
ins-closed language and let J = ( L \ Then L \ { E } = J D* J and J is called the insertion base (or in short, ins-base) of L.
C X* be a nontrivial \ ( ( L\ { E } ) D ( L \ { E } ) ) .
Let L {E})
The following result shows that if L is regular, its ins-base is also regular.
Proposition 6.3.1 If L is a regular ins-closed language, then its ins-base J is a regular language. Proof Since L is regular, J = ( L \ regular.
{E})
\ ( ( L\ { E } )
D
( L \ { E } ) ) is
The ins-base of a regular ins-closed language can be an infinite language. For example, L = ba*bD*ba*b = {bzb I x E X*, (z1b is even} is regular and ins-closed but J contains the infinite set ba*b. If we put the additional constraint that L is del-closed, the ins-base will always be finite, as will be shown by Proposition 6.3.3.
136
C H A P T E R 6. INSERTIONS A N D DELETIONS
G X* be a regular language. If L is insclosed and del-closed, then the minimal set of generators K of L , i.e. K = (L\{c})\(L\{E})~ is a regular maximal code over alph(L). I n fact, K is a maximal prefix code and a maximal sufix code over alph(L ) .
Proposition 6.3.2 Let L
Proof Since K = (L\{E})\(L\{E})~, K is regular. Moreover, since L is del-closed, K is a bifix code. Now we prove that K is a maximal prefix (suffix) code over alph(L). Let a E alph(L). Then uav E L for some u,u E alph(L)*. Therefore, un(au)n E L for any n > 1. We take an enough big integer as n, e.g. n > (SIwhere S is the set of states of a finite acceptor accepting L. Then there exists i = 1 , 2 , .. . , I S1 such that un+i(au)n E L . On the other hand, u ~ ( u v E ) ~L . Since L is del-closed, uz E L . As ua E L , we have (av)Z E L , i.e. aw E L where w = (va)Z-'v. In the same way as above, there exists a positive integer i, such that aaaE L . Let now z E X + . . Then z = a l a 2 . . . a , where ai E X , i = . 1 , 2 , . . . ,r . Let H = {a?, a:, . . . ,a?} G L. Obviously, z y = alap . a,y E ( H D* H ) C L for some y E X*. This means that K is a maximal prefix code. The proof that K is a maximal suffix code over alph(L) can be done in the same way. Hence K is a maximal bifix code over alph(L) as well. + .
In the above proof, the condition of regularity is necessary. Remark 6.3.1 Let X = {a,b} and let L = (ab D* ab) U { E } . Then L is ins-closed and del-closed. Moreover, K is a b i k code. But K is not a maximal bifix code over {a, b} since {ba} U K is a bifix code where K is the minimal set of generators of L.
The converse of the above proposition does not hold. Remark 6.3.2 Let X = { a , b } and let L = {a2}U{b2}Uab+aUbafb. Then L is a regular maximal b i k code over { a , b}. But L* is not ins-closed since ab(aba)a = ababaa $ L* though aba E L . Lemma 6.3.1 Let L X*be a regular language that is ins-closed and del-closed. Then there exists a positive integer n such that for every u E X+ we have un E L.
6.4. COMBINATION OF OPERATIONS
137
Proof Since the minimal set of generators of L is a maximal prefix code, for any u E alph(L)+there exists y E X*such that uy E L. Let p 2 1 be an integer. Then u p y p E L. In the same way as in the proof of Proposition 6.3.2, ui E L for some positive integer i 5 I S 1 where S is the set of states of a finite acceptor accepting L. Let n = ISI!. Then un E L.
Proposition 6.3.3 Let L C X* be a regular language that is insclosed and del-closed. Let J be the ins-base of L . Then J as finite. Proof Suppose J is infinite. Then by the iteration property for a regular language, there exist u , v , w E alph(L)+ such that uvw E J and uv*w L. Hence uw E L. By Lemma 6.3.1, there exists n, n 2 1 such that zn E L for any z E alph(L)*. Since L is ins-closed, U V ( U ~ - ~ W ~ - ~=) W uvun-'wn E L . From the assumption that L is del-closed, it follows that uvun-l E L. On the other hand, since un E L , U ~ - ~ ( U V U ~ - ~=) unuun U E L. By the assumption that L is del-closed, v E L. However, this contradicts the assumption that uuw E J . Therefore, J must be finite.
6.4
Combination of operations
In this section, we will combine the operations on languages. The main result is due to [44]. First we consider inRes(u D* u)for u E
X+.
Lemma 6.4.1 Let u, v E X+ and let v E in&s(UD*U). If 1u) = lvl, then there exists p E X+ such that u, u E pX*. Proof Obviously, the lemma holds if u = v. Now let u # 'u. Since vu 6 inRes(u D* u ) and u # v, there exist p , q E X+ such that u = p q , uu = puq. Hence u , v E p X * .
For u E X * , we define Int(u) as follows: Int(e) = E and Int(au') E X and u' E X * . Let u E X+ and let i 1 1. Then we define u ( i ) = a if u = u'au", u', u" E X * , a E X and (u'a( = i. = a if a
138
CHAPTER 6. INSERTIONS A N D DELETIONS
Remark 6.4.1 Let u,v E X+ and let v E i n R e s ( u D * U ) . If Iu( =1.1 and u # v, then there exists p E X+ such that u = pu’, v = pv’ and Int (u’) # Int( 21’). Proposition 6.4.1 Let u,v E X + and v E i n R e s ( u D* u ) . If 1uI = (v(,then u = v. Proof Suppose u # v. By Remark 6.4.1, u = pu‘,v = pv‘ and Int(u’) # Int(v’) where p E X+ and u‘,v‘ E X*. Case A p = aibp’,i 1 1,a , b E X , a # b and p’ E X * . Consider w = aiaibp‘v‘bp‘u‘ E u D* u. Then w = auP where ap = u and la1 5 IuI. Since u E aibX*, IaI 5 i. If (a1 = i, then u = v , which is a contradiction. Therefore, 1.11 5 i - 1. In this case, aaibp‘u’P = aiaibp’v‘bp’u‘. Then (aaibp’u’p)( la1 + i + 1) = b. On the other hand, (aiaibp’v’bp’u’)((al + i + 1)= a , which is a contradiction. Case B p = aa,a E X and i 2 1. In this case, u = a i d and v = a i d . Case B-1 Int(v’) = c # a. Let v = aicv”. Since aicv“aiu‘ E u D* u,aicv”aiu’ = a(a2u’)P where (UP = a i d . As Int(u’) # Int(v’) = C , 101 5 i . If IQJ = 0, then u = v, which is a contradiction. Hence 1 5 la1 5 i and a E a+. Consequently, (aaiu’P)(i+l) = a. On the other hand, (aicv”aiu’)(i+ 1) = c. This means that a = c, which is a contradiction. Case B-2 Int(v‘) = a. Let Int(u’) = b and let u = aabu”. Then a # b. Let v = i+ . 1 ,,,I/ . Since aiaiflv”bu“ = a(aibu”)P where ap = aibu”. Obviously, la]5 i. However, in this case, (aaibu”P)(lal + i + 1) = b and (aiai+lv’’bu’’)(lal + i + 1) = a , which is a contradiction. Consequently, u = v. Conjecture
Let u E
X+. Then i n R e s ( u D* u)= u D* u.
A word u E X + is called an overlapping word if u = ow = for some a, P, w E X + .
wp
Lemma 6.4.2 Let u E X + . If au = UP holds f o r some a,P E X+ with ( a / , 5 lul - 1, then u is an overlapping word.
6.4. COMBINATION OF OPERATIONS
139
Proof Let y E X+ be a word such that u = yj3. Then u = ay. Consequently, u = a y = yp. This means that u is an overlapping word. Proposition 6.4.2 Let u E X+. If u is not an overlapping word, then inRes(u D* u)= u D* u.
Proof Notice that u D* u inRes(u D* u).Hence it is enough to show that 'u E u D* u if v E inRes(u D* u ) . Suppose v $! u D* u. Since vu E u D* u, there exist a , p,w E Xf such that 5 Ju1- 1, w E ( v -+* u ) ,wu = aup and E E (ap -+* u ) . Let w = awl. Then w' # E and w'u = up. By Lemma 6.4.2, u is an overlapping word, which is a contradiction. Hence v E u D* u. It is unknown whether inRes(u D* u ) = u D* u holds for any
uE
x*.
This page intentionally left blank
Chapter 7
Shuffles and Scattered Deletions In this chapter, we will focus mainly the introducuction of the notion of shuffle residual of a language and discuss its properties and characterizations. The chapter will be organized as follows: In Section 7.1, the notion of shuffle residual of a language is defined. Some properties of the shuffle residual of a language are described, as well as a characterization of the shuffle residual of a given language. We will also charactarize the shuffle closure of a language. In Section 7.2, we will provide several conditions for the existence of maximal languages whose shuffle residual equals a given language. A generalization of the notion of shuffle residual of a language will also be introduced. In Sections 7 . 3 , we will deal with the scattered deletion operation of a language. The contents of this chapter are based on the results in [41] and 1441.
7.1
Shuffie residuals and closures
We will start this section with the definition of the shuffle residual of a language. Let L C X* be a language over X. Then the shufle residual of L (denoted by shRes(L)) is defined by: 141
142 CHAPTER 7. SHUFFLES AND SCATTERED DELETIONS
shRes(L) = {x E X* 1 Vu E L , u o x
L}.
Example 7.1.1 Let X = { a , b}. Then we have: (1) shRes(X*) = X*. (2) shRes(L,b) = Lab. (3) shRes(L) = { E } for L = {unbn I n 2 0). (4) shRes(L1) = L1 and shRes(L2) = L1 for L1 = (a2)*and Lz = aL1. ( 5 ) shRes(L) = b* for L = b*ab*. ( 6 ) shRes(L) = L for L = aX*b. The following results provide some basic properties of the shuffle residual of a language.
Proposition 7.1.1 shRes(M)oshRes(N)c shRes(MoN) and shRes ( M )n shRes(N) c shRes(M U N ) . Proof Let u E shRes(M)o shRes(N). This means that there exist m E shRes(M) and n E shRes(N) such that u E m o n. Since the shuffle operation is commutative, we have
( M o N ) o ( m o n )= ( M o r n ) o ( N o n )L M o N . Notice that the equality does not always hold. For example, let X = { a , b } , M = ab* and N = ba*. Then shRes(M) = { E } = shRes(N). On the other hand, M o N = {u E X* I IuI, 2 1, lUlb 2 l} and hence shRes(M o N ) = X*. Now we prove that s h R e s ( M ) n s h R e s ( N )2 s h R e s ( M U N ) . Let u E shRes(M) f l shRes(N). The fact that u E shRes(M) implies that M o u G M . The fact that u E shRes(N)implies that N o u G N . Consequently we have ( M U N ) o uC M U N . Thus u E shRes(MUN), i.e. shRes(M n N ) C ( M u N ) . Notice that the equality does not always hold. For example, if M = ( X 2 ) *and N = X ( X 2 ) * then shRes(M) = shRes(N) = M , but shRes(M U N ) = X * .
Proposition 7.1.2 Let L C X * . Then shRes(L) is closed under shufle. Moreover, shRes(L) i s a submonoid of X * . If L is commutative, then shRes(L ) is also commutative.
Proof Let x,y E shRes(L) and u E L. Then u o x G L and consequently (uox)oyC_ L. As shuffle is associative, we have uo(xoy) C_ L ,
7.1. SHUFFLE RESIDUALS AND CLOSURES
143
i.e. x o y C shRes(L). This implies that shRes(L) is closed under shuffle. In particular, zy E z o y belongs to shRes(L). Since E E shRes(L), shRes(L) is a monoid. Now assume L is commutative. Let xuvy E shRes(L) for x,u,v,y E X*.Then zuvy o w & L for any w E L. As L is commutative, xvuy o w L and hence zvuy E shRes(L). This means that shRes(L) is commutative. In the following we will provide some properties of shRes(L) and characterize shRes(L) for a given language L. We begin by defining the iterated shufle operation as:
u cx)
L1 o* L2 =
(L1 on L2),
n=O
where L1 oo L2 = L1 and L1 on+' L2 = (L1 on L2) o L2.
Lemma 7.1.1 Let L shRes(L ) .
C X* and let u,v E shRes(L). Then v o* u C
Proof Let w v o* u. There exists lc 2 0 such that w E v ok u. We will show, by the induction on lc, that w E shRes(L). If lc = 0, then w = v E shRes(L). Assume the assertion holds true for k and take w E v ok u. Then w E Q o u where Q E v ok u. According to the induction hypothesis, v ok u C shRes(L). Therefore, Q E shRes(L). By a,uE shRes(L) and by Proposition 7.1.2, we have Q O U 2 shRes(L). This implies w E shRes(L). Proposition 7.1.3 Let L
X'. Then we have shRes2(L)= shRes
( s h R e s ( L ) )= shRes(L). Proof Assume u E shRes(shRes(L)). As E E shRes(L), we have u = E o u E shRes(L),i.e. shRes(shRes(L))C_ shRes(L). Now let u E shRes(L) and let E shRes(L). Obviously, v o u E v o* u. By Lemma 7.1.1, v o* u shRes(L) and hence u E shRes(shRes(L)), i.e. shRes(L) C shRes(shRes(L)). This completes the proof of the proposition. We will show that the shuffle residual of a regular langusge is regular.
144 CHAPTER 7. SHUFFLES AND SCATTERED DELETIONS
Lemma 7.1.2 Let L 2 X * . Then we have shRes(L) o L = L .
Proof By the definition of shRes(L), shRes(L) o L 2 L. Since shRes(L) is a monoid, E E shRes(L) and hence L C shRes(L) o L. Thus shRes(L)o L = L. Proposition 7.1.4 If a language L is regular, then shRes(L) is regular and can be eflectively constructed.
Proof By Lemma 7.1.2, shRes(L)o L = L . Therefore, shRes(L) is a solution of the language equation K o L = L. From Lemma 4.5.1 and proposition 4.5.1, it follows that shRes(L) is regular and can be effectively constructed.
A language L such that L C shRes(L) is called shufJEe closed (or in short, sh-closed). A language L is sh-closed if and only if u E L and v E L imply u o u 2 L. As a consequence, every sh-closed language is a submonoid of X*.Notice that a language L is sh-closed if and only if L o L L. In general, submonoids of X * are not sh-closed. For example, let X = {a,b,c} and let L = (a(bc)*)*.Then L is a submonoid that is not sh-closed, because a,abc E L , but abac @ L. Proposition 7.1.5 shRes(L) = L if and only if L is sh-closed and E E L.
Proof (+) Notice that L o L = shRes(L) o L 2 L. Hence L is sh-closed. (+) If L is sh-closed, then L 2 shRes(L). Let u E shRes(L). Sonce E E L , u = c o u E L. Thus shRes(L) = L. Let L X*.Then it is obvious that Lo (= Lo* L ) is the smallest sh-closed language containing L . This language is called the shufle closure of L and denoted by sfc(L). Notice that, if L is a regular (context-free) language, then sfc(L) is not in general a regular (context-free) language. For example, let X = {a,b, c } and let L = {abc}. Then s f c ( L )n a+b+c+ = {anbncn 1 n 2 l} which is not a context-free language though L is finite. Recall that we dealt with shuffle closurse of commutative regular languages.
7.2. MAXIMAL SHUFFLE RESIDUALS
7.2
145
Maximal shuffle residuals
In this section, we will provide conditions for the existence of maximal languages whose shuffle residual equals a given language, as well as a generalization of the notion of shuffle residual. Let L E X * be an sh-closed language with E E L. By M x ( L ) , we denote the set {MC_X*I shRes(M) = L and M is maximal in the sense of inclusion relation}.
Definition 7.2.1 An sh-closed language L C X* is said to be an RSS-type language if it contains a regular ssh-closed language Lo with aZph(L) = alph(L0). Proposition 7.2.1 An sh-closed language L X* is an RSS-type language if and only iJ for any a E alph(L),a+ n L # 0.
Proof (+) Let a E aZph(L). Then a E alph(L0). Since Lo is an ssh-closed language, by Proposition 5.2.4, a+ n LO # 8 and hence U+ n L # 0. (e) Let alph(L) = { a l ,a2, ...,a,} and let pi be a positive integer such that up' E L for any i, 1 _< i 5 n. Moreover, let Lo = (a:')* o (a;')* o ... o (up)*.Then Lo C_ L and LO is a regular ssh-closed language. In what follows, L E X * is assumed to be an RSS-type language containing a regular ssh-closed language Lo with alph(L) = alph(Lo). Lemma 7.2.1 Let M C X * with shRes(M) = L . Then M can be represented as M = UiE1(aioLo)where 'ui E X * , i E I and I is some index set.
Proof Obvious from the fact Lo o M
= A4
Lemma 7.2.2 Let M C_ X * with shRes(M) = L . If alph(L) = X , then there exists a positive integer p satisfying the following condition: For any u E X * , there exists ,B E X* such that I,BI 5 p and u E p 0 Lo.
146 CHAPTER 7. SHUFFLES AND SCATTERED DELETIONS
Proof Let X = { a l ,a2, ...,a,}. Since LO is ssh-closed, for any i = 1 , 2 , . . . , n, there exists a positive integer pi such that (a?)* C LO. Now let u E X * . Then u E u’o (a:’)* o (uy)* o ... o (a?)* where 05 < pi for any i = 1 , 2 , . . . ,n. Let p = C:=“=,pi - 1). Then u E u’ o LO and lu’l 5 p. Definition 7.2.2 By Cb, we denote the set ,B o Lo. Lemma 7.2.3 Let u , v E c b and let u
v. Then v o Lo C u o LO.
Proof First, v H u # 8. Since u , v E C p and Lo is commutative, we have v H u C Lo. Hence v E uoL0. Therefore, VOLO5 (uoL0)oLo = u o Lo. Proposition 7.2.2 Assume that aZph(L) = X . Let M 5 X* with shRes(M) = L . Then A4 as regular.
Proof Let A4 = UiEI(ai o LO).Then by Lemma 7.2.2, there exists a positive integer q and ,Bj E X * ,j = 1 , 2 , . . . , q such that {ai I i E I } = UjE{1,2 ,,,,,q}(,Bj o LO). Let Dj = Cpj n {ai 1 i E I } for any j = 1,2, . . . , q . Notice that each Dj contains a maximal hypercode H~ in D ~ .Let H; = { u E D~ 3v E H ~ , U v> for any j = 1 , 2 , .. . , q and let E = U j E { ,,,, l q } H j . Notice that E C {ai I i E I } and E is finite. Let a E (ai1 i E I } . Then there exists j = 1 , 2 , . . . ,q such that Q E Dj. By the definition of H j , Q E H j or ~k 5 h a for
sh
I
some a k E H;. In the former case, a o LO C E o LO. In the latter case, CY E a k o LO and hence Q o Lo a k o LO E o LO. Therefore, E o LO C UiEI(ai o L O ) E o Lo and A4 = E o Lo. Since E and LO are regular, A4 is regular.
c
Corollary 7.2.1 An RSS-type language is regular.
Proof
Since L = shRes(M) and A4 is regular, L is regular.
Notice that, if aZph(L) C X, then the statement in Proposition 7.2.2 does not hold true. For instance, let M = L U (Un21(bn! o L ) ) where L is an RSS-type language and b E X \ uZph(L). Then shRes(M) = L but M is not regular.
7.2. MAXIMAL SHUFFLE RESIDUALS
147
Theorem 7.2.1 Assume alph(L) = X . Let M 5 X* with shRes(M) = L. Then there exists N 2 M such that N E M x ( L ) .
Proof Let M = Mo C M I c A42 C . . . be an ascending chain of languages such that shRes(Mi) = L for any i 2 0. Moreover, let Mi = UjGIi(aij o LO)for any i 2 0. From the same reason as in the proof of Proposition 7.2.2, it follows that {aij I i 2 0 , j E Ii} C_ UjE{1,2 )...,q } C&. Let Dk = c,, n {"ij 1 i 2 0 , j E Ii} for any k = 1 , 2 , . . . , q . Let HI,be a maximal hypercode in DI,,let H i = { u E DI, I 3v E H k , u Ih v} for any k = 1 , 2 , .. . ,q and let E = UkE(1,2,,,,,q } H i . Then E is finite. Suppose M = MO c M I c MZ c . is an infinite ascending chain. Since E is finite, there exists a positive integer r such that EoLo C Mr.Let ~ ( ~ E Mr+l ~ 1 \Mr. ) ~ In the same way as in the proof of Proposition 7.2.2, ~ ( , + lo) Lo ~ C_ E o Lo C_ Mr,which is a contradiction. Hence M = MO c M I c M2 c . . . is always a finite ascending chain. Consequently, N = Mr E M x ( L ) . +
The situation is completely different for the case alph(L) c X . Let alph(L) = Y c X and let Z = X\Y. Now let Z*= { Z O , z l , 22, ...} where zo = E and ( z i (5 (zi+1(for any i 2 0. Now suppose there exists M E M x ( L ) and M = Uil0(zi o Mi) where Mi C Y *for any i 2 0. Notice that shRes(Mi) 2 L for any i 2 0.
Lemma 7.2.4 Mi
# 0 for any i 2 0 .
Proof Suppose MO = 0. Consider N = M U L. It is obvious that N 3 M and shRes(N) 2 L. Since M E M x ( L ) , shRes(N) 3 L. Let z E shRes(N) \ L. Then there exists mi E zi o Mi,i 2 1 such that (mi o x) n L # 0. However, this is impossible because, for any u E L, lulz = 0 but, for any w E mi o x,1v(z L [mil2 2 1. Hence MO # 0. Now suppose Mi = 0 for some i 2 1. Consider N = M U (zio L ) . Obviously, N 3 M and shRes(N) 2 L. By the maximality of M , shRes(N) 3 L . Hence there exists 17: EshRes(N) \ L such that (x o M ) n (zio L ) # 0. This implies that 1x1~> 0. Now consider xlzil+l E shRes(N) \ L . Then there exists m E M such that (xlzil+lo m) n (zio L ) # 0. This yields a contradiction because, for any u E zi o L, IuJz= lzil but, for any v E zlzi1+' o m , IwJz>_ \zil+ 1. Hence Mi # 0 for any i 2 0.
148 CHAPTER 7. SHUFFLES AND SCATTERED DELETIONS Lemma 7.2.5 Let N = { i I i 2 0 , M i # Y * } . Then N is infinite.
Proof Suppose there exists a positive integer no such that, for any n 2 no,Mn = Y * . Consider z i E Z+. Obviously, z: o M M. Hence .z: E shRes(M), which is a contradiction. This completes the proof of the lemma. Now let Ki = shRes(Mi) for any i 2 0. Recall that Ki 2 L for any i 2 0.
ni20Ki. Obviously, L 5 ni20 Ki. Let z E ni20Ki. Since z E KO,zo
Lemma 7.2.6 L =
Proof Mo Mo. Therefore, Iz(z = 0 and (zi o Mi) o II: C (zio Mi) for any i 1 1. This implies that zo M C M , i.e. z E L . This completes the proof of the lemma.
Lemma 7.2.7 Let N = (Ui,o,i,k(zioM~))U(z~~Y*). Then shRes(N) =
ni20,i#k K.
ni20,i#k
Proof That Ki & shRes(N) is obvious. Let z E shRes(N). If 1x12 > 0, then zlz”J+l E shRes(N). Since z I ” ~ I + ~ oCNU i > k + l ( z i ~ Mi) and zkoMk C zkoY*, ~l”kl+loMC M , i.e. z l ” k l + l E shRes(M) = L , which is a contradiction. Hence 1x12 = 0. Since 1x1~= 0 , z o M i Mi for any i, k # i 1 0, i.e. x E Ki. This completes the proof of the lemma.
ni>o,i#k
Let A = {w E X* 1 3i 2 0 , w $! Ki,Vj # i , w E K j } . Notice that A = {w E X* I 3i 2 0 , w $! Ki,Vj # i, w o LO K j } . As the A proof of Proposition 7.2.2, there exists a finite set B with B such that, for any w E A there exists w’E B with w E w ‘ o LO.Now let w $! Ki and let w‘ $! Kj. Suppose i # j . Then w’E Ki and hence w E w’ o LO 5 Ki, which is a contradiction. Therefore, i = j . Let B = { w I , w ~..., , w,}. Moreover, for any i = 1 , 2 , . . . , T , we choose some integer f ( i ) such that wi $! K f ( i ) . Then the following is now obvious. Lemma 7.2.8 Let
Then
7.2. MAXIMAL SHUFFLE RESIDUALS Proposition 7.2.3 Let alph(L) = Y
cX.
149 Then M x ( L ) = 8.
Proof By Lemma 7.2.5, there exists a positive integer t such that Mt # Y* and t @ { f ( l ) , f ( 2 ) , , . . , f ( r ) } . Let u @ L. If u E A , then u@ K f ( i )and hence u @ Ki. If u @ A , then there exist at least two distinct integers i and j such that u @ KiUKj. Therefore, u $ Ki.Now let N = (UHi>o,i#t(zi o M i ) ) U (zt o Y * ) . Obviously, N 3 M . By Lemma 7.2.7, shkes(N) = Ki = L . This contradicts the maximality of M and hence M x T L ) = 8.
nlSil, ni20,iZt
ni,o,i#t
ni>o,i+t
We consider now similar questions for a generalization of the notion of shuffle residual. The shuffle residual of a language consists of the words x whose shuffle L o x is completely included in L . We can relax this condition by only requiring that at least one word from L o x belongs to L. The notion obtained in this way generalizes the notion of shuffle residual. More precisely, the generalized shufle residual of a language L , denoted by g-shRes(L) is defined as follows.
Definition 7.2.3 Let M 3y E M , (x o y) n M # S}.
X*. Then g-shRes(M) = {x E X* 1
The following results give some properties of the generalized shuffle residual of a language.
Proposition 7.2.4 If M is a semigroup, then the generalized shufle residual of M is a monoid. Proof It is obvious that E E M . Let x,y E g-shRes(M). Then there exist z1, z2 E M such that (x o z1) n M # 8 and ( y o 22) n M # 0. This implies that (xy o z1zz) n M # 8 , i.e. zy E g-shRes(M).
Proposition 7.2.5 If M is sh-closed, then g-shRes(M) is sh-closed. Proof If x,y E g-shRes(M) this means that there exist such that (x o 21) fl M # 8 and ( y o z2) n M # 8. Let z be a word in x o y. As z1 o z2 G M we have
which implies that
z1, z2 E
M
150 CHAPTER 7. SHUFFLES AND SCATTERED DELETIONS Proposition 7.2.6 If M ular.
C X* is regular, then g-shRes(M) is reg-
Proof Let M be a regular language accepted by a finite acceptor A = ( S ,X,6, SO, 8’).Denote by X = {GI a E X} and X = X U Consider the function 61 : S x X S defined by 61(s,a) = 6(s, a ) if a E X and & ( s ,5 ) = s if si E X. Consider another function 6 2 : S x S defined by 62(s,u ) = S(s, u ) if a E X and 62(s,a) = 6(s, u ) if si E X. Define now the acceptor
x-
x.
A = ( S ,X,&(so, so), u s , t)l s E F, t E F } ) where the transition function 8 : ( S x S ) x X by 8((s, t ) ,b) = (61(s,b ) , 6 2 ( t , b ) ) for b E X. Then we have
L(A)=
{Z E
z =~
X* I 3x2 E
{E}
-----+
S x S is defined
u x,332 E { E } u x,
l q 1 ~ 2 .y. Z. xnvn, 2 1 2 2
*
. . Z, E M ,
~ 1 ~ 1 x 2. .~x,yn 2 E M , where E = E } . Let p be the homorphism of X* into X* defined by p(a) = E if X and p ( 3 ) = a if si E Then it can be seen that g-shRes(M) = p ( L ( A ) )and hence gshRes(M) is regular.
aE
x.
By 4,we denote the set { L C X* 1 3M = L).
C X* with
g-shRes(M)
Remark 7.2.1 The following statement is not always true: For any L E 4 there exists a maximal M C X* such that g-shRes(M) = L.
Proof { E } E 4.Suppose that there exists a maximal M X* such that g-shRes(M) = { E } . Let a # M and let $ = M U { a } . It is obvious that { E } E g-shRes(G). Suppose that E # x # g-shRes(G). Since g-shRes(G) is a monoid, xn E g-shRes(M) for any n, n 2 1. Let n 2 1 such that n1x1 > IaI. Notice that ( M U { a } )o xn C M U a. However, since xn #g-shRes(M),there exists m E M such that om M . Hence (u E xn o m , but this contradicts the assumption 721x1 > la/. Therefore g-shRes(G) = { E } . This means that M is not maximal.
7.3. SCATTERED DELETION CLOSURE
7.3
151
Scattered deletion closure
First, we will define the scattered deletions of words and languages.
Definition 7.3.1 Let u,w E X * . Then u I--+ w = { u ~ u ~ . . . Iuu, = u1w1u2wz~~ ~ z L , ~ ,w , = ~11712.. ‘w,,r 2 1,u1, q ,. . . ,u,, w, E X * } is called the scattered deletion of Y from u. For languages L1, Lz G X * , the language UuEL1,2iEL2 u H w is called the scattered deletion of Lz from L1. The following fundamental result is due to [54].
Proposition 7.3.1 The scattered deletion of a regular language from a regular language is regu1n.r. Proof Let L , K C X * be regular languages. Let A = (S,X , 6, so, F ) and B = ( T ,X , y,to, G ) be finite acceptors such that 7 ( A )= L and 7 ( B )= K , respectively. Moreover, let X’ = {a’I a E X}. Consider the following finite acceptors A’ = (S,X U X’, b’, so, F ) and B’ = ( T ,X U X ‘ , y’,t o , G ) : (1) saA’ = sa / A ‘ - ,aA for any s E S and any a E X . ( 2 ) taB‘ = t for any t E T and any a E X , and talB’ = t a B for any t E T and any a’E X‘. Let p be the following homomorphism of (X U X’)* onto X * : E for any a E X. By the similar way in the proof of Proposition 6.2.1, it can be verified that p ( 7 ( A ’ n ) 7(B’n ) ( X u X I ) * )= L K . Since 7 ( A ’ )n I(@)n ( X u XI)* is regular, L H K is regular.
p ( a ) = a and p(a’) =
-
As in the case of deletion, the above proposition does not hold for context-free languages. We can take the same example, i.e. let X = { a , b , c , d } , let L = {anbncmdm 1 n , m 2 l} and let K = {bkck 1 k 2 1). Then L I+ K = {anbn-k~m-kdm 1 n,m 2 k 2 l} is not context- free. Let L C X*. Then the set of sparse subwords s p s ( L ) of L is defined as follows: sps(L) z { u E X * I u = al . . . U k and there exist wi E X * ,i = 1,2,. . . , k + 1 such that vlalw2a2~.~ wkakwk+l E L}.
152 CHAPTER 7. SHUFFLES AND SCATTERED DELETIONS We also define the scattered deletion residual sdRes(L) of L as follows: sdRes(L) = {z E sps(L) 1 tru E L , u H z C_ L } . In the above, the condition that x E sps(L) has been added because otherwise sdRes(L) would contain irrelevant words which are not sparse subwords of any word of L and thus yield 8 as a result of the scattered deletion from L.
Example 7.3.1 Let X = { a , b } . Then (I) sdRes(X*)= X * . ( 2 ) sdRes(Lab) = Lab where Lab = { u E X * I Iu(, = I u l b } . (3) For L = {unbn 1 n 2 0 } , sdRes(L) = L. (4) For L = b*ab*, sdRes(L) = b*. The following proposition gives some basic properties of the scattered deletion residual of a language.
Proposition 7.3.2 Let L C_ X * . (i} If z,y E sdRes(L) and zy E sps(L), then xy E sdRes(L). (ii} If sps(L) is a submonoid of X * , then sdRes(L) is a submonoid of X * . (iii) If L is a commutative language, then sdRes(L) is also commutative.
Proof (i) Let z , y E sdRes(L) with xy ~ s p s ( L ) .If u E L, then u = u1z1u2x2 ' ' ' ~kxkuk+ly1uk+2y2' ' "&+kYnU,+k+l. Since X E sdRes(L), we have u1 . . . Uk+l'pl . . . ynun+k+l E L. Moreover, since y E sdRes(L), we can conclude that u1. . . U k . . u,+l~+~E L. As the initial decomposition of u was arbitrary, we deduce that u H zy L , which implies xy E sdRes(L). (ii) Immediate from (i). (iii) Let z = z 1 2 2 . . . x l ~E sdRes(L), z i E X * for 1 5 i 5 k. As z E sps(L) and L is commutative, Q-'Q(x) E sps(L) where Q is the Parikh mapping. Let y = y 1 y 2 . . . y k , yi E X , i 2 0 , be a word in *-'Q(Z) and let U = U l y l ...UkykUk+l E L , Ui E yi E x. AS L is commutative, the word u l z l . . ukXkUk+l is in L and, as z E sdRes(L), we have that u1 ' . . ukuk+l E L. This implies u t--f y 2 L , which means y E sdRes(L). +
x*,
In the following, we construct the set sdRes(L) for a given language L .
Proposition 7.3.3 If L is a language in X* then sdRes(L) = ( L H L')' n sps(L) where K C means X * \ K for K G X * .
7.3. SCATTERED DELETION CLOSURE
153
Proof Let z E sdRes(L). From the definition of sdRes(L) it follows that z E sps(L). Assume that z $ ( L H LC),. This means there exists 20 E L , u E Lc such that 2 E (w H u). This implies u E (w t+ z). We arrived at a contradiction as z E sdRes(L) but there exists a word w E L with (w H z)n Lc = w # 8. For the other inclusion, let z E ( L H Lc)cnsps(L).As z E sps(L), if z # sdRes(L) then there exists w E L such that w E (w H z ) n L C# 0. This implies z E (w H u) C ( L H Lc), which is a contradiction with the initial assumption about z. The following result connects the notions of shuffle and scattered deletion. Proposition 7.3.4 Let L E X* be an sh-closed language. Then L as sd-closed if and only i f L = ( L H L ) .
Proof If L is sd-closed, L H L 2 L. Now let u E L. Since L is sh-closed, uu E L. Therefore u E ( L H L ) , i.e. L C ( L H L ) . We can conclude that L = ( L H L ) . The other implication is obvious. If L is a nonempty language and if D L is the family of all sd-closed languages Li containing L, then the intersection
of all sd-closed languages containing L is an sd-closed language called the scattered deletion closure of L, or in short, sd-closure of L. The sd-closure of L is the smallest sd-closed language containing L.
We will now define a sequences of languages whose union is the sd-closure of a given language L. Let:
sdq(L)= L SdCl(L) = sdco(L) H (sdco(L)u { E } ) sdcz(L) = sdcl(L) H ( s d c l ( L )U { E } )
...
154 CHAPTER 7. SHUFFLES AND SCATTERED DELETIONS
SdCk+l(L)= SdCk(L) H (SdCk(L)u { E } )
- sdck(L). Clearly s d c k ( ~ ) sdck+l(L). Let sdc(L) = Uk>O
Proposition 7.3.5 sdc(L) is the sd-closure of the language L . Proof Clearly L C sdc(L). Let now 71 E sdc(L) and u E sdc(L). Then v E s d ~ ( L and ) u E sdcj(L) for some integers i , j 2 0. If k = m a z { i , j } , then v E sdck(L) and u E sdck(L). This implies (u F+ v ) C sdck+l(L) E sdc(L). Therefore sdc(L) is an sd-closed language containing L. Let T be an sd-closed language such that L = sdco(L) E T . Since T is sd-closed, if sdck(L) T then sdck+l(L) T . By an induction argument, it follows that sdc(L) C T . This completes the proof of the proposition. It can be proved that the languages sdck(L), k L C X* is regular.
2 0 , is regular if
By Proposition 7.3.1, the family of regular languages is closed under scattered deletion. Therefore, if L is regular, then the languages sdck(L), k 1 0 , are also regular. However, this result does not imply that sdc(L) is regular. Proposition 7.3.6 and Proposition 7.3.7 show different cases. Recall that, for a language L , the principal congruence PL of L is defined by: u = ~ ( P Lif)and only if xuy E L ($ lcvy E L for any z,y E
x*.
When the principal congruence of L has a finite index (finite number of classes) the language L is regular. If L is commutative, we have the following result.
Proposition 7.3.6 Let L C X* be a regular language. If L is commutative, then its scattered deletion closure sdc(L ) is commutative and regular.
7.3. SCATTERED DELETION CLOSURE
155
Proof Let us prove first that sdc(L) is commutative. To this end, it is sufficient to show that sdck+l(L) is commutative if s d c k ( L ) is commutative. Let x u v y E sdck+l(L). If zuvy E sdck(L), then we are done. Otherwise, by the definition of sdck+l(L), there exist w, z E sdck(L) such that w E ( x u v y o z ) . Since sdck(L) is commutative, x u v y z E sdck(L) and zvuyz E s d c k ( L ) . From the fact that z,zwuyz E sdck(L) and the definition of sdck+l(L), it follows that zwuy E sdck+l(L), i.e. sdck+l(L) is commutative. We will show next that s d c ( L ) is regular. To this end, we show then u = U ( P ~ ~ ~ ~ + Let~ ( uL =)v(Psdck(~)) ). that if u E v(Psdck(~)) and let xuy E sdck+l(L). By the definition of sdck+l(L), there exists w, z E sdck(L) such that w E (zuy o z ) . Since sdck(L) is commutative, zuyz E s d c k ( l ) . Hence zvyz E s d c k ( L ) . From the fact that z E sdck(L) and by the definition of sdck+l(L), it follows that zvy E sdck+l(L). In the same way, z v y E sdck+l(L) implies zuy E s d c k S 1 ( L ) . Consequently, u = W ( P ~ ~ ~ ~ holds. + ~ (This L )means ) that the number of congruence classes of PSdCk+l(L)is smaller or equal to that of Psdck(~). Notice that sdcfJ(L)2 S d C l ( L )
c * . . 2 Sd%(L) c Sd%+l(L) c . . ..
Hence there exist positive integers k , no such that the number of equals k for any n 2 no. Since the congruence classes of Psdcn(L) number of languages over X whose number of congruence classes is constant is finite, we have s d c t ( L ) = sdct+l(L) for some t 2 1. Thus s d c ( L ) = sdct(L) which implies that s d c ( L ) is regular (see also [43]). However, in general the above situation does not happen. The proof is due to [44].
1x1
Proposition 7.3.7 If 2 2, then there is a regular (contezt-free) language L G X * such that s d c ( L ) is not regular (context-free).
Proof Let X = { a , b , . . .} and let L = (ab)+(abba)+(babbaa)+U {bbaa}. Then it is easy to see that IuI, = lulb for any u E s d c ( L ) . Since ~~(aba)~(babb)~ E ((ab)+(abba)+(babbaa)+H* bbaa), an(aba)" (babb)" E s d c ( L ) n a+(aba)+(babb)+ for any n,n 2 1. In the above, H* means a consecutive application of H. Suppose s d c ( L ) is contextfree. Then s d c ( L ) n a+(aba)+(babb)+ is context-free. Since sdc(L) n
156 CHAPTER 7. SHUFFLES AND SCATTERED DELETIONS ~ ~ ( a b a ) + ( b u bisb context-free, )~ we have ~ ~ ( a b u ) ~ ( b a=b uvwxy b)~ where 1 5 1~x15 n and uviwxiyE sdc(L) n ~ + ( a b a ) ~ ( b a bfor b)~ any i 2 1 for a sufficiently large number n. However, in this case, (uviwziy(, # (uviwziylb for any i 2 2, which is a contradiction. Hence sdc(L) is not context-free though L is regular. This completes the proof of the proposition.
Chapter 8
Directable Automata An automaton A = ( S ,X,6) is called a directable automaton if there exists w E X * such that swA = t w A for any s , t E S. Then a word w is called a directing word of the directable automaton A .
Fact Let A = ( S , X , 6 ) be an automaton. Then A as directable i f and only if for any s , t E S , there exists u E X* such that suA = t u A .
(+) Obvious. (e) Let T be a maximal subset of S such that 3w E X * ,‘it,t’ E T ,t w A = t‘wA. If T = S , then A is a directable automaton. Suppose T # S . Then there exists s E S \ T such that swA # t w A for any t E T . Moreover, there there exists w‘ E X * such that for . any t E T , ( s w ~ ) w ’=~ (twA)wIA,i.e. s ( w w ’ ) ~= ~ ( w w ’ ) ~Let T‘ = T U {s}. Then tl(ww’)A = t2(ww’)A for any t l , t 2 E T‘. This contradicts the maximality of T . Hence A is directable. Proof
Recall that, in Chapter 3, we considered the class of directable (strongly directable) automata. In this chapter, we will deal with directable automata and then nondeterministic directable automata. For the case of nondeterministic automata, the notion of directability is not uniquely determined. We will introduce three kinds of directabilities for nondeterministic automata. The contents of this chapter consist of the results in [ 2 5 ] ,[26] and [28].
157
CHAPTER 8. DIRECTABLE AUTOMATA
158
8.1
Deterministic case
We will start this section by proving that the set of directing words of a directable automaton is a regular language. Proposition 8.1.1 Assume that A = ( S , X , b ) is a directable automata. T h e n the set of directing words D(A) of A is a regular language. Proof Let A = ( S , X , b ) be a directable automata. For any a E X and any subset T of S , we define J(T,a ) = U t E T { b ( t ,a ) } . Then we have a finite acceptor = ((7' I T 5 S } ,X,x, S, {{s} I s E S } ) . Since A is directable, we have = D(A). Hence D(A) is regular.
x
7(x)
Let A = (S,X , 6) be a directable automaton. By d(A),we denote the value rnin{lwl I w E D(A)}. Moreover, d ( n ) denotes the value rnaz{d(A) I A = ( S ,X, 6) is a directable automaton with n states}. In the definition of d ( n ) , X ranges over all finite nonempty alphabets. In [ll],Cernjr conjectured the following. Conjecture For any n 2 1,d ( n ) = (n- 1)2.
Calculating all possible cases, Cernjr confirmed that the above conjecture holds true up to n = 5 . However, the above is still an open problem for the general case. We will only show that d ( n ) is the order of 0 ( n 3 ) .Better estimations can be found in [58] and [59]. First, we will introduce the following result by Cernjr that suggests the reason why Cernjr reached the above conjecture. Proposition 8.1.2 For any n 2 1, we have (n - 1)2_< d ( n ) .
Consider the following automaton: A = ((1 , . . . ,n},{a,b},S)where6(i,a) = i + l i f i = 1 , 2, . . . ,n-1 and b ( n , a ) = 1, 6(n- 1,b) = n and b(i,b ) = i if i = 1 , 2 , .. . ,n and i#n-l. Proof
Now we show that d(A) = (n- 1)2. Let w E X + be a shortest directing word of A. Then S w A = U S E S{ s w A } = { n } and w = w'b.
8.1. DETERMINISTIC CASE
159
-
Moreover, SwtA = { n - I,n ) . Let w = w l a l a z . . an-lb where ai E X,i= 1 , 2,..., n - 1. Then ai = a for any i = 1 , 2,..., n - 1 and S w f = { n ,1). This implies that w1 = w/,b and SwiA = { n - 1,n,1). Taking the same procedure as above, we have:
w1 = w2an-’b, S w i = {n,1 , 2 } and
202
= wkb.
Continuing the same process, we can obtain w = b ( ~ ~ - l b )=~ - ~ (ban-’)n-2b. Since Iw( = ( n - l)’, we have ( n - 1)25 d ( n ) .
Proposition 8.1.3 For any n 2 1, we have d(n) 5 1
+ ( n - 2)(;).
Proof It can easily be seen that the proposition holds for n = 1 , 2 . Let n 2 3 and let A = ( S , X , S ) be a directable automaton with IS\= n. Since A is a directable automaton, there exist so,s1 E S , S O# s1 and a E X such that souA = q a A . Hence ISaA( < IS(. Let s, t E SaA,s # t . Moreover, let u E X * be one of the shortest words such that suA = tuA. Suppose (u( 2 )(; 1. Then we have u = xvy,u,xyE X+ such that s x A = ~ ( x vand ) ~txA = t(xu)A. This implies that ~ ( z y = ) ~ t ( z y ) A .This contradicts the assumption that u is one of the shortest words. Hence (uI 5 (y). Now consider s‘,t‘ E S ( ~ U s’) #~ t‘. , In the same way as the above, we can find u‘ E X*, Iu’( 5 );( such that s’dA = t’u’A. Using the same technique, we can find a directing word w = auu’ . . . of A with IwI _< 1 ( n- 2)
+
+
(y).
A similar problem for some classes of automata can be disscussed. For instance, an automaton A = ( S , X , 6 ) is called a commutative automaton if ~ ( 2 ~ 2 1=) ~~ ( 2 1 1 ~holds ) ~ for any s E S and any u , v E X*. By dcom(n), we denote the value m a x { d ( A ) I A = ( S , X , 6 )is commutative and directable, and I S1 = n } . In the definition of dcom(n),X ranges over all finite nonempty alphabets. The following result is originally due to [60] and [61]. However, we have a simple proof due to [as]. Proposition 8.1.4 For any n 2 1, we have dcom(n) = n - 1. Proof Let A = ( S , X , 6 ) be a commutative directable automaton suA 2 S ( W U=) ~S ( U ~ ) ~ with JSJ= n. First notice that SuA = USES for any u, v E X*. Let w = ala2 . . . a, be one of the shortest directing
CHAPTER 8. DIRECTABLE AUTOMATA
160
words of A . Thus we have S a t 2 S ( a 1 a 2 ) 2 ~ S ( a 1 a 2 a 3 )2 ~ ... 2 S(alaza3 . * . a,)A. Notice that every inclusion is proper because the word w is one of the shotest directing words. Hence r 5 n - 1. On the other hand, consider the following commutative directable automaton B = ({1,2,. . . ,n},X , y) where y ( i , u ) = i 1 for any a E X and any i = 1 , 2 , .. . , n - 1 and y ( n , a ) = n for any a E X. Then d ( B ) = n - 1. Consequently, dcom(n) = n - 1.
+
Let A = ( S , X , b ) be an automaton with 151 ' = n. We consider an algorithm to decide whether A is directable. Recall that a word u E X * is called a subword of a word w E X * if w = s u y for some 2,y E X * . Let L X * and let w E X*. Then w is called a merged word of L if any word in L is a subword of w. Let w E X * be a merged word of X d ( n ) . Then an automaton A = ( S , X , S ) with I S 1 = n is directable if and only if (SwAI = 1. Therefore, one of our purposes is to find a merged word of X d ( n )which is as short as possible. For instance, w = ulu2 . . ut is a merged word of X d ( n ) where X d ( n )= { u l ,u2, . . . , ut}. However, this merged word is too wI = d ( n ) l X l d ( n ) .Actually, we have the following result long, i.e. I [39]:
Proposition 8.1.5 There exists a merged word w E X s of X d ( n ) such that IwI 5 IXld(n) d ( n ) - 1.
+
To prove Proposition 8.1.5, we consider the automaton C = ( X d ( n )X, , y) where (au)bc = ub for a, b E X and u E X d ( " ) - l . Let v1, v2,. . . , v, E X d ( n ) . Then, by v1 -+ v2 -+ . . . -+ V T , we mean that v1,v2,. . . ,v, are distinct elements and vi+1 = via? for some ui E X where i = 1 , 2 , . . . ,r - 1.
Lemma 8.1.1 Let v1 -+ 212 -+ . ' . there is no v E Xd(") such that v1
--f
V,
-+
21, -+
for a positive integer r . If v2 -+ . . . -+ vr -+ v , then
211.
Proof Suppose that v, --+ v1 does not hold. Let vi = aiui where ai E X and ui E X d ( n ) - l for any i = 1 , 2 , . . . ,r . Since vr -+ v1 does not hold, we have {v,aC I u E X } = {u,a I E X } G (212,213,. . . , I + } , i.e. u,X (212,v3, . . . ,v,}. Let u,a = vi for some a E X and some
8.1. DETERMINISTIC CASE
161
i = 2 , 3 , . . , ,r . By the fact that vi-1 + vi, vi E u i - l X and hence ui-1 = u,. As ai-lui-1 = vi-1, we have vi-1 E Xu,. That is, vi E u,X implies that vi-1 E Xu,. Notice that )Xu,) = )urXI. Hence Xu, {q,212,. . . vr-l}. However, v, = aru, E Xu,.This is a contradiction. Therefore, v, + vl holds. Lemma 8.1.2
xd(")
Proof Let v E \ {q, 212,. . . ,vr}. Since v E xd(") \ {v1,02, . . . , v,} and v v y = w1, there exist u,w E X * and a E X such that v1 = uaw and wuc E X d ( " )\ (~1,212,.. . , v,} and ~ ( U U = ) ~(vuc)uc E {v1,v2,. . . , vr}. Let v k = (vuc)uc with Ic = 1 , 2 , . . . , r . Then vuc -+ vk. On the other hand, it follows from Lemma 8.1.1 that vk + Wk+l + * . . -+ a, + v1 + v2 + -+ wk-1. Recall that vuc $ { ~ l l , V 2 , .. . , Vr}. Thus vuc -+ Z I ~+ vk+l + * * ' + 21, + 211 + V 2 -+ . . . --t vk-1. This completes the proof of the lemma. e
.
.
Proof of Proposition 8.1.5 By Lemma 8.1.1 and Lemma 8.1.2, we have v1 + v2 + . . . -+ vt where Xd(") = {vl, v 2 , . . . , vt}. Let vi+l = via:, ai E X , i = 1 , 2 , . . . , t - 1. Consider the word w = 2 ~ 1 ~ 1 ~. at-1 2 . . E X*. Obviously, 01 is a subword of w. Since v l a y = v2, 212 is a subword of w as well. For any i = 2,3, . . . , t , vi is a subword of w because 01 (ala2 . , ' ai-1) = V i . Hence w is a merged word of X d ( " ) . Notice that IwI = (211) t - 1 = d(n) ]XId(")- 1. This completes the proof of the proposition.
+
+
Remark 8.1.1 It can easily be shown that the above word w is a shortest merged word of Xd(") since, for instance, v1 can be found uniquely only at the prefix of w, v2 can be found uniquely only at the suffix of vial and in general vi can be found uniquely only at the suffix of v1a1a2 * . . ai-1. Using the word w, we can check whether a given automaton A = ( S ,X , 6 ) with IS\= n is directable, i.e. A is directable if and only if ISWCJ =
1.
CHAPTER 8. DIRECTABLE AUTOMATA
162
However, the above algorithm is not effective. The following result [29] provides a more effective algorithm to decide whether a given automaton is directable. Let p be the following relation on S : YS] t E
--
s,(s, t ) E p
3u E x*,S U A = t U A .
We introduce also the following relations on S : (1) vs, t E ( s ,t ) E po s = t. (2) vz 1 1,vs, t E S]( s ,t ) E pi 3a E (saA,taA)E
s,
x,
pi-1.
(3
Proposition 8.1.6 p = u p i . Moreover, A is directable if and only i=O
if (s, t ) E p f o r a n y s, t E s.
(3 Proof
That u p i
Cp
is obvious. Let ( s ,t ) E p. Then there exists
i=O
u E X * such that suA = tuA. Assume that u is a shortest word Therefore, u = such. Notice that I{T I T C S, IT1 = 2}1 = (;). u1u~u3where u1,u2,ug E X * , u 2 E X + and suf = s ( u ~ u = ~ ) ~ tuf = t(u1u2)A. Thus s ( u ~ u=~ t )( ~~ 1 ~ 3 This ) ~ . contradicts the
(3 minimality of IuI.Therefore] (uI5 (;),
i.e. u E u p i . The latter half i=O
is obvious from the fact that ( s l t ) E p means suA = tuA for some uE
x*.
Remark 8.1.2 In [as],it is indicated that the above proposition provides an algorithm to decide whether or not any given automaton A = ( S ,X , 6) is directable with the time bound of O ( m . n 2 )where m= and n = ISI.
1x1
8.2
Nondeterministic case
In this section, we will deal with nondeterministic directable automata and their related languages. For nondeterministic automata,
8.2. NONDETERMINISTIC CASE
163
the directability can be defined in several ways. In each case, the directing words constitute a regular language. We will consider six classes of regular languages with respect to the different definitions of directability. Notice that an automaton A = ( S , X , S ) is said to be nondeterministic if it consists of the following data: (1) S , X are the same materials as in the definition of finite automaton. (2) S is a relation such that b ( s , a ) C S for any s E S and a E X. In the above, the relation S can be extended as follows: (1) ) ~ ( t , vfor ) any = 1s) for any s E S . (2) ~ ( s , a v=
U
S(S,E)
t E 6 ( s,a)
s E
S, a
E
X and v E X * .
Let A = ( S , X , S ) be a nondeterministic automaton. First we introduce the notion of directing words of A by [30]. Definition 8.2.1 (1) A word w E X * is D1-directing if swA # 8 for any s E S and lSwAl = 1. (2) A word w E X* is D2-directing if swA = S w A for any s E S. ( 3 ) A word w E X * is D3-directing if
n
# 0.
S w ~
SES
Definition 8.2.2 Let i = 1 , 2 , 3 . Then A is called a Di-directable automaton if the set of Di-directing words is not empty.
Let A = ( S , X , S ) be a nondeterministic automaton. Then, for any i = 1 , 2 , 3 ,Di(A) denotes the set of all Di-directing words. Then we have : Proposition 8.2.1 For any i = 1,2,3,D i ( A ) is a regular language. Proof
Let A = ( S , X , S ) be a nondeterministic automaton and let
S = { S O , s1,s 2 , . . . , s,},r 1 0. For any i = 1 , 2 , 3 , we define a finite acceptor Ai = ( { T I T G S } , S,, ( { s o } , {q},. . . , { s , } ) , Fi) as follows: (1) ( T O , T ~ , . . . , ~ r ) a = ~ s,((T~,T~, i . . . , T,), a ) = (ToaA,T1aA,. . . ,T, a A ) for any a E X and any Ti 2 S,i= 0 , 1 , . . , ,T . (2) = { ( { t ) , { t } , . .. , { t } ) F3 =
It
E S } , F2 = { ( T , T , . . , T )
{(To,Tl,.. . ,T,) I Ti C S,i= 0 , 1 , . . . , T ,
I
T
nTi# S}. r
i=O
G
S } and
CHAPTER 8. DIRECTABLE AUTOMATA
164
Then it is obvious that Di(A) = 7(Ai) for any i = 1 , 2 , 3 . Hence Di(A) is a regular language for any i = 1 , 2 , 3 .
As for the D1-directability of a complete nondeterministic automaton, Burkhard introduced it in [lo]. We are going to investigate the classes of languages consisting of D1-, D2- and D3-directing words of nondeterministic automata and complete nondeterministic automata. Here a complete nondeterminsitic automaton A = ( S ,X, 6) means that ,aA # 0 for any s E S and any a E X. The classes of Di-directable nondeterministic automata and complete nondeterministic automata are denoted by Dir(i) and CDir(i), respectively. Let X be an alphabet. For i = 1 , 2 , 3 , we define the following classes of languages: ( I ) L&(i) = {Di(A) 1 A = (s>x,6) E Dir(i))' (2) l g N D ( i ) {Di(A) I A = (S,X, 6) E CDir(i)}. Let D be the class of deterministic directable automata. For A E D, D(A) denotes the set of all directing words of A . Then we can define the class, i.e. L$ = {D(A) I A = (S,X, 6) E D}. Then, by Propsition 8.2.1 and Proposition 8.1.1, all the above classes are subclasses of all regular languages.
8.3
Classes of regular languages
In this section, we will investigate the classes of regular languages consisting of directing words. Since it is easy to see that @' =
L'"' CND(i) - L:&~) 1x12 2.
=
{unu* I n >_ 1) for any i = 1,2,3, we assume
that
We introduce the following result due to [30].
Lemma 8.3.1 Let A = ( S ,X, 6) be a nondeterministic automaton. T h e n we have D2(A)X* = Dz(A). Moreover, If A is complete, then X * D l ( A ) = D1(A), X*Dz(A)X*= D2(A) and X*Ds(A)X*= D3 (A) *
8.3. CLASSES OF REGULAR LANGUAGES
165
Proof Let A = (S,X,6) be a nondeterministic automaton. First we prove that Da(A)X* = D2(A). It is obvious that D2(A) C D2(A)X*. Now, let u E D2(A)X*. Then u = vw where v E Da(A) and w E X*. Let s E S . Since svA = S v A , we have suA = This means ~ ( v w =) ~(swA)wA = ( S v A ) w A = S ( ~ W=) SuA. ~ that u E Dz(A). Hence Dz(A)X* 2 D2(A) and D2(A)X*= Dz(A). Now assume A is complete. It is obvious that D1 (A) E X*D1(A). Let u E X*Dl(A). Then u = vw where v E X * and w E Dl(A). Since A is complete, suA # 0 and suA = S ( V W ) ~= ( s v A ) w AC S w A for any s E S. Consequently, 1 5 (suA(5 ( S w A (= 1. Therefore, lsuAI= 1 and u E Dl(A). This shows that X*Dl(A) = Dl(A). We show that X*D2(A)X* = Da(A). Notice that D2(A)X* = D2(A) holds and hence X*Dz(A)X*= X*D2(A)holds. Therefore, it is enough to show that X*D2(A) = D2(A). That D2(A) C X*D2(A) is obvious. Let u E X*D2(A). Then u = ww where v E X* and w E Dz(A). Let s E S . As suA = S ( V W ) ~= (swA)wA,svA # 0 and w E D2(A), suA = ( s v A ) w A = SwA. Notice that s is an arbitrary element of S. Therefore, suA = SuA for any s E S, i.e. u E D2(A). Thus X*D2(A) = D2(A) and X*D2(A)X*= Dz(A). We show the last equality. It is enogh to show that X*D3(A)X*C D3(A). Let u E X*D3(A)X*. Then u = vwx where v , x E X* and w E Ds(A). Let s E S. Since A is complete, svA # 0. Let S Z = ~ T ~ . Then S ( U W ) ~= ( s v ~ ) = , ~T W ~2 n t w A 2 n t w A # 0 tET
because w E D3(A). Hence ~ ( v w x2) (~r ] t w A ) z A#
t€S
8. Therefore,
t€S
nsuA#
0. This
means that u E Ds(A). Consequently, we have
SES
X*D3(A)X*= Ds(A). Now we will characterize the class Cg Proposition 8.3.1 Let L C X* be a language. T h e n L E only af L # 0,L as regular and X*LX* = L .
Lg
af and
Proof (+) Let L E L g . Then L # 0 and there exists a directable automaton A = (S,X,S) such that L = D(A). Let u E L, i.e. u E D(A). Then JSuAI= 1. Let v , w E X*. Since 0 # S ( v u w )A C
CHAPTER, 8. DIRECTABLE AUTOMATA
166
S ( U ~= (SuA)wA, ) ~ we have 1 5 I S ( v u ~ )5~ ISuA/ l = 1. Hence lS(v~w= ) ~1.( This means that uuw E D(A) = L , i.e. X * L X * L . As the converse inclusion is obvious, we have X * L X * = L . (+) Now assume that L # 8, L is regular and X * L X * = L . By the proof of Propositon 4.1, the accepter A = ( S , X , S ,[ E ] , {[u]I u E L } ) where S = {[u]I u E X * } accepts L . Let u , u E L . Then zuy,xuy E L for any z,y E X * because X * L X * = L. That is, u = ~ ( P Land ) { [ u ]I u E L } is a singleton set. Now let w E L . Then S w A = {[uw] u E X*} = [w] because uw E L for any u E X * . Thus lSwAI = 1 and w is a directiong word of A . Hence L E L g .
I
Corollary 8.3.1
Lf:is closed
under union.
Proposition 8.3.2
Proof It is obvious that Lg Now let L E Then L # 8. Moreover, by Lemma 8.3.1, we have X * L X * = L . By Proposition 8.3.1, L E Lf:and hence LEND(2)= L D X. It is also obvious that Lf:C L5ND(3).Let L E L g N D ( 3 ) . Then L # 0 and by Lemma 8.3.1, we have X * L X * = L . By Proposition 8.3.1, L E Lg. Thus we have = Lg. n L&(2) = LE, it is enough to show To prove that that LgND(,)n LED(,) C L g . Let L E n LgD(2). Since L E L$D(Do, by Lemma 8.3.1 L X * = L and hence X * L X * = X * L . By the assumption that L E L&D(l), it follows from Lemma 8.3.1 that X*LX* = X * L = L . Therefore, by Lemma 8.3.1 we have L E ~f:, i.e. L $ ~ n ~ L:~(,) ( ~ ) = Lf:. Finally, to prove that L$N,,(l) nL$D(3)= L g , it is enough to show that LgND(l)f l LED(3)C Lf:.Let L E L g N D ( 1 ) n L$D(3). Since L E L&,D(l), by Lemma 8.3.1 we have X * L = L . Moreover, there exists a nondeterministic automaton A = (S, X, S ) such that L = D3(A) because L E ,C$D(3). We show that A is a complete nondeterministic automaton. Suppose A is not complete. Then there exist a E X and s E S such that suA = 8. Let u E L . Since X * L = L , au E
8.3. CLASSES OF REGULAR LANGUAGES
167
L = D3(A). Therefore, au is D3-directing word of A. Consequently, ~ ( a u #) 0~ and hence suA # 0, which is a contradiction. Hence A E CDir(3). By Lemma 8.3.1, X*LX* = L and L E L g , i.e. LEND(1)
n G q 3 ) = G.
Notice that we have the following inclusion relations.
Proposition 8.3.3 (1) L g C LgND(llC LGD(l). (2) Lg C LED(l)n LGD(3).
Proof (1) It is obvious that L g LEND(,)C LGD(l) holds. Let a E X. Consider the following nondeterministic automaton A = ({1,2},X,6)where l a A = {1},2aA = (1) and, l b A = {1,2} and 2bA = (2) for b E X \ { a } . Then A is complete. Moreover, a is a DI-directing word of A. If Dl(A) E L g , then ab must be in D1(A) for any b E X \ { a } . However, ab f D1(A), which is a contradiction. Thus L; c Let B = ({1,2}, X , 7 ) where laB = {l},2aB = (1) and, l b B = 0 and 2bB = {a} for any b E X \ { u } . Then u is D1-directing word of B. By 8.3.1, ba must be in D1(B) for any b E X \ { a } if D1(B) E However, ba f D1(B), which is a contradiction. Hence, LcND(l)c L&,(l). (2) Let a E X . Since L g C L$D(l) and LE C C$D(3), L; C C$D(l) nLGD(3).Let C = ({1,2},X,Q)where l a c = {1,2},2aC= {1,2} and, l b C = (1) and 2bC = 8 for any b E X \ { a } . Then D2(C) = D3(C) = ax*,i.e. a x * E LgD(l)nL$D(3). But, if a x * E L g , then, by Lemma 8.3.1 ba must be in a x * for any b E X \ { a } , which is a contradiction. Hence L$ c L&,(l) n LgD(3). We will show that the classes L$D(l),LED(21and L$D(3) are incomparable, i.e. there is no inclusion relation between any two of these three classes. To describe the situation, we consider the following three nondeterministic automata A , B , C with the same set of states {1,2}: (1) l a A = (1) = 2aA = {l}, l b A = {1,2} = 2bA = {1,2} for any b E X \ { a } . (2) laB = {2},2aB = {1,2},l b B = 8 , 2 b B = (1) for any b E X \ { a } . (3) l a c = {2},2aC = {1,2},l b C = {1},2bC = 0 for any b E X \ { a } .
CHAPTER 8. DIRECTABLE AUTOMATA
168
Lemma 8.3.2 ( I )
0 # D2(B) $ C$D(l) and
D3(C)
$ ‘$D(Z)’
0 # D l ( A ) $ C&,(2) and
D2(B)
and D i ( A ) $ C$D(3). (2)
’
$ l g D ( 3 ) ’ (3) f D3(C)
‘gD(1)
Proof (1) It is obvious that D1(A) = X * a . By Lemma 8.3.1, X * a $ C&,(2). Now suppose X * a E C$D(3). Then there exists a nondeterministic automaton D = ( S ,X, 6) such that D3(D) = X * a . Since a, ba E X*a where b E X \ { a } , we have a,ba E D3(D). Therefore, s a D ,sbD # 0 for any s € S. Hence bab E D3(D) = X * a , which is a contradiction. Consequently, X * a $ C$D(3). (2) Let b E X \ {a}. Then aa, bb E D2(B). Suppose D2(B) f CND(1). Then there exists a nondeterministic automaton D = (S,X , 6) such D2(B) = D l ( D ) . Since aa,bb E D l ( D ) , we have sbD # 8 for any s E S and baa E D l ( D ) . Thus baa E D2(B), which is a contradiction. Now suppose D2(B) E C$D(3). Then there exists a nondeterministic automaton E = ( T , X , y ) such D2(B) = D3(E). Notice that aa,bb E D2(B) = Ds(E), we have tbE # 8 for any t E T and baa E D3(E). Hence baa E D2(B), a contradiction. Consequently, D2(B) $ CcDD(3). (3) Let b E X \ { a } . Then a,aab E D3(C). Now suppose D3(C) E CND(1). Then there exists a nondeterministic automaton D = ( S , X , 6 ) such D3(C) = D l ( D ) . Since a E D l ( D ) , we have /saDl = 1 and ~ ( a b =) (~s a D ) b D= ( ( s a D ) a D ) b D = s(aab)D for any s E 5’. Thus ab E D l ( D ) and ab E D3(C), which is a contradiction. Hence D3(C) $ C N D ( ~ ) . Now suppose D3(C) E C$D(2). Then there exists a nondeterministic automaton E such D2(E) = D3(C). Since a E D2(E), by Lemma 8.3.1 we have ab E D2(E). Thus ab E D3(C), which is a contradiction. Thus D3(C) C$D(2). Notice that D1(A) E L:ND(l) in the proof of (1) of the above lemma. Hence the following proposition and its corollary are immediate consequences of Lemma 8.3.2. Proposition 8.3.4 The classes ,CcDD(,) , C$D(2) and C$DD(31are incomparable. Corollary 8.3.2 T h e classes J C ~ ~ ~ ( ~ )and , CC$D(3) $ ~ ( ~are) incompara b le.
8.3. CLASSES OF REGULAR LANGUAGES
‘6D ( 1)
‘5
‘ED
= ‘&VD(2)
(2)
‘6D
169
(3)
= cx CND(3)
Figure 8.1: Inclusion relations
The above figure depicts the inclusion relations for the 7 classes of regular languages. Now we investigate the structure of a language in LzD(l)
Definition 8.3.1 A nondeterministic automaton A = (S,X,6) is said to be of partial function type (or in short, ofpf-type) if IsaAJ5 1 for any s E S and any a E X . Lemma 8.3.3 Let A = ( S , X , 6 ) be a nondeterministic automaton. Then there exists a nondeterministic automaton of pf-type B = ( T ,X , 7)such that D2(A) = D2(B).
Proof We define B = ((21 8 # 2 C S } , X , 7)as follows: ZaB = .aA for any s E S and any Z C_ S , Z # 0.
u
ZEZ
Let u E Dz(A). Then suA = SuA for any s E S . Therefore, Z u B = SuB for any Z G S, Z # 8. Thus u E D2(A). Now assume u @ Dz(A). Then there exist s, t E S such that s u A # tuA. Hence { s } u B # {t}uB. This means that u $ D2(B). Hence Dz(A) = Dz(B). Proposition 8.3.5 Let L E LcD(2)\ (LcD(l)n L$D(3)). T h e n there exist L1 E L g , Lz E n C,XD(3)such that L = L1 U L2 with
L1 n L2 # 0.
170
CHAPTER 8. DIRECTABLE AUTOMATA
Proof By Lemma 8.3.3, there exists a nondeterministic automaton of pf-type A such that L = D 2 ( A ) . Let L1 = {u E L I SuA = 0) and let L2 = {u E L 1 SuA # S}. Then it is obvious that L2 = D l ( A ) = D 3 ( A ) . Therefore, L2 E L$D(l) f?LgD(,) if L2 # 0. Notice that L1 = L \ L2 and L , L2 are regular. Hence L1 is regular. It is obvious that X*L1X* = L1. By Propositon 8.3.1, L1 E Lf:if L1 # 8. Suppose that L1 = 8 or L2 = 0. Then L E LGD(l)flLGD(!), which is a contradiction. This completes the proof of the proposition. We have already proven that L g is closed under union. We will investigate some closure properties under union and intersection. Proposition 8.3.6 The following classes are not closed under union: ‘ZND(l)*
(2)
‘GD(I)*
(3) L$D(2)’
Proof (1) Let a E X and let A = ( { 1 , 2 , 3 } , X 6, ) be the following complete nondeterministic automaton: l a A = { l } , 2 a A = {1},3aA = { 2 } , l b A = 2bA = 2bA = { 1 , 2 , 3 } for any b E X \ { a } . for any a E X . Then D 1 ( A ) = X * a 2 , i.e. X * a 2 E Consider L = X * a 2 U X*b2 for a,b E X , a # b. Suppose L E L$D(ll. Then there exists a nondeterministic automaton B = ( S , X , y ) such that L = D l ( B ) . Notice that a2 E D l ( B ) . Since a2 E D 1 ( B ) , s a B = 8 for any s E S . On the other hand, since b2 E D ~ ( B ) , s ( a b b=) ~S(abb)B for any s E S. Thus abb E D1(B) = L , which is a contradiction. Consequently, L $ L$,(l) and hence L $! i.e. is not closed under union. (2) By ( l ) ,L $! L&,(l) and hence L$D(l) is not closed under union. ( 3 ) Let a E X and let C = ( { 1 , 2 , 3 } X , , 6 ) be the following nondeterministic automaton: l a A = {l},2aA = { l } ,3aA = { 2 } , l b A = {l},2bA = 3bA = 8 for any b E X \ {a}. Then D 2 ( C ) = a2X*, i.e. a2X* E L$D(2). Consider K = a2X* U b2X* for a,b E X , a # b. Suppose K E LGD(2).Then there exists
8.3. CLASSES OF REGULAR LANGUAGES
171
a nondeterministic automaton E = ( Q ,X, 0) such that K = Dz(E). If = 0, then Q ( b ~ a = ) ~0 and baa E Dz(E> = K , which is a contradiction. If # 0, then q(aa)E # 0 for any q E Q and hence qaE # 0 for any q E Q . In this case, q(abb)E= Q(abb)E for any q E Q , i.e. abb E Dz(E) = K , which is a contradiction. Therefore, K E L$D(2),i.e. L$D(z) is not closed under union.
Proposition 8.3.7 The class
is closed under union.
Proof Let L , M E L$D(3). Then there exist nondeterministic automata A = ( S ,X, S) and B = ( T ,X, y) such that S n T = 8,D3(A) = L and D s ( B ) = K . Now consider the following nondeterministic automaton C = ( S U T ,X, 0): sac = ,aA U T for any s E S and any a E X and tac = taB U S for any t E T and any a E X . We will show that L U M = D3(C). Let u E L. Then n s u A # 8.Hence quc = (( suA)u T ) SES
n tuB)u S ) 2
n
S€S
suA # 0. Thus u E D3(C). In the same way,
n((
tET
n
qESUT
SES
if u E M , then u E D3(C). Therefore, L U M D3(B). Let u $ L U M . Then u $ L and u $ M . This implies that pC = suA)UT)n n s u A = 8 and n t u B = 8. Hence SES
((
nt u B )u S )
tET
tET
suA #
=
n
((n
qESUT
SES
8. Therefore, u $ D3(C) and L u M
=
SES
D3(C), i.e. L U M E L$D(3). This completes the proof of the proposition.
Proposition 8.3.8 The following classes are closed under nonempty intersection: ( I ) LE. (2) LEND(l). (3) L $ ~ ( ~ (4) ) . L $ ~ ( ~ (5) ). ‘CD(3)
’
Outline of the proof Let i = 1 , 2 , 3 and let A = (S,X,S),B = ( T ,X, y) be nondeterministic automata such that Di(A) = L and Di(B) = K . Define the nondeterministic automaton A x B = ( S x T ,X , 6 x y) as follows:
CHAPTER 8. DIRECTABLE AUTOMATA
172
t’)
I s‘
E s a A , t’ E
taB}. Notice that A x B is complete if and only if A and B are complete. For any i = 1,2,3, we can see that u E D i ( A x B ) if and only if u E Di(A) n D i ( B ) for any u E X * . Thus any of the above classes is closed under nonempty intersection. (s, t ) a A X B = {(s’,
We will consider the shortest directing words of nondeterministic automata. Let i = 1 , 2 , 3 and let A = ( S , X , b ) be a nondeterministic automaton. Then & ( A )denotes the value min{lul I u E D i ( A ) } . For any positive integer n 2 1, d i ( n ) denotes the value m a z { d i ( A ) I A = ( S ,X , 6 ) : A E Dir(i) and IS1 = n } . Moreover, cdi(n) denotes the value m a z { d i ( A ) I A = ( S , X , 6 ) : A E CDir(i) and IS1 = n } . Notice that in the definitions of &(n)and cdi(n), X ranges over all finite nonempty alphabets. First, we determine the value c d l ( n ) . The following result is due to [lo]. Theorem 8.3.1 Let n
2 1.
Then c d l ( n ) = 2n
-n -
1
Proof For n = 1 , 2 , obviously the assertion of the theorem holds true. Assume n 2 3. Proof of c d l ( n ) 5 2n - n - 1 Let A = ( S ,X , 6) be a complete nondeterministic automaton with IS1 = n and let w = ala2. a,-la E D 1 ( A ) where a l , a 2 , . . . ,a,-l,a E X and r = IwI = d l ( A ) . Suppose that r = IwI > 2n - n - 1. Notice that 2n - n - 2 = I{T c S I IT1 2 a}]. Let Ti = S(ala2 ...ui) A where i = 1 , 2 , . . . , r - 1, Then +
.
there exist i ,j = 1,2, . . . , r - 1 such that i < j and Ti = Tj. In this case, ala2 . . . aiaj+l . . . a,a E D 1 ( A ) . This contradicts the assumption that r = d l ( A ) . Hence c d l ( n ) 5 2n - n - 1.
Proof of 2n - n - 1 5 cdl ( n ) To prove 2n - n - 1 5 c d l ( n ) , it is enough to construct a complete nondeterministic automaton A = ( S ,X , 6) such that I S1 = n and d l ( A ) = 2n - n - 1. Let S be a finite set with IS1 = n. Moreover, let { T I T2,. , . . ,T,} = {T C S I IT1 2 2). Furtheremore, we assume that IT11 2 IT21 2 . . . 2 IT,I and
8.3. CLASSES OF REGULAR LANGUAGES
173
( s 1 , S Z } . Notice that r = 2n - n - 2. Now we construct the following nondeterministic automaton A = ( S ,X , 6 ) :
T, =
(1) X = { a ? , a 2 , .. . ,a,, z } . ( 2 ) saf = TI for any s E S . (3) For any i = 1 , 2 , . . . , r - 1, = Ti+l if s E Ti and su!+l = S , otherwise. (4) s1zA = s2zA = {SI} and s z A = S if s # s1, s2. Then A is complete and S(ala2 . . u , z ) ~= S a f ( a 2 = T ~ ( u ~ . . . u , ~ ) ~ = T ~ u ~=( Tu ~~ (. u. ~ . u. ., .~u )= ,~ z. ). .~= T , z A = (s1, s2}zA = ( ~ 1 ) . Hence a l a 2 . . a,z E D 1 ( A ) and l a l a 2 . . . a,zl = r 1 = 2n - n - 1. Suppose that there exists w E D l ( A ) with d l ( A ) = JwI < 2n - n - 1. Let w = aiw' where w' E X* and i = 2 , 3 , . . . ,r. Since S 3 Ti-1, we have Sai = S , S ( a i w ' ) A = SwrA and ISW'~I= 1. This implies that w' E D 1 ( A ) . This contradicts the minimality of IwI. For the case that w = zw' where w' E X*, we have S ( ~ W=' )S ~ z A w t A = S w f A because S 3 { s 1 , s 2 } . Hence we encounter the same contradiction. Assume w = a l a 2 . . . a i w ' for some i = 1,2, . . . , r and w' E X * . Obviously, w' E X + and hence i 5 r - 1. Suppose w' = ajv where j # a + 1 and v E X*. Let j < i 1. Remark that w = a1a2 . " a j . . . aiajv. Notice that S ( a l a 2 . .. a j . . . a i ~ j = ) ~ Tj or S(ala2 * .' a j . . . a i ~ j = ) ~S . In the former case, since S(ala2 - .. ~ j = Tj, ) we ~ have S(ala2.a . = S w A and a l a 2 . . . a j v E D l ( A ) , which contradicts the minimality of IwI. In the latter case, S w A = SvA and lSvAI = 1. Therefore, v E D l ( A ) , which is a contradiction. Suppose j > i + 1. Since i < j - 1, Ti \ Tj-1 # 8. Therefore, S(ula2 . . . ~ i a j = ) ~T.aA 2 3 = S . Consequently, SvA = S w A and v E D l ( A ) , which contradicts the minimality of Iw(. Now let w' = zw where v € X*.Since w = a l a 2 . . . aizv, S w A = S ( a 1 ~ 2 . . . a i z v= ) ~TizAvA. Notice that Ti # T,. Hence Ti \ ( s 1 , s 2 ) # 8. Therefore, S w A = S ( a l a 2 . . . a i ~ v =) TizAvA ~ = SvA and v E D l ( A ) , which contradicts the minimality of IwI. This means that there is no w E D 1 ( A ) with IwI < 2n - n - 1. Hence d l ( A ) = 2n - n - 1. This completes the proof of the proposition.
+
+
We will first deaI with the value d l ( n ) and then the value d ~ ( n ) . The results are due to [48]. n
Lemma 8.3.4 Let n 2 2. Then d l ( n ) 5 c(;)(2k - 1) k=2
CHAPTER 8. DIRECTABLE AUTOMATA
174
n
Proof
Let n 1 2. We will show that dl(n) 5
C(;)(ak - 1). Let
k=2 A = ( S , X , 6 ) be a D1-directable automaton with n states and let w = aia2. * . a, E Di (A) such that ai E X, i = 1 , 2 , . . . ,T , r 1 1 and IwI = r = di(A). Since w E D l ( A ) , there exists so E S such that s w A = {so} for any s E S. For any i = 1 , 2 , . . . , r , we define the (2) Ti= {t E SiI set Si and Ti as follows: (1) Si = S ( u l a 2 . . . t(ai+1ai+2. * * a , ) A= {so}}. Let s E S and let i = 1,2, . . . ,r . Since s(ala2 . . . aiai+l . . . a,)A = (s(a1a2.. . c ~ i ) ~ ) ( a i.+. .la,)A = {SO}, we have s(a1a2.. . a i ) A n Ti# 8. Let S = SO= TO.Consider the set { (Si,Ti) I i = 0,1,2, . . . ,r - 1). It is obvious that Si # 8 for any i = 0 , 1 , . . . ,r - 1. It is also obvious that I S01 # 1. Suppose that lSil = 1 for some i = 1 , 2 , . . . ,r-1. Then Si = Ti = { t } for some t E S. By the definition of Ti, this means that ai+lai+2.. . a, E D l ( A ) , which contradicts the minimality of IwI. Therefore, lSil # 1 for any i = 1 , 2 , . . . ,n. Hence the set {(Si,Ti) I i = 0 , 1 , 2 , . . . ,r - l} does not contain any ( { s } ,{ s } ) with SO # s E S . Now assume that (Si,Ti) = ( S j ,T’) for some i , j = 1 , 2 , . . . ,r 1,i < j. Then it can be seen that ala2 - aiaj+laj+2.. . a, E Dl(A), which contradicts the minimality of IwI.Hence all (Si,Ti),i = 0,1,2, . . . , r - 1, are distinct. Therefore, I{ (Si,Ti) i = 0, 1,2, . . . , T - 1}1 5 + .
I
n
n
c ( L ) ( 2 k - 1) and hence r 5 c ( ; ) ( 2 k k=2 k=2 proof of the lemma.
-
1). This completes the
To determine the value d1(2), we consider the following example.
Example 8.3.1 Let A = ({1,2}, {a,b, c}, 6) be the following nondeterministic automaton: (1) l a A = {l,2} and 2aA = (2). (2) l b A = 8 and 2bA = {1,2}. (3) lcA = (1) and 2cA = 0. Then abc is a shortest D1-directing word of A . By Lemma 8.3.4, d l ( 2 ) 5 3. Therefore, d l ( 2 ) = 3.
Lemma 8.3.5 Let n
2 3.
Then 2n - n 5 dl(n).
Proof For n = 1,2, obviously the lemma holds true. Assume n 2 3. We will construct a D1-directable automaton A = ( S ,X , 6) such that
8.3. CLASSES OF REGULAR LANGUAGES
175
IS1 = n and d l ( A ) = 2n - n. Let S be a finite set with (SI= n and let {Tl,T2,.. . ,T,} = {T c S 1 JTI2 2). Notice that T = 2n - n - 2. Moreover, we assume that 12'1 2 IT21 2 - . . L IT,[, {so} = S \TI and T, = {sl, s2}. Now we construct the following nondeterministic automaton A = ( S , X , b ) : (1) X = {a1,a2,. . . ,a,,b}. (2) For any i = 1 , 2 , . . . ,T - 1,s a t = Ti+l if s E Ti and s a t = S , otherwise. (3) s l a t = s2a: = {sl} and s a t = S if s E S \ {q,sp}. (4) sobA = 0 and sbA = 71' for any s E S \ {SO}. Let s E S and let i = 1 , 2 , .. . ,T . Notice that s(aibala2. a,)A = {sl} and hence a i b a l a 2 . . . a T E D1(A). Moreover, since sobA = 8, we have bX*nD1(A) = 8.Let i , j = 1 , 2 , . . . , T . Then S ( ~ i a j=) S~ . On the other hand, ~ ( a i b=) 7~1' for any s E S. This means that u E aibX* if u is a shortest D1-directing word of A . Let i = 1,2, . . . ,T - 1. Then Ti(ai~j)~ = Ti+luf = S if j > i 1 and Ti(ai~j)~ = Ti+luf = T'+l if j 5 i. Notice that in the latter case j 1 5 i+ 1. This implies that u is not a shortest D1-directing word of A if u E X*aiajX* where j # i 1. Moreover, since SbA = 7'1, u is not a shortest D1directing word of A if u E X X + b X * . Consequently, aibalaa . . . a, is a shortest D1-directing word of A , i.e. d l ( A ) = T 2 = 2n - n. This completes the proof of the lemma. 9
+
9
+
+
+
Thus we have the following. n
Proposition 8.3.9 Let n
2 2.
Then 2n
-n
5 dl(n) 5 c(F)( -2k k=2
1). Notice that dl(1) = 0 and d1(2) = 3. Before dealing with the value d3(n), recall that a nondeterministic automaton A = (S,X,6 ) is said to be of pf-type if J s a A J5 1 for any s E S and any a E X .
Remark 8.3.1 Let A be a nondeterministic automaton of pf-type. Then D3(A) = D l ( A ) . Let A = ( S ,X , 6) be a D3-directable automaton of pf-type. Consider the following procedure P : Let u E D3(A). Assume that u = 2 ~ 1 2 ~ 2 2where ~3 u 1 , u g E X*,u2 E X + and S u l A = S ( u 1 ~ 2 ) ~ . Then procedure P can be applied as u jP~ 1 ~ 3 .
CHAPTER 8. DIRECTABLE AUTOMATA
176
Then we have the following result.
Lemma 8.3.6 I n the above procedure, we have
u1u3
E D3(A).
Proof Let A = ( S , X , 6 ) be a nondeterministic automaton of pftype. Moreover, let u = u1uzu3 where u1,ug E X * , Z L ZE X+ and S u l A = S ( u 1 ~ 2 ) ~Since . u E D 3 ( A ) , there exists so E S such that suA = {SO} for any s E S . From the assumptions that S u l A = S ( u 1 u ~ and ) ~ A is a nondeterministic automaton of pftype, it follows that suA = S ( U ~ U Z U=~ S('ZL1U3)A ) ~ = {SO} for any s E S. By Remark 8.3.1, this means that ~ 1 E D ~ 3 (3A ) . Let A = ( S , X , 6 ) be a D3-directable automaton of pf-type and let ~ l a 2 . 9 . aE~ D 3 ( A ) such that 3 s , t E S , s # t , s a l A = t a l A . Assume that 'u E D 3 ( A ) ,'u = ' ~ 1 ~ 2' u~1 , 213 3 , E X*, vz E X + , l S q A l = I S ( V ~ Vand ~ ) {s, ~ (t } C S q A . Then procedure Q(s,t)can be applied as 'u + Q ( s , t ) 'ulala2 . . . a,. Then we have the following result.
Lemma 8.3.7 I n the above procedure, we have v l a l a p . . . a, E D 3 ( A ) and lSvlAl > I S v l a l A J .
Proof Let s E S. Since v = ' ~ 1 ~ E2 D ~ 33 ( A ) , we have sviA # 0, actually Is'ulAI = 1. Notice that 3s, E S , 'dt E S, t ( a l a 2 . . . a,)A = {sr}. Therefore, s ( ' u l a l a 2 . .. a,)A = ( s q A ) ( a l a 2 ...a,)A = {s,} and hence wlala2. a, E D 3 ( A ) . Since A is of pf-type and {s,t } C S'ulA, lS'ulAl 2 lSvlalAl 1. This completes the proof of the lemma. +
.
+
Lemma 8.3.8 Let A = ( S ,X , 6 ) be a D3-directable automaton such that I S1 = n and d 3 ( A ) = d3(n). T h e n there exists a nondeterministic automaton B = ( S ,Y,y) of pf-type such that d 3 ( B ) = d 3 ( n ) . Proof Let u = alaz...a,E D 3 ( A ) with I uI = d 3 ( A ) . Since u E D 3 ( A ) ,there are s, E S and a sequence of partial functions of S into S,p 1 , p 2 , . . . , p T such that s(ala~...ai)~ 2 pi(pi-l(...(pl(~))...)) for any s E S and any i = 1 , 2 , .. . ,T . Furthermore, p r ( p r - l ( . * * ( p l ( s ) ) ...)) = {s,} for any s E S . Now we define the pf-type automaton B = (S,Y,7 ) as follows: (1) Y = (bi I i = 1 , 2 , .. . , r } . Remark that
8.3. CLASSES OF REGULAR LANGUAGES
177
. . ,br are distinct symbols. (2) sbiB = p i ( s ) for any s E S and any i = 1,2,.. . ,r.
bl, b2,.
Then B is a nondeterministic automaton of pf-type. Moreover, it is obvious that b1b2 . * . br E D3(B). Suppose that bi, bi, - .. bi, E D3(B) where ii, 22, . . . ,ik E { 1,2,. . . ,r}, Then we have ailai, . . . aik E D3(A). Therefore, k 1 T and T = d3(B). This completes the proof of the lemma. We are now ready to determine an upper bound for d3(n).
Proposition 8.3.10 For any n 2 3, &(n) 5
n - 1.
x(i)- xri2) +
n-1
n-2
k=2
k=O
Proof Let A = ( S , X , 6 ) be a nondeterministic automaton of pftype such that IS[= n and d3(n) = &(A). Moreover, let u = a1a2*..ar E DS(A) with T = d3(n). Let Si = S ( U ~ U ~ *for *.U~ i = l12,...,r. Since A is of pf-type and r = d3(n) = &(A), IS( > IS11 1 IS,( 2 2 ISr-11 > ISr(= 1. Let Sr = {ST}. By Lemma 8.3.6, S, S1, S2,. . . , Sr-l and Sr are distinct. Moreover, since IS1 > IS11, there exist so, s1 E S such that so # s1 and soulA = slalA. Therefore, we can apply for procedure &(so,s1) to a1a2...ar if necessary and we can get ~ 1 ~ 2 2. .a, . +Q(s,t) v l a l a 2 . . . a,. Now we apply for procedure P to v l a l a 2 . . . a, a s many times as possible until we cannot apply for procedure P anymore. Hence we can obtain v2 E D3(A) with lv2l 5 21’1 - JSJ.Then we apply for procedure Q(,,,,,) to v2. We will continue the same process until we cannot apply for neither procedure P nor &(so,s1) anymore. Notice that this process will be terminated after a finite number of applications of procedures P and Q(so,sl). Let w = c1c2 - . cs, ci E X , i = 1,2,. . . ,s be the lastD3-directing word of A which was obtained by the above process. Let Ti = S(clc2 . . . ~ i for)any~ i = 1,2,. . . , s. Then Ti # Tj for any i , j = 1,2,.. . ,s with i < j and { T I T2,. , . . ,T,} contains at most n - 2 elements T i , i = 1,2,.. . , s with T, 2 {so, s l } . Since
x(ni2)
n-3
({T S S
1
{so,$1) 2 T } (=
and by the above observation,
k=O
CHAPTER 8. DIRECTABLE AUTOMATA
178 we have
Regarding the lower bound for d3(n),we have the following result.
Proposition 8.3.11 Let n 2 3. Then d3(n) 1 2m (d3(n)>_ 3 2m-1 + 1 if n = 2m I).
+
+ 1 if n = 2m
Proof Let n 1 3 and let S = {1,2,. . . , n } . Moreover, let S1 = (1,2}, let Sz = {3,4}, . . ., let Sm-1 = (2m - 3,2m - 2) and let Sm = (2m - 1,2m} if n = 2m (Sm = (2m - 1,2m,2m 1) if n = 2m 1). We define the following D3-directable automaton A = ( S ,X, 6):
+
+
(1) {Tl,TZ,...,Tk}= ((nl,nZ,...,nm}I (nl,nZ,...,nm)E s1 x S 2 x . . . x S m )w h e r e k = 2 m i f n = 2 m ( k = 3 . 2 m - 1 i f n = 2 m + 1 ) . (2) TI = (1,3,5,. . . ,2m - 1). (3) X = (a,b l , b z , . . . ,bk-2, b k - - 1 , ~ ) . (4) laA = 2aA = (I}, 3aA = 4aA = {3}, . . . , (2m - 3)aA = (2m 2)aA= (2m - 3) and (2m - l)aA = (2m)aA= (2m - l} if n = 2m ((2m - 1)aA = (2m)aA = (2m 1)aA = (2m - 1) if n = 2m I). ( 5 ) Let i = 1 , 2 , .. . , k - 1. By p i , we denote a bijection of Ti onto Ti+l. Then tbiA = pi(t) for any t E Ti and tbiA = 8, otherwise. (6) tcA = (1) for any t E Tk and tcA = 8, otherwise.
+
+
Then it can easily be seen that ablb2 bk-1C is a D3-directing word of A . Notice that C U , QCU, ablcu, ablbzcu, . . . , ablb2. * . bicu 6 D3(A) for any i = 1 , 2 , . . . , k - 2 and any u E X * , and TiaA= TI for any i = 1 , 2 , . . . , k . Hence ablb2.. . b & l C is a shortest D3-directing word of A . Therefore, d3(n) 1 2m+ 1 if n = 2m (ds(n)2 3 .2m-1 1 if n = 2m 1). e
+
+
+
Finally, we consider the values cd2(n)and dz(n>.
Proposition 8.3.12 For n 2 2, 2n - n - 1 5 cdz(n) 5 d2(n) I + (2n - 2)(”,”).Remark that cda(1) = dz(1) = 0.
<
Proof Let n 2 2. It is obvious that cdz(n)5 d2(n).The automaton A in the proof of Theorem 8.3.1 shows that 2n - n - 1 5 cdz(n). Let A = ( S ,X, 6 ) be a D2-directable automaton with n states and
8.3. CLASSES OF REGULAR LANGUAGES
179
let w E Dz(A) such that IwI = d z ( A ) . We construct the following finite automaton B = ( { T I T L S } , X , 7 ) : (1) For any T G S and a E X,TaB = taB.
u
tET
Then dz(A) = d ( l 3 ) . Notice that J{T 1 T C S}l = 2n. By Proposition 8.1.3, d ( B ) < 1 (2n - 2)(2,”). Thus 2n - n - 1 5 cd2(n) L d2(72) < 1 (2” - a)(”,”).
+
+
Now we introduce some results on the value of cd3 (n).The results are due to [30]. Let A = ( S , X , 6 ) be a nondeterministic automaton. A word w E X* is said to be a D3-merging word for a pair of two states s , t E if swA n t w A # 8.
s
Proposition 8.3.13 A complete nondeterministic automaton A = (S,X , 6) is Ds-directable if and only if there exists a D3-merging word for any pair of s, t E S.
(+) Obvious from the definition of Ds-directability. (+) Let T S be a maximal subset of S satisfying the following
Proof
s
condition: There exists a word w E
X”such that n t w A # 8. tET
If T = S, then A is Ds-directable. Assume T # S. Let s E S \ T and let t’ E o w A . Consider s w A C S. Notice that swA # 8 tET
because A is complete. Since there exists a Ds-merging word for the pair t‘ E S and s’ E swA, there exists w‘ E X * such that t w / A n s ’ w ’ ~# 8. Thus t(ww’)A # 8, which contradicts
n
tETU{s}
the maximality of T . Hence S = T and A is D3-directable.
Lemma 8.3.9 Let A = (S,X,S) be a nondeterministic automaton with IS1 = n. If there exists a D3-merging word for s , t E S , then there exists a D3-merging word w E X* for s, t E S such that IwI 5
(3. Proof Let s , t E S and let w = alaa...a,E X* where r 1 1 and a l , a2, . . . , a, E X , be a shortest D3-merging word for s,t E S.
CHAPTER 8. DIRECTABLE AUTOMATA
180
Then swA f l t w A # 8. Let (s1,t l ) E saf x t a f , (SZ,t z ) E s ( a 1 a ~ x) ~ t ( u l a 2 ) A l . . , ( S T - 1 , t r - 1 ) E s(a1a2 * * . aT-l)A x t ( a 1 a z . * ’ a,-l)A. suppose ?- > (;). Then there exist i , j = 1 , 2 , . . . ,?- - 1,i j such that ( s i , t i } = { s j , t j } . Assume that si = s j and ti = t j . Then s(a1az.. . azaj+1aj+2 * . . aT-la,)A n t ( a l a 2 . .. u ~ u ~ + ~. .ua,-~ + 1 a,) ~ A. # 8, i.e. a1a2.. . aiaj+laj+z. . . a,-la, is a D3-merging word for s, t E S, which contradicts the minimality of IwI. Let si = t j and ti = s j . We have also s ( a l a 2 . . . aiaj+laj+2. . aT-laT)Ant(ala2.. , aiaj+laj+z . . . aT-laT)A# 8 , i.e. ~ 1 ~ 2. aiaj+laj+;! . . . . a,-la, is a D3-merging word for s , t E S, which contradicts the minimality of J w J .Consequently, IWI I (;).
<
Lemma 8.3.10 Let A = ( S ,X , 6) be a complete D3-directable automaton with I S1 = n and let T b e a subset o f S with \TI = m. Then t w A # 0 and IwI 5 ( m - 1)(;). there exists w E X* such that
n
tET
Proof We prove the lemma by induction on 17’1. For \TI = 2, by Lemma 8.3.9, the lemma holds true. Assume that the lemma holds true for IT1 = m - 1. Now let T = { t l , t 2 , . . . , tm-1, tm}. By Lemma 8.3.9, there exists w1 E X * such that lwll 5 );( and tm-1wlA n t m w l A # 8. Let tlrnVlE tm-lwlA n tmwlA, let t’l E t1wlA, let t‘2 E t Z w l A , . .., let t l r n - 3 E trn-3wiA and let tlm-2 E tm_2wlA. Then, let T‘ = {t’l,t’z, . . . ,tlm-2, t l m - l } . By the induction hypothesis, there exists w2 E X * such that t ( w z ) A # 8 and ( w ~5( ( m - 2)(:). t’ET’
Then we have r ) t ( w l w z ) A 2
+
tET
+
n t ( ~ ~ w#2 8.) ~Here lwlwzI
=
VET’
(w1( lwzl 5 );( (m - 2)(;) = ( m - I)(;). This completes the proof of the lemma.
+
Proposition 8.3.14 Let n 2 1. Then ( n - 1)2 5 cd3(n) 5 1 (n2)
(3.
Proof That ( n - 1)2 5 cds(n) follows from Proposition 8.1.2. Let A = (S,X , 6) be a complete nondeterministic automaton such that Ds(A) # 8. Let w be a shortest D3-directing word of A. If A is a deterministic automaton, then cd3(n) 5 d ( n ) . Now assume that A is not deterministic, i.e. there exist a E X and s E S such that
8.4. COMMUTATIVE CASE
181
A Isa 1 1 2. Since A is complete, a is a Ds-merging word for some two distinct states in S . Then there exists a subset T of S such that 0 < JTJ5 n - 1 and suA n T # 0 for any s E S . By Lemma 8.3.10, there exists w E X * such that n t w A # 0 and IwI 5 (n- 2)(;).
n~ ( a w#) 0~and (awl 5 tET
Therefore,
1
+ (n- 2)(;).
Thus c d s ( n ) 5
S€S
1
+ (n- a)(;).
8.4
Commutative case
In this section, we will deal with commutative nondeterministic automata and related languages alongside the same line as that of the previous section. A nondeterministic automaton A = ( S , X , S ) is called commutative if ~ ( a b = ) ~~ ( b a holds ) ~ for any s E S and any a , b E X . By C’E,C’&D(i) and ,C‘NXD ( j ) , i , j = 1 , 2 , 3 , we denote the classes of regular languages of directing words of deterministic commutative automata, of Di-directing words of complete commutative nondeterministic automata, and of Dj-directing words of commutative nondeterministic automata, respectively. Since it is easy to verify that = C””’ CND(i) - C’{”’ ND(i) = iana* ln> - l} for any i = 1,2,3, we assume that 1x1 2 2.
,C’g’
Then we have the following result, Proposition 8.4.1 Let L C X * . Then L E C’f: if and only if L 8, L is regular and commutative, and L = L o X * .
#
Proof (+) First notice that L is a commutative regular language. By Proposition 8.3.1, X * L X * = L . Since L is commutative, X * L X * = L O X * and hence L = L o x * . (+) The proof can be given in the same way as in Proposition 8.3.1. A nessary task is only to check the following: Vu,v E X * , [uv] = [‘uu], i.e. 2/21 = ‘uu(PL). However, this is obvious from the assumption that L is commutat ive .
CHAPTER 8. DIRECTABLE AUTOMATA
182
Corollary 8.4.1
c
Proof It is obvious that L’; E c’&,D(2) L’&(2). Therefore, to prove the corollary, it is enough to show that L’g = L’GD(2). Assume that L E L’$D(z). Then by Lemma 8.3.1, L = L X * where L is a commutative regular language. Since L and X * are commutative, L = L X * = L o X * . By the above proposition, L E L’g and hence L’X D - L’&(2). Corollary 8.4.2 The class L’t is closed under union and intersection.
Proof Let L , M E L’g. Then LU M is regular. Moreover, LU M = ( L o X * ) U ( M o X * ) = ( L U M o X * . Therefore, by the above proposition, L U M E L’;, i.e. LID is closed under union. Let u E L and v E M . Then uv E u o v and uv E L n M , i.e. L n M # 0.Furthermore, LFlM = ( L n M ) o X * .Hence L n M E L’g. This means that L’g is closed under intersection.
B
Proposition 8.4.2
L’g = L’gND(1)
= L’gDN(3).
Proof Let i = 1,2. Then it is obvious that L’g C_ L’&D(i). Let 0 # L E L’gDN(il. Then there exists a commutative complete automaton A = ( S , X , S ) such that L = D i ( A ) . Let x u v y E D i ( A ) where x , u , v , y E X * . Since ~ ( x u v y = ) ~~ ( x v u y for ) ~ any s E S , x v u y E D i ( A ) = L. Hence L is commutative. Since A is complete, X * D i ( A ) = D i ( A ) , i.e. X * L = L . As L is commutative, X * L = L o X * . Therefore, L = L o X * . By Proposition 8.4.1, L E L’;, i.e. L/; = L ’ E N D ( ~ ) . Now we provide a characterization of the classes L’GD(ll and
L‘&S).
C X*and let i = 1 , 3 . T h e n L E L’:D(i) if and only if there exist 0 # Y C X and afinite nonempty commutative
Proposition 8.4.3 Let L
language LO Y * such that L = Lo o Y * .
8.4. COMMUTATIVE CASE
183
Proof (+) Let L E L’$D(i).Then there exists a commutative nondeterministic automaton A = ( S , X , S ) such that Di(A) = L. Let Y = {a E X I ‘v’s E S , s a A # 0). It follows from L # 0 that Y # 0. Suppose that there exists a E X \ Y such that a E alph(L). Then there exists u E X* with au E L . Then there exists s E S such that ~ ( a u=) 0.~ This contradicts the fact that au E Di(A) = L. Therefore, L C_ Y * . Let LObe the shuffle base of L . Recall that the shuffle base is a hypercode and hence it is finite. Moreover, since L is commutative, Lo is commutative. I t is also obvious that L = LE. On the other hand, since svA # 0 for any s E S and any v E Y * ,Y*Lo C L and in fact Y*Lo = L. As LOis commutative, L = Y*Lo = LOo Y * . ( e )By Proposition 8.4.1, there exists a commutative nondeterministic automaton A = ( S ,Y ,6) such that L = Di(A). We will construct the commutative nondeterministic automaton B = ( S ,X , y) as follows: (1) ,aB = saA for any s E S and any a E Y . ( 2 ) ,aB = 0 for any s E S and any a E X \ Y . Then obviously L = D i ( B ) and B is commutative because ~ ( a b ) ~ = ~ ( a b=) ~ ( b a =) ~ ( b afor ) ~any s E S and any a , b E Y and, ~ ( a b =) ~0 = ~ ( b a for ) ~any s E S and any a E X \ Y , b E X . Therefore, L E L’GD(l). Corollary 8.4.3 L’&l) = L’&(3) and L’g
c L’cD(l).
Proof That L’GD(,) = L’GD(3)is obvious from Proposition 8.4.3. First, it is obvious that L’g L’GD(l). Let a E X and let > 1. Then, by Proposition 8.4.3, a+ E L’$D(l). However, a+ $ L’g. Hence L’g c L’GD(l).
1x1
Corollary 8.4.4 L’$D(l) is neither closed under union nor closed under intersection.
1x1
> 1. Then a+, b+ E L’&(l) where a , b E X,a # b. By Proof Let Proposition 8.4.3, a+ U b+ E L’&l), i.e. L’CD(,)is not closed under intersection. Now consider a+ n b+ = 0 and hence a+ n b+ $ L’GD(ll. Consequently, L’:D(ll is not closed under intersection.
CHAPTER 8. DIRECTABLE AUTOMATA
184
Here are the inclusion relations for the 7 classes of commutative regular languages.
L’CD(I)
pD
= “CD(3)
- L / 6 D ( 2 ) = L’END(l) = L’END(2)
=
Figure 8.2: Commutative case We will consider the shortest directing words of commutative nondeterministic automata. Let i = 1 , 2 , 3 and let n 2 1. Then cd,,(i,(n) denotes the value maz{di(A) I A = ( S ,X, 6 ) : commutative, A E CDir(i) and (SI= n}. Notice that in the definitions of d,,o(n) and cdcO,(q(n), X ranges over all finite nonempty alphabets. Example 8.4.1 Let n 1 2 and let A = ({1,2,. . . ,n } ,{ a } , 6 ) be the nondeterministic automaton such that l A= {1,2}, i a A = {i l} for any i = 2,3, . . . , n- 1 and nuA = { l}. Notice that A is commutative. Then it can be verified that i(a2n-2)A= {1,2,. . . ,n } for any i = 1 , 2 , . . . , n but 2(ak)’ = (2 k } for any k = 1 , 2 , . . . , n - 2 and 2 ( a k ) A = {1,2,.. ., k - n + 2 ) for any k = n - l , n , . . . , 2 n - 3. This means that azn-’ is the shortest D2-directing word of A. i.e. d z ( A ) = 2 n - 2. Consequently, d,,(2)(n) 2 2n - 2.
+
+
Lemma 8.4.1 Let A = ( S ,X, 6) be a commutative nondeterministic automaton. Let i = 1,3, let Li = Di(A) and let Y = aZph(Li). If Di(A) # 8, then ,aA # 8 f o r any s E S and any a E Y . Proof Let s E S and let a E Y . Since a E alph(Li), there exist u , v E X* such that uav E Li and hence auv E Li. Therefore, ~ ( a u v=) S~ ( ~ u v#) 8~ for any s E S . Thus saA # 8
8.4. COMMUTATIVE CASE
185
Lemma 8.4.2 Let n 2 1 and let i = 1,2,3. Then we have dmm(q(n) = cd,,(i) (n) fur any n _> 1.
Proof It is obvious that cd,,(,)(n) 5 dcom(i)(n). First consider the cases i = 1,3. Let A = (S,X , 6) be a commutative nondeterministic automaton such that &(A) = d,,(i)(n). If A is complete, then dcom(i)(n) = cdcom(i)(n).Now assume that A is not complete. Let Li = Di(A) and let Y = aZph(Li). By Lemma 8.4.1, Li C_ Y * . We construct the following nondeterministic automaton B = (S,Y,r): suB = ,aA for any s E S and any a E Y . Notice that B is complete, commutative, I S 1 = n and d i ( B ) =
(4.Hence &?m(i) (4 = C L 7 L ( Z ) (4. Now we consider the case i = 2. For n = 1 , 2 , it is obvious that dcom(2)(n)= cdco,(z)(n). Hence we assume that n > 2. Let A = (S,X , 6) be a commutative nondeterministic automaton such that & ( A ) = d,,(z)(n). Let u = alaa...a, be a shortest Dz-directing word of A. If SuA # 0, then we construct the following commutative nondeterministic automaton B = ( S , Y , y ) where Y = { a E X I Vs E S,saA # S} and suB = ,aA for any s E S and any a E Y . By Lemma 8.4.1, B is complete. Furthermore, u is a shortest word in DZ(B), i.e. GJm(z)(n)I d Z ( B ) . Hence dcom(2)(4 5 Cdco,(2)(72). Therefore,Z)(,~, (4 = Cdcom(2) (4. Now assume SuA = 0. Notice that SuA = USESsuA 2 S ( V U = )~ S ( U V for ) ~ any u,v E X*. Hence S a f 2 S(alaz)A2 . . . 1S(a1az.. . ar-l)A 2 S(a1a2 * * . a,)A = 0. If S ( a 1 a 2 . * * U j ) A = S ( U l U , . . . a j + p f o r s o m e j = 1 , 2, . . . ,n-1, thenS(alaz...uj-laj+l...~,)~ =@and a1a2 . . . aj-laj+l . . . a, E Dz(A), which contradicts the assumption that alaz.. . a, is a shortest Dz-directing word of A. Therefore, sup 3 S ( a p 2 ) A 3 * . . 3 S ( U 1 U ~* * . U,-l)A 3 S(a1az.. . a,)A = 0. Since I S1 = n, r I n and hence dcom(2) (n)I n. Recall that 2n - 2 5 dcom(2)(n)(see Example 8.4.1). This yealds a contradiction. Thus ~com(2)
dcom(2)
(4= ~ ~ m m ((4. 2)
Theorem 8.4.1 For any n 2 1,dmm(l)(n)= ~d,,(~)(n) = n - 1.
Proof Let A = ( S , X , 6 ) be a commutative nondeterministic automaton with IS\= n. Assume that D1(A) # 0. Let u = alaz . . . a,
CHAPTER 8. DIRECTABLE AUTOMATA
186
be a shortest word in D1(A) where T 1 1 and a l , a 2 , . . . , a , E X. Then S a t 2 S ( a ~ a z2) ~. . . 1S(ala2. . . a,)A where IS(ala2.. . - 1. If S ( a l a 2 . . . ~ j = ~) ( a ~l a 2 . ~ j + l for ) ~some j = 1 , 2 , . . . , n 1,then IS(ala2.. . a j - l a j + l . . . = 1 and a l a 2 . - .aj-laj+l . . . ar E Dl(A), which contradicts the minimality of IuI.Therefore, S a t 3 S(a1az)A 3 . . . 3 S(a1aa ~ . + a r )Since ~. S 3 Sat, I S 1 = n and IS(ala2.. . = 1, we have T 5 n - 1 and d m m ( l ) ( n ) = cdm,(l)(n)
+
Example 8.4.2 Let n 2 3 and let A = ( { 1 , 2 , . . . ,n } ,{a},S ) be the nondeterministic automaton such that l A= {2,3}, iaA = {i + 1) for any i = 2 , 3 , . . . ,n - 1 and nuA = {I}. Then A is commutative and complete. Lemma 8.4.3 Let A be the complete nondeterministic automaton in Example 8.4.2. Then &(A) = ( n - 1)2+ 1.
Proof It can easily be verified that ia(n-1)2+1- { 1 , 2 , 3,..., n } for any i = 1 , 2 , 3 , . .. , n but 2 ~ ( " - ~ )= ' { 1 , 3 , 4,..., n - 1,n} # { 1 , 2 , 3 ,. . . ,n}. Moreover, la(n-1)2 = { 1 , 2 , 3 , . . . ,n}. Therefore, a(n-1)2+1E D2(A) but u(n-1)29 D2(A). Since D2(A)X* = D2(A), &(A) = ( n - 1)2 1.
+
Lemma 8.4.4 Let A be the complete nondeterministic automaton in Example 8.4.2. Then d3(A) = n(n - 3) 3.
+
Proof
It can be easily seen that D2(A) n
Then we have n i ( u " ) A n
{ n ,l }
n
# 0.
# 8.
Let m = &(A).
Let j E n i ( u " ) A . If j = 1 , 2 , then
i=l
i=l
( ( 7 i ( u " - 1 ) A ) # 8 and &(A) < m, which is a contradiction. i=l
n
I f j > 3, then we have j - 1 E ni(P-l)A and &(A) < m, which is a i=l
8.4. COMMUTATIVE CASE
187
contradiction. Consequently, j = 3. It can easily be verified that 3 E for any i = 1,2,.. . ,n but 3 $! 2(an(n-3)f2)A.Hence ~ n ( 7 ' - 3 ) + ~E D3(A)but a7L(nP3)f2 $! D3(A). Since A is complete, D3(A)X*= D3(A). Therefore, &(A) = n(n - 3) 3.
+
+
Proposition 8.4.4 Let n 2 2. Then (n - 1)2 1 5 ~d,,(~)(n) = dcom(2)(n)I 2" - 2. For n = 1, C 4 m ( 2 ) ( 1 ) = &lm(2)(1) = 0.
For n = 1,2, obviously the proposition holds. Let n 3 3 and let A = ( S , X , 6 ) E CDir(2) with IS]= n. We construct the following complete nondeterministic automaton B = ({T C_ S 1 T #
Proof
01, x,4:
n
a T B = n t a A for any T,0 # T
5S
and any a E X.
tET
Then it is obvious that B is complete, I{T 2 S 1 T # 0}l = 2n - 1, and & ( A ) = d l ( B ) . By Theorem 8.4.1, d l ( B ) 5 2n - 2 and 4 ( A ) 5 2n - 2. Hence cda(n) = &(n) 5 2" - 2. Now we show that (n - 1)2 1 I cd2(n) = d2(n). Let A be the complete nondeterministic automaton in Example 8.4.2. By Theorem 8.4.1, we have & ( A )= (n - 1)2 1. Thus (n - 1)2 1 5 c&(n).
+
+
+
Proposition 8.4.5
Proof For n
= 1 , 2 , obviously the proposition holds. Let n
2 3 and
let A = ( S , X , 6 ) E CDir(3) with IS(= n. By Proposition 8.3.14, dcom(3)(A) 5 1 (n - a)(;). Hence cdCom(3)(n) = &(n) I 1 (n 2) (;). On the other hand, consider the complete nondeterministic automaton A in Example 8.4.2. By Lemma 8.4.4, n2 - 3n 3 = cdg(A).Hence n2 - 3n 3 I cdCom(3)(n) = dcom(3)(n).
+
+
+
+
This page intentionally left blank
Bibliography [l] T. Araki and N. Tokura, Decision problems for regular expressions with shuffle and shuffle closure operators, Transactions of Institute of Electronics and Communication Engineers of Japan, J64-D (1981), 1069-1073.
[a] T. Araki and N. Tokura, Flow
languages equal recursively enumerable languages, Acta Informatica 15 (1981), 209-217.
[3] B.H. Barnes, Groups of automorphisms and set of equivalence classes of input for automata, Journal of the Association for Computing Machinery 12 (1965), 561-565. [4] B.H. Barnes, On the groups of automorphisms of strongly connected automata, Mathematical Systems Theory 4 (1970), 289294. [5] R. Bayer, Automorphism groups and quotients of strongly connected automata and monadic algebras, Report No. 204, Department of Computer Science, University of Illinois (1966). [6] Z. Bavel, Structure and transition-preserving functions of finite automata, Journal of the Association for Computing Machinery 15 (1968), 135-158. [7] B. Berard, Literal shuffle, Theoretical Computer Science 51 (1987), 281-299. [8] J. Berstel and D. Perrin, Theory of Codes, Academic Press, New York, 1985.
189
190
BIBLIOGRAPHY
[9] G. Birkhoff, Lattice Theory, Providence, R.I. AMS, 1967. [lo] H.V. Burkhard, Zum Langenproblem homogener experimente an determinierten und nicht-deterministischen automaten, Elektronische Informationsverarbeitung und Kybernetik, EIK 12 (1976), 301-306. [ll] J. Cernf, Poznhmka k homoghym experimentom s koneEinfmi automatami, Matematicko-fysikalny Casopis SAV 14 (1964), 208215.
[12] A. Clifford and G.B. Preston, The Algebraic Theory of Semigroups I, Mathematical Survey of the American Mathematical Society 7, Providence, R.I., 1961 (1964), 208-215. [13] A. Clifford and G.B. Preston, The Algebraic Theory of Semigroups 11, Mathematical Survey of the American Mathematical Society 7, Providence, R.I., 1967 (1964), 208-215. [14] C. CBmpeanu, K. Salomaa and S. Vhgvolgyi, Shuffle quotient and decompositions, Lecture Notes in Computer Science 2295 (Springer) (2002), 186-196. [15] S. Eilenberg, Automata, Languages and Machines, Vol A, Academic Press, New York, 1974. [16] S. Eilenberg, Automata, Languages and Machines, Vol. B, Academic Press, New York, 1976. [17] A. C. Fleck, Isomorphism groups of automata, Journal of the Association for Computing Machinery 9 (1962), 469-476. [18] A. C. Fleck, On the automorphism group of an automaton, Journal of the Association for Computing Machinery 12 (1965), 566569.
[19] S. Ginsburg, The Mathematical Theory of Context-flee Languages, McGraw Hill, New York, 1975. [20] A. Ginzburg, Algebraic Theory of Automata, Academic Press, 1968.
BIBLIOGRAPHY
191
[21] J. W. Grzymala-Busse, On the strongly related automata, Foundations of Control Engineering 3 (1978), 3-8. [22] M. Hall, The Theory of Groups, Macmillan, New York, 1959. [23] J. Hartmanis and R. E. Steams, Algebraic Structure Theory of Sequential Machines, Prentice-Hall, 1966. [24] J.E. Hopcroft and J.D. Ullman, Introduction to Automata Theory, Languages and Computation, Addison-Wesley, Reading MA, 1979. [25] B. Imreh and M. Ito, On some special classes of regular languages, in Jewels are Forever (edited by J. Karhumaki et al.) (1999) (Springer, New York), 25-34. [26] B. Imreh and M. Ito, On regular languages determined by nondeterministic directable automata, Acta Cybernetica, to appear. [27] B. Imreh, M. Ito and M. Katsura, On shuffle closures of commutative regular languages, in Combinatorics, Complexity and Logic (edited by D.S. Bridges et al.) (1996) (Springer, Singapore), 276288. [28] B. Imreh, M. Ito and M. Steinby, On commutative directable nondeterministic automata, in Grammars and Automata for Strings: Prom Mathematics and Computer Science to Biology, and Back (edited by C . Martin-Vide et al.) (2003) (Taylor and Francis, London), 141-150. [29] B. Imreh and M. Steinby, Some remarks on directable automata, Acta Cybernetica 12 (1995), 23-36. [30] B. Imreh and M. Steinby, Directable nondeterministic automata, Acta Cybernetica 14 (1999), 105-115. [31] M. Ito, A representation of strongly connected automata, Systems-Computers-Controls 7 (1976), 29-35. [32] M. Ito, Strongly connected group-matrix type automata whose orders are prime, Transactions of Institute of Electronics and Communication Engineers of Japan E59 No. 9 (1976), 6-10.
192
BIBLIOGRAPHY
[33] M. Ito, Generalized group-matrix type automata, Transactions of Institute of Electronics and Communication Engineers of Japan E59 No. 11 (1976), 9-13. [34] M. Ito, A representation of strongly connected automata and its Applications, Journal of Computer and Systems Science 17 (1978), 65-80. [35] M. Ito, Input sets of strongly connected automata, Fundamentals of Computation Theory, Band 2 (1979), 187-192. [36] M. Ito, Some classes of automata as partially ordered sets, Mathematical Systems Theory 15 (1982), 357-370. [37] M. Ito, On small categories whose sets of objects form lattices, Colloquia Mathematica JBnos Bolyai Vol. 39 (North Holland, Amsterdam) (1985), 83-96. [38] M. Ito, Shuffle decomposition of regular languages, Journal of Universal Computer Science 8 (2002), 257-259. [39] M. Ito and J. Duske, On cofinal and definite automata, Acta Cybernetica 6 (1983), 181-189. [40] M. Ito, L. Kari and G. Thierrin, Insertion and deletion closure of languages, Theoretical Computer Science 183 (1997), 3-19. [41] M. Ito, L. Kari and G. Thierrin, Shuffle and scattered deletion closure of languages, Theoretical Computer Science 245 (2000), 115- 134. [42] M. Ito and M. Katsura, On transitive cofinal automata, Mathematical Aspects of Natural and Formal Languages (1994) (World Scientific, Singapore), 173-199. [43] M. Ito, C.M. Reis and G. Thierrin. Adherence in finitely generated free monoids. Congressus Numerantium 95 (1993), 37-45. [44] M. Ito, P.V. Silva, Sremarks on deletion, scattered deletions and related operations on languages, in Semigroups and Applications (edited by J. J.M. Howie et al.) (1998) (World Scientific, Singapore), 97-105.
BIBLIOGRAPHY
193
[45] M. Ito and R. Sugiura, n-Insertion on languages, to appear in Aspects of Molecular Computing. [46] M. Ito and G. Tanaka, Dense property of initial literal shuffles, International Journal of Computer Mathematics 34 (1990), 161170. 1471 M. Ito, G. Thierrin and S.S. Yu, Shuffle-closed languages, Publicationes Mathematicae of Debrecen 46/3-4 (1995),1-21. [48] M. Ito and K. Tsuji, Some shortest directing words of nondeterministic directable automata, submitted. [49] K. Iwama, Universe problem for unrestricted flow languages, Acta Informatica 19 (1983), 85-96. [50] M. Jantzen, Extending regular operations with iterated shuffle, Theoretical Computer Science 38 (1985), 223-247. [51] J. Jedrzejowicz, Nesting of shuffle closure is important, Information Processing Letters 25 (1987), 363-367. [52] J. Jedrzejowicz, Infinite hierarchy of shuffle expressions over a finite alphabet, Information Processing Letters 36 (1990), 13-17. [53] J. Jedrzejowicz, Undecidability results for shuffle languages, Journal of Automata, Languages and Combinatorics 1 (1996), 147159. [54] L. Kari. On insertion and deletion in formal languages, PhD Thesis, University of Turku, 1991. [55] M. Katsura, Automorphism groups and factor automata of strongly connected automata, Journal of Computer and Systems Science 36 (1988), 25-65. [56] M. Lothaire, Combinatorics on Words, Addison-Wesley, Reading, 1983. [57] Y . Masunaga, N. Noguchi and J. Oizumi, A structure theory of automata characterized by group, Journal of Computer and Systems Science 7, 300-305 (1973).
194
BIBLIOGRAPHY
[58] J.-E. Pin, Sur les mots synchronisants dans un automata fini, Elektronische Informationsverarbeitung und Kybernetik, EIK 14 (1978), 297-303. [59] J.-E. Pin, Sur un cas particulier de la conjecture de Cerny, Automata, Lecture Notes in Computer Science 62 (Springer) (1979), 345-352. [60] I. Rystsov, Exact linear bound for the length of reset words in commutative automata, Publicationes Mathematicae of Debrecen 48 (1996), 405-409. [61] I. Rystsov, Reset words for commutative and solvable automata, Theoretical Computer Science 172 (1997), 273-279 [62] A. Salomaa, Formal languages, Academic Press, New York, 1973. [63] Y. Shibata, On the structure of an automaton and automorphisms, Systems-Computers-Controls 3 (1972), 10-15. [64] H. J. Shyr and G. Thierrin, Hypercodes, Information and Control 24 (1974), 45-54. [65] H. J. Shyr, Free monoids and Languages, Lecture Notes, National Chung-Hsing University, Hon Min Book Company, Taichung, Taiwan, 1991. [66] G. Thierrin, Hypercodes, right convex languages and their syntactic monoids, Proceedings of the American Mathematical Society 83 (1981), 255-258.
[67] C.A. Trauth, Jr, Group-type automata, Journal of the Association for Computing Machinery 13, 170-175 (1966). [68] G.P. Weeg, The structure of an automaton and its operationpreserving transformation group, Journal of the Association for Computing Machinery 9 (1962), 345-349.
BIBLIOGRAPHY
195
[69] G.P. Weeg, The automorphism group of direct product of strongly related automata, Journal of the Association for Computing Machinery 12 (1965), 187-195.
[70] D. Wood, Theory of Computation, Harper & Row, Publishers, Inc., New York, 1987.
This page intentionally left blank
Index acceptor, 3 finite, 3, 85 nondeterministic, 85 pushdown, 3, 89 algorithm, 3 alphabet, 2, 6, 84 automaton, 3, 6, 64 abelian, 65 commutative, 7, 65, 159 cyclic, 64 directable, 4, 75, 157 factor, 38 generalized group-matrix type, 51 group-type, 65 (n,G)-,10 nondeterministic, 163 perfect, 7, 65 permutation, 8 pullback, 78 quasiperfect, 65 regular group-matrix type, 5 simplified, 8 strongly connected, 6, 64 strongly directable, 75 strongly related, 64 transitive, 65 X-, 64 automorphism, 2, 6, 65
bijection, 1 class, 66 strong, 63, 66 code, 2, 134 bifix, 3, 134 infix, 3, 134 maximal, 134 prefix, 3, 134 suffix, 3, 134 concatenation, 2, 92 decidable, 3 decomposition, 99 maximal, 99 deletion, 127, 130 iterated, 130 del-closure, 132 deletion closure, 132 of a language, 132 derivation, 84 direct product, 35, 64 effectively constructed, 3 endomorphism, 2, 6 equivalent to each other, 22, 30 generalized group-matrix of order n, 52 197
198 generalized group-matrix type automaton of order n , 54 generalized group-vector of order n, 53 generalized shuffle residual, 149 generator, 64 grammar, 2, 84 context-free, 2, 84 regular, 2, 84 Greibach normal form, 84 group, 1 automorphism, 6, 65 commutative, 2 quotient, 1 simple, 2 group-matrix of order n, 9 group-matrix type automaton of order n, 10 group-type automaton with group G, 65 group-vector of order n, 9 h-descendant, 124 homomorphic image, 64 homomorphism, 2, 6, 64, 93 natural, 2 hypercode, 3, 114, 124 initial state, 85 injection, 1 ins-base, 135 insertion, 94, 127, 128 insertion base, 135 insertion closure, 127, 129 of a language, 127, 129 insertion residual, 127 isomorphic to each other, 6
INDEX isomorphism, 2, 6, 64 isomorphism in wider sense, 23 iterated deletion, 130 iterated shuffle, 143 kernel, 2 K-product, 35 Kronecker product, 35 language, 2, 83 accepted by an acceptor, 85 commutative, 103, 114 context-free, 2, 83, 84 del-closed, 132 deletion closed, 132 generated by a grammar, 84 ins-closed, 129 insertion closed, 129 nontrivial, 93 recognized by an acceptor, 85 regular, 2, 83, 84 RSS-type, 145 sh-closed, 113 shuffle closed, 113 ssh-closed, 113 strongly shuffle closed, 113 lattice, 3 monoid, 1 characteristic, 30 commutative, 2 free, 2 n-insertion, 4, 83, 93 nondeterministic acceptor with emove, 85 nondeterministic automaton, 163 commutative, 181
INDEX complete, 164 Di-directable, 163 of partial function type, 169 of pf-type, 169, 175 n-shuffle, 99 order, 124 embedding, 124 Parikh mapping, 102 partially ordered set, 3 partial order, 3 poset, 3 principal congruence, 84 production rules, 84 pullback system, 77 regular, 56 regular ( n ,G)-automaton, 12 regular system, 22 root, 118 of a semigroup, 118 scattered deletion, 151 scattered deletion closure, 153 of a language, 153 sd-closure, 153 semigroup, 1 free, 2 separation condition, 52 set of final state, 85 set of initial states, 85 sh-base, 114 sh-free, 114 shuffle, 4, 83 shuffle base, 114 shuffle closure, 103, 144 of a language, 103, 144
199 shuffle product, 93 of a language, 93, 103 of words, 93, 103 shuffle residual, 141 SP-condition, 51, 52 stack symbol, 89 start symbol, 84 state set, 6, 85 state transition function, 6, 85 subautomaton, 64 subgroup, 1 normal, 1 subword, 160 sparse, 151 surjection, 1 undecidable, 3 variables, 84 word, 2, 84 Di-directing, 163 directing, 157 D1-directing, 163 D3-directing, 163 D3-merging, 179 D2-directing, 163 empty, 2, 64, 84 merged, 160 overlapping, 138