Monotone Memory Predicates, memScan, and writeDesc #
Factor descriptor invariants over allocated Word-RAM list blocks, together with the shared linear
membership scanner memScan and 4-word descriptor writer writeDesc.
Main definitions #
Cslib.Algorithms.WordRAM.VariableElimination.HoldsFactor,HoldsFactorList,AllDataBelow: append-only memory layout predicates for factor descriptors.Cslib.Algorithms.WordRAM.VariableElimination.memScan: linear array membership scan.Cslib.Algorithms.WordRAM.VariableElimination.writeDesc: 4-word factor descriptor writer.
Main results #
Cslib.Algorithms.WordRAM.VariableElimination.preservesBelow_of_modifies: a frameMemory.Modifies (Set.Ici F)extends a prefix frame belowF.Cslib.Algorithms.WordRAM.VariableElimination.memScan_framed,Cslib.Algorithms.WordRAM.VariableElimination.writeDesc_framed: framed triples fixing the result and final state ofmemScanandwriteDesc, forMemory.FramedTriple.call_eq.
A step that changes only cells at or above F extends a prefix frame below F.
Factor descriptors #
A 4-word factor descriptor at descAddr points to f's scope and entries.
Contiguous array of 4-word descriptors for fs starting at base.
Arguments (ptr, len, key) for memScan and filterNe.
- target : ℕ
Field
targetofMemScanArgs. - base : ℕ
Field
baseofMemScanArgs. - len : ℕ
Field
lenofMemScanArgs.
Instances For
Product equivalence encoding MemScanArgs as words.
Linear scan returning 1 iff key occurs in the slice [ptr, ptr + len).
memScan reading a list xs below the frontier meets a framed triple that modifies nothing
and fixes its result, 1 exactly when the key occurs in xs, and its final state.
Every scope/entry cell referenced by descriptors fs lies strictly below F.
Arguments for storing one 4-word factor descriptor at dst.
- dst : ℕ
Field
dstofWriteDescArgs. - scPtr : ℕ
Field
scPtrofWriteDescArgs. - scLen : ℕ
Field
scLenofWriteDescArgs. - enPtr : ℕ
Field
enPtrofWriteDescArgs. - enLen : ℕ
Field
enLenofWriteDescArgs.
Instances For
Product equivalence encoding WriteDescArgs as words.
Write a 4-word factor descriptor (scPtr, scLen, enPtr, enLen) at dst.
An admissible writeDesc meets a framed triple of cost 4 that changes only cells at or
above any F ≤ args.dst and fixes its result and final state.