Reading a fusion-node header #
All eighteen words of an internal-node header are loaded by a fixed straight-line program. The constant offsets and their address additions are charged. Query-dependent array accesses are separate from this header load.
Main definitions #
ReadHeaderProgram.code: the 54-instruction header reader.
Main results #
ReadHeaderProgram.exec: checked execution with an explicit header-address bound.
References #
@[reducible, inline]
Base address of the record, preserved.
Instances For
@[reducible, inline]
Constant-offset scratch.
Instances For
@[reducible, inline]
Address scratch.
Instances For
Load header word i into register i+1.
Instances For
All eighteen header loads, with their constant offsets and address additions.
Instances For
def Cslib.Algorithms.WordRAM.FusionTree.ReadHeaderProgram.result (x : WordRAM.Data 21) :
WordRAM.Data 21
Output state after the eighteen loaded words.
Instances For
theorem Cslib.Algorithms.WordRAM.FusionTree.ReadHeaderProgram.exec {w : ℕ} (x : WordRAM.Data 21) (ha : WordRAM.Fits w (x.regs pointer + 17)) :
WordRAM.Exec w code x (result x) 54
All header words are read in 54 checked standard instructions, counting constants and address additions. The address bound implies that all constant offsets fit as well.
The record base and memory are preserved, and each output register contains its header word.