Documentation

Complexitylib.Models.RandomAccessMachine.Simulation.RegisterStore.Machine.EntryLookup

Sparse register lookup #

A bounded lookup advances the encoded source cursor without modifying its cells.

theorem Complexity.RAM.RegisterStore.Machine.entryLookupTM_hoareTime_frame {n : } (tapes : EntryScanTapes n) (store : Store) (address : ) (initialWork : Fin nTape) (inp₀ out₀ : Tape) (hready : EntryScanReady tapes.entry (List.flatMap Entry.encode store) address.bits initialWork initialWork) (hcount : (initialWork tapes.count).HasBinaryNat (List.length store)) (hinput : TM.Parked inp₀) (houtput : TM.Parked out₀) :
(entryLookupTM tapes).HoareTime (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ work = initialWork out = out₀) (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ EntryLookupResult tapes store address initialWork work out = out₀) (entryLookupTime tapes address store)

Scan a runtime-sized encoded sparse store and leave exactly RegisterStore.read store address on the decoded-value tape.

theorem Complexity.RAM.RegisterStore.Machine.entryLookupTM_hoareTime_frame_source {n : } (tapes : EntryScanTapes n) (store : Store) (address : ) (initialWork : Fin nTape) (inp₀ out₀ : Tape) (hready : EntryScanReady tapes.entry (List.flatMap Entry.encode store) address.bits initialWork initialWork) (hcount : (initialWork tapes.count).HasBinaryNat (List.length store)) (hinput : TM.Parked inp₀) (houtput : TM.Parked out₀) :
(entryLookupTM tapes).HoareTime (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ work = initialWork out = out₀) (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ EntryLookupResult tapes store address initialWork work (work tapes.entry.source).cells = (initialWork tapes.entry.source).cells (∀ (i : Fin n), (work i).head (initialWork i).head + entryLookupTime tapes address store) out = out₀) (entryLookupTime tapes address store)

Framed lookup with explicit preservation of the complete encoded source cell function.

Sparse lookup preserves one-way output safety.

theorem Complexity.RAM.RegisterStore.Machine.entryLookupTM_prefix_withinAuxSpace {n : } (tapes : EntryScanTapes n) (store : Store) (address inputLength initialSpace time : ) (start current : Complexity.Cfg n (entryLookupTM tapes).Q) (hinitial : start.WithinAuxSpace inputLength initialSpace) (hreach : (entryLookupTM tapes).reachesIn time start current) (htime : time entryLookupTime tapes address store) :
current.WithinAuxSpace inputLength (initialSpace + entryLookupTime tapes address store)

Sparse lookup inherits the scanner's all-prefix auxiliary-space envelope.