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.

48 ABACUS COMPUTABILITY<br />

Figure 5-2. Emptying a box.<br />

without indicating how it is accomplished. Such summaries are useful in showing how more<br />

complicated programs can be put together out of simpler ones.<br />

5.2 Example (Emptying box m into box n). The program is indicated in Figure 5-3.<br />

Figure 5-3. Emptying one box into another.<br />

The figure is intended for the case m ≠ n. (If m = n, the program halts—exits on the e<br />

arrow—either at once or never, according as the box is empty or not originally.) In future we<br />

assume, unless the contrary possibility is explicitly allowed, that when we write of boxes<br />

m, n, p, <strong>and</strong> so on, distinct letters represent distinct boxes.<br />

When as intended m ≠ n, the effect of the program is the same as that of carrying stones<br />

from box m to box n until box m is empty, but there is no way of instructing the machine<br />

or its operator to do exactly that. What the operator can do is (m−) take stones out of<br />

box m, one at a time, <strong>and</strong> throw them on the ground (or take them to wherever unused<br />

stones are stored), <strong>and</strong> then (n+) pick stones up off the ground (or take them from wherever<br />

unused stones are stored) <strong>and</strong> put them, one at a time, into box n. There is no assurance that<br />

the stones put into box n are the very same stones that were taken out of box m, but we<br />

need no such assurance in order to be assured of the desired effect as described in the block<br />

diagram, namely,<br />

[m] + [n] → n:<br />

the number of stones in box n after this move equals<br />

the sum of the numbers in m <strong>and</strong> in n before the move<br />

<strong>and</strong> then<br />

0 → m: the number of stones in box m after this move is 0.<br />

5.3 Example (Adding box m to box n, without loss from m). To accomplish this we must<br />

make use of an auxiliary register p, which must be empty to begin with (<strong>and</strong> will be empty<br />

again at the end as well). Then the program is as indicated in Figure 5-4.

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

Saved successfully!

Ooh no, something went wrong!