Moving words between tapes #
Three machines, built from the tidy identity Turing.MultiTapeTM.tidyCopy, that move a word
between the input, the work tapes and the output, leaving everything else as it is:
Turing.MultiTapeTM.loadWord Symbol iwrites the input to the blank work tapei;Turing.MultiTapeTM.copyWord e markcopies the word on tapee 1to the blank tapee 0;Turing.MultiTapeTM.emitWord e markoutputs the word on tapee 0.
The last two use a further blank tape to flag the left end of the word with mark.
Main results #
noncomputable def Turing.MultiTapeTM.loadWord {k : ℕ} (Symbol : Type u_2) (i : Fin k) :
MultiTapeTM k Symbol ((Unit ⊕ RewindState) ⊕ RewindWorkState)
Writes the input to the work tape i.
Instances For
noncomputable def Turing.MultiTapeTM.copyWord {k : ℕ} {Symbol : Type u_1} (e : Fin (0 + 1 + 2) ↪ Fin k) (mark : Symbol) :
MultiTapeTM k Symbol (MarkWorkState ⊕ ((Unit ⊕ RewindState) ⊕ RewindWorkState) ⊕ MarkWorkState)
Copies the word on tape e 1 to tape e 0, using tape e 2 to flag the left end of the word
with mark.
Instances For
noncomputable def Turing.MultiTapeTM.emitWord {k : ℕ} {Symbol : Type u_1} (e : Fin (0 + 2) ↪ Fin k) (mark : Symbol) :
MultiTapeTM k Symbol (MarkWorkState ⊕ (Unit ⊕ RewindState) ⊕ MarkWorkState)
Outputs the word on tape e 0, using tape e 1 to flag the left end of the word with
mark.