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:
- non-Agg cases to the existing
Query.evaluateAnnotated_homplus the bridge betweenAnnotatedRelation.toLiftedandmapAnnotatedRelation(proven here); - the Agg case is a direct argument mirroring
Query.evaluateAggSum_hombut on theLiftedTK-valued output. The δ-applied row-annotation column is handled by the newmap_deltafield ofSemiringWithMonusHom.
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
- Query.mapAnnotatedFullRow h row k = LiftedTK.mapHomFn (⇑h.toRingHom) (row k)
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).