Dynamic Approximate-Membership Filter Specification #
This file defines an algorithm-independent oblivious-sequence specification
(Cslib.DataStructure.ApproximateMembership.spec) for a dynamic approximate-membership filter
(supporting insertions, deletions of present keys, and membership queries) over a finite universe
Fin U with capacity n and per-query false-positive probability bound ε : ℝ≥0∞.
Semantic design and duplicate-insertion convention #
At any point in an operation sequence ops : List (Op U), the filter represents a dynamic set
S : Finset (Fin U) of at most n keys, starting from ∅:
Op.insert uis admissible whenu ∉ Sand#S < n, transitioning toinsert u S;Op.delete uis admissible whenu ∈ S, transitioning toS.erase u;Op.query uis always admissible and leavesSunchanged.
Excluding duplicate insertions of an already-present key (u ∉ S) at the specification level is
essential for achieving $O(1)$ per-operation expected time in fingerprint-based filters such as the
quotient filter Pagh, Pagh and Rao; Bender et al.: if an
operation sequence could insert the same key u n times, all n copies would share the same
quotient and remainder on every random branch, forming a deterministic run of length n and
forcing $\Omega(n)$ probe time. Internally, the quotient filter still maintains the multiset of
fingerprints S.val.map fp so that when two distinct present keys x ≠ y in S collide in both
quotient and remainder, deleting x removes only one copy of their shared fingerprint and preserves
zero false negatives for y.
Main definitions #
Cslib.DataStructure.ApproximateMembership.Op,Cslib.DataStructure.ApproximateMembership.Result,Cslib.DataStructure.ApproximateMembership.Label: filter operations (insert,delete,query), return types (PUnitandBool), and transcript labels.Cslib.DataStructure.ApproximateMembership.stepSet,Cslib.DataStructure.ApproximateMembership.activeSetFrom,Cslib.DataStructure.ApproximateMembership.activeSet,Cslib.DataStructure.ApproximateMembership.activeSetBefore: evolution of the present key set along an operation sequence.Cslib.DataStructure.ApproximateMembership.ValidOp,Cslib.DataStructure.ApproximateMembership.ValidOpSeqFrom,Cslib.DataStructure.ApproximateMembership.ValidOpSeq: operation-sequence admissibility under capacityn.Cslib.DataStructure.ApproximateMembership.NoFalseNegatives,Cslib.DataStructure.ApproximateMembership.FalsePositiveAt,Cslib.DataStructure.ApproximateMembership.spec: pathwise zero-false-negative invariant, per-query false-positive event, andObliviousSequenceSpec.
Main results #
Cslib.DataStructure.ApproximateMembership.card_activeSetFrom_le,Cslib.DataStructure.ApproximateMembership.card_activeSet_le,Cslib.DataStructure.ApproximateMembership.card_activeSetBefore_le: any admissible operation sequence maintains#S ≤ nat every step.Cslib.DataStructure.ApproximateMembership.spec_weaken: monotonicity ofspec U n εin the false-positive boundε.
References #
- B. H. Bloom, Space/time trade-offs in hash coding with allowable errors
- L. Carter, R. Floyd, J. Gill, G. Markowsky and M. Wegman, Exact and approximate membership testers
- A. Pagh, R. Pagh and S. S. Rao, An optimal Bloom filter replacement
- M. A. Bender, M. Farach-Colton, R. Johnson, R. Kraner, B. C. Kuszmaul, D. Medjedovic, P. Montes, P. Shetty, R. P. Spillane and E. Zadok, Don't thrash: how to cache your hash on flash
Operations on a dynamic approximate-membership filter over universe Fin U.
- insert {U : ℕ} (u : Fin U) : Op U
Insert key
uinto the represented set. - delete {U : ℕ} (u : Fin U) : Op U
Delete key
ufrom the represented set (valid whenuis currently present). - query {U : ℕ} (u : Fin U) : Op U
Query whether key
uis currently in the represented set.
Instances For
Transcript entry pairing a filter operation with its observation.
Oblivious-sequence specification of a dynamic approximate-membership filter over universe
Fin U with capacity n and per-query false-positive probability bound ε : ℝ≥0∞:
- Every transcript in
μ.supportmatchesopsand has zero false negatives on every query of a currently present key (u ∈ activeSetBefore ops idx). - At every query of a currently absent key (
ops[idx]? = some (.query u)withu ∉ activeSetBefore ops idx), the probability of returningtrueis at mostε.