Simulating Turing Machines on Maurer Machines
Simulating Turing Machines on Maurer Machines
Simulating Turing Machines on Maurer Machines
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<str<strong>on</strong>g>Simulating</str<strong>on</strong>g> <str<strong>on</strong>g>Turing</str<strong>on</strong>g> <str<strong>on</strong>g>Machines</str<strong>on</strong>g><br />
<strong>on</strong> <strong>Maurer</strong> <str<strong>on</strong>g>Machines</str<strong>on</strong>g><br />
J.A. Bergstra 1,2 and C.A. Middelburg 3<br />
1 Programming Research Group, University of Amsterdam,<br />
P.O. Box 41882, 1009 DB Amsterdam, the Netherlands<br />
janb@science.uva.nl<br />
2 Department of Philosophy, Utrecht University,<br />
P.O. Box 80126, 3508 TC Utrecht, the Netherlands<br />
janb@phil.uu.nl<br />
3 Computing Science Department, Eindhoven University of Technology,<br />
P.O. Box 513, 5600 MB Eindhoven, the Netherlands<br />
keesm@win.tue.nl<br />
Abstract. <strong>Maurer</strong> machines are much closer to real computers than<br />
<str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines. Computer instructi<strong>on</strong>s play a prominent part in <strong>Maurer</strong><br />
machines. We show a straightforward way to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines<br />
<strong>on</strong> a <strong>Maurer</strong> machine. It illustrates that the instructi<strong>on</strong> implicitly<br />
executed by a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine <strong>on</strong> a test or write step must be capable of<br />
reading or overwriting the c<strong>on</strong>tents of any cell from the infinite number<br />
of cells <strong>on</strong> the tape of the <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine. Real computers do not have<br />
such instructi<strong>on</strong>s. We show two ways to get rid of this kind of infinity.<br />
Keywords: <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines, <strong>Maurer</strong> machines, thread algebra, stored<br />
threads, strategic interleaving, thread forking, fair interleaving strategies.<br />
1998 CR Categories: F.1.1, F.1.2, F.3.2.<br />
1 Introducti<strong>on</strong><br />
In [12], <strong>Maurer</strong> proposes a model for computers that is quite different from the<br />
well-known models such as register machines, multistack machines and <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
machines (see e.g. [9]). The strength of <strong>Maurer</strong>’s model is that it is close to real<br />
computers. Computer instructi<strong>on</strong>s play a prominent part in his model.<br />
In [4], we developed a theory which covers basic issues c<strong>on</strong>cerning stored<br />
threads and their executi<strong>on</strong>. In that paper, we showed am<strong>on</strong>g other things that<br />
a single thread can c<strong>on</strong>trol the executi<strong>on</strong> <strong>on</strong> a <strong>Maurer</strong> machine of any finitestate<br />
thread stored in the memory of the <strong>Maurer</strong> machine, provided the basic<br />
acti<strong>on</strong>s of the stored thread corresp<strong>on</strong>d to instructi<strong>on</strong>s of the <strong>Maurer</strong> machine.<br />
To describe threads, we used an extensi<strong>on</strong> of BTA (Basic Thread Algebra),<br />
introduced in [2] under the name BPPA (Basic Polarized Process Algebra). BTA<br />
is a form of process algebra which is tailored to the descripti<strong>on</strong> of the behaviour<br />
of deterministic sequential programs under executi<strong>on</strong>. The extensi<strong>on</strong> c<strong>on</strong>cerns an<br />
operator for interleaving of threads and, for each <strong>Maurer</strong> machine, an operator
for applying a thread to the <strong>Maurer</strong> machine from a state of the <strong>Maurer</strong> machine.<br />
Applying a thread to a <strong>Maurer</strong> machine amounts to a sequence of state changes<br />
according to the instructi<strong>on</strong>s that the <strong>Maurer</strong> machine associates with the basic<br />
acti<strong>on</strong>s performed by the thread.<br />
In this paper, we show a straightforward way to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines<br />
<strong>on</strong> a <strong>Maurer</strong> machine. It illustrates that the instructi<strong>on</strong> implicitly executed by a<br />
<str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine <strong>on</strong> a test or write step must be capable of reading or overwriting<br />
the c<strong>on</strong>tents of any cell from the infinite number of cells <strong>on</strong> the tape of the <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
machine – the cell of which the c<strong>on</strong>tents is actually read or overwritten depends<br />
<strong>on</strong> the head positi<strong>on</strong>. In <strong>Maurer</strong>’s terminology, a test instructi<strong>on</strong> has an infinite<br />
input regi<strong>on</strong> and a write instructi<strong>on</strong> has an infinite output regi<strong>on</strong>. Real computers<br />
do not have such instructi<strong>on</strong>s. We show also that the instructi<strong>on</strong>s c<strong>on</strong>cerned can<br />
be replaced by instructi<strong>on</strong>s with a finite input regi<strong>on</strong> and a finite output regi<strong>on</strong><br />
if we aband<strong>on</strong> the restricti<strong>on</strong> to machines with a finite-state c<strong>on</strong>trol.<br />
In the straightforward way to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines <strong>on</strong> a <strong>Maurer</strong> machine,<br />
a thread applied to the <strong>Maurer</strong> machine corresp<strong>on</strong>ds to the finite-state c<strong>on</strong>trol<br />
of the <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine in questi<strong>on</strong>. This thread is definable by a finite recursive<br />
specificati<strong>on</strong>. However, the adaptati<strong>on</strong> of this way to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines to<br />
the use of instructi<strong>on</strong>s with a finite input regi<strong>on</strong> and a finite output regi<strong>on</strong> usually<br />
leads to a thread that is <strong>on</strong>ly definable by an infinite recursive specificati<strong>on</strong>.<br />
Thus, in the simulati<strong>on</strong> of <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines just as well, <strong>on</strong>e kind of infinity<br />
has been replaced by another kind. We show a way to get around the latter<br />
kind of infinity in the case of c<strong>on</strong>vergent computati<strong>on</strong>s. The basic ideas are:<br />
(a) the thread corresp<strong>on</strong>ding to the finite-state c<strong>on</strong>trol of the <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine in<br />
questi<strong>on</strong> is stored and then executed under c<strong>on</strong>trol of a thread that makes the<br />
head positi<strong>on</strong> part of the instructi<strong>on</strong>s and (b) the c<strong>on</strong>trolling thread grows, by<br />
means of thread forking, whenever a head positi<strong>on</strong> occurs for the first time. For<br />
this, the operator for interleaving of threads from [4] is adapted to thread forking.<br />
This operator is based <strong>on</strong> the simplest deterministic interleaving strategy, namely<br />
cyclic interleaving. In [3], other plausible interleaving strategies are treated. We<br />
discuss why the last-menti<strong>on</strong>ed way to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines <strong>on</strong> a <strong>Maurer</strong><br />
machine works for other fair interleaving strategies as well.<br />
The structure of this paper is as follows. First of all, we review <strong>Maurer</strong>’s model<br />
for computers (Secti<strong>on</strong> 2) and Basic Thread Algebra (Secti<strong>on</strong> 3). Following this,<br />
we extend BTA with an operator to deal with interleaving of threads (Secti<strong>on</strong> 4)<br />
and, for each <strong>Maurer</strong> machine, an operator which allows for threads to transform<br />
states of the associated <strong>Maurer</strong> machine by means of its instructi<strong>on</strong>s (Secti<strong>on</strong> 5).<br />
After that, we set out a way to store a finite-state thread in the memory of a<br />
<strong>Maurer</strong> machine for executi<strong>on</strong> <strong>on</strong> the <strong>Maurer</strong> machine (Secti<strong>on</strong> 6). Next, we<br />
review <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines (Secti<strong>on</strong> 7) and show a simple way to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
machines <strong>on</strong> <strong>Maurer</strong> machines (Secti<strong>on</strong> 8). Then, we show two ways to simulate<br />
<str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines <strong>on</strong> <strong>Maurer</strong> machines by means of instructi<strong>on</strong>s with a finite input<br />
regi<strong>on</strong> and a finite output regi<strong>on</strong> <strong>on</strong>ly (Secti<strong>on</strong>s 9 and 10). After that, we discuss<br />
why the latter way, which uses cyclic interleaving, works for any fair interleaving<br />
strategy (Secti<strong>on</strong> 11). Finally, we make some c<strong>on</strong>cluding remarks (Secti<strong>on</strong> 12).<br />
2
2 <strong>Maurer</strong> Computers<br />
In this secti<strong>on</strong>, we shortly review <strong>Maurer</strong> computers, i.e. computers as defined<br />
by <strong>Maurer</strong> in [12].<br />
A <strong>Maurer</strong> computer C c<strong>on</strong>sists of the following comp<strong>on</strong>ents:<br />
– a set M;<br />
– a set B with card(B) ≥ 2;<br />
– a set S of functi<strong>on</strong>s S : M → B;<br />
– a set I of functi<strong>on</strong>s I : S → S;<br />
and satisfies the following c<strong>on</strong>diti<strong>on</strong>s:<br />
– if S1, S2 ∈ S, M ′ ⊆ M and S3 : M → B is such that S3(x) = S1(x) if x ∈ M ′<br />
and S3(x) = S2(x) if x �∈ M ′ , then S3 ∈ S;<br />
– if S1, S2 ∈ S, then the set {x ∈ M | S1(x) �= S2(x)} is finite.<br />
M is called the memory, B is called the base set, the members of S are called<br />
the states, and the members of I are called the instructi<strong>on</strong>s. It is obvious that<br />
the first c<strong>on</strong>diti<strong>on</strong> is satisfied if C is complete, i.e. if S is the set of all functi<strong>on</strong>s<br />
S : M → B, and that the sec<strong>on</strong>d c<strong>on</strong>diti<strong>on</strong> is satisfied if C is finite, i.e. if M and<br />
B are finite sets.<br />
Let (M, B, S, I) be a <strong>Maurer</strong> computer, and let I : S → S. Then the input<br />
regi<strong>on</strong> of I, written IR(I), and the output regi<strong>on</strong> of I, written OR(I), are the<br />
subsets of M defined as follows:<br />
IR(I) = {x∈M | ∃S1, S2 ∈ S, y ∈ OR(I) • ∀z ∈ M \ {x} •<br />
OR(I) = {x∈M | ∃S ∈ S • S(x) �= I(S)(x)} .<br />
S1(z) = S2(z) ∧ I(S1)(y) �= I(S2)(y)} ,<br />
OR(I) is the set of all memory elements that are possibly affected by I; and<br />
IR(I) is the set of all memory elements that possibly affect elements of OR(I)<br />
under I.<br />
Let (M, B, S, I) be a <strong>Maurer</strong> computer, let I ∈ I, let M ′ ⊆ OR(I), and let<br />
M ′′ ⊆ IR(I). Then the regi<strong>on</strong> affecting M ′ under I, written RA(M ′ , I), and the<br />
regi<strong>on</strong> affected by M ′′ under I, written AR(M ′′ , I), are the subsets of M defined<br />
as follows:<br />
RA(M ′ , I) = {x∈IR(I) | AR({x}, I) ∩ M ′ �= ∅} ,<br />
AR(M ′′ , I) = {x∈OR(I) | ∃S1, S2 ∈ S • ∀z ∈ IR(I) \ M ′′ •<br />
S1(z) = S2(z) ∧ I(S1)(x) �= I(S2)(x)} .<br />
AR(M ′′ , I) is the set of all elements of OR(I) that are possibly affected by the<br />
elements of M ′′ under I; and RA(M ′ , I) is the set of all elements of IR(I) that<br />
possibly affect elements of M ′ under I.<br />
In [12], <strong>Maurer</strong> gives many results about the relati<strong>on</strong> between the input regi<strong>on</strong><br />
and output regi<strong>on</strong> of instructi<strong>on</strong>s, the compositi<strong>on</strong> of instructi<strong>on</strong>s, the decompositi<strong>on</strong><br />
of instructi<strong>on</strong>s and the existence of instructi<strong>on</strong>s. In [4], we summarize<br />
the main results.<br />
3
3 Basic Thread Algebra<br />
Table 1. Axiom of BTA<br />
x � tau � y = x � tau � x T1<br />
In this secti<strong>on</strong>, we review BTA (Basic Thread Algebra), a form of process algebra<br />
which is tailored to the descripti<strong>on</strong> of the behaviour of deterministic sequential<br />
programs under executi<strong>on</strong>. The behaviours c<strong>on</strong>cerned are called threads.<br />
In BTA, it is assumed that there is a fixed but arbitrary set of basic acti<strong>on</strong>s<br />
A with tau �∈ A. We write Atau for A ∪ {tau}. BTA has the following c<strong>on</strong>stants<br />
and operators:<br />
– the deadlock c<strong>on</strong>stant D;<br />
– the terminati<strong>on</strong> c<strong>on</strong>stant S;<br />
– for each a ∈ Atau, a binary postc<strong>on</strong>diti<strong>on</strong>al compositi<strong>on</strong> operator � a � .<br />
We use infix notati<strong>on</strong> for postc<strong>on</strong>diti<strong>on</strong>al compositi<strong>on</strong>. We introduce acti<strong>on</strong> prefixing<br />
as an abbreviati<strong>on</strong>: a ◦ p, where p is a term of BTA, abbreviates p � a � p.<br />
The intuiti<strong>on</strong> is that each basic acti<strong>on</strong> performed by a thread is taken as<br />
a command to be processed by the executi<strong>on</strong> envir<strong>on</strong>ment of the thread. The<br />
processing of a command may involve a change of state of the executi<strong>on</strong> envir<strong>on</strong>ment.<br />
At completi<strong>on</strong> of the processing of the command, the executi<strong>on</strong> envir<strong>on</strong>ment<br />
produces a reply value. This reply is either T or F and is returned<br />
to the thread c<strong>on</strong>cerned. Let p and q be closed terms of BTA. Then p � a � q<br />
will proceed as p if the processing of a leads to the reply T (called a positive<br />
reply), and it will proceed as q if the processing of a leads to the reply F (called<br />
a negative reply). The acti<strong>on</strong> tau plays a special role. Its executi<strong>on</strong> will never<br />
change any state and always produces a positive reply.<br />
BTA has <strong>on</strong>ly <strong>on</strong>e axiom. This axiom is given in Table 1. Using the abbreviati<strong>on</strong><br />
introduced above, axiom T1 can be written as follows: x � tau � y = tau ◦ x.<br />
A recursive specificati<strong>on</strong> over BTA is a set of equati<strong>on</strong>s E = {X = tX |<br />
X ∈ V }, where V is a set of variables and each tX is a term of BTA that <strong>on</strong>ly<br />
c<strong>on</strong>tains variables from V . We write V(E) for the set of all variables that occur<br />
<strong>on</strong> the left-hand side of an equati<strong>on</strong> in E. Let t be a term of BTA c<strong>on</strong>taining a<br />
variable X. Then an occurrence of X in t is guarded if t has a subterm of the<br />
form t ′ � a � t ′′ c<strong>on</strong>taining this occurrence of X. A recursive specificati<strong>on</strong> E is<br />
guarded if all occurrences of variables in the right-hand sides of its equati<strong>on</strong>s<br />
are guarded or it can be rewritten to such a recursive specificati<strong>on</strong> using the<br />
equati<strong>on</strong>s of E. We are <strong>on</strong>ly interested in models of BTA in which guarded<br />
recursive specificati<strong>on</strong>s have unique soluti<strong>on</strong>s, such as the projective limit model<br />
of BTA presented in [1, 2]. A thread that is the soluti<strong>on</strong> of a finite guarded<br />
recursive specificati<strong>on</strong> over BTA is called a finite-state thread.<br />
We extend BTA with guarded recursi<strong>on</strong> by adding c<strong>on</strong>stants for soluti<strong>on</strong>s<br />
of guarded recursive specificati<strong>on</strong>s and axioms c<strong>on</strong>cerning these additi<strong>on</strong>al c<strong>on</strong>stants.<br />
For each guarded recursive specificati<strong>on</strong> E and each X ∈ V(E), we add<br />
4
Table 2. Axioms for guarded recursi<strong>on</strong><br />
〈X|E〉 = 〈tX|E〉 if X =tX ∈ E RDP<br />
E ⇒ X = 〈X|E〉 if X ∈ V(E) RSP<br />
Table 3. Approximati<strong>on</strong> inducti<strong>on</strong> principle<br />
π0(x) = D P0<br />
πn+1(S) = S P1<br />
πn+1(D) = D P2<br />
πn+1(x � a � y) = πn(x) � a � πn(y) P3<br />
( �<br />
n≥0πn(x) = πn(y)) ⇒ x = y AIP<br />
a c<strong>on</strong>stant standing for the unique soluti<strong>on</strong> of E for X to the c<strong>on</strong>stants of BTA.<br />
The c<strong>on</strong>stant standing for the unique soluti<strong>on</strong> of E for X is denoted by 〈X|E〉.<br />
Moreover, we use the following notati<strong>on</strong>. Let t be a term of BTA and E be a<br />
guarded recursive specificati<strong>on</strong>. Then we write 〈t|E〉 for t with, for all X ∈ V(E),<br />
all occurrences of X in t replaced by 〈X|E〉. We add the axioms for guarded recursi<strong>on</strong><br />
given in Table 2 to the axioms of BTA. In this table, X, tX and E stand<br />
for an arbitrary variable, an arbitrary term of BTA and an arbitrary guarded<br />
recursive specificati<strong>on</strong>, respectively. Side c<strong>on</strong>diti<strong>on</strong>s are added to restrict the<br />
variables, terms and guarded recursive specificati<strong>on</strong>s for which X, tX and E<br />
stand. The additi<strong>on</strong>al axioms for guarded recursi<strong>on</strong> are known as the recursive<br />
definiti<strong>on</strong> principle (RDP) and the recursive specificati<strong>on</strong> principle (RSP). The<br />
equati<strong>on</strong>s 〈X|E〉 = 〈tX|E〉 for a fixed E express that the c<strong>on</strong>stants 〈X|E〉 make<br />
up a soluti<strong>on</strong> of E. The c<strong>on</strong>diti<strong>on</strong>al equati<strong>on</strong>s E ⇒ X = 〈X|E〉 express that this<br />
soluti<strong>on</strong> is the <strong>on</strong>ly <strong>on</strong>e.<br />
We often write X for 〈X|E〉 if E is clear from the c<strong>on</strong>text. It should be borne<br />
in mind that, in such cases, we use X as a c<strong>on</strong>stant.<br />
The projective limit characterizati<strong>on</strong> of process equivalence <strong>on</strong> threads is<br />
based <strong>on</strong> the noti<strong>on</strong> of a finite approximati<strong>on</strong> of depth n. When for all n these<br />
approximati<strong>on</strong>s are identical for two given threads, both threads are c<strong>on</strong>sidered<br />
identical. This is expressed by the infinitary c<strong>on</strong>diti<strong>on</strong>al equati<strong>on</strong> AIP (Approximati<strong>on</strong><br />
Inducti<strong>on</strong> Principle) given in Table 3. Following [1, 2], approximati<strong>on</strong> of<br />
depth n is phrased in terms of a unary projecti<strong>on</strong> operator πn( ). The projecti<strong>on</strong><br />
operators are defined inductively by means of the axioms P0–P3 given in<br />
Table 3. In this table, a stands for an arbitrary member of Atau. It happens that<br />
RSP follows from AIP.<br />
The structural operati<strong>on</strong>al semantics of BTA and its extensi<strong>on</strong>s with guarded<br />
recursi<strong>on</strong> and projecti<strong>on</strong> can be found in [5, 4].<br />
Henceforth, we write Tfinrec for the set of all terms of BTA with recursi<strong>on</strong> in<br />
which no c<strong>on</strong>stants 〈X|E〉 for infinite E occur, and Tfinrec for the set of all closed<br />
terms of BTA with recursi<strong>on</strong> in which no c<strong>on</strong>stants 〈X|E〉 for infinite E occur.<br />
We write Tfinrec(A), where A ⊆ A, for the set of all closed terms from Tfinrec<br />
5
Table 4. Axioms for cyclic interleaving with perfect forking<br />
� f (〈 〉) = S CSIf1<br />
� f (〈S〉 � α) = � f (α) CSIf2<br />
� f (〈D〉 � α) = SD(� f (α)) CSIf3<br />
� f (〈x � a � y〉 � α) = � f (α � 〈x〉) � a � � f (α � 〈y〉) CSIf4<br />
� f (〈x � nt(n) � y〉 � α) = tau ◦ � f (α � 〈φ(n)〉 � 〈x〉) CSIf5<br />
Table 5. Axioms for deadlock at terminati<strong>on</strong><br />
SD(S) = D S2D1<br />
SD(D) = D S2D2<br />
SD(x � a � y) = SD(x) � a � SD(y) S2D3<br />
that <strong>on</strong>ly c<strong>on</strong>tain basic acti<strong>on</strong>s from A. We write p ∈ p ′ , where p, p ′ ∈ Tfinrec, to<br />
indicate that p is a subterm of a term p ′′ ∈ Tfinrec for which p ′ = p ′′ is derivable<br />
from RDP.<br />
4 Interleaving of Threads and Thread Forking<br />
In this secti<strong>on</strong>, we extend BTA with an operator for interleaving of threads that<br />
supports thread forking.<br />
A thread vector is a sequence of threads. A strategic interleaving operator<br />
turns a thread vector of arbitrary length into a single thread. The resulting single<br />
thread is sometimes called a multi-thread. Several kinds of strategic interleaving<br />
have been elaborated in earlier work, see e.g. [3, 5]. In this secti<strong>on</strong>, we <strong>on</strong>ly cover<br />
<strong>on</strong>e of the simplest interleaving strategies, namely cyclic interleaving with perfect<br />
forking.<br />
It is assumed that a fixed but arbitrary thread forking functi<strong>on</strong> φ:N → Tfinrec,<br />
where N ⊆ N, has been given. Moreover, it is assumed that nt(n) ∈ A for all<br />
n ∈ dom(φ). The basic acti<strong>on</strong> nt(n) represents the act of forking off thread<br />
φ(n). We c<strong>on</strong>sider the case where forking off a thread will never be blocked or<br />
fail. Therefore, it always produces a positive reply. The acti<strong>on</strong> tau arises as the<br />
residue of forking off a thread. We write NT for the set {nt(n) | n ∈ dom(φ)}.<br />
The strategic interleaving operator for cyclic interleaving with perfect forking is<br />
denoted by � f ( ).<br />
The axioms for cyclic interleaving with perfect forking are given in Table 4. 4<br />
In CSIf3, the auxiliary deadlock at terminati<strong>on</strong> operator SD( ) is used. It turns<br />
terminati<strong>on</strong> into deadlock. Its axioms are given in Table 5. In Table 4, a stands<br />
4 We write 〈 〉 for the empty sequence, 〈d〉 for the sequence having d as sole element,<br />
and α � β for the c<strong>on</strong>catenati<strong>on</strong> of sequences α and β. We assume that the identities<br />
α � 〈 〉 = 〈 〉 � α = α hold.<br />
6
for an arbitrary member of Atau \ NT . In Table 5, a stands for an arbitrary<br />
member of Atau.<br />
In [3], we treat several strategies for cyclic interleaving with forking. All of<br />
them deal with cases where forking may be blocked and/or may fail. We believe<br />
that perfect forking is a suitable abstracti<strong>on</strong> when studying the simulati<strong>on</strong> of<br />
<str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines.<br />
The structural operati<strong>on</strong>al semantics for cyclic interleaving without forking<br />
is given in [5, 4]. The adaptati<strong>on</strong> to the case with perfect forking is obvious.<br />
5 Applying Threads to <strong>Maurer</strong> <str<strong>on</strong>g>Machines</str<strong>on</strong>g><br />
In this secti<strong>on</strong>, we introduce <strong>Maurer</strong> machines and add for each <strong>Maurer</strong> machine<br />
H a binary apply operator •H to BTA.<br />
A <strong>Maurer</strong> machine is a tuple H = (M, B, S, I, A, [ ]), where (M, B, S, I) is<br />
a <strong>Maurer</strong> computer and:<br />
– A ⊆ A \ NT ;<br />
– [ ] : A → (I × M).<br />
The members of A are called the basic acti<strong>on</strong>s of H, and [ ] is called the basic<br />
acti<strong>on</strong> interpretati<strong>on</strong> functi<strong>on</strong> of H.<br />
The apply operators associated with <strong>Maurer</strong> machines are related to the apply<br />
operators introduced in [6]. They allow for threads to transform states of the<br />
associated <strong>Maurer</strong> machine by means of its instructi<strong>on</strong>s. Such state transformati<strong>on</strong>s<br />
produce either a state of the associated <strong>Maurer</strong> machine or the undefined<br />
state ↑. It is assumed that ↑ is not a state of any <strong>Maurer</strong> machine. We extend<br />
functi<strong>on</strong> restricti<strong>on</strong> to ↑ by stipulating that ↑ ↾ M = ↑ for any set M.<br />
The first operand of the apply operator •H associated with <strong>Maurer</strong> machine<br />
H = (M, B, S, I, A, [ ]) must be a term from Tfinrec(A) and its sec<strong>on</strong>d argument<br />
must be a state from S ∪ {↑}.<br />
Let H = (M, B, S, I, A, [ ]) be a <strong>Maurer</strong> machine, let p ∈ Tfinrec(A), and<br />
let S ∈ S. Then p •H S is the state from S that results if all basic acti<strong>on</strong>s<br />
performed by thread p are processed by the <strong>Maurer</strong> machine H from initial<br />
state S. Moreover, let (Ia, ma) = [a] for all a ∈ A. Then the processing of a<br />
basic acti<strong>on</strong> a by H amounts to a state change according to the instructi<strong>on</strong> Ia.<br />
In the resulting state, the reply produced by H is c<strong>on</strong>tained in memory element<br />
ma. If p is S, then there will be no state change. If p is D, then the result is ↑.<br />
Let H = (M, B, S, I, A, [ ]) be a <strong>Maurer</strong> machine, and let (Ia, ma) = [a] for<br />
all a ∈ A. Then the apply operator •H is defined by the equati<strong>on</strong>s given in<br />
Table 6 (for a ∈ A and S ∈ S) and the rule given in Table 7 (for S ∈ S). We say<br />
that p •H S is c<strong>on</strong>vergent if ∃n ∈ N • πn(p) •H S �= ↑. If p •H S is c<strong>on</strong>vergent, then<br />
the length of the computati<strong>on</strong> of p •H S, written |p •H S|, is the smallest n ∈ N<br />
such that πn(p) •H S �= ↑. If p •H S is not c<strong>on</strong>vergent, then |p •H S| is undefined.<br />
We say that p •H S is divergent if p •H S is not c<strong>on</strong>vergent. Notice that the rule<br />
from Table 7 can be read as follows: if x •H S is divergent, then it equals ↑.<br />
7
Table 6. Defining equati<strong>on</strong>s for apply operator<br />
x •H ↑ = ↑<br />
S •H S = S<br />
D •H S = ↑<br />
(tau ◦ x) •H S = x •H S<br />
(x � a � y) •H S = x •H Ia(S) if Ia(S)(ma) = T<br />
(x � a � y) •H S = y •H Ia(S) if Ia(S)(ma) = F<br />
Table 7. Rule for divergence<br />
∀n ∈ N • πn(x) •H S = ↑<br />
x •H S = ↑<br />
We introduce some auxiliary noti<strong>on</strong>s, which are useful in proofs. Let H =<br />
(M, B, S, I, A, [ ]) be a <strong>Maurer</strong> machine, and let (Ia, ma) = [a] for all a ∈ A.<br />
Then the step relati<strong>on</strong> ⊢H ⊆ (Tfinrec(A) × S) × (Tfinrec(A) × S) is inductively<br />
defined as follows:<br />
– if p = tau ◦ p ′ , then (p, S) ⊢H (p ′ , S);<br />
– if Ia(S)(ma) = T and p = p ′ � a � p ′′ , then (p, S) ⊢H (p ′ , Ia(S));<br />
– if Ia(S)(ma) = F and p = p ′ � a � p ′′ , then (p, S) ⊢H (p ′′ , Ia(S)).<br />
If (p, S) ⊢H (p ′ , S ′ ), then p •H S = p ′ •H S ′ . Moreover, let p ∈ Tfinrec(A), and let<br />
S ∈ S. Then the full path of p •H S is the unique full path in ⊢H from (p, S).<br />
A full path in ⊢H is <strong>on</strong>e of the following:<br />
– a finite path 〈(p0, S0), . . . , (pn, Sn)〉 in ⊢H such that there exists no<br />
(pn+1, Sn+1) ∈ Tfinrec(A) × S with (pn, Sn) ⊢H (pn+1, Sn+1);<br />
– an infinite path 〈(p0, S0), (p1, S1), . . .〉 in ⊢H .<br />
If p •H S is c<strong>on</strong>vergent, then its full path is a path of length |p •H S| from (p, S)<br />
to (S, S ′ ), where S ′ = p •H S. Such a full path is also called a computati<strong>on</strong>.<br />
Henceforth, we write ⊢ ∗ H for the reflexive and transitive closure of ⊢H .<br />
6 Representati<strong>on</strong> of Threads<br />
In this secti<strong>on</strong>, we make precise how to represent threads in the memory of a<br />
<strong>Maurer</strong> machine.<br />
It is assumed that a fixed but arbitrary finite set Mthr and a fixed but arbitrary<br />
bijecti<strong>on</strong> mthr : [0, card(Mthr) − 1] → Mthr have been given. Mthr is called the<br />
thread memory. We write size(Mthr) for card(Mthr). Let n, n ′ ∈ [0, size(Mthr) − 1]<br />
be such that n ≤ n ′ . Then, we write Mthr[n] for mthr(n), and Mthr[n, n ′ ] for<br />
{mthr(k) | n ≤ k ≤ n ′ }.<br />
8
The thread memory is a memory of which the elements can be addressed by<br />
means of members of [0, size(Mthr) − 1]. We write Athr for [0, size(Mthr) − 1].<br />
The thread memory elements are meant for c<strong>on</strong>taining the representati<strong>on</strong>s<br />
of nodes that form part of a simple graph representati<strong>on</strong> of a thread. Here,<br />
the representati<strong>on</strong> of a node is either S, D or a triple c<strong>on</strong>sisting of a basic<br />
acti<strong>on</strong> and two members of Athr addressing thread memory elements c<strong>on</strong>taining<br />
representati<strong>on</strong>s of other nodes.<br />
Let n, n ′ ∈ Athr be such that n ≤ n ′ . Then, we write Bthr[n, n ′ ] for {S, D} ∪<br />
([n, n ′ ] × A × [n, n ′ ]). We write Bthr for Bthr[0, size(Mthr) − 1]. Bthr is called the<br />
thread memory base set. We write Sthr for the set of all functi<strong>on</strong>s Sthr:Mthr → Bthr.<br />
Let p ∈ Tfinrec be a term not c<strong>on</strong>taining tau. Then the nodes of the graph<br />
representati<strong>on</strong> of p, written Nodes(p), is the smallest subset of Tfinrec such that:<br />
– p ∈ Nodes(p);<br />
– if p ′ � a � p ′′ ∈ Nodes(p), then p ′ , p ′′ ∈ Nodes(p);<br />
– if 〈X0|{X0 = t0, . . . , Xn = tn}〉 ∈ Nodes(p), 〈t0|{X0 = t0, . . . , Xn = tn}〉 ≡<br />
p ′ � a � p ′′ , then p ′ , p ′′ ∈ Nodes(p).<br />
We write size(p) for card(Nodes(p)).<br />
It is assumed that for all p ∈ Tfinrec, a fixed but arbitrary bijecti<strong>on</strong> nodep :<br />
[0, size(p) − 1] → Nodes(p) with nodep(0) = p has been given.<br />
Let p ∈ Tfinrec be a term not c<strong>on</strong>taining tau, with size(p) ≤ size(Mthr). Then<br />
the stored graph representati<strong>on</strong> of p, written sthr(p), is the unique functi<strong>on</strong> sthr :<br />
Mthr[0, size(p) − 1] → Bthr[0, size(p) − 1] such that for all n ∈ [0, size(p) − 1],<br />
sthr(Mthr[n]) = nrepr p(nodep(n)), where nrepr p : Nodes(p) → Bthr[0, size(p) − 1]<br />
is defined as follows:<br />
nrepr p(S) = S ,<br />
nrepr p(D) = D ,<br />
nrepr p(p ′ � a � p ′′ ) = (nodep −1 (p ′ ), a, nodep −1 (p ′′ )) ,<br />
nrepr p(〈X0|{X0 = t0, . . . , Xn = tn}〉)<br />
= nrepr p(〈t0|{X0 = t0, . . . , Xn = tn}〉) .<br />
We call sthr(p) a stored thread.<br />
Notice that sthr(p) is not defined for p with size(p) > size(Mthr). The size of<br />
the thread memory restricts the threads that can be stored.<br />
7 <str<strong>on</strong>g>Turing</str<strong>on</strong>g> <str<strong>on</strong>g>Machines</str<strong>on</strong>g><br />
<str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines were proposed almost 70 years ago by <str<strong>on</strong>g>Turing</str<strong>on</strong>g> in [13]. In this<br />
secti<strong>on</strong>, we define a kind of <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines which is at least as powerful as<br />
the kinds of <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines that are nowadays often c<strong>on</strong>sidered as standard<br />
(cf. [11, 9]): each <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine of those kinds can be simulated by a <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
machine of the kind defined here. The <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines of the kind defined here,<br />
called simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines, are closer to the <strong>on</strong>es proposed by <str<strong>on</strong>g>Turing</str<strong>on</strong>g>.<br />
9
First we give an intuitive descripti<strong>on</strong> of a simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine. A simple<br />
<str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine c<strong>on</strong>sists of a finite-state c<strong>on</strong>trol, a <strong>on</strong>e-way infinite tape and a<br />
tape head. The c<strong>on</strong>trol can be in any of a finite number of states. The tape is<br />
divided into a countably infinite number of cells. Each cell can hold any <strong>on</strong>e of<br />
a finite number of tape symbols. One of the tape symbols is the blank symbol<br />
�. The tape head is always positi<strong>on</strong>ed at <strong>on</strong>e of the tape cells. A simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
machine makes steps based <strong>on</strong> its current state and the tape symbol held in the<br />
cell at which the tape head is positi<strong>on</strong>ed. In <strong>on</strong>e step it changes state and either<br />
overwrites the cell at which the tape head is positi<strong>on</strong>ed with some tape symbol<br />
or moves the tape head left or right <strong>on</strong>e cell (but not both).<br />
We will fix <strong>on</strong> {0, 1, �} for the set of tape symbols. We write Btape for the<br />
set {0, 1, �}. We use the directi<strong>on</strong> symbols L and R, and the halt symbol H. The<br />
symbols L, R and H are no tape symbols. We write Dhd for the set {L, R}.<br />
A simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine T c<strong>on</strong>sists of the following comp<strong>on</strong>ents:<br />
– a finite set Q;<br />
– a functi<strong>on</strong> δ : Q × Btape → Q × (Btape ∪ Dhd ∪ {H});<br />
– an element q 0 ∈ Q.<br />
The members of Q are called the states, δ is called the transiti<strong>on</strong> functi<strong>on</strong>, and<br />
q 0 is called the initial state.<br />
A c<strong>on</strong>tents of the tape of a simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine is a functi<strong>on</strong> τ : N → Btape<br />
for which there exists an n ∈ N such that for all m ∈ N with m ≥ n, τ(m) = �.<br />
We write Ctape for the set of all such functi<strong>on</strong>s.<br />
Let T = (Q, δ, q 0 ) be a simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine. Then a c<strong>on</strong>figurati<strong>on</strong> of T is<br />
a triple (q, τ, i), where q ∈ Q, τ ∈ Ctape and i ∈ N. If q = q 0 , then (q, τ, i) is an<br />
initial c<strong>on</strong>figurati<strong>on</strong> of T . If δ(q, τ(i)) = (q ′ , H) for some q ′ ∈ Q, then (q, τ, i)<br />
is a terminal c<strong>on</strong>figurati<strong>on</strong> of T . Let (q, τ, i) and (q ′ , τ ′ , i ′ ) be c<strong>on</strong>figurati<strong>on</strong>s of<br />
T . Then (q ′ , τ ′ , i ′ ) is next to (q, τ, i) in T if for some s ′ ∈ Btape ∪ Dhd such that<br />
s ′ �= L if i = 0:<br />
δ(q, τ(i)) = (q ′ , s ′ ) ,<br />
for all j ∈ N:<br />
and<br />
τ ′ (j) = s ′ if i = j ∧ s ′ ∈ Btape ,<br />
τ ′ (j) = τ(j) if i = j ∧ s ′ ∈ Dhd ,<br />
τ ′ (j) = τ(j) if i �= j ,<br />
i ′ = i if s ′ ∈ Btape ,<br />
i ′ = i − 1 if s ′ = L ,<br />
i ′ = i + 1 if s ′ = R .<br />
Let T = (Q, δ, q 0 ) be a simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine. Then the step relati<strong>on</strong><br />
⊢T ⊆ (Q × Ctape × N) × (Q × Ctape × N) is defined by (q, τ, i) ⊢T (q ′ , τ ′ , i ′ )<br />
10
iff (q ′ , τ ′ , i ′ ) is next to (q, τ, i) in T . A computati<strong>on</strong> of T is a finite path<br />
〈(q0, τ0, i0), . . . , (qn, τn, in)〉 in ⊢T such that (q0, τ0, i0) is an initial c<strong>on</strong>figurati<strong>on</strong><br />
of T and (qn, τn, in) is a terminal c<strong>on</strong>figurati<strong>on</strong> of T . 5<br />
In the case of a simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine, the set of tape symbols is invariably<br />
Btape, the tape is a <strong>on</strong>e-way infinite tape, in each step either a tape cell is<br />
overwritten or the tape head is moved (but not both), input symbols are not<br />
distinguished and accepting states are not distinguished (for the roles of input<br />
symbols and accepting states, see e.g. [9]). The definiti<strong>on</strong>s given above can easily<br />
be adapted to the cases where the set of tape symbols is an arbitrary finite set,<br />
the tape is a two-way infinite tape, in each step made both a cell is overwritten<br />
and the tape head is moved, input symbols are distinguished and/or accepting<br />
states are distinguished. However, it happens that each <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine of the<br />
kinds resulting from such adaptati<strong>on</strong>s can be simulated by a simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine<br />
(for details, see e.g. [8, 7, 11, 9]). Hence, if each simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine can<br />
be simulated <strong>on</strong> a <strong>Maurer</strong> machine, then each <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine of those other<br />
kinds can be simulated <strong>on</strong> a <strong>Maurer</strong> machine as well.<br />
8 Simulati<strong>on</strong> of <str<strong>on</strong>g>Turing</str<strong>on</strong>g> <str<strong>on</strong>g>Machines</str<strong>on</strong>g><br />
In this secti<strong>on</strong>, we show a straightforward way to simulate simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines<br />
<strong>on</strong> a <strong>Maurer</strong> machine. Henceforth, simple <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines will shortly be<br />
called <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines.<br />
Assume that a fixed but arbitrary countably infinite set Mtape and a fixed<br />
but arbitrary bijecti<strong>on</strong> mtape : N → Mtape have been given. Mtape is called a tape<br />
memory. Let n ∈ N. Then we write Mtape[n] for mtape(n).<br />
The tape memory is an infinite memory of which the elements can be addressed<br />
by means of members of N. The elements of the tape memory c<strong>on</strong>tain 0,<br />
1 or �. We write Stape for the set of all functi<strong>on</strong>s Stape : Mtape → Btape for which<br />
there exists an n ∈ N such that for all m ∈ N with m ≥ n, Stape(Mtape[m]) = �.<br />
The <strong>Maurer</strong> machines TM , TM ′ and TM ′′ defined in this paper would not be<br />
<strong>Maurer</strong> machines if Stape was simply the set of all functi<strong>on</strong>s Stape : Mtape → Btape,<br />
for <strong>Maurer</strong> machines may not have states that differ in the c<strong>on</strong>tents of infinitely<br />
many memory elements.<br />
The memory of the <strong>Maurer</strong> machine TM used to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines<br />
c<strong>on</strong>sists of a tape memory (Mtape), a head positi<strong>on</strong> register (head) and a reply<br />
register (rr). Its instructi<strong>on</strong> set c<strong>on</strong>sists of two test instructi<strong>on</strong>s (Itest:0, Itest:1),<br />
two write instructi<strong>on</strong>s (Iwrite:0, Iwrite:1) and two move head instructi<strong>on</strong>s (Imovel,<br />
Imover). Each instructi<strong>on</strong> is associated with a basic acti<strong>on</strong>. The set of basic acti<strong>on</strong>s<br />
of TM c<strong>on</strong>sists of those basic acti<strong>on</strong>s.<br />
It is assumed that test:s, write:s ∈ A, for all s ∈ Btape, and mover, movel ∈ A.<br />
5 We interpret the usual remark “no left move is permitted when the read-write head<br />
is at the [left] boundary” (see e.g. [11]) as “when the read-write head is at the left<br />
boundary, a left move impedes making a step but does not give rise to halting”.<br />
11
TM is the <strong>Maurer</strong> machine (M, B, S, I, A, [ ]) such that<br />
M = Mtape ∪ {head, rr} ,<br />
B = Btape ∪ N ∪ B ,<br />
S = {S : M → B | S ↾ Mtape ∈ Stape ∧ S(head) ∈ N ∧ S(rr) ∈ B} ,<br />
I = {Itest:s, Iwrite:s | s ∈ Btape} ∪ {Imover, Imovel} ,<br />
A = {test:s, write:s | s ∈ Btape} ∪ {mover, movel} ,<br />
[a] = (Ia, rr) for all a ∈ A .<br />
Here, for each s ∈ Btape, Itest:s is the unique functi<strong>on</strong> from S to S such that for<br />
all S ∈ S:<br />
Itest:s(S) ↾ Mtape = S ↾ Mtape ,<br />
Itest:s(S)(head) = S(head) ,<br />
Itest:s(S)(rr) = T if S(Mtape[S(head)]) = s ,<br />
Itest:s(S)(rr) = F if S(Mtape[S(head)]) �= s ;<br />
for each s ∈ Btape, Iwrite:s is the unique functi<strong>on</strong> from S to S such that for all<br />
S ∈ S and n ∈ N:<br />
Iwrite:s(S)(Mtape[S(head)]) = s ,<br />
Iwrite:s(S)(Mtape[n]) = S(Mtape[n]) if S(head) �= n ,<br />
Iwrite:s(S)(head) = S(head) ,<br />
Iwrite:s(S)(rr) = T ;<br />
Imover is the unique functi<strong>on</strong> from S to S such that for all S ∈ S:<br />
Imover(S) ↾ Mtape = S ↾ Mtape ,<br />
Imover(S)(head) = S(head) + 1 ,<br />
Imover(S)(rr) = T ;<br />
and, Imovel is the unique functi<strong>on</strong> from S to S such that for all S ∈ S:<br />
Imovel(S) ↾ Mtape = S ↾ Mtape ,<br />
Imovel(S)(head) = S(head) − 1 if S(head) > 0 ,<br />
Imovel(S)(head) = 0 if S(head) = 0 ,<br />
Imovel(S)(rr) = T if S(head) > 0 ,<br />
Imovel(S)(rr) = F if S(head) = 0 .<br />
We write STM and ATM for the set of states of TM and the set of basic acti<strong>on</strong>s<br />
of TM , respectively.<br />
A <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread is a c<strong>on</strong>stant 〈X0|{X0 = t0, . . . , Xn = tn}〉 ∈ Tfinrec, where<br />
t0, . . . , tn are terms of the form t� test:0 �(t ′ � test:1 �t ′′ ) with t, t ′ and t ′′ of the<br />
form write:s ◦ X, mover ◦ X, X � movel � D or S (s ∈ Btape, X ∈ {X0, . . . , Xn}).<br />
Each <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine can be simulated <strong>on</strong> the <strong>Maurer</strong> machine TM by means<br />
of a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread p ∈ Tfinrec(ATM ).<br />
12
Theorem 1. Let T = (Q, δ, q 0 ) be a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine. Then there exists a <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
thread p ∈ Tfinrec(ATM ) such that for all computati<strong>on</strong>s c of T , there exists an<br />
S ∈ STM such that the computati<strong>on</strong> of p •TM S simulates c.<br />
Proof. Suppose that Q = {q0, . . . , qn}. Let E be the guarded recursive specificati<strong>on</strong><br />
{Xi = ti0 � test:0 � (ti1 � test:1 � t i�) | 0 ≤ i ≤ n}, where<br />
tis = write:s ′ ◦ Xj<br />
tis = mover ◦ Xj<br />
if δ(qi, s) = (qj, s ′ ) ∧ s ′ ∈ Btape ,<br />
if δ(qi, s) = (qj, R) ,<br />
tis = Xj � movel � D if δ(qi, s) = (qj, L) ,<br />
tis = S if ∃q ∈ Q • δ(qi, s) = (q, H) .<br />
Define φ : Q → Tfinrec(ATM ) by φ(qi) = 〈Xi|E〉 (0 ≤ i ≤ n). Clearly, φ(qi) is<br />
a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread. Define φ ′ : Ctape × N → STM by φ ′ (τ, i) is the unique state<br />
S ∈ STM such that S(Mtape[j]) = τ(j) for all j ∈ N, S(head) = i and S(rr) = T.<br />
Combine φ and φ ′ to φ ∗ : Q × Ctape × N → Tfinrec(ATM ) × STM defined by<br />
φ ∗ (q, τ, i) = (φ(q), φ ′ (τ, i)). Then we have (q, τ, i) ⊢T (q ′ , τ ′ , i ′ ) iff φ ∗ (q, τ, i) ⊢TM<br />
φ ∗ (q ′ , τ ′ , i ′ ). This is easily proved by distincti<strong>on</strong> between the following cases:<br />
δ(q, τ(i)) ∈ Q × Btape, δ(q, τ(i)) ∈ Q × {R}, δ(q, τ(i)) ∈ Q × {L}, δ(q, τ(i)) ∈<br />
Q × {H}. It follows immediately that, if c = 〈(q0, τ0, i0), . . . , (qn, τn, in)〉 is a<br />
computati<strong>on</strong> of T , the computati<strong>on</strong> of φ(q0) •TM φ ′ (τ0, i0) simulates c. ⊓⊔<br />
Looking at the instructi<strong>on</strong>s used in the simulati<strong>on</strong> of <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines <strong>on</strong> the<br />
<strong>Maurer</strong> machine TM , we observe that the test instructi<strong>on</strong>s Itest:s have an infinite<br />
input regi<strong>on</strong> and a finite output regi<strong>on</strong> and that the write instructi<strong>on</strong>s Iwrite:s<br />
have a finite input regi<strong>on</strong> and an infinite output regi<strong>on</strong>. It is easy to see that these<br />
infinite regi<strong>on</strong>s are essential for many <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines. For example, c<strong>on</strong>sider<br />
the <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine that, starting from head positi<strong>on</strong> 0, overwrites cells that hold<br />
0 with 1 and cells that hold 1 with 0 and halts when the first cell holding � is<br />
reached. Infinite input and output regi<strong>on</strong>s are essential for this <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine<br />
because the first cell holding � may occur anywhere <strong>on</strong> the tape and the <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
machine has <strong>on</strong>ly a finite-state c<strong>on</strong>trol. However, if we expand <str<strong>on</strong>g>Turing</str<strong>on</strong>g> threads to<br />
threads definable by infinite recursive specificati<strong>on</strong>s, we can simulate all <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
machines using test and write instructi<strong>on</strong>s with a finite input regi<strong>on</strong> and a finite<br />
output regi<strong>on</strong>.<br />
9 Using Instructi<strong>on</strong>s with Finite Input & Output Regi<strong>on</strong>s<br />
In order to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines using test and write instructi<strong>on</strong>s with a<br />
finite input regi<strong>on</strong> and a finite output regi<strong>on</strong>, we have to adapt the <strong>Maurer</strong><br />
machine TM . Moreover, for each <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine, we have to adapt the corresp<strong>on</strong>ding<br />
<str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread. It happens that the <str<strong>on</strong>g>Turing</str<strong>on</strong>g> threads can be adapted in<br />
a uniform way.<br />
We adapt the <strong>Maurer</strong> machine TM by removing the head positi<strong>on</strong> register<br />
head from the memory and the move head instructi<strong>on</strong>s Imovel and Imover from<br />
the instructi<strong>on</strong> set. In additi<strong>on</strong>, we replace each test instructi<strong>on</strong> Itest:s by a test<br />
13
instructi<strong>on</strong> Itest:s:n for each n ∈ N, and each write instructi<strong>on</strong> Iwrite:s by a write<br />
instructi<strong>on</strong> Iwrite:s:n for each n ∈ N. Each instructi<strong>on</strong> is associated with a basic<br />
acti<strong>on</strong>. We replace the basic acti<strong>on</strong>s of TM by those basic acti<strong>on</strong>s.<br />
It is assumed that test:s:n, write:s:n ∈ A for all s ∈ Btape and n ∈ N.<br />
TM ′ is the <strong>Maurer</strong> machine (M, B, S, I, A, [ ]) such that<br />
M = Mtape ∪ {rr} ,<br />
B = Btape ∪ B ,<br />
S = {S : M → B | S ↾ Mtape ∈ Stape ∧ S(rr) ∈ B} ,<br />
I = {Itest:s:n, Iwrite:s:n | s ∈ Btape ∧ n ∈ N} ,<br />
A = {test:s:n, write:s:n | s ∈ Btape ∧ n ∈ N} ,<br />
[a] = (Ia, rr) for all a ∈ A .<br />
Here, for each s ∈ Btape and n ∈ N, Itest:s:n is the unique functi<strong>on</strong> from S to S<br />
such that for all S ∈ S:<br />
Itest:s:n(S) ↾ Mtape = S ↾ Mtape ,<br />
Itest:s:n(S)(rr) = T if S(Mtape[n]) = s ,<br />
Itest:s:n(S)(rr) = F if S(Mtape[n]) �= s ;<br />
for each s ∈ Btape and n ∈ N, Iwrite:s:n is the unique functi<strong>on</strong> from S to S such<br />
that for all S ∈ S and m ∈ N:<br />
Iwrite:s:n(S)(Mtape[n]) = s ,<br />
Iwrite:s:n(S)(Mtape[m]) = S(Mtape[m]) if n �= m ,<br />
Iwrite:s:n(S)(rr) = T .<br />
We write STM ′ and ATM ′ for the set of states of TM ′ and the set of basic acti<strong>on</strong>s<br />
of TM ′ , respectively.<br />
Let 〈X0|E〉, where E = {X0 = t0, . . . , Xn = tn}, be a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread, let<br />
i ∈ {0, . . . , n}, and let k ∈ N. Moreover, let T0 be the set of all subterms<br />
of a term t ∈ Tfinrec for which t0 = t is derivable from E. Then the relati<strong>on</strong><br />
HPXi ⊆ T0 × (N ∪ {−1}) is inductively defined as follows:<br />
– if Xi ∈ T0, then HPXi(Xi, 0);<br />
– if HPXi (t, l), t � test:s � t′ ∈ T0 and l ≥ 0, then HPXi (t � test:s � t′ , l);<br />
– if HPXi (t, l), t′ � test:s � t ∈ T0 and l ≥ 0, then HPXi (t′ � test:s � t, l);<br />
– if HPXi(t, l), write:s ◦ t ∈ T0 and l ≥ 0, then HPXi(write:s ◦ t, l);<br />
– if HPXi(t, l), mover ◦ t ∈ T0 and l ≥ 0, then HPXi(mover ◦ t, l + 1);<br />
– if HPXi (t, l), t � movel � D ∈ T0 and l ≥ 0, then HPXi (t � movel � D, l − 1).<br />
We write X0 k −→E Xi to indicate that there exist a t ∈ Tfinrec such that t0 = t<br />
is derivable from E and HPXi (t, k) holds. The recursive specificati<strong>on</strong> ψ(E) is<br />
inductively defined as follows:<br />
– if X0 k −→E Xi, then Xik =tik ∈ ψ(E),<br />
where tik is obtained from ti by applying the following replacement rules:<br />
14
• test:s is replaced by test:s:k;<br />
• write:s ◦ Xj is replaced by write:s:k ◦ Xjk;<br />
• mover ◦ Xj is replaced by Xjl, where l = k + 1;<br />
• if k �= 0, then Xj � movel � D is replaced by Xjl, where l = k − 1;<br />
• if k = 0, then Xj � movel � D is replaced by D.<br />
We write ψ(〈X0|E〉) for 〈X00|ψ(E)〉.<br />
The variables of a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread p corresp<strong>on</strong>d to the states of a <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
machine. If the head positi<strong>on</strong> is made part of the instructi<strong>on</strong>s, a different copy<br />
of a state is needed for each different head positi<strong>on</strong> that may occur when the<br />
<str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine enters that state. The variables of ψ(p) corresp<strong>on</strong>d to those new<br />
states. C<strong>on</strong>sequently, applying <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread p to <strong>Maurer</strong> machine TM from<br />
some state of TM has the same effect as applying ψ(p) to <strong>Maurer</strong> machine TM ′<br />
from the corresp<strong>on</strong>ding state of TM ′ .<br />
Theorem 2. Let p be a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread, and let S0 ∈ STM and S ′ 0 ∈ S ′ TM<br />
be such<br />
that S0 ↾(Mtape ∪{rr}) = S ′ 0 and S0(head) = 0. Then (p•TM S0)↾(Mtape ∪{rr}) =<br />
ψ(p) •TM ′ S′ 0.<br />
Proof. It is easy to see that for all S ∈ STM :<br />
Itest:s(S) ↾ (Mtape ∪ {rr}) = Itest:s:n(S ↾ (Mtape ∪ {rr})) ,<br />
Iwrite:s(S) ↾ (Mtape ∪ {rr}) = Iwrite:s:n(S ↾ (Mtape ∪ {rr})) ,<br />
Imover(S) ↾ Mtape<br />
Imovel(S) ↾ Mtape<br />
= S ↾ Mtape ,<br />
= S ↾ Mtape ,<br />
where n = S(head).<br />
Let (pn, Sn) be the n+1-th element in the full path of p •TM S0 of which<br />
the first comp<strong>on</strong>ent equals S, D or q � test:0 � r for some q, r ∈ Tfinrec, and let<br />
(p ′ n, S ′ n) be the n+1-th element in the full path of ψ(p) •TM ′ (S0 ↾ (Mtape ∪ {rr}))<br />
of which the first comp<strong>on</strong>ent equals S, D or q ′ � test:0:k � r ′ for some k ∈ N and<br />
q ′ , r ′ ∈ Tfinrec. Then, using the above equati<strong>on</strong>s, it is straightforward to prove by<br />
inducti<strong>on</strong> <strong>on</strong> n that:<br />
– pn = q � test:0 � r and Sn(head) = k iff p ′ n = q ′ � test:0:k � r ′ with q ′ and<br />
r ′ obtained from q and r by applying the replacement rules given in the<br />
definiti<strong>on</strong> of ψ above;<br />
– Sn ↾ (Mtape ∪ {rr}) = S ′ n.<br />
(for n < |p •TM S0| if p •TM S0 is c<strong>on</strong>vergent). From this, the theorem follows<br />
immediately. ⊓⊔<br />
Theorem 2 deals <strong>on</strong>ly with the case where the initial head positi<strong>on</strong> is 0. This is<br />
sufficient to c<strong>on</strong>clude that each <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine can be simulated <strong>on</strong> the <strong>Maurer</strong><br />
machine TM ′ by means of an adapted <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread, for each <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine<br />
can be simulated by a (simple) <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine of which the initial head positi<strong>on</strong><br />
is restricted to 0.<br />
15
C<strong>on</strong>sider again the <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine that, starting from head positi<strong>on</strong> 0, overwrites<br />
cells that hold 0 with 1 and cells that hold 1 with 0 and halts when<br />
the first cell holding � is reached. The <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread that corresp<strong>on</strong>ds to the<br />
finite-state c<strong>on</strong>trol of this <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine is the c<strong>on</strong>stant 〈X0|E〉, where<br />
E = {X0 = write:1 ◦ X1 � test:0 � (write:0 ◦ X1 � test:1 � S),<br />
X1 = mover ◦ X0 � test:0 � (mover ◦ X0 � test:1 � mover ◦ X0)} .<br />
k<br />
Clearly, X0 −→E X0 for each k ∈ N. C<strong>on</strong>sequently, in this case ψ(E) is an<br />
infinite-state thread. We will show in Secti<strong>on</strong> 10 that, when simulating <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
machines <strong>on</strong> a <strong>Maurer</strong> machine using test and write instructi<strong>on</strong>s with a finite<br />
input regi<strong>on</strong> and a finite output regi<strong>on</strong>, we can get around infinite-state threads<br />
in the case of c<strong>on</strong>vergent computati<strong>on</strong>s.<br />
Hitherto, the results c<strong>on</strong>cerning the simulati<strong>on</strong> of <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines are closely<br />
related to well-known facts about <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines. In <strong>Maurer</strong>’s terminology, the<br />
facts c<strong>on</strong>cerned can be phrased as follows:<br />
– the instructi<strong>on</strong> implicitly executed by a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine <strong>on</strong> a test step has<br />
an infinite input regi<strong>on</strong> and a finite output regi<strong>on</strong>;<br />
– the instructi<strong>on</strong> implicitly executed by a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine <strong>on</strong> a write step has<br />
a finite input regi<strong>on</strong> and an infinite output regi<strong>on</strong>;<br />
– these instructi<strong>on</strong>s can be replaced by instructi<strong>on</strong>s with a finite input regi<strong>on</strong><br />
and a finite output regi<strong>on</strong> if we allow <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines with an infinite set<br />
of states.<br />
10 Using a Multi-thread and Thread Forking<br />
In this secti<strong>on</strong>, we show a way to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines <strong>on</strong> a <strong>Maurer</strong> machine<br />
using test and write instructi<strong>on</strong>s with a finite input regi<strong>on</strong> and a finite<br />
output regi<strong>on</strong> that gets around infinite-state threads in the case of c<strong>on</strong>vergent<br />
computati<strong>on</strong>s. The basic ideas behind it are as follows:<br />
– the thread corresp<strong>on</strong>ding to the finite-state c<strong>on</strong>trol of the <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine<br />
in questi<strong>on</strong> is stored and then executed under c<strong>on</strong>trol of a multi-thread that<br />
makes the head positi<strong>on</strong> part of the instructi<strong>on</strong>s;<br />
– this multi-thread forks off for every head positi<strong>on</strong> a c<strong>on</strong>trol thread of itself<br />
<strong>on</strong> the head reaching the preceding positi<strong>on</strong> for the first time.<br />
By using thread forking in this way, the executi<strong>on</strong> remains c<strong>on</strong>trolled by a finite<br />
thread if the computati<strong>on</strong> c<strong>on</strong>cerned is c<strong>on</strong>vergent. Although it is not necessary<br />
to get around infinite-state threads, the head positi<strong>on</strong> register head will be<br />
replaced by a countably infinite memory.<br />
It is assumed that a fixed but arbitrary countably infinite set Mhd and a<br />
fixed but arbitrary bijecti<strong>on</strong> mhd : N → Mhd have been given. Mhd is called a<br />
head positi<strong>on</strong> memory. Let n ∈ N. Then we write Mhd[n] for mhd(n). Mhd is an<br />
infinite memory of which the elements can be addressed by means of members of<br />
16
N. The elements of Mhd c<strong>on</strong>tain T or F. We write Shd for the set of all functi<strong>on</strong>s<br />
Shd : Mhd → B for which there exists an n ∈ N such that Shd(Mhd[n]) = T and<br />
for all m ∈ N with m �= n, Shd(Mhd[m]) = F. Mhd will be used in such a way<br />
that the head positi<strong>on</strong> is always the unique n for which Mhd[n] c<strong>on</strong>tains T. The<br />
memory of the simulating <strong>Maurer</strong> machine remains countably infinite if head is<br />
replaced by Mhd. The replacement achieves that, for each memory element, all<br />
possible c<strong>on</strong>tents bel<strong>on</strong>g to a finite set.<br />
The <strong>Maurer</strong> machine TM ′′ defined below would not be a <strong>Maurer</strong> machine if<br />
Shd was simply the set of all functi<strong>on</strong>s Shd : Mhd → B, for <strong>Maurer</strong> machines may<br />
not have states that differ in the c<strong>on</strong>tents of infinitely many memory elements.<br />
We adapt the <strong>Maurer</strong> machine TM by extending the memory with a thread<br />
memory (Mthr), a thread locati<strong>on</strong> register (tlr) and a basic acti<strong>on</strong> register (bar),<br />
and the instructi<strong>on</strong> set with a halt instructi<strong>on</strong> (Ihalt), a fetch instructi<strong>on</strong> (Ifetch),<br />
an execute stored basic acti<strong>on</strong> instructi<strong>on</strong> (Iexsba:n) for each n ∈ N, an test executi<strong>on</strong><br />
mode instructi<strong>on</strong> (Itestem), and a test head positi<strong>on</strong> instructi<strong>on</strong> (Itesthp:n) for<br />
each n ∈ N. Each of these extra instructi<strong>on</strong>s is associated with a basic acti<strong>on</strong>.<br />
We replace the basic acti<strong>on</strong>s of TM by those basic acti<strong>on</strong>s. In additi<strong>on</strong>, we replace<br />
the head positi<strong>on</strong> register head by a head positi<strong>on</strong> memory Mhd, each test<br />
instructi<strong>on</strong> Itest:s by a test instructi<strong>on</strong> Itest:s:n for each n ∈ N, and each write<br />
instructi<strong>on</strong> Iwrite:s by a write instructi<strong>on</strong> Iwrite:s:n for each n ∈ N.<br />
The thread memory Mthr is meant for storing a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread p. Processing of<br />
a basic acti<strong>on</strong> performed by p now amounts to first fetching the basic acti<strong>on</strong> from<br />
Mthr in the basic acti<strong>on</strong> register bar and then executing the basic acti<strong>on</strong> in bar.<br />
The thread locati<strong>on</strong> register tlr is meant for c<strong>on</strong>taining the address of the thread<br />
memory element from which most recently a basic acti<strong>on</strong> has been fetched.<br />
The c<strong>on</strong>tents of that thread memory element, together with the reply produced<br />
at completi<strong>on</strong> of the executi<strong>on</strong> of the basic acti<strong>on</strong> c<strong>on</strong>cerned, determines the<br />
thread memory element from which next time a basic acti<strong>on</strong> must be fetched.<br />
To indicate that no basic acti<strong>on</strong> has been fetched yet, tlr must initially c<strong>on</strong>tain<br />
−1. The thread memory element from which the first time a basic acti<strong>on</strong> must<br />
be fetched is the <strong>on</strong>e at address 0. The instructi<strong>on</strong> Iexsba:n allows for making the<br />
head positi<strong>on</strong> part of the instructi<strong>on</strong> that corresp<strong>on</strong>ds to the basic acti<strong>on</strong> in bar.<br />
The instructi<strong>on</strong> Itesthp:n is meant for testing whether the head positi<strong>on</strong> is n. The<br />
instructi<strong>on</strong> Itestem allows for testing whether the executi<strong>on</strong> of the stored <str<strong>on</strong>g>Turing</str<strong>on</strong>g><br />
thread has not yet come to an end.<br />
Once again, it is assumed that test:s, write:s ∈ A, for all s ∈ Btape, and<br />
mover, movel ∈ A. Moreover, it is assumed that testem, halt, fetch ∈ A and<br />
testhp:n, exsba:n ∈ A for all n ∈ N.<br />
TM ′′ is the <strong>Maurer</strong> machine (M, B, S, I, A, [ ]) such that<br />
M = Mtape ∪ Mhd ∪ Mthr ∪ {tlr, bar, rr} ,<br />
B = Btape ∪ B ∪ Bthr ∪ Athr ∪ {−1} ∪ ATM ,<br />
S = {S : M → B |<br />
S ↾ Mtape ∈ Stape ∧ S ↾ Mhd ∈ Shd ∧ S ↾ Mthr ∈ Sthr ∧<br />
S(tlr) ∈ Athr ∪ {−1} ∧ S(bar) ∈ ATM ∧ S(rr) ∈ B} ,<br />
17
I = {Itest:s:n, Iwrite:s:n | s ∈ Btape ∧ n ∈ N} ∪ {Imover, Imovel}<br />
∪ {Itestem, Ihalt, Ifetch} ∪ {Itesthp:n, Iexsba:n | n ∈ N} ,<br />
A = {testem, halt, fetch} ∪ {testhp:n, exsba:n | n ∈ N} ,<br />
[a] = (Ia, rr) for all a ∈ A .<br />
Here, Itestem is the unique functi<strong>on</strong> from S to S such that for all S ∈ S:<br />
Itestem(S) ↾ Mtape = S ↾ Mtape ,<br />
Itestem(S) ↾ Mhd = S ↾ Mhd ,<br />
Itestem(S) ↾ Mthr = S ↾ Mthr ,<br />
Itestem(S)(tlr) = S(tlr) ,<br />
Itestem(S)(bar) = S(bar) ,<br />
Itestem(S)(rr) = T if S(Mthr[S(tlr)]) ∈ {S, D} ,<br />
Itestem(S)(rr) = F if S(Mthr[S(tlr)]) �∈ {S, D} ;<br />
Ihalt is the unique functi<strong>on</strong> from S to S such that for all S ∈ S:<br />
Ihalt(S) ↾ Mtape = S ↾ Mtape ,<br />
Ihalt(S) ↾ Mhd = S ↾ Mhd ,<br />
Ihalt(S) ↾ Mthr = S ↾ Mthr ,<br />
Ihalt(S)(tlr) = S(tlr) ,<br />
Ihalt(S)(bar) = S(bar) ,<br />
Ihalt(S)(rr) = T if S(Mthr[S(tlr)]) = S ,<br />
Ihalt(S)(rr) = F if S(Mthr[S(tlr)]) �= S ;<br />
Ifetch is the unique functi<strong>on</strong> from S to S such that for all S ∈ S:<br />
Ifetch(S) ↾ Mtape = S ↾ Mtape ,<br />
Ifetch(S) ↾ Mhd = S ↾ Mhd ,<br />
Ifetch(S) ↾ Mthr = S ↾ Mthr ,<br />
Ifetch(S)(tlr) = ntl(S, r) ,<br />
Ifetch(S)(bar) = π2(S(Mthr[ntl(S, r)])) if S(Mthr[ntl(S, r)]) �∈ {S, D} ,<br />
Ifetch(S)(bar) = S(bar) if S(Mthr[ntl(S, r)]) ∈ {S, D} ,<br />
Ifetch(S)(rr) = T if S(Mthr[ntl(S, r)]) �∈ {S, D} ,<br />
Ifetch(S)(rr) = F if S(Mthr[ntl(S, r)]) ∈ {S, D} ,<br />
where r = S(rr) and ntl : S × B → Athr is defined as follows:<br />
ntl(S, T) = π1(S(Mthr[S(tlr)])) if S(tlr) ∈ Athr ∧ S(Mthr[S(tlr)]) �∈ {S, D} ,<br />
ntl(S, F) = π3(S(Mthr[S(tlr)])) if S(tlr) ∈ Athr ∧ S(Mthr[S(tlr)]) �∈ {S, D} ,<br />
ntl(S, r ′ ) = S(tlr) if S(tlr) ∈ Athr ∧ S(Mthr[S(tlr)]) ∈ {S, D} ,<br />
ntl(S, r ′ ) = 0 if S(tlr) �∈ Athr ;<br />
18
for each n ∈ N, Itesthp:n is the unique functi<strong>on</strong> from S to S such that for all<br />
S ∈ S:<br />
Itesthp:n(S) ↾ Mtape = S ↾ Mtape ,<br />
Itesthp:n(S) ↾ Mhd = S ↾ Mhd ,<br />
Itesthp:n(S) ↾ Mthr = S ↾ Mthr ,<br />
Itesthp:n(S)(tlr) = S(tlr) ,<br />
Itesthp:n(S)(bar) = S(bar) ,<br />
Itesthp:n(S)(rr) = S(Mhd[n]) ;<br />
for each n ∈ N, Iexsba:n is the unique functi<strong>on</strong> from S to S such that for all S ∈ S:<br />
Iexsba:n(S) = tmi(S(bar), n)(S) ,<br />
where tmi : ATM × N → I is defined as follows:<br />
tmi(test:s, n) = Itest:s:n ,<br />
tmi(write:s, n) = Iwrite:s:n ,<br />
tmi(mover, n) = Imover ,<br />
tmi(movel, n) = Imovel ;<br />
for each s ∈ Btape and n ∈ N, Itest:s:n is the unique functi<strong>on</strong> from S to S such<br />
that for all S ∈ S:<br />
Itest:s:n(S) ↾ Mtape = S ↾ Mtape ,<br />
Itest:s:n(S) ↾ Mhd = S ↾ Mhd ,<br />
Itest:s:n(S) ↾ Mthr = S ↾ Mthr ,<br />
Itest:s:n(S)(tlr) = S(tlr) ,<br />
Itest:s:n(S)(bar) = S(bar) ,<br />
Itest:s:n(S)(rr) = T if S(Mtape[n]) = s ,<br />
Itest:s:n(S)(rr) = F if S(Mtape[n]) �= s ;<br />
for each s ∈ Btape and n ∈ N, Iwrite:s:n is the unique functi<strong>on</strong> from S to S such<br />
that for all S ∈ S and m ∈ N:<br />
Iwrite:s:n(S)(Mtape[n]) = s ,<br />
Iwrite:s:n(S)(Mtape[m]) = S(Mtape[m]) if n �= m ,<br />
Iwrite:s:n(S) ↾ Mhd<br />
Iwrite:s:n(S) ↾ Mthr<br />
= S ↾ Mhd ,<br />
= S ↾ Mthr ,<br />
Iwrite:s:n(S)(tlr) = S(tlr) ,<br />
Iwrite:s:n(S)(bar) = S(bar) ,<br />
Iwrite:s:n(S)(rr) = T ;<br />
19
Imover is the unique functi<strong>on</strong> from S to S such that for all S ∈ S:<br />
Imover(S) ↾ Mtape = S ↾ Mtape ,<br />
Imover(S) ↾ Mhd = shiftr(S ↾ Mhd) ,<br />
Imover(S) ↾ Mthr = S ↾ Mthr ,<br />
Imover(S)(tlr) = S(tlr) ,<br />
Imover(S)(bar) = S(bar) ,<br />
Imover(S)(rr) = T ,<br />
where shiftr : Shd → Shd is defined as follows (n ∈ N):<br />
shiftr(S)(Mhd[0]) = F ,<br />
shiftr(S)(Mhd[n + 1]) = S(Mhd[n]) ;<br />
and, Imovel is the unique functi<strong>on</strong> from S to S such that for all S ∈ S:<br />
Imovel(S) ↾ Mtape = S ↾ Mtape ,<br />
Imovel(S) ↾ Mhd = shiftl(S ↾ Mhd) ,<br />
Imovel(S) ↾ Mthr = S ↾ Mthr ,<br />
Imovel(S)(tlr) = S(tlr) ,<br />
Imovel(S)(bar) = S(bar) ,<br />
Imovel(S)(rr) = ¬ S(Mhd[0]) ,<br />
where shiftl : Shd → Shd is defined as follows (n ∈ N):<br />
shiftl(S)(Mhd[0]) = T if S(Mhd[0]) = T ,<br />
shiftl(S)(Mhd[0]) = S(Mhd[1]) if S(Mhd[0]) = F ,<br />
shiftl(S)(Mhd[n + 1]) = S(Mhd[n + 2]) .<br />
Let n ∈ N, and let CE n be the guarded recursive specificati<strong>on</strong> over BTA that<br />
c<strong>on</strong>sists of the following equati<strong>on</strong>s:<br />
CT n = (nt(n + 1) ◦ CT ′ n) � testhp:n � (CT n � testem � S) ,<br />
CT ′ n = (exsba:n ◦ CT ′′ n) � fetch � (S � halt � D) ,<br />
CT ′′ n = CT ′ n � testhp:n � (CT ′′ n � testem � S) .<br />
Moreover, take the functi<strong>on</strong> φ from N to Tfinrec defined by φ(n) = 〈CT n|CE n〉<br />
as the thread forking functi<strong>on</strong>. Then applying <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread p to the <strong>Maurer</strong><br />
machine TM from some state of TM in which the head positi<strong>on</strong> is 0 has the<br />
same effect as applying � f (〈CT 0〉) to the <strong>Maurer</strong> machine TM ′′ from the corresp<strong>on</strong>ding<br />
state of TM ′′ in which the thread memory c<strong>on</strong>tains the stored graph<br />
representati<strong>on</strong> of p.<br />
Theorem 3. Let p be a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> thread such that size(p) ≤ size(Mthr), and let<br />
S0 ∈ STM and S ′′<br />
0 ∈ STM ′′ be such that S0 ↾ (Mtape ∪ {rr}) = S ′′<br />
0 ↾ (Mtape ∪ {rr}),<br />
20
S0(head) = 0, S ′′<br />
0 (Mhd[0]) = T, S0 ↾ Mthr[0, size(p) − 1] = sthr(p), S0(tlr) = −1.<br />
Then (p •TM S0) ↾ (Mtape ∪ {rr}) = (�f (〈CT 0〉) •TM ′′ S′′<br />
0 ) ↾ (Mtape ∪ {rr}) and, for<br />
all n ∈ N, (p •TM S0)(head) = n iff (�f (〈CT 0〉) •TM ′′ S′′ 0 )(Mhd[n]) = T.<br />
Proof. It is easy to see that for all S ∈ STM , S ′′ ∈ STM ′′ and n, n′ ∈ N such<br />
that S ↾ (Mtape ∪ {rr}) = S ′′ ↾ (Mtape ∪ {rr}), S(head) = n and S ′′ (Mhd[n]) = T:<br />
Itest:s(S) ↾ (Mtape ∪ {rr}) = Itest:s:n(S ′′ ) ↾ (Mtape ∪ {rr}) ,<br />
Iwrite:s(S) ↾ (Mtape ∪ {rr}) = Iwrite:s:n(S ′′ ) ↾ (Mtape ∪ {rr}) ,<br />
Imover(S) ↾ (Mtape ∪ {rr}) = Imover(S ′′ ) ↾ (Mtape ∪ {rr}) ,<br />
Imovel(S) ↾ (Mtape ∪ {rr}) = Imovel(S ′′ ) ↾ (Mtape ∪ {rr}) ,<br />
Itest:s(S)(head) = n ′ iff Itest:s:n(S ′′ )(Mhd[n ′ ]) = T ,<br />
Iwrite:s(S)(head) = n ′ iff Iwrite:s:n(S ′′ )(Mhd[n ′ ]) = T ,<br />
Imover(S)(head) = n ′ iff Imover(S ′′ )(Mhd[n ′ ]) = T ,<br />
Imovel(S)(head) = n ′ iff Imovel(S ′′ )(Mhd[n ′ ]) = T .<br />
Let (� f (〈CT 0〉), S ′′<br />
0 ) ⊢ ∗ TM ′′ (� f (〈p1〉 � . . . � 〈pl〉), S ′′ ). Then we have for all<br />
i, j ∈ [1, l], n ∈ N and s ∈ Btape:<br />
1. (a) if pi ∈ CT n and pj ∈ CT n, then i = j,<br />
(b) nt(n + 1) ◦ CT ′ n ∈ pi iff n = max({m | ∃k ∈ [1, l] • pk ∈ CT m});<br />
2. if S ′′ (Mhd[n]) = T, then:<br />
(a) there exists a unique k ∈ [1, l] such that pk ∈ CT n,<br />
(b) for all k ′ ∈ [1, l] and n ′ ∈ N, n ′ �= n implies pk ′ �∈ CT ′ n ′;<br />
3. if S ′′ (Mhd[n]) = T, pi ∈ CT n, pi �≡ S and pi �≡ D, then there exist a T ′′ ∈<br />
STM ′′ and p′ 1 ∈ p1, . . . , p ′ i−1 ∈ pi−1 such that (� f (〈p1〉�. . .�〈pl〉), S ′′ ) ⊢ ∗ TM ′′<br />
(� f (〈pi〉 � . . . � 〈pl〉 � 〈p ′ 1〉 � . . . � 〈p ′ i−1 〉), T ′′ ) and T ′′ ↾ Mtape = S ′′ ↾ Mtape<br />
and T ′′ (Mhd[n]) = T;<br />
4. if S ′′ (Mhd[n]) = T and p1 ≡ CT n, then there exists a T ′′ ∈ STM ′′ such that<br />
(�f (〈p1〉 �. . . �〈pl〉), S ′′ ) ⊢∗ TM ′′ (�f (〈CT n+1〉 �〈CT ′ n〉 �〈p2〉 �. . . �〈pl〉), T ′′ )<br />
and T ′′ ↾ Mtape = S ′′ ↾ Mtape and T ′′ (Mhd[n]) = T;<br />
5. if S ′′ (Mhd[n]) = T, p1 ≡ CT ′ n and S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))]) �∈ {S, D}, then:<br />
(a) if π2(S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))])) = test:s, then there exists a T ′′ ∈ STM ′′<br />
such that (�f (〈p1〉�. . .�〈pl〉), S ′′ ) ⊢∗ TM ′′ (�f (〈CT ′′ n〉�〈p2〉�. . .�〈pl〉), T ′′ )<br />
and T ′′ ↾(Mtape ∪{rr}) = Itest:s:n(S ′′ )↾(Mtape ∪{rr}) and T ′′ (Mhd[n]) = T;<br />
(b) if π2(S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))])) = write:s, then there exists a T ′′ ∈ STM ′′<br />
such that (�f (〈p1〉�. . .�〈pl〉), S ′′ ) ⊢∗ TM ′′ (�f (〈CT ′′ n〉�〈p2〉�. . .�〈pl〉), T ′′ )<br />
and T ′′ ↾(Mtape∪{rr}) = Iwrite:s:n(S ′′ )↾(Mtape∪{rr}) and T ′′ (Mhd[n]) = T;<br />
(c) if π2(S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))])) = mover, then there exist a T ′′ ∈ STM ′′<br />
and p ′ 2 ∈ p2, . . . , p ′ l ∈ pl such that (�f (〈p1〉 � . . . � 〈pl〉), S ′′ ) ⊢∗ TM ′′<br />
(�f (〈p ′ �<br />
2〉 . . . � 〈p ′ l 〉 � 〈CT ′′ n〉), T ′′ ) and T ′′ ↾ (Mtape ∪ {rr}) = Imover(S ′′ ) ↾<br />
(Mtape ∪ {rr}) and T ′′ (Mhd[n + 1]) = T;<br />
21
(d) if π2(S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))])) = movel, then there exist a T ′′ ∈ STM ′′<br />
and p ′ 2 ∈ p2, . . . , p ′ l ∈ pl such that (� f (〈p1〉 � . . . � 〈pl〉), S ′′ ) ⊢ ∗ TM ′′<br />
(� f (〈p ′ 2〉 � . . . � 〈p ′ l 〉 � 〈CT ′′ n〉), T ′′ ) and T ′′ ↾ (Mtape ∪ {rr}) = Imovel(S ′′ ) ↾<br />
(Mtape ∪ {rr}) and either n > 0 and T ′′ (Mhd[n − 1]) = T or n = 0 and<br />
T ′′ (Mhd[n]) = T;<br />
6. if S ′′ (Mhd[n]) = T, p1 ≡ CT ′ n and S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))]) ∈ {S, D}, then:<br />
(a) if S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))]) = S, then there exists a T ′′ ∈ STM ′′ such<br />
that (�f (〈p1〉 � . . . � 〈pl〉), S ′′ ) ⊢∗ TM ′′ (S, T ′′ ) and T ′′ ↾ Mtape = S ′′ ↾ Mtape<br />
and T ′′ (Mhd[n]) = T;<br />
(b) if S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))]) = D, then there exists a T ′′ ∈ STM ′′ such<br />
that (�f (〈p1〉 � . . . � 〈pl〉), S ′′ ) ⊢∗ TM ′′ (D, T ′′ ) and T ′′ ↾ Mtape = S ′′ ↾ Mtape<br />
and T ′′ (Mhd[n]) = T;<br />
7. if S ′′ (Mhd[n]) = T and p1 ≡ CT ′′ n, then there exist a T ′′ ∈ STM ′′ and p′ 2 ∈ p2,<br />
. . . , p ′ l ∈ pl such that (�f (〈p1〉 � . . . � 〈pl〉), S ′′ ) ⊢∗ TM ′′ (�f (〈CT ′ �<br />
n〉 〈p ′ �<br />
2〉<br />
. . . � 〈p ′ l 〉), T ′′ ) and T ′′ ↾ Mtape = S ′′ ↾ Mtape and T ′′ (Mhd[n]) = T.<br />
Property 1 is easily proved by inducti<strong>on</strong> <strong>on</strong> m. Using property 1, property 2 is<br />
easily proved by inducti<strong>on</strong> <strong>on</strong> n. Using properties 1 and 2, property 3 is easily<br />
proved by case distincti<strong>on</strong> between the different forms p1, . . . , pl can take. Using<br />
properties 1 and 2, the remaining properties are easily proved by case distincti<strong>on</strong><br />
between the different forms p2, . . . , pl can take.<br />
Let (pm, Sm) be the m+1-th element in the full path of p•TM S0, let (p ′′<br />
0, S ′′<br />
0 )<br />
be the first element in the full path of �f (〈CT 0〉) •TM ′′ S′′ 0 , and let (p ′′ m+1, S ′′ m+1)<br />
be the element in the full path of �f (〈CT 0〉) •TM ′′ S′′ 0 that follows the m+1-th<br />
element of which the first comp<strong>on</strong>ent equals �f (〈exsba:n ◦ CT ′′ �<br />
n〉 α) for some<br />
n ∈ N and α ∈ Tfinrec ∗ . Then, using the above equati<strong>on</strong>s and other properties, it<br />
is straightforward to prove by inducti<strong>on</strong> <strong>on</strong> m that:<br />
– pm is represented by the part of sthr(p) to which ntl(S ′′ m, S ′′ m(rr)) points;<br />
– Sm ↾ (Mtape ∪ {rr}) = S ′′ m ↾ (Mtape ∪ {rr}) and for all n ∈ N, Sm(head) = n iff<br />
S ′′ m(Mhd[n]) = T.<br />
(for m < |p •TM S0| if p •TM S0 is c<strong>on</strong>vergent). From this, the theorem follows<br />
immediately. ⊓⊔<br />
The way to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines <strong>on</strong> a <strong>Maurer</strong> machine described in<br />
this secti<strong>on</strong> involves interleaving of the threads in a thread vector. The thread<br />
vector c<strong>on</strong>cerned c<strong>on</strong>sists of finite-state threads <strong>on</strong>ly. Initially, the thread vector<br />
c<strong>on</strong>sists of <strong>on</strong>e thread. The length of the thread vector usually increases during<br />
executi<strong>on</strong>. However, we c<strong>on</strong>clude from Theorem 3 and the definiti<strong>on</strong> of the apply<br />
operator that it remains finite if the computati<strong>on</strong> c<strong>on</strong>cerned is c<strong>on</strong>vergent.<br />
In Secti<strong>on</strong> 8, the instructi<strong>on</strong>s used to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines includes<br />
instructi<strong>on</strong>s with an infinite input regi<strong>on</strong> and instructi<strong>on</strong>s with an infinite output<br />
regi<strong>on</strong>. In Secti<strong>on</strong> 9, <strong>on</strong>ly instructi<strong>on</strong>s with a finite input regi<strong>on</strong> and a finite<br />
output regi<strong>on</strong> are used together with adapted <str<strong>on</strong>g>Turing</str<strong>on</strong>g> threads. However, another<br />
kind of infinity arises: the adaptati<strong>on</strong> turns many <str<strong>on</strong>g>Turing</str<strong>on</strong>g> threads, which are<br />
finite-state threads, into infinite-state threads. In this secti<strong>on</strong>, the adaptati<strong>on</strong> of<br />
22
<str<strong>on</strong>g>Turing</str<strong>on</strong>g> threads is circumvented by storing the <str<strong>on</strong>g>Turing</str<strong>on</strong>g> threads and then executing<br />
the stored <str<strong>on</strong>g>Turing</str<strong>on</strong>g> threads under c<strong>on</strong>trol of a multi-thread that makes the head<br />
positi<strong>on</strong> part of the instructi<strong>on</strong>s. By using thread forking in the way described,<br />
the executi<strong>on</strong> remains c<strong>on</strong>trolled by a finite-state thread if the computati<strong>on</strong><br />
c<strong>on</strong>cerned is c<strong>on</strong>vergent. However, still another kind of infinity arises: the thread<br />
forking functi<strong>on</strong> needed is an injective functi<strong>on</strong> with an infinite domain, viz. N.<br />
11 Fair Strategic Interleaving<br />
Cyclic interleaving with perfect forking is a simple instance of a fair interleaving<br />
strategy. In this secti<strong>on</strong>, we make precise what it means for basic interleaving<br />
strategies with support of perfect forking to be fair. It happens that the way to<br />
simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines <strong>on</strong> a <strong>Maurer</strong> machine presented in Secti<strong>on</strong> 10 works<br />
with any fair basic interleaving strategy with support of perfect forking.<br />
In [3], it is dem<strong>on</strong>strated that it is in essence open-ended what counts as an<br />
interleaving strategy. However, here we have to make precise what we c<strong>on</strong>sider<br />
to be an interleaving strategy. Our choice is c<strong>on</strong>diti<strong>on</strong>ed by the simple fact<br />
that strategies that are not relevant to the present purpose can be left out.<br />
This means that we c<strong>on</strong>sider <strong>on</strong>ly basic interleaving strategies with support of<br />
perfect forking, but without support of other special features. For instance, we<br />
do not c<strong>on</strong>sider interleaving strategies that support the case where processing of<br />
certain acti<strong>on</strong>s may be temporarily blocked and/or blocked forever. And we do<br />
not c<strong>on</strong>sider any kind of n<strong>on</strong>-perfect forking either.<br />
A basic strategic interleaving operator � s ( ) is an operator <strong>on</strong> a thread vector<br />
such that for all α ∈ Tfinrec ∗ , p ′ , p ′′ ∈ Tfinrec, a ∈ Atau \ NT and n ∈ dom(φ): 6<br />
� s (〈 〉) = S ,<br />
� s (〈S〉 � α) = � s (α) ,<br />
� s (〈D〉 � α) = SD(� s (α)) ,<br />
∃!α ′ , α ′′ ∈ Tfinrec ∗ •<br />
(α ′ ∈ perm(〈p ′ 〉 � α) ∧ α ′′ ∈ perm(〈p ′′ 〉 � α) ∧<br />
� s (〈p ′ � a � p ′′ 〉 � α) = � s (α ′ ) � a � � s (α ′′ )) ,<br />
∃!α ′ ∈ Tfinrec ∗ •<br />
(α ′ ∈ perm(〈p ′ 〉 � α � 〈φ(n)〉) ∧<br />
� s (〈p ′ � nt(n) � p ′′ 〉 � α) = tau ◦ � s (α ′ )) .<br />
The strategic interleaving operators characterized here basically operate as<br />
follows: at each interleaving step, the first thread in the thread vector gets a<br />
turn to perform an acti<strong>on</strong> and then the remaining thread vector is permuted in<br />
a deterministic manner. Hence, for a given basic strategic interleaving operator<br />
� s ( ), the axioms can always be given in the following way:<br />
6 We write D ∗ for the set of all finite sequences with elements from set D, D + for the<br />
set of all n<strong>on</strong>-empty finite sequences with elements from set D, and perm(α) for the<br />
set of all permutati<strong>on</strong>s of sequence α.<br />
23
� s (〈 〉) = S ,<br />
� s (〈S〉 � α) = � s (α) ,<br />
� s (〈D〉 � α) = SD(� s (α)) ,<br />
� s (〈x � a � y〉 � α) = � s (pv +a<br />
s (〈x〉 � α)) � a � � s (pv −a<br />
s (〈y〉 � α)) ,<br />
� s (〈x � nt(n) � y〉 � α) = tau ◦ � s (pv +nt(n)<br />
s<br />
(〈x〉 � α � 〈φ(n)〉)) ,<br />
where a stands for an arbitrary member of Atau \ NT , for unary functi<strong>on</strong>s pv +a<br />
s ,<br />
pv −a<br />
s<br />
and pv +nt(n)<br />
s<br />
<strong>on</strong> Tfinrec + such that, for all α ∈ Tfinrec + , pv +a<br />
s (α) ∈ perm(α),<br />
pv −a<br />
s (α) ∈ perm(α) and pv +nt(n)<br />
s (α) ∈ perm(α).<br />
In order to determine whether a basic interleaving strategy is fair, we need to<br />
know how thread vectors are permuted. If α is a thread vector in which a thread<br />
occurs more than <strong>on</strong>ce, we cannot infer from α and the thread vector resulting<br />
from a permutati<strong>on</strong> of α how α is permuted. Hence, the functi<strong>on</strong>s pv +a<br />
s and<br />
pv −a<br />
s are not sufficient to determine whether a basic interleaving strategy is fair.<br />
Therefore, we assume that, for all a ∈ Atau, b ∈ A \ NT and α ∈ Tfinrec + ,<br />
functi<strong>on</strong>s pp +a<br />
s (α), pp−b s (α) : [1, |α|] → [1, |α|] are given such that:<br />
pv +a<br />
s (〈p1〉 � . . . � 〈pn〉) = 〈p ′ �<br />
1〉 . . . � 〈p ′ n〉 ⇒<br />
∀i ∈ [1, n] • pi ≡ p ′<br />
pp +a<br />
s (〈p1〉�...�〈pn〉)(i) ,<br />
pv −b<br />
s (〈p1〉 � . . . � 〈pn〉) = 〈p ′ �<br />
1〉 . . . � 〈p ′ n〉 ⇒<br />
∀i ∈ [1, n] • pi ≡ p ′<br />
pp −b<br />
s (〈p1〉�...�〈pn〉)(i) .<br />
+a<br />
Auxiliary relati<strong>on</strong>s � ⊆ Tfinrec + × Tfinrec + −b<br />
, for a ∈ Atau, and � ⊆<br />
Tfinrec + × Tfinrec + , for b ∈ A \ NT , are used below to define fairness of basic<br />
interleaving strategies. They are defined as follows:<br />
α +a<br />
� α ′ ⇔<br />
∃p, p ′ ∈ Tfinrec, α ′′ ∈ Tfinrec ∗ •<br />
(α = 〈p � a � p ′ 〉 � α ′′ ∧ α ′ = pv +a<br />
s (〈p〉 � α ′′ )) if a �∈ NT ,<br />
α +nt(n)<br />
� α ′ ⇔<br />
∃p, p ′ ∈ Tfinrec, α ′′ ∈ Tfinrec ∗ •<br />
(α = 〈p � nt(n) � p ′ 〉 � α ′′ ∧ α ′ = pv +nt(n)<br />
s (〈p〉 � α ′′ � 〈φ(n)〉)) ,<br />
α −b<br />
� α ′ ⇔<br />
∃p, p ′ ∈ Tfinrec, α ′′ ∈ Tfinrec ∗ •<br />
(α = 〈p � b � p ′ 〉 � α ′′ ∧ α ′ = pv −b<br />
s (〈p ′ 〉 � α ′′ )) .<br />
Let �s ( ) be a basic strategic interleaving operator. Then �s ( ) is fair if for<br />
all α0, α1, . . . ∈ Tfinrec + and j0 ∈ [1, |α0|], j1 ∈ [1, |α1|], . . . :<br />
�<br />
+a<br />
(∃a ∈ Atau • (αi � αi+1 ∧ pp<br />
i∈N<br />
+a<br />
s (αi)(ji) = ji+1) ∨<br />
−a<br />
∃a ∈ A \ NT • (αi � αi+1 ∧ pp−a s (αi)(ji) = ji+1)) ⇒ �<br />
ji+1 = 1 .<br />
24<br />
i∈N
According to the above definiti<strong>on</strong>s, cyclic interleaving with perfect forking<br />
is a fair basic interleaving strategy. The way to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines <strong>on</strong> a<br />
<strong>Maurer</strong> machine shown in Secti<strong>on</strong> 10 works not <strong>on</strong>ly with cyclic interleaving,<br />
but also with any other fair basic interleaving strategy.<br />
Theorem 4. Theorem 3 goes through if we replace the strategic interleaving<br />
operator for cyclic interleaving by any other fair basic interleaving strategy.<br />
Proof. The proof follows the same line as the proof of Theorem 3. Properties 4,<br />
5a and 5b from that proof are too str<strong>on</strong>g in the case of an arbitrary fair basic<br />
interleaving strategy. We have the following weaker properties instead:<br />
4 ′ . if S ′′ (Mhd[n]) = T and p1 ≡ CT n, then there exist a T ′′ ∈ STM ′′ and p′ 2 ∈ p2,<br />
. . . , p ′ l ∈ pl such that (� f (〈p1〉�. . .�〈pl〉), S ′′ ) ⊢ ∗ TM ′′ (� f (〈CT n+1〉�〈CT ′ n〉�<br />
〈p ′ 2〉 � . . . � 〈p ′ l 〉), T ′′ ) and T ′′ ↾ Mtape = S ′′ ↾ Mtape and T ′′ (Mhd[n]) = T;<br />
5 ′ . if S ′′ (Mhd[n]) = T, p1 ≡ CT ′ n and S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))]) �∈ {S, D}, then:<br />
(a) if π2(S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))])) = test:s, then there exist a T ′′ ∈ STM ′′<br />
and p ′ 2 ∈ p2, . . . , p ′ l ∈ pl such that (� f (〈p1〉 � . . . � 〈pl〉), S ′′ ) ⊢ ∗ TM ′′<br />
(� f (〈CT ′′ n〉 � 〈p ′ 2〉 � . . . � 〈p ′ l 〉), T ′′ ) and T ′′ ↾ (Mtape ∪ {rr}) = Itest:s:n(S ′′ ) ↾<br />
(Mtape ∪ {rr}) and T ′′ (Mhd[n]) = T;<br />
(b) if π2(S ′′ (Mthr[ntl(S ′′ , S ′′ (rr))])) = write:s, then there exist a T ′′ ∈ STM ′′<br />
and p ′ 2 ∈ p2, . . . , p ′ l ∈ pl such that (� f (〈p1〉 � . . . � 〈pl〉), S ′′ ) ⊢ ∗ TM ′′<br />
(� f (〈CT ′′ n〉 �〈p ′ 2〉 �. . . �〈p ′ l 〉), T ′′ ) and T ′′ ↾(Mtape ∪{rr}) = Iwrite:s:n(S ′′ )↾<br />
(Mtape ∪ {rr}) and T ′′ (Mhd[n]) = T.<br />
These weaker properties are sufficient to complete the proof. ⊓⊔<br />
12 C<strong>on</strong>clusi<strong>on</strong>s<br />
There are many ways to simulate <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines <strong>on</strong> <strong>Maurer</strong> machines. In this<br />
paper, we have presented three ways which give insight into the c<strong>on</strong>necti<strong>on</strong>s<br />
between <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines, <strong>Maurer</strong> machines and real computers:<br />
– In the first way, the <strong>Maurer</strong> machine <strong>on</strong> which <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines are simulated<br />
has the most obvious instructi<strong>on</strong>s for the simulati<strong>on</strong> of <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines.<br />
Moreover, the transiti<strong>on</strong> functi<strong>on</strong> of the <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine in questi<strong>on</strong><br />
is rendered in an obvious way into a finite-state thread which is applied to<br />
that <strong>Maurer</strong> machine. Unlike real computers, the <strong>Maurer</strong> machine used for<br />
the simulati<strong>on</strong> has instructi<strong>on</strong>s with an infinite input regi<strong>on</strong> or an infinite<br />
output regi<strong>on</strong>.<br />
– In the sec<strong>on</strong>d way, the <strong>Maurer</strong> machine <strong>on</strong> which <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines are simulated<br />
has <strong>on</strong>ly instructi<strong>on</strong>s with a finite input regi<strong>on</strong> and a finite output<br />
regi<strong>on</strong>. This is attained by replacing each instructi<strong>on</strong> with an infinite input<br />
regi<strong>on</strong> or an infinite output regi<strong>on</strong> by a countably infinite number of instructi<strong>on</strong>s,<br />
namely <strong>on</strong>e for each different head positi<strong>on</strong>. The necessary adaptati<strong>on</strong><br />
of the thread into which the transiti<strong>on</strong> functi<strong>on</strong> of a <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine is rendered,<br />
usually results in an infinite-state thread. Unlike finite-state threads,<br />
an infinite-state thread cannot be regarded as the behaviour of a deterministic<br />
sequential program under executi<strong>on</strong> <strong>on</strong> a real computer.<br />
25
– In the third way, the <strong>Maurer</strong> machine <strong>on</strong> which <str<strong>on</strong>g>Turing</str<strong>on</strong>g> machines are simulated<br />
has again <strong>on</strong>ly instructi<strong>on</strong>s with a finite input regi<strong>on</strong> and a finite<br />
output regi<strong>on</strong>. However, the thread into which the transiti<strong>on</strong> functi<strong>on</strong> of a<br />
<str<strong>on</strong>g>Turing</str<strong>on</strong>g> machine is rendered is not adapted, but first stored in the memory of<br />
the <strong>Maurer</strong> machine and then executed under c<strong>on</strong>trol of a multi-thread that<br />
makes the head positi<strong>on</strong> part of the instructi<strong>on</strong>s. The multi-thread forks off<br />
for every head positi<strong>on</strong> a c<strong>on</strong>trol thread of itself <strong>on</strong> the head reaching the<br />
preceding positi<strong>on</strong> for the first time. Thus, the multi-thread remains finite<br />
in the case of c<strong>on</strong>vergent computati<strong>on</strong>s.<br />
The third way also illustrates that some main c<strong>on</strong>cepts of c<strong>on</strong>temporary programming,<br />
namely multi-threads and thread forking, have an interesting theoretical<br />
applicati<strong>on</strong>.<br />
Our interest in <strong>Maurer</strong> machines originates from our plan to develop, as<br />
part of a project investigating micro-threading architectures [10], an approach<br />
to design processor architectures that exploit instructi<strong>on</strong> level parallelism. As a<br />
first step, we have developed a basic theory of stored threads and their executi<strong>on</strong><br />
based <strong>on</strong> <strong>Maurer</strong> machines. The development of that theory is presented<br />
in [4]. Like the work presented in this paper, that work also builds up<strong>on</strong> thread<br />
algebra [3]. Our work presented in [5], <strong>on</strong> a framework for specificati<strong>on</strong> and verificati<strong>on</strong><br />
of systems that c<strong>on</strong>sist of several multi-threaded programs <strong>on</strong> various<br />
hosts in different networks, builds up<strong>on</strong> thread algebra as well.<br />
References<br />
1. J. A. Bergstra and I. Bethke. Polarized process algebra and program equivalence.<br />
In J. C. M. Baeten, J. K. Lenstra, J. Parrow, and G. J. Woeginger, editors, Proceedings<br />
30th ICALP, volume 2719 of Lecture Notes in Computer Science, pages<br />
1–21. Springer-Verlag, 2003.<br />
2. J. A. Bergstra and M. E. Loots. Program algebra for sequential code. Journal of<br />
Logic and Algebraic Programming, 51(2):125–156, 2002.<br />
3. J. A. Bergstra and C. A. Middelburg. Thread algebra for strategic interleaving.<br />
Computer Science Report 04-35, Department of Mathematics and Computer Science,<br />
Eindhoven University of Technology, November 2004.<br />
4. J. A. Bergstra and C. A. Middelburg. <strong>Maurer</strong> computers with single-thread c<strong>on</strong>trol.<br />
Computer Science Report 05-17, Department of Mathematics and Computer<br />
Science, Eindhoven University of Technology, June 2005.<br />
5. J. A. Bergstra and C. A. Middelburg. A thread algebra with multi-level strategic<br />
interleaving. In S. B. Cooper, B. Löwe, and L. Torenvliet, editors, CiE 2005,<br />
volume 3526 of Lecture Notes in Computer Science, pages 35–48. Springer-Verlag,<br />
2005.<br />
6. J. A. Bergstra and A. P<strong>on</strong>se. Combining programs and state machines. Journal<br />
of Logic and Algebraic Programming, 51(2):175–192, 2002.<br />
7. M. D. Davis and E. J. Weyuker. Computability, Complexity, and Languages. Academic<br />
Press, New York, 1983.<br />
8. H. Hermes. Enumerability, Decidability, Computability. Springer-Verlag, Berlin,<br />
1965.<br />
26
9. J. E. Hopcroft, R. Motwani, and J. D. Ullman. Introducti<strong>on</strong> to Automata Theory,<br />
Languages and Computati<strong>on</strong>. Addis<strong>on</strong>-Wesley, Reading, MA, sec<strong>on</strong>d editi<strong>on</strong>, 2001.<br />
10. C.R. Jesshope and B. Luo. Micro-threading: A new approach to future RISC. In<br />
Australian Computer Architecture C<strong>on</strong>ference 2000, pages 34–41. IEEE Computer<br />
Society Press, 2000.<br />
11. P. Linz. An Introducti<strong>on</strong> to Formal Languages and Automata. J<strong>on</strong>es and Bartlett<br />
Publishers, Sudbury, MA, 1997.<br />
12. W. D. <strong>Maurer</strong>. A theory of computer instructi<strong>on</strong>s. Journal of the ACM, 13(2):226–<br />
235, 1966.<br />
13. A. M. <str<strong>on</strong>g>Turing</str<strong>on</strong>g>. On computable numbers, with an applicati<strong>on</strong> to the Entscheidungs<br />
problem. Proceedings of the L<strong>on</strong>d<strong>on</strong> Mathematical Society, Series 2, 42:230–265,<br />
1937. Correcti<strong>on</strong>: ibid, 43:544–546, 1937.<br />
27