A characterization of constant-time cellular automata computation

16
Physica D 45 (1990) 4044419 North-Holland A CHARACTERIZATION OF CONSTANT-TIME CELLULAR AUTOMATA COMPUTATION * Sam KIM and Robert McCLOSKEY Computer Science Department, Rensselaer Polytechnic Institute, Tmy, NY 12180, USA Received 17 January 1990 Revised manuscript received 20 March 1990 This paper investigates three different classes of one-dimensional CA languages that. can be accepted in constant time. For each class of the languages, two characterizations are given, one in terms of finite sets and the other in terms of a subclass of deterministic finite automata. It is also shown that the constant-time CA languages have very restricted closure properties. 1. Introduction ‘A cellular automaton is an n-dimensional ar- ray of identical finite state machines, called cells, which operate in a sequence of discrete time steps. At each time step, every cell reads the states of its neighbors and changes its own state. The cellu- lar automaton model has been extensively studied for the exploitation of its parallelism in language recognition and image processing on the one hand [l-3] and for identifying its dynamic properties and simulating physical systems on the other [4,5]. This paper investigates the languages that can be recognized in constant time by one-dimensional cellular automata and introduces two characteri- zations of these languages, one in terms of finite sets and the other in terms of a subclass of deter- ministic finite automata. The constant-time cellu- lar automata languages defined in this paper are different from the finite-time sets on cellular au- tomata defined in refs. [4,6]. There, the finite-time set of a cellular automaton is defined to be the set of configurations of a cellular automaton at some constant time t that can be evolved from all pos- sible initial configurations. Every finite-time set is regular [4,6]. * Partial support for this research was provided by the Directorate of Computer and Information Science and Engineering of the National Science Foundation under Institutional Infrastructure No. CDA-8 805910. This paper has five sections including this one. Section 2 introduces basic definitions and nota- tion. Sections 3 and 4 show characterizations of constant-time cellular automata languages in terms of finite sets and deterministic finite au- tomata, respectively. Section 5 gives some further remarks. 2. Notation and terminology A one-dimensional cellular automaton (CA) is a linear array of identical finite state machines, called cells, that operate synchronously at discrete time steps (see fig. 1) [l]. Initially, all cells are in the quiescent state and an input of length n is applied to n consecutive cells. At each time step, each cell changes its state depending on its own state, its external input and the current states of its two neighbors. The external input is applied during the first step and remains null thereafter. The number of cells of a CA is equal to the length of the input, except that it is one for the null input. We also assume that every cell has a distinguished accepting state and a distinguished rejecting state. All other states are said to be neutral. Once a cell is in the rejecting or the accepting state, it cannot change state. Conventionally, a CA, as a language recognizer, 0167-2789/90/$03.50 @ 1990 - Elsevier Science Publishers B.V. (North-Holland)

Transcript of A characterization of constant-time cellular automata computation

Page 1: A characterization of constant-time cellular automata computation

Physica D 45 (1990) 4044419

North-Holland

A CHARACTERIZATION OF CONSTANT-TIME CELLULAR AUTOMATA COMPUTATION *

Sam KIM and Robert McCLOSKEY Computer Science Department, Rensselaer Polytechnic Institute, Tmy, NY 12180, USA

Received 17 January 1990 Revised manuscript received 20 March 1990

This paper investigates three different classes of one-dimensional CA languages that. can be accepted in constant time. For each class of the languages, two characterizations are given, one in terms of finite sets and the other in

terms of a subclass of deterministic finite automata. It is also shown that the constant-time CA languages have very restricted closure properties.

1. Introduction

‘A cellular automaton is an n-dimensional ar- ray of identical finite state machines, called cells, which operate in a sequence of discrete time steps. At each time step, every cell reads the states of its neighbors and changes its own state. The cellu- lar automaton model has been extensively studied for the exploitation of its parallelism in language recognition and image processing on the one hand [l-3] and for identifying its dynamic properties and simulating physical systems on the other [4,5].

This paper investigates the languages that can be recognized in constant time by one-dimensional cellular automata and introduces two characteri- zations of these languages, one in terms of finite sets and the other in terms of a subclass of deter- ministic finite automata. The constant-time cellu- lar automata languages defined in this paper are different from the finite-time sets on cellular au- tomata defined in refs. [4,6]. There, the finite-time set of a cellular automaton is defined to be the set of configurations of a cellular automaton at some constant time t that can be evolved from all pos- sible initial configurations. Every finite-time set is regular [4,6]. * Partial support for this research was provided by the

Directorate of Computer and Information Science and

Engineering of the National Science Foundation under Institutional Infrastructure No. CDA-8 805910.

This paper has five sections including this one. Section 2 introduces basic definitions and nota- tion. Sections 3 and 4 show characterizations of constant-time cellular automata languages in terms of finite sets and deterministic finite au- tomata, respectively. Section 5 gives some further remarks.

2. Notation and terminology

A one-dimensional cellular automaton (CA) is a linear array of identical finite state machines, called cells, that operate synchronously at discrete time steps (see fig. 1) [l]. Initially, all cells are in the quiescent state and an input of length n is applied to n consecutive cells. At each time step, each cell changes its state depending on its own state, its external input and the current states of its two neighbors. The external input is applied during the first step and remains null thereafter. The number of cells of a CA is equal to the length of the input, except that it is one for the null input. We also assume that every cell has a distinguished accepting state and a distinguished rejecting state. All other states are said to be neutral. Once a cell is in the rejecting or the accepting state, it cannot change state.

Conventionally, a CA, as a language recognizer,

0167-2789/90/$03.50 @ 1990 - Elsevier Science Publishers B.V. (North-Holland)

Page 2: A characterization of constant-time cellular automata computation

S. Kim and R. McCloskey / Constant-time CA 405

a b a b

. . . . . . . . . . - 0

Fig. 1. A cellular automaton.

has a designated accepting cell (usually one of the boundary cells) [1]. An input is accepted iff the designated cell enters an accepting state. For a CA computa t ion which allows linear- or higher- t ime complexity, it does not make any difference which cell is defined as the accepting cell because there is enough t ime to communicate across the entire array. However, for a sublinear- or constant- t ime CA computat ion, it does not make sense to have such a designated cell. Instead, the accepting condition must be defined differently. Various ac- cepting conditions give rise to models with varying language recognition capabilities [7]. In this paper we study the following three CA models.

Defini t ion 1 ( cons tant - t ime CA) . Let k > 0 be a fixed integer.

(i) ACA: The input is accepted iff all cells are simultaneously in the accepting state in k steps, with no cells having entered the rejecting state.

(ii) ECA: The input is accepted iff there is a cell in an accepting state in k steps.

(iii) MCA: The input is accepted i f f there exists a cell in an accepting s tate with no cells in the rejecting s tate in k steps.

This definition is different from the one in ref. [8], where ACA, named 1-CSCA, was defined such that both accepting state and rejecting state can change to other states. An input is accepted iff all cells are simultaneously in an accepting state in k steps, for a constant k. Let XCA denote a class of CA defined above. By k-XCA we denote a constant- t ime XCA which accepts an input in some constant k > 0 steps. In this paper we only investigate deterministic CA.

Defini t ion 2 ( substr ing vector) . Let ~ be a finite a lphabet and x ~ E*. For an integer k > 0 and x E E*, define f~(x) to be the prefix of x of length k, tk(x) to be the suffix o f x of length k, and Ik(x) to be the set of substrings of x of length k, i.e. {vlv E E k and x = uvw, for some u ,w c E*}. I f Ix[ < k, then f~(x) = tk(x) = x. For k > 0, the substring vector of order k of x is an ordered triple SVk(x) = ( f k - i ( x ) , Ik(x), t~_i(x)) .

Defini t ion 3. For a finite a lphabet ~ and integer k > 0, denote by ~<k the set of strings in Z* of length less than k. Let a , a ' , V, 7 ' C_ Z<k and/3, /3' c_ ~k.

(i) U~(a,/3,7) denotes the language L C_ Z* such that x E L iff fk-l(X) E a, Ih(x) C /3, and t k - l ( x ) ~ 7.

(ii) /~k(~,/3,7) denotes the language L C_ N* such that x E L iff f k - l ( x ) E a , Ik(x) n/3 ¢ O, or

(iii) ]l)/k((a,/3, 7), (a ' , /3 ' , 7 ' ) ) denotes the lan- guage L C_ ]E* such that x E L iff

(a) f k _ i ( X ) E O~, Ik (x ) C_ /3, and t k - l ( X ) E 7, and

(b) f k - l ( x ) E a ' , Ik(x) Ni l ' ¢ 0, or tp - l (x ) E 7' , i.e., Uk((a, /3 ,7) , (a ' , /3 ' ,7 ' ) ) = Uk(a,/3, 7) N/~k(a',/3', 7' ).

Defini t ion 4 ( L T S S ) [9] . Let L C_ ~*. L is zero- testable in the strict sense (0-LTSS) iff it is Z* or 0. For k > 0, L is k-LTSS iff there exist a C_ Z<k, /3 C Z~, and 7 C_ E<k such that L = grk(a,/3, ff). A language is LTSS iff it is k-LTSS, for some k _> 0.

Defini t ion 5 ( L T E S ) . Let L C ]E*. L is zero- testable in the existential sense (0-LTES) iff it is ~* or 0. For k > 0, L is k-LTES iff there exist a _C ~<~, 13 C ~k, and 7 C Z <k such that L = /~k(a,/3,7). A language is LTES iff it is k-LTES, for some k _> 0.

Defini t ion 6 ( L T M S ) . Let L C_ Z*. L is zero- testable in the mixed sense (0-LTMS) iff it is N* or 0. For k > 0, L is k-LTMS i f f the re exist a , a ' , 7, 7' C_ Z <k and /3,/3' C Z k such that L = 2tTIk((a,/3,7), ( a ' , /3 ' , 7 ' ) ) . A language is LTMS iff it is k-LTMS, for some k > 0.

Defini t ion 7 (locally tes table languages) [9,10]. Let L C ~*.

(i) L is 0-testable if[" it is ]C* or 0. (ii) For an integer k > 0, L is k-testable if[, for

all x, y E Z*, SVk(x) = SVk(y) implies that either both x and y are in L or neither is in L.

(iii) L is locally testable if it is k-testable for some k > 0.

D e f i n i t i o n 8 (LTES~ LTSS~ L T M S and lo- cally t e s tab le a u t o m a t a ) . A finite au tomaton is LTES (LTSS, LTMS, locally testable), if it ac-

Page 3: A characterization of constant-time cellular automata computation

406 S. Kim and R. McCloskey ,’ Constant-time CA

cepts an LTES (respectively, LTSS, LTMS, locally testable) language.

3. Characterizations of constant-time CA

languages

This section investigates the properties of the languages defined in section 2 and shows that they characterize constant-time CA languages.

Lemma 1. For any k > 0, L is L-LTSS iff z is k-LTES.

Proof. If L is 0-LTSS, then it is either C* or 0, making x either 0 or C*, respectively, and so z is 0-LTES by definition. If L is J+LTSS, for some X: > 0, let, a, p, and y be such that L = Uk(a,fl, y). Find& = C<le-cy,@’ = Ck-Bandy’ = C<“-y. Clearly, for any z E c*, x E z iff f&l(z) E a’, Ik(x)np’ # 0, Or tk-l(“C) E 7’. It fOllOWS that z = Ek(Q’,P’,+), and so z is k-LTES. The converse is proved similarly. 0

Lemma 2. If a language L is L-LTES (k-LTSS), then it is K’-LTES (L’-LTSS), for any k’ > k.

Proof. Let L be L-LTES and let L’ > k. If k = 0 then either L = h:k’(0,0,0) = 0 or L = &‘(c <k’,Ek’,C<k’) = C‘. Thus, L is also k’- LTES. If k > 0, let a, p, and y be such that L = ,??b(a,P,-y). Construct the sets CY’ = {zzulx E cr,w E C‘, Izw1 < /G’}, p’ = {UZW\Z E p,u,w E C*, IUXWI = 12’}, and y’ = {wzix E y,w t C’, 1wzI < k’}. We leave it for the reader to show

that, for all z E c*, fh_l(x) t a, Ik(x) no # 0, or t&1(x) E 7 iff fk’_1(z) E a’, Ik’(T)np’ # 0, or tk,-l(~) E -y’. It follows that L = Ek’(a’,p’,y’), i.e., L is k’-LTES. Now let L be L-LTSS. By lemma 1, z is L-LTES, and by the above, z is also k’- LTES. Then using lemma 1 again, we have that L is L’-LTSS. 0

Lemma 3. A language L is LTMS iff it is the intersection of an LTSS language and an LTES language.

Proof. Let L be I2-LTMS. If X: = 0, then ei- ther L = 0 = 0 n 0 or L = C* = C’ n C’, from which it follows that L is the intersection of a 0-LTSS language and a 0-LTES language. If k > 0, let (~,p,y, CX’,~‘, and y’ be such that

L = ~k(((I,p,y),(a’,p’,r’)). Then L is the in- tersection of the k-LTSS language L1 and the k- LTES language Lz, where L1 = tik(a, 0, y) and L2 = Ek(a’,p’, 7’). For the converse, let ~51 be L1-LTSS and Lz be Lz-LTES. By lemma 2, L1 is L-LTSS and L2 is L-LTES, where X: is the maximum of L1 and liz. If k = 0, then L1 f’ Lz is either C* or 0, which is 0-LTMS. Other- wise, let (Y, p, y, cr’, p’, and y’ be such that L1 = Uk(a,Q,y) and L2 = Ek(a’,o’,y’). Then L1 n L2 = Mk(((~,p,r),(a’,P’,y’)), which is k- LTMS. q

Lemma 4. For any k > 0, L is a L-ACA language iff z is L-ECA.

Proof. Let A4 be a L-ACA which accepts L. Con- struct a k-ECA M’ which accepts z as follows. M’ simulates M such that at the kth step each cell of 1M’ enters the accepting state if its simulation is to enter a nonaccepting state. If the simulation is to enter the accepting state at the Lth step, the cell stays in a neutral state. Conversely, let L be a language accepted by a L-ECA M’. Construct a L-ACA M which accepts E. M simulates M’ up to X: steps and lets each cell enter the accepting state if its simulation is to enter a nonaccepting state.

0

Theorem 1. A language L is LTSS iff it is ac- cepted by an ACA.

Proof. Let L be L-LTSS. If X: = 0, then L is ei- ther C’ or 0. If L is C’, then define the initial state of the cells of M to be the accepting state. If L is 0, define the initial state of the cells to be the rejecting state. Clearly, M accepts L. If X: > 0, let cr, p, and y be such that L = ok(a,p, 7). We construct a ([(k + 1)/21)-ACA M which accepts L as follows. The cells of M have three look-up tables for a, fi, and y, respectively. For an in- put 2 = (1102.. .a,, let ci be the cell which has ai as its external input. Let ai = E, for i < 1 or i > n. Construct M such that cell c; finds the sub- string WW; = ai-r(k-1)/21 . . .a;. . .ai+L(&l)/2] of z in [(k + 1)/21 steps and enters the accepting state if any of the following conditions is satisfied.

(i) (w;\ = k and wi E /?. (ii) wi is a prefix of 2, lwil < L and wig E a,

for some y E C’.

Page 4: A characterization of constant-time cellular automata computation

S. Kim and R. McCloskey / Constant-time CA 407

(iii) wl is a suffix of x, Iwll < k, and y w i E 7, for some y E ]E*. Otherwise, ci enters the rejecting state. Notice tha t by having the b o u n d a r y cells send blank sym- bols to their neighbors, we can make it possible for cell ci to determine whether wi is a prefix or suf- fix of z. We leave it for the reader to show tha t f k - l ( X ) E ~ , I k ( x ) C/3 , and tk_ l (x ) E 7 iff, with input z, all cells ci, 1 < i < n will be in the ac- cept ing state in [(k + 1) / 2] steps. Thus, M accepts L.

Now, le t L be the language accepted by a k- A C A M. If k = 0, then L is ei ther E* or 0. Thus , L is an LTSS language. Suppose k > 1. F ind L0 = {x[ Ix I < 2k - 2 and M accepts x in k steps} and const ruct the sets: a = L0 U {xl with input x = al • • • a2k-2, cells e l , . . . , C~_l enter the accept ing state in k steps}, 7 = L o U { x I with input x = al • • • a2k-2, cells ck, • • •, C2k-2 enter the accept ing s ta te in k steps} and /3 = {x I with input x = al . . . a2k-1, cell ck enters the accept ing state in k steps}.

We leave it for the reader to show that , for every word w E Z*, w is accepted by M iff f2k-2(w) E c~, I2k--l(W) C /3 and t2k-2(w) E 7. Thus, L is the (2k - 1)-LTSS language U2~-1 (c~,/3, 7)- []

R e m a r k : Notice tha t the cons t ruc t ion above does not necessarily give the smallest a , / 3 and 7 such tha t U2k- l ( a , f l , 7) = L. For example, there m a y exist w E fl such that , for all x , y E ~*, x w y ~ L. Word w is useless for defining L. We can remove useless words from the sets by the following pro- cedure.

(i) Wi th a , fl, and 7, cons t ruc t a graph G(V, E ) as follows: V = {[w]lw is in ei ther c~ or 7, or wa E /3 for some a E ~}. For each pair [Wl], [we] in V, assign a directed edge from [Wl] to [w2] with label a, if w l a E fl and t 2 k _ 2 ( w l a ) = w2.

(ii) Search G and mark all nodes which are on a pa th from a node [wl], wi E ~ , to a node [wj],

w j E T . (iii) Delete w from a and 3' if node [w] has no

mark in G. (iv) I f a node [wi] has no mark and has an out-

going edge labeled by a E Z, delete wia f rom/3.

T h e o r e m 2. A language L is LTES iff it is ac- cepted by an ECA.

P r o o f . The theorem follows from lemmas 1, 4 and

theorem 1. []

L e m m a 5. I f a language L is LTMS, then it is accepted by an MCA.

P r o o f . I f L is an LTMS language, then by l emma 3 there exist an LTSS language L1 and an LTES language L2 such tha t L = L1 N L2. Let M1 and M2 be a k -ACA and a k - E C A which accept L1 and L2, respectively. By theorems 1 and 2, such CA exist. Cons t ruc t a k -MCA M which accepts L by s imulat ing M1 and M2 simultaneously. At the k th step, each cell of M does the following. - Enters the accept ing state if bo th s imulat ions are in the accept ing state. - Enters the rejecting state if the simulat ion for the cell of M1 is in a nonaccept ing state. - Enters a neutra l state, otherwise. []

L e m m a 6. Let M be an MCA. Then L ( M ) is an LTMS language.

P r o o f . Suppose M is a k -MCA, for some k > 0. I f k = 0, then L ( M ) is ei ther ]E* or 0 and thus is an LTMS language. Suppose k > 0. Using the same idea as in the proof of theorem 1, we con- s t ruct ( a , /3 ,7 ) and ( a ' , / 3 ' , 7 ') such tha t L ( M ) =

/t:/h((a, f l , 7 ) , ( a ' , / 3 ' , 7 ' ) ) . F ind Lo = {xl Ix] < 2k - 2 and with input x, no cell of M enters the rejecting s ta te in k steps} and const ruct the sets: a = L o U { x [ with input x = a l . . . a 2 ~ - 2 , ai E ~ ] , n o cells among C l , . . . , c ~ - 1 enter the re- jec t ing state at the k th step}, 7 = Lo U {x I with input x = al . . . a 2 k - 2 , ai E ~3, no cells a m o n g c~ , . . . , c2k_2 enter the rejecting state at the k th step} a n d / 3 = {x I with input x = a l . . . a 2 ~ - l , cell c~ does not enter the rejecting state at the k th step}.

Let L~ = {x I (x l <_ 2k - 2 and M accepts x in fit and 7 t k steps}. We cons t ruc t cd, as follows:

a ' = L~ U {x I with input x = al . . . a 2 k - 2 , ai E E, at least one cell among c l , . . . , c ~ _ ~ enters the accept ing state at the kth step}, 7 ' = Lo U {x] with input x = a l . . . a 2 / ¢ - 2 , ai E Z, at least one cell a m o n g c ~ , . . . , c2~-2 enters the accept ing state at the k th step} and fl' = {x[ with input x = a l . . - a 2 k - 1 , ai C ~, cell ck enters the accept ing state at the k th step}.

We leave it for the reader to show tha t L ( M ) =

M2~-1((~,/3, ~), (~',/3', 7')). [] T h e o r e m 3. A language L is an LTMS language

Page 5: A characterization of constant-time cellular automata computation

408 S. Kim and R. McCloskey / Constant-time CA

iff it is accepted by an MCA.

Proof. The theorem follows from lemmas 5 and 6. I3

Since any ACA or ECA can be simulated by an MCA, we have the following corollary.

Corollary 1. The class of LTMS languages in- cludes the classes of LTES languages and LTSS languages.

As the following theorem shows, the subclasses of CA languages that we have introduced have very limited closure properties under Boolean op- erations.

Theorem 4.

(a) The class of LTMS languages is not closed under union, intersection or complementation.

(b) The class of LTSS languages is closed un- der intersection, but is not closed under union or complementation.

(c) The class of LTES languages is closed un- der union, but is not closed under intersection or complementation.

Proof.

(a) Let C = {a, b, c}. Consider Lr = b{a, b, c}’ and L2 = {a,b}*. Clearly, LI is LTES and LZ is LTSS. By corollary 1 both L1 and L2 are LTMS languages. Suppose L3 = L1 u Lx is an LTMS lan- guage which is accepted by a k-MCA M, for some k > 0. Let z = bb2”+‘cbzk+‘, y = ab’“+‘bb*“+‘,

and i=a b2”+‘cb2”+‘. Clearly, 2 and y are in Ls, and and t is not. We show that if M accepts x

and y, then it must’also accept z. Let C,(xxuy) denote the sequence of consecutive cells on a CA which get the substring w on an input xwy. We consider the following two cases:

Case (1). When M accepts z by having at least one cell in Cbk Cb~~ + I (bb*“+l cb* k+l ) entering the ac- cepting state in k steps, then, with input z, at least one cell in Cbhcbk (abzkf1cb2”+‘) will enter the accepting state in k steps with no cell in the rejecting state. Since y is accepted, no cells in Cab& +I (ab 2k+1bb2k+‘) will b e in the rejecting state in k steps. It follows that M must also accept 2, a contradiction.

Case (2). When M accepts x by having at least one cell in Cbbk (bb* k+l cb* k+l ) entering the accepting

state in k steps, with no cells in C~L~~ZL+~ (bb*“+’

xcb*“+‘) entering either the accepting or reject- ing state. Since no cell in C~S~~ZL+~ (bb2k+1cb2k+‘)

enters the accepting state in k steps, with input

y no cells in Cbk+~bpk+~(ub2k+1bb2k+1) will enter the accepting state in k steps. Hence, M accepts y by having at least one cell in Cabk(ab2’+’ bb*“+l)

entering the accepting state in k steps. Obviously, M must also accept t since at least one cell in Cab’ (ab2k+‘cb2k+1 ) will enter the accepting state in k steps with no cells in C~kc~2k+l(ab2k+1cb2k+1)

in the rejecting state. Again we are in a contradic- tion. LTMS languages are not closed under union.

Now, consider zr and Es which are LTSS and LTES languages, respectively, by lemma 1. By lemma 3 L4 = z1 n z2 is LTMS. We just proved that %I = L1 U L2 is not an LTMS language. It follows that LTMS languages are not closed under complementation.

Finally, let L5 = C*aE* and L6 = C*bC*. Both L5 and L6 are LTMS languages. Suppose L7 = Ls n L6 is an LTMS language which is accepted by a k-MCA M, for some k _> 0. Consider w = c”ac”bc” and w’ = cnbcnac”, for some n > L. Both w and w’ will be accepted by M. It follows that either cnacnacn or cnbcnbc”, neither of which is in L7, must be accepted by M, a contradiction. LTMS languages are not closed under intersection.

(b) Given two ACA Ml and Ms, it is easy to construct an ACA M such that each cell simulates the cells of Ml and Ms in parallel and accepts the input iff both simulations accept the input. ACA languages are closed under intersection. Using the technique from part (a), we can prove that ACA languages are not closed under union or comple- mentation.

Part (c) can be proved similarly. We leave the proofs for the reader. 0

By using the same idea as in ref. [8], it can be shown that a language is regular iff it is accepted by a nondeterministic ACA. This implies that nondeterministic constant-time CA have more computational power than their deterministic ver- sion. This is in contrast to the finite automata model.

Page 6: A characterization of constant-time cellular automata computation

S. Kim and R. McCloskey / Constant-time CA 409

4. Sequential machine characterization o f constant-time CA

We know that there are two subclasses of com- putat ional models, parallel and sequential. An in- teresting question is" For a given parallel model, is there a sequential model which is computa- tionally equivalent? By computat ional equivalence we mean that both models solve the same prob- lems without regard to their t ime complexity. I f two computing models are computat ional ly equiv- alent, we say that each characterizes the other. If a parallel model, like unrestr icted CA, can simu- late a Turing machine, then by Church's thesis it is computat ional ly equivalent to the Turing ma- chine. We are interested in some subclasses of the models which are less powerful than the Turing machine. In ref. [11], it is shown that some sub- classes of systolic models can be characterized in terms of sequential models. Section 3 showed that ACA, ECA, and MCA accept LTSS, LTES, and LTMS languages, respectively. All these languages are regular. This section identifies three subclasses of deterministic finite s tate au toma ta which ac- cept these languages, actually showing sequential model characterizations for the constant- t ime CA defined in section 2.

We shall introduce some definitions concern- ing deterministic finite au t om a t a before we de- scribe the main result. Let M = (Q, E, 5, q0, F ) be a deterministic finite automaton. (Our nota- tion follows ref. [121. ) L(M) denotes the language accepted by M, i.e., {x ] 6(q0, x) E F}. We some- times use L(M,p) to denote {x I (i(p,x) E F}. Thus, L(M) = L(M, qo). We assume that the au- tomaton is given in terms of its s tate transit ion graph. By qd and qe we denote the rejecting sink state and the accepting sink state, respectively, i.e., 5(qd, a) = qd and 5(qe, a) = qe, for all a E E, qe is in F and qa is not in F. We shall use the ter- minology "component" to refer to any subgraph of a state transit ion graph whose underlying undi- rected subgraph is connected. When we show a s tate transit ion graph, we will omit qa and all the edges leading to it. By SCC we mean a maximal strongly connected component of a state transi- tion graph excluding qd.

Definition 9 (reachable c o m p o n e n t ) . Let rni

a b a

b

(a)

1,5

al a

@ (b)

Fig. 2. (a) A state transit ion graph. (b) The pair graph on QI × Q2 = {1 ,2 ,3 ,4 ,5} × {3,4,5}.

be a component of a state transit ion graph. The reachable component from rnl, denoted by mi , , is the subgraph which comprises mi and all directed paths reachable from mi. Likewise mp, denote the reachable component from state p. Notice that if p is a state in an SCC rni, then rni, = rap,.

Definition 10 (pair graph ). Let M = (Q, E, ~, qo,F) be an automaton. Let Q1, Q2 c Q, which are not necessarily disjoint, and * be a symbol not in Q. The pair graph on Q1 xQ2 is the edge-labeled graph G(V, E), where V = ( q l u *) × (Q2 u { * } ) - {(*,*)} and E is defined as follows (see fig. 2, for an example):

Define 5i: Qi x E --* Qi u {*}, i = 1, 2 such that for a l l p E Q ~ a n d a E E,

61(p,a) = q i f S ( p , a ) = q E Q i ,

= * if 5(p,a) ~ Qi.

Then E = {((p,q),a,(r,s))lp E q l , q E Q2,p # q , r e u { , } , s E u { * } , 6 ( p , a ) = r,

52(q,a) = s, and r # * or s # *}. Notice that from a node (p, ,) , ( , , q), or (p,p) of the pair g r a p h , no outgoing edge exists. A pair graph is not necessar- ily connected.

Definition 11 (input s p a n ) . Let M = (Q, E,5, q0, F ) be a deterministic finite automaton, and let rn be a component of the s tate transit ion graph of the automaton. A word x is an input span for state p in m iff 5(q, x) = p, for some q in m, such that ,

Page 7: A characterization of constant-time cellular automata computation

410 S. Kim and R. McCloskey / Constant-time CA

for every prefix w of IC, S(q, w) is in m. Note that p and q may be the same state.

Definition 12 (finite input memory) [13]. Let it4 = (Q, C, 6, qo, F) be a deterministic finite au- tomaton. Let m; be a component of the state tran- sition graph of M, and let Qi be the set of states in mi. Component m; has input memory of order k if X: is the minimum nonnegative integer such that no two states in Qi - {qd} have a common input span in rni of length L. Component rni has finite input memory iff it has input memory of or- der X: for some X: > 0. Let ml and m2 be two components of the state transition graph. Then ml and m2 have pairwise finite input memory iff there exists an integer X: such that no states p and q, respectively, in ml and m2 have a common in- put span of length greater than X: on ml and m2,

respectively. Notice that finiteness of input memory of a state

transition graph is independent of the assignment of accepting states. It is not difficult to show that if a component m of a state transition graph has infinite input memory, then m has two states p

and q which are not qd such that b(p, z) = p and 6(q, z) = q, for some z E C’ , and, for every prefix Z’ of Z, both b(p, z’) and 6(q, 2’) are in m. Let S be the set of states (other than qd) of a component m of a state transition graph. We can determine if component m has finite input, memory by con- structing the pair graph on S x S and testing if the graph is acyclic. If it is, then m has finite in- put memory, otherwise m does not. Specifically, if /S] = 1, then m has finite input memory of order zero. Otherwise, if the pair graph is acyclic, m has input memory of order T + 1, where T is the length of the longest path in the pair graph .

In ref. [14], we introduced the following charac- terization theorem for the class of locally testable deterministic finite automata and showed that, given a deterministic finite automaton, it is pos- sible to determine if it is locally testable in 0(n2) time, where n is the number of states of the au- tomaton.

Theorem 5. Let M = (Q, C,b,qo, F) be a re- duced deterministic finite automaton. The au- tomaton accepts a locally testable language iff the transition graph satisfies the following properties.

(i) Every SCC has finite input memory.

(ii) For every pair of SCCs m; and rnj such that mi is an ancestor of mj, either (a) they have pair- wise finite input memory, or, otherwise (b) for every pair of states p in mi and q in mj, and 2 E Cf such that 6(p,t) = p and b(q,z) = q,

6(p, w) = T is an ancestor of q iff 6(q, w) is in ??Zj,

for all w E C’.

Theorem 6. Let M be a deterministic finite au- tomaton which is reduced. M has finite input memory iff L(M) is LTSS.

Proof. Let M = (Q, C,b,qo,F) and let Qe = Q - {qd}. Suppose that the state transition graph has finite input memory of order k. If X: = 0, then I&s] 5 1. If I&e] = 0, we have L(M) = 0, which is 0-LTSS. If I&e] = 1, then L(M) = A* for some A C C. Thus L(M) = c~({c},A, {E}), which is LTSS. Suppose I&e] >_ 2. Assign each state in Qe by its input spans of length k, i.e., every state p E QO is assigned by words 2 E C’ satisfying either 1.~1 < 12 and 6(qo,x) = p, or 121 = k and 6(q, cc) = p for some q E Qo. Now, construct the sets Q = {XIX E E’, jz] <_ k and 6(qo,z) # qd}, p = {zalz E Ek,a E X:,x is assigned to some q E Q and 6(q,a) # qd}, and y = {zc(;c is as- signed to some q E F}. We leave it to the reader to show that L(M) is the (k + l)-LTSS language

~k+&%h).

Now, let L be the L-LTSS language tik,(cX,p, y). We construct a finite state automaton M’ =

(Q’,IZ,b’,qA,F’), where Q’ = {[w]]w.z E CX, for some 2 E C*} U {[w]iw E -y} U {[w]lwa E /3, for

some a E C> u {qd}, nl, = [cl, F’ = {[WI I w E ~1, and 6’ is defined as follows. For every pair of states

[%I, [w2] E Q’, 6’([wI,a) = b21 if tk(wla) = w2,

for some a E C. Finally, make all transitions as yet undefined go to the dead sink state qd. Notice that a state [w] E Q’ has input span w and no two states have a common input span of length L. M’

has finite input memory. We leave it to the reader to show that x E L iff M’ accepts x. 0

Since the complement of an LTSS language is LTES, we have the following corollary.

Corollary 2. Let M = (Q, TE, 6, q,-,, F) be a deter- ministic finite automaton. L(M) is LTES iff the complement ?i? = (Q, C, 6, qo, Q - F) of M has fi- nite input memory.

Page 8: A characterization of constant-time cellular automata computation

S. K im and R. McCloskey / Constant-t ime CA 411

Now, we investigate determinis t ic finite au tom- a t a which accept LTMS languages. Before we show the main theorem, we need the following lemmas.

L e m m a 7. Let M = (Q, E, ~f, q0, F ) be a deter- ministic finite a u t o m a t o n such tha t every SCC in the state t rans i t ion g raph of M has finite input memory. Let m be a componen t of the s tate t ran- sition graph and let S be the set of s tates in m. I f there exists p ~ S such tha t 6(p,x n) is in m, for some x ~ E + and n _> IS], and, for every prefix w of x '~, (~(p, w) is in m, then ~(q, x) = q, for some state q in m.

P r o o f . If 5(p, x" ) is in m and, for every prefix w of x ~, 5(p,w) is in m, it mus t be tha t 5(p,x i) = ~(p, xJ), for some 0 _< i < j _< n. Let 6(p,x i) = q. We claim tha t (~(q, x) = q. Suppose 6(q, x) = r # q. Then (~(r,x j - i ) = r and ~(q,x j - i ) = q. Clearly, q and r are in the same SCC, and, hence, the SCC has infinite input memory, a contradict ion. []

L e m m a 8. Let M = (Q, E, 5, qo, F ) be a reduced determinist ic au tomaton . Let p,q E Q - {qd} be a pair of dist inct s tates such tha t L(M,p) c L(M,q). Then, for all w E E*, if 5(p,w) = r ~(q, w) = s, then i ( i , r) C L(M, s).

P r o o f . Since M is a reduced au toma ton , L(M, r) # L(M, s). Suppose L(M, r) D L(M, s), and let z E L(M,r) - L(M,s). Then wz is in L(M,p) - L(M, q), a contradict ion. []

In the following lemmas we shall use extensively the nota t ion C~(xwy), first used in the p roof of theorem 4, to denote the sequence of cells of a CA which get w on an input xwy.

L e m m a 9. Let M = (Q, E, 6, qo, F ) be a reduced determinist ic finite a u t o m a t o n which accepts an LTMS language. Let M ' be an M C A which ac- cepts L(M) in k steps, for some k > 0. Let p ,q E Q - {qa} be such tha t 6(p, x) = p and ~(q, x) = q, for some x E E+, and L(M,p) C L(M,q). Then for any wt,w2, v C E* such tha t 5(qo, wl) -- p and 5(qo, w2) = q, M ' will have

(1) at least one cell in Cw2~(w2x2k+lv) enter- ing the accept ing state with no cells rejecting at the kth step, and

(2) all cells in C,,~(WlX2k+lv) entering a neu- tral s tate at the kth step.

P r o o f . Since L(M,p) C L(M, q), there exists u E ~* such tha t /f(p, u) is not in an accept ing state, while ~(q, u) is. M' accepts w2x2k+lu and does not accept wtx2k+lu. This implies tha t at the k th step M t will have at least one cell in Cw2~ (w2x 2k+lu) entering the accept ing state and no cells rejecting. Thus , par t (1) of the l emma is true. M' has no cells in Cwl~(WlX2k+lu) entering the accept ing s ta te at the k th step. Since p ¢: qa, there exists u ' E ~* such tha t ~(p,u') is in an accept ing state. M ' accepts WlX2k+lu ' and W2x2k+lu, and does not accept WlX2a+lu. For all v E E*, M ' must have all cells in C~1~ (wx 2~+1 v) entering a neutra l s tate at the k th step. Suppose not. I f M ' has a cell in C ~ ( w x 2 k + l v ) entering the rejecting state at the k th step, then wlx2k+lu' cannot be accepted. I f M ' has a cell in C~l~k(wx2k+lv) entering the accept ing state at the kth step with no rejecting state, then wlx2k+lu will be accepted. Pa r t (2) of the l emma is true. []

L e m m a 10. Let M = (Q, E, 6, qo, F ) be a reduced determinist ic a u t o m a t o n which has two dist inct s ta tes p,q E Q - {qa} such tha t ~(p,x) = p and 6(q,x) = q, for some x E E +. I f L(M) is LTMS, then either L(M,p) D L(M,q) or L(M,p) C L(M,q). In par t icular , if p is an ancestor of q, then i ( M , p ) C i (M,q) .

P r o o f . Suppose tha t nei ther p nor q is an ances- tor of the o ther and nei ther L(M,p) D L(M,q) nor L(M,p) C L(M,q). Let Wl,W2 ~ E* be such tha t 5(qo, wl) = p, ~(qo, w2) = q. Find y, z C ~* such tha t 5(p, y) is an accept ing state, while 5(q, y) is not, and 5(p, z) is not an accept ing s tate , while ~(q, z) is. Since M is reduced and nei- ther i ( M , p ) C i ( U , q ) nor L(M,p) D i (M,q ) , there exist such words y and z. Suppose L(M) is accepted by a k - M C A M t, for some k > 0. Since WlX2k+ty is accepted by M ' , no cells in C~v(wlx2k+ly) will enter the rejecting state in k steps. It follows tha t M ' rejects w2x2k+ty by having either all cells entering a neutral s tate or at least one cell in Cw:~(w2x2~+ty) entering the rejecting state at the k th step. We consider the following two cases.

Case (1). W h e n M ' rejects w2x2k+ly by hav- ing at least one cell in C~:~(w2x2k+ly) enter- ing the rejecting state. Since 5(q, z) is in an ac- cept ing state, w2x2k+lz is in L(M). However, M '

Page 9: A characterization of constant-time cellular automata computation

412 S. Kim and R. McCloskey / Constant-time CA

will reject ulzx 2k+1~ because at least one cell in c WZBl'(W2X 2k+1~) will enter the rejecting state in X: steps.

Case (2). When M’ rejects w~x~~+~Y by having all cells entering a neutral state at the kth step. M’ must accept w2x 2k+1 2 by having at least one cell in C,kz(~2x2k+1 t) entering in the accepting state in X: steps, with no cell in the rejecting state. Since M’ accepts w~x~~+~Y, no cell in Cwls~(~1x2k+1Y) will enter the rejecting state. It follows that M’ accepts w1 x 2k+1~ by having at least one cell in

Ca"z(WlX zk-tl~) entering the accepting state in X: steps. In either case we have L(M) # L(M’), a contradiction.

Now, suppose that p is an ancestor of q and it does not satisfy L(M,p) c L(M, q). Find w, y, z E C+ such that 6(qo, w) = p, S(p, y) = q, 6(p, 2) is an accepting state and b(q, z) is not. Sup- pose that L(M) is a L-LTMS language, for some l.z 2 0. Since M is reduced and q is not qd, there must be ‘1~ E C* such that 6(q,u) is an ac- cepting state. M’ accepts WX~~+~~X~~+~ZL, while Wx2k+lyx2k+l z is rejected, which implies that, for all v E C*, no cells in CWz2k +lya~(wx2k+1Yx2k+1~) enter the rejecting state in X: steps. We consider two cases depending on whether or not any cells in C’,,Z~-~~~~(UJX~~~~ yx2”+‘v) enter the accept- ing state in X: steps. Suppose that no cells in c ,,~E~~~~L(wx~~+‘Yx~~+~~~) are in the accepting state after the lath step. Then, since wx2k+1z is accepted, at least one cell in Cz~p(~x2k+1~) must enter the accepting state in X: steps with no other cells entering the rejecting state, which implies that Wx2k+lyx2k+1, must be accepted, a con- tradiction. Now, suppose that at least one cell in Cws2ki lyzk(wx 2k+1Yx2k+1 v) is in the accept- ing state after the Lth step with no other cells rejecting. Since WX~~+~Z is accepted by M’, no cells in Cz~z(~x2k+‘~) enter a rejecting state in X: steps, which implies that wx2k+1yx2k+1z must be accepted. Again we are in a contradiction. 0

Lemmall.LetM=(Q,C,5,qo,F)beareduced deterministic finite automaton which accepts an LTMS language, and let p, q t Q - {qd} be distinct states such that 6(p,x) = p and S(q,x) = q, for some 2 t C+, and L(M,p) c L(M, q). If there exist I’, s G Q - {qd} such that

(1) T is in the reachable component mQ* and s

is not, and (2) 6(~, y) = T and S(s, y) = s, for some Y E C+,

then L(M, T) > L(M, s).

Proof. Let M’ be an MCA which accepts L(M)

in k steps, for some 12 2 0. Find w’ E C* such that 6(qo, w’) = q. Since 6(p,x) = p and 6(q, x) = q and L(M,p) c L(M, q), by lemma 9 M’ will have at least one cell in CW,z~(~‘x2k+1) entering an ac- cepting state, with no cells rejecting, at the kth step. Let z E C” such that 6(q,z) = r. Then M’

has at least one cell in C,1,~~+l,y~(~‘x2k+1~y2k+1) entering the accepting state at the Lth step.

By lemma 10 either L(M,T) c L(M, s) or L(M, T) > L(M, s). Suppose L(M,r) c L(M, s). By lemma 9, for any w E C* such that 6(qo,w) =

T, M’ will have all cells in C,,~(wy~“+l) entering a neutral state at the kth step. Let w = w’xZk+%.. We showed above that M’ has at least one cell in c ,!,2L-lzyL (

I 2k+l w x ZY 2kf1) entering the accept-

ing state at the kth step. We are in a contradic- tion. q

Lemma 12. Let A4 = (Q, C, 6,qo, F) be a re- duced deterministic automaton which has two dis- tinct states p, q E Q - {qd} such that 6(p, x) = p,

6(q, x) = q, for some x E C+, and L(M,p) c

L(M,q). If L(M) is LTMS, then the reachable component. mg* has no pair of distinct states T, s E Q - {qd} such that S(T, y) = T and b(s, Y) = s, for someyEC+.

Proof. Suppose that mQ_ has such states r and s. Find WI, ~2,203, w4 E C* such that S(qo, ~1) = p,

b(qo,wz) = q, 6(q,w3) = T and 6(q,w4) = s. Now, suppose that L(M) is an LTMS language accepted by an MCA M’ in X: steps, for some 12 2 0. By Lemma 9 M’ will have at least one cell in C,,,.4 (T_u~x~~+~ ) entering the accepting state at the kth step. Since T # s, there must be IL E C* such that either S(T, U) is an accept- ing state and 6(s, u) is not, or vice versa. With- out loss of generality suppose 6(r, U) is an ac- cepting state and 6( s, U) is not. Consider words

w2x 2k+lW3y2k+l u in L(M) and w~x~~+‘w~Y~~+‘u

not in L(M). Clearly, M’ must reject w2x 2k+l w4

Y 2k+1 u by having at least one cell in C1k,,,qyk

(w2x 2k+lWqy2k+l IL) entering the rejecting state

at the Lth step, which implies that M’ rejects

w2x 2k+1~4y2k+1~, for all 2 E C*. However, since s is not the rejecting sink state, there must be

Page 10: A characterization of constant-time cellular automata computation

S. Kim and R. McCloskey / Constant-time CA 413

u ~ C ~* such t h a t 5 ( s , u ' ) is an accep t ing s ta te . Hence, w2x2k+lw4y~h+lu ' is in L(M). I t follows t ha t L(M) ~ L ( M ' ) , a con t rad ic t ion . []

L e m m a 13. Let M = ( Q , ~ , 6 , qo, F ) be a re- duced de t e rmin i s t i c finite a u t o m a t o n which ac- cep ts an LTMS language. Let M ~ be an M C A which accep t s L(M) in k s teps , for some k ~_ 0. Let p,q ~ Q - {qd} be d i s t i nc t s t a t es such t ha t ~ ( p , x ) = p and 6 (q ,x ) = q, for some x ~ Z ÷ . I f t he re exis t r, s ~ Q - {qd} such t ha t

(1) r is in the reachab le c o m p o n e n t mq. and s is not , and

(2) ~ ( r , y ) = r and 6 ( s , y ) = s, for some y ~ Z+ , then , for every z ~ Z* such t h a t 5(q, z) = r , e i the r ~(p, ~ y ~ + ~ ) -- s or ~(p, zy ~ ÷ 1 ) = r

P r o o f . Let M * be an M C A which accepts L(M) in k s teps. F i n d w~,we, w3 ~ ~* such t ha t 6(qo,w~) = p, 6(qo, w2) = q, and ~(q0, w3) = s. For any z ~* such t ha t 6(q, z) = r , let s' = 5(p, zy ~+~) and suppose ne i the r s ~ = s nor s ~ = r . By l e m m a 10 e i ther L(M,p) D L(M,q) or L(M,p) C n(M,q).

Case (1). W h e n L(M,p) C L(M,q). By l e m m a 11 L(M, r) D L(M, s). By l e m m a 9 M ' will have all cell in C ~(w3y2h÷t~ en te r ing a neu t r a l s t a t e a t W 3 y \ /

the k th s tep. Hence, for all v ~ ~*, M ~ will e i ther accept or re ject w3y2~+tv d e p e n d i n g on the s t a t e s of the cells in C~(w~y2~+~v) at the k th s tep. We cons ider the fol lowing two cases.

Case (1.1). W h e n there exis ts u ~ ~* such t ha t ~(qo,w~x2h+lzy2~+lu) does not en ter an accept - ing s t a t e and 6(qo,w2x~+lzy2~+~u) does. Since 6(p, x) = p, ~(q, x) = q and L(M,p) C L(M, q), by l e m m a 9 M ' will have all cells in C~,~(WlZ2~+~v) en te r ing a neu t r a l s t a t e a t the k th s tep, for all v

(wxx 2~+1 -y2h+lu) en te r ~*. Also all cells in C ~ a ne u t r a l s t a t e a t the k th s tep. I t follows t h a t , for all v ~ ]E*, M ' accep t s Wlx2k+lzy2k+lv iff the re

exis ts a t least one cell in C~(wtx2~+~zy2a+~v) ente r ing the accep t ing s t a t e a t the k th s tep wi th no cells re jec t ing . Recal l t h a t , for all v ~ Z*, M ~ accep t s w3y2k+lv iff there exis ts a t least one cell in Cy~v(w3y2k+ly) ente r ing the accep t ing s t a t e a t the k th s tep wi th no cells re ject ing. I t follows t h a t , for all v ~ Z* and z ~ ~* such t ha t ~ (q ,z ) = r , WlX~+~zy~+lv is in L(M) iffw~ye~+lv is, which impl ies t ha t s ~ and s are equiva len t s ta tes . Since M is a r educed a u t o m a t o n , we have s = s ~.

Case (1.2). W h e n the re is no u E ~* such t h a t ~(qO, WtX2k+lzy2k+lu) does not en te r an accep t - ing s t a t e and ~(qo, wtx2k+lzy2~+lu) does. Since

L(M,p) C L(M,q), this case impl ies t ha t for all u E ~*, wlx 2k+1 zy2k+lu is in L(M) iff W2X2k+lzy2h+tu is. I t follows t h a t s t and r a re

equivalent . Since M is a r educed a u t o m a t o n , we have s r = r .

Case (2). W h e n L(M,p) D L(M,q). By l e m m a 9 M' will have at leas t one cell in Cw~k(WlX 2k+l) en te r ing the accep t ing s t a t e a t the k th s tep wi th no cells re jec t ing . Suppose s ' # r. By l e m m a 8 we have L(M,s') D L(M,r). F i n d u E Z* such t h a t 6(s', u) ente rs an accep t ing s t a t e and ~(r, u) does not. Then wtx2k+lzy2k+lu is in L(M) and w2x2k+lzy2a+lu is not. I t follows t ha t M ' will have all ceils in C~k ~y~ (WlX 2k+1 zy2k+lv) en te r ing a ne u t r a l s t a t e a t the k th s tep, for all v E ~*. I t follows tha t , for all v c ~*, WlX2k+lzy2k+lv is in L(M) i f f M ' has no cells in C~,(wtx2k+lzy2k+lv) en te r ing the re jec t ing s t a t e a t the k th s tep. Since r 7 £ qd, i t mus t be s' ~ qd. By l e m m a 10 e i ther L(M, s) ~ L(M, r) or L(M, s) C L(M,r).

Case (2.1). W h e n L(M, s) D L(M, r). By l e m m a 9 M ' will have at leas t one cell in Cw~y~(way 2k+1) en te r ing the accep t ing s t a t e wi th no ceils re ject- ing. I t follows t h a t , for all v 5 E*, w3y2k+lv is in L(M) iff M ~ has no cells in Cykv(w3y2k+tv) en te r ing the re jec t ing s t a t e a t the k th s tep. We know tha t WlX~h+lzy~k+lv is in L(M) iff M ' has no cells in Cy~,(WlX2k+lzy2k+lv) ente r ing the re-

j ec t i ng s t a t e a t the k th s tep. Hence, for all v C ~*, wlx2k+lzy2k+lv is in L(M) iff w3y2k+lv is in L(M). I t follows t h a t s and s ' a re equivalent . Since M is a reduced a u t o m a t o n , we have s = s ' .

Case (2.2). W h e n L(M, s) C L(M, r). B y the same a r g u m e n t for case (2.1), we can show t h a t , for all v C Z*, no cells in Cy~v(W2X2k+lzy2k÷lv) en te r

the re jec t ing s t a t e a t the k th s tep. I t follows t h a t , for all v C ~*, w2x2~+lzy2k+lv is in L(M) iff

wtx2k+lzy2k+lv is in L(M), which impl ies s ' = r . []

Now, we presen t the ma in theo rem.

T h e o r e m 7. Let M = (Q,~,5, qo, F) be a re- duced finite de t e rmin i s t i c a u t o m a t o n . L(M) is LTMS iff M sat isf ies the fol lowing condi t ions .

(1) M is loca l ly t e s tab le .

Page 11: A characterization of constant-time cellular automata computation

414 S. Kim and R. McCloskey / Constant-time CA

(2) Let p, q E Q - {qd} any distinct states such that 6(p, z) = p and 6(q, z) = q, for some z E C+.

(a) Either L(M,p) > L(M,q) or L(M,p) c L(M, q) if neither p nor q is an ancestor of the other. L(M,p) c L(M, q) if p is an ancestor of q.

(b) Suppose L(M,p) c L(M, q). If there exist r, s E Q - {qd} such that r is in the reachable component m4* and s is not, and 6(r, y) = r and 6(s,y) = s, for some y E E+, then L(M, r) >

L(M, s). (c) If L(M,p) c L(M, q), then the reachable

component mp* has no pair of distinct states r, s E Q - {qd} such that 6(r, y) = r and 6(s, y) = s, for someyEE+.

(d) If there exist a pair of distinct states r, s E Q - {qd} such that r is in the reachable component m4* and s is not, and 6(r,y) = r and 6(s,y) = s, for some y E C+, then, for every z E C’ such that 6(q, .z) = r, either 6(p, zy”) = s or b(p, zy”) = r, for some constant n > 0.

Proof (of necessity). By ref. [9], the class of locally testable languages is the Boolean closure of the class of LTSS languages. Thus by lemmas 1 and 3, every LTMS language is locally testable. Hence, part (1) holds. Parts (2a), (2b) and (2~) follow from lemmas 10, 11 and 12, respectively. Let M’ be an MCA which accepts L(M) in k steps, for some k 2 0, and let n = 2k + 1. Then by lemma 13, part (2d) is true.

For the proof of sufficiency of the theorem, we will show that if M satisfies all the conditions of the theorem, then we can effectively construct an LTES automaton MI and an LTSS automa- ton M2 such that L(M) = L(M1) n L(Mz). By lemma 3, L(M) is LTMS. Before we show an al- gorithm which constructs Ml and Mz and prove that L(M) = L(M,) n L(Mz), we introduce the following lemmas.

and r cannot appear on a single path of the state transition graph. Let p, q, q and r, respectively, be the states p, q, r and s of condition (2d) of the theorem. Then either q or r must be a de- scendant of p by condition (2d). Suppose r is a descendant of p. Then by condition (2a) of the theorem we have L( M, p) c L( M, r). By condition (2a) of the theorem, either L(M,p) I L(M, q) or

L(M, PI C L(M, q). If L(M, P) 3 L(M,q), then

the reachable component rnr* has two states p and r such that 6(p,z) = p and S(r, z) = r, which violates condition (2~) of the theorem. Sup- pose L(M,p) c L(M, q). Let q, r, r and p be, respectively, the states p, q, r and s of lemma 13. Then either p or r must be a descendant of q. If p is a descendant of q, then we cannot have L(M,p) C L( M, q) by condition (2a) of the theo- rem. If r is a descendant of q, then it violates the condition (2~) of the theorem. 0

Definition 13 (product graph ). Let G be a state transition graph of a deterministic automa- ton M = (Q, C,b,qo,F), and let p,q E Q be a pair of distinct states. The product graph with respect to the ordered pair (p,q), is a state tran- sition graph G,,, = (Q’, X,6’, F’), where Q’ =

{[r, sllr, s E Q, r # s,~(P, u) = r and 6(q, .w) = 5,

for some w E E*} u {qe}, F’ = {[r, s]([r, s] E Q’, r E F} U {qe}, and 6’ is de fined as follows: For gh6ei,lr Q’ and a E C, let 6(r, a) = t, 6(s, a) = t’.

(a) 6’([r,s],a) = [t,t’], if t # t', (b) S’([r, ~],a) = qer if t = t’.

Notice that the product graph has no start state, which is the only difference from the state transi- tion graph of an automaton.

Lemma 14. Let M = (Q, C, 6, qo, F) be a deter- ministic automaton which is reduced. If M satis- fies all the conditions of theorem 7, then it does not have distinct states p, q, r E Q - {qd} such that 6(p,z) = p, 6(q,z) = q and 6(r,z) = r, for some z E c+.

Lemma 15. Let M = (Q, C, 6, qo, F) be a reduced deterministic automaton which satisfies the con- ditions of theorem 7. Let p, q E Q - {qd} be any pair of distinct states such that 6(p, x) = p and b(q,z) = q, for some z E C+. Then the product

graph GPX4 = (Q’, C, 8,F’) has no pair of states

[pi, 411, [pa al c Q’ such that h’([pl,ql],z) =

$,a1 and b’([n, q21, z) = b2,m,l, for any 2 E

Proof. Suppose M has such states p, q, and r. Proof. By condition (2a) of theorem 7, either No two states of p, q and r can be in the same L(M,P) c L(M,q) or L(M,p) > L(M,q). With- SCC. Otherwise, it violates condition (1) of the out loss of generality suppose that L(M, p) c theorem. By condition (2~) of the theorem, p, q L(M,q). Since [PI, 411 # [~2,q21, either PI # PZ or

Page 12: A characterization of constant-time cellular automata computation

S. Kim and R. McCloskey / Constant-time CA 415

ql # q2. Notice tha t by the definition of the prod- uct graph, Pl and P2 are descendants of p, and ql and q2 are descendant of q. Since L ( M , p ) C L ( M , q ) , neither ql nor q2 is qd- Otherwise, ei- ther Pl = qd or P2 = qd, implying tha t either [Pl,ql] = [qd, qd] or [Pz,q2] = [qd, qd]. Either [Pl, ql] or [P2, q2] should have been defined as qe by the definition of the p roduc t graph . I f ql ~ q2, then q has two dist inct descendant states ql and q2 such tha t 5(ql, x) = ql and b(q2, x) = q2, which violates condi t ion (2c) of theorem 7.

Suppose ql = q2 and Pl ~ p2. If bo th Pl and P2 are not qd, then we have three s tates Pl, ql and P2 such tha t 6 ( p l , x ) = Pl, 6 (q l ,x ) = ql and 6(p2 ,x ) = P2, which violates l emma 14. Ei ther Pl or P2 is qd and the o ther is not qd. W i t h o u t loss of generali ty suppose pl - qd and P2 5 £ qd, State P2 is not a descendant of q. Otherwise, q and P2 belong to the reaching componen t mq. , which violates condi t ion (2c) of theorem 7. Find w l , w 2 E Z* such tha t 6 ' ([p ,q] ,wl ) = [Pl,ql] and g'([p,q],w2) = [P2,q21. Let p, q, ql and P2 be, re- spectively, the s tates p, q, r and s of condit ion (2c) of theorem 7. We have ~(q, w l x '~) = ~(q, w2x '~) = ql = q2, for all n > 0, while ~(p, w l x '~) = Pl = qe and ~i(p, w2x n) = P2- It violates the condit ion. []

Now, for an a u t o m a t o n M which satisfies all the condit ions of the theorem, let M1 and M2 be the a u t o m a t a cons t ruc ted by a lgor i thms 1 and 2 in figs. 3 and 4, respectively. Lemmas 16, 17 and 18 below show t h a t M1 is LTES, M2 is LTSS and L ( M ) = L ( M 1 ) fl L(M2).

L e m m a 16. Let M = (Q, ]E, 6, qo, F ) be a reduced determinist ic a u t o m a t o n which satisfies the condi- t ions of theorem 7. The a u t o m a t o n M1 which is cons t ruc ted from M by a lgor i thm 1 of fig. 3 is LTES.

P r o o f . Let M1 = (Q1, E, 61, q01, F1)" We assume tha t the states in Q1 have the same labels assigned by the a lgor i thm, i.e., Q1 = Q11uQ12u{q¢} , where Ql l c_ Q and Q12 c_ Q × Q. Notice tha t the s tates in Q12 are f rom produc t graphs cons t ruc ted by the a lgor i thm. For the convenience of identification, we will use indexed state labels, like [Pi, qi], for a s tate in Q12.

By corol lary 2 M1 is LTES if its complement is LTSS. Notice tha t by the cons t ruc t ion M1 has no qd. Hence, to prove M1 is LTES, it is enough

to show tha t M1 has no two nonsink states which have identical loop transit ions. We will show tha t there exists no x E ~+ and a pair of dist inct s ta tes from among r , s ~ Q l l and [pl,ql],[p~,q2] c Q12 satisfying any of the following conditions.

(a) 51(r, x) - r and 51(8, X) ~-- 8. (b) (~a(r,x) = r and ~l([p i ,q l] ,X) = [Pl,qi]- (c) 61([pl, ql], x) = [Pl, ql] and 51([P2, q2], x) =

Suppose M1 has two distinct s tates r and s which satisfy (a). They belong to an SCC. By condi t ion (1) of theorem 7, they cannot be in the same SCC. Let mi and m j be the SCCs which has r and s, respectively. Then step (4) of a lgor i thm 1 must have deleted r and s when it deletes the reach- able components mi . and m j . . Hence, M1 cannot have such states r and s. Suppose M1 has r and [Pl, ql] which satisfy (b) above. Since [Pl, ql] is fi'om a produc t graph, it must be Pl # ql, r # Pl and r # ql. We have (5(r,x) = r, 6 ( p l , x ) = Pl and 5(ql, x) = ql, which contradic ts l emma 14. Fi- nally, suppose M1 has [Pl, ql], [P2, q2] E Q12 which satisfy ( c ) a b o v e . Since [pl,ql] 3 £ [P2,q21, either Pl # P2 or ql # q2. Since both [Pl,ql] and [P2,q2] are from a p roduc t graph, it mus t be Pl # ql and P2 ¢ q2- We claim tha t either pl # q2 or ql # P2. Suppose not, i.e., Pl = q2 and ql = P2. Then we have [Pl,ql] = [Pl,P2] and [P2,q2] = [P2 ,P l ] -By L e m m a 8 L ( M , p l ) C L ( M , p2) because [Pl,P2] is a state from a p roduc t graph, say Gpxq , such tha t L ( M , p ) C L ( M , q ) and pl = (~(p,w) and p2 = ~i(q,w), for some w ~ E*. By the same ar- gument , we have L ( M , p2) C L ( M , pt) . This is a contradict ion.

We have tha t either pl # P2 or ql ¢ q2, and tha t either Pl 7 £ q2 or ql ¢: P2. Combining these, there are four possible cases to be considered. In each case, there are at least three dist inct s tates from among pi , p2, ql, and q2- We know tha t ~(pl, x) - Pl, 6(p2, x) = p2, 5(ql, x) = ql, and (~(q2, X) = q2" This violates l e m m a 14. [~

L e m m a 17. Let M = (Q, Z, ~i, q0, F ) be a reduced determinist ic a u t o m a t o n which satisfies the condi- t ions of theorenl 7. The a u t o m a t o n 2ti2 which is cons t ruc ted from M by a lgor i thm 2 of fig. 3 is LTSS.

P r o o L Let M2 = (Q2, Z, 52,q02, F2). Notice tha t going top-down a lgor i thm I finds an SCC mi

Page 13: A characterization of constant-time cellular automata computation

416 S. Kim and R. McCloskey / Constant-time CA

Procedure Construct-LTES;

j/G is the state transition graph of M.// G’ := G;

Repeat

Going top down on G, for each SCC m, which has no mark and has pairwise infinite input memory with respect to an SCC m, do

if L(M,p) C L( M, q), for a pair of states p and q, resp ectively, in m, and m,,

such that 6(p, I) = p and 6(q, z) = q, for some z E X+, then begin

(1) Identify the reachable components m;, and m,.;

Let Q.* and Q,* be the sets of states, respectively, in m,, and m,*; (2) Construct the sets of edges:

si=((r,a,S)laEC,r~Q-(Q,,UQ,*),sEQ,*-Qj*,6(r,a)=s}. S, = {(~,a,s)la E C,r E Q - (Qt. uQI.),s E Q,.,b(~,a) = s}.

(3) Construct the product graph GpXq;

(4) Mark m,, and mJ. in G and delete m,, and m,. from G’; (5) Attach-and-merge the product graph GpXs to G’ as follows:

(//Sij will be used in algorithm 2.//)

s ‘, := 0 ; For each edge (T, a, s) in S, do begin

Find a node [s, t] in GPXq, for some t E Q1.; Put edge (T, a, [s, t]) on G’;

Si, := S,, u(r,a,[s,t]); end;

Merge all states in G’ which have the same label into a single state; (6) For each edge (T, a, s) E S,, put edge (T, a, qe) on G’;

end

until (there is no SCC in G which has no mark and has infinite input memory with respect to some other SCC)

Change qd in G’, if any, into qe;

Let qo or [qo,p], for some p E Q, whichever exists in G’, be the start state; Let Ml be the automaton having G’ as the state transition graph;

Fig. 3. Algorithm 1 (constructing LTES Ml).

Procedure Construct-LTSS;

j/G is the state transition graph of M./j G’ := G;

for each set S,, constructed by step (5) of algorithm 1 do

begin

Delete m,. - m,. from G’; for each edge (r,a, [s,t]) in S,, , put edge (~,a, t) on G’;

end;

If [qo,p] is the start state of Ml, for some p E Q, then

let p be the start state of G’ else let qo be the start state of G’; Let A42 be the automaton having G’ as the state transition graph;

Fig. 4. Algorithm 2 (constructing LTSS A42).

Page 14: A characterization of constant-time cellular automata computation

S. Kim and R. McCloskey / Constant=time CA 417

which has pairwise infinite input memory with re- spect to an SCC mj such that L(M,p) c L (M,q) , for a pair of states p and q in ml and mj , re- spectively. Construct ing M2, algori thm 2 deletes mi. - m j . from G' and diverts all the edges coming into mi. - mj . (i.e. Sij) onto m j . . Let Q2 = Q21 tJ Q22, where Q21 is the set of s tates which do not belong to any such reachable com- ponent my. and Q22 = Q2 - Q21.

Now, suppose that M2 is not LTSS by having two distinct s tates r,s E Q2 - {qd} such that 62(r,y) = r and 62(s,y) = s, for some y c ~+. Both r and s cannot be in Q21. Otherwise, by con- dition (2a) of theorem 7 either L(M, r) D L(M, s) or L(M, r) C L(M, s), and algori thm 2 must have deleted either s or r when it deleted mi. - rnj.. Suppose r is in Q21 and s is in Q22- By condi- tion (2c) of theorem 7 L ( M , r ) C L (M, s ) . The algorithm must have deleted r constructing M2. Finally, suppose r and s are in Q22. By condi- tion (2c) of theorem 7, r and s cannot belong to the same reachable component mj . described above. Suppose r is in mj . and s is in the reach- able component rnk. from an SCC mk which has pairwise infinite input memory with respect to an SCC ml such that L(M, t) c L(M, t ' ) , for a pair of states t and t ' in mt and ink, respectively. By condition (2c), we have L(M, r) D L ( M , s ) and L(M, r) c L(M, s), which implies r = s, a contra- diction. []

L e m m a 18. Let M = (Q, Z, 6, q0, F ) be a deter- ministic finite s tate au tomaton which satisfies the conditions of theorem 7. Let M1 and M2 be the au toma ta which are constructed by algorithms 1 and 2, respectively. Then L ( M ) = L(M1)AL(M2).

P r o o f . Let M1 = (QI ,~ ,5 I ,q l ,F1 ) and M2 = (Q2,~,52,q2,F2). For the proof we need the fol- lowing observations:

(a) Q: c_ Q and Q1 = QII u Q~2 ~ {qe}, where Q ~ c_ Q and Q~e c_ Q x Q. Notice that M~ does not have qd.

(b) If [qo,P] is the s tar t s ta te of M1, then p is the start s ta te of/1//2. Otherwise, qo is the s tar t s tate of both M1 and /142.

(c) For all p,q ~ Qli and a ~ Z, if6~(p,a) = q in M~, then 52(p,a) = q in M2.

(d) If M1 has dil(p,a ) = qe, for some p ~ Ql1 and a ~ E, then M and M2 have ~i(p,a) = q and

~2(P, a) = q, respectively, for some q E Q. (e) For any r , s , t c Q and a c Z, if M1 has

6l(r,a) = [s,t], then /1//2 has 62(r,a) = t. (f) If M1 has ~l( [q , r ] ,a) = [s,t], then M2 has

~2(r, a) = t. (g) If M1 has ~l([r,s],a) = qe, then M has

~(r,a) = ~(s,a) = t, for some t ~ Q, and M2 has 62(s,a) = t.

Observation (a) is obvious because M2 has no product graph attached, and M1 may have compo- nents from both M and a product graph at tached by step (5) of algorithm 1. I f the start s tate q0 of M is in an SCC mi which has pairwise infi- nite input memory with respect to an SCC rrtj, then algorithms 1 and 2 define [q0,P] and p to be the start states of M1 and M2, respectively, for some p c Q. Otherwise, q0 will be the start s tate of the automata . Hence, part (b) of the observa- tion is true. Since the algorithms do nothing with the states which are not involved with the prod- uct graphs constructed by step (5) of algorithms 1, such states and the transitions between them will appear in both M1 and M2. Hence, observation (c) holds. Algori thm 1, by step (5), at taches the product graph Gp×q by adding an edge (r, a, [s, t]), for each edge (r, a, s) in Si. Notice that Si is the set of edges which link a state in Q - ( Q i . t 2 Q j . ) to a state Qi. - Q j . , and Sj is the set of edges which link a state Q - (Qi. t2Qj.) to a state in Qj. . Step (6) of algorithm 1, constructing M1, puts edge (r,a, qe), for every edge (r ,a ,s) E Sj, and qd, if any, is changed to qe- Clearly, constructing M2 the algorithms do nothing with the edges in Sj. All the transit ions corresponding to the edges in Sj still exist in M2. Hence, part (d) of the observations follows. Observation (e) follows from steps (5) of algori thm 1 and step (2) of algori thms 2. Obvi- ously, if M 1 has (~1 ([q, r], a) = [s, t], then the tran- sition is from a product graph constructed by step (5) of algorithm 1, which implies that 62(r, a) = t in M2. Hence, observation (f) follows. Finally, for part (g) of the observations, notice that [r, s] is a state from a product graph. By definition 13, [r,s] takes transit ion to qe on an input a E Z if ~(r, a) = ~(s , a).

Now, we show that L(M) = L(M1) ~ L(M2). Construct M ' = (Q1 × Q2, E,/~', [ql, q2], F ' ) such that , for [p,q] E Q1 × Q2 and a ~ F~, ~'([p, qJ, a) =

Page 15: A characterization of constant-time cellular automata computation

418 S. Kim and R. McCloskey / Constant-tzme CA

[~l(P,~L~2(c7,~)1, and F’ = {[T, S]\T E Fl and s E F2). We prove by induction t,hat, for all 2 E c*, ;c c L(M’) iff z E L(M). For convenience we assume that Ml and M2 have the state labels t,hat, were assigned when they were constructed from M by algorithms 1 and 2, respectively. Re- call that by definition 13 a node [r, s] of a product graph is an accepting st.ate iff r is an accepting state in M. Notice that every state [T, s] t Q12 is derived from a product graph G,, p with some

P, 4 E Q - {a} such that 6(p, z) = P, a(s, x) = q, for some z E E+, and L(M,p) c L(M, q). Hence, b(p,uj) = r and 6(q, UJ) = s, for some w E C*, and by lemma 10 L(M, T) c L(M, s). If T is an accepting state, then so is s. Hence the start state of M’, which is either [qo,qo] or [[qo,p],p], is an accepting st.ate iff qo is. It follows that M’ accepts the null string E iff M accepts. Suppose that, for all words w of length less than n, M accepts w iff M’ does. Let 6(qo, w) = p in M. Then, with input w, M’ will enter one of the following states: [p,p],

[qer ~1, [[P, ~1, ~1, for some T E Q. Now, suppose that, for a E C, M takes transi-

tion 6(p,a) = q. M’ will take one of the following transitions, for some T, s E Q.

(a) R’(b,~l,a) = kb41. (b) ~‘([P,PI,~) = he,ql. Cc) 6’(k%Pl,a) = [[Q,rl,~l. Cd) 6’(b, ~1, ~],a) = [[a 81, ~1. (e) ~‘(ke7d,a) = h,ql. (f) 6’(NP> Tl, Tl? a) = [4e,41.

Transitions (a), (b), (c), (d) and (f) follow from the observations (3), (4), (5), (6) and (7), respec- tively. Transition (e) is a consequence of transition (b) or (f). Clearly, q is an accepting state iff [q, q],

[qe, 41, [[q, ~1, ~1 and [[q, 31, s] are. 0

Now, we are ready t,o prove the sufficiency of theorem 7.

Proof (of sufficiency). Lemmas 16, 17 and 18

show that if M satisfies all the conditions of the theorem, t,hen we can const.ruct an LTES automa- ton Ml and an LTSS automaton Mz such that L(M) = L(Ml) n L(M2). 0

5. Conclusion

We have identified three subclasses of finite state automata that characterize the constant- time CA languages introduced in this paper. If we change the definition of a CA so that its cells can have a transition from the rejecting state to a non- rejecting state as in ref. [8], then, under this new definition, the ACA and MCA languages would be closed under union. But still the ACA languages would not be closed under complementation, and the MCA languages would not be closed under in- tersection or complementation. The class of locally testable languages is the Boolean closure of each of the LTSS, LTES, and LTMS classes of languages [9]. Interesting questions concerning the constant- time CA languages are:

(1) Given a deterministic finite automaton M,

is it possible to decide whether L(M) is LTMS in polynomial time?

(2) Is there any natural CA model that accepts locally testable languages in constant time?

We believe that (1) can be answered affirma- tively by using an algorithm similar to that found in ref. [14]. For (2), it seems to be impossible unless we are allowed to take a complementary interpre- tation on an outcome of a CA computation.

Acknowledgements

The authors are grateful to Professor Robert McNaughton for his many valuable comments and suggestions.

References

[1] A.R. Smith, Real-time language recognition by one-

dimensional cellular automata, J. Computer System

Sci. 6 (1972) 23-253.

[2] A. Rosenfeld, Picture Languages (Academic Press,

New York, 1979).

[3] M.J.B. Duff and T.J. Fountain, Cellular Logic Image

Processing (Academic Press, New York, 1986).

[4] S. Wolfram, Theory and Applications of Cellular Au-

tomata (World Scientific, Singapore, 1986).

[5] J. Demongeot, E. Goles and M. Tchuente, Dynami-

cal Systems and Cellular Automata (Academic Press,

New York, 1985).

Page 16: A characterization of constant-time cellular automata computation

S. K im and R. McCloskey / Constant-t ime CA 419

[6] M.G. Nordahl, Formal languages and finite cellular automata, Complex Systems 3 (1989) 63-78.

[7] O.H. Ibarra and S.M. Kim, Fast parallel language recognition by cellular automata, Theor. Computer Sci. 41 (1985) 231-246.

[8] R. Sommerhalder and S.C. Westrhenen, Parallel lan- guage recognition in constant time by cellular au- tomata, Acta Informatica 19 (1983) 397-407.

[9] R. McNaughton and S. Papert, Counter-free Au- tomata (MIT Press, Cambridge, MA, 1971).

[10] J. Brzozowski and I. Simon, Characterizations of lo- cally testable events, Discrete Math. 4 (1973) 243- 271.

[11] O.H. Ibarra, S.M. Kim and M. Palis, Some results concerning linear iterative (systolic) arrays, J. Parallel Distributed Computing 2 (1985) 182-218.

[12] J.E. Hopcroft and J.D. Ullman, Introduction to Automata Theory, Languages, and Computation (Addison-Wesley, Reading, MA, 1979).

[13] R. Martin, Studies in Feedback-Shift-Register Synthe- sis of Sequential Machines (MIT Press, Reading, MA, 1968).

[14] S.M. Kim, R. McNaughton and R. McCloskey, A polynomial time algorithm for the local testability problem of deterministic finite automata, Lect. Notes Computer Sci. 382 (1989) 420-436.