Function lattices::algebra::linearity

source ·
pub fn linearity<S: Debug + PartialEq + Clone, R: Debug + PartialEq + Clone>(
    items: &[S],
    f: impl Fn(S, S) -> S,
    g: impl Fn(R, R) -> R,
    q: impl Fn(S) -> R,
) -> Result<(), &'static str>
Expand description

Defines the linearity property

q is linear with respect to some group operation + if q(a+b) = q(a) + q(b) This is the same as q being a group homomorphism As defined in the paper “DBSP: Automatic Incremental View Maintenance for Rich Query Languages” Input parameters f, g, and q represent (f) the base operation of the algebraic structure for state, (g) the base operation of the algebraic structure the query q outputs to and (q) the query over f that we want to check for linearity (to incrementalize) respectively