package granary

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

Module Granary_ivm.ZsetSource

Z-sets — the core data structure of DBSP-style incremental computation (#417 Phase 1).

A Z-set over a domain is a finitely-supported map from elements to signed integer weights: an element present with weight +1 is "in the set once", +n "n times", and a negative weight is a retraction. Inserts and deletes from the row-level delta feed (#419) lift to a Z-set delta (Inserted+1, Deleted-1), and the incremental operators (Phase 2) are functions over Z-sets that commute with add, so a view is maintained by applying operators to the input delta rather than recomputing.

A Z-set is kept canonical: an element with total weight 0 is never stored, so two Z-sets are equal iff they have the same elements with the same nonzero weights.

Sourcemodule type ELEMENT = sig ... end

The element domain of a Z-set: a totally ordered, printable type.

Sourcemodule type S = sig ... end

The operations a Z-set supports.

Sourcemodule Make (E : ELEMENT) : S with type elt = E.t

Make (E) builds a Z-set module over element domain E.