Documentation

CslibFrontier.Computability.PointerMachine.WordRAM.Encoding

Encoding pointer-machine states as word memory #

encodeState installs the source register banks and fixed-size node blocks in word memory, sets the next-free address, and fills unused registers and cells with zero. The source control label is represented separately by the compiled program position. repr_encodeState proves that every source state has this representation. bounded_encodeState gives the word bound for valid source states satisfying Fits.

This describes the starting state of the simulator. It does not charge or implement conversion from the word-RAM's input-list convention.

Encode the source pointer/data banks and heap blocks. Null, padding and unused memory are zero; source data uses the explicitly supplied encoding e.

Every source state is represented by its canonical word-memory encoding.

theorem Cslib.PointerMachine.WordRAM.bounded_encodeState {M : Model} {L : Layout} {e : M.Value ↪ ℕ} {w : ℕ} {x : State M L} (hv : x.Valid) (hf : Fits e w x) :

Valid pointers and fitting source data make every encoded register and cell word-bounded.