INFORMATION
SCIENCES
3519-90
79
(1985)
A Space-Hierarchy Result on Two-Dimensional Alternating Turing Machines with Only Universal States KATSUSHI INOUE AKIRA IT0 ITSUO TAKANAMI and HIROSHI
TANIGUCHI
Department
of Electronics,
Communicated
Faculty of Engineering.
Yamaguchi
University,
Ube, 755, Japan
by Azriel Rosenfeld
ABSTRACT
This paper space-bounded input tapes are classes of sets log m.
1.
investigates a space hierarchy of the classes of sets accepted by alternating two-dimensional Turing machines which have only universal states, and whose restricted to square ones, and shows that there exists a dense hierarchy for the accepted by these Turing machines with spaces of size less than or equal to
INTRODUCTION
It has been shown [l-5] that there exists a hierarchy of the classes of languages accepted by deterministic or nondeterministic one-dimensional space-bounded Turing machines for ranges above loglog n. It is well known [1,3] that the deterministic or nondeterministic one-dimensional Turing machines with space below loglog n accept only regular sets. On the other hand, for the two-dimensional case, as shown in [6], there exists an infinite hierarchy of the classes accepted by deterministic space-bounded Turing machines, even below loglog n. This paper investigates a space hierarchy of the classes of sets accepted by alternating space-bounded two-dimensional Turing machines which have only universal states, and whose input tapes are restricted to square ones, and shows that there exists a dense hierarchy for the classes of sets accepted by these Turing machines with spaces of size less than or equal to log m. c.Elaevier Science Publishing Co., Inc. 1985 52 Vanderbilt Ave.. New York, NY 10017
0020-0255/85/$03.30
KATSUSHI INOUE ET AL.
80
2.
PRELIMINARIES
DEFINITION 2.1. Let Z be a finite set of symbols. A two-dimensional fupe over Z is a two-dimensional rectangular array of elements of Z. The set of all two-dimensional tapes over Z is denoted by XC2).Given a tape x E Z(‘), we let f,(x) be the number of rows of x and 12(x) be the number of columns of x. If l
only when 1 d i Q i’ G I,(x) and 1 Q j < j’ < I,(x), z satisfying the following: (i) ll(z)=i’-i+l (ii) foreach k,r
and l,(z)=j’-j+l; [l
as the two-dimensional tape
z(k,r)-x(k+i-l,r+j-
1). We now recall the definition of a two-dimensional alternating Turing machine introduced in [9]. DEFINITION 2.2. A two-dimensional alternating Turing machine (ZATM) is a
septuple
where (1) (2) (3) (4) (5) (6)
Q is a finite set of states, qO E Q is the initial state, U G Q is the set of universal states, FE Q is the set of accepting states, Z is a finite input alphabet (# 4 Z is the boundary symbol), r is a finite storage-tape alphabet (B E r is the blank symbol),
(7) 6 C tQ X (2 {left,right,up,down,nomove}
U {#))X
r)X
X {left,right,nomove})
(Q
X (r
-
tBl)X
is the next-move relation.
A state q in Q - U is said to be existential. As shown in Figure 1, the machine A4 has a read-only (rectangular) input tape with boundary symbols #, and one semiinfinite storage tape, initially blank. Of course, M has a finite control, an input head, and a storage tape head. A position is assigned to each cell of the read-only input tape and to each cell of the storage tape, as shown in Figure 1. A step of M consists of reading one symbol from each tape, writing a symbol on the storage tape, moving the input and storage heads in specified
TWO-DIMENSIONAL
ALTERNATING
Position (0,O)
(0,l)
TURING
MACHINES
81
(0. n + 1)
(1,l)
I
Read-only input tape
I
Finite control Position 1
Posilon 2 Fig. 1. Two-dimensional
Storage tape
alternating Turing machine. m and n are arbitrary positive integers.
directions, and entering a new state, in accordance with the next move relation 6. Note that the machine cannot write the blank symbol. If the input head falls off the input tape, or if the storage head falls off the storage tape (by moving left), then the machine M can make no further move. DEFINITION 2.3. A configurationof a 2-ATM M = (Q, q,,, U, F, Z, r, 6) is an
element of
~(2~x(Nu{O})2 x&f, where S, = Q x(r - {B})* x N, and N denotes the set of all positive integers. The first component of a configuration’ c = (x,(i, j),(q, u, k)) represents the input to M. The second component (i, j) of c represents the input head position. The third component (q, a, k) of c represents the state of the finite control, nonblank contents of the storage tape, and the storage-head position. ‘We note that 0 Q i ,(x)+1, 0 ( j (/,(x)+1, and 1 d k < lol(+l, wherefor any string W, IwJdenotes the length of w (with IAl= 0, whereh is the null string).
82
KATSUSHI
INOUE ET AL.
An element of S, is called a storage state of M. If q is the state associated with configuration c, then c is said to be universal (existential, accepting) configuration if q is a universal (existential, accepting) state. The initial configuration of M on input x is
A configuration computation.
represents an instantaneous
description
of M at some point in a
DEFINITION2.4. Given M = (Q, q,,, U, F, Z, r, S), we write c I- c’ M
and say c’ is a successor of c if configuration one step of M, according to the transition necessarily denoted
c’ follows from configuration c in rules 6. The relation F is not M single valued, since S is not. The reflexive transitive closure of I- is M
; . A computation path of M on x is a sequence M cg IM
where co = IM(x). with the properties
Cl
IM
* . . t- c, M
(n>O),
A computation tree of M is a finite, nonempty
labeled tree
(1) each node n of the tree is labeled with a configuration Z(a), (2) if n is an internal node (a nonleaf) of the tree, I(r) is universal
and
(cll(n) p) = {C1,...,Ck), then R has exactly k children pi,. . . , pk such that 1( pi) = c,, (3) if B is an internal node of the tree and I(s) is existential, exactly one child p such that
then s has
An accepting computation tree of M on an input x is a computation tree whose root is labeled with IM( x) and whose leaves are all labeled with accepting configurations. We say that M accepts x if there is an accepting
TWO-DIMENSIONAL computation
ALTERNATING
83
TURING MACHINES
tree of M on input x. Define T(M)={xEX(*)]Macceptsx}.
In this paper, we are mainly concerned with a 2-ATM which has only universal states, and whose input tapes are restricted to square ones. We denote such a 2-ATM by 2-UTMS. By 2-ATM” we denote a 2-ATM whose input tapes are restricted to square ones. Let L : N -, R be a function with one variable rrt, where R denotes the set of all nomegative real numbers. With each 2-UTM” (or 2-ATM’) M we associate a space complexity function SPACE which takes configurations to natural numbers. That is, for each configuration c = (x,( i, j),( q, a, k)), let SPACE(C)= Ial. We say that M is L(m) space-bounded if for all m and for all x with /i(x) = l,(x) - m, if x is accepted by M, then there is an accepting computation tree of M on input x such that for each node r of the tree, sa~c~(l(lr)) Q fL( m)j.* By 2-UTM*(L(m)) [2-ATM’(L(m))] we denote an L(m) spacebounded 2-UTM” [2-ATM”], A two-dimensional deterministic Turing machine [7] is a 2-ATM whose configurations each have at most one successor. By 2-DTM”( L(m)) we denote an L(m) space-bounded two-dimensional deterministic Turing machine whose input tapes are restricted to square ones. For each X E (A, U, D >, define .9[2-XTM”(L(m))]={T]T=1”(M)forsome2-XTM”(L(m))
N).
We need the following concepts in the next section. DEFINITION 2.5. A function L : N --) R is two-dimensionally space constructible if there is a two-dimensional deterministic Turing machine M such that (i) for each m 2 1 and for each input tape x with 1, (x) = Z,(x) = m , M uses at most 1 L( m)] cells of the storage tape, (ii) for each m > 1, there exists some input tape x with I,(x) = E*(x) = m on which M halts after its read-write head has marked off exactly 1 L( m)] cells of the storage tape, and (iii) foreachm~l,when~ven~y~puttapex~~~~(x)=f~~~)=m, M never halts without marking off exactly [ L( m)l cells of the storage tape. (In this case, we say that M constructs the function
L.)
DEFINITION 2.6. Let 2,, 2, be finite sets of symbols. A projection is a mapping ;i : Xi’) + Z(,z) which is obtained by extending a mapping r : 2, + Z, as follows: 7(x)=x’ CJ (i) I,(x)=I,(x’) for each k-1,2, and (ii) r(x(i,j)) =x’(i,j)foreach(i,j)~((i,j)ll~i~I~(x)andlgjg1~(~)}. “f r] means the smallest integer greater than or equal t0 r.
84
KATSUSHI
INOUE ET AL.
kn-+----m-n+ 1
1
f m-l
Xl
x2
m
1
1
Fig. 2. (m. n)-chunk.
3.
RESULTS
It is well known [6] that there is a dense hierarchy for the classes of sets of square tapes accepted by two-dimensional deterministic Turing machines with nonconstant spaces. The main purpose of this section is to show that an analogous result also holds for 2-UTM” ’s with spaces of size less than or equal to log m. We first give several preliminaries to get the desired result. Let Z be a finite alphabet. For each m > 2 and each 1 Q n Q m - 1, an (m, n)-chunk over Z is a pattern x over Z as shown in Figure 2, where xi E 2(*), x2 E 2(‘), l,(x,) = m -1, I,(x,)=n, I,(x,)=m,and I,(x,)=mn.Let M bea2-UTM”(I).Note that if the numbers of states and storage-tape symbols of M are s and t, respectively, then the number of possible storage states of M is sit’. Let Z be the input alphabet of M, and let # be the boundary symbol of M. For any (m, n)-chunk x over Z, we denote by x(#) the pattern (obtained from x by surrounding x with #‘s) as shown in Figure 3. Below, we assume without loss of generality that for any (m, n)-chunk over Z (m 2 2, 1 Q n < m - l), M has the following property: 3 (A) M enters or exits the pattern x(#) only at the face designated bold line in Figure 3, and M never enters an accepting state in x(#).
by the
Then the number of entrance points to x(#) [or of exit points from x(#)] for M is n + 3. We suppose that these entrance points (or exit points) are numbered 3Note that for any 2-UTM”(f) (A) such that T(M) = T( M’).
M’, we can construct
a 2-UTM’(I)
M with the property
TWO-DIMENSIONAL
ALTERNATING #
#
TURING .o
MACHINES
a#
T 1
_+Ln _.: m
x .
.
.
.
. #.
85
. .
.
.*
l
#
Fig. 3
1,2,..., n+3inanappropriateway.Let P={1,2,...,n+3} bethesetofthese entrance points (or exit points). Let C = { ql, q2,. . . , qU} be the set of possible storage storage states of M, where u = sit’. For each i E P and each q E C, let M(,,,,(x(#)) be a subset of P x C u {L} which is defined as follows (L is a new symbol): (1) (j, p) E M(,.,,(x(#)) * when M enters the pattern x(#) in storage state q at point i, there exists a sequence of steps of M in which M eventually exits x(#) in storage state p and at point j. (2) L E Mti, 4j (x( #)) a when M enters the pattern x( #) in storage state 4 and at point i, there exists a sequence of steps of M in which M never exits x(#). [Note the assumption that M never enters an accepting state in x(#).] over Z. We say that x and y are M-equiuM(,,,,(y(#)). For any (m,n)chunk x over Z and for any tape VEX(~) with /i(u)=1 and i2(v)=n, let x[ ti] be the tape in Z(‘) consisting of v and x as shown in Figure 4. The following lemma means that M cannot distinguish between two (m, n)chunks which are M-equivalent. Let x, y be two (m, n)-chunks
afent if for each (i,q)E
PxC,
M(,,,,(x(#))=
LEMMA 3.1. Let M be a 2-UTM(I) with the property (A) described above, and I: be the input alphabet of M. Let x and y be M equivalent (m, n)-chunks over Z (m>2, l
computation computation
and
The lemma follows from the observation that there exists an accepting tree of M on X[V] if and only if there exists an accepting tree of M on y [ Y], since x and y are M-equivalent. w
~~USHI
86
INOUE ET AL.
Fig. 4. .x[v].
Clearly, M-equivalence is an equivalence relation on (111,n )-chunks, and we get the following lemma. LEMMA3.2. Let M be a 2-UTM(I) with theproperty input alphabet of M. Then there are at most
(A) aboue, and Z be the
M-equivalence clarses of (m, n)-chunk.s over 2, where u = sit’, s is the number of states of the finite control of M, and t is the number of storage-tape symbols of M. Proof. The proof is similar to that of Lemma 2.1 in IS]. We are now ready to prove the following key lemma. LEMMA3.3. Let L : N + R be a tw~dimensio~l~y spuce-.~onstructib~e function such thut L(m) G log m (m > l), and M be a two-dimensional deterministic Turing machine which constructs the function L. Let T[ L, M] be the following set, which depend on L and M: m>2 [f,(x)=i,(x)=m & (when the tape T[L,M]=(xe (~X{O,l))‘“‘~~ A1(x) is presented to M, its read-write heud marks off exact/y 1 L( m)l cells of the storuge tape and then halts) & 3i (2 < i < m>
[~2(~~~~~~~~~~~~~~~~l~l~=~~~~t~~~~~~~~~~~~~~l~l)l}~
where Z is the input alphabet of M, and x1 [h2] is the projection which is obtained by extending the mapping h, : 2 X {O,l} + Z(h, : 2 X {O,l} + {O,l}) so that for
TWO-DIMENSIONAL
ALTERNATING
any c=(a,b)EZX{O,l},
h,(c)=a
(1) T[ L, M] E 9[2-DTM”( (2) T[L, M] 4 9[2-UTM’( lim ,-,[L’(mVL(mN=0.
TURING
[h,(c)=b].
MACHINES
87
77wn
L( m))], and L’(m))] for any function L’ : N + R such that
Proof. (1): The set T[ L, M] is accepted by a 2-DTM”( L( m)) MI which acts as follows. Suppose that an input x with l,(x) = I,(x) = m (m > 2) is presented to MI. First, MI directly simulates the action of M on h,(x). (If M does not halt, then MI also does not halt, and will not accept x.) If MI finds out that M halts [in this case, note that M has marked off exactly [ L( m)l cells of the storage tape because M constructs the function L], then MI stores the segment h,(x[(l,l),(l,IL(m)l)l) on tb e storage tape. [Of course, MI uses exactly 1L( m)l cells marked off.] After that, MI simply checks that for some i (2 < i < m), x,(x [(i,l), (i,[L( m)l)]) is identical with stored on the storage tape, and MI accepts the input x if this check is successful. It will be obvious that T( MI) = T[ L, M]. (2): Suppose that there is a 2-UTM”(L’( m)) M, accepting T[ L, M], where lim ,_,[L’(m)/L(m)]=O [note that L(m)dlogm (m>l)]. Let s and t be the numbers of states (of the finite control) and storage-tape symbols of M2, respectively. We assume without loss of generality that when M, accepts a tape x in T[ L, M], it enters an accepting state only on the upper left-hand comer of x, and that M, never falls off an input tape out of the boundary symbol #. [Thus, M2 satisfies the property (A) above.] For each m > 2, let z(m) E 3’) be a fixed tape such that (i) I,(z(m))=I,(z(m))= m and (ii) when z(m) is presented to M, it marks off exactly [ L( m)l cells of the storage tape and halts. [Note that for each m a 2, there exists such a tape z(m) because M constructs the function L.] For each m > 2, let
~2(X[(l,l),(l,rL(m)l)l)
V(m)=(xE
(ZX{0,1})‘*‘11,(x)=12(x)=m
&h,([(l,l),(m,IL(m)l)l)
R(m)=
{row(x)]xEY(m)},
where for each x in V(m), row( x)
E {O,l}‘*’
88
KATSUSHI
INOUE ET AL.
Since4 IY( m) 1= 2’ ‘(m)1 , it follows that
( 2rL:m”)+( zrLr”)+...+( 2:::)
IR(m)l=
I
if
( 2rL;m”) +...+(+:.;;)=22rL(m)1 -1
2r+)i
am_l,
otheese.
Note that B = { p lfor some x in V(m), p is the pattern obtained from x by cutting the part x[(l,l),(l,[L(m)])] off} is a set of (m,]L(m)])-chunks over I: X (0, 1 }. Since M2 can use at most L’(m) cells of the storage tape when M, reads a tape in V(m), from Lemma 3.2, there are at most E(m)=(2(rL(m)1+3)U[m]+1
(rLcm)i +3)dmi
>
M,-equivalence classes of (m, [ L( m)])-chunks (over Z X {O,l}) in B, where u[m] = sL’(m)t”(“). We denote these M,-equivalence classes by Since L(m) E(m). For such m, there must be some Q,Q’ (Q#Q’) in R(m) and some C, [lgid E(m)] such that the following statement holds: There exist two tapes x, y in V(m) such that (i)
and
for some p in Q but not in Q’, (ii) row(x) = Q and row(y) = Q’, and (iii) both p, and p,, are in C,, where px (p,,) is the (m,[L(m)])-chunk over Z X (0, l} obtained from x (from y) by cutting the part
x[(l,l),(l,i~(m)l)l
Wp=t
.v[(Ll),(l,iL4m)l)l)
off.”
As is easily seen, x is in T[ L, M], and so x is accepted by M2. Therefore, from Lemma 3.1, it follows that y is also accepted by M2, which is a contradiction. (Note that y is not in T[ L, Ml.) This completes the proof of (2). n 4For any set S, IS1denotes the number of elements of S.
TWO-DIMENSIONAL
ALTERNATING
TURING
MACHINES
89
From Lemma 3.3, we can get the following main theorem. THEOREM 3.1. For any L, : N + R and L, : N + R such that (i) L, is a two-dimensionally space-constructible function, (ii) L,(m) < log m, and (iii) lim ,_,,[L,(m)/L,(m)]=O, there is a set in .EP[2-DTM”(L2(m))], but not in P[2-UTM”(L,(m))]. COROLLARY 3.1. Let L, : N + R and L, : N + R be any functions satisfying the condition that L,(m) < L,(m) (m > 1) and satisfying conditions (i), (ii), and (iii) described in Theorem 3.1. Then
(1) 5?[2-DTM”(Li(m))]&fZ[2-DTM”(L,(m))], (2) Y[2-UTM”(L,(m))] 5 Z[2-UTMS(L,(m))]. For each k E N, let logck) m be the function
and
defined as follows: (m=O),
log”‘m=
i [logDm]
log(k+l) m = log”)(log(k)
(m>l), m).
(4
As shown in Theorem 3 in [6], the function log(k)m (k > 1) is two-dimensionally space-constructible. It is easy to see that log(k+l) m < logck) m (m 2 1) and lim m _ m (logck+ ‘) m)/(logCk) m) = 0. From these facts and Corollary 3.1, we have COROLLARY
3.2.
For any k E N,
(1) s[2-DTM”(log(k+‘) (2) Z’[2-UTM”(log(k+‘)
m)] s 5?[2-DTM”(log(k) m)] s Z’[2-UTM”(log(k)
m)], and m)].
REMARKS. It has been shown [lo] that Z’[2-DTlW(
L( m))] 2 di”[2-UTM”(
L( m))] 5 =.V’[2-ATM”( L( m))]
for any L such that lim, _ m [ L( m)/log m] = 0. It is unknown whether a result analogous to Theorem 3.1 also holds for 2-ATM” ‘s. It will also be interesting to investigate space-hierarchy properties of the classes of sets accepted by 2-ATM” ’s (or 2-UTM” ‘s) with spaces of size greater than log m. REFERENCES 1. J. Hartmanis, P. M. Lewis II, and R. E. Stearns, Hierarchies of memory limited computations, in IEEE Conference Record of Switching Circuit Theory and Logical Design, 1965, p. 179.
KATSUSHI INOUE ET AL. 2. J. E. Hopcroft and J. D. Ullman, Introduction to Automata Theory, Lunguages and Computation, Addison-Wesley, Reading, Mass., 1979. 3. J. E. Hopcroft and J. D. Ullman, Some results on tape-bounded Turing machines, J. Assoc. Compute Mach. 16:168 (1967). 4. J. I. Seiferas, Techniques for separating space complexity classes, J. Comput. Syst. Sci. 14:73-99 (1977). 5. J. I. Seiferas, Relating refined space complexity classes, J. Compur. Sysf. Sci. 14:100-129 (1977). 6. K. Morita, H. Umeo, H. Ebi, and K. Sugata, Lower bounds on tape complexity of two-dimensional tape Turing machine. IECE Japan Trans. (01, June 1978, p. 381. 7. K. Inoue and I. Takanami, Three-way tape-bounded two-dimensional Turing machines, Inform. Sri. 17:195-220 (1979). 8. K. Inoue and I. Takanami, A note on closure properties of the classes of sets accepted by tape-bounded two-dimensional Turing machines, Inform. Sci. 15:143-158 (1978). 9. K. Inoue, I. Takanami, and H. Taniguchi, Two-dimensional alternating Turing machines, Theoret. Comput. Sci. 27:61-83 (1983). 10. K. Inoue, A. Ito, I. Takanami, and H. Taniguchi, A note on two-dimensional alternating Turing machines with only universal states, Technical Report No. AL82-45, IECE of Japan, 1982. Received 5 November
1984; revised 6 November 1984