Pure Cluster-Level Insert and Delete Operations for the Quotient Filter #
This file defines the computable cluster-level state updates insertCluster and deleteCluster on
FilterState b f, together with FilterInv.insertState and FilterInv.deleteState, and proves
that they preserve the canonical quotient-filter invariant FilterInv.
Main definitions #
Cslib.DataStructure.ApproximateMembership.QuotientFilter.FilterState.setFull,setOcc,setRunStart,setRem: primitive slot updates onFilterState b f.Cslib.DataStructure.ApproximateMembership.QuotientFilter.shiftRight,Cslib.DataStructure.ApproximateMembership.QuotientFilter.shiftLeft: tail-recursive slot-shift loops on(isRunStart, remAt).Cslib.DataStructure.ApproximateMembership.QuotientFilter.calcRunStart,calcTargetSlot,calcDeleteStop: computable run-boundary and target-slot indices inside a cluster[o .. o + ℓ).Cslib.DataStructure.ApproximateMembership.QuotientFilter.insertCluster,Cslib.DataStructure.ApproximateMembership.QuotientFilter.deleteCluster: computable cluster updates forinsertanddelete.Cslib.DataStructure.ApproximateMembership.QuotientFilter.FilterInv.insertState,Cslib.DataStructure.ApproximateMembership.QuotientFilter.FilterInv.deleteState: pure quotient-filter state transitions.
Main results #
Cslib.DataStructure.ApproximateMembership.QuotientFilter.FilterInv.insertState_filterInv: insertingu ∉ S(when#(insert u S) ≤ nand#(insert u S) < 2 ^ b) preservesFilterInv.Cslib.DataStructure.ApproximateMembership.QuotientFilter.FilterInv.deleteState_filterInv: deletingu ∈ SpreservesFilterInv.
Section 1: Primitive slot updates and shift loops on FilterState #
Update isFull at slot q.
Update isOcc at bucket q.
Update isRunStart at slot q.
Update remAt at slot q.
Tail-recursive right-shift of (isRunStart, remAt) on [s .. s + k) into
[s + 1 .. s + k + 1) relative to o.
Tail-recursive left-shift of (isRunStart, remAt) on [s + 1 .. s + k + 1) into [s .. s + k)
relative to o.
Section 2: Range filter helper #
Section 3: Computable run boundaries and target slot offsets #
Computable starting slot offset S_a of bucket a's run in cluster [o .. o + ℓ).
Computable target slot offset s for inserting or deleting remainder r in bucket a of
cluster [o .. o + ℓ).
Prefix scan over m < i for the stopping offset of the left-shift during delete in cluster
[o .. o + ℓ): the first m < i with a < m and occBefore st o m < runsBefore st o (m + 1), or
ℓ if none exists in [0, i).
Computable stopping offset e ∈ (a, ℓ] for the left-shift during delete in cluster
[o .. o + ℓ): the first m > a (m < ℓ) where occBefore st o m < runsBefore st o (m + 1), or
ℓ if none exists.
Section 4: Slot-stream list lemmas for shiftRight and shiftLeft #
Section 5: IntervalValid combinators #
Section 6: Cluster-level insertCluster and deleteCluster #
Pure cluster-level insertion of remainder r into bucket a ≤ ℓ of cluster [o .. o + ℓ).
Pure cluster-level deletion of remainder r from bucket a < ℓ of cluster [o .. o + ℓ).
Section 7: Global FilterInv preservation under insert and delete #
Pure quotient-filter state update for insert u.
Pure quotient-filter state update for delete u.
Global FilterInv preservation under insert: inserting u ∉ S (when #(insert u S) ≤ n
and #(insert u S) < 2 ^ b) preserves FilterInv.
Global FilterInv preservation under delete: deleting u ∈ S (when #S < 2 ^ b)
preserves FilterInv.