On inclusion problem for deterministic multitape automata

On inclusion problem for deterministic multitape automata

1 I, number 3 Vahw INDORMATION PROCESSING LETTERS 18 November 1980 ONllNCCUSlONPROBLEMFBRDETERMINISTICMUkTITAPEAUTOMATA E.B. KTNPER Compuri;.,g C...

368KB Sizes 2 Downloads 87 Views

1 I, number 3

Vahw

INDORMATION PROCESSING LETTERS

18 November 1980

ONllNCCUSlONPROBLEMFBRDETERMINISTICMUkTITAPEAUTOMATA E.B. KTNPER Compuri;.,g

Center, hvian State University,Riga, LatviairS.S.R., U.S.S.R.

Rcccivcd 13 March 1980

Slultitape automata, inclusion problem, decidability

It is well known (and easily can be proved), that the inclusion problem for deterministic muiiitape ~~utomatais undecidable. The aim of this paper is to define a natural class of n-tape automata with decidable inclusisn problem. Definition 1. One-way n-tape automaton over the alphabeth Z: is a system 9’2 = (Q, M, qo, F, Co, Cr, .... C’,). where (a) (0, M, qe, F) is a finite automaton: i.e. Q is the s:t of states, q. is the initial state, M is the transition rImction defined on Q X (r: u (4)) (# is a special symbcrlto indicate the end of the word on a tape), F is the set of accepting states; (b) Q = lJ$, Ci, i # j * Cj n Cj * 8 (informally, if q E Ci, then only the ith head is moving at q). An n-tuple x = (xl, ... . x,), where xi E Z*, 1G i G n. is acceptable by the automaton c);Iziff 5% reaches some q E F having read all the words xl#, xz#, ....

definiticn of acceptability differs a little from the definition in [ I ] (see [3 I). Let L(‘M ) be the set of all n-twples of words accepted by VZ . The inclusion problem for two automata 9Z 1 and 3112 is to decide whether L(3tI r) C_ T.-P-&). We will define a class of n-tape automata with decidabie inclusion problem. In order to describe this class a diagram D(m) of a special type called the generalized di,lgrararwill be associated with every n-tape automaton Cm as follows. Our

144

The nodes of D(m) are the states of % . Let ith head (i E 11, .. .. n}) be moving at the state qo. Let ql, .... qk be states such that (a) they are reachable from q. by moving only the ifh head, (b) the ifh head is not moving at G E {qr , .... qk} (e.g. if a jth head is moving at Q, then j # i). Evidently, the set L(r) of all words transferring q. to qr by moving only the ith head is regular. Let a, be a regular expression corresponding to L(r). We draw an arc from q. to each node qr, r = 1,2, .... k. The arc (qo, Q) is labeled by the pair (i, a,). Then in a similar way we draw arcs from ql, q2, .. . . qk (if a jth head is moving at Q, then arcs from % are labeled by pairs of type (j, a)) and so on. Since the set Q is finite we obtain a finite diagram. Such a diagram will be called a generalized diagram. If there are no loops in the generalized diagram of the automaton -%, then for all input n-tuples this automaton changes heads only finitely often. The inclusion problem for such automata is easily decidable. But if there are loops in the generalized diagrams, the inclusion problem becomes considerably more difficult. Our result is that the inclusion problem is decidable for automata with one loop in generalized diagrams. Hence the equivalence problem is decidable for such automata. ? ‘I&problem is a well-known open problem for deterministic n-tape (n > 3) automata in the general case. Let T be the class of all n-tape automata 3n with at most one loop in generalized diagrams D(m).

Volume 11, number 3

INFORMATIONPROCESSING LETTERS

Theorem. The inclusion problem is decidable for ntape automata in the class T.

L n L”(“)

18 Novcmtcr 1980

c L(W)

(2)

for each SQ and iii(sQ). The inclusion (1) can be checked easily since ftlc right-hand side of (i ) is the finite union of Cartesian

Sketch of proof. There are two main parts in our proof. The first part is:

regular languages. The basic difficulty is to check (2). Let q E Ci for some i. We check (2) by induction for all srblanguages products of

Lemma 1. The inclusion problem L C_L( 9X) is decidable for Cartesian products L of n regular languages and automata VZ E T. The main idea of the proof of Lemma 1 is the following. One can regard finite paths in the diagram D(m) which start at the initial state, finish at some accepting state q and go around the loop a few times. be any fixed set of paths Let d = {AmIm=o,l,... in D(Cm), where all A, E SQhave the same entry to the loop, the same exit, say Q, the same initial fragment from q. to the entry and the same final fragment after q, and each A, goes around the loop exactly m times. It is evident there exists only a finite number of such sets d for given 3n . We define the language Lm(sQ) for any path A E SQgoing around the loop m times as follows. Let L(a) be the language defined by the regular expression a. Then, Lrn(34) = (L’,(L’,‘)“L;“, L;(L;)m LY, . ... L;(L;)mL’& where, for any; E {1,2, .. . . n), LI is concatenation. of languages L(a) corresponding to all arcs on A0 with labels (i, a) from the initial state to q; L: is concatenation of languages L(a) corre sponding to arcs with labels (i, a) on the path going around the loop only once from 5 to q; Ly is concatenation of languages L(a) corresponding to arcs with labels (i, a) on the path from q to q (without going around the loop). Evidently, L(Y ) = lid (UmL”(sQ)). It is not difficult to divide the set {m 1L n Lm(sQ) # 0) into a finite number of arithmetic progressions. Let i?i(d ) = m. tkml,k=O,l ,..., be one of such progressions. We associate the Cartesian product L”@ ) = (L’l(L’l)mo((Lq)m*)*L’I’, ....

with iii(d ). Now the main idea of the algorithm is to check two inclusions concerning these languages: L c_ Ud (UZ@q)LG@Q),

(1)

L”(“Qj*‘(k)= (L;(L;‘)“‘o((L;)ml)*L~, LfCLi)

mo+kml $,

.,.,



... ,

L~(L~)“O((L::)ml)*L::)),

k = 0, 1, . .. .

of L”(’ ). So Lemma 1 is proved. Now using Lemma I we have to check tl:e inclu-

sion L(Cm1) 2 L(cni& We regard any path A in D(% 1) from the state q. to some fixed q E F. Let L(A) be the Iznguage defined by A; more precisely, L(A) is the Cartesian product of languages Li(A), where each Li(A) is ahe concatenation of languages i(a) corresponding to labels (i, a) on this path. II; is easy to see that L(m 1) E L(Cm *) iff L(A) S l,(Cm2) for alj A with ends in F(W 1). So it suffices to check the iIldUShI L(f&) E L(% 2) for all paths Ak Ed for any fixed SQ. The second main part of our algorithm is the following: Lemma 2. A number k. such that

can be effectively found. Again we only outline the proof. For each k we regard the initial fragnient & of Ak from q. to the exit ?i fr. m the loop. Our first aim is to describe all paths B iI, D(W 2) such that L(B) I-JL(&) f 8. On this stage we consider paths of a more genera! type. We define any path of this type as follows. The set of all arcs of the type (i, a) on the path from the beginning of the path to some node q is called an it” subpath with the end q. ‘2.: n-tuple of such ends for any path B is called the final set of the path. (B.-q) dcn~tcs the path B with the final set 4. Elements qi of ~II>’ final set ?j = (qI , q2, . . . . qn) can be very far from one another on the path (B,?). However, there exists a convenient description of all final setsq of path (B-q) for all &. This description can be obtained in form of a finite set of linear forms.

Volume 11, number 3

INFORMATION PROCESSING LETTERS

Given any path (B,_?$such that L(B) n ,L&J # $9, we can regard extensions C of this path such that L.(C).a L(&) f (3.In other words, we have to regard p’zths C’(q)in lI(% 2) froim final sets 4 such that L(C@)) pi L(A) # 0, where A is the final fragment of any Ak from the exit of the loop to q. Using the notion of the pat:] C(q) one can understand in a natural way the sense of the following statement: ‘audomaton ‘& is working on the n-tuple STfrom the set -q = (91. q2r .‘) qn)‘* Now we divide the set of all final sets into a finite number of equivalence classes with the following main

(L(B,Q) C--I L&)

18 November 1980 # 8) * 3 (B’J’)

((L(B’, 9’) n L&J

3m G b

+ @ & fi’ is equivalent to q)).

Using linear forms describing final sets of (B,q) for all lik, we obtain a finite set of finite systems of linear inequalities. Each such a system is equivalent to some integer programming problem. It is well known [2] that there exists an algorithm solving such systems. This algorithm completes the proof of Lemma 2.

l

- -I Rapefly A. Let q, q be equivalent final sets. For each Z E L(A) there exists (and effectively can be found) an n-tuple c(Z) such that ‘32 2 reaches the same state working on X from q as working on a(x) from -I 4=

have to find a number kO such that for every (R, Zj)and for every k Mow WI

146

References [ 1 ] M.O. Rabin and D. Scott, Finite automata and their decision problems, IBM J. Res. Develop. 3 (2) (1959) 114125. [ 21 T.C. Hu, Integer Programming and Network Flows (Addison-Wesley, Reading, MA, 1969). [3] B.G. Mirkin, On a theory of multitape automata, Kibcrnetika 5 (1966) 12-l 8 (in Russian).