The symbolic evaluation of a query, operator by operator #
Sym.sym maps a query whose context starts with k parameter
components to a closed symbolic relation (Provenance.SymOps), and
Sym.symB a recursive term to a symbolic term carrying P further
columns through its rounds – the counter of a bounded recursion
(Provenance.SymMu). The translation reads the relation of descriptors
and the counters off an environment (Sym.SymEnv): what it is asked of
those is stated where it is used, by the correctness theorem.
A construction outside the fragment the translation is for – an apply, a union, a difference, a duplicate elimination, a set recursion, the rewritten world's operators – translates to an empty relation: such a query is not a symbolic evaluation's input, and the correctness theorem excludes it by hypothesis.
What the symbolic evaluation reads off its environment: the cut, the relation of descriptors, and for each arity of a bag recursion the width of its counters, the least counter and the successor relation.
- CQ : AggQueryIn T c 1 (ColKind.allReg 1)
The cut, as a unary relation.
- Desc : AggQueryIn T c (k * (7 + k)) (ColKind.allReg (k * (7 + k)))
The descriptors.
The width of the counters of a recursion of each arity.
- Lq (n : ℕ) : AggQueryIn T c (self.ctrK n) (ColKind.allReg (self.ctrK n))
The least counter.
- Sq (n : ℕ) : AggQueryIn T c (self.ctrK n + self.ctrK n) (ColKind.allReg (self.ctrK n + self.ctrK n))
The successor relation of the counters.
Instances For
Dependency graph
An empty relation that reads a hole, for the recursive terms the translation has no case for.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The source of a parameter leaf's column.
Equations
- Sym.pvCS pv j = match pv j with | Sum.inl a => Sym.CS.const a | Sum.inr o => Fin.addCases (fun (i : Fin k) => Sym.CS.par i) (fun (j' : Fin c) => Sym.CS.amb j') o
Instances For
Dependency graph
The row of a symbolic relation with one more column, the tag.
Equations
- Sym.tagSA a i = Fin.lastCases (Sym.SA.const a) (fun (i : Fin N) => Sym.SA.col i) i
Instances For
Dependency graph
A padding row of a scalar aggregation's union: a descriptor,
constant cells, and the tag 0.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The symbolic evaluation of a closed query.
Equations
- One or more equations did not get rendered due to their size.
- Sym.sym env f (AggQueryIn.Rel x✝ s) = AggQueryIn.castKind ⋯ (AggQueryIn.Proj (Sym.projSA (Sym.leafSA x✝)) (Sym.prodR env.Desc (AggQueryIn.Rel x✝ s)))
- Sym.sym env f (AggQueryIn.Param pv x✝) = AggQueryIn.castKind ⋯ (AggQueryIn.Proj (Sym.projSA (Sym.symProjSA 0 (Sym.pvCS pv))) env.Desc)
- Sym.sym env f (AggQueryIn.Proj ps q) = AggQueryIn.castKind ⋯ (AggQueryIn.Proj (Sym.projSA (Sym.symProjSA 0 fun (j : Fin x✝¹) => Sym.projCS (ps j))) (Sym.sym env f q))
- Sym.sym env f (AggQueryIn.Sel φ q hφ) = AggQueryIn.Sel (Sym.transPred 0 φ).toGen (Sym.sym env f q) ⋯
- Sym.sym env f (AggQueryIn.Explode k_1 a q) = Sym.sym env f q
- Sym.sym env f (AggQueryIn.Retag h q) = Sym.sym env f q
- Sym.sym env f (AggQueryIn.Hole x✝¹ s x✝) = AggQueryIn.emptyRel ((k + x✝¹) * (7 + k))
- Sym.sym env f AggQueryIn.Empty = AggQueryIn.emptyRel ((k + 0) * (7 + k))
- Sym.sym env f (a.Apply a_1) = AggQueryIn.emptyRel ((k + (n₁ + n₂)) * (7 + k))
- Sym.sym env f (a.Sum a_1) = AggQueryIn.emptyRel ((k + x✝¹) * (7 + k))
- Sym.sym env f a.Dedup = AggQueryIn.emptyRel ((k + x✝) * (7 + k))
- Sym.sym env f (a.Diff a_1) = AggQueryIn.emptyRel ((k + x✝) * (7 + k))
- Sym.sym env f (AggQueryIn.MuSet s a a_1) = AggQueryIn.emptyRel ((k + x✝) * (7 + k))
- Sym.sym env f (AggQueryIn.GammaTok is his ts fs a a_1 keep) = AggQueryIn.emptyRel ((k + (n₁ + n₂ + 1)) * (7 + k))
- Sym.sym env f (AggQueryIn.ProvSum is his t a) = AggQueryIn.emptyRel ((k + (n₁ + 1)) * (7 + k))
- Sym.sym env f (AggQueryIn.WinExpr P O o ws ts fs g a keeps) = AggQueryIn.emptyRel ((k + (n + 1)) * (7 + k))
Instances For
Dependency graph
The symbolic evaluation of a recursive term, carrying P further
columns through it.
Equations
- One or more equations did not get rendered due to their size.
- Sym.symB env f P s m (AggQueryIn.Hole x✝¹ s' x✝) = if h : x✝¹ = m then h ▸ AggQueryIn.Hole ((k + x✝¹) * (7 + k) + P) s else Sym.junkB ((k + x✝¹) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.Proj ps q) = AggQueryIn.castKind ⋯ (AggQueryIn.Proj (Sym.projSA (Sym.symProjSA P fun (j : Fin x✝¹) => Sym.projCS (ps j))) (Sym.symB env f P s m q))
- Sym.symB env f P s m (AggQueryIn.Sel φ q hφ) = AggQueryIn.Sel (Sym.transPred P φ).toGen (Sym.symB env f P s m q) ⋯
- Sym.symB env f P s m (AggQueryIn.Explode k_1 a q) = Sym.symB env f P s m q
- Sym.symB env f P s m (AggQueryIn.Retag h q) = Sym.symB env f P s m q
- Sym.symB env f P s m (AggQueryIn.Rel x✝ a) = Sym.junkB ((k + x✝) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.Param pv x✝) = Sym.junkB ((k + x✝¹) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m AggQueryIn.Empty = Sym.junkB ((k + 0) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (a.Apply a_1) = Sym.junkB ((k + (n₁ + n₂)) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (a.Sum a_1) = Sym.junkB ((k + x✝¹) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m a.Dedup = Sym.junkB ((k + x✝) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (a.Diff a_1) = Sym.junkB ((k + x✝) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.Mu s_1 a a_1) = Sym.junkB ((k + x✝¹) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.MuSet s_1 a a_1) = Sym.junkB ((k + x✝) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.Gamma is ts fs a keep ord) = Sym.junkB ((k + (n₁ + n₂)) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.GammaScalar ts fs a ord) = Sym.junkB ((k + x✝) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.GammaNest is his p f_1 a) = Sym.junkB ((k + (n₁ + 1)) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.GammaTok is his ts fs a a_1 keep) = Sym.junkB ((k + (n₁ + n₂ + 1)) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.ProvSum is his t a) = Sym.junkB ((k + (n₁ + 1)) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.Win P_1 O o w t f_1 a a_1 dist keep) = Sym.junkB ((k + (n + 1)) * (7 + k) + P) ((k + m) * (7 + k) + P) s
- Sym.symB env f P s m (AggQueryIn.WinExpr P_1 O o ws ts fs g a keeps) = Sym.junkB ((k + (n + 1)) * (7 + k) + P) ((k + m) * (7 + k) + P) s