The cut a query's symbolic evaluation is taken relative to #
The symbolic evaluation of a query is correct relative to a cut holding
every value the evaluation compares, groups or makes up (Sym.Good): the
values of the relations it reads, its constants, the null, the context's
values, and the values its aggregations compute. The last are computed
by symbolic evaluations themselves: a grouping's counts, at every
parameter row, are read off the symbolic evaluation of its input relative
to the cut of that input, which is smaller. So the cut is defined by
recursion on the query (Sym.cutQ), each aggregation adding the values
its symbolic counterpart computes, and it is proved to make the
evaluation good (Sym.good_cutQ).
The union of finitely many unary relations.
Equations
- Sym.unionFin f 0 x_2 = AggQueryIn.emptyRel 1
- Sym.unionFin f n.succ F = AggQueryIn.sumByMuX (f 0) (f 1) (F 0) (Sym.unionFin (fun (i : ℕ) => f (i + 2)) n fun (i : Fin n) => F i.succ)
Instances For
Dependency graph
The union of two unary relations.
Equations
- Sym.u2 f a b = AggQueryIn.sumByMuX (f 0) (f 1) a b
Instances For
Dependency graph
The values of every column of a relation.
Equations
- Sym.valsOf f q = Sym.unionFin f n fun (i : Fin n) => Sym.projQ (fun (x : Fin 1) => Sym.SA.col i) q
Instances For
Dependency graph
The context's values.
Equations
- Sym.ambQ f c = Sym.unionFin f c fun (j : Fin c) => Sym.projQ (fun (x : Fin 1) => Sym.SA.amb j) AggQueryIn.unitC
Instances For
Dependency graph
The null, if the domain has one.
Equations
- Sym.nullQ = match ValueType.nullVal with | some ν => Sym.constQ ν | none => AggQueryIn.emptyRel 1
Instances For
Dependency graph
Finitely many constants.
Equations
- Sym.constsQ f S = Sym.unionFin f S.toList.length fun (i : Fin S.toList.length) => Sym.constQ (S.toList.get i)
Instances For
Dependency graph
The aggregations of the symbolic evaluation, before their cells #
A symbolic grouping's rows: the keys' cells, then the aggregate values themselves.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
A symbolic second-level grouping's rows.
Equations
- Sym.nestRaw env f is p g q = (AggQueryIn.GammaNest (Sym.gKeyIdx is) ⋯ (Sym.projV p) g (Sym.sym env f q)).allRegOf
Instances For
Dependency graph
A symbolic scalar aggregation's rows, over the padded union.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
A symbolic window's rows: the input's cells, then the window's value itself.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The cut #
An eighth of a supply of names.
Instances For
Dependency graph
The values of some columns of a relation.
Equations
- Sym.colsQ f q idx = Sym.unionFin f p fun (j : Fin p) => Sym.projQ (fun (x : Fin 1) => Sym.SA.col (idx j)) q
Instances For
Dependency graph
A cut: the null, the context's values, finitely many constants and the values a query computes.
Equations
Instances For
Dependency graph
The values a query reads and computes: those of the relations it reads and those its aggregations compute, read off their symbolic counterparts relative to the cut of their input.
Equations
- One or more equations did not get rendered due to their size.
- Sym.cutCore cnt f (AggQueryIn.Rel x✝ s) = Sym.valsOf f (AggQueryIn.Rel x✝ s)
- Sym.cutCore cnt f (AggQueryIn.Hole x✝¹ s x✝) = AggQueryIn.emptyRel 1
- Sym.cutCore cnt f (AggQueryIn.Param pv x✝) = AggQueryIn.emptyRel 1
- Sym.cutCore cnt f AggQueryIn.Empty = AggQueryIn.emptyRel 1
- Sym.cutCore cnt f (AggQueryIn.Proj ps q) = Sym.cutCore cnt f q
- Sym.cutCore cnt f (AggQueryIn.Sel φ q hφ) = Sym.cutCore cnt f q
- Sym.cutCore cnt f (q₁.Prod q₂) = Sym.u2 (Sym.part f 0) (Sym.cutCore cnt (Sym.part f 1) q₁) (Sym.cutCore cnt (Sym.part f 2) q₂)
- Sym.cutCore cnt f (AggQueryIn.Explode k_1 a q) = Sym.cutCore cnt f q
- Sym.cutCore cnt f (AggQueryIn.Retag h q) = Sym.cutCore cnt f q
- Sym.cutCore cnt f (AggQueryIn.Mu s q₀ q₁) = Sym.u2 (Sym.part f 0) (Sym.cutCore cnt (Sym.part f 1) q₀) (Sym.cutCore cnt (Sym.part f 2) q₁)
- Sym.cutCore cnt f (a.Apply a_1) = AggQueryIn.emptyRel 1
- Sym.cutCore cnt f (a.Sum a_1) = AggQueryIn.emptyRel 1
- Sym.cutCore cnt f a.Dedup = AggQueryIn.emptyRel 1
- Sym.cutCore cnt f (a.Diff a_1) = AggQueryIn.emptyRel 1
- Sym.cutCore cnt f (AggQueryIn.MuSet s a a_1) = AggQueryIn.emptyRel 1
- Sym.cutCore cnt f (AggQueryIn.GammaTok is his ts fs a a_1 keep) = AggQueryIn.emptyRel 1
- Sym.cutCore cnt f (AggQueryIn.ProvSum is his t a) = AggQueryIn.emptyRel 1
- Sym.cutCore cnt f (AggQueryIn.WinExpr P O o ws ts fs g a keeps) = AggQueryIn.emptyRel 1
Instances For
Dependency graph
The cut of a query.
Instances For
Dependency graph
What the cut names #
What the cut holds #
The cut makes the evaluation good #
The classes of the basis with products in place of the apply:
∅, Π, σ, ×, γ, win, μ^⊎.
Equations
Instances For
Dependency graph
What a cut is asked of a query: the null, the context's values, the query's constants and the values of its core.
Equations
- Sym.CutOK cnt f q C D γ = ((∀ (a : T), ValueType.isNull a = true → a ∈ C) ∧ (∀ (j : Fin c'), γ j ∈ C) ∧ q.allConsts ⊆ C ∧ Sym.valsU ((Sym.cutCore cnt f q).evaluatePlain D γ) ⊆ C)
Instances For
Dependency graph
The table of a query #
The environment of a query's table: built from the query's cut.
Instances For
Dependency graph
The table of a query: its symbolic evaluation relative to its cut, the encodings of its rows at every type of parameter row.
Equations
- Sym.tabQ cnt f q = Sym.sym (Sym.tabEnv cnt f q) (Sym.part f 2) q
Instances For
Dependency graph
The table holds, under each parameter row's descriptor, the encodings of the rows the query computes at that row, wherever the query settles.