Truncation of Natural Numbers to w-Bit Words #
Computable truncation Cslib.WordRAM.wordOfNat w v : Fin (2 ^ w) mapping a natural number v below
2 ^ w (Fits w v) to ⟨v, _⟩ and defaulting out-of-range values to 0, shared between Word-RAM
table-extraction and cell-probe simulation layers.
Main definitions #
Cslib.WordRAM.wordOfNat: truncatev : ℕintoFin (2 ^ w), returning0when2 ^ w ≤ v.
Main results #
Cslib.WordRAM.wordOfNat_val_of_lt:(wordOfNat w v).val = vwheneverv < 2 ^ w(Fits w v).Cslib.WordRAM.wordOfNat_unifFin:wordOfNat w k.valtransportsFin (2 ^ w - 1 + 1)samples fromProbComp.unifFin (2 ^ w - 1)toFin (2 ^ w).