Top Banner
“Al.I.Cuza” University of Ia¸ si Faculty of Computer Science Sardinas-Patterson like algorithms in coding theory Author, Bogdan Pa¸ sa ni uc Supervisor, Prof. dr. Ferucio Lauren t ¸iu T ¸iplea Ia¸ si, Sept ember 2003
40

Sardinas Patterson Like Algorithms in Coding Theory

Apr 06, 2018

Download

Documents

Roxana Puf
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 1/40

“Al.I.Cuza” University of Iasi

Faculty of Computer Science

Sardinas-Patterson likealgorithms in coding theory

Author,

Bogdan Pasaniuc

Supervisor,

Prof. dr. Ferucio Laurentiu Tiplea

Iasi, September 2003

Page 2: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 2/40

Contents

1 Introduction 2

2 Variable length codes 42.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Basic characterization results . . . . . . . . . . . . . . . . . . 9

3 Sardinas-Patterson characterization 143.1 S-P Algorithm for classical codes . . . . . . . . . . . . . . . . 153.2 S-P Algorithm for z-codes . . . . . . . . . . . . . . . . . . . . 183.3 S-P Algorithm for Time-Varying codes . . . . . . . . . . . . . 243.4 S-P Algorithm for SE-codes . . . . . . . . . . . . . . . . . . . 29

4 Conclusions 37

Bibliography 38

1

Page 3: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 3/40

Chapter 1

Introduction

Nowadays, with the exponential growth in the amount of data that the hu-man society deals with, data managing becomes a very important problem.Despite of technologic development there have always been a problem intransmitting and storing data. Although there have been important pro-gresses in the quality of transmissions one can not say that a certain trans-mission could happen without errors. The technology of data storage isdeveloping quickly, but it fails to keep up with the necessities of today’ssociety.

The exponentially increasing amount of data exchanged between comput-ers led to a rapid development in the technology of detecting and correcting

errors that can occur in it’s transmission. We need to encode data in sucha manner that we could detect as many errors that could occur or, if wemay think that we could encode data in order to decrease it’s size in orderto reduce the time of the exposure of data to transmission errors. Usuallythese two ideas are combined in order to have a faster and more reliabletransmission.

The origins of coding theory are in the theory of information developedby Shannon in the 1950s. The are several fields in which this theory evolved.One is error-correcting codes which is an important application of algebra.Another one is the theory of entropy that links codes to probability theory.

In this paper we present an important part from the theory of codes, theproblem of deciding how and when can we use a given set to encode, decodedata.

The problem of detecting which sets can be used to encode is an importantproblem in the theory of codes. This problem is solved in the case of classical

2

Page 4: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 4/40

codes by the Sardinas-Patterson characterization theorem , result that leads

to en effective algorithm for deciding if a given set is a code or not.The aim of this paper is to present how the original Sardinas-Patterson characterization theorem  evolved from classical codes to new types of codeslike z-codes, TV-codes and SE-codes.

In the first part of this paper we present basic properties and definitionsof codes. We present the Shutzenberger criterion for codes, the Sardinass-Patterson criterion for codes, and results on codes using probability distri-butions.

In the second part we present algorithms that decide for a specified set if it is a code or not. We present here how the Sardinas-Patterson characteri-zation theorem  leaded to an effective algorithm that decides if a given set is

a code or not. We continue by presenting a result obtained in [2] result thatgeneralizes the Sardinas-Patterson characterization theorem to z-codes. Thisresult also leads to an effective algorithm for z-codes, algorithm based on anupper bound on words that might have two distinct factorizations.

Next we present result for TV-codes, obtained in [9], and the algorithmcorresponding to it. The next section is dedicated to Synchronized Extensioncodes. The result presented here is a Sardinas-Patterson theorem like, resultthat unfortunatelly does’n lead to an effective algorithm for deciding the se-code property for the entire class of se-codes. There are subclasses for whichthis result has a corresponding effective algorithm.

3

Page 5: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 5/40

Chapter 2

Variable length codes

In this chapter we define some basic notions on codes. We concentrate ourefforts in presenting only the main notations and only the most importantcharacterizations results that will be used in the following chapters. Thisbasic results on codes are presented here only for giving an idea on codes,especially on variable length codes. For more details the reader is directedto [1]

Some important characterizations results presented here are the Schutzen-berg criterion for codes and the Sardinas-Patterson theorem for codes.

4

Page 6: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 6/40

2.1 Definitions

We shall call alphabet a finite and nonempty set A. We shall call the elementsof  A letters.

For every sets A and B, A ⊆ B denotes the inclusion of  A into B and|A| is the cardinality of the set A; the empty set is denoted by φ. The set of natural numbers is denoted by N and by N∗ we denote the set N \ {0}.

Let A = (Ai|i ≥ 1) be a family of sets. We denote by A≥i the set j≥i Ai · · · A j and by A∞ the set

i≥1 A≥i.

A word w over the alphabet A is a finite sequence of letters:

w = (a1, a2, ...an), ∀i ai ∈ A.

A word w over the alphabet A can be seen as a mapping w : {1, · · · , n} −→A, where n is a natural number called the length  of the word. The length of the word is also denoted by |w|.

The empty sequence is called the empty word and it is denoted by λ.Also we can define λ as the function λ : ∅ −→ A. Evidently the length of  λ

is 0.Furthermore we denote the set of all words over an alphabet A as A∗.We denote A+ as the set A∗ \ λ.We define the operation concatenation  (or product) · : A+ −→ A+ by:

(w · v)(i) = w(i) , if  1 ≤ i ≤ |w|v(i − |w|) , if  |w| + 1 ≤ i ≤ |w| + |v|

This operation is associative and thus we can write

w = a1a2 · · · an

instead of: w = (a1, a2, · · · , an). The concatenation operation can be easilyextended to A∗ if we consider λ as the neutral element( w · λ = λ · w = w ).Then (A∗, ·) is a free monoid generated by A.

5

Page 7: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 7/40

Definition 2.1.1 1 Let A be an alphabet(a finite and nonempty set). A code

over the set  A is a subset  C  ⊆ A∗

such that for any  x1x2...xn, y1y2...ym, twosequences over  C ( xi ∈ C and y j ∈ C, ∀i ≤ n , ∀ j ≤ m) if:

x1x2 · · · xn = y1y2 · · · ym

it follows that:

1. n = m and 

2. xi = yi, ∀i ≤ n.

In other words, a set C  ⊆ A∗ is a code if it has the unique descifrability

