27.04.2015 Views

Computability and Logic

Computability and Logic

Computability and Logic

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.2. SIMULATING ABACUS MACHINES BY TURING MACHINES 51<br />

the rule x y+1 = x · x y , which is implemented by means of cumulative multiplication,<br />

using box m 1 as a counter.<br />

It should now be clear that the initial restriction to two elementary sorts of acts,<br />

n+ <strong>and</strong> n−, does not prevent us from computing fairly complex functions, including<br />

all the functions in the series that begins sum, product, power, ..., <strong>and</strong> where the<br />

n + 1st member is obtained by iterating the nth member. This is considerably further<br />

than we got with Turing machines in the preceding chapters.<br />

5.2 Simulating Abacus Machines by Turing Machines<br />

We now show that, despite the ostensible greater flexibility of abacus machines,<br />

all abacus-computable functions are Turing computable. Before we can describe a<br />

method for transforming abacus flow charts into equivalent Turing-machine flow<br />

charts, we need to st<strong>and</strong>ardize certain features of abacus computations, as we did<br />

earlier for Turing computations with our official definition of Turing computability.<br />

We must know where to place the arguments, initially, <strong>and</strong> where to look, finally,<br />

for values. The following conventions will do as well as any, for a function f of r<br />

arguments x 1 , ..., x r :<br />

(a) Initially, the arguments are the numbers of stones in the first r boxes, <strong>and</strong> all other<br />

boxes to be used in the computation are empty. Thus, x 1 = [1], ..., x r = [r],<br />

0 = [r + 1] = [r + 2] =···.<br />

(b) Finally, the value of the function is the number of stones is some previously<br />

specified box n (which may but need not be one of the first r). Thus,<br />

f (x 1 , ..., x r ) = [n] when the computation halts, that is, when we come to an<br />

arrow in the flow chart that terminates in no node.<br />

(c) If the computation never halts, f (x 1 , ..., x r ) is undefined.<br />

The computation routines for addition, multiplication, <strong>and</strong> exponentiation in the<br />

preceding section were essentially in this form, with r = 2 in each case. They were<br />

formulated in a general way, so as to leave open the question of just which boxes<br />

are to contain the arguments <strong>and</strong> value. For example, in the adder we only specified<br />

that the arguments are to be stored in distinct boxes numbered m <strong>and</strong> n, that the sum<br />

will be found in box x, <strong>and</strong> that a third box, numbered p <strong>and</strong> initially empty, will<br />

be used as an auxiliary in the course of the computation. But now we must specify<br />

m, n, <strong>and</strong> p subject to the restriction that m <strong>and</strong> n must be 1 <strong>and</strong> 2, <strong>and</strong> p must be<br />

some number greater than 2. Then we might settle on n = 1, m = 2, p = 3, to get a<br />

particular program for addition in the st<strong>and</strong>ard format, as in Figure 5-7.<br />

The st<strong>and</strong>ard format associates a definite function from natural numbers to natural<br />

numbers with each abacus, once we specify the number r of arguments <strong>and</strong><br />

the number n of the box in which the values will appear. Similarly, the st<strong>and</strong>ard<br />

format for Turing-machine computations associates a definite function from natural<br />

numbers to natural numbers (originally, from positive integers to positive integers,<br />

but we have modified that above) with each Turing machine, once we specify the<br />

number r of arguments. Observe that once we have specified the chart of an abacus

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!