Fixed-width packing for linear-bounded tapes #
This module packs a bounded number of logical symbols into each physical tape cell. It is independent of any particular grammar or automaton and is used by Aho's row encoding.
@[reducible, inline]
A width-W block of optional logical symbols stored in one physical tape cell.
Equations
- PackedBlock α W = (Fin W → Option α)
Instances For
noncomputable instance
PackedBlock.instFintype
{α : Type}
[Fintype α]
(W : ℕ)
:
Fintype (PackedBlock α W)
Equations
instance
PackedBlock.instDecidableEq
{α : Type}
[DecidableEq α]
(W : ℕ)
:
DecidableEq (PackedBlock α W)
Equations
The i-th width-W block of a list, padded with none past the list end.
Instances For
Pack a list into n width-W cells. Entries beyond n * W are ignored.
Equations
- packedTape W n xs i = packedCell W xs ↑i