INFORMATION
SCIENCES
17, 195-220 (1979)
195
‘Ibee-Way TapeBounded Two-DimensionalTuringMadrlws KATSUSHI MOUE
ITSUO TAKANAMI morlment ofElectronics, Fad& of Engineering, Yamqpchi University, f&e, 755 Jigwn Communicated by Azriel Rosenfeld
ABSTRACT In this paper, we introduce a three-way tape-bounded ~~~~0~ Turing machine (which can be considered as an extension of the on-line tape-bounded one-dimensional Turing machine to two dimensions), and investigate hierarchical and closure properties of the classes of sets accepted by several types of such machines.
1. INTRODUCTION In [I], tape-bounded two-dimensional Turing machines were proposed, and tape reduction and hierarchy theorems about them were given. In [2, 31, closure properties concerning certain operations of the classes of sets accepted by various ta~-~~d~ tw~ension~ Turing machines were examined. Tape-bounded two-dimensional Turing machines can be considered as an extension of off-line tape-bounded one-dimensional Turing machines [S] to two dimensions. Recently, Rosenfeld [5] introduced a two-dimensional finite automaton (called the “three-way two-dimensional finite automaton”) whose input head can move right, left, or down, but not up, and investigated some of its properties. In this paper, building on Rosenfeld’s ideas, we propose a three-way tape-bounded two-dimensional Turing machine which can be considered as an extension of an on-line tape-bounded one-dimensional Turing machine [4] to
OElsevier North Holland, Inc., 1979
KATSUSHI INOUE AND ITSUO TAKANAMI
1%
two dimensions, and investigate its fundamental properties. A three-way tapebounded two-dimensional Turing machine is a tape-bounded two-dimensional Turing machine whose input head can move right, left, or down, but not up. In Sec. 2, we give terminology and notation necessary for this paper. In Sec. 3, we investigate the difference between the accepting powers of three-way and four-way tape-bounded two-dimensional Turing machines. In Sec. 4, we investigate the difference between the accepting powers of deterministic and nondeterministic three-way tape-bounded two-dimensional Turing machines. In Sec. 5, for the classes of sets of square tapes accepted by several types of three-way tape-bounded two-dimensional Turing machines, we examine closure properties under the operations of taking union, intersection, complementation, rotation, row reflection, row and column cyclic closures, and projection. It is unknown [7J if a two-dimensional finite automaton can decide whether or not the l’s on a two-dimensional tape (over (0, 1)) form a connected region. In Sec. 6, we show that any nondeterministic three-way Turing machine which operates in storage space of order lower than the square root of the input sidelength cannot decide this connectedness. 2.
PRELIMINARIES
DEFINITION2.1. Let 2 be a finite set of symbols. A ~~dirn~~i5~~ tape over ): is a tw~~mensional rectangular array of elements of Z. The set of all two-dimensional tapes over Z is denoted by X(*).Given a tape XE%*), we let I,(x) be the number of rows of x and I,(x) be the number of columns of x. If 1 < i
(Lj), (fJ’)l,
only when 1~ i
l,r+j-
1).
(We call x[(ij), (i’,j’)] the “[(i,j), (i’,j’)]-segment of x.“) We now give five operations [2, 3, 61 which are concerned with this paper.
TUFUNG MACHINES DEFINITION
2.2. If
the rotation xR of x is given by
the row reji'ecrion
xRRof
x
is given by
a ruw cyclic shifr of x is any two-dimensiond tape of the form
for some 1
*”
. am.k+f
..’
all
ah
..-
.
.
amI
‘-’
.
. am
alk
for some 1 a; k
. a,,&
c5hm
cyclic shift
198
KATSUSHI INOUE AND ITSUO TAKANAMI
DEFINITION2.3. Let T be a set of two-dimensional tapes. Then TR={xRIxET} (rotation of T), TRR={xRRIx~ T} (row reflection of T), (row cyclic closure of T) TRC={yIy is a row cyclic shift of some xET} (co Iumn cyclic closure TCC= {yly is a column cyclic shift of some x E T} of T).
DEFINITION2.4. Let Z,, & be finite sets of symbols. A projection is a mapping ? : Z$z)+Z$2) which is obtained by extending a mapping T : &+Z2 as follows: b(x)= x’ if and only if (i) &(x)= C(x’) for each k= 1,2, and (ii) r(x(i,j))=x’(i,j) for each (i,j) [I
We then introduce a three-way tape-bounded two-dimensional Turing machine, which is the subject of this paper. We first recall a tape-bounded two-dimensional Turing machine [l-3]. A two-dimensional Turing machine M in the sense considered here, as shown in Fig. 1, has a read-only two-dimensional input tape with boundary symbols “#” and one semi-infinite storage tape. (Of course, M has a finite control, an input tape head and a storage tape head.) The action of M is similar to that of the one-dimensional Turing machine [4] which has a read-only input tape with endmarkers and one
Two-dimensional input tape
Storage tape Fig. 1. Two-dimensionalTuring machinewith read-onlyinput.
TURING MACHINES
199
semi-infinite storage tape, except that the input tape head of M can move up, down, right, or left. That is, when an input tape x EX(*) (where Z is the set of input symbols of M and the boundary symbol # is not in 2) is presented to M, M determines the next state of the finite control, the move direction (up, down, right, left, or no move) of the input tape head, the symbol written by the storage tape head, and the move direction (right, left, or no move) of the storage tape head, depending on the present state of the finite control and the symbols read by input and storage tape heads. If the input tape head falls off the tape x with boundary symbols, M can make no further move. M starts in its initial state, with the input tape head on the upper left-hand corner of the tape x, and with all cells of the storage tape blank. We say that M accepts the tape if M eventually halts in a specified state (accepting state). We denote by T(M) the set of all two-dimensional tapes accepted by M. A three-way two-dimensional Turing machine is a two-dimensional Turing machine whose input tape head can move right, left, or down, but not up. Let L(m,n) : N*+=R (where N is the set of all positive integers and R is the set of all non-negative real numbers) be a function of two variables m and n. A two-dimensional Turing machine (three-way two-dimensional Turing machine) M is said to be L(m, n) tape-bounded if for no input tape x E X(*)with I,(x)= m and I*(x)= n does M scan more than L(m,n) cells’ on the storage tape. We denote an L(m,n) tape-bounded two-dimensional Turing machine [three-way L(m, n) tape-bounded two-dimensional Turing machine] by “TM(L(m,n))” [“TRTM(L(m,n))“]. A TM(L(m,n)) [TRTM(L(m,n))] is in general nondeterministic. We denote a deterministic TM(L(m,n)) [deterministic TRTM(L(m,n))] in particular by “DTM(L(m,n))” [“DTRTM(L(m,n))“]. Let !Z[TM(L(m,n))]
= { TIT= T(M) for some TM(L(m,n))
M},
!Z[DTM(L(m,n))] = { TIT= T(M) for some DTM(L(m,n)) C[TRTM(L(m,n))]=
{ TIT= T(M) for some TRTM(L(m,n))
M}, M},
and lZ[DTRTM(L(m,n))]
= { TIT= T(M) for some DTRTM(L(m,n))M}.
Let L(m): N-R be a function with one variable m. By “TM”(L(m))” [“DTMS(L(m)),” “TRTM”(L(m)),” “DTRTM’(L(m))“] we denote a nondeterministic two-dimensional Turing machine (deterministic two-dimensional ‘Rigorously, “L(m, n) cells” should be replaced with “[L(m, n)] cells”, where [r] means the smallest integer greater than or equal to r. Below we omit [r]: if no confusion occurs.
KATSUSHI INOUE AND ITSUO TAKANAMI
200
Turing machine, nondeterministic three-way two-dimensional Turing machine, deterministic three-way two-dimensional Turing machine) whose input tapes are restricted to square ones and which does not scan more than L(m) cells* on the storage tape for any square tape x E Xc*)with m rows and m columns. Let CfTM”(L(m))] = {TIT= T(M) for some TM”(L(m)) M}. C[DTMS(L(m))], C[TRTM’(L(m))], and JZ[DTRTMs(L(m))] are defined similarly. We denote a nondeterministic (dete~~stic) two-~mension~ finite automaton [7, 8] by “2-NA” (“2-DA”). A three-wq 2-N/1 ~~~~ee-w~Z-&4) [S] is a 2-NA (2-DA) whose input tape head can move right, left, or down, but not up. We denote a three-way 2-NA (three-way 2-DA) by “TR2-NA” (“TR2DA”). By “2-NA”” (“,-DA’,” “TR2-NA”,” “TFG!-DA”“) we denote a 2-NA (2-DA, TR2-NA, TR2-DA) whose input tapes are restricted to square ones. Let lZ[2-NA]= { TI T is accepted by some 2-NA}, and l?[2-NAZI= { 2’1T is accepted by some 2-NA”}. e[TR2-NA], !Z[TR2-NA”], etc. are defined similarly. As is easily seen, it follows that for any constant k, !Z[2-NA]= l?[TM(k)], C[2-DA] = C[DTM(k)], e[TR2-NA] = C[TRTM(k)], and &[TR2-DA] = C[DTRTM(k)]. 3. THREE-WAY VERSUS FOUR-WAY In this section, we investigate the difference between the accepting powers _ _ of tape-bounded two-dimensional Turing machines and three-way tapebounded two-dimensional Turing machines. 3.1.
SQUARE TAPES
We first argue the case when input tapes are restricted to square ones. We need the following two lemmas. LEMMA 3.1. fRf T, = {x E (0, l}“l(3m > 2)[I,(x) = f&x)= m & .$(I, l), (l,m)]=x[(2,1), (2,m)]]}, and iet L,(m):N+R be a ~~cf~~n such that lim,,,,,[L,(m)/m]=O. Then (1) T, E E[2-DA=], and (2) T, 4 QT’RTM”(L,(m))]. Proof. The proof of (1) is omitted here, since it is obvious. We now prove (2). (The proof is similar to that of Proposition 4.3.8 in [5].) Suppose that there is a TRTM”(L,(m)) M accepting IT,, and that s is the number of states of the 2Rigorously, “L(m) cells” should be replaced with “[L(m)] cells”.
201
TURING MACHINES
finite control and t is the number of storage-tape symbols. For each m > 3, let
Clearly, each tape in V(m) is accepted by M. For each x E V(m), let conf(x) be the set of configurations3 of M just after the point, in the accepting computations on x, where the input head left the first row of x. Then the following proposition must hold. PROPOSITION3.1
For any two different tapes x,y E V(m), conf(x) n conf(y) =0
(empty set).
(For otherwise, suppose that conf(x) n conf(_~)#la and u Econf(x)n conf(y). It is obvious that if, starting with this configuration u, the input head proceeds to read the [(2, I), (m,m)]-segment of x, then M could enter an accepting state. Therefore, by assumption, it follows that the tape z [l,(z)= f,(z) = m] satisfying the following two conditions must be also accepted by M: (i) 4(1,1X (Lm)l=yW, 0, (1,m)l; (ii) d(Zl), h,m)l=MZ I>,hm)l- l-his contradicts the fact that 2 is not in T,.) Clearly, 1V(m)1 = 2”, where for any set S, ISI denotes the number of elements of S. Let c(m) be the number of possible configurations of M just after the input head left the first rows of tapes in V(m). Then c(m) c(m)
for large m.
3For any (three-way) two-dimensional Turing machine M, we define the confg~ak~~ of M to be a combination of the (1) state of the finite control, (2) position of the input tape head within the input tape, (3) position of the storage tape head within the nonblank portion of the storage tape, and (4) contents of the storage tape.
202
KATSUSHI INOUE AND ITSUO TAKANAMI
Therefore, it follows that for large m there must be different tapes x,y E V(m) such that conf(x)nconf(y)fM, This contradicts Proposition 3.1, and thus the part (2) of the lemma holds. H LEMMA 3.2. Let T,={~E{O,l}(~~~(3rn> l)[l,(x)=I,(x)=2m & x[(l,l) (m,2m)]= x[(m+ 1,1), (2m,2m)]]}, and let .&(m):N+R be ajhction such thu; rim,,, [L2(m)/m2]=0. Then (1) T2E ~~DT~s~ogm)], and (2) T2@~[TRTM~(~(m~)l.
Proof. The proof of (1) is omitted here, since it is obvious. We prove (2). Suppose that there is a TRTM”( L2(m)) M accepting T,, and that s is the number of states of the finite control and t is the number of storage-tape symbols. For each m > 1, let V(m)={xETzll,(x)=Z2(x)=2m}. Clearly, each tape in F(m) is accepted by M. For each x E V(m), let “conf(x)” be the set of co~igurations of M just after the point, in the accepting computations on x, where the input head left the top half (i.e., the mth row) of x. Then, by using the same technique as in the proof of Proposition 3.1, we can prove that the following proposition must hold. PROPOSITION
3.2. For any two different tapes x,y E V(m), conf(x)nconf(y)=(a.
. Let c(m) be the number of possible configurations of Clearly, j V(m){ =2 2mZ M just after the input head left the mth rows of tapes in V(m). Then
c(m) <~(2rn+2)L,(2rn)t~~(~“~ Since lim,_m[L2(m)/m2]=0,
we have
1V(m)1 >c(m)
for large m.
Therefore, it follows that for large m there must be different tapes x,y E V(m) such that conf(x)nconf(y)#0. This contradicts Proposition 3.2, and thus the part (2) of the lemma holds. H
TURING MACHINES
203
From Lemmas 3.1 and 3.2, we can get the following theorem. THEOREM3.1. Let &(m):N+R
be a function such that lii,,_,[~(m)/m2]
=O. Then (1)
i.WIRTMsM~Nle ~[DTWM4)1, and (2) ~[TRTWMM.z QTW~,(~Nl.
COROLLARY
3.1 [5]: lZ[TR2-DA”]e r;[2-DA”] and QTR2-NA”] Z C[2-NV].
The following theorem means that two-dimensional Turing machines and three-way two-dimensional Turing machines are equivalent in accepting power, if the number of cells available on the storage tape is equal to or larger than m2 for any input tape with m rows and m columns. THEOREM 3.2. Let L(m) : N-R
be a function such that L(m) > m2 for each
m > 1. Then
(1) QDTRTM”(L(m))]= C[DTM”(L(m))], and (2) c[TRTM$(L(m))]= C[TM”(L(m))]. Proof. To prove the theorem, it is sufficient to show that !Z[DTM”(L(m))]C c[DTRTMS(L(m))] [or ~[TM~(L~m))]~~[TRT~(L(m))]l, where L(m)>m’ (m > 1). Let M be a DTM”(L(m)) [or TM”(L(m))j. Consider the DTRTMg(L(m)) [or TRTM~(~m))J M’ which acts as follows. M’ divides the storage tape into two tracks. When an input tape x with r,(x)= I,(x) = m is presented to M’, M’ first copies each row of x in sequence on track 1. [Since h4’ can use L(m) ( > m2) cells on the storage tape, it is obvious that M’ can do this.] Then, M’ simulates the action of M on x by using the copied pattern on track 1. (I’rack 2 is used to simulate the storage tape of M.) Then M’ accepts x if and only if M accepts x. The details of the action of M’ are left to the reader. It will be obvious that T(M’) = T(M). II 3.2. GENERAL
TAPES
We next argue for the case when input tapes are not restricted to square ones. DEFINITION 3.1. Let g(n) : N+R be a function. The function g(n) is said to be constructed Ly some one-dimemional deterministic Turing machine if there is a one-dimensional deterministic Turing machine M which for any input tape of length n makes use of exactly g(n) (rigorously, [g(n)]) cells of the storage tape and halts, where M has a read-only input tape with end markers and one semi-infinite storage tape [4].
204
KATSUSHI INOUE AND ITSUO TAKANAMI
LENMA3.3. Let f(m) : N-+ R be a function such that lim_,[ f(m)/m] -0, and g(n) : N+ R be a monotonic norzdecreasingfunction which can be constructed by same one-dimensional deterministic Turing machine, and let T[ g] i= {x E {0, 1)(2)](3n > l)[(,(x)=2X2g(n) & &(.x)=n & x[(l, 1),(28(n),n)]=X[(2.1P(n)+1, l), (2X28(“),n)]]).4 Then (Q
T[g~~~~~~M~g~n~~l, afid (2) T[glfis~[TR~M(f~m~ + g(n))1 u ~ITRTM~~(m~ X s(n))]. Proof. (1): By using the same idea as in the proof of Lemma 3.1(2) in f2], we can prove (1). The details are omitted here. (2): We only show that T[ g] is not in QTRTM(f(m)Xg(n))]. (By using the same method, we can show that T[ g] is not in QTRTM(f(m)+-g(n))].) Suppose that there is a TRTM(L;(m,n)) M accepting T[ g], where L(m,n) = f(m)xg(n), and s is the number of states of the finite control and t is the number of storage-tape symbols. For each n > 1, let
Clearly, each tape in V(n) is accepted by M. For each x in V(n), let conf(x) be the set of configurations of M just after the point, in the accepting computations on x, where the input head left the top half (i.e., the 2d”jth row) of x. Then, by using the same technique as in the proof of Proposition 3.1, we can prove that the following proposition must hold. PROPOSITION 3.3. For any two duerent tapes x,y E V(n),
conf(x)nconf(y)=IZI. Clearly, 1V(n)/ = 2” X2g’n!.Let c(n) be the number of possible configurations of M just after the input head left the 2*(“‘th rows of tapes in V(n). Then c(n) gs(nf2)L(m,,n)tt(“~*“),
where m,,=2x2 d”) . As shown later, /V(n)1 >c(n) for large n. Therefore, it follows that for large n there must be different tapes x,yE k’(n) such that conf(x) n conf(y)#0. This contradicts Proposition 3.3. This completes the proof of (2) of the lemma.
4R.ig~ro~iy, “g&f” should be replacedwith “[g(n)].” For simplicity, we denote [g(n)] by g(n).
205
TURING MACHINES We now show that 1V(n)1 x(n)
for large n. We first have5
log1V(n) I= n x 2g@), and
loge(n)
Since
X g(n) for L(&, n)]
limm__ [f(m)/m]
lh?lp,M%v~l
= 0
(see
the
condition
of
the
lemma),
= 0, so that, by recalling that m,,= 2 x 2&“),we have lim
f(*n)
-0
n-rm2X2go-
’
and thus f(4)
_()
?!i% 2B(n) -
(3.1)
.
From (3.1), we have .
k%
logf(mJ < g(n)
1
-
P-2)
Two cases arise. (i) Suppose that n &g(n) for infinitely many n. Then, by using (3.1) above, it follows that log1V(n)1> loge(n) for some large n. (ii) Suppose that g(n) > n for infinitely many fzj (nl
many n. Then we have for infinitely
‘In what follows, the base of logarithms is to be taken as 2.
206
KATSUSHI
Therefore,
INOUE
AND ITSUO TAKANAMI
by using (3.2) above, we have
loglogc(ni) loglog]V(ni)]
:%
1ogf(m,) = i--Pm hm < lim
\
g(q) + log n,
l”gf(&+)+log g(4) @nil
i-02
= lim i+oo
=
kf(%)
that 1V(n)1 >c(n)
and g(n)
i-am
<
g(ni)
From Lemma 3.3, we can get the following THEOREM3.3. L-et f(m)
+ lim log&)
g(ni)
lOti
lim
i-+03
In either case, we can conclude
+lOgg(&)
S(ni)
1
. for some large n.
n
theorem.
be the functions described
in Lemma
3.3.
Then + AnNI.cz QDTWf(m) + &)>I9 &))I Z WWf(m) + dnN1, X &ONiZWTM(f(m) X I, and X g(n))1 fZCW(f(m) X s(n))l.
(1) QDTRTM(f(m)
(2) QTRTWf(m)
+
(3) WTRTWf(m) (4) QTRTWf(m)
LEMMA3.4. Let f(m): such
that
lim,,_J
(3n > l)[l~(x)=n
N+R
g(n)/n]
be a function, and g(n): N+R be a function and let T, = {x E (0, l}(z)]l,(x) = 2 &
= 0,
8~ x[(l, l),(l,n)l=x[G
1),(2,n)ll}.
Then
(1) T, E lZ[2-DA], and (2) T3 E QTR’Wf(m)
+
s(n))1u WRTWf(m)
x
dnN1.
Proof. It will be obvious that part (1) of the lemma holds. By using the same ideas as in the proof of (2) of Lemma 3.1, we can show that there is no TRTWf(m) + g(n)) Ior TRTM(f(m) X g(n))1accepting T3. The details are left to the reader. n
From Lemma 3.4, we can get the following. THEOREM3.4. Let f(m)
and g(n)
be the functions described
Then the same conclusions as in Theorem 3.3 hold.
in Lemma
3.4.
TURING MACHINES 4.
NONDETERMINISM
207 VERSUS DETERMINISM
In this section, we investigate the difference between the accepting powers of deterministic and nondeterministic three-way tape-bounded two-dimensional Turing machines. 4.1.
SQUARE
TAPES
We first argue the case when input tapes are restricted to square ones. THEOREM 4.1. Let L(m) : N --+ R be u function such that (i) lim,,_,,[ L(m)/logm] = 0 or (ii) L(m) > logm and lim,,_,[ L(m)/m’] =O. Then
C[DTRTM”( L( m))] e l!Z[TRTM’(L( m))]. Proof. Let L’(m) be a function such that lim,_,[L’(m)/logm]=O. Then, as shown later (see Theorem 5. l), C[DTRTM”(L’(m))] is not closed under union. On the other hand, it is obvious that ~[TRTM~(~‘(~))] is closed under union. Therefore, ~~DTRTM~(~(~))]~ ~~RTM’(L’(~))]. Let L“(m) be a function and L”(m) > logm. Then, as shown later (see such that lim,_,_[L”(m)/m2]=0 Theorems 5.2 and 5.3), f?[DTRTMS(L”(m))] is closed under complementation, but lZ[TRTM”(L”(m))] is not closed under complementation. Therefore, !Z[DTRTM”(L”(m))Jg l?.[TRTM”(L”(m))]. This completes the proof of the theorem. n COROLLARY
4.1 [5]. ‘Z[TR2- DA”] _&Z QTR2-NA”].
It is unknown whether or not lZIDTRTM”(L(m))]ZQTRTMS(L(m))] any L(m) > m2 (m > 1). 4.2. GENERAL
for
TAPES
We next argue the case when input tapes are not restricted to square ones. LEMMA4.1. Let f(m) : N-R be a function such that lim,_,[f(m)/m] =0, und g(n) : N-R be a monotonic no~ecre~jng function which can be constructed by some one-dj~~io~~ determjnistic Turing machine, and let T’[ g] = {x E (0, l}‘*)](% > 1)[1,(x)=2X2g(n) & 12(x)=n & x[(l, l),(2B’“),n)]#x[(28(“f+ 1, 1), (2 X 28(“),n)]]} . Then ( 1) T’[ g] B C[DTRTM(f(m) + g(n))1 u fZ[DTR’Mf(m) (2) T’I gl E f lTRTM( &))I.
X g(n))], and
208
KATSUSHI
INOUE
AND ITSUO TAKANAMI
Proof. (1): We only show that T’[ g] is not in e[DTRTM(f(m) Xg(n))]. (By using the same method, we can show that T’[g] is not in c[DTRTM(f(m)+ g(n))].) Suppose that there is a DTRTM(L(m,n)) M accepting T’[g], where L(m,n)=f(m) xg(n),and s is the number of states of the finite control and t is the number of storage-tape symbols. For each n > 1, let
For each x in I’(n), let conf(x) be the configuration of M just after the input head left the top half (i.e., the 2 g(%h row) of x. Then the following proposition must hold. PROPOSITION 4.1. For any two tapes x, y E V(n) [(A 1),(2g(“) , n)]-segments are different, conf(x) # conf(y). (For otherwise, suppose that conf(x) =conf(y). V(n) satisfying the following:
Consider
such
that
their
two tapes z,z’ E
(i) z[(l, l), (2g(n), n)] = x[(l, l), (2g(“), n)] and z’[(l, I), (2s@), n)] = ~[(l, l),(2g(“), n)l; and (ii) Z[(2g(n)+l, l), (2 X 2d”),n)] = z’[(2s(“)+ 1, I), (2 x 2g(“),n)]=y[(1,1),(2g@), n)]. Clearly, z is in T’[ g], and so z is accepted by M. Since conf(x) = conf(y), it follows that z’ must be also accepted by M. This contradicts the fact that z’ is not in T’[ g].) Letp(n) be the number of tapes in V(n) whose [(l, 1),(2g(“),n)]-segments are different. Clearly, p(n) = 2” x28(“).On the other hand, let c(n) be the number of possible configurations of M just after the input head left the 2s(“)th rows of tapes in V(n). Then c(n) ~s(n+2)L(m,,n)tL(“n,“),
where m,, = 2 x 2s(“). As shown in the proof of (2) of Lemma 3.3,
for large n. Therefore, it follows that for large n there must be two tapes x,y E V(n) such that their [(l, 1),(2s(“), n)]-segments are different and conf(x) = conf(y). This contradicts Proposition 4.1, and thus part (1) of the lemma holds. (2): We consider the TRTM( g(n)) M which acts as follows. Suppose that an input tape x with l*(x) = n is presented to M. First of all, by using the number n of columns of x, M marks off exactly g(n) cells of the storage tape. [Since
TURING MACHINES
209
g(n) can be constructed by some one-dimensional deterministic Turing machine, it is obvious that M can do this.] M divides the part marked off of the storage tape into two tracks, and stores a binary number on each track to count a number between 0 and 2&“).M first counts the number 2d”) on track 1 and track 2. (M performs the above actions on the first row.) M then chooses some j (1 28”‘) and so M fails in the choice of i. To check that Ii(x) = 2 X 2d”), M subtracts one from the number on track 2 for every two down moves along the jth column. M can do the desired check by knowing whether or not the input head arrives at the bottom boundary symbol when track 2 counts the number 0.1 It will be obvious that T(M) = T’[ g]. n From Lemma 4.1, we can get the following theorem. THEOREM 4.2.Letf(m) and g(n) be the functions described in Lemma 4.1. Then (1) WTRTM(f(m)
(2) WTRTWf(m)
+ s(n))1Z QTR’Wf(m) X g(n))1iZC[TR’Wf(m)
+ gW)l, ad X s(W
LEMMA 4.2.Let f(m) : N+ R be a function, and g(n) : N-R be a function & (there such that lim__J g(n)/n] = 0, and let T4={x~{0,1}(*)~(f,(x)=2) exists exactly one “1” on the second row of x) & 3j(l
e[DTRTMCf(m)xg(n))l.
Proof. It is obvious that part (1) of the lemma holds. Here we prove (2). We only show that T4 is not in QDTRTMCf(m)Xg(n))]. (The proof is similar to that of Proposition 4.3.9 in [5].) Suppose that there is a DTRTM(L(m,n)) M accepting T4, where L(m, n) = f (m) x g(n), and s is the number of states of the finite control and t is the number of storage tape symbols. For each n > 1, let
KATSUSHI
210
INOUE
AND ITSUO TAKANAMI
For each x in V(n), let conf(x) be the configuration of M just after the input head left the first row of x. Then the following proposition must hold.
PROPOSITION 4.2.Fur any two tapes x,y E V(n) such that their first rows are different, conf(x)f
conf(y).
[For otherwise suppose that conf(x) =conf(y). Consider two tapes z,z’ E V(n) satisfying the following (suppose that x(lj)#y(lj) and x(lj)= 1 and Y(lJ)=O): (i) z](l, 1),(1,n)l=W, 1),(1,41and W, ~h(L~)l=_W, l),(l,n)l; (ii) z(2j)= 1 and z(2,r)=O for each r (1
(2,n)l.
Clearly, z is in T4, and so z is accepted by M. It follows that z’ must be also accepted by M. This contradicts the fact that z’ is not in T4.] Let p(n) be the number of tapes in V(n) whose first rows are different, and let c(n) be the number of possible configurations of M just after the input head left the first rows of tapes in V(n). Then
Since lim ,,_,[ g(n)/n] =O, it follows that lim,,,[logc(n)/logp(n)] =O, and thus p(n) >c(n) for large n. Therefore, it follows that for large n there must be two tapes x,y E V(n) such that their first rows are different and conf(x)= conf(y). This contradicts Proposition 4.2, and thus part (2) of the lemma holds.
n From Lemma 4.2, we can get the following
theorem.
THEOREM 4.3.Let f(m) and g(n) be the functions described in Lemma 4.2. Then
( 1) ePTRTMWm) + g(n))1IzC.[TRTWf(m)+ g(n))],and (2) fWTRTW.fW XsW)l!Z fVRTMCf(m)X&Nl5.
CLOSURE
PROPERTIES
In this section, we investigate closure properties of the classes of sets of square tapes accepted by several types of three-way tape-bounded two-dimensional Turing machines. See [9] for closure properties of the classes of sets of
TURING MACHINES
211
“general two-dimensional tapes” accepted by several types of three-way tapebounded two-dimensional Turing machines. First of all, we examine closure properties under Boolean operations. LEMMA5.1. Let L(m) : N+ R be a function such that lim,_,[ L(m)/logm J= 0, and let T, = {x E {O,l)(2)/(3m > 2)[(1,(x) = f,(x) = m) & (there exist exactly two l’s on the first row of x) & (the Symbol (on the second row) just below the beg-hand 1 on the Jkst row of x is I)}, and T6= {x E {0, 1}(2)](3m> 2&‘/,(x)= Iz(x) = m) & (there exist exactIy two I’s on the $%st row of x) & (the symbol (on the second row) just below the right-hard 1 on the first row of x is I)}. Then (1) T,, T,EQTR~-DA’], (2) T5u T6 4 QDTRTM”(L(m))], and (3) T, n T6 @QTRTM”(L(m))]. Proof. (1): The proof is left to the reader, since it is obvious. (2): Suppose that there is a DTRTM(L(m)) M accepting T5u T,, and s is the number of states of the finite control and t is the number of storage tape symbols. For each m > 2, let V(m) = {x E (0, I}f*)f(l,(x) = I,(x) = m) & (there exist exactly two I’s in the first row of x)1. For each x in V(m), let conf(x) be the configuration of M just after the input head left the first row of x. Then the following proposition must hold. PROPOSITION 5.1. For any two tapes x,y E V(m) such that their first rows are different, conf(x)# conf(y).
[For otherwise, suppose that conf(x) = conf(y). Consider two tapes z,z’ in V(m) satisfying the following (suppose that x(lj)#y( 1,j) and x( 1,j) = 1 and u(L.j)=O): 6) W,
l),(l,m)l=x~(l, O,U,m)land z’[(h~),(~,m)~=y~(~~ l),(Wl;
(ii) 2(2,j)= 1 and z(2,r)=O for each r (I ,(m, m)l= z’f(2, I),(m,m>J. Clearly, z is in T5u T6, and so z is accepted by M. Since conf(x) = conf( y), it follows that z’ must be also accepted by M. This contradicts the fact that t’ is not in T,u Ts.] Letp(m) be the number of tapes in V(m) whose first rows are different, and c(m) be the number of possible configurations of M just after the input head left the first rows of tapes in V(m). Then
P(m)=(;)?
c(m) ~s(m+2)~~m)t~tm).
KATSUSHI INOUE AND ITSUO TAKANAMI
212
For large m, p(m)zam*, large m
Since lim,,,[l(m)/logm]=0,
where a is a positive number. Therefore, we have for
it follows that . loge(m) 1 di?% logp(m) ’ Z ‘
Thus for large m, p(m) >c(m). Therefore, it follows that for large m there must be two tapes x,y E V(m) such that their first rows are different and conf(x)= conf(y). This contradicts Proposition 5.1, and thus part (2) of the lemma holds. (3): Suppose that there is a TRTM”(L(m)) M accepting T5 n T6, and s is the number of states of the finite control and t is the number of storage-tape symbols. For each m > 2, let V(m) = {x E (0, l}(2)](11(x)= I,(x) = m) & (there exist exactly two l’s
in the first row of x) & (x[(l, 1),(&m)] = N2, UCWI) 82(xK3, Ww41 E (W291. Clearly, each tape in V(m) is in Ts n T6, and so it is accepted by M. For each x in V(m), let conf(x) be the set of configurations of M just after the point, in the accepting computations on x, where the input head left the first row of x. Then, by using the same technique as in the proof of Proposition 3.1, we can prove that the following proposition must hold. PROPOSITION 5.2. For aq~ two d$fermttapes x,y E V(m), conf( x) n conf( y ) = 0.
Clearly,
Iv(m)l=( 7). As shown in the proof of (2) of the lemma, we have for large m
IVW Mm), where c(m) [
213
TURING MACHINES
follows that for large m there must be two different tapes in V(m) such that conf(x) n conf(u) f 0. This contradicts Proposition 5.2, and thus the part (3) of the lemma holds. l From Lemma 5.1 and a little consideration, we can get the following theorem. THEOREM 5.1.
Let L(m) : N-R
be a funcfion such that lim,,,[l(m)/logm]
=O. Then (1) ~[DTRTM3(~(~))] is not closed under union or intersection, and (21 ~~RTM~(~(m))l ~o~le~nt~tion~
is closed under union, but not und’er intersection or
COROLLARY 5.1. (1) C[TR2-DA”] is not closed w&r union or intersection. (2) lZ![TR2-NAx]is closed under union, but not under intersection or complementation . It is unknown whether or not C[DTRTM’(L(m))] is closed under complementation for any L(m) such that lim,,,_+,[l(m)/logm]=0. Theorem 5.1 and the following theorem mean that in a sense, QDTRTM”(logm)] is the smallest class closed under intersection. THEOREM5.2. Let L(m) : N+R
be ajkzction
such that t(m)
> logm (m > 1).
Then
(1) efDTRTM”(L(m))] is closed under union, intersection, and compkmentution, and
(2) C~RTM”(L(m))] is closed under union and intersection. Proof. (1): We only show that QDTRTM’(log m)] is closed under union, intersection, and complementation. (Similar techniques are used to prove the other cases.) Compfementution: For any DTRTM” (logm) M,6 one can construct, by using ordinary techniques, another DTRTM” (logm) M’ such that (i) T(M)= T(W), and (ii) for any input tape, M’ always arrives at the bottom boundary symbol # and halts. Then one can obtain a DTRTM” (logm) M” accepting the complement of T(M) from M’ by exchanging the accepting and nonaccepting states of M ‘. Intersection: Let M, and M2 be any two DTRTM” (1ogm)‘s. We consider the DTRTMJ (logm) M which acts as follows. M divides the storage tape into six tracks, and uses tracks 1, 2, and 3 to simulate M,, and tracks 4, 5, and 6 to
6Below, we assume without loss of generality that when a DTRTM’ (logm) accepts an input tape, it always arrives at the bottom boundary symbol # and enters an accepting state.
214
KATSUSHI
INOUE
AND ITSUO TAKANAMI
simulate Mz. it4 first begins to simulate the action of M, on the first row of an input tape x (starting from the first row and the first column), by using track 1. When iU, leaves the first row of x from some position (e.g. from the first row and the i,th column), A4 stores the number i, in a binary representation on track 2, and stores the position of the storage-tape head at that time on track 3. Then, M begins to simulate the action of Mz on the first row of x (starting from the first row and the first column), by using track 4. When M2 leaves the first row of x from some position (e.g. from the first row and the&th column), M stores the number j, in a binary representation on track 5, and stores the position of the storage-tape head at that time on track 6. M next begins to simulate the action of M, on the second row of x (starting from the second row and the j,th column), by using the information stored on tracks 1, 2, and 3. After that, M continues to simulate by turns the actions of M, and Mz on each row of x by using the above techniques. Then A4 accepts x if and only if both M, and Mz arrive at the bottom boundary symbol and accept x. It will be obvious that T(M)= T(M,)n T(M,). Union: lZ[DTRTM” (logm)] is closed under union, since it is closed under complementation and intersection. (2): It is obvious that fZ[TRTM”(L(m))] is closed under union. By using the same ideas as those in the proof above, we can easily see that QTRTM”(L(m))] is closed under intersection. n THEOREM 5.3. Let L(m): N-R be a function such that L(m) > logm ana’ lim ,+,[L(m)/m*]=O. Then lZ[TRTM”(L(m))] is not closed under complementation. Proof. Let L(m) be the function described in the theorem, and let T2 be the set described in Lemma 3.2. Consider the complement F2 of T,. Clearly, T2= T’u T”, where T’= {XE {0,1}(*)](3m > O)[l,(x)= 1,(x)=2m+ 11) and T” = {xE{O, l}(*)](Bm > l)[l,(x)= I*(x)=2 m & x1(1, l), (m,2m)l#xKm+ 1,1), (2m,2m)]]}. It is obvious that T’ is in QTRTM”(L(m))]. On the other hand, we can easily show, by using the same ideas as in the proof of Lemma 4.1(2), that T” is in c[TRTM”(logm)], and thus in F.[TRTM”(L(m))]. (The details are left to the Fader.) Thus F2 is in e[TRTM”(L(m))], since it is closed under union. Since T,= T2 is not in lZITRTMS(L(m))] [by Lemma 3.2(2)], it follows that lZ[TRTM”(L(m))] is not closed under complementation. n It is unknown whether or not plementation for any L(m) > m*.
e[TRTM”(L(m))]
is closed
We next investigate closure properties under rotation, and column cyclic closures, and projection.
under
row reflection,
comrow
LEMMA 5.2. Let T, = {x E (0, 1}(*)1(3m > 2)[l,(x) = l,(x) = m & x[(l, l), (m, l)]=x[(l,2), (m,2)]]} and T8={x~{0, l}(*)((Bm > l)[l,(x)=I,(x)=2m 8r
TURING MACHINES
215
(I) T, E C[TR2-DA”], and (2) Ts E C[DTRTM”(m)]. Proof. The proof, which is easy, is omitted here.
q
THEOREM5.4. fRt L(m) : N+R be a f&&on such that (if hm,,,_,,[ L(m)/m] -0, or (ii) L(m) >m and ~~~~~~L(rn}/rn~]=O. TIren ~rD~~~(~(rn~)] and ~~TRTM~(~(rn~~]are m@closed under rotation. Proof. Let L’(m): N+R be a function such that lim,,,,,[l’(m),/mJ=O. By Lemma 3.1(2), TF= TI @ GfTRTMS(L’(m))]. Therefore, it follows by Lemma 5,2( 1) that neither lZ[DTRTM’(L’(m))J nor c[TRTM”(L’(m))] is closed under rotation. Let L”(m) : IV-+ R be a function such that L”(m) > m and Then, by Lemma 3.2(2), TgR= TzG lZ[TRTM*(L”(m))]. lim,__[L”(m)/m2]=0. Therefore, it follows by Lemma 5.2(2) that f?[DTRTM”(L”(m))] and C[TRTM”(L”(m))J are not closed under rotation. This completes the proof of the theorem. n
Theorem 5.4 and the following theorem mean that ~[DTR~~(rn~] is the smallest class closed under rotation.
in a sense,
THEOREM5.5. LRi L(m): N-+-R be a @z&on such that L(m) > m2 (m > 1). Then borh CfDTRTM”(L(m))] and C[TRTM”(L(m))] are closed under rotation. Proof. It is obvious that e[DTM’(L’(m))] (or C[TW(L’(m))]) is closed under rotation for any function L’(m). It follows from this fact and Theorem 3,2 that the theorem holds. I
LEW 5.3. Let L(m) : N-+ R be a function such that lim,,_,,[ L(m)/m] = 0, and let T9 = {x E (0, I )(‘)j@rn > 2)[(1,(x) = I,(x) = m) & (there exists exact& ane 1 in the firf
8-0~ of x) & ~~(l~j~m~~(m,j)=~(l~)=l]]~,
T,,=(xE
(0, 1>@‘/(3rnz 2g(f,(x)= 12(~)= m) C (there exists exaEtIy one 1 in the mrh fvw of x) & (~(l,l~=~(m~l)=l)]], and T,,=(xf(0,1)01(3m;z2~X(ft(x)=I,(x)= m) 4%(there exists exizcr& one 1 in the first row of x) 8~ gj(l 2)[(5,(x)= I,(x)- m) & (there exists exactly one 1 in the mth row of x) & aj(l
that there is a DTRT~(~(rn~~ N accepting TEc(TFR)* and s is the nwnber of states of the finite ctlntrol and r is the number of storage-tape symbols. For
216
KATSUSHI
INOUE
AND ITSUO TAKANAMI
each m ;I 3, let
V(m)={xE{O,
l}@)~I,(x)=I,(x)
=m fe x((2, I), (m,m)]E{O}(2)).
For each x in V(m), let conf (x) be the configuration of M just after the input head left the first row of x. Then the following proposition must hold. PROPOSITION 5.3. For any two different tupes x,y E V(m), conf(x)fconf(y). [For otherwise, suppose that conf(x) = conf( y). Consider two tapes z, t’ with m rows and m columns satisfying the following (suppose that x(l,j)#y(l,j) and x(1,&= 1 and y(lj)=O): (i) z](l, l), (1,m)l=-W 9, U,m)l and W, MLm)l=yNl, (ii) z[(2,1), (m-1,m)]E{0}(2); (iii) z(mj)= 1 and t(m,r)=O for each r (1
I),
11,(WI;
(mm)1= 42,1), Cm,41.
Clearly, z is in TtR (and thus in Tfi’), and so z is accepted by M. Since conf(x)=conf(y), it follows that z’ must be also accepted by M. This contradicts the fact that zf is not in TaC (and thus not in TFR).] Clearly, I V(m)/ = 2”, c(m)
where c(m) is the number of possible configurations of M just after the input head left the first rows of tapes in V(m). Since lim,,,[l(m)/m] =O, we have c m or ar e m. Therefore, it follows that for large m there must be IV(m)l> ( )f 1 g two different tapes x,y E V(m) such that conf(x)=conf(y). This contradicts Proposition 5.3, and thus parts (2) and (3) of the lemma hold. l LEMMA5.4. Let L(m) be the function described in urns 5.3, and let Ti2 = {x f (0, 1,2)(‘)1(3m > 2)[(f,(x) = I,(x) = m) & aj(l
where 6 is the projection obtained by extendl} [h(O)=O, h(l)=
1, h(2)= 11.
Proof. It is obvious that part (1) of the lemma holds. From the fact that K( Ti,) = jrgRR(where T9 is the set described in Lemma 5.3) and from Lemma 5.3(2), it follows that part (2) of the lemma holds.
217
TURING MACHINES From Lemmas 5.3 and 5.4, we can get the following theorem.
THEOREM5.6. Let L(m) : N-+R be a function such that lim,,,,, [L(m)/m] = 0. Then lZ![DTRTM”(L(m))] is not closed under row rejlection, row and column cycIic closures, or projection.
From Theorems 5.4 and 5.6, we can get the following corollary. COROLLARY 5.2. (I) CfTR2-DA”] is not closed under rotation, row reflection, row and column cyclic cfosures, or projection. (2) C[TR2-NA”] is not closed under rotation. The proof of the following theorem is straightforward, but very tedious, and so the proof is omitted here. THEOREM5.7.
(1) QTRTM$(L(m))] is closed under row reJection and row and column cyclic closures for any L(m) a logm (m > 1). (2) QTRTM”(L(m))] is closed under projection for any L(m) > m (m z 1). It is unknown whether or not ~[TRTM=(L(m~)] is closed under row reflection or row and column cyclic closures for any function L(m) such that lim,_,,[L(m)/log m] = 0, and it is also unknown whether or not ~~TRTM5(L(m))] is closed under projection for any function L(m) such that lim,,,[ L(m)/m] = 0. 6.
UNRECOGNIZABILITY
OF CONNECTED PICTURES
It is unknown [7] if a 2-DA (or 2-NA) can accept the set of connected pictures. In this section, we show that any nondeterministic three-way twodimensional Turing machine which operates in storage space of order lower than the square root of the input sidelength cannot accept the set of connected pictures. (See [IO] for the formal definition of a connected picture.) Let T, be the set of all the square connected pictures. THEOREM6. I. Let L(m) : N-+ R be a function such that
Then T, @ QTRTM*(L(m))]. Proof. Suppose that there is a TRTMs(L(m)) M accepting TC, and s is the number of states of the finite control and t is the number of storage-tape
KATSUSHI INOUE AND ITSUO TAKANAMI
218
symbols. For each m > 1, let v(m)={XE{O,l}(~)]I,(x)=1~(X)=m(m+l) & Vi(1
xK3,1), (4(x),
M-q)1E {1>‘2’I.
As is easily seen, each tape in V(m) is in Tc, and so it is accepted by M. For each x in V(m), let conf(x) be the set of configurations of M just after the point, in the accepting computations on x, where the input head left the first row of x. Then the following proposition must hold. PROPOSITION 6.1. For any two different tapes x,y E V(m),
[For otherwise, suppose that conf(x) n conf(y) #0 and u E conf(x) II conf(y). It is obvious that if, starting with this configuration (I, the input head proceeds to read the [(2, l), (I,(x),Z2(x))]-segment of x, M could enter an accepting state. Therefore, by assumption, it follows that the tape z satisfying the following two conditions must be also accepted by M: (i) z[(l, I), (l,f2(z))] =yNl, 11,(lJ2(rNI; (3 W,
1X (4(z), ~2(4)1= xK2, l), (Mx), Mx))l. This con-
tradicts the fact that z is not in T,.] Clearly, 1V(m)1 = mm. Let c(m) be the number of possible configurations of M just after the input head left the first rows of tapes in V(m). Then
Since lim,_,,[L(m)/V% ]=0 (see th e condition of the theorem), it follows that limm_,m[L(m(m + l))/ J/m ]=O. From this, we have
k% since log] V(m)] = mlogm > j/m
-fdm(m+ ‘11=o log]V(m)]
’
(6.9
for large 112.By using (6.1), we have
TURING MACHINES
219
and thus 1V(m)1 >c(m) for large m. Therefore, it follows that for large m there must be different tapes X,_YEV(m) such that conf(x)nconf(y)#0. This contradicts Proposition 6.1, and thus the theorem holds. H COROLLARY
6.1. T, @ C[TR2NA”].
It is still unknown whether or not T, is accepted by some 2-NA”. 7. CONCLUSIONS We conclude this paper by giving several open problems. (1) Does c[TRTM’(m’)] properly contain e[DTRTM(m2)]? (It will be obvious that this problem is closely concerned with the problem of whether the class of sets accepted by nondeterministic linear bounded automata properly contains the class of sets accepted by deterministic linear bounded automata [4lJ (2) Is e[DTRTM”(L(m))] closed under complementation for any L(m) such that lim,,,[l(m)/logm]=O? (3) Is E[TRTM”(m’)] closed under complementation? (If C[TRTMs(m2)] were not closed under complementation, then QTRTM”(m2)] would properly contain l?[DTRTM”(m2)].) (4) Is C[TRTM”(L(m))] closed under row reflection or row and column cyclic closures, for any L(m) such that lim,,,[l(m)/logm]=O? (5) Is e[TRTM”(L(m))] closed under projection for any L(m) such that limm_J L(m)/m] = O? The authors would like to thank Professor A. Rosenfeld for giving them the motivationfor this paper. They would also like to thank Professors N. Honda and T. Fukumura of Nagoya University; Y. Inagaki of Me University; and A. Nakamura, N. Yoshida, and T. Ae of Hiroshima University for their hearty encouragement.
REFERENCES 1. K. Morita, H. Umeo, and K. Sugata, Computational complexity of L(m,n) tape-bounded two-dimensional tape Turing machines, IECE of Japan Trans. (D), Nov. 1977, p. 982. 2. K. Inoue and I. Takanami, A note on closure properties of the classes of sets accepted by tape-bounded two-dimensional Turing machines, Infonnution Sci., 15: 143-158 (1978). 3. K. Inoue and I. Takanami, Cyclic closure properties of automata on a two-dimensional tape, Information Sci., 15229-242 (1978). 4. J. D. Hopcroft and J. D. UUman, Formal Languages and Their Relation to Aufomata, Addison-Wesley, Reading, Mass., 1969.
KATSUSHI INOUE AND ITSUO TAKANAMI
220
5. A. Rosenfeld, Sequential and parallel picture acceptors, TR-613, AFOSK-77-3271, Computer Science Te&nical Report Series, University of Maryland, College Park, Maryland, Dec. 1977. 6. G. Siromoney, R. Siromoney, and K. Krithivasan, Picture languages with array rewriting rules, Information and Control 22:447 (1973). 7. M. Blum and C. Hewitt, Automata on a two-dimensional tape, in IEEE Symposium on Switching and Automata Theory, 1967, pp. 155-160. 8. K. Inoue and A, Nakamura, Some properties of two-dimensional on-line tessellation acceptors, Znfor~tion Sci. 13:95-121 (1977). 9. K. Inoue and I. Takanami, Closure properties of three-way and four-way tape-bounded two-dimensional Turing machines, Znformation Sci., to appear. 10. S. M. Selkow, One-pass complexity of digital picture properties, J. Assoc. Comput. Ma& 19(2):283 (Apr. 1972). Recekd
August 1978