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.

54 ABACUS COMPUTABILITY<br />

If it is scanning a blank, there can be no more strokes to the right, <strong>and</strong> it therefore<br />

returns to st<strong>and</strong>ard position. But if it is scanning a stroke at that point, it has more<br />

work to do before returning to st<strong>and</strong>ard position, for there are more blocks of strokes<br />

to be dealt with, to the right on the tape. These must be shifted one square rightwards,<br />

by erasing the first 1 in each block <strong>and</strong> filling the blank to the block’s right with a<br />

stroke—continuing this routine until it finds a blank to the right of the last blank it<br />

has replaced by a stroke. At that point there can be no further strokes to the right, <strong>and</strong><br />

the machine returns to st<strong>and</strong>ard position.<br />

Note that node 1a is needed in case the number r of arguments is 0: in case the<br />

‘function’ that the abacus computes is a number A 0 n . Note, too, that the first s − 1<br />

pairs of nodes (with their efferent arrows) are identical, while the last pair is different<br />

only in that the arrow from node sb to the right is labelled B:1 instead of B:R. What<br />

the general s+ flow chart looks like in the case s = 1 is shown in Figure 5-10.<br />

Figure 5-10. The special case s = 1.<br />

The second step in our method of converting abacus flow charts into equivalent<br />

Turing machine flow charts can now be specified: replace each s− node (with the<br />

two arrows leading from it) by a copy of an s− flow chart having the general pattern<br />

shown in Figure 5-11.<br />

Readers may wish to try to fill in the details of the design for themselves, as an<br />

exercise. (Our design will be given later.) When the first <strong>and</strong> second steps of the<br />

method have been carried out, the abacus flow chart will have been converted into<br />

something that is not quite the flow chart of a Turing machine that computes the same<br />

function that the abacus does. The chart will (probably) fall short in two respects,<br />

one major <strong>and</strong> one minor. The minor respect is that if the abacus ever halts, there<br />

must be one or more ‘loose’ arrows in the chart: arrows that terminate in no node.<br />

This is simply because that is how halting is represented in abacus flow charts: by an<br />

arrow leading nowhere. But in Turing-machine flow charts, halting is represented in<br />

a different way, by a node with no arrows leading from it. The major respect is that<br />

in computing A r n (x 1,...,x r ) the Turing machine would halt scanning the leftmost 1<br />

on the tape, but the value of the function would be represented by the nth block of<br />

strokes on the tape.Evenifn = 1, we cannot depend on there being no strokes on the<br />

tape after the first block, so our method requires one more step.<br />

The third step: after completing the first two steps, redraw all loose arrows so they<br />

terminate in the input node of a mop-up chart, which makes the machine (which will<br />

be scanning the leftmost 1 on the tape at the beginning of this routine) erase all but<br />

the first block of strokes if n = 1, <strong>and</strong> halt scanning the leftmost of the remaining<br />

strokes. But if n ≠ 1, it erases everything on the tape except for both the leftmost

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

Saved successfully!

Ooh no, something went wrong!