property; that is any word in C +

can be written uniquely as a product of words from C  (it has a unique factorization in words from C ).It follows naturally that a code C  never contains the empty word λ that

is why we usually say that C  is a subset of  A+ = A∗ \ λ.

Example 2.1.1 Let  A = {a, b}. C  = {a,ab,ba} is not a code over  A. It iseasy to see that  aba  has two distinct factorizations over  C .

aba = (ab)a = a(ba)

thus we can conclude that  C  is not a code.

For two sets X, Y  ⊆ A∗

we can define a new set XY  in the following way:

XY  = {xy|x ∈ X, y ∈ Y }.

We define inductively C n in the following way:

• C 0 = λA∗;

• C n+1 = C nC .

Now we introduce the is a factor of  relation on words. We say that aword w ∈ A∗ is a factor of v if there exist x, y ∈ A∗ such that v = xwy. This

relation is a partial order on A

.Furthermore we say that w is a left factor of  v (or w is a prefix of v) if w

is a factor of v and x = λ(v = wy). The factor w is called proper if w = v or

1There are authors[5] that define a code only as a subset of A∗. That implies that thereexists codes without the unique descifrability property.

6

Page 8: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 8/40

in other words y = λ. This relation is left factor  is a partial order on A∗ too.

We will write w ≤ pref  v whenever w is a factor of  v and w < v whenever wis a proper factor of  v.In a symmetric manner we define is right factor  (or is suffix of) and is

proper right factor .Although we shall present some different classes of codes in a following

section we will define now some important classes of codes.

Definition 2.1.2 Let A = φ and  C  ⊆ A+ be a code. Then:

1. C  is called  block code if all words from  C  have the same length;

2. C  is called  prefix code if there are not two words from  C  such that 

one is prefix of the other;

3. C  is called  suffix code if there are not two words from  C  such that one is suffix of the other;

4. C  is called  biprefix code if  C  is in the same time prefix and suffix code;

5. C  is called  binary code if the number of elements in  A is 2.

There are two main fields in which codes are used: one is for detecting and correcting errors that appear during the transmission of data and theother is data compression . Block codes are used especially for detecting andcorrecting errors. If the transmission is noiseless, that is no errors can occur inthe process, we may concentrate our efforts in encoding the data as efficientlyas possible. Thus we must define a method for comparing efficiency of codes.

If we consider that at one time a letter can appear with a certain prob-ability we obtain a probability distribution for an alphabet. In other wordsa probability distribution for A is a function π : A∗ −→ [0, 1] with the prop-erty that

a∈Aπ(a) = 1. In this manner if we associate an alphabet with a

probability distribution we obtain an information source.The couple (A, π) where A is an alphabet and π is a probability distribu-

tion for A is called information source,Usually it is convenient to extend π at A∗ in the following way:

π(w) =

1 , if w = λ,

Πni=1π(ai) , if w = a1a2...an.

7

Page 9: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 9/40

The probability of  C  ⊆ A∗ is made up by the sum of the probabilities

of the words from C . If  C  = φ then π(C ) = 0. We obtain a value(π(C ))between 0 and +∞ for the set C , value relative to the probability distributionπ. This value is called the measure of  C  relative to π.

For example the probability distribution π(c) = 1Card(C )

, ∀c ∈ C  is calledthe uniform distribution .

8

Page 10: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 10/40

2.2 Basic characterization results

Given a set C  over an alphabet A the main question that we try to answeris: Can we determine if C is a code or not?  In this section we will give sometheoretical results on codes, results that will answer this question .First of all we will present two simple results on codes.

Proposition 2.2.1 Let C  ⊆ A+ be a code. Then  ∀n ≥ 1, C n is a code over A.

Proof  The proof is very simple. If we consider two different factorizationsfor the same word over C n then we can rewrite every word in those twofactorizations as a product of  n words from C (it follows from the definition

of  C n). In this manner we obtain two different factorizations over C . Thisis not possible(C  has the unique descifrability property ). Contradiction.We conclude that C n is a code. 2

The other result allows us to view codes as injective morphisms from analphabet Σ into A∗. Thus whenever we want to codify an alphabet (moregenerally a set of elements) over another alphabet we must consider an injec-tive function. Conversely the injective morphisms h : Σ∗ −→ A∗ are calledcodifications of Σ in A∗ because h(Σ) is a code.

Proposition 2.2.2 Let  A = φ be an alphabet and  C  ∈ A+ (C  = φ. C  is a code if and only if ∃h : Σ∗ −→ A∗ an injective morphism such that C  = h(Σ),

with  Σ a well chosen set.

Proof  The proof is very simple and it can be found in [1] 2

Theorem 2.2.1 The Schutzenberger criterion for codes.

Let C  ⊆ A+, where A is an alphabet. C  is a code if and only if:

1. C 

(

n≥2 C n) = φ

2. (∀w ∈ A+)(C ∗w

C ∗ = φ and wC ∗

C ∗ = φ ⇒ w ∈ C ∗)

Unfortunately this criterion for determining if a given set is a code or

not doesn’t lead us to an effectively applyable algorithm. It is impossible todetermine C n and A+ in an acceptable time.

We shall present next a result that leads to an acceptable algorithm fordeciding if a given set is a code or not. This result is also known as theSardinas-Patterson theorem for codes.

9

Page 11: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 11/40

First of all we must define inductively the family of sets C n, also called

the sets of reminders, as:• C 1 = {x ∈ A+|∃c ∈ C  : cx ∈ C }

• C i+1 = {x ∈ A+|∃c ∈ C  : cx ∈ C i} ∨ {x ∈ A+|∃c ∈ C i : cx ∈ C }

Theorem 2.2.2 The Sardinas-Patterson criterion for codes.

Let A be an alphabet and C  ⊆ A+. C  is a code if and only if  C ∩ C i = φ, ∀i ≥1.

Instead of giving a formal proof 2 we will explain how and why we mustcompute C i using an example.

Let C  be a subset of  {0, 1}+.

C  = {010, 0001, 0110, 1100, 00011, 00110, 11110, 101011}.

We say that the word w = 000110101111000110 has two distinct factoriza-tions over C . Let us find these two distinct factorizations.

1. We begin from left to right and we try to find 2 different words fromC  that are prefix in w. We have found x1 = 0001 and y1 = 00011. Wenotice that x1 ≤ pref  y1. In order to continue our computation we mustremember 1 which is the remainder between x1 and y1(y1 = x11). We

add the word 1 to C 1.More generally in order to determine all computations that might leadto different factorizations we must add to C 1 all x such that cx is in C 

with c ∈ C .

c x

2. In order to continue our computation we will repeat the following step:We suppose that we are at the step i. We make the following remark:the reminder r from C i is the only difference between our two distinctfactorizations that we are trying to construct, that is:

2A complete proof can be found in [1]

10

Page 12: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 12/40

• x1x2 · · · xlr = y1y2 · · · yk or

• x1x2 · · · xl = y1y2 · · · ykr or

We continue our computation by:

a) finding words in C  that begin with the reminders from C i; that iscontinuing our computation with an xk;

