The bits of a framed word #
frame w doubles every bit b of w into true, b and ends with false
(Turing.MultiTapeTM.frame). Its bits are therefore constants or bits of w
(Turing.MultiTapeTM.getElem_frame), which is what makes framed inputs easy to feed to circuits.
A frame followed by a word, as written on a work tape, splits at each framed bit into the pairs
before it, the pair true, c of the bit c, and the frame of the rest
(Turing.MultiTapeTM.frame_append_cons), so a machine can locate the tag and the bit of each pair
and overwrite the bit in place (Turing.MultiTapeTM.set_frame_append_cons).
Main results #
Turing.MultiTapeTM.getElem_frame: the bit at each position offrame w.Turing.MultiTapeTM.getElem?_frame_two_mul,Turing.MultiTapeTM.getElem?_frame_two_mul_add_one,Turing.MultiTapeTM.getElem?_frame_two_mul_length: the marker, data, and terminator bits offrame wby position.Turing.MultiTapeTM.forall_getElem?_frame_iff: a predicate agrees withframe wplaced at offsetbaseiff it agrees with the markers, the bits ofw, and the terminator.Turing.MultiTapeTM.forall_getElem?_append_iff: a predicate agrees with the bits ofu ++ wiff it agrees withuand withwshifted byu.length.Turing.MultiTapeTM.getD_frame_two_mul,Turing.MultiTapeTM.getD_frame_two_mul_add_one: indexed access to markers and input bits with defaultfalse.Turing.MultiTapeTM.length_flatMap_frame: the length of a list of framed words.Turing.MultiTapeTM.length_unframe_le: the word framed at the start of a word is no longer than the word.Turing.MultiTapeTM.frame_append_cons: a frame split at a framed bit.Turing.MultiTapeTM.getElem?_frame_append_length,Turing.MultiTapeTM.getElem?_frame_append_cons: the terminator and the tags of a frame followed by a word.Turing.MultiTapeTM.lt_length_frame_append_cons,Turing.MultiTapeTM.two_mul_length_le_length_frame_append: positions within a frame followed by a word.Turing.MultiTapeTM.set_frame_append_cons: overwriting a framed bit in place.
Indexed bit access #
A predicate P : ℕ → Prop agrees with frame w shifted by base on
[base, base + (frame w).length) iff it is false at base + 2 * w.length and, for each
j < w.length, is true at base + 2 * j and agrees with w[j] at base + 2 * j + 1.
A predicate P : ℕ → Prop agrees with the bits of u ++ w iff it agrees with u below
u.length and with w shifted by u.length on [u.length, u.length + w.length).