Reusable sparse-register operand lookup -- definitions #
One RAM instruction may need several direct or indirect register reads. This module gives lookup a reusable phase boundary: it loads a query from a canonical source, scans the encoded store, copies out the decoded value, resets all scanner scratch, rewinds the source, and restores the runtime entry count.
Uniform scanner-head bound from a canonical cell-one start.
Equations
- Complexity.RAM.RegisterStore.Machine.entryLookupRestoreHeadBound tapes store address = 1 + Complexity.RAM.RegisterStore.Machine.entryLookupTime tapes.scan address store
Instances For
Reset budget obtained from the nine fixed owned targets and the common head/width envelopes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Restore scanner scratch, source cursor, and runtime count after a completed lookup whose value has already been copied out.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Copy out a lookup result, then restore the complete reusable scanner ABI.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Load the supplied query, perform one sparse lookup, copy out its value, and return to the same reusable blank-query scanner boundary.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Time bound for scanner reset, source rewind, and count restoration.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Time bound after the query has been prepared.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Complete reusable loaded-lookup time bound.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Read a positive-tag sparse overlay and either decode the tag or fall back to the immutable public-input bank on a sparse miss.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Complete reusable dense-overlay lookup budget.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Load one fixed address from canonical zero, read through the dense input and sparse overlay, then clear the fixed-address source back to zero.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Complete fixed-address dense-overlay lookup budget.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Load one fixed address from canonical zero, run a reusable lookup, then clear the fixed-address source back to zero.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Complete fixed-address lookup budget.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Canonical precondition for one reusable loaded lookup.
- scanner : EntryScanReady tapes.scan.entry (List.flatMap Entry.encode store) [] work work
- count : (work tapes.scan.count).HasBinaryNat (List.length store)
- countSource : (work tapes.countSource).HasBinaryNat (List.length store)
- querySource : (work tapes.querySource).HasBinaryNat address
- destination : (work tapes.destination).HasBinaryNat 0
- copyScratch : (work tapes.copyScratch).HasBinaryNat 0
Instances For
Canonical precondition for a fixed-address lookup whose query source starts at zero and is restored to zero.
- scanner : EntryScanReady tapes.scan.entry (List.flatMap Entry.encode store) [] work work
- count : (work tapes.scan.count).HasBinaryNat (List.length store)
- countSource : (work tapes.countSource).HasBinaryNat (List.length store)
- querySource : (work tapes.querySource).HasBinaryNat 0
- destination : (work tapes.destination).HasBinaryNat 0
- copyScratch : (work tapes.copyScratch).HasBinaryNat 0
Instances For
Boundary after the external query has been copied into scanner storage.
- scanner : EntryScanReady tapes.scan.entry (List.flatMap Entry.encode store) address.bits work work
- count : (work tapes.scan.count).HasBinaryNat (List.length store)
- countSourceNat : (work tapes.countSource).HasBinaryNat (List.length store)
- querySourceNat : (work tapes.querySource).HasBinaryNat address
- destination : (work tapes.destination).HasBinaryNat 0
- copyScratch : (work tapes.copyScratch).HasBinaryNat 0
Instances For
Uniform cleanup certificate extracted from either scanner outcome.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Boundary after the bounded scanner has produced a semantic lookup result. It retains the exact cleanup certificate, the read-only source image, a uniform cursor bound, and the complete external frame needed by restoration.
- result : EntryLookupResult tapes.scan store address preparedWork work
- resetReady : EntryLookupResetReady tapes store address work
- resetHeadBound (i : Fin n) : i ∈ entryLookupResetTargets tapes → (work i).head ≤ entryLookupRestoreHeadBound tapes store address
Instances For
Existentially packages the concrete prepared work family between query copying and scanning, so subsequent phases can use a semantic Hoare boundary.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stable semantic state carried through value rewind, value copy, scratch reset, source rewind, and count restoration.
- resetReady : EntryLookupResetReady tapes store address work
- resetHeadBound (i : Fin n) : i ∈ entryLookupResetTargets tapes → (work i).head ≤ entryLookupRestoreHeadBound tapes store address
- countSourceNat : (work tapes.countSource).HasBinaryNat (List.length store)
- querySourceNat : (work tapes.querySource).HasBinaryNat address
- copyScratchNat : (work tapes.copyScratch).HasBinaryNat 0
Instances For
The decoded value has been rewound to the canonical read boundary.
- restore : EntryLookupRestoreInvariant tapes store address initialWork work
- value : (work tapes.scan.entry.value).HasBinaryNat (read store address)
- destination : (work tapes.destination).HasBinaryNat 0
Instances For
The decoded value has been copied to the instruction operand tape while all scanner restoration data remains available.
- restore : EntryLookupRestoreInvariant tapes store address initialWork work
- value : (work tapes.scan.entry.value).HasBinaryNat (read store address)
- destination : (work tapes.destination).HasBinaryNat (read store address)
Instances For
Exact boundary after all nine scanner-owned binary tapes have been reset.
- copied : EntryLookupCopied tapes store address initialWork copiedWork
Instances For
Semantic form of the reset endpoint, stable while the encoded source is rewound.
- targetsBlank (i : Fin n) : i ∈ entryLookupResetTargets tapes → work i = TM.resetBinaryBlank
- countSourceNat : (work tapes.countSource).HasBinaryNat (List.length store)
- querySourceNat : (work tapes.querySource).HasBinaryNat address
- destination : (work tapes.destination).HasBinaryNat (read store address)
- copyScratchNat : (work tapes.copyScratch).HasBinaryNat 0
Instances For
Boundary after scanner reset and encoded-source rewind, immediately before the runtime entry count is copied back.
- scanner : EntryScanReady tapes.scan.entry (List.flatMap Entry.encode store) [] work work
- countZero : (work tapes.scan.count).HasBinaryNat 0
- countSourceNat : (work tapes.countSource).HasBinaryNat (List.length store)
- destination : (work tapes.destination).HasBinaryNat (read store address)
- copyScratchNat : (work tapes.copyScratch).HasBinaryNat 0
Instances For
Reusable endpoint after one loaded sparse-register read.
- scanner : EntryScanReady tapes.scan.entry (List.flatMap Entry.encode store) [] finalWork finalWork
- count : (finalWork tapes.scan.count).HasBinaryNat (List.length store)
- value : (finalWork tapes.destination).HasBinaryNat (read store address)
- copyScratch : (finalWork tapes.copyScratch).HasBinaryNat 0
Instances For
Reusable endpoint after reading through a tagged mutable overlay into the immutable public-input bank.
- scanner : EntryScanReady tapes.scan.entry (List.flatMap Entry.encode overlay) [] finalWork finalWork
- count : (finalWork tapes.scan.count).HasBinaryNat (List.length overlay)
- value : (finalWork tapes.destination).HasBinaryNat (DenseOverlay.read input overlay address)
- copyScratch : (finalWork tapes.copyScratch).HasBinaryNat 0
Instances For
Reusable fixed-address dense-overlay endpoint. The destination contains the decoded register value and the temporary query source is zero again.
- scanner : EntryScanReady tapes.scan.entry (List.flatMap Entry.encode overlay) [] finalWork finalWork
- count : (finalWork tapes.scan.count).HasBinaryNat (List.length overlay)
- querySource : (finalWork tapes.querySource).HasBinaryNat 0
- destination : (finalWork tapes.destination).HasBinaryNat (DenseOverlay.read input overlay address)
- copyScratch : (finalWork tapes.copyScratch).HasBinaryNat 0
Instances For
Reusable fixed-address endpoint. The destination holds the semantic read, the scanner is restored, and the fixed query source is zero again.
- scanner : EntryScanReady tapes.scan.entry (List.flatMap Entry.encode store) [] finalWork finalWork
- count : (finalWork tapes.scan.count).HasBinaryNat (List.length store)
- querySource : (finalWork tapes.querySource).HasBinaryNat 0
- destination : (finalWork tapes.destination).HasBinaryNat (read store address)
- copyScratch : (finalWork tapes.copyScratch).HasBinaryNat 0