b) finding words in C  that are prefix in the reminders from C i; thatis continuing our computation with an yl.

If we reach λ as a reminder it means that at that step we have twodistinct factorizations ( we have started with different words from C )for the same word(based on the remark made above the only differencebetween those two factorizations is λ).

In our case we have reached:

w = (00011)(010)(11110)(00110) = (0001)(101011)(1100)(0110)

This theorem offers a test for codes that consists in a systematic organi-zations of computations required to verify if a subset of  A+ is a code or not.Basically we try to find distinct derivations for the same word by startingfrom left to right and trying to match words to the set of reminders. Wecompute all the reminders in all the attempts to find distinct factorizations.

We discover distinct factorizations by finding the empty word as one of thereminders and keeping in mind that the computations have different startingwords. Now we can say that for any subset C  of A∗ it is effectively decidableif  C  is a code or not.

The algorithm suggested by the result above is called The Sardinas-Patterson algorithm for codes. We will describe more of this algorithm ina following section.

We have previously defined the probability distribution for an alphabetA and we have extended it to words over A. We have defined the measureof sets as the sum of the probabilities for the words in that set. We shallpresent a result that links the measure of a set with the code property for

that set.

Theorem 2.2.3 3 Let  C  ⊂ A+ and  π a probability distribution for the al-phabet  A.

3The complete proof can be found in [1]

11

Page 13: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 13/40

1. If  C  is a code then 

π(C n) = π(C n), ∀n ≥ 1.

2. If  π is positive ( π(a) > 0, ∀a ∈ A), if  π(C ) is finite and if 

π(C n) = π(C n), ∀n ≥ 1,

then  C  is a code.

Theorem 2.2.4 Let A be an alphabet. Then  ∀C  ⊆ A+ and  C  a code impliesthat  π(C ) ≤ 1.

We shall discus the case when π is a particular case of distribution theuniform distribution . The uniform distribution for an alphabet is a function:

π : A −→ [0, 1], π(a) =1

|A|, ∀a ∈ A.

In the case of  A finite and the distribution uniform then we obtain that anycode C  over the alphabet of  k implies that the following equation holds:

c∈C 

k|c| ≤ 1.

This theorem has its limitations in determining if a given set is a code or notas shown in the following example[1]

Example 2.2.1 Let  A = a, b and  C  = {ab, aba, aab}. It is easy to verify that this set is not a code since:

(aba)(ab) = (ab)(aab).

If we consider any probability distribution  π over  A we obtain  π(C ) < 1.Indeed, let  π(a) = p, π(b) = q, with  p + q = 1. Then 

π(C ) = pq + 2 p2q.

It is easy to verify that  p + q = 1 implies that we always have pq ≤ 14

and  p2q ≤ 4

27. Then 

π(C ) ≤1

4+

8

27< 1.

12

Page 14: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 14/40

This example shows that the converse of the Theorem2.2.4 is false.

Theorem 2.2.5 Let  A be an alphabet and  1 ≤ d1 ≤ d2 ≤ · · · ≤ dn be a set of natural numbers. There exists a prefix code C  consisting of n words with the lengths (d1, d2, · · · , dn) if and only if 

1

|A|d1+

1

|A|d2+ · · · +

1

|A|dn≤ 1.

This result is also known as the Kraft Inequality and gives an importanttool for verifying if there exists codes with predetermined word lengths. In1956 McMillan extends this inequality to finite codes not just prefix.

McMillan Inequality: Let A be an alphabet. Then ∀C  = c1, c2, · · · , cn ⊂A+ code the following inequality holds:

1

|A|d1+

1

|A|d2+ · · · +

1

|A|dn≤ 1.

13

Page 15: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 15/40

Chapter 3

Sardinas-Pattersoncharacterization

Usually it is not easy to verify if a given subset of A∗ has the unique descifra-bility property and thus being a code. The usual test in order to determine if a set of words is a code or not consists in finding two different decompositionsfor the same w ∈ C ∗ and thus determining that the given set is not a code.

Intuitively the process of finding different decompositions is usually easyif the sets C  and A have few elements. If we look at a set C  = {a,ab,b}subset of {a, b}+ it is very simple to see that ab has two distinct factorizations.Usually sets that might be codes have many elements and it is very hard tosee two distinct factorizations or to prove that there doesn’t exist differentfactorizations for the same word. If we look at the set C  = {aa, ab, aab, bba}it is not easy to determine two different factorizations or to prove that therearen’t such.

These simple examples show us that it is necessary to find algorithm thateffectively decide if a given set is a code or not. The Sardinas-Patterson algo-rithm (SP-algorithm for short) suggested by Theorem2.2.2 consists merelyin computing all the reminders in all attempts at a double factorization. Itdiscovers a double factorization by the fact that the empty word is one of the reminders.

14

Page 16: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 16/40

3.1 S-P Algorithm for classical codes

Theorem2.2.2 , also known as the Sardinas-Patterson theorem for codes, leadsus to an effective algorithm that solves the problem if a given set is a codeor not. The theorem states that C  is a code iff  C  ∩ C i = ∅, for all i ≥ i.In other words C  is a code iff  C i does not contain the empty word for anyi ≥ 1. It is very easy to see that these two forms of the Sardinas-Pattersontheorem are equivalent. Indeed, if  C  ∩ C i = ∅ then from the definition of C i+1 it follows that λ ∈ C i+1. The converse holds true; that is if  λ ∈ C i thenthere C  ∩ C i = ∅.

We shall present the algorithm as a proposition.

Proposition 3.1.1 Let A be an alphabet and  C  ⊆ A+, C -finite and different  from emptyset .It is effectively decidable if  C  is a code or not.

Proof  C  is a code ⇐⇒ C  ∩ C i = φ, ∀i ≥ 1.We show that because C  is finite then the following sequence is cyclic:

C 1, C 2, · · · , C n · · ·

Indeed if C  is finite then we can effectively determine a natural number n ≥ 1such that:

(∀c ∈ C )(|c| ≤ n)

We will show next that:

(∀i ≥ 1)(∀c ∈ C i)(|c| ≤ n)

We will prove the statement by induction over i.

• For i = 1C 1 = {x ∈ A+| ∃c ∈ C  : cx ∈ C } =⇒

(∀x ∈ C 1)(∀c ∈ C )(|x| < |cx| ≤ n)

• For i ≥ 1 if we suppose that (∀c ∈ C i)(|c| ≤ n) then if we consider howC i is constructed:

C i+1 = {x ∈ A+|∃c ∈ C  : cx ∈ C i} ∨ {x ∈ A+|∃c ∈ C i : cx ∈ C }

it is easy to see that(∀c ∈ C i+1)(|c| ≤ n)

holds.

15

Page 17: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 17/40

We have proved that the words in C i have lengths less or equal to the

words in C . It is easy to see that the sequence: C 1, C 2, · · · , C n · · · is notinfinite. Then there exists k, l such that:

(1 ≤ k ≤ l)(C k = C l)

The following algorithm decides if C  is a code or not:

begin i = 1Compute C 1while(C i does not contain empty word)

begin i := i + 1Compute C iif ( (exists j < i : C  j = C i) ∨ (C i = φ))

return C is a codeendwhile

return C is not a codeend 

This Algorithm always ends because the sequence C 1, C 2, · · · , C n · · · iscyclic, that is, there exists 1 ≤ i ≤ j such that C i = C  j.This algorithm is also known as the S-P algorithm for codes. 2If we consider the same example as in Theorem2.2.2 : C  is a subset of 

{0, 1}+.

C  = {010, 0001, 0110, 1100, 00011, 00110, 11110, 101011}

the results obtained by applying the Sardinas-Patterson algorithm are shownin Figure 1.

If we want to obtain the shortest word w that has two different fac-torizations over C  we must look in the result table from right to left. Inour case λ is a reminder from 0110 ∈ C 7 and 0110 ∈ C  then w ends in0110 (w = w10110). 0110 is obtained as a reminder between 0 ∈ C 6 and00110 ∈ C . Thus w1 = w20. Continuing in the same manner we obtain

w = 000110101111000110.

16

Page 18: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 18/40

010

0001

0110

1100

00011

00110

11110

101011

C C C C C C C1C 42 3

01 01 100

1110

01011

11 00

110 011

110

0

011

10

110

0110

0011

5 6 7

λ

...

Figure 1

17

Page 19: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 19/40

3.2 S-P Algorithm for z-codes

In this section we will present an algorithm for testing if a given set is az-code or not. This algorithm that solves the problem in the case that thegiven set is finite was given in [2] and it is based on a suitable extension of the Sardinas-Patterson criterion for classical codes.

First of all we shall recall the concept of a z-code and we shall presentsome basic results on z-codes.

There are many cases where we need to extend words not only to the rightas in classical codes but to the left too by taking in consideration the finalletters of the word. This special case of a code that generates a word thatdoesn’t necessary increase in size but can decrease the size of the constructed

word is called a zigzag-code or for short a z-code. A factorization over a z-code can continue with a word to the right as in classical codes but can alsocontinue with a word on the left and thus deleting that codeword from thecomputation and thus decreasing it’s size. A more formal definition is givennext.

Let A be an alphabet and A∗ be the free monoid generated by A. LetX  ∈ A∗. We define a relation on A∗ × A∗ generated by the set

T  = {((ux,v), (u,xv))|u, v ∈ A∗, x ∈ X }.

We define the step relation between the pairs (u, v) and (u, v) if and only

if ((u, v), (u, v)) ∈ T  or ((u, v), (u, v)) ∈ T . We denote a step between twopairs by: (u, v) → (u, v). We say that a step is to the right on x  or to the left on x  if (u,xv) → (ux,v), respectively (ux,v) → (u,xv). A path  is defined asa sequence of steps.

We define by X ↑ the set that contains all words w ∈ A∗ such that existsat least one finite path between the pairs (λ, w) and (w, λ) (exists and it isfinite (λ, w) →+ (w, λ)).

A z-factorization f of w over X  of length m, where X  is a subset of  A∗

and w ∈ X ↑ is a path (ui, vi) → (ui+1, vi+1) for i = 0, 1, · · · , m, which verifiesthe following conditions:

(1) u0 = vm+1 = λ,

(2) v0 = um+1 = w,

(3) (u j, v j ) = (uk, vk) for j = k.

18

Page 20: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 20/40

Condition (3) is necessary in order to exclude the presence of ”cycles” in

the factorization.Definition 3.2.1 A set  X  ⊆ A∗ is a z-code if and only if any word  w ∈ A∗

has at most one z-factorization over  X .

Remark 3.2.1 (1) Any z-code is a code; the converse is false. There arecodes that are not z-codes.

Let us consider  X  = {b, aab, bba, aabba}.

X  is a code. Indeed, if we apply the Sardinas-Paterson algorithm discussed in the precedent section we obtain the following result:

• C 1 = {ba};

• C 2 = {a};

• C 3 = {ab, abba};

• C 4 = φ.

and thus we conclude that  X  is a code.

X  is not a z-code. Indeed, the word  w = aabba over the alphabet A = {a, b}+ has two distinct z-factorizations over  X . Let’s number theelements of  X  as follows:

x1 = b x2 = aab x3 = bba x4 = aabba.

Two distinct factorizations for  w are:

a) (λ, aabba) →right x1 (aabba, λ)

b) (λ, aabba)→right x2(aab, ba) →left x1 (aa, bba) →right x3 (aabba, λ)

We conclude that X is not a z-code.

(2) Any prefix(suffix) code is a z-code. There are z-codes that are neither prefix or suffix.

The following algorithm computes all the factorizations in all attemptsat a double factorization for a single word. First of all we must define theconcept of a configuration. If in Sardinas-Patterson algorithm for codes thereare produced a sequence of sets of words until one of this sets contains λ or is

19

Page 21: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 21/40

equal to empty set, this algorithm produces a sequence of sets with elements

from A∗

× A∗

× {1, 2, · · · , n}3

.In the original S-P algorithm it is sufficient to take in account only thedifferent reminders from the right side because the factorization only contin-ues to the right. For z-codes it is not sufficient because an z-factorizationcan continue with a step to the left, and thus decreasing the length of theword to have double factorization; in order to continue a z-factorization tothe left we must know the left side of a computation (usually denoted by l),not only the different reminders.

