Documentation

Complexitylib.Models.RandomAccessMachine.Simulation.RegisterStore.Machine.EntryAppend

Sparse-entry final append #

theorem Complexity.RAM.RegisterStore.Machine.entryAppendRestoreTM_hoareTime_frame {n : } (tapes : EntryReplaceTapes n) (address newValue : ) (emitted : List Bool) (initialWork readyWork : Fin nTape) (inp₀ out₀ : Tape) (hready : EntryScanReady tapes.entry [] address.bits initialWork readyWork) (hreplacement : (readyWork tapes.replacement).HasBinaryNat newValue) (hinput : TM.Parked inp₀) (houtput : out₀.HasBinaryPrefix emitted) :
(entryAppendRestoreTM tapes).HoareTime (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ work = readyWork out = out₀) (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ work = readyWork out.HasBinaryPrefix (emitted ++ Entry.encode (address, newValue))) (entryAppendRestoreTime address newValue)

Append one absent query/nonzero-value entry and restore both canonical source tapes exactly, retaining the caller's complete work family.

Final append and restoration are append-only on the output tape.

theorem Complexity.RAM.RegisterStore.Machine.entryAppendRestoreTM_prefix_withinAuxSpace {n : } (tapes : EntryReplaceTapes n) (address newValue inputLength initialSpace time : ) (start current : Complexity.Cfg n (entryAppendRestoreTM tapes).Q) (hinitial : start.WithinAuxSpace inputLength initialSpace) (hreach : (entryAppendRestoreTM tapes).reachesIn time start current) (htime : time entryAppendRestoreTime address newValue) :
current.WithinAuxSpace inputLength (initialSpace + entryAppendRestoreTime address newValue)

Coarse all-prefix auxiliary-space envelope for final append/restoration.