Interval counts in polynomial time #
The interval count on plain data (Turing.MultiTapePTM.localIntervalCount) is computable in
polynomial time, as long as its 2 ^ b coin strings are polynomially many in the input. This is
the machine-simulation part of the polynomial-time construction of the block-counting networks
of #1833.
Finite storage (Turing.MultiTapePTM.LocalCfg) is encoded by Turing.MultiTapePTM.encLocalCfg:
the control and output track by their ranks, the input position in unary, the work tapes with all
their stored cells (Turing.MultiTapeTM.encBiTape), and the head positions in binary
(Turing.MultiTapeTM.encIntBin).
- One coin step (
Turing.MultiTapePTM.localCoinStep) branches on the finite key of the control, the read symbols and the coin (Turing.MultiTapeTM.ComputableInPolyTime.finite_cases); every branch applies a fixed action. A step adds at most a constant to the encoded length. - A replay (
Turing.MultiTapePTM.localRun) is a fold of coin steps with additive growth. - The interval condition compares the state, the output track, the head coordinates and the window cells after the replay, all from the encoded storage.
- The interval count counts the coin strings of
Cslib.BitString.enumList bsatisfying it.
Main definitions #
Turing.MultiTapePTM.encLocalCfg: the encoding of finite storage.Turing.MultiTapePTM.IntervalData,Turing.MultiTapePTM.encIntervalData,Turing.MultiTapePTM.encControlData,Turing.MultiTapePTM.IntervalData.count: the arguments of an interval count, their encoding, and their count.
Main results #
Turing.MultiTapePTM.computableInPolyTime_localRun: replays are polynomial-time.Turing.MultiTapePTM.IntervalData.computableInPolyTime_mk,Turing.MultiTapePTM.ControlData.computableInPolyTime_mk: assembling the arguments.Turing.MultiTapePTM.computableInPolyTime_localIntervalCount: interval counts are polynomial-time when the2 ^ bcoin strings are polynomially many in the input.
Encoding finite storage #
The encoding of finite storage: the control and the output track by their ranks, the input position in unary, the work tapes with all their stored cells, and the head positions in binary.
Rules for finite storage #
One coin step #
Growth of a coin step #
Replays #
Replays are polynomial-time: replaying computed coins from computed finite storage, on a computed input.
Tapes of windows, reads and head coordinates #
The interval count #
The arguments of an interval count on plain data.
The input.
- b : ℕ
The block length.
The block indices at the start of the interval.
The movements of the blocks.
- cIn : ControlData k State
The entering control record.
The entering window cells.
- cOut : ControlData k State
The leaving control record.
The leaving window cells.
The arguments of an interval count as a tuple.
The encoding of a control record on plain data: the state and the track by their ranks, and the offsets in unary.
The encoding of the arguments of an interval count: the input, the block length in unary, the block indices in binary, the movements by their ranks, and the records and window cells.
The interval count of its arguments.
Assemble a control record on plain data from its certified components.
Assemble the arguments of an interval count from their certified components.
Interval counts are polynomial-time in their computed arguments, provided that the 2 ^ b
coin strings, with their encodings, are polynomially many in the input: the count enumerates them
and replays each on the finite storage of the embedded window.