Function lattices::algebra::bilinearity
source · pub fn bilinearity<S: Debug + PartialEq + Clone, R: Debug + PartialEq + Clone, T: Debug + PartialEq + Clone>(
items_f: &[S],
items_h: &[T],
f: impl Fn(S, S) -> S,
h: impl Fn(T, T) -> T,
g: impl Fn(R, R) -> R,
q: impl Fn(S, T) -> R,
) -> Result<(), &'static str>
Expand description
Defines the bilinearity property
q is bilinear with respect to + if q(a + b, c) = q(a,c) + q(b,c) and q(a,c + d) = q(a,c) + q(a,d) This is the same as q being distributive over the addition operation of the three groups S, T, and R in q:S x T –> R As defined in the paper “DBSP: Automatic Incremental View Maintenance for Rich Query Languages Input parameters f, h, g, and q represent (f) the base operation of the algebraic structure on the left input to the query q, (h) the base operation of the algebraic structure on the right input to the query q, (g) the base operation of the algebraic structure the query q outputs to, and (q) The query over (f,g) that we want to check for bilinearity (to incrementalize)