Indexed access to right-nested machine lists #
The index is supplied in unary. This is the representation used by all bounded row, column, and coordinate loops below: its length is the number of list tails to take. The routine is total on arbitrary strings and its state only shrinks, so its global polynomial-time bound does not depend on the input being a well-formed list code.
Extracts the unary index ruler from a list-index request.
Equations
Instances For
Extracts the encoded list from a list-index request.
Equations
Instances For
Drops as many encoded list entries as the length of the unary index ruler.
Equations
Instances For
Return the code of the element at the unary index, or the empty word if the index is outside the encoded list.
Equations
Instances For
theorem
BeyondBethe.machineListIndexIterate_length_le_width
(word : List Bool)
(iterations : ℕ)
:
iterations ≤ (machineListIndexRuler word).length →
(machineListTail^[iterations] (machineListIndexData word)).length ≤ word.length
Exact semantics #
theorem
BeyondBethe.machineListIndex_binaryListCode
{α : Type u_1}
(encode : α → List Bool)
(xs : List α)
(k : ℕ)
(hk : k < xs.length)
:
machineListIndex (Complexity.pair (List.replicate k true) (binaryListCode encode xs)) = encode xs[k]
@[simp]
theorem
BeyondBethe.machineMatrixEntryAtUnary_encode
{n : ℕ}
(A : Matrix (Fin n) (Fin n) ℚ)
(i j : Fin n)
:
machineMatrixEntryAtUnary
(Complexity.pair (List.replicate (↑i) true)
(Complexity.pair (List.replicate (↑j) true) (rationalMatrixBinaryEncoding.encode ⟨n, A⟩))) = rationalEntryBinaryCode (A i j)