Finite Automata and Their Decision Problems

About this paperTiếng Việt中文日本語beside Tiếng Việtbeside 中文beside 日本語

This paper is under a licence that does not allow it to be reproduced, so what is here is its front matter and a short abstract. Read it at the publisher's page.

Abstract: Finite automata are considered in this paper as instruments for classifying finite tapes. Each one-tape automaton defines a set of tapes, a two-tape automaton defines a set of pairs of tapes, et cetera. The structure of the defined sets is studied. Various generalizations of the notion of an automaton are introduced and their relation to the classical automata is determined. Some decision problems concerning automata are shown to be solvable by effective algorithms; others turn out to be unsolvable by algorithms.

Introduction

Turing machines are widely considered to be the abstract prototype of digital computers; workers in the field, however, have felt more and more that the notion of a Turing machine is too general to serve as an accurate model of actual computers. It is well known that even for simple calculations it is impossible to give an aa priori upper bound on the amount of tape a Turing machine will need for any given computation. It is precisely this feature that renders Turing’s concept unrealistic.

In the last few years the idea of a finite automaton has appeared in the literature. These are machines having only a finite number of internal states that can be used for memory and computation. The restriction of finiteness appears to give a better approximation to the idea of a physical machine. Of course, such machines cannot do as much as Turing machines, but the advantage of being able to compute an arbitrary general recursive function is questionable, since very few of these functions come up in practical applications.

Many equivalent forms of the idea of finite automata have been published. One of the first of these was the definition of “nerve-nets” given by McCulloch and Pitts.3 The theory of nerve-nets has been developed by authors too numerous to mention. We have been particularly influenced, however, by the work of S. C. Kleene2 who proved an important theorem characterizing the possible action of such devices (this is the notion of “regular event” in Kleene’s terminology). J. R. Myhill, in some unpublished work, has given a new treatment of Kleene’s results and this has been the actual point of departure for the investigations presented in this report. We have not, however, adopted Myhill’s use of directed graphs as a method of viewing automata but have retained throughout a machine-like formalism that permits direct comparison with Turing machines. A neat form of the definition of automata has been used by Burks and Wang1 and by E. F. Moore,4 and our point of view is closer to theirs than it is to the formalism of nerve-nets. However, we have adopted an even simpler form of the definition by doing away with a complicated output function and having our machines simply give “yes” or “no” answers. This was also used by Myhill, but our generalizations to the “nondeterministic,” “two-way,” and “many-tape” machines seem to be new.

In Sections 1-6 the definition of the one-tape, one-way automaton is given and its theory fully developed. These machines are considered as “black boxes” having only a finite number of internal states and reacting to their environment in a deterministic fashion.

We center our discussions around the application of automata as devices for defining sets of tapes by giving “yes” or “no” answers to individual tapes fed into them. To each automaton there corresponds the set of those tapes “accepted” by the automaton; such sets will be referred to as definable sets. The structure of these sets of tapes, the various operations which we can perform on these sets, and the relationships between automata and defined sets are the broad topics of this paper.

After defining and explaining the basic notions we give, continuing work by Nerode,5 Myhill, and Shepherdson,7 an intrinsic mathematical characterization of definable sets. This characterization turns out to be a useful tool for both proving that certain sets are definable by an automaton and for proving that certain other sets are not.

In Section 4 we discuss decision problems concerning automata. We consider the three problems of deciding whether an automaton accepts any tapes, whether it accepts an infinite number of different tapes, and whether two automata accept precisely the same tapes. All three problems are shown to be solvable by effective algorithms.

*Now at the Department of Mathematics, Hebrew University in Jerusalem. †Now at the Department of Mathematics, University of Chicago. ‡The bulk of this work was done while the authors were associated with the IBM Research Center during the summer of 1957.

In Chapter II we consider possible generalizations of the notion of an automaton. A nondeterministic automaton has, at each stage of its operation, several choices of possible actions. This versatility enables us to construct very powerful automata using only a small number of internal states. Nondeterministic automata, however, turn out to be equivalent to the usual automata. This fact is utilized for showing quickly that certain sets are definable by automata.

Using nondeterministic automata, a previously given construction of the direct product of automata (Definition 7), and the mathematical characterization of definable sets, we give short proofs for various well-known closure properties of the class of definable sets (e.g., the definable sets form a Boolean algebra). Furthermore we include, for the sake of completeness, a formulation of Kleene's theorem about regular events.

In trying to define automata which are closer to the ideal of the Turing machine, while preserving the important feature of using only a preassigned amount of tape, another generalization suggests itself. We relax the condition that the automaton always move in one direction and allow the machine to travel back and forth. In this way we arrive at the idea of a two-way automaton. In Section 7 we consider the problem of comparing one-way with two-way automata, a study that can be construed as an investigation into the nature of memory of finite automata. A one-way machine can be imagined as having simply a keyboard representing the symbols of the alphabet and as having the sequence from the tape fed in by successively punching the keys. Thus no permanent record of the tape is required for the operation of the machine. A two-way automaton, on the other hand, does need a permanent, actual tape on which it can run back and forth in trying to compute the answer. Surprisingly enough, it turns out that despite the ability of backwards reference, two-way automata are no more powerful than one-way automata. In terms of machine memory this means that all information relevant to a computation which an automaton can gather by backward reference can always be handled by a finite memory in a one-way machine.

In Chapter III we study multitape machines. These automata can read symbols on several different tapes, and we adopt the convention that a machine will read for a while on one tape, then change control and read on another tape, and so on. Thus, with a two-tape machine, a set of pairs of tapes is defined, or we can say a binary relation between tapes is defined. Using again the powerful tool of nondeterministic automata, we establish a relationship between two-tape automata and one-tape automata. Namely, the domain and range of a relation defined by a two-tape automaton are sets of tapes definable by one-tape automata. From this follows the fact that, unlike the sets definable by one-tape automata, the relations definable by two-tape automata do not form a Boolean algebra. The problems whether a two-tape automaton accepts any pair of tapes and whether it accepts an infinite number of pairs are shown to be solvable by effective algorithms.

We conclude with a brief discussion of two-way, two-tape automata. Here even the problem whether an automaton accepts any tapes at all is not solvable by an effective algorithm. Furthermore a reduction of two-way automata to one-way automata is not possible. All in all, there is a marked difference between the properties of one-tape automata and those of two-tape automata. The study of the latter is yet far from completion.

Chapter I. One-tape, one-way automata

• 1. The intuitive model and basic definitions

An automaton will be considered as a black box of which questions can be asked and from which a "yes" or "no" answer is obtained. The number of questions that can be asked will be infinite, and for simplicity a question is interpreted as any arbitrary finite sequence of symbols from a finite alphabet given in advance. An easy way to imagine the act of asking the question of the automaton is to think of the black box as having the separate symbols on a typewriter keyboard. Then the machine is turned on and the question is typed in; after an "end of question" button is pressed, a light indicates a "yes" or "no" answer. Other good images of how the automaton could appear physically would use punched cards. Suppose that we punch just one symbol or code number for a symbol to a card; then a question is simply a stack of cards. The automaton is asked a question by having the stack read in a card at a time in the usual way.

For the purposes of this paper, we shall not use either of the above images but rather think of the questions as given on one-dimensional tapes. The machine will be endowed with a reading head which can read one square of the tape (i.e., one symbol) at a time, and then it can advance the tape one unit and read, say, the next square to the right. We assume the machine stops when it runs out of tape. So much for the external character of an automaton.

The internal workings of an automaton will not be analyzed too deeply. We are not concerned with how the machine is built but with what it can do. The definition of the internal structure must be general enough to cover all conceivable machines, but it need not involve itself with problems of circuitry. The simple method of obtaining generality without unnecessary detail is to use the concept of internal states. No matter how many wires or tubes or relays the machine contains, its operation is determined by stable states of the machine at discrete time intervals. An actual existing machine may have billions of such internal states, but the number is not important from the theoretical standpoint—only the fact that it is finite.

As a further simplifying device, we need not consider all the intermediate states that the machine passes through but only those directly preceding the reading of a symbol. That is, the machine first reads a symbol or square on the tape, then it may pass through several states before it is ready to read the next symbol. To be able to mimic the action of the automaton, we need not remember all these intermediate states but only the last one it goes into before it reads the next square. In fact, if we make a table of all the transitions from a state and a symbol to a new state, then the whole action of the machine is essentially described.

Finally, to get the answer from the machine, we need only distinguish between those states in which the "yes" light is on and those states in which the "no" light is on when the end of the question is reached. Again, for simplicity, it is assumed that all states are in one category or the other but not in both. Thus the whole machine is described when a class of designated states corresponding to the "yes" answers is given. It remains now to give a precise mathematical form to these ideas.

First a finite alphabet Σ\Sigma is given and fixed for the rest of the discussion. The actual number of symbols in the alphabet is not important. It is only important that all the automata considered use the same alphabet so that different machines can be compared. For illustration we shall often think of Σ\Sigma as containing only the two symbols 0 and 1. By a tape we shall understand any finite sequence of symbols from Σ\Sigma. We also include the empty tape with no symbols to be denoted by Λ\Lambda. The class of all tapes is denoted by TT. If xx and yy are tapes in TT, then xyxy denotes the tape obtained by splicing xx and yy together or by juxtaposing or concatenating the two sequences. In other words, if

x=σ0σ1…σn−1x = \sigma_0 \sigma_1 \ldots \sigma_{n-1}

and

y=τ0τ1…τn−1,y = \tau_0 \tau_1 \ldots \tau_{n-1},

then

xy=σ0σ1…σn−1τ0τ1…τn−1,xy = \sigma_0 \sigma_1 \ldots \sigma_{n-1} \tau_0 \tau_1 \ldots \tau_{n-1},

where the σ\sigma's and τ\tau's are in Σ\Sigma. We assume as obvious the two laws

Λx=xΛ=x,\Lambda x = x \Lambda = x,

and

x(yz)=(xy)z,x(yz) = (xy)z,

for all x,y,zx, y, z in TT. In mathematical terminology, TT together with the operation of juxtaposition forms the free semigroup (with unit) generated by Σ\Sigma.

We shall often have occasion to cut tapes into pieces. For example, let

x=σ0σ1…σn−1;x = \sigma_0 \sigma_1 \ldots \sigma_{n-1};

