Binary string encodings on Turing-machine tapes #
Generic predicates and lemmas for tapes containing canonical binary strings.
Tape.HasBinaryPrefix describes a string being written from left to right,
Tape.HasBinaryString describes the same contents after rewinding the head to
cell one, Tape.HasBinaryContent forgets the head while an in-place arithmetic
cursor moves, and Tape.HasBinarySuffix describes a read cursor at the
beginning of a remaining suffix. These shapes are shared by deterministic and
nondeterministic machine constructions.
A tape while a binary string is being written: cells 1..|bits| contain
the bits, the head is at the next cell, and the remaining tail is blank.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Canonical binary contents independently of the tape head. This is the stable invariant for in-place arithmetic cursors that scan and rewind.
Equations
Instances For
A read cursor at the beginning of a remaining binary suffix. The suffix starts under the current off-marker head, is followed immediately by blank, and the tape has no stray left markers.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A completed binary string whose length is at most B.
Equations
- t.HasBoundedBinaryString B = ∃ (bits : List Bool), bits.length ≤ B ∧ t.HasBinaryString bits
Instances For
A completed binary string has the same canonical contents after forgetting its parked head.
Canonical contents become a completed binary string when the head is at cell one.
Moving a cursor preserves its canonical binary contents.
Overwriting one in-range binary cell preserves canonical contents and updates exactly that bit.
A completed binary tape encodes exactly bits as its output string.
A completed binary tape with the left marker at cell 0 is exactly the
standard initialized tape for those bits, moved to cell 1.
A binary prefix with the left marker at cell zero has exactly the canonical initialized cell contents, independently of its current head.
Bounded completed binary tapes expose exact initialized tape shape for some string whose length satisfies the same bound.
A freshly initialized empty tape, moved right past ▷, is an empty
binary prefix.
A standard initialized binary tape moved right to its first data cell is a completed binary string.
The head of an appendable binary prefix reads its first trailing blank.
An appendable binary prefix already contains the advertised delimited output, independently of its current head.
A freshly initialized binary tape starts with its whole string as the remaining suffix.
A completed binary string exposes the same bits as its remaining suffix.
A delimited output parked at cell one is a binary suffix cursor when the tape has no stray left-end markers.
Moving right after reading the first bit exposes the remaining suffix.
An empty remaining suffix reads the terminating blank.
A binary suffix cursor never reads the left-end marker.
Writing the next bit extends a binary prefix by one cell.
Writing the next bit preserves the left-end marker cell.
Moving a completed binary string's head to the first blank, without changing its cells, yields the corresponding appendable prefix.
Rewinding a binary prefix to cell one yields a completed binary string.