I am using the book Elements of the Theory of Computation (2nd edition), which has been fine until now. However, I am stuck trying to grasp the Machine Turing conveyed in Example 4.1.8 (pages 189-190). I cannot make sense of the copying machine portrayed in Figure 4-8. Can someone help me understand with an input word as an example?
1 Answer
The following is how I decode this program. The $R_\sqcup$ is a macro for the machine that moves right until it reads a blank. I deduce that $R^2_\sqcup$ repeats this process, locating the second blank to the right. Now the machine shutles right and left moving one non-blank $a$ to the right each cycle.
The position in the original string of the current copied character is temporarily marked with a blank.
move-Left until space
step-Right
while the current character a is not a space
do
write space // overwriting a, but it is memorized,
twice: move-Right until space,
write a //on the position of the second space
twice: move-Left until space,
write a // restoring the a in the first copy
step-Right
od
move-Right until space