One family identifier, one value #
An operator building aggregate values stamps each with a family
identifier: its label, the group key, the parameters it records, the
column, and the terms applied since. This file proves that across all the
evaluations a query performs – one per row of an apply's left side, one
per round of a recursion – two values carrying the same identifier are
the same value (AggQueryIn.builds_coherent). This is what lets a
recursion's body build values: what it builds in one round, it builds
again in the next.
Three things are asked of the query, each because an identifier would otherwise not determine the value:
AggQueryIn.readsRecorded– every operator records the parameters its subtree reads, so that equal parameters mean equal inputs;AggQueryIn.labelsDistinct– no two operators share a label;AggQueryIn.sourceCols– no projection column applies an arbitrary function to an aggregate value (ProjColIn.aggTerm, a column of the rewritten world), which the identifier would not record;AggQueryIn.allFramesContainSelf– every window frame contains the current row, so that a window's value is a function of the row's tuple; anEXCLUDE CURRENT ROWframe removes one occurrence of the row, which two rows with the same tuple but different annotations remove differently.
The fences #
Every window frame contains its current row, single-frame windows included.
Equations
- (AggQueryIn.Rel x✝ a).allFramesContainSelf = True
- (AggQueryIn.Hole x✝¹ s x✝).allFramesContainSelf = True
- (AggQueryIn.Param pv x✝).allFramesContainSelf = True
- AggQueryIn.Empty.allFramesContainSelf = True
- (AggQueryIn.Proj ps q).allFramesContainSelf = q.allFramesContainSelf
- (AggQueryIn.Sel φ q hφ).allFramesContainSelf = q.allFramesContainSelf
- (q₁.Prod q₂).allFramesContainSelf = (q₁.allFramesContainSelf ∧ q₂.allFramesContainSelf)
- (q₁.Apply q₂).allFramesContainSelf = (q₁.allFramesContainSelf ∧ q₂.allFramesContainSelf)
- (q₁.Sum q₂).allFramesContainSelf = (q₁.allFramesContainSelf ∧ q₂.allFramesContainSelf)
- q.Dedup.allFramesContainSelf = q.allFramesContainSelf
- (q₁.Diff q₂).allFramesContainSelf = (q₁.allFramesContainSelf ∧ q₂.allFramesContainSelf)
- (AggQueryIn.Explode k a q).allFramesContainSelf = q.allFramesContainSelf
- (AggQueryIn.Mu s q₀ q₁).allFramesContainSelf = (q₀.allFramesContainSelf ∧ q₁.allFramesContainSelf)
- (AggQueryIn.MuSet s q₀ q₁).allFramesContainSelf = (q₀.allFramesContainSelf ∧ q₁.allFramesContainSelf)
- (AggQueryIn.Gamma is ts fs q keep ord).allFramesContainSelf = q.allFramesContainSelf
- (AggQueryIn.GammaScalar ts fs q ord).allFramesContainSelf = q.allFramesContainSelf
- (AggQueryIn.GammaNest is his p f q).allFramesContainSelf = q.allFramesContainSelf
- (AggQueryIn.ProvSum is his t q).allFramesContainSelf = q.allFramesContainSelf
- (AggQueryIn.Retag h q).allFramesContainSelf = q.allFramesContainSelf
- (AggQueryIn.GammaTok is his ts fs a q keep).allFramesContainSelf = q.allFramesContainSelf
- (AggQueryIn.Win P O o w t f q a dist keep).allFramesContainSelf = (w.ContainsSelf ∧ q.allFramesContainSelf)
- (AggQueryIn.WinExpr P O o ws ts fs g q_1 keeps).allFramesContainSelf = ((∀ (l : Fin q), (ws l).ContainsSelf) ∧ q_1.allFramesContainSelf)
Instances For
Dependency graph
Every projection column is one of the source language's: none applies an arbitrary function to an aggregate value.
Equations
- (AggQueryIn.Rel x✝ a).sourceCols = True
- (AggQueryIn.Hole x✝¹ s x✝).sourceCols = True
- (AggQueryIn.Param pv x✝).sourceCols = True
- AggQueryIn.Empty.sourceCols = True
- (AggQueryIn.Proj ps q).sourceCols = ((∀ (j : Fin x✝¹), (ps j).sourceCol = true) ∧ q.sourceCols)
- (AggQueryIn.Sel φ q hφ).sourceCols = q.sourceCols
- (q₁.Prod q₂).sourceCols = (q₁.sourceCols ∧ q₂.sourceCols)
- (q₁.Apply q₂).sourceCols = (q₁.sourceCols ∧ q₂.sourceCols)
- (q₁.Sum q₂).sourceCols = (q₁.sourceCols ∧ q₂.sourceCols)
- q.Dedup.sourceCols = q.sourceCols
- (q₁.Diff q₂).sourceCols = (q₁.sourceCols ∧ q₂.sourceCols)
- (AggQueryIn.Explode k a q).sourceCols = q.sourceCols
- (AggQueryIn.Mu s q₀ q₁).sourceCols = (q₀.sourceCols ∧ q₁.sourceCols)
- (AggQueryIn.MuSet s q₀ q₁).sourceCols = (q₀.sourceCols ∧ q₁.sourceCols)
- (AggQueryIn.Gamma is ts fs q keep ord).sourceCols = q.sourceCols
- (AggQueryIn.GammaScalar ts fs q ord).sourceCols = q.sourceCols
- (AggQueryIn.GammaNest is his p f q).sourceCols = (p.sourceCol = true ∧ q.sourceCols)
- (AggQueryIn.ProvSum is his t q).sourceCols = q.sourceCols
- (AggQueryIn.Retag h q).sourceCols = q.sourceCols
- (AggQueryIn.GammaTok is his ts fs a q keep).sourceCols = q.sourceCols
- (AggQueryIn.Win P O o w t f q a dist keep).sourceCols = q.sourceCols
- (AggQueryIn.WinExpr P O o ws ts fs g q_1 keeps).sourceCols = q_1.sourceCols
Instances For
Dependency graph
The values an evaluation builds #
The values the operators of a query build while it is evaluated: the columns an operator adds to its output rows, and what its subqueries build – once per row of an apply's left side, once per round of a recursion.
Equations
- One or more equations did not get rendered due to their size.
- (AggQueryIn.Rel x✝⁴ a).Builds x✝³ x✝² x✝¹ x✝ = False
- (AggQueryIn.Hole x✝⁵ s x✝⁴).Builds x✝³ x✝² x✝¹ x✝ = False
- (AggQueryIn.Param pv x✝⁴).Builds x✝³ x✝² x✝¹ x✝ = False
- AggQueryIn.Empty.Builds x✝³ x✝² x✝¹ x✝ = False
- (AggQueryIn.Proj ps q).Builds x✝³ x✝² x✝¹ x✝ = q.Builds x✝³ x✝² x✝¹ x✝
- (AggQueryIn.Sel φ q hφ).Builds x✝³ x✝² x✝¹ x✝ = q.Builds x✝³ x✝² x✝¹ x✝
- (q₁.Prod q₂).Builds x✝³ x✝² x✝¹ x✝ = (q₁.Builds x✝³ x✝² x✝¹ x✝ ∨ q₂.Builds x✝³ x✝² x✝¹ x✝)
- (q₁.Sum q₂).Builds x✝³ x✝² x✝¹ x✝ = (q₁.Builds x✝³ x✝² x✝¹ x✝ ∨ q₂.Builds x✝³ x✝² x✝¹ x✝)
- q.Dedup.Builds x✝³ x✝² x✝¹ x✝ = q.Builds x✝³ x✝² x✝¹ x✝
- (q₁.Diff q₂).Builds x✝³ x✝² x✝¹ x✝ = (q₁.Builds x✝³ x✝² x✝¹ x✝ ∨ q₂.Builds x✝³ x✝² x✝¹ x✝)
- (AggQueryIn.Explode k a q).Builds x✝³ x✝² x✝¹ x✝ = q.Builds x✝³ x✝² x✝¹ x✝
- (AggQueryIn.GammaScalar ts fs q ord).Builds x✝³ x✝² x✝¹ x✝ = ((∃ r ∈ (AggQueryIn.GammaScalar ts fs q ord).evaluate x✝³ x✝² x✝¹, ∃ (j : Fin x✝⁴), r.1 j = Sum.inr x✝) ∨ q.Builds x✝³ x✝² x✝¹ x✝)
- (AggQueryIn.GammaNest is his p f q).Builds x✝³ x✝² x✝¹ x✝ = ((∃ r ∈ (AggQueryIn.GammaNest is his p f q).evaluate x✝³ x✝² x✝¹, r.1 (Fin.natAdd n₁ 0) = Sum.inr x✝) ∨ q.Builds x✝³ x✝² x✝¹ x✝)
- (AggQueryIn.ProvSum is his t q).Builds x✝³ x✝² x✝¹ x✝ = q.Builds x✝³ x✝² x✝¹ x✝
- (AggQueryIn.Retag h q).Builds x✝³ x✝² x✝¹ x✝ = q.Builds x✝³ x✝² x✝¹ x✝
Instances For
Dependency graph
Values derived by terms #
The values derived from S by terms: S and every term over
one of them.
- base {T K₀ : Type} [ValueType T] {S : AggTok T K₀ → Prop} {x : AggTok T K₀} : S x → TermCl S x
- step {T K₀ : Type} [ValueType T] {S : AggTok T K₀ → Prop} {x : AggTok T K₀} (t : TermIn T 1 0) : TermCl S x → TermCl S (AggTok.postcompTerm t x)
Instances For
Dependency graph
One family identifier, one value.
Instances For
Dependency graph
Terms over coherent values #
The terms a family identifier records.
Instances For
Dependency graph
A family identifier with its terms forgotten.
Instances For
Dependency graph
Terms applied in order.
Equations
- x.postcompTerms [] = x
- x.postcompTerms (t :: ts) = (AggTok.postcompTerm t x).postcompTerms ts
Instances For
Dependency graph
What is built: the operator's label, no term #
The width of each operator #
The column a family identifier records.
Instances For
Dependency graph
Each operator's label with the number of columns it builds.
Equations
- (AggQueryIn.Rel x✝ a).labWidths = []
- (AggQueryIn.Hole x✝¹ s x✝).labWidths = []
- (AggQueryIn.Param pv x✝).labWidths = []
- AggQueryIn.Empty.labWidths = []
- (AggQueryIn.Proj ps q).labWidths = q.labWidths
- (AggQueryIn.Sel φ q hφ).labWidths = q.labWidths
- (q₁.Prod q₂).labWidths = q₁.labWidths ++ q₂.labWidths
- (q₁.Apply q₂).labWidths = q₁.labWidths ++ q₂.labWidths
- (q₁.Sum q₂).labWidths = q₁.labWidths ++ q₂.labWidths
- q.Dedup.labWidths = q.labWidths
- (q₁.Diff q₂).labWidths = q₁.labWidths ++ q₂.labWidths
- (AggQueryIn.Explode k a q).labWidths = q.labWidths
- (AggQueryIn.Mu s q₀ q₁).labWidths = q₀.labWidths ++ q₁.labWidths
- (AggQueryIn.MuSet s q₀ q₁).labWidths = q₀.labWidths ++ q₁.labWidths
- (AggQueryIn.Gamma is ts fs q keep ord).labWidths = labCons n₂ (lab, n₂) q.labWidths
- (AggQueryIn.GammaScalar ts fs q ord).labWidths = labCons x✝ (lab, x✝) q.labWidths
- (AggQueryIn.GammaNest is his p f q).labWidths = (lab, 1) :: q.labWidths
- (AggQueryIn.ProvSum is his t q).labWidths = q.labWidths
- (AggQueryIn.Retag h q).labWidths = q.labWidths
- (AggQueryIn.GammaTok is his ts fs a q keep).labWidths = labCons n₂ (lab, n₂) q.labWidths
- (AggQueryIn.Win P O o w t f q a dist keep).labWidths = (lab, 1) :: q.labWidths
- (AggQueryIn.WinExpr P O o ws ts fs g q_1 keeps).labWidths = (lab, 1) :: q_1.labWidths
Instances For
Dependency graph
Where a row's values come from #
The values an environment provides to a query reading the
rounds l: its context's, and those of the rounds bound to the names in
l.
Equations
Instances For
Dependency graph
Every value a row holds is built by the query or provided by the environment, up to terms.
Dependency graph
Equal parameters, equal inputs #
One evaluation of a window: the value is the tuple's #
One evaluation of an operator: one value per identifier #
Coherent situations #
A coherent situation: the plain context is the collapse of the environment's context, as the evaluator keeps it.
Instances For
Dependency graph
The values a situation provides #
What an operator stamps #
The rows an operator builds #
Two evaluations of one operator #
One operator in two coherent situations builds one value per
identifier, given that its parameters' identifiers – which are smaller –
already determine their values (hU). Equal identifiers record equal
parameters, so the two situations agree where the operator reads
(EvalEnv.agree_of_paramKey), so the operator's two evaluations are one
(AggQueryIn.evaluate_congr_reads), in which the identifier determines the
value (hfun).
Dependency graph
Combining the cases #
Across the evaluations of a query #
What coherence says of two values of one family: one identifier, one value, and one family, one class.
Instances For
Dependency graph
What the induction carries: in two coherent situations whose
provided and built values lie in U, two values the query builds with the
same identifier, of size at most M, are equal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The theorem #
One family, one class: values of one family are read in one listing, so they carry the same annotations.
Equations
Instances For
Dependency graph
One family identifier, one value, across every evaluation a query
performs; one family, one class. In two coherent situations whose
provided values are terms over a set R₀ of values that record no term,
carry no label of the query and are themselves coherent, the values the
query builds in either situation, those of R₀, and every term over them
have one value per identifier and one class per family. The induction is
on the size of the identifier: an operator's identifier records its
parameters' identifiers, which are smaller, and equal parameters make
equal inputs (AggQueryIn.coh_node).