Polynomial-time operations on finite tape storage #
The operations of cslib's existing tapes are certified in plain polynomial time
(Turing.MultiTapeTM.ComputableInPolyTime) by composition of list, option and pair operations.
They charge the complete stored tapes and accept any symbol encoding, including infinite or
empty alphabets. Finite-control interpreters can use these rules without building new tape
machines.
Main results #
Turing.MultiTapeTM.ComputableInPolyTime.stackTape_cons: prepend a computed cell, retaining the stack's omission of trailing blanks.Turing.MultiTapeTM.ComputableInPolyTime.biTape_moveLeft,.biTape_moveRight,.biTape_write,.biTape_step: native tape operations withfun_propcertificates.Turing.MultiTapeTM.ComputableInPolyTime.biTape_mk₁: load a computed list.
References #
Adapts Computability/Probabilistic/Tape.lean from the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8 to plain polynomial time, using arbitrary symbol
encodings instead of fixed finite tags.
Reading the stored list is a change of view of the same encoded bits.
Reading a stack head decodes the first cell, with a blank default.
Removing a stack head is the list-tail operation.
Prepend a cell without requiring a default symbol or case analysis over the alphabet.
Map symbols to occupied cells with the list map.
Assemble a tape from its computed head and two sides.
Read the current cell of a computed tape.
Extract the stored left side.
Extract the stored right side.
Move left by the stack operations.
Move right by the stack operations.
Write a computed optional symbol, including blank erasure.
Execute a fixed native action, charging the full encoded tape.
Loading a list constructs a head and two stacks with no default symbol.