package granary

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Granary_ivm.JoinSource

Incremental equi-join over Z-sets (#417 Phase 2).

Join is bilinear, so its delta is Δ(L ⋈ R) = ΔL ⋈ R + L ⋈ ΔR + ΔL ⋈ ΔR. An operator value maintains the integrated inputs L and R (indexed by join key) and, given a delta on either side, returns the matching output delta and folds it into a materialized output — so the join is kept current in time proportional to the change, not the size of L and R.

Output carries bag multiplicity: a matched pair contributes the product of its input weights. Set / SELECT DISTINCT semantics, if wanted, are a Zset.S.distinct applied to the output, not built in here.

Sourcemodule type SPEC = sig ... end

What to join: the two input and one output Z-set domains, the join key, and how to extract keys / combine a matched pair into an output element.

Sourcemodule Make (S : SPEC) : sig ... end

Make (S) builds an incremental equi-join operator for spec S.