Product of Finite Maximal p-codes

Similar documents
On Strong Alt-Induced Codes

Languages and monoids with disjunctive identity

Aperiodic languages and generalizations

Codes induced by alternative codes

languages by semifilter-congruences

Primitive partial words

WHEN ARE REES CONGRUENCES PRINCIPAL?

On Shyr-Yu Theorem 1

Properties of Fibonacci languages

Insertion and Deletion of Words: Determinism and Reversibility

Limited Codes Associated with Petri Nets

Mergible States in Large NFA

Hierarchy among Automata on Linear Orderings

Words with the Smallest Number of Closed Factors

Outfix-Free Regular Languages and Prime Outfix-Free Decomposition

arxiv: v1 [cs.dm] 16 Jan 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Positive varieties and infinite words

The commutation with ternary sets of words

Transducers for bidirectional decoding of prefix codes

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

The bideterministic concatenation product

arxiv: v1 [math.co] 13 Sep 2017

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

F. Blanchet-Sadri, "Codes, Orderings, and Partial Words." Theoretical Computer Science, Vol. 329, 2004, pp DOI: /j.tcs

Ogden s Lemma. and Formal Languages. Automata Theory CS 573. The proof is similar but more fussy. than the proof of the PL4CFL.

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

Transducer Descriptions of DNA Code Properties and Undecidability of Antimorphic Problems

Semi-simple Splicing Systems

group Jean-Eric Pin and Christophe Reutenauer

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

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

Equations on Partial Words

Independence of certain quantities indicating subword occurrences

Some Operations Preserving Primitivity of Words

An Overview of Residuated Kleene Algebras and Lattices Peter Jipsen Chapman University, California. 2. Background: Semirings and Kleene algebras

Involution Palindrome DNA Languages

BOUNDS ON ZIMIN WORD AVOIDANCE

PRODUCT OF OPERATORS AND NUMERICAL RANGE

How Many Holes Can an Unbordered Partial Word Contain?

Aperiodic languages p. 1/34. Aperiodic languages. Verimag, Grenoble

Special Factors and Suffix and Factor Automata

The Restricted Edge-Connectivity of Kautz Undirected Graphs

Conjugacy on partial words. By: Francine Blanchet-Sadri and D.K. Luhmann

Partial cubes: structures, characterizations, and constructions

L is finite or cofinite}, A + k+1 = { L A + L is a boolean combination of languages of the form L 1 L n (n 1) with L 1, L n A +

Order-theoretical Characterizations of Countably Approximating Posets 1

Theoretical Computer Science

Nondeterministic State Complexity of Basic Operations for Prefix-Free Regular Languages

Simple equations on binary factorial languages

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

F. Blanchet-Sadri and F.D. Gaddis, "On a Product of Finite Monoids." Semigroup Forum, Vol. 57, 1998, pp DOI: 10.

Decomposing planar cubic graphs

Laboratoire d Informatique Fondamentale de Lille

Automorphisms of the endomorphism semigroup of a free abelian diband

Substitutions, Trajectories and Noisy Channels

Generating DNA Code Words Using Forbidding and Enforcing Systems

Duality and Automata Theory

International Journal of Scientific & Engineering Research Volume 8, Issue 8, August-2017 ISSN

Duality in Logic. Duality in Logic. Lecture 2. Mai Gehrke. Université Paris 7 and CNRS. {ε} A ((ab) (ba) ) (ab) + (ba) +

Maximal and Minimal Solutions to Language Equations*

Obtaining the syntactic monoid via duality

A SURVEY ON DIFFERENCE HIERARCHIES OF REGULAR LANGUAGES

Decision Problems Concerning. Prime Words and Languages of the

Deciding Whether a Regular Language is Generated by a Splicing System

A robust class of regular languages

Semigroup presentations via boundaries in Cayley graphs 1

K-Comma Codes and Their Generalizations

Invertible insertion and deletion operations

Fine and Wilf s Periodicity on Partial Words and Consequences

Defining Languages by Forbidding-Enforcing Systems

SEMIRINGS SATISFYING PROPERTIES OF DISTRIBUTIVE TYPE

The Membership Problem for a, b : bab 2 = ab

Universal words and sequences

EFFICIENT ALGORITHMS FOR TESTING THE TWINS PROPERTY

SYNTACTIC SEMIGROUP PROBLEM FOR THE SEMIGROUP REDUCTS OF AFFINE NEAR-SEMIRINGS OVER BRANDT SEMIGROUPS

ARTICLE IN PRESS. Language equations, maximality and error-detection. Received 17 July 2003; received in revised form 25 August 2004

On the robustness of primitive words

Theory of Computation

ON HIGHLY PALINDROMIC WORDS

Automata Theory and Formal Grammars: Lecture 1

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

By: F. Blanchet-Sadri, C.D. Davis, Joel Dodge, Robert Mercaş, Robert, Margaret Moorefield

Relationships between upper exhausters and the basic subdifferential in variational analysis

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

A Factor Theorem for Subsets of a Free Monoid*

Polynomial closure and unambiguous product

Profinite methods in automata theory

arxiv: v1 [math.co] 25 Apr 2018

DENSITY OF CRITICAL FACTORIZATIONS

Some decision problems on integer matrices

On the Complete Join of Permutative Combinatorial Rees-Sushkevich Varieties

Equational Theory of Kleene Algebra

Partial Words and the Critical Factorization Theorem Revisited

Small Cycle Cover of 2-Connected Cubic Graphs

arxiv: v1 [math.co] 22 Jan 2013

MATH 433 Applied Algebra Lecture 22: Semigroups. Rings.

Bridges for concatenation hierarchies

2. Syntactic Congruences and Monoids

Insertion operations: closure properties

Transcription:

Product of Finite Maximal p-codes Dongyang Long and Weijia Jia Department of Computer Science, City University of Hong Kong Tat Chee Avenue, Kowloon, Hong Kong, People s Republic of China Email: {dylong,wjia}@cs.cityu.edu.hk Liang Zhang Department of Applied Mathematic, Tongji University Shanghai 0009, People s Republic of China ABSTRACT: Several properties of the products of finite maximal prefix, maximal biprefix, semaphore, synchronous, maximal infix and maximal outfix codes are discussed respectively. We show that, for two nonempty subsets X and Y of A such that the product XY being thin, if XY is a maximal biprefix code, then X and Y are maximal biprefix codes. Also, it is shown that, for two finite nonempty subsets X and Y of A such that the product XY being unambiguous, if XY is a semaphore code then X and Y are semaphore codes. Finally, two open problems to the product of finite semaphore and maximal infix codes are presented. KEYWORDS: product of languages, maximal prefix code, semaphore code. Introduction The product of variable-length codes is a basic operation, which plays an important role in the theory of variable-length codes [-,7,]. In particular, maximal P-codes reflect extreme properties of P-codes when they are considered as communication tools [,7]. Berstel and Perrin posed if XY is a finite maximal prefix code, then X and Y are maximal prefix codes ([], Proposition 4.0 in Chapter, p.06). Bruyére [3] gives an example where XY is a finite maximal prefix code, but X and Y need not be maximal prefix codes. Further results related to this open problem can be found in [4]. It is shown that, let X and Y be nonempty subsets of A and X be a thin code, if XY is a maximal prefix code then X and Y are maximal prefix codes [4]. To the best of our knowledge there is no discussion about the product of proper subclasses of finite maximal prefix codes such as finite maximal biprefix codes, semaphore code, synchronous codes and so on [5-], whether that have the same properties as finite maximal prefix codes. Making use of the product of proper subclasses of finite maximal prefix codes, we can obtain more characteristics of these proper subclasses, which are not given by other methods This paper was supported in part by the Natural Science Foundation of China (project No. 60073056) and the Guangdong Provincial Natural Science Foundation (project No. 0074)

[,7]. Motivated by the relevant problems above, we investigate the product of several finite maximal P-codes. We first introduce the necessary concepts and notations. For additional details and definitions, see the references, in particular [,7,]. Let A be a finite alphabet and L A be a language. Denote A = A { } where is the empty word over A. With a language L one associates its syntactic monoid syn ( L) = A /, where P L x y( PL ) ( u, v A ) uxv L uyv L. By [w] we denote the P L -class of the word w, i.e. [w] = { x A x w( )}. For every w A we denote by w the length of w. for any X, Y A, we define X Y = { x A Xx Y } and YX = { x A xx Y }. A language L A is said to be a code over A if the submonoid L of A generated by L is freely generated by L. Assume that P is any property of languages. We call a code a P-code if C possesses the property P. If C is a P-code, for every u ( C ) A, C {u} is not a P-code, then C is said to be a maximal P-code. Let M be a monoid and N be a subset of M. An element m M is right completable in N if there exists u in M such that mu N. A subset N of M is right dense in M if all elements of M are right completable in N. A subset N of M is right complete if the submonoid generated by N is right dense. A language C A is said to be a prefix code if CA C =. A language C A is said to be a suffix code if A C C =. A language C A is both a prefix code and a suffix code then we call C a bifix (or biprefix) code. A code C is said to be an infix code if ( u, v, x A ) x, uxv C uv =. A code C is said to be an outfix code if ( u, v, x A ( x, u, y A ) uv, uxv C x =. A language ) xuy, u C y =. A language C A P L is said to be a p-infix code if C A is said to be a semaphore code if and only if C is prefix and A X XA. A maximal prefix code C A is synchronous if and only if there exists x C such that A x C. Let X be a subset of A. Then X is said to have finite deciphering delay if there is an integer d 0 such that d ( x, x )( y )( u A ) xyu x X x = x. The paper is organized as follows. After introduction section, we discuss the product of finite maximal biprefix codes. It is shown that, for two nonempty subsets X and Y of A such that the product XY being thin, if XY is a maximal biprefix code then X and Y are maximal biprefix codes. In section 3, we prove that, for two finite nonempty subsets X and Y of A such that the product XY being unambiguous, if XY is a semaphore code then X and Y are semaphore codes. Meanwhile, a new characterization of semaphore codes is also given. In Section 4, several properties of the product of finite synchronous codes and codes with finite deciphering delay are presented. We show that, if X, Y A be

nonempty subsets then XY is a maximal outfix code if and only if X and Y are maximal outfix codes in Section 5. Finally the two cases of the product of finite semaphore and maximal infix codes are unsolved and proposed as open problems.. Finite Maximal Prefix and Maximal Biprefix Codes We first give several lemmas. Lemma. (Corollary 4. in Chapter of [], p.03) If X and Y are prefix (maximal prefix) codes, then XY is a prefix (maximal prefix) code. Remark. In general, if XY is a prefix (maximal prefix) code, then X and Y are not necessarily prefix (maximal prefix) codes (see Example 4., in the chapter of [], p.06). In particular, let X = { a, a }, Y = {b}, then XY = { ab, a b} is a finite prefix code, but X is not prefix. However, we have Lemma. (Proposition 4.0 in Chapter of [], p.06) Let X and Y be finite nonempty subsets of A such that the product XY is unambiguous. If XY is a maximal prefix code, then X and Y are maximal prefix codes. Example 4., in the chapter of [] (p.06) shows that the conclusion fails for infinite codes. However, it is not known whether the hypothesis of unambiguity is necessary ([], p.06). Bruyére gives an example, which shows the hypothesis of unambiguity necessary [3]. In addition, Latteux gives another result Lemma 3. [4] Let X and Y be nonempty subsets of A and X be a thin code. If XY is a maximal prefix code, then X and Y are maximal prefix codes. Moreover, we have Theorem. If XY is a prefix (maximal prefix) code and Y is a finite maximal prefix code, then X is a prefix (maximal prefix) code. Proof: First we show that X is a prefix code. Arguing by contradiction, we assume that X is not a prefix code. Thus there exist x, x and v A such that x = xv. Consider the word x y = xvy with y Y and y = max{ w w Y}. Since Y is a maximal prefix code, A = YA Y( A ) ([]). But vy Y( A ), thus vy YA. Therefore we have that x y = xvy = x yv for some y Y, v A. This contradicts to XY being a prefix code. By Lemma, since XY is a maximal prefix code and both X and Y are prefix codes, X is a maximal prefix code. 3

Remark. If XY is a prefix (maximal prefix) code and Y an infinite maximal prefix code, then X need not be a prefix (maximal prefix) code. For example, let A = {a, b}, X = {, a}, Y = a b. Then XY = a b, but X is not a prefix code. From the previous results, it easily follows that Corollary. Let X and Y be finite nonempty subsets of A. If XY is a maximal prefix code and X a prefix code, then X and Y are maximal prefix codes. Corollary. Let X and Y be finite nonempty subsets of A. If XY is a maximal prefix code and Y a maximal prefix code, then X and Y are maximal prefix codes. By Lemmas and 3, we can easily obtain Corollary 3. Let X and Y be finite nonempty subsets of A such that the product XY is unambiguou. If XY is a maximal biprefix code, then X and Y are maximal biprefix codes. Remark 3. In general, if XY is a biprefix code, then X and Y need not be biprefix codes. Let X = {a, a b}, Y = {b, ab }, then XY = {ab, a b, a bab }. Clearly, XY is a biprefix code but X is not a biprefix code. In general, we have Theorem. Let X and Y be nonempty subsets of A such that XY is thin. If XY is a maximal biprefix code, then X and Y are maximal biprefix codes. Proof: Since XY is a maximal biprefix code and XY is thin, then XY is a maximal prefix code and XY is a maximal suffix code, X is a suffix code and Y is a prefix code. By Lemma 3, X and Y are maximal prefix codes. By duality and Lemma 3, we have that X and Y are maximal suffix codes too. And consequently X and Y are maximal biprefix codes. Remark 4. Theorem fails for infinite non-thin codes. Let A = {a, b}, { wab w w A }, X = X X A X =, Y = a b. We know that X is a maximal prefix and a suffix code but not a maximal suffix (see Example.3 in the chapter 3 of [], p.45) code, and Y is a maximal prefix code but not a suffix code. By construction of X and Y, it is easy to verify that XY is a maximal prefix and suffix code. Thus XY is a maximal biprefix code but Y is not a maximal biprefix code. 3. Finite Semaphore and Maximal p-infix Codes On the product of semaphore codes, we know Lemma 4. (Proposition 5.9, in the chapter of [], p.0) If X and Y are semaphore code, then XY is a semaphore code. Conversely, if XY is a semaphore code and if X is a prefix code, then X is semaphore code. 4

Lemma 5. (Proposition 5.3, in the chapter of [], p.09) Let semaphore code if and only if X is right complete and X A XA = X A. Then X is a Remark 5. Example 5.4 in the chapter of [] (p.) shows that if XY is a semaphore code, then Y need not be a semaphore, even if it is a maximal prefix code. However, by Lemma 3, we have Corollary 4. If XY is a semaphore code and X a thin code, then X is a semaphore code. By Theorem and Lemma 4, we immediately have Corollary 5. If XY is a semaphore code and Y a finite maximal prefix, then X is a semaphore code. We first give the following lemma Lemma 6. Let X be a finite semaphore. Then Y = X A is a semaphore code where X = X with X X =, X = { w ( w ) w w}. Proof: Arguing by contradiction, we assume that Y is not a semaphore code, by Lemma 5, Y A YA, thus there exist y, y Y, u A, v A such that y = uyv. By construction of X and X, we have that y, y, or y, y A, or y and y A, or y and y A, which contradicts with X A XA =. Hence Y is a semaphore code. Note that a semaphore code must be a maximal semaphore code, because a semaphore code is a maximal prefix code. Therefore the class of semaphore codes coincides with the class of maximal semaphore codes. On finite semaphore codes, we have Theorem 3. Let X and Y be finite nonempty subsets of A. If XY is a semaphore code and Y a maximal prefix code, then XY is a semaphore code, where Y = Y Y A, Y = Y Y, Y Y =, Y = { w Y ( w w w}. Proof: Since XY is a semaphore and Y is a maximal prefix code, by Corollary 5, X is a semaphore code. Let X = X with X X =, X = { w X ( w ) w }, and Y = Y Y with Y Y =, w Y = { w Y ( w w }. Thus XY = X )( Y ) = X w ( Y Y X Y 5

X Y Y. By Lemma 6, we have that Z = ( X Y Y Y ) Y A is a semaphore code. Now, we consider Z = ( X Y Y Y A ) Y A. First we prove that Z is a prefix code. Assume that there exist z, z Z, u A such that z = zu. We will divide it into four cases. () If z, z ( X Y Y Y A ) then u =, a contradiction. () If z, z Y A then z a = zbu a for some a, b A, u A. Thus z a, zb Y, which contradicts with XY being a maximal prefix code. (3) If z ( X Y A ) and z Y A, then z a = zua with za Y, which contradicts with Z being a semaphore code. (4) If z Y A and z ( X Y Y Y A ), then z = zau for some a A and u A. Since za Y, which contradicts to Z being a semaphore. This shows that Z is a prefix code. Next we show that Z is a maximal prefix code. By Z being a maximal prefix code, therefore, for any w Z, there exists z Z such that z has the prefix relation with w. First, if z ( X Y A ), then there exists z = z Z such that z has the Y Y prefix relation with w. Secondly, if z Y, then w = z av or z a = wv for v A with z Y A. If v, then z Z has the prefix relation with w. If v = 0, then w = z a = w or w = z a. Clearly, z has the prefix relation with w. This shows that Z is a maximal prefix code. Finally we prove that Z is a semaphore code. By Lemma 5, arguing by contradiction, we assume that there exist u A, v A, z, z Z such that z = uzv. Similarly, the discussion is taken by dividing into four cases. () If z, z ( X Y Y Y A ), then it contradicts to Z being a semaphore code. () If z, z Y A, then z a = uzbv a for some a, b, A, v A, and z b, za Y. It contradicts with Z being a semaphore code. (3) If z ( X Y A ) then z a = uzva with za Y, a contradiction! (4) If z Y A and z ( X Y Y Y A ), then z = uzbv for some b, A, v A, and zb Y. If v, then it contradicts with Z being a semaphore code. If v =, then z = uzb. We show that z = uzb is impossible. Clearly, if z Y A, then z a = uzba which contradicts to XY being a semaphore code. If z Y, then x y = ux y, for some x, x, y Y y Y. Since X is a semaphore code, A X XA, ux = x,, y xu y u y Y Y Y Y u y ux y x =, thus y =, a contradiction. Similarly, if z Y, then x = for some x, x, y Y, y Y. Since X is a semaphore code, then A X XA, ux = xu, x y = xu y, thus y = u y, a contradiction. That means z uzb. We obtain that Z is a semaphore code. Clearly, Z = ( X )( Y Y A ) = XY, that is, XY is a semaphore code. 6

Similar to the proof of theorem 3, we have Theorem 4. Let X and Y be finite nonempty subsets of A such that the product XY is unambiguous. If XY is a semaphore code, then XY is a semaphore code, where Y = Y Y A, Y Y Y =, Y Y =, Y = { w Y ( w w }. w Corollary 6. Let X and Y be finite nonempty subsets of A. If XY is a semaphore code and Y a maximal prefix code, then Y = Y Y A is a semaphore code, where Y = Y Y, Y Y =, Y = { w Y ( w w w}. Proof: Arguing by induction on n, n = max { y y Y}, we show this Corollary. Since XY is a semaphore code, by Corollary 5, X is a semaphore code, and Y is a maximal prefix code. For n =, we have Y = A. Thus, the conclusion clearly holds. We assume that the conclusion is true for n. We now consider n. By Theorem 3, XY is a semaphore code, and n = max { y y Y }. Thus, by the hypothetical condition of induction, we have that Similarly, we have Y is a semaphore code. Corollary 7. Let X and Y be finite nonempty subsets of A such that the product XY is unambiguous. If XY is a semaphore code, then Y is a semaphore code, where Y = Y Y A, Y Y Y =, Y Y =, Y = { w Y ( w w }. w Remark 6. The above Y in Corollary 7 is not necessarily a semaphore code for a finite maximal prefix code Y. For example, let A = {a, b}, Y = {a, aba, abab, ab a, ab 3, b}. Clearly, Y = {a, aba, ab, b} is not a semaphore code. Theorem 5. Let X and Y be finite nonempty subsets of A. If XY is a semaphore code and Y a maximal prefix code, then X and Y are both semaphore codes. Proof: Suffice it to show that Y is a semaphore code. Let Y = Y Y A where Y = Y Y, Y Y =, Y = { w Y ( w w w}. By Corollary 6, Y is a semaphore code. Arguing by contradiction, we assume that Y is not a semaphore code. Thus, there exist y, y Y such that (, v A ) y = uy v u () If y, y Y, then it contradicts with Y, which is a semaphore code. () If y, y Y or y Y, y Y, then it is impossible. Thus we have that y Y and y Y. If v >, then y = ya, ya = uyva and v = va with y Y A, v A. Thus y = uyv, which contradicts with loss of generality, we assume that Y being a semaphore code. Therefore, without 7

y = uya, where a A, y Y and y Y. Moreover, we have [( A ) u] ya Y = Suppose that u = u u ( u, v A )( y3 y3 = u yv According to the previous discussion, we have y3 = u yb, where b A, y Y and y3 Y. Since y 3 = y, and y3 = u yb < uu yb = b y uy =, this is impossible. Since X is a finite maximal prefix code, for all c A, there is a positive integer k such that c k. Next, we consider = uy a cu y a y = k c u y k where u = cu, c A. Thus c y = a. Again, since Y is a maximal prefix code, there is u y = yv or y = u yv, for some v, v A. If v = or v =, then y = u y, k k k c y = c u y a c( c y) a = y Y such that Consequently XY A ( XY) A, this contradicts with XY being a semaphore code. Therefore v and v. A ) u] y But [( A Y =, we have u y = yv That is, k k k c y = c u y a = c yv a = c( c Thus XY A ( XY) A, this is a contradiction. It shows that Y is a semaphore code. By Corollary 4 and Theorem 5, we have Corollary 8. Let X and Y be finite nonempty subsets of A and X a code. If XY is a semaphore code, then X and Y are semaphore codes. Similarly, we have Theorem 6. Let X and Y be finite nonempty subset of A such that the product XY is unambiguous. If XY is a semaphore code, then X and Y are semaphore codes. By Lemma 5, a semaphore code must be p-infix code [7-8]. But a p-infix code need not be a semaphore code. For instance, let A = {a, b}, X = {a, b}. It is easy to verify that X is a p-infix code but not a semaphore code. k y) a 8

On the product of p-infix codes, we have Theorem 7. If X and Y are p-infix codes, then XY is a p-infix code. Proof: Arguing by contradiction, we assume that there exist x, x, y, y Y, u A, v A such that x y = ux yv. () If x > ux, then it contradicts to X being a p-infix code. () If x ux, then y = wyv, which contradicts with Y being p-infix code. Therefore A XYA XY =. Remark 7. Conversely, if XY is a p-infix code then X and Y are not necessarily p- infix codes. For instance, let A = {a, b}, X = a b, Y = {a, aba, ab, b}. We can easily verify that Y is not a p-infix code. On the other hand, the code XY = a {ba, baba, bab, b } is a semaphore code, and consequently it is a p-infix code. Even if XY is a finite p- infix, then X and Y need not be p-infix codes. For example, let A = {a, b}, X = {a, a }, Y = {b}. We can easily verify that XY = {ab, a b} is a p-infix code but X is not a p-infix code. Furthermore, on maximal p-infix codes, we have the following interesting properties. Lemma 7. Let X A. Then X is a maximal p-infix code if and only if A = X A ( A ) A XA ( A ) X ( A ) We will give another characterization of semaphore codes, which is different from that in [] (p.07-5). Theorem 8. Let X A. Then X is a semaphore code if and only if X is a maximal p-infix code. Proof: We first show that if X is a maximal p-infix code, then X must be a semaphore code. Let S = X A X. Clearly S is a nonempty subset of X. To prove that X is semaphore, let us show that X = A S A SA. By definition of S, we have X A S. Since S X and X is a p-infix code, X A SA =. This shows that X A S A SA. Assume that there exists a word y in ( A S A SA ) X. By hypothesis, { y} is no a p-infix code. We get either y = uxv or x = uyv with x, u A, v A is impossible. In the second case,. In the first case, since x A S, it follows that y A S means that x A SA y A SA which, a contradiction with X A S A SA. Hence X = A S A SA. This shows that X is a semaphore code. Conversely, assume that X is a semaphore code. Then it is a p-infix code. Suppose that X is not a maximal p-infix code, there exists y A X such that { y} is a p- infix code. By the definition of p-infix code, { y} is a prefix code. But X is a semaphore code, and consequently X is a maximal prefix code, a contradiction with { y} being a prefix code. That is, X is a maximal p-infix code. 9

Remark 8. By Theorem 8, clearly, a maximal p-infix code must be a maximal prefix code. Conversely, in general, a maximal prefix code need not be a p-infix code. For example, let A = {a, b}, X = {a, aba, ab, b}. Clearly X is a maximal prefix code but not a p-infix code. Remark 9. By Example 5.4 in the chapter of [] (p.), we know that Theorem 6 fails for infinite semaphore codes. 4. Finite Synchronous and Codes with Finite Deciphering Delay Since a synchronous code is a maximal prefix code, a synchronous code must be a maximal synchronous code. On the product of two finite synchronous codes, we have Remark 0. The product of two finite synchronous codes is not necessarily synchronous. Let A = {a, b}, X = {a, ab, b}. We can easily verify that X is both a semaphore and a synchronous code, but Y = XX = {a 4, a 3 b, a b, aba, abab, ab, ba, bab, b } is not a synchronous code. Remark. Let X and Y be finite nonempty subsets of A. If XY is synchronous then X and Y are not necessarily synchronous even if XY is unambiguous. Let A = {a, b}, X = {a, ba, b }, Y = {a 4, a 3 b, a b, aba, abab, ab, ba, bab, b }. We can easily verify that XY = {a 5,...,b 4 } is synchronous (by Theorem 6.4, in the chapter of [], p.7), but Y is not synchronous. On the product of codes with finite deciphering delay, we have Remark. If XY is a code having finite deciphering delay then X and Y are not necessarily codes with finite deciphering delay. For example, let A = {a, b}, X = {a, ab, baa}, Y = {b}. We can easily verify that XY = {ab, abb, baab} has deciphering delay, but X has an infinite deciphering delay. By Theorems 8.3 and 8.4 in the chapter of [] (p.30) and a Bruyéere s result [3], we can get that Remark 3. Let X and Y be the finite nonempty subsets of A. If XY is maximal in the family of codes with finite deciphering delay, then XY is a maximal code by Theorem 8.3 in the chapter of [] (p.30). And consequently XY is a maximal prefix code by Theorem 8.4 in the chapter of [] (p.30). According to a Bruyére s result [3], X and Y need not be maximal in the family of codes with finite deciphering delay in general. However, we easily obtain that 0

Corollary 9. Let X and Y be finite nonempty subsets of A such that the product XY is unambiguous. If XY is maximal in the family of codes with finite deciphering delay, then X and Y are maximal in the family of codes with finite deciphering delay. 5. Finite Maximal Infix and Outfix Codes We first give two lemmas. They are easily followed from definitions. Lemma 8. Let X and Y be infix codes. Then XY is an infix code. Remark 4. In general, if XY is an infix code, then X and Y are not necessarily infix codes. Let A = {a, b}, X = {ab, a b a}, Y = {a}. We can easily verify that XY = {aba, a b a } is an infix code, but X is not an infix code. Lemma 9. Let X A. Then X is a maximal infix code if and only if A = X ( A ) ( A ) X ( A ) X ( A ) A A X A XA On the product of two finite maximal infix codes, we have Remark 5 If X and Y are both maximal infix codes, then XY is not necessarily a maximal infix code. Let A = {a, b}, X = {a, b }, Y = {a, b 3 }. We can easily verify that X and Y are both maximal infix codes, but XY = {a, ab 3, b a, b 5 } is not a maximal infix code because XY {aba} is an infix code. Conversely, if XY is a finite maximal infix code, then the structure of X and Y are becoming more complex. An open problem related to the product of finite maximal infix codes is given in the next section. On outfix codes, we have that Theorem 9 [6-7,9-0] Let X, Y A. Then XY is an outfix code if and only if X and Y are both outfix codes. Theorem 0 Let X, Y A be nonempty subsets. Then XY is a maximal outfix code if and only if X and Y are maximal outfix codes. Proof: ( ) Assume that X is not a maximal outfix code, there exists w such that X {w} is an outfix code. Consider ( X {w} )Y = XY wy. Since X and Y are both outfix codes, the words in XY has no outfix relation with the words in wy. Therefore XY wy is an outfix code, which contradicts with XY being a maximal outfix code. This shows that X is a maximal outfix code. Similarly we obtain that Y is a maximal outfix code. ( ) By Theorem 9, XY is an outfix code. Assume that XY is not a maximal outfix code, there exists w such that XY {w} is an outfix code. Since X and Y are outfix codes, XY {wy} is also an outfix code for any y Y. But X is a maximal outfix code, so X {w} is not an outfix code, thus there exists x such that x = uxv and w = uv or x = uv and w = uxv with x A, uv A. Hence we have that x y = uxvy, wy = uvy or

x y = uvy, wy = uxvy. We show that x y Y has an outfix relation with the word wy. This is impossible. 6. Future Work and Discussion In particular, a simpler proof of Theorem 5 is very exquisite and given by an anonymous reviewer. In order to appreciate the anonymous reviewers, we fortunately quote the result as follows: A simpler proof of Theorem 5: By Corollary 5, X is a semaphore code. Assume that Y is not semaphore code, hence Y A YA by Lemma 5. Take y, y Y such that y = uy v with u of minimal length u. We have u > 0 since Y is prefix. Let c be the first letter of u, i.e., u = cu with c A. The case u = c = is impossible. Otherwise, as X is a finite maximal prefix code, x c k = for a well-chosen k, and xy = cxy v in contradiction with XY being a semaphore code. Thus u. As Y is maximal prefix, there exists y comparable with u y v for the prefix order. If y w = u y v for some w A, then xy = cx y w in contradiction with XY being a semaphore code. So u y v is a prefix of y with u < u. This is impossible since u was chosen with minimal length. Clearly, we can suppress many results and replace by Theorem 5 with the proof given above. However, the proof of Theorem 5 and the relevant results in Section 3 may be useful to solving the following Problem. Therefore we retain the original proof of Theorem 5. Similar to problem posed by Berstel and Perrin [], we have if XY is a finite semaphore code then X and Y are semaphore codes, that is Problem. It is not know whether the hypothesis of unambiguity in Theorem 6 is necessary. In addition, there are many examples showing if XY is a maximal infix code, then X and Y are both maximal infix codes. For example, let A = {a, b}, Z = {a, ab, ba, b 4 }, {a, a(ba) k, b(ab) k, b }, k =,,. It is easy to verify that Z is a maximal infix code, and if Z = XY, then X and Y are maximal infix codes. Therefore, we have to test whether the following problem is true Problem. Let X and Y be the finite nonempty subsets of A. If XY is a maximal infix code, then X and Y are both maximal infix codes.

Acknowledgements The authors would like to express their appreciation for the efforts of the anonymous reviewers whose suggestions significantly improved this paper. We are particularity in debt to the reviewer who carefully checked the special cases section and corrected several errors. Also, we would like to thank Professor Masami Ito for his encouragement and support in revising the paper. References [] J. Berstel, D. Perrin, Theory of Codes, Academic Press,Orlando, 985. [] V. Bruyére, M. Latteux, Variable-Length Maximal Codes, In F. Meyeraufder Heide,B. Monien (editors): Automata, Languages and Programming, 3rd International Colloquium, ICALP96, Paderborn, Germany, July 996, Proceedings. Lecture Notes in Computer Science, 099, 4-47, Springer-Verlag, Berlin,996. [3] V. Bruyére, An Answer to a Question About Finite Maximal Prefix Sets of Words, Theoretical Computer Science, 56(988), 339-344. [4] V. Bruyére, Codes, Dissertation présentée pour Ióbtention du grade légal ge docteur en sciences, Université Mons-Hainaut,99, manuscript. [5] M. Ito, H. Jürgensen, H. J. Shyr, G. Thierrin, Languages Whose n-element Subsets Are Codes, Theoretical Computer Science, 94(99), 35-349. [6] M. Ito, H. Jürgensen, H. J. Shyr, G. Thierrin, Outfix and Infix Codes and Related Classes of Languages, Journal of Computer System Science, 43(99), 484-508. [7] H. Jürgensen, S. Konstantinidis, Codes, in Hanndbook of Formal Language Theory I, edited by G. Rozenberg and A. Salomaa, Springer-Verlag, Berlin, 997, 5-607. [8] D. Y. Long, On the Structure of Some Group Codes, Semigroup Forum 45(99), 38-44. [9] D. Y. Long, n-infix-outfix Codes, Chinese Science Bulletin, 39(994), 584-586. (in Chinese) [0] D. Y. Long, k-outfix Codes, Chinese Annals of Mathematics, (A) Vol. 0(989), 94-99. (in Chinese) [] D. Y. Long, On Group Codes, Theoretical Computer Science, 63(996), 59-67. [] H. J. Shyr, Free Monoids and Languages, Hon Min Book Co. Taiwan, 99. 3