Universal Turing Machines, Part 7: Registration
Now it is time to determine the state that we will transition into. Because of the difficulty of matching a sequence of symbols (the little q) that is sitting in the middle of a list (the big Q‘s) we will first copy this symbol to the register.
- Scanning left from the Tape marker, we can erase all the symbol markings, until we hit our current state
- Scan to the right until we hit the state that we transition into.
- Pick up the first uncopied bit (unless we see a Y or X in which case we can stop here and Accept or Reject.) Also, if we see a S, Q, or T then we’ve done all the copying we need to do, and can rewind the tape unmarking everything along the way. Otherwise, we start copying bits one-by-one in a loop.
- Scan to the left until we hit the Blank Symbol marker.
- Scan until we hit a bit that has already been copied (or the q at the tape’s beginning).
- Place a marked version of the copied bit, and return to get the next bit.