We define a configuration  for a set X  any tuple A∗ × A∗ × {1, 2, · · · , n}3.A configuration is any tuple q = (l,r,i,j,k), where l is the left part in theattempt at a double configuration and r is the reminder at that step. At that

moment we have constructed two different z-factorizations: one for l, and onefor lr. It is obvious that if we reach a configuration q = (l, λ , i, j, k) wehave found two distinct z-factorizations for the same word l.

The algorithm proposed in [2] constructs sets of configurations until reachesa set that contains configuration q = (l, λ , i, j , k) or until the length of apossible double z-factorization reaches the maximum value K . It is shownthat for a given set X  it is possible to determine the length K  of the shortestwords that might have a double factorization.

The algorithm finds two distinct z-factorizations with the property thatthese different z-factorizations are the shortest that we can find.

First of all we must define how we can obtain the sets of configurations.This is an iterative process beginning with the set:

Q1 = {(xh,r,h, 0, k)|∃xh, xh ∈ X  : xk = xkr}

and continuing with the set Qn which is the set of all configurations producedfrom configurations from Qn−1.

The configurations are obtained according to the actual step in the deriva-tion. The configuration q = (l,r,i,j,k) produces a configuration q = (l, r, i, j, k)according to the following three cases:

1. we continue our derivation to the right with an xh which is an prefix

of the reminder r:

20

Page 22: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 22/40

l

l

xh

r

r

Case 1

2. we continue our derivation to the right with an xh such that the re-minder r is a prefix of  xh:

  ¨l

l r

xh

r

Case 2.

3. we continue our derivation to the left with an xh:

©

l

l r

xh

r

Case 3.

The configuration q = (l, r, i, j , k) is defined formally as following:

Definition 3.2.2 We say that a configuration  q = (l,r,i,j,k) produces on X  a configuration  q = (l, r, i, j, k) if there exists xh ∈ X  such that:

h = j, r = xhr

, l

= lxh,

i = h, j = 0 k = k;

or h = j, xh = rr, l = lr,

21

Page 23: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 23/40

i = k, j = 0 k = h;

or h = i, r = xhr, l = lx−1

h ,

i = 0, j = h k = k.

After defining how a set of configurations produces another set of config-urations we present an algorithm given in [2] that decides if a given set X  isa z-code or not. The value K  that occurs is the upper bound on the lengthof the shortest words in A∗ that might have two distinct factorizations.

We define two families of sets in order to help us see better the compu-tations that we are processing. These families of sets are obtained from the

sets of configurations and have no computational value.

C n = {lr ∈ A∗|∃(l,r,i,j,k) ∈ Qn}

andW n = {r ∈ A∗|∃(l,r,i,j,k) ∈ Qn}

W n is also called the set of remainders of  nth level.The Algorithm 

begin 

n = 1;Compute Q1, C 1, W 1while (λ is not in W n) and ( Qn = φ ) and(|lr| < K , for any lr ∈ C n )

begin n := n + 1Compute Qn, C n, W n

endwhileif  (λ is in W i)

then X  is not a z-codeelse X  is a z-code

end 

22

Page 24: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 24/40

Remark 3.2.2 The algorithm always ends because of the limit imposed on 

the shortest word that might have two distinct factorizations. In [2] it isshown that  K  can be computed before the execution of the algorithm.If we consider  X  a subset of  A∗ that is not a z-code (there are words with 

distinct factorizations), and  w a word with two distinct factorizations with the property that the length of  w is minimum then:

K  =a∈A

 pai=1

C |X|

a

2i ,

where for any  w ∈ A∗, |w|a denotes the number of occurrences of the letter  a

in  w and for any  X  = {x1, x2, · · · , xn} and  a ∈ A we denote by:

|X |a =n

i=1

|xi|a.

23

Page 25: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 25/40

3.3 S-P Algorithm for Time-Varying codes

Time-Varying codes(TV-codes for short) have been introduced in [9] as aproper extension of L-codes[3]. We shall recall these two concepts and presentthe extension of the Sardinas-Patterson algorithm to TV-codes.

L-codes are introduced in [3] as functions g : Σ −→ Σ∗ such that g :Σ∗ −→ Σ∗ given by:

g(λ) = λ, and

g(σ0σ1 · · · σn−1) = g1(σ0)g2(σ1) · · · gn(σn−1)

for all σ1, σ2, · · · , σn ∈ Σ+, is injective. gi denotes the ith iteration of the

unique homomorphic extension of  g, for all i ≥ 1 (g1

= g and gi+1

= gi

◦ gfor all i ≥ 1, where ◦ is the function composition).

A TV-code over an alphabet A is any function h : Σ × N∗ −→ A+, whereΣ is an alphabet, such that the function h : Σ∗ −→ A∗ given by:

h(λ) = λ, and

h(σ1σ2 · · · σn) = h(σ1, 1)h(σ2, 2) · · · h(σn, n)

for all σ1, σ2, · · · , σn ∈ Σ+, is injective. The main idea behind a TV-code isto encode a letter by considering it’s position in the word to be coded.

Because each symbol is coded by taking in consideration it’s position in

the word to be encoded we can view any TV-code as a matrix with |Σ| rowsand an infinite number of columns:

σ1

σ2

· · ·

σ|Σ|

Σ \ N∗1 2 3 · · ·

h(σ1, 1)

h(σ2, 1)

· · ·

h(σ|Σ|, 1)

h(σ1, 2)

h(σ2, 2)

· · ·

h(σ|Σ|, 2)

h(σ1, 3)

h(σ2, 3)

· · ·

h(σ|Σ|, 3)

· · ·

· · ·

· · ·

· · ·

24

Page 26: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 26/40

For any TV-code h : Σ × N∗ −→ Σ+ we define the sets H i(the ith column

in the matrix above) in the following manner:

H i = {h(σ, i)|σ ∈ Σ}

and we denote by H  the family of sets (H i|i ≥ 1). The set H i is called theith section  of  h.

In [9] there have been presented some results concerning relations existingbetween TV-codes, classical codes and L-codes. We will present briefly someof these results.

Any code g : Σ :−→ A+ is a TV-code. Indeed we can define h : Σ×N −→A+ as h(σ, i) = g(σ) for all σ ∈ Σ and i ∈ N. It is obvious that g = h.

Any L-code g : Σ −→ Σ+

is a TV-code. Indeed, we can define h :Σ × N∗ −→ Σ+ by h(σ, i) = gi+1(σ), for all σ ∈ Σ and i ∈ N. It is obviousthat g = h.

A major result on TV-codes is that there are TV-codes that are notL-codes. This assures us that TV-codes are a proper extension of L-codes.

The Schutzenberger criterion for codes has been extended to TV-codes inthe following manner:

Theorem 3.3.1 1 A function  h : Σ × N ∗ −→ A+ is a TV-code if and only if h is regular, H is catenatively independent, and the following property holdstrue:

(∀w ∈ A+)(w not in H ∞ =⇒ (∀i, j ≥ 1)(H 1 · · · H iw ∩ H 1 · · · H  j = φ ∨wH ≥i+1 ∩ wH ≥ j+1 = φ))

We are going to present a Sardinas-Patterson characterization theoremfor TV-codes2. First of all we are going to analyze the cases where we canget different factorizations. As seen in the Sardinas-Patterson theorem forclassical codes we begin by growing two strings by different code words.

First of all we begin by constructing a set of reminders such that anyword member of this set is a reminder from two different codewords, in factcodewords from H 1.

H 11,1 = H 21,1 = {x ∈ A+|∃σ σ

∈ Σ : h(σ, 1)x = h(σ

, 1)}

1More details and the complete proof can be found in [9]2The complete proof can be found in [9]

25

Page 27: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 27/40

It is obvious that if H 2 ∪ H 11,1 = φ then we can find two distinct factorizations

thus h not being a TV-code.After constructing H 1,1 we continue by adding a new codeword to thefirst(second) string. We encounter two cases.

Case 1: The codeword from H 2 is shorter than the reminder w ∈H 1,1(h(σ

, 2)w

= w, where w

is the new reminder). In this manner wedefine two the sets H 12,1 by taking in consideration if we catenate the newcodeword to the first string:

H 12,1 = {x ∈ A+|∃σ ∈ Σ : h(σ, 2)x ∈ H 11,1},

and H 21,2 if we catenate to the second string:

H 21,2 = {x ∈ A+|∃σ ∈ Σ : h(σ, 2)x ∈ H 21,1}.

Case 2: The codeword from H 2 is longer than the reminder w ∈ H 1,1(h(σ

, 2) =ww

, where w

is the new reminder). In this manner we define two the setsH 22,1 by taking in consideration if we catenate the new codeword to the firststring:

H 22,1 = {x ∈ A+|∃y ∈ H 11,1 : yx ∈ H 2},

and H 11,2 if we catenate to the second string:

H 11,2 = {x ∈ A+|∃y ∈ H 21,1 : yx ∈ H 2}.

In this manner we define inductively, for any k ≥ 1, the family of setsHk = {H 1i,j, H 2i,j|i, j ≥ k}:

• H k,k = H 1k,k = H 2k,k = {x ∈ A+|∃σ σ

∈ Σ : h(σ, k)x = h(σ

, k)};

• H 1i,j = {x ∈ A+|(i > k ∧H ix∩H 1i−1,j = φ)∨( j > k ∧H 2i,j−1x∩H  j = φ)},for all i, j ≥ k with either i > k or j > k;

• H 2i,j = {x ∈ A+|( j > k∧H  j x∩H 2i,j−1 = φ)∨(i > k ∧H 1i−1,jx∩H i = φ)},for all i, j ≥ k with either i > k or j > k.

26

Page 28: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 28/40

Let us see en example[9]. Let h be the function given in the table below.

σ1

σ2

σ3

Σ \ N∗1 2 3 4 5 · · ·

a

baa

aba

baa

b

bab

ab

aab

a

ab

aab

a

ab

aab

a

· · ·

· · ·

· · ·

We compute the following sets members of the family H1:

– H 1,1 = {a, b}, H 12,1 = {a} = H 21,2, H 22,1 = {a, b} = H 11,2;

– H 13,1 = φ = H 21,3, H 23,1 = {b, ab} = H 11,3, H 12,2 = {aa, ab} = H 22,2;

– H 14,1 = H 24,1 = H 11,4 = φ, H 13,2 = {a, b} = H 22,3, H 23,2 = {b} = H 12,3.

Theorem 3.3.2 Sardinas-Patterson criterion for TV-codes3

A function  h : Σ × N∗ −→ A+ is a TV-code if and only if  h is regular and the following property holds true:

(∀k ≥ 1)(∀i, j ≥ k)(H 1i,j ∩ H i+1 = φ = H 2i,j ∩ H  j+1)

This result leads to en effective algorithm for deciding if a given regular func-tion h is a code or not.

3A complete proof can be found [9]

27

Page 29: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 29/40

The Algorithm 

begin i = 1; j = 1while(true)

begin Compute H 1i,j

Compute H 2i,j,

if (H 1i,j ∩ H i+1 = φ ∨ H 2i,j ∩ H  j+1 = φ)return C is a not code

endwhileend 

28

Page 30: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 30/40

3.4 S-P Algorithm for SE-codes

Synchronized Extension systems (SE-systems for short) are powerful gen-erative tools, a new and elegant approach in formal language theory andcombinatorics on word. Introduced in [6], those are very useful when dealingwith non-standard generative devices as time-varying mechanisms, condi-tional grammars or monadic string rewriting systems [6, 9, 8, 10]. Those canalso be used to define a new concept of a code(Section 5 in [6],[4]).

A Synchronized Extension system  (SE-system, for short) [6] is a 4-tuple

G = (V, L1, L2, S ),

where V  is an alphabet and L1, L2 and S  are languages over V . L1 is calledthe initial language, L2 the extending language, and S  the synchronization set  of  G.

Let G = (V, L1, L2, S ) be an SE-system. We define the binary relation⇒G,r− on V ∗ as follows:

u ⇒G,r− v iff (∃w ∈ L2)(∃s ∈ S )(∃x, y ∈ V ∗)(u = xs ∧ w = sy ∧ v = xy).

x

ys

s

As seen in the picture the word s ∈ S  acts as a synchronizing word between u

and w. The relation ⇒G,r− is defined in such a manner that the synchronizingword from S  is neglected in the final result.

The language generated by an SE-system G and ⇒G,r− is defined as:

Lr−(G) = {w|∃v ∈ L1 such that v ⇒∗G,r− w}

If we want the synchronizing word to appear in the final result we mustdefine a new relation ⇒G,r+ in the following manner:

u ⇒G,r+

v iff (∃w ∈ L2)(∃s ∈ S )(∃x, y ∈ V 

)(u = xs ∧ w = sy ∧ v = xsy).

x

ys

s

29

Page 31: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 31/40

Also we can extend word to the left by defining in a similar manner the

relations ⇒G,l−

and ⇒G,l+

. The relation between these relation is that byextending to the left we obtain the mirror image of what we obtain by ex-tending to the right:

Ll−(G) =

Lr−( G),

where Ll−(G) is the language generated by an SE-system G extending to the

left and

Lr−( G) is the language generated by the SE-system G extending tothe right.

A derivation can be considered as word π over the alphabet L2 × S  (asting containing pairs like:the word used in the current derivation step, thesynchronization used). If  L2 and S  are indexed sets, a derivation can also be

considered as a sting of pairs of indexes.In this case we say that π in an r−-derivation  of  u into v, and we write

u ⇒πr− v.

A derivation u ⇒∗r− v is called an r−-derivation  of  u into v. Two r−-

derivationsu1 ⇒r− u2 ⇒r− · · · ⇒r− un

andu1 ⇒r− u2 ⇒r− · · · ⇒r− um

are called distinct  if  n = m or there is an i such that ui = ui. An SE-systemG is called r−-ambiguous if there is a word v having at least two distinct

r−-derivations in G.An r−-derivation u1 ⇒r− u2 ⇒r− · · · ⇒r− un is called reduced  if it does

not contain cycles, that is, there are no i and j such that i = j and ui = u j .If an SE-system has the property that for any word v there is at most areduced r−-derivation of  v, then it is called r−-nonambiguous or an r−-code.It is also generically called an SE-code.

Furthermore on we shall use only r−derivations because any result ob-tained for this kind of derivations can be easily translated to the other threetypes of derivations.

Definition 3.4.1 A SE-system  G = (V, L1, L2, S ) is called  k-bounded di-rected if  S  = V k and the derivation relation is defined as follow:

u ⇒G,r− v iff  (∃w ∈ L2)(∃s ∈ S )(∃x, y ∈ V ∗)(u = xs ∧ w = sy ∧ v = xy),

such that  s is the longest word in  S , suffix in  u and prefix in  w.

30

Page 32: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 32/40

Remark 3.4.1 4

• Codes are particular cases of SE-codes. Indeed, a set  C  ⊆ A+ is a codeif and only if the SE-system 

(A,C,C, {λ})

is r−-nonambiguous.

• Z-codes are not particular cases of SE-codes. If the SE-system:

G = (A ∪ {#}, X {#}, {#}X {#} ∪ X {##}, {#} ∪ X {#})

associated to the set of words X  is r−-nonambiguous then X is a z-code,but not conversely 5. This happens because in the case of a z-code the

words removed by left derivations must be kept because they are used  for right derivations. In the case of SE-codes these words are not kept and the right derivations do not depend on the left derivations madebefore.

The Sardinas-Patterson characterization theorem for codes can be extendedto SE-codes but it doesn’t lead to an effective algorithm for testing the SE-code property. It has been pointed in [6] (Remark 4.1) that this property isundecidable in general.

In order to develop a Sardinas-Patterson theorem like we must computeall the reminders in all attempts at a double factorization. In order to do that

we must define a structure that describes a step from a computation. It is notsufficient to describe only the reminders as in the original theorem becausean derivations can decrease or increase the length of the computation.

Definition 3.4.2 A configuration of G is a structure

[(l, s1), (r, s2)](z,s),f 

where l, r ∈ V ∗, s1, s2, s ∈ S  ∪ {λ} , z ∈ L1 ∪ L2 ∪ {λ}, and  f  ∈ {0, 1}.

We denote by Config(G) the set of all configurations of the SE-systemG.

A configuration [(l, s1), (r, s2)](z,s),f  describes a possible analysis step of two distinct r− derivations of the same word, as it is pictorially representedin the following figure:

4For more details see [6]5For more details the reader is directed to [4]

31

Page 33: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 33/40

l s1

l

r

s2

The flag f  is 0 if both r−-derivations are extended in the same way, and 1otherwise. The pair (z, s) is used to avoid identic r−-derivations when f  = 1.

We have defined a possible analysis step of two distinct r− derivations.We must define a way for a configuration to produce another configurationsstrictly depending on how can we continue these two distinct derivations.This passing from a configuration to another is given by a binary relation−→ on Config(G).

Definition 3.4.3 The passing from a configuration to another one is given 

by a binary relation  −→ on  Config(G). We define this relation by consid-ering a generic configuration 

[(l, s1), (r, s2)](z,s),f 

and showing all possible steps from it:

1. [(l, s1), (λ, s1)](λ,λ),0s1x

−→ [(l, s1), (r, s2)](x,s2

),0, where x = rs2.

This case is pictorially represented in the following figure:

-l

l

xs1

s1

s1

l

l

r s

2

x

s1

2. [(l, s1), (λ, s1)](λ,λ),0s1x

−→ [(l, s1), (r, s1)](x,s2

),0, where l = lr and  s1 =rx.

This case is pictorially represented in the following figure:

-l

l

s1

s1

l

s1 x

r x

s1

l

s

1

3. [(l, s1), (r, s2)](z,s),0s2x

−→ [(l, s1), (r, s2)](z,s),f , where rx = rs2 and 

((z, s), f ) =

((λ, λ), 0), if  r = λ and  s1 = s2((z, s), 1), otherwise

This case is pictorially represented in the following figure:

32

Page 34: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 34/40

-l s1l s1

l s2

xs1

r l r x

r

s

2

4. [(l, s1), (r, s2)](z,s),0s2x

−→ [(l, s1), (r, s1)](z,s),f , where l = lr, s1 = rrx

and 

((z, s), f ) =

((λ, λ), 0), if  r = λ and  s1 = s1

((z, s), 1), otherwise

This case is pictorially represented in the following figure:

-

r x

s

1

l

l

x

r

l

l

s1

s2

s2

s1

r

5. [(l, s1), (r, s2)](z,s),0s1x

−→ [(l, s2), (r, s2)](z,s),f , where x = rrs2, l = lr

and 

((z, s), f ) =

((λ, λ), 0), if  r = λ and  s2 = s2((z, s), 1), otherwise

This case is pictorially represented in the following figure:

-ll s1

l s2r

s1 x

l

s

1

s2

rr

r

x

6. [(l, s1), (r, s2)](z,s),0s1x

−→ [(l, s1), (r, s2)](z,s),f , where x = xs1, r = xr

l = lx and 

((z, s), f ) =

((λ, λ), 0), if  r = λ and  s1 = s2

((z, s), 1), otherwise

This case is pictorially represented in the following figure:

-ll

l r

s

1

s2

x

l

r

s1

s1

r s2

x

7. [(l, s1), (r, s2)](z,s),0s1x

−→ [(l, s1), (r, s2)](z,s),1, where l = ll,s1 = lx,r = lr.

This case is pictorially represented in the following figure:

33

Page 35: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 35/40

-..................................

ll s1

l

s1

s2

s2

r

lr

r

x s

1

8. [(l, s1), (r, s2)](z,s),1s1x

−→ [(l, s2), (r, s2)](λ,λ),1, where(z, s) = (x, s2),l =lr and  x = rrs2.

This case is pictorially represented in the following figure:

-l s1

l

s1

r

x

s2 l r

r r

s2

s

2l

l

x

9. [(l, s1), (r, s2)](z,s),1s1x

−→ [(l, s1), (r, s2)](λ,λ),1, where (z, s) = (x, s1), l =lr and  x = rrs2. This case is pictorially represented in the following 

 figure:

-l s1

l

s1

r

x

s2 l

l

xl

r

r

s

2

s2

10. [(l, s1), (r, s2)](z,s),1s1x

−→ [(l, s1), (r, s2)](λ,λ),1, where (z, s) = (x, s1),l =ll, r = lr and  s1 = lx.

This case is pictorially represented in the following figure:

-

..................................

..................................

l s1

l

s1

r

x

s2 l r

l

s2

l s

1

x

r

11. [(l, s1), (r, s2)](z,s),1s2x

−→ [(l, s1), (r, s2)](λ,λ),1, where (z, s) = (x, s2), rx =rs2.

This case is pictorially represented in the following figure:

-l s1

l r s2

s2 x

l

l r x

s1

r s

2

34

Page 36: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 36/40

12. [(l, s1), (r, s2)](z,s),1s2x

−→ [(l, s1), (r, s2)](λ,λ),1, where (z, s) = (x, s1), l =

l

r

and  s

1 = r

rx.This case is pictorially represented in the following figure:

-

..................................

..................................

l s1

l r s2

s2 x

l

l r x

s1

s

1

r

l

After describing how a configuration can produce another configurationswe define the sets Qi ⊆ Config(G),for all i ≥ 0, for any SE-system G =(V, L1, L2, S ) , as follows:

• Q0 = {[(λ, λ), (r, s2)](r,s2),0|rs2 ∈ L1, s2 ∈ S } ,

• Qi+1 = {[(l, s1), (r, s2)](z,s),f |∃[(l, s1), (r, s2)](z,s),f  ∈ Qi ∧[(l, s1), (r, s2)](z,s),f  −→ [(l, s1), (r, s2)](z,s),f }.

Theorem 3.4.1 6 Let G = (V, L1, L2, S ) be an SE-system. G is an r−code if and only if for any i ≥ 0, Qi does not contain configurations [(l, s1), (λ, s1)](z,s),1.

This theorem leads us to an algorithm for verifying that a given set isa SE-code or not. Unfortunately we can’t give a halting condition for thisalgorithm. If it stops the answer is that the given set is not a SE-code. Thus

the SE-code property is semi-decidable.

6The proof can be found in [4]

35

Page 37: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 37/40

The Algorithm 

begin i = 1;Compute Q1

while ([(l, s1), (λ, s1)](z,s),1 not in Qi) and ( Qi = φ )begin 

i := i + 1if  ([(l, s1), (λ, s1)](z,s),1 in Qi)

then X  is not SE-codestop;

Compute Qi

endwhileend 

The SE-code property is semi-decidable in general but there are particularsubclasses of SE-system for which this property is decidable. Indeed for thek-bounded directed SE-systems7 this property is decidable.

7See Definition 3.4.1

36

Page 38: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 38/40

Chapter 4

Conclusions

This paper is dedicated to the study of a very important aspect of the theoryof codes: how to determine if a given set is a code or not. This problem issolved, in the case of classical codes, by the Sardinas-Patterson characteri-zation theorem . This result leads to an effective algorithm for detecting thecode property for a given set.

When introducing various classes of codes, the authors have to solve avery important problem: the way of determining how a given set can actas a code or not. This problem is usually solved extending the Sardinas-Patterson result for that specific code. This is the case of  z-codes, TV-codesand SE-codes.

In the case of SE-codes we have developed a Sardinas-Patterson character-ization theorem but unfortunately it doesn’t lead us to an effective algorithm.We concentrate our efforts in determining specific subclasses of SE-systemsfor which the SE-code property is decidable. This remains an interestingopen problem.

37

Page 39: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 39/40

Bibliography

[1] J. Berstel, D. Perrin. Theory of Codes, Academic Press, 2002.

[2] M. Madonia,S. Salemi T. Sportelli. A Generalisation of Sar-

dinas and Pattersons algorithm to z-codes, Theoretical Com-puter Science 108, 1992, 251-270.

[3] H.A. Maurer, A.Salomaa, D.Wood. L-codes and Number Sys-tems, Theoretical computer Science 22, 1983, 331-346.

[4] I. Popa, B. Pasaniuc. A Sardinas-Patterson Characterization Theorem for SE-codes, 10th International Conference on Au-tomata and Formal Languages - Debrecen Hungary, (Informa-tion Processing Letters, submitted).

[5] S. Roman. Coding and Information Theory , Springer-Verlag,1992.

[6] F.L. Tiplea, E. Makinen, C. Apachite. Synchronized Exten-sions Systems, Acta Informatica 37, 2001, 449-465.

[7] F.L. Tiplea, E. Makinen. A Note on Synchronized Extension Systems, Information Processing Letters 79, 2001, 7-9.

[8] F.L. Tiplea, E. Makinen. Note on SE-systems and Regular Canonical Systems, Fundamenta Informaticae 46, 2001, 253-256.

[9] F.L. Tiplea, E. Makinen, C. Enea. SE-Systems, Timing Mech-anisms, and Time-Varying Codes, International Journal of Computer Mathematics 79, 2002.

38

Page 40: Sardinas Patterson Like Algorithms in Coding Theory

8/3/2019 Sardinas Patterson Like Algorithms in Coding Theory

http://slidepdf.com/reader/full/sardinas-patterson-like-algorithms-in-coding-theory 40/40

[10] F.L. Tiplea, E. Makinen. On the Complexity of a Problem on 

Monadic String Rewriting Systems, Journal of Automata, Lan-guages and Combinatorics (to appear).

39