the σ\sigma's are in Σ\Sigma and nn is referred to as the length of the tape xx. We adopt the following notation

kxl=σkσk+1…σl−1,_k x_l = \sigma_k \sigma_{k+1} \ldots \sigma_{l-1},

where k≤l≤nk \leq l \leq n. In other words kxl_k x_l is a section of xx running from the (k+1)st(k+1)^{st} symbol of xx through the lthl^{th} symbol. Clearly, the length of kxl_k x_l is l−kl - k. We will agree that if k=lk = l, then kxl=Λ_k x_l = \Lambda, the tape of length 0. As a useful property of the notation, we have

x=0xk kxn,x = _0 x_k \ _k x_n,

where k≤nk \leq n, or more generally

kxm=kxl lxm,_k x_m = _k x_l \ _l x_m,

where k≤l≤m≤nk \leq l \leq m \leq n.

We shall refer to such tapes as 0xk_0 x_k as the initial section or initial portion of xx of length kk.

The obvious notation xnx^n for xxx…xxxx \ldots x multiplied together nn times will also be used with the convention that x0=Λx^0 = \Lambda.

Having explained all the notations for the tapes that will be fed into the machines, we turn now to the formal definition of an automaton.

Definition 1. A (finite) automaton over the alphabet Σ\Sigma is a system A=(S,M,s0,F)\mathfrak{A} = (S, M, s_0, F), where SS is a finite non-empty set (the internal states of A\mathfrak{A}), MM is a function defined on the Cartesian product S×ΣS \times \Sigma of all pairs of states and symbols with values in SS (the table of transitions or moves of A\mathfrak{A}), s0s_0 is an element of SS (the initial state of A\mathfrak{A}), and FF is a subset of SS (the designated final states of A\mathfrak{A}).

Let A\mathfrak{A} be an automaton. First of all the function MM can be extended from S×ΣS \times \Sigma to S×TS \times T in a very natural way by a definition by recursion as follows:

M(s,Λ)=s, for s in S;M(s, \Lambda) = s, \text{ for } s \text{ in } S;
M(s,xσ)=M(M(s,x),σ), for s in S,x in T, and σ in Σ.M(s, x \sigma) = M(M(s, x), \sigma), \text{ for } s \text{ in } S, x \text{ in } T, \text{ and } \sigma \text{ in } \Sigma.

The meaning of M(s,x)M(s, x) is very simple: it is that state of the machine obtained by beginning in state s and reading through the whole tape x symbol by symbol, changing states according to the given table of moves. It should be at once apparent from the definition of the extension of MM just given that we have the following useful property:

M(s,xy)=M(M(s,x),y), for all s in S and x,y in T.M(s, xy) = M(M(s, x), y), \text{ for all } s \text{ in } S \text{ and } x, y \text{ in } T.

We may now easily define the set of those tapes which cause the automaton to give a "yes" answer.

Definition 2. The set of tapes accepted or defined by the automaton A\mathfrak{A}, in symbols T(A)T(\mathfrak{A}), is the collection of all tapes xx in TT such that M(s0,x)M(s_0, x) is in FF.

Definition 3. The class of all definable sets of tapes, in symbols T\mathcal{T}, is the collection of all sets of the form T(A)T(\mathfrak{A}) for some automaton A\mathfrak{A}.

The meaning of acceptance can be made clearer by a diagram. Let x=σ0…σn−1x = \sigma_0 \ldots \sigma_{n-1}. For each k≤nk \leq n, let

sk=M(s0,0xk),s_k = M(s_0, _0 x_k),

so that for k>0k > 0 we have

sk=M(sk−1,σk−1).s_k = M(s_{k-1}, \sigma_{k-1}).

The condition that xx be in T(A)T(\mathfrak{A}) is that sns_n be in FF. Each sks_k is the state of the machine A\mathfrak{A} after reaching the k\textsuperscript{th} symbol in the tape xx. Thus if we write down the following diagram:

σ0σ1σ2⋯σn−1s0s1s2s3…sn−1sn,\begin{array}{cccccc} \sigma_0 & \sigma_1 & \sigma_2 & \cdots & \sigma_{n-1} \\ s_0 & s_1 & s_2 & s_3 \ldots s_{n-1} & s_n, \end{array}

we have a complete picture of the motion of the machine A\mathfrak{A} across the tape xx. It is very important to notice in this picture that there is exactly one more internal state than there are symbols on the tape, a fact that will be used several times in Section 4.

• 2. A mathematical characterization of definable sets

An automaton can be a very complicated object, and it is not clear exactly how complicated the sets definable by automata can become. In order to understand the nature of these definable sets, we will develop in this section a mathematically simple and completely intrinsic characterization of these sets, which shows exactly the effect of considering machines with only a finite number of internal states. This “finiteness” condition is certainly the main feature of our study.

Actually two different characterizations will be given, but they share a common feature of involving equivalence relations over the set TT of all tapes. The reader is assumed familiar with the notion of an equivalence relation and equivalence classes.

Definition 4. An equivalence relation R over the set T of tapes is right invariant if whenever xRy, then xzRyz for all z in T.

Clearly there is an analogous definition of left-invariant equivalence relations.

Definition 5. An equivalence relation over the set T is a congruence relation if it is both right and left invariant.

If RR is a congruence relation then the formulas xRzxRz and yRwyRw always imply xyRzwxyRzw. In consequence, if [x] is the equivalence class containing x, and [y] is the equivalence class containing y, then we can define unambiguously the product of the two equivalence classes by the equation

[x][y]=[xy].[x][y]=[xy].

In mathematical terms, the set of equivalence classes is said to be the quotient semigroup of TT under the congruence relation RR and is called a homomorphic image of TT. There are many distinct homomorphic images of TT, but we shall be most interested in those that are finite. Somewhat more generally we shall make use of equivalence relations satisfying the following definition.

Definition 6. An equivalence relation over T is of finite index if there are only finitely many equivalence classes under the relation.

With these definitions, we may now state the first result on characterizing definable sets. This theorem is due to J. R. Myhill and is published with his kind permission.

Theorem 1. (Myhill) Let U be a set of tapes. The following three conditions are equivalent:

(i) U is in T\mathcal{T};

(ii) U is the union of some of the equivalence classes of a congruence relation over T of finite index;

(iii) the explicit congruence relation ≡\equiv defined by the condition that for all x,y in T, x≡yx \equiv y if and only if for all z,w in T, whenever zxw is in U, then zyw is in U, and conversely, is a congruence relation of finite index.

Proof: Assume (i) and in particular that U=T(A)U = T(\mathfrak{A}) for a suitable automaton A\mathfrak{A}. Define a relation RR by the condition that xRyxRy if and only if M(s,x)=M(s,y)M(s,x) = M(s,y) for all s in S. Clearly RR is an equivalence relation, but it is also a congruence relation. For assume that xRyxRy and zz is any tape in TT. Then

M(s,xz)=M(M(s,x),z)=M(M(s,y),z)=M(s,yz),for all s in S.\begin{align*} M(s,xz) &= M(M(s,x),z) \\ &= M(M(s,y),z) \\ &= M(s,yz), \quad \text{for all } s \text{ in } S. \end{align*}

Thus RR is right invariant. Likewise

M(s,zx)=M(M(s,z),x)=M(M(s,z),y)=M(s,zy),for all s in S,\begin{align*} M(s,zx) &= M(M(s,z),x) \\ &= M(M(s,z),y) \\ &= M(s,zy), \quad \text{for all } s \text{ in } S, \end{align*}

and RR is shown to be left invariant.

That RR is of finite index is a consequence of the fact that if xx is a fixed tape and rr is the number of internal states of A\mathfrak{A}, then the expression M(s,x)M(s,x) can assume at most rr different values. Thus the number of equivalence classes is at most rrr^r.

Finally if xx is in T(A)T(\mathfrak{A}) and xRyxRy, then M(s0,x)=M(s0,y)M(s_0,x) = M(s_0,y) so that yy is in T(A)T(\mathfrak{A}) also. This remark shows that U=T(A)U = T(\mathfrak{A}) is in fact the union of the equivalence class under RR of those tapes in UU. We have thus shown that (i) implies (ii).

Assume next that statement (ii) holds, and let RR now stand for any congruence relation satisfying the conditions mentioned in (ii). Consider the specific relation ≡\equiv defined in (iii) in terms of UU. Let xx and yy be any tapes such that xRyxRy. Suppose that zxwzxw is in UU. Now RR is a congruence relation, so that zxwRzywzxwRzyw. On the other hand UU is a union of equivalence classes. Thus zywzyw must also be in UU. This argument actually shows that if xRyxRy, then x≡yx \equiv y. In other words, ≡\equiv is a relation making fewer distinctions than the relation RR. That ≡\equiv is a congruence relation is a trivial consequence of its definition, so if RR is of finite index, then ≡\equiv must necessarily be of finite index too. Hence, (ii) implies (iii).

Finally, assume that (iii) holds. We must define an automaton A\mathfrak{A} such that U=T(A)U = T(\mathfrak{A}). To this end, let SS be the set of equivalence classes under the congruence relation ≡\equiv. Define the function MM by the formula:

M([x],σ)≡[xσ],M([x],\sigma) \equiv [x\sigma],

where the square brackets indicate the formation of equivalence classes. Notice we need only the fact that ≡\equiv is right invariant to see that the definition of MM is unambiguous. Further, let s0=[Λ]s_0 = [\Lambda], and finally let FF be the set of all [x][x] where xx is in UU. It should be obvious that UU is indeed a union of equivalence classes under ≡\equiv. A simple inductive argument shows that if MM is extended in the way indicated in Section 1 to the set S×TS \times T, then M([x],y)=[xy]M([x],y) = [xy] for all x,yx,y in TT. Thus we see at once that M(s0,x)=M([Λ],x)=[x]M(s_0,x) = M([\Lambda],x) = [x] is in FF if and only if xx is in UU; in other words U=T(A)U = T(\mathfrak{A}), as was to be shown. Hence, (iii) implies (i), and the proof of Theorem 1 is complete.

The main trouble with Theorem 1 is that the number of equivalence classes under the relation ≡\equiv can become very large as is indicated in the proof that (i) implies (ii). To be more economical and to stay closer to the simpler automata defining the set UU, one should use only right-invariant equivalence relations rather than demanding congruence relations. The following theorem is formulated in an exactly parallel fashion to Theorem 1 and is essentially a simplification of a theorem by A. Nerode,5^5 who used a somewhat more involved notion of automaton than that adopted here. The principle is very useful and was employed by J. C. Shepherdson7^7 in a proof of the main theorem of Section 7, as is explained there.

Theorem 2. (Nerode) Let UU be a set of tapes. The following three conditions are equivalent:

(i) UU is in T\mathcal{T}; (ii) UU is the union of some of the equivalence classes of a right-invariant equivalence relation over TT of finite index; (iii) the explicit right-invariant equivalence relation EE defined by the condition that for all x,yx, y in TT, xEyxEy if and only if for all zz in TT, whenever xzxz is in UU, then yzyz is in UU, and conversely, is an equivalence relation of finite index.

The proof need not be given in detail because it can be copied almost word for word from the proof of Theorem 1. It should only be mentioned that the relation RR in the proof that (i) implies (ii) has the simpler definition:

xRyxRy if and only if M(s0,x)=M(s0,y)M(s_0, x) = M(s_0, y).

This implies that the number of equivalence classes for RR is at most the number of internal states of A\mathfrak{A}. This remark and an analysis of the full proof leads directly to the following corollary.

Corollary 2.1. If UU is in T\mathcal{T}, then the number of equivalence classes under the relation EE is the least number of internal states of any automaton defining UU.

In other words, the relation EE leads at once to the most economical automaton defining UU. This remark is also due to Nerode.

As a simple application of Theorem 1, we shall show that the set UU of all tapes of the form 0n10n0^n 10^n for n=0,1,2,…n = 0, 1, 2, \ldots is not definable by any automaton. Suppose to the contrary that UU is in T\mathcal{T}. Consider the relation ≡\equiv of Theorem 1 (iii). This relation would have to be of finite index, so that for some integers n≠mn \neq m we would have 0n≡0m0^n \equiv 0^m. It follows at once that 0n10m≡0n10n0^n 10^m \equiv 0^n 10^n, and hence that 0n10m0^n 10^m is in UU, which is impossible. Thus UU cannot be in T\mathcal{T}.

• 3. Closure properties of the class of definable sets

Using the theorems just given in the preceding section, we can derive very simply some facts about the class T\mathcal{T}. It turns out that T\mathcal{T} can be actually characterized by its closure properties under some natural operations on sets of tapes, but the discussion of this fact will be delayed to Section 6. Sometimes it is easier to use Theorems 1 and 2 and sometimes it is easier to give direct constructions of machines. In this section we shall indicate how the Boolean operations can be done in both ways. First, however, we prove two theorems that seem to be easier by the indirect method.

Theorem 3. If xx is in TT, then {x}\{ x \}, the set consisting only of xx, is in T\mathcal{T}.

Proof: Clearly an automaton can be built which recognizes one and only one tape given in advance; however, Theorem 2 is easier to apply. The relation EE defined in Theorem 2 (iii) in terms of U={x}U = \{ x \} simply means that yEzy Ez if and only if whenever yy and zz are initial segments of the tape xx, then y=zy = z. Thus EE has one equivalence class for each initial segment of xx and one extra equivalence class for all the rest of the tapes. Obviously EE then is of finite index, which completes the proof.

If xx is any tape, then it can be turned end-for-end and written backwards. Let x∗x^* stand for the result of writing xx backwards so that if x=σ0σ1…σn−1x = \sigma_0 \sigma_1 \ldots \sigma_{n-1}, then x∗=σn−1σn−2…σ0x^* = \sigma_{n-1} \sigma_{n-2} \ldots \sigma_0. Clearly we have the rules:

σ∗=σ,for σ in Σ,Λ∗=Λ,x∗∗=x,\begin{align*} \sigma^* &= \sigma, & \text{for } \sigma \text{ in } \Sigma, \\ \Lambda^* &= \Lambda, \\ x^{**} &= x, \end{align*}

and

(xy)∗=y∗x∗.(xy)^* = y^* x^*.

In case UU is any set of tapes, U∗U^* will denote the set of all x∗x^* where xx is in UU.

The motion of an automaton, according to the definitions of Section 1, is always from left to right. Thus from the original definition, the following result is a little surprising.

Theorem 4. If UU is in T\mathcal{T}, then U∗U^* is in T\mathcal{T}.

Proof: The content of the theorem is that if a set of tapes is definable, then so is the set obtained by writing all the defined tapes backwards. The direct construction of a machine defining U∗U^* from a given machine defining UU is rather lengthy, but Theorem 1 makes the result almost obvious. Let ≡\equiv be the relation defined in terms UU from Theorem 1 (iii) and let ≡∗\equiv^* be the analogous relation for U∗U^*. Assume that x≡∗yx \equiv^* y. If zx∗wzx^* w is in UU, then (zx∗w)∗(zx^* w)^* is in U∗U^*. But (zx∗w)∗=w∗xz∗(zx^* w)^* = w^* xz^*. Hence, w∗yz∗w^* yz^* is in U∗U^* also; however, w∗yz∗=(zy∗w)∗w^* yz^* = (zy^* w)^*, and so zy∗wzy^* w is in UU. This shows that x∗≡∗y∗x^* \equiv^* y^*. Since U∗∗=UU^{**} = U, this argument with UU and U∗U^* interchanged is also valid, and we have proved that x≡∗yx \equiv^* y if and only if x∗≡∗y∗x^* \equiv^* y^*, for all x,yx, y in TT. Clearly then, if ≡\equiv is of finite index, then ≡∗\equiv^* must be also of finite index with the same number of equivalence classes, which completes the proof.

Theorem 5. The class T\mathcal{T} is a Boolean algebra of sets.

Proof: That the class T\mathcal{T} is closed under complements is the most obvious fact, even from the original definition. For if U=T(A)U = T(\mathfrak{A}) where A=(S,M,s0,F)\mathfrak{A} = (S, M, s_0, F), then T−U=T(B)T - U = T(\mathfrak{B}), where B=(S,M,s0,S−F)\mathfrak{B} = (S, M, s_0, S - F). One need only prove in addition that T\mathcal{T} is closed under intersections. Suppose that U1U_1 and U2U_2 are in T\mathcal{T}. By Theorem 2, let R1R_1 and R2R_2 be two right-invariant equivalence relations of finite index such that UiU_i is a union of equivalence classes under RiR_i for i=1,2i = 1, 2. Consider the equivalence relation R3=R1∩R2R_3 = R_1 \cap R_2, in other words xR3yxR_3y if and only if xR1yxR_1y and xR2yxR_2y. R3R_3 is, of course, right invariant. Every equivalence class under R3R_3 is an intersection of equivalence classes under R1R_1 and R2R_2. Hence, the number of equivalence classes for R3R_3 is at most the product of the numbers for R1R_1 and R2R_2. We see, then, that R3R_3 is of finite index. Now U1∩U2U_1 \cap U_2 is simply a union of intersections of the two kinds of equivalence classes, so that U1∩U2U_1 \cap U_2 is a union of equivalence classes under R3R_3, which shows that U1∩U2U_1 \cap U_2 is in T\mathcal{T} by Theorem 2. The proof is complete.

Corollary 5.1. The class T\mathcal{T} contains all finite sets of tapes.

This is a direct consequence of Theorems 3 and 5.

The proof of Theorem 5 may seem too abstract. To make it more direct, we show next how to form at once a machine defining the intersection.

Definition 7. Let A=(S,M,s0,F)\mathfrak{A} = (S, M, s_0, F) and B=(T,N,t0,G)\mathfrak{B} = (T, N, t_0, G) be two automata. The direct product A×B\mathfrak{A} \times \mathfrak{B} is that automaton (S×T,M×N,(s0,t0),F×G)(S \times T, M \times N, (s_0, t_0), F \times G) where S×TS \times T and F×GF \times G are the Cartesian products of sets, (s0,t0)(s_0, t_0) is the ordered pair of s0s_0 and t0t_0, and the function M×NM \times N on (S×T)×Σ(S \times T) \times \Sigma is defined by the formula

(M×N)((s,t),σ)=(M(s,σ),N(t,σ))(M \times N)((s, t), \sigma) = (M(s, \sigma), N(t, \sigma))

for all s in S, t in T, and σ\sigma in Σ\Sigma.

Theorem 6. If A\mathfrak{A} and B\mathfrak{B} are automata, then

T(A×B)=T(A)∩T(B).T(\mathfrak{A} \times \mathfrak{B}) = T(\mathfrak{A}) \cap T(\mathfrak{B}).

Proof: An obvious inductive argument shows that for all tapes xx we have (M×N)((s,t),x)=(M(s,x),N(t,x))(M \times N)((s, t), x) = (M(s, x), N(t, x)) for all ss in SS and tt in TT. Now xx is in T(A×B)T(\mathfrak{A} \times \mathfrak{B}) if and only if (M×N)((s0,t0),x)=(M(s0,x),N(t0,x))(M \times N)((s_0, t_0), x) = (M(s_0, x), N(t_0, x)) is in F×GF \times G. This in turn is equivalent to the conjunctions of conditions that M(s0,x)M(s_0, x) is in FF and N(t0,x)N(t_0, x) is in GG; in other words, xx is in T(A)∩T(B)T(\mathfrak{A}) \cap T(\mathfrak{B}), as was to be shown.

• 4. The emptiness problem

Suppose someone gave you an automaton A=(S,M,s0,F)\mathfrak{A} = (S, M, s_0, F) without telling you what it was supposed to do. The gift might turn out to be an elaborate practical joke, and T(A)T(\mathfrak{A}) could very well be empty. Now a person would not want to spend the rest of his life feeding all the infinite number of possible tapes into the machine if all the answers are going to be the same. Thus one would like to know an upper bound on the number of tapes that need be tried to determine whether the machine is of any use. Such an upper bound is supplied by the next theorem.

Theorem 7. Let A\mathfrak{A} be an automaton. Then T(A)T(\mathfrak{A}) is not empty if and only if A\mathfrak{A} accepts some tape of length less than the number of internal states of A\mathfrak{A}.

Proof: We need only establish the implication from left to right. Assume that T(A)T(\mathfrak{A}) is not empty and indeed that xx is a tape in T(A)T(\mathfrak{A}) of minimal length. Let nn be the length of xx and let rr be the number of internal states of A\mathfrak{A}. By way of contradiction, assume that r≤nr \leq n. It follows at once that there must exist integers k<l≤nk < l \leq n such that

M(s0,0xk)=M(s0,0xl),M(s_0, 0^{x_k}) = M(s_0, 0^{x_l}),

where 0xk0^{x_k} and 0xl0^{x_l} are the initial segments of xx of length kk and ll. Consider the tape x′=0xklxnx' = 0^{x_k} l^{x_n} which is shorter than xx. We have

M(s0,x′)=M(s0,0xklxn)=M(M(s0,0xk),lxn)=M(M(s0,0xl),lxn)=M(s0,0xllxn)=M(s0,x)\begin{align*} M(s_0, x') &= M(s_0, 0^{x_k} l^{x_n}) \\ &= M(M(s_0, 0^{x_k}), l^{x_n}) \\ &= M(M(s_0, 0^{x_l}), l^{x_n}) \\ &= M(s_0, 0^{x_l} l^{x_n}) \\ &= M(s_0, x) \end{align*}

because x=0xllxnx = 0^{x_l} l^{x_n}. Hence x′x' must be in T(A)T(\mathfrak{A}) also, which contradicts the minimum conditions on xx and proves that n<rn < r.

Corollary 7.1. Given a finite automaton A\mathfrak{A} there is an effective procedure whereby in a finite number of steps it can be decided whether T(A)T(\mathfrak{A}) is empty.

The corollary is an immediate consequence of the fact that Theorem 7 shows that only a finite number of tapes that need be tried, and any one tape can be run effectively through a machine once the table of moves has been given. It is also possible to give a simple necessary and sufficient condition of a similar nature for T(A)T(\mathfrak{A}) to be infinite. We precede that result by a lemma.

Lemma 8. Let A\mathfrak{A} be an automaton with rr internal states. Let xx be a tape in T(A)T(\mathfrak{A}) of length nn. If r≤nr \leq n, then there exist tapes y,z,wy, z, w such that x=yzw,z≠Λx = yzw, z \neq \Lambda, and all the tapes yzmwyz^m w are in T(A)T(\mathfrak{A}) for m=0,1,2,…m = 0, 1, 2, \ldots.

Proof: As in Theorem 7, there must exist integers k≤l≤nk \leq l \leq n such that

M(s0,0xk)=M(s0,0xl).M(s_0, 0^{x_k}) = M(s_0, 0^{x_l}).

Let y=0xk,z=kxl,w=lxny = 0^{x_k}, z = k^{x_l}, w = l^{x_n}. Since k<lk < l, we see that z≠Λz \neq \Lambda. Clearly x=yzwx = yzw, and yz=0xlyz = 0^{x_l}, hence M(s0,y)=M(s0,yz)M(s_0, y) = M(s_0, yz). It follows then at once by induction that M(s0,y)=M(s0,yzm)M(s_0, y) = M(s_0, yz^m). Whence, we derive

M(s0,x)=M(s0,yzw)=M(M(s0,yz),w)=M(M(s0,yzm),w)=M(s0,yzmw).\begin{align*} M(s_0, x) &= M(s_0, yzw) \\ &= M(M(s_0, yz), w) \\ &= M(M(s_0, yz^m), w) \\ &= M(s_0, yz^m w). \end{align*}

Thus all the tapes yzmwyz^m w are also in T(A)T(\mathfrak{A}).

Theorem 9. Let A\mathfrak{A} be an automaton with rr internal states. Then T(A)T(\mathfrak{A}) is infinite if and only if it contains a tape of length nn with r≤n≤2rr \leq n \leq 2r.

Proof: The implication from right to left is a direct consequence of Lemma 8. Assume that T(A)T(\mathfrak{A}) is infinite. The alphabet Σ\Sigma is finite, and so T(A)T(\mathfrak{A}) must contain tapes of length greater than any integer. Let xx be a tape in T(A)T(\mathfrak{A}) of length n≥rn \geq r. As in the other two proofs, there must exist integers k<l≤nk < l \leq n such that

M(s0,0xk)=M(s0,0xl).M(s_0, 0^{x_k}) = M(s_0, 0^{x_l}).

Now take a new tape xx which is of minimal length of any tape in T(A)T(\mathfrak{A}) for which integers k<lk < l exist satisfying the above equation. Assume further that ll is the least such integer ≤n\leq n = the length of xx. We no longer know that n≥rn \geq r. Thus if i<j<li < j < l, then

M(s0,0xi)≠M(s0,0xj).M(s_{0,0}x_i) \neq M(s_{0,0}x_j).

Since there are at most rr values for the function MM to assume, this proves that l≤rl \leq r. Further, if l≤i<j≤nl \leq i < j \leq n, then

M(s0,0xi)≠M(s0,0xj),M(s_{0,0}x_i) \neq M(s_{0,0}x_j),

since otherwise the tape x′=0xi jxnx' = _0x_i\ _jx_n would be a shorter tape than xx satisfying the given conditions on xx. Counting the number of indices between ll and nn, we see that n−l+1≤rn - l + 1 \leq r. Adding ll to both sides and applying the previous inequality, we find n+1≤2rn + 1 \leq 2r, or better, n<2rn < 2r. If r≤nr \leq n, then the proof would be complete; however, this may not be the case. Assume that n<rn < r. Let y=0xky = _0x_k, z=kxlz = _kx_l, w=lxnw = _lx_n. We have x≠Λx \neq \Lambda, and all tapes yzmwyz^m w are in T(A)T(\mathfrak{A}). Let mm be the least integer such that

r≤k+m(l−k)+(n−l).r \leq k + m(l - k) + (n - l).

Clearly m≠0m \neq 0, since k+(n−l)<n<rk + (n - l) < n < r. If

2r≤k+m(l−k)+(n−l),2r \leq k + m(l - k) + (n - l),

then

r≤k+(m−l)(l−k)+(n−l),r \leq k + (m - l)(l - k) + (n - l),

because l−k≤n<rl - k \leq n < r. But this is impossible because mm was chosen as the least such integer. Hence

k+m(l−k)+(n−l)<2rk + m(l - k) + (n - l) < 2r

and the number on the left is the length of yzmwyz^m w, which proves that there is some tape in T(A)T(\mathfrak{A}) of the indicated length.

Corollary 9.1. Given a finite automaton A\mathfrak{A}, there is an effective procedure whereby in a finite number of steps it can be decided whether T(A)T(\mathfrak{A}) is infinite.

Corollary 9.2. Let A\mathfrak{A} be a finite automaton with rr internal states, and let the alphabet Σ\Sigma have q>1q > 1 symbols. Then if T(A)T(\mathfrak{A}) is finite, it can have at most

∑k<rqk=qr−1q−1 tapes.\sum_{k < r} q^k = \frac{q^r - 1}{q - 1} \text{ tapes}.

Notice also that Lemma 8 gives another proof that the set of tapes of the form 0n10n0^n 10^n is not definable by any finite automaton.

Finally we shall treat in this section the question of deciding whether two automata define the same set of tapes.

Definition 8. Two automata A\mathfrak{A} and B\mathfrak{B} are equivalent if T(A)=T(B)T(\mathfrak{A}) = T(\mathfrak{B}).

Theorem 10. Two automata A\mathfrak{A} and B\mathfrak{B} are not equivalent if and only if there is a tape xx of length less than the product of the number of internal states of A\mathfrak{A} by that of B\mathfrak{B} which is accepted by one machine but not by the other.

Proof: Let A′\mathfrak{A}' be the machine having the same internal states as A\mathfrak{A} and defining the complement of T(A)T(\mathfrak{A}) as in the proof of Theorem 5. Similarly for B\mathfrak{B}. A\mathfrak{A} and B\mathfrak{B} are not equivalent if and only if one of the sets T(A×B′)T(\mathfrak{A} \times \mathfrak{B}'), T(A′×B)T(\mathfrak{A}' \times \mathfrak{B}) is not empty. The theorem follows now directly from Theorem 7, Theorem 6 and Definition 7.

Corollary 10.1. Given two finite automata A\mathfrak{A} and B\mathfrak{B}, there is an effective procedure whereby in a finite number of steps it can be decided whether A\mathfrak{A} and B\mathfrak{B} are equivalent.

All the results of this section are quite evident from the literature, e.g., Burks-Wang,1 Section 2.2. Only Theorem 10 and its corollary are a little stronger than the corresponding results there because of a wider definition of equivalence of automata. These results are nonetheless included for completeness, since the general approach here is rather different.

Chapter II. Reductions to one-way automata

• 5. Nondeterministic operation

The automata used throughout Chapter I were strictly deterministic in their tape-reading action, which was uniquely determined by the table of moves, since there was one and only one way the machine would change its state in any particular situation. Requiring all machines to be of this form can lead to rather cumbersome details, in view of the large number of internal states needed even for some relatively elementary operations. In this section we introduce the notion of a nondeterministic automaton and show that any set of tapes defined by such a machine could also be defined by an ordinary automaton. The main advantage of these machines is the small number of internal states that they require in many cases and the ease in which specific machines can be described. Several examples of their use will be found in Section 6.

Definition 9. A nondeterministic (finite) automaton over the alphabet Σ\Sigma is a system A=(S,M,S0,F)\mathfrak{A} = (S, M, S_0, F) where SS is a finite set, MM is a function of S×ΣS \times \Sigma with values in the set of all subsets of SS, and S0S_0 and FF are subsets of SS.

A nondeterministic automaton is not a probabilistic machine but rather a machine with many choices in its moves. At each stage of its motion across a tape it will be at liberty to choose one of several new internal states. Of course, some sequence of choices will lead either to impossible situations from which no moves are possible or to final states not in the designated class FF. We disregard all such failures, however, and agree to let the machine accept a tape if there is at least one winning combination of choices of states leading to a designated final state. The next definition makes this convention precise.

Definition 10. Let A\mathfrak{A} be a nondeterministic automaton. The set T(A)T(\mathfrak{A}) of tapes accepted by A\mathfrak{A} is the collection of all tapes x=σ0σ1…σn−1x = \sigma_0 \sigma_1 \ldots \sigma_{n-1} for which there exists a sequence s0,s1,…,sns_0, s_1, \ldots, s_n of internal states of A\mathfrak{A} such that {#rabin-1959-automata-def-10 .statement tag=02E1} (i) s0s_0 is in S0S_0; (ii) sis_i is in M(si−1,σi−1)M(s_{i-1}, \sigma_{i-1}), for i=1,2,…,ni = 1, 2, \ldots, n; (iii) sns_n is in FF.

It is readily seen that if A\mathfrak{A} is a nondeterministic machine such that M(s,σ)M(s, \sigma) consists of exactly one internal state for each ss in SS and σ\sigma in Σ\Sigma, then A\mathfrak{A} is really the same as an ordinary automaton, and T(A)T(\mathfrak{A}) will contain the expected tapes. Thus ordinary automata are special cases of nondeterministic automata, and we shall freely identify the ordinary machines with their counterparts.

One might imagine at first sight that these new machines are more general than the ordinary ones, but this is not the case. We shall give a direct construction of an ordinary automaton, defining exactly the same set of tapes as a given nondeterministic machine.

Definition 11. Let A=(S,M,S0,F)\mathfrak{A} = (S, M, S_0, F) be a nondeterministic automaton. D(A)\mathcal{D}(\mathfrak{A}) is the system (T,N,t0,G)(T, N, t_0, G) where TT is the set of all subsets of SS, NN is a function on T×ΣT \times \Sigma such that N(t,σ)N(t, \sigma) is the union of the sets M(s,σ)M(s, \sigma) for ss in tt, t0=S0t_0 = S_0, and GG is the set of all subsets of SS containing at least one member of FF.

Clearly D(A)\mathcal{D}(\mathfrak{A}) is an ordinary automaton, but it is actually equivalent to A\mathfrak{A}.

Theorem 11. If A\mathfrak{A} is a nondeterministic automaton, then T(A)=T(D(A))T(\mathfrak{A}) = T(\mathcal{D}(\mathfrak{A})).

Proof: Assume first that a tape x=σ0σ1…σn−1x = \sigma_0 \sigma_1 \ldots \sigma_{n-1} is in T(A)T(\mathfrak{A}) and let s0,s1,…,sns_0, s_1, \ldots, s_n be a sequence of internal states satisfying the conditions of Definition 10. We show by induction that for k≤nk \leq n, sks_k is in N(t0,0xk)N(t_{0,0} x_k). For k=0k = 0, N(t0,0xk)=N(t0,0,Λ)=t0=S0N(t_{0,0} x_k) = N(t_{0,0}, \Lambda) = t_0 = S_0 and we were given that s0s_0 is in S0S_0. Assume the result for k−1k - 1. By definition, N(t0,0xk)=N(N(t0,0xk−1),σk−1)N(t_{0,0} x_k) = N(N(t_{0,0} x_{k-1}), \sigma_{k-1}). But we have assumed sk−1s_{k-1} is in N(t0,0xk−1)N(t_{0,0} x_{k-1}) so that from the definition of NN we have M(sk−1,σk−1)⊂N(t0,0xk)M(s_{k-1}, \sigma_{k-1}) \subset N(t_{0,0} x_k). However, sks_k is in M(sk−1,σk−1)M(s_{k-1}, \sigma_{k-1}), and so the result is established. In particular sns_n is in N(t0,0xn)=N(t0,0,x)N(t_{0,0} x_n) = N(t_{0,0}, x), and since sns_n is in FF, we have N(t0,0,x)N(t_{0,0}, x) in GG, which proves that xx is in T(D(A))T(\mathcal{D}(\mathfrak{A})). Hence, we have shown that

T(A)⊂T(D(A))T(\mathfrak{A}) \subset T(\mathcal{D}(\mathfrak{A}))

Assume next that a tape x=σ0σ1…σn−1x = \sigma_0 \sigma_1 \ldots \sigma_{n-1} is in T(D(A))T(\mathcal{D}(\mathfrak{A})). Let for each k≤nk \leq n, tk=N(t0,0xk)t_k = N(t_{0,0} x_k). We shall work backwards. First, we know that tnt_n is in GG. Let then sns_n be any internal state of A\mathfrak{A} such that sns_n is in tnt_n and sns_n is in FF. Since sns_n is in

tn=N(t0,0xn)=N(tn−1,σn−1),t_n = N(t_{0,0} x_n) = N(t_{n-1}, \sigma_{n-1}),

we have from the definition of NN that sns_n is in M(sn−1,σn−1)M(s_{n-1}, \sigma_{n-1}) for some sn−1s_{n-1} in tn−1t_{n-1}. But

tn−1=N(t0,0xn−1)=N(tn−2,σn−2),t_{n-1} = N(t_{0,0} x_{n-1}) = N(t_{n-2}, \sigma_{n-2}),

so that sn−1s_{n-1} is in M(sn−2,σn−2)M(s_{n-2}, \sigma_{n-2}) for some sn−2s_{n-2} in tn−2t_{n-2}. Continuing in this way we may obtain a sequence, sn,sn−1,sn−2,…,s0s_n, s_{n-1}, s_{n-2}, \ldots, s_0 such that sks_k is in tkt_k; sks_k is in M(sk−1,σk−1)M(s_{k-1}, \sigma_{k-1}), for k>0k > 0; and sns_n is in FF. Since t0=S0t_0 = S_0, we also have s0s_0 in S0S_0, which proves that xx is in T(A)T(\mathfrak{A}). Thus, T(D(A))⊂T(A)T(\mathcal{D}(\mathfrak{A})) \subset T(\mathfrak{A}), which completes the proof.

This theorem has many interesting consequences. For example, it shows that any automaton with several initial states can be replaced by an equivalent automaton with but one initial state. It would seem that the notions of final state and initial state should be dual in some sense. But one must be careful, because, as the reader may easily show for himself, with the alphabet Σ={0,1}\Sigma = \{0,1\} the set of all tapes of the form 0n0^n or 1n1^n cannot be defined by any nondeterministic automaton with but one designated final state. The correct notion of duality between initial and final states is connected with the reversal of right and left, as indicated in the next definition and theorem.

Definition 12. Let A=(S,M,S0,F)\mathfrak{A} = (S, M, S_0, F) be a nondeterministic automaton. The dual of A\mathfrak{A} is the machine A∗=(S,M∗,F,S0)\mathfrak{A}^* = (S, M^*, F, S_0) where the function M∗M^* is defined by the condition

s′s' is in M∗(s,σ)M^*(s, \sigma) if and only if ss is in M(s′,σ)M(s', \sigma).

Notice that we have at once the equation A∗∗=A\mathfrak{A}^{**} = \mathfrak{A}. The relation between the sets defined by an automaton and its dual is as follows.

Theorem 12. If A\mathfrak{A} is a nondeterministic automaton, then T(A∗)=T(A)∗T(\mathfrak{A}^*) = T(\mathfrak{A})^*.

Proof: In view of the equality A∗∗=A\mathfrak{A}^{**} = \mathfrak{A}, we need only show T(A∗)⊂T(A)∗T(\mathfrak{A}^*) \subset T(\mathfrak{A})^*. Let x=σ0σ1…σn−1x = \sigma_0 \sigma_1 \ldots \sigma_{n-1} be a tape in T(A∗)T(\mathfrak{A}^*); we must show that x∗x^* is in T(A)T(\mathfrak{A}). Let s0,s1,…,sns_0, s_1, \ldots, s_n be the sequence of internal states of A∗\mathfrak{A}^* such that s0s_0 is in FF, sns_n is in S0S_0 and sks_k is in M∗(sk−1,σk−1)M^*(s_{k-1}, \sigma_{k-1}) for k=1,2,…,nk = 1, 2, \ldots, n. Define a new sequence s0′,s1′,…,sn′s'_0, s'_1, \ldots, s'_n by the equation sk′=sn−ks'_k = s_{n-k} for k≤nk \leq n. Obviously, s0′s'_0 is in S0S_0 and sn′s'_n is in FF. Further, for k>0k > 0 and k≤nk \leq n, sk−1′=sn−k+1s'_{k-1} = s_{n-k+1} is in M∗(sn−k,σn−k)M^*(s_{n-k}, \sigma_{n-k}), or in other words, sn−k=sk′s_{n-k} = s'_{k} is in M(sk−1′,σn−k)M(s'_{k-1}, \sigma_{n-k}). Now defining a new sequence of symbols σ0′σ1′…σn−1′\sigma'_0 \sigma'_1 \ldots \sigma'_{n-1} by the formula σk′=σn−k−1\sigma'_k = \sigma_{n-k-1}, we see that σk−1′=σn−k\sigma'_{k-1} = \sigma_{n-k} and σ0′σ1′…σn−1′=x∗\sigma'_0 \sigma'_1 \ldots \sigma'_{n-1} = x^*. Thus, x∗x^* is in T(A)T(\mathfrak{A}) as was to be proved.

It should be noted that Theorem 12 together with Theorem 11 yields a direct construction and proof for Theorem 4 of Section 3 which was first proved by the indirect method of Theorem 1. In the next section we make heavy use of the direct constructions supplied by the nondeterministic machines to obtain results not easily apparent from the mathematical characterizations of Theorems 1 and 2.

  1. Further closure properties

Simplifying a result due originally to Kleene, Myhill in unpublished work has shown that the class T\mathcal{T} can be characterized as the least class of sets of tapes containing the finite sets and closed under some simple operations on sets of tapes. We indicate here a different proof using the method developed in the preceding section.

First of all, we need to define the operations on sets of tapes. Let UU and VV be two sets of tapes. By the complex product UVUV of UU and VV we understand the collection of all tapes of the form xyxy with xx in UU and yy in VV. Clearly the product of sets satisfies the associative law:

(UV)W=U(VW).(UV)W = U(VW).

This leads to the introduction of finite exponents where we define Un=UU…UU^n = UU \ldots U (n times) with the convention than U0={Λ}U^0 = \{\Lambda\}. Finally, if UU is a set of tapes we can form the closure of UU, in symbols cl(U)cl(U), which is the least set VV containing UU, having Λ\Lambda as an element, and such that whenever x,yx, y are in VV then xyxy is in VV. Another definition is given by the equation

cl(U)=U0∪U1∪U2∪U3…,cl(U) = U^0 \cup U^1 \cup U^2 \cup U^3 \ldots,

where the infinite union extends all over finite exponents. We may prove at once about these operations that the class T\mathcal{T} is closed under them.

Theorem 13. The class T\mathcal{T} is closed under the formation of complex products and closures of sets in T\mathcal{T}.

Proof: Assume first that U,VU, V are in T\mathcal{T}. Let U=T(A)U = T(\mathfrak{A}) and V=T(B)V = T(\mathfrak{B}) where A\mathfrak{A} and B\mathfrak{B} are ordinary automata with A=(S,M,s0,F)\mathfrak{A} = (S, M, s_0, F) and B=(T,N,t0,G)\mathfrak{B} = (T, N, t_0, G). We need only find a nondeterministic machine C\mathfrak{C} such that UV=T(C)UV = T(\mathfrak{C}). We may assume that the sets SS and TT have no elements in common, and then equate C=(S∪T,P,{s0},G)\mathfrak{C} = (S \cup T, P, \{s_0\}, G) where the function PP is defined as follows:

P(s,σ)={M(s,σ)},if s is in S−F;P(s, \sigma) = \{M(s, \sigma)\}, \quad \text{if } s \text{ is in } S - F;
P(s,σ)={M(s,σ),N(T0,σ)},if s is in F;P(s, \sigma) = \{M(s, \sigma), N(T_0, \sigma)\}, \quad \text{if } s \text{ is in } F;
P(t,σ)=N(t,σ),if t is in T.P(t, \sigma) = N(t, \sigma), \quad \text{if } t \text{ is in } T.

The straightforward proof that C\mathfrak{C} has the desired property is left to the reader.

Next, we must show why Hcl(U)Hcl(U) is in T\mathcal{T}. We construct a machine D\mathfrak{D} such that cl(U)=T(D)cl(U) = T(\mathfrak{D}), where D\mathfrak{D} is allowed to be nondeterministic. Simply let D=(S,Q,s0,F)\mathfrak{D} = (S, Q, s_0, F), where the function QQ is defined as follows:

Q(s,σ)={M(s,σ)},if s is in S−F;Q(s, \sigma) = \{M(s, \sigma)\}, \quad \text{if } s \text{ is in } S - F;
Q(s,σ)={M(s,σ),M(s0,σ)},if s is in F.Q(s, \sigma) = \{M(s, \sigma), M(s_0, \sigma)\}, \quad \text{if } s \text{ is in } F.

The easy completion of the proof is left to the reader.

Theorem 14. (Kleene-Myhill). The class T\mathcal{T} is the least class of sets of tapes containing the finite sets and closed under the formation of unions, complex products, and closures of sets.

The full proof of Theorem 14 will not be given. Instead we give a brief account of the method of proof needed. Let U\mathcal{U} be the least class closed under the operations mentioned in the theorem. That U⊂T\mathcal{U} \subset \mathcal{T} is the content of Theorems 5, 5.1, and 13. To prove that T⊂U\mathcal{T} \subset \mathcal{U}, consider each set in T\mathcal{T} to be of the form T(A)T(\mathfrak{A}), where A\mathfrak{A} is nondeterministic, and proceed by a kind of induction on A\mathfrak{A}. In more precise terms, define the weight of A\mathfrak{A}, in symbols ∣A∣|\mathfrak{A}|, to be the sum of all the cardinal numbers of the sets M(s,σ)M(s, \sigma) for all ss in SS and σ\sigma in Σ\Sigma. Then by assuming that T(B)T(\mathfrak{B}) is in U\mathcal{U} for all B\mathfrak{B} with ∣B∣<∣A∣|\mathfrak{B}| < |\mathfrak{A}|, one can prove that T(A)T(\mathfrak{A}) is also in U\mathcal{U}. The details, however, are tiring.

This discussion completes our survey of the closure properties of the class of definable sets begun in Section 3, and the authors are not aware of any other interesting operations on sets that can be effected by constructions of automata that we have not already indicated. The remainder of this paper will be therefore devoted to generalizations of the notion of an automaton.

7. Two-way automata

Trying to further generalize the notion of an automaton, we consider automata which are not confined to a strict forward motion across their tapes. This leads to the following definition, which is a direct extension of Definition 1.

Definition 13. Let L={−1,0,+1}L = \{-1, 0, +1\}. A two-way (finite) automation over a finite alphabet Σ\Sigma is a system A=(S,M,s0,F)\mathfrak{A} = (S, M, s_0, F) where SS is a finite non-empty set (the set of internal states of A\mathfrak{A}), MM is a function from S×ΣS \times \Sigma into L×SL \times S (the table of moves of A\mathfrak{A}), s0s_0 is an element of SS (the initial state of A\mathfrak{A}), and FF is a subset of SS (the set of designated final states of A\mathfrak{A}).

A two-way automaton A\mathfrak{A} operates as follows: When given a tape, i.e., a finite linear sequence of squares each containing a single symbol of the alphabet Σ\Sigma, A\mathfrak{A} is set in internal state s0s_0 scanning the first (leftmost) square of the tape. At each stage of the machine's operation, if the internal state is ss, the scanned symbol is σ\sigma, and M(s,σ)=(p,s′)M(s, \sigma) = (p, s'), where pp is one of −1,0,1-1, 0, 1, then A\mathfrak{A} will move one square to the left, stay where it is, or move one square to the right, according as p=−1,0,1p = -1, 0, 1; furthermore, A\mathfrak{A} will enter internal state s′s'. The operation described just now is called an atomic step of A\mathfrak{A}. After completion of an atomic step, A\mathfrak{A} is again in a certain internal state scanning a certain symbol, and a new atomic step is performed, and so on.

If, when operating in this way on a given tape, A\mathfrak{A} will eventually get off the tape on the right side and at that time be in a state in FF, then we shall say that the tape is accepted by A\mathfrak{A}. The formal definition is as follows:

Definition 14. The set T(A)T(\mathfrak{A}) of tapes accepted by the two-way automaton A\mathfrak{A} is the set of all sequences σ0…σn−1\sigma_0 \ldots \sigma_{n-1} of symbols from the alphabet Σ\Sigma for which there exist an integer m>0m > 0, a sequence of integers p0,…,pmp_0, \ldots, p_m, and a sequence s0,…,sms_0, \ldots, s_m of internal states of A\mathfrak{A} such that {#rabin-1959-automata-def-14 .statement tag=02EA} (i) p0=0p_0 = 0 and s0s_0 is the initial state of A\mathfrak{A}; (ii) 0≤pi<n0 \leq p_i < n for i=0,…,m−1i = 0, \ldots, m-1; (iii) pm=np_m = n and sms_m is in FF; (iv) (pi−pi−1,si)=M(si−1,σpi−1)(p_i - p_{i-1}, s_i) = M(s_{i-1}, \sigma_{p_{i-1}}) for i=1,…,mi = 1, \ldots, m.

In the above definition the sequence p0,…,pmp_0, \ldots, p_m should be interpreted as the sequence of positions of the machine A\mathfrak{A} on the tape; thus, pi−pi−1p_i - p_{i-1} indicates the change in position of the machine from time i−1i-1 to time ii. Condition (ii), for example, means that the machine does not run off the tape before the computation has been completed.

In analogy with Definition 3 we shall say that a set PP of tapes is definable by a two-way automaton if there exists some two-way automaton A\mathfrak{A} such that T(A)=PT(\mathfrak{A}) = P.

To avoid confusion we shall, from now on, refer to the automata discussed in Sections 1-6 as one-way automata.

Let us consider an example of a two-way machine illustrating the complicated fashion in which such a machine can operate on a given tape. Let A\mathfrak{A}, B\mathfrak{B}, and C\mathfrak{C}, be three one-way automata over the same alphabet Σ\Sigma. We combine these automata into a single two-way automaton D\mathfrak{D} having the following flow diagram. Given a tape tt the automaton A\mathfrak{A} (which we imagine as being a part of D\mathfrak{D}) starts reading it on the left end and proceeds from left to right until a designated final state of A\mathfrak{A} is reached; when this happens D\mathfrak{D} goes into the initial state of B\mathfrak{B} and starts reading the tape from right to left until a designated final state of B\mathfrak{B} is reached; when this happens D\mathfrak{D} switches into the initial state of A\mathfrak{A} and again starts moving from left to right, and so on; all this time automaton

C is reading the tape symbols as they come in (i.e., in the sequence in which they are being scanned by D) and t is accepted by D only if D ever gets off the right-hand end of t and at that time C is in one of its final designated states. It seems to be quite difficult to determine the kind of set of tapes defined by D. It turns out, to our surprise, that the following theorem holds.

Theorem 15. For every two-way automaton A\mathfrak{A} there exists a one-way automaton A‾\overline{\mathfrak{A}} such that T(A)=T(A‾)T(\mathfrak{A}) = T(\overline{\mathfrak{A}}). Furthermore, A‾\overline{\mathfrak{A}} can be obtained effectively from A\mathfrak{A}.

Outline of Proof:* By definition, a Z-motion of A\mathfrak{A} on a tape t consists of A\mathfrak{A} moving across a square x in a certain direction up to a square y, changing direction at y and moving back towards x, changing again direction before passing x and moving up to y; a Z-motion thus contains exactly two changes of direction. While operating on a tape t a two-way automation will in general perform a complicated succession of forward and backward motions before accepting or rejecting t. In particular, A\mathfrak{A} will go through a great number of Z-motions.

In a given Z-motion in the diagram,

Figure.

the internal state s' in which A\mathfrak{A} re-enters y is a function of the state s in which A\mathfrak{A} originally entered y and the portion of the tape from x to y. If it were possible to compute this new state s', without actually having to move back, then we could substitute for A\mathfrak{A} a new automaton which, instead of turning back at y, would simply go directly from state s into state s' and thus the Z-motion would be eliminated. It turns out that the computation of s' from s is indeed possible because the set R(s,s′)R(s,s') (L(s,s′)L(s,s')) of tapes such that when A\mathfrak{A} starts on the right-(left) hand end it will go through a simple loop (i.e., move directly to some square, change direction there, and go straight back to where it started) and arrive back in state s', is definable by a one-way automaton. Combining A\mathfrak{A} with these one-way automata it is possible to define a new derived automaton A′\mathfrak{A}' which on any given tape t performs fewer Z-motions than A\mathfrak{A} does and such that T(A′)=T(A)T(\mathfrak{A}') = T(\mathfrak{A}). We then show that, by repeating this derivation operation a sufficient number of times, a one-way automaton is obtained which defines the same set as A\mathfrak{A}. This depends on the fact that there is a bound, common to all tapes t accepted by A\mathfrak{A}, on the number of times A\mathfrak{A} goes through any square of t; this bound being the number of internal states of A\mathfrak{A}.

Corollary 15.1. The equivalence problem for two-way automata is effectively solvable.

Proof: Given two two-way automata A\mathfrak{A} and B\mathfrak{B}, to decide whether T(A)=T(B)T(\mathfrak{A}) = T(\mathfrak{B}) construct one-way automata A‾\overline{\mathfrak{A}} and B‾\overline{\mathfrak{B}} such that T(A‾)=T(A)T(\overline{\mathfrak{A}}) = T(\mathfrak{A}) and T(B‾)=T(B)T(\overline{\mathfrak{B}}) = T(\mathfrak{B}); by the previous theorem this can be done effectively. Apply now to A‾\overline{\mathfrak{A}} and B‾\overline{\mathfrak{B}} the procedure given in Corollary 10.1.

Chapter III. Multitape automata

• 8. Description and definitions

We turn now to the study of multitape machines, fixing our attention, without any real loss of generality, on the two-tape case. We can picture the two-tape machine A\mathfrak{A} as having two scanning heads reading a pair (t0,t1)(t_0,t_1) of tapes. We adopt the convention that the machine will read for a while on one tape, then change control and read for a while on the other tape, and so on until one of the tapes is exhausted. When this happens A\mathfrak{A} stops and the pair (t1,t2)(t_1,t_2) is accepted if and only if A\mathfrak{A} is in a designated final state. Thus, with a two-tape automaton, a set of pairs of tapes is defined, or we can say a binary relation between tapes is defined.

To make two-way automata more versatile we afford them with the ability to anticipate the end of the tape. This arrangement consists in augmenting the alphabet Σ\Sigma with an end-marker ε\varepsilon and always feeding into the automaton pairs of the form (t0ε,t1ε)(t_0\varepsilon,t_1\varepsilon); here t1t_1 and t2t_2 do not contain ε\varepsilon, the latter being merely a technical symbol.

In order to indicate the change of control from one tape to the other we use the device of dividing the states of the machine into two classes: the first class contains those states in which the first tape is being read, while the second class has to do with the second tape. These remarks should serve as sufficient background for the following formal definition.

Definition 15. A two-tape, one-way automaton over an alphabet Σ\Sigma is a system A=(S,M,s0,F,C0,C1)\mathfrak{A} = (S,M,s_0,F,C_0,C_1) where (S,M,s0,F)(S,M,s_0,F) is an ordinary automaton; except that M is a function from S×(Σ∪{ε})S \times (\Sigma \cup \{\varepsilon\}) into SS, and where the sets C0,C1C_0, C_1 form a partition of SS, i.e., C0∩C1=ϕC_0 \cap C_1 = \phi and C0∪C1=SC_0 \cup C_1 = S.

Thus a two-tape machine is just an ordinary automaton having an additional structure to determine which tape is to be read.

To be able to define explicitly when a pair of tapes is accepted by an automaton, the following notation involving the partition of the set of states is needed.

Let A=(S,M,s0,F,C0,C1)\mathfrak{A} = (S,M,s_0,F,C_0,C_1) be a two-tape automaton and let s0,s1,…,sns_0, s_1, \ldots, s_n be a sequence of states (where s0s_0 is the initial state). Then there is a unique pair of associated sequences of integers k0,…,kn;l0,…,lnk_0, \ldots, k_n; l_0, \ldots, l_n such that: (i) kik_i is 0 or 1 according as sis_i is in C0C_0 or C1C_1; (ii) lil_i is the number of indices j<ij < i such that sjs_j is in CkiC_{k_i}.

Definition 16. The set of all pairs of tapes accepted by a two-tape automaton A\mathfrak{A}, in symbols T2(A)T_2(\mathfrak{A}), is the set of all pairs (t1,t2)(t_1,t_2) on the alphabet Σ\Sigma such that for

(t1ε,t2ε)=(σ00σ01…σ0(m−1),σ10σ11…σ1(n−1))(t_1\varepsilon, t_2\varepsilon) = (\sigma_{00}\sigma_{01} \ldots \sigma_{0(m-1)}, \sigma_{10}\sigma_{11} \ldots \sigma_{1(n-1)})

there is a (unique) sequence of states s0,s1,…,sps_0, s_1, \ldots, s_p and associated sequences of integers k0,…,kp;l0,…,lpk_0, \ldots, k_p; l_0, \ldots, l_p such that

(i) s0s_0 is the initial state of A\mathfrak{A}; (ii) si=M(σki−1li−1si−1)s_i = M(\sigma_{k_{i-1}} l_{i-1} s_{i-1}) for i=1,…,pi = 1, \ldots, p; (iii) if kp−1=0k_{p-1} = 0 then lp−1=m−1l_{p-1} = m - 1 and if kp−1=1k_{p-1} = 1 then lp−1=n−1l_{p-1} = n - 1; (iv) sps_p is in FF.

In the above definition we are, of course, assuming that if ki=0k_i = 0, then li<ml_i < m and if ki=1k_i = 1, then li<nl_i < n otherwise condition (ii) would be meaningless.

• 9. Relation to one-tape automata

Two-tape automata behave in a fashion almost identical with that of one-tape automata, the only difference being that they operate on two tapes. It is therefore natural to try to establish relationships between the sets of pairs of tapes definable by two-tape machines and the sets of tapes definable by one-tape automata.

Theorem 16. Let A=(S,M,s0,F,C0,C1)\mathfrak{A} = (S, M, s_0, F, C_0, C_1) be a two-tape automaton. The set of all tapes t1t_1 for which there exists some tape t2t_2 such that (t1,t2)(t_1, t_2) is in T2(A)T_2(\mathfrak{A}) (i.e., the domain of the relation defined by A\mathfrak{A}) is definable by a one-tape automaton. An automaton defining this set can in fact be constructed effectively from A\mathfrak{A}.

Proof: The idea underlying the proof is that on the first component of any pair of tapes (A\mathfrak{A}) operates like a nondeterministic one-tape machine. Once we are able to define the one-tape, nondeterministic automaton accepting precisely the tapes t1t_1 for which (t1,t2)(t_1, t_2) is in T2(A)T_2(\mathfrak{A}) for some t2t_2 the proof is completed by Theorem 11.

To shorten the argument we shall consider a slightly simplified version of the notion of two-tape automata; namely, in Definitions 15 and 16 we disregard the end symbol ε\varepsilon and the special role it plays (it is possible to extend the proof to cover the general case). A pair (t1,t2)(t_1, t_2) is thus fed directly into A\mathfrak{A} and is said to be accepted if and when A\mathfrak{A} gets off one of the tapes in a designated final state of A\mathfrak{A}.

Let s′′s'' be in C0C_0 and s′s' be in C1C_1. A tape tt on the alphabet Σ\Sigma is called a (s′,s′′)(s', s'') transition tape if A\mathfrak{A}, when started on tt in s′s' will go through states in C1C_1 until it gets off tt in s′′s''. For every pair (s′,s′′)(s', s'') for which there exists some transition tape let t(s′,s′′)t(s', s'') denote a shortest one. The length of t(s′,s′′)t(s', s'') is clearly less than the number of states in C1C_1 so that all shortest transition tapes, and hence all pairs of states possessing a transition tape, can be effectively found.

A state s′s' in C1C_1 will be called a finalizing state if there exists a tape t(s′)t(s') such that A\mathfrak{A}, when started on t(s′)t(s') in s′s', will go in states of C1C_1 to the end of t(s′)t(s') and get off the tape in a designated final state of A\mathfrak{A}.

Define now a nondeterministic one-tape automaton B\mathfrak{B} as follows. Let ff be some new element not in SS, the set of states of B\mathfrak{B} is C0∪{f}C_0 \cup \{f\}. The table NN of moves of B\mathfrak{B} is defined by (i) N(f,σ)={f}N(f, \sigma) = \{f\}; (ii) N(s,σ)={M(s,σ)}N(s, \sigma) = \{M(s, \sigma)\}, if M(s,σ)M(s, \sigma) is in C0C_0; (iii) N(s,σ)={f}N(s, \sigma) = \{f\}, if M(s,σ)M(s, \sigma) is a finalizing state in C1C_1; (iv) N(s,σ)N(s, \sigma) = the set of all s′′s'' where there exists a transition tape t(M(s,σ),s′′)t(M(s, \sigma), s''), otherwise.

The set of initial states of B\mathfrak{B} is {s0}\{s_0\} if s0s_0 is in C0C_0 and is the set of s′′s'' for which there exists a tape t(s0,s′′)t(s_0, s''), if s0s_0 is in C1C_1. The set of designated final states of B\mathfrak{B} (C0∩F)∪{f}(C_0 \cap F) \cup \{f\}.

It is left for the reader to verify that the set of all tapes accepted by B\mathfrak{B} is precisely the domain of the relation T2(A)T_2(\mathfrak{A}); we recall at this point the simplified definition of acceptance used in the proof. This completes our proof.

Corollary 16.1. There are effective procedures whereby, given a two-tape automaton A\mathfrak{A}, it can be decided in a finite number of steps whether T2(A)T_2(\mathfrak{A}) is empty and whether T2(A)T_2(\mathfrak{A}) is infinite.

Proof: Construct the one-tape automata B\mathfrak{B} and C\mathfrak{C} defining the domain and range of the relation T2(A)T_2(\mathfrak{A}). The set T2(A)T_2(\mathfrak{A}) is empty if and only if T(B)T(\mathfrak{B}) is empty. The set T2(A)T_2(\mathfrak{A}) is infinite if and only if at least one of T(B)T(\mathfrak{B}) and T(C)T(\mathfrak{C}) is infinite. Now apply Corollaries 7.1 and 9.1.

Corollary 16.2. If T2(A)T_2(\mathfrak{A}) contains only pairs of the form (t,t)(t, t) (i.e., A\mathfrak{A} defines a diagonal relation) then the set of all tapes tt for which (t,t)(t, t) is in T2(A)T_2(\mathfrak{A}) is definable by a one-tape automaton.

• 10. Impossibility of Boolean operations

Whereas the class of sets definable by one-tape automata is closed under the Boolean operations (Theorem 5), when we come to sets of pairs definable by two-tape automata the situation is markedly different.

Theorem 17. The class of all sets definable by two-tape automata is (i) closed under complementation; (ii) is not closed under intersection and union.*

Proof: (i) Let A=(S,M,s0,F,C0,C1)\mathfrak{A} = (S, M, s_0, F, C_0, C_1). The complement, with respect to the set of all pairs of tapes on Σ\Sigma, of T2(A)T_2(\mathfrak{A}), is T2((S,M,s0,S−F,C0,C1))T_2((S, M, s_0, S - F, C_0, C_1)). (ii) Let Σ={0,1}\Sigma = \{0, 1\} and use the notation 0n0^n to denote the tape containing nn zeroes. The sets U={(0n10m,0k10n),n,m,k=1,2,…}U = \{(0^n 10^m, 0^k 10^n), n, m, k = 1, 2, \ldots\} and V={(t,t),tV = \{(t, t), t runs through all tapes\} are definable by two-tape automata. Now B∩D={(0n10n,0n10n),n=1,2,…}B \cap D = \{(0^n 10^n, 0^n 10^n), n = 1, 2, \ldots\}. If this set were definable by a two-tape automaton then, by Corollary 16.2, the set {0n10n,n=1,2,…}\{0^n 10^n, n = 1, 2, \ldots\} would be definable by a one-tape automaton, which is impossible. That the class of definable sets is not closed with respect to unions now follows from the identity A∩B=T−[(T−A)∪(T−B)]\mathfrak{A} \cap \mathfrak{B} = T - [(T - \mathfrak{A}) \cup (T - \mathfrak{B})] and (i).

• 11. Unsolvability of the intersection problem

We have shown that the emptiness problem for two-tape automata is effectively solvable. It will now turn out that a similar elementary problem is not solvable. As a preparation for this result concerning automata we must recall a theorem of E. Post.6

The correspondence problem is the following: Given two equally long ordered lists a1,a2,…,ana_1, a_2, \ldots, a_n and b1,b2,…,bnb_1, b_2, \ldots, b_n of tapes on the alphabet Σ\Sigma, to decide whether there exist a sequence of indices i1,i2,…,iki_1, i_2, \ldots, i_k, where

*J. C. Shepherdson informed us in a letter about a different simple example for the fact that the class of definable relations is not closed under intersections.

1 \leq i_j \leq n, such that a_{i_1} a_{i_2} \ldots a_{i_k} = b_{i_1} b_{i_2} \ldots b_{i_k}.

E. Post proved that the correspondence problem (for an alphabet with more than one letter) is not effectively solvable.

Theorem 18. The problem whether for two finite two-tape automata A1\mathfrak{A}_1 and A2\mathfrak{A}_2 we have T2(A1)∩T2(A2)=ϕT_2(\mathfrak{A}_1) \cap T_2(\mathfrak{A}_2) = \phi (the empty set) is not effectively solvable.

Proof: Corresponding to every sequence, a1,a2,…,ana_1, a_2, \ldots, a_n of words on our alphabet Σ\Sigma construct a set P(a1,a2,…,an)P(a_1, a_2, \ldots, a_n) of pairs of tapes as follows: We may assume that 0,1 are in Σ\Sigma; if ii is an integer let i\mathbf{i} be the tape consisting of ii symbols 1 followed by a single 0. Now (t1,t2)(t_1, t_2) is in P(a1,a2,…,an)P(a_1, a_2, \ldots, a_n) if and only if for some kk

(i) t1=ai1ai2…aikt_1 = a_{i_1} a_{i_2} \ldots a_{i_k} (ii) t2=ii1ii2…iikt_2 = \mathbf{i}_{i_1} \mathbf{i}_{i_2} \ldots \mathbf{i}_{i_k}, where ij≤ni_j \leq n.

It is not hard to construct a two-tape automaton A(a1,a2,…,an)=A\mathfrak{A}(a_1, a_2, \ldots, a_n) = \mathfrak{A} such that T2(A)=P(a1,a2,…,an)T_2(\mathfrak{A}) = P(a_1, a_2, \ldots, a_n). Namely, to check whether a pair (t1,t2)(t_1, t_2) satisfies conditions (i) and (ii), A\mathfrak{A} will start on t2t_2 and count the number of symbols 1 until the first 0 is met, let this number be i1i_1. The machine then switches to t1t_1 and checks whether this tape begins with ai1a_{i_1}; if it does not, then (t1,t2)(t_1, t_2) is not accepted. If t1t_1 does begin with ai1a_{i_1}, then after reading through ai1a_{i_1} the machine switches back to t2t_2, and the whole process is repeated. If at any time a symbol other than 0 or 1 is found on t2t_2, or if t2t_2 contains a run of more than nn symbols 1 or more than one symbol 0, then the pair (t1,t2)(t_1, t_2) is not accepted. These remarks sufficiently indicate the construction of A\mathfrak{A} and we shall not go into further detail.

Given two sequences of words S1=(a1,a2,…,an)S_1 = (a_1, a_2, \ldots, a_n) and S2=(b1,b2,…,bn)S_2 = (b_1, b_2, \ldots, b_n) then P(a1,a2,…,an)∩P(b1,b2,…,bn)≠ϕP(a_1, a_2, \ldots, a_n) \cap P(b_1, b_2, \ldots, b_n) \neq \phi if and only if the Post correspondence problem of S1S_1 and S2S_2 has a solution. Since the correspondence problem is not effectively solvable it follows that the problem whether

T2(A(a1,…,an))∩T2(A(b1,…,bn))≠ϕT_2(\mathfrak{A}(a_1, \ldots, a_n)) \cap T_2(\mathfrak{A}(b_1, \ldots, b_n)) \neq \phi

is not effectively solvable.

12. Two-way, two-tape automata

Turning now to two-way, two-tape automata we find that all hope of any constructive decision processes is lost. It is even impossible to decide, by a constructive decision method applicable to all automata, whether a two-way, two-tape machine accepts any tapes. To prove this formally it is, of course, necessary to give the explicit definition of a two-way machine. We shall not give the details here, since they are long and not very much different from the formal definitions needed for two-way, one-tape automata. The main point is that, as with the two-way, one-tape automaton, the table of moves of a two-way, two-tape automaton sometimes requires the machine to back up from the scanned square. However, an outline of the proof should clarify the method.

It was shown above that there is no constructive decision method for deciding whether two two-tape, one-way machines A1\mathfrak{A}_1 and A2\mathfrak{A}_2 both accept a common pair of tapes, that is, whether T2(A1)∩T2(A2)≠ϕT_2(\mathfrak{A}_1) \cap T_2(\mathfrak{A}_2) \neq \phi. From the construction of the two-tape machines it follows that if hh is a new symbol not in the alphabet Σ\Sigma, then there is a one-one correspondence between all two-tape, one-way machines A\mathfrak{A} over Σ\Sigma and certain two-tape one-way machines A′\mathfrak{A}' over Σ∪{h}\Sigma \cup \{h\} such that a pair of tapes (t1,t2)(t_1, t_2) is in T2(A)T_2(\mathfrak{A}) if and only if (ht1h,ht2h)(ht_1h, ht_2h) is in T2(A′)T_2(\mathfrak{A}'). In words, we simply put a marker at the ends of the tapes, and all accepted tapes must be of this form. Let now A1\mathfrak{A}_1 and A2\mathfrak{A}_2 be any two two-tape machines. The corresponding machines over Σ∪{h}\Sigma \cup \{h\} are A1′\mathfrak{A}_1' and A2′\mathfrak{A}_2'. Now because A1′\mathfrak{A}_1' and A2′\mathfrak{A}_2' only accept tapes with markers at the ends, they can be glued together into a two-way machine B\mathfrak{B} such that T2(B)=T2(A1′)∩T2(A2′)T_2(\mathfrak{B}) = T_2(\mathfrak{A}_1') \cap T_2(\mathfrak{A}_2'). The two-way motion of B\mathfrak{B} is obvious: first run through the tapes in the style of A1\mathfrak{A}_1 to see if the pair is accepted, and then, after hitting the markers at the right end, run backwards until the left markers are hit, at which time the motion is again reversed, and the machine is started over, running in the style of A2\mathfrak{A}_2.

The outline of the construction given above shows that every intersection problem about one-way machines A1\mathfrak{A}_1 and A2\mathfrak{A}_2 is equivalent to the intersection problem about machines A1′\mathfrak{A}_1' and A2′\mathfrak{A}_2', which in turn is equivalent to the emptiness problem for a two-way machine B\mathfrak{B}. Since there is an effective method for showing these equivalences, and since there is no effective solution of the intersection problem for one-way machines, we have proved the following.

Theorem 19. There is no effective method of deciding whether the set of tapes definable by a two-tape, two-way automaton is empty or not.

An argument similar to the above one will show that the class of sets of pairs of tapes definable by two-way, two-tape automata is closed under Boolean operations. In view of Theorem 17, this implies that there are sets definable by two-way automata which are not definable by any one-way automaton; thus no analogue to Theorem 15 holds.

References

  1. A. W. Burks and Hao Wang, "The logic of automata," Journal of the Association for Computing Machinery, 4, 193-218 and 279-297 (1957).
  2. S. C. Kleene, "Representation of events in nerve nets and finite automata," Automata Studies, Princeton, pp. 3-41, (1956).
  3. W. S. McCulloch and E. Pitts, "A logical calculus of the ideas imminent in nervous activity," Bulletin of Mathematical Biophysics, 5, 115-133 (1943).
  4. E. F. Moore, "Gedanken-experiments on sequential machines," Automata Studies, Princeton, pp. 129-153 (1956).
  5. A. Nerode, "Linear automaton transformations," Proceedings of the American Mathematical Society, 9, 541-544 (1958).
  6. E. Post, "A variant of a recursively unsolvable problem," Bulletin of the American Mathematical Society, 52, 264-268 (1946).
  7. J. C. Shepherdson, "The reduction of two-way automata to one-way automata," IBM Journal, 3, 198-200 (1959). Revised manuscript received August 8, 1958

Read off the page by a vision model reading the page images using olmOCR-2-7B-1025-FP8.