Documentation

Provenance.QueryEvaluateInVKHom

Unified hom commutation for Query.evaluateAnnotatedFull #

The single hom commutation theorem Query.evaluateAnnotatedFull_hom asserts that for any well-formed query q and any SemiringWithMonusHom h : K → K',

evaluateAnnotatedFull q hq (h ⋆ d) =
  (evaluateAnnotatedFull q hq d).map (mapAnnotatedFullRow h)

where mapAnnotatedFullRow h is the pointwise pushforward on a LiftedTK-tuple (data cells unchanged, ann α mapped through h, ktensor t mapped through KTensor.mapHom h.toRingHom).

This is the aggregation analogue of Query.evaluateAnnotated_hom (Green, Karvounarakis & Tannen, Provenance Semirings, Prop. 3.5) extended to the (R5) aggregation case, and continues the “compile once, evaluate many” theme of Sen, Maniu & Senellart, ProvSQL: a single K-annotated computation can be specialised to any concrete m-semiring K' through an m-semiring homomorphism h, including for aggregate queries with K-tensor row annotations.

The proof reduces:

References #

Bridge: mapAnnotatedRelation and toLifted commute #

The bridge between annotated-relation pushforward and toLifted: pushing h through and then lifting agrees with lifting and then applying mapHomFn h.toRingHom pointwise on each tuple cell.

Row-wise pushforward on evaluateAnnotatedFull output #

The row-wise pushforward applied to an evaluateAnnotatedFull output: each LiftedTK T K cell is mapped through LiftedTK.mapHomFn h.toRingHom.

Equations
Instances For

    Unified hom commutation theorem #

    Unified hom commutation for Query.evaluateAnnotatedFull.

    For any SemiringWithMonusHom h : K → K' and any well-formed query q (non-aggregating, or top-level aggregation with non-aggregating inner query), evaluating the unified annotated semantics on the pushforward h ⋆ d is the same as evaluating on d and then mapping each output row pointwise through LiftedTK.mapHomFn h.toRingHom.

    This is the aggregation extension of the Green-Karvounarakis-Tannen hom commutation property (Prop. 3.5), and the unified counterpart of both Query.evaluateAnnotated_hom (non-Agg) and Query.evaluateAggSum_hom (Agg, separate output format).