Looping over the blocks of a string inside the algebra #
Amplified acceptance is a majority vote over the blocks of a random seed. Both
that vote and the outer disjunction over shift blocks are limited recursions
over a ruler whose length is the iteration count: at the step whose tail is
y, the block index is |y|, so the block itself is cut out of the source
string by a drop of |y| · |τ| bits — a length smash produces — followed
by a take of |τ|. No state has to be threaded through the recursion.
Main definitions #
Cobham.blockAtIdx— thej-th block of a string at a given widthCobham.acceptCountAux— unary count of blocks on which the path acceptsCobham.majorityFlag— the amplified majority verdict as a flag
Main results #
Cobham.acceptCountAux_length— the count is the number of accepting blocksCobham.acceptCountAux_mem,Cobham.majorityFlag_mem— both are in the algebra
The block of s selected by the ruler idx at the width of τ.
Equations
- Complexity.Cobham.blockOf τ s idx = List.take τ.length (List.drop (Complexity.smash idx τ).length s)
Instances For
Counting accepting blocks #
Unary count of the blocks of s on which the path of tm accepts: one bit
per accepting block. The recursion runs once per bit of ρ, and the block
index at each step is the length of the remaining tail.
Equations
Instances For
The count is the number of accepting block indices below |ρ|.
The count is in the algebra.
The amplified verdict #
The verdict sought at a shift: the amplified majority, or its negation.
Equations
- Complexity.Cobham.verdictFlag tm b u x τ s ρ = bif b then Complexity.Cobham.majorityFlag tm u x τ s ρ else Complexity.notBit (Complexity.Cobham.majorityFlag tm u x τ s ρ)
Instances For
Disjunction over shifts #
Disjunction of the verdict over the shift blocks of wit: the recursion
runs once per bit of the shift ruler, and at each step the shift block is cut
from wit at the index given by the remaining tail.
Equations
Instances For
The disjunction over shifts is in the algebra.
Membership among blocks #
Flag: the block c occurs among the width-|τ| blocks of s indexed by the ruler.
Equations
- Complexity.Cobham.memBlockAux τ s c [] = [false]
- Complexity.Cobham.memBlockAux τ s c (head :: y) = Complexity.orBit (Complexity.Cobham.eqFlag c (Complexity.Cobham.blockOf τ s y)) (Complexity.Cobham.memBlockAux τ s c y)
Instances For
The membership test is an existential over block indices.