The environment of the symbolic evaluation, built from a cut #
The symbolic evaluation (Provenance.SymTab) reads its descriptors and the
counters of its bounded recursions off an environment (Sym.SymEnv). This
file builds both from a query computing the cut, as unary relations over
the ambient context, and proves the environment sound wherever the cut
holds the null (Sym.envOK_envOf).
The counters of a recursion of arity n are the rows of E^K, E the
non-null values of the cut with the two constants 0 and
ValueType.nonzero, and K = n (k + 3): there are at least as many as
the rounds a restricted bag recursion over good values can run.
Unary relations of values #
The non-null rows of a unary relation.
Equations
Instances For
Dependency graph
The one row holding a constant.
Equations
- Sym.constQ a = AggQueryIn.Param (fun (x : Fin 1) => Sum.inl a) (ColKind.allReg 1)
Instances For
Dependency graph
The alphabet of the counters #
The values counters are written with: the non-null values of the
cut, 0 and ValueType.nonzero, each once.
Equations
- Sym.alphaQ f CQ = (AggQueryIn.sumByMuX (f 0) (f 1) (Sym.nnQ CQ) (AggQueryIn.sumByMuX (f 2) (f 3) (Sym.constQ 0) (Sym.constQ ValueType.nonzero))).dedupG
Instances For
Dependency graph
The supply names a query does not mention.
Equations
- Sym.FreshFor f q = ∀ (i : ℕ), AggQueryIn.noMention (f i) q
Instances For
Dependency graph
Powers of a unary relation #
The K-th power of a unary relation, by products.
Instances For
Dependency graph
The counters #
The width of the counters of a recursion of arity n, for k
parameter components.
Instances For
Dependency graph
The counters: the rows of E^K.
Equations
- Sym.ctrQ f CQ K = Sym.powU (Sym.alphaQ f CQ) K
Instances For
Dependency graph
The least counter.
Equations
- Sym.lqQ f cnt CQ K = Sym.leastQ (f 4) (f 5) cnt (Sym.ctrQ f CQ K)
Instances For
Dependency graph
The successor relation of the counters.
Instances For
Dependency graph
The values of a unary relation, as a finite set.
Equations
- Sym.valsU R = (Multiset.map (fun (y : Tuple T 1) => y 0) R).toFinset
Instances For
Dependency graph
The bound above a gap #
The cells of the descriptors #
A cell's columns as arguments: seven columns and the rank's.
Equations
- Sym.cellSA v th = Fin.addCases v th
Instances For
Dependency graph
The row of a constant thermometer.
Equations
- Sym.thRowQ k r = AggQueryIn.Param (fun (j : Fin k) => Sum.inl (Sym.therm k r j)) (ColKind.allReg k)
Instances For
Dependency graph
The ranks from 0 to r in unary.
Equations
- Sym.thQ f k 0 = Sym.thRowQ k 0
- Sym.thQ f k K.succ = AggQueryIn.sumByMuX (f (2 * K)) (f (2 * K + 1)) (Sym.thQ f k K) (Sym.thRowQ k (K + 1))
Instances For
Dependency graph
The five kinds of cells #
A concrete cell for each value of the cut.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The unary ranks.
Instances For
Dependency graph
A cell for each gap above a non-null value of the cut with a value above it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
A cell for each gap above the greatest non-null value of the cut.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The cells of the gap below the least non-null value of the cut.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The empty row where the cut holds no non-null value, nothing elsewhere.
Equations
- Sym.emptyQ s₁ s₂ cnt R = AggQueryIn.notInDiffX s₁ s₂ cnt AggQueryIn.unitC (Sym.projQ (fun (j : Fin 0) => j.elim0) R)
Instances For
Dependency graph
The cells of the one gap of a cut with no non-null value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The cells #
The cells of the descriptors, each once.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
A gap's lower bound: none, or a non-null value of the cut.
Instances For
Dependency graph
The cells: a value of the cut, or a gap with a rank at most k.
Equations
- Sym.CellShape C k x = ((∃ a ∈ C, x = Sym.enc C k (Sym.Code.conc a)) ∨ ∃ (l : WithBot T) (r : ℕ), Sym.GapOK C l ∧ r ≤ k ∧ x = Sym.enc C k (Sym.Code.fresh l r))
Instances For
Dependency graph
Powers of a relation, block by block #
The block i of a row of K blocks of m columns.
Instances For
Dependency graph
The K-th power of a relation, its rows laid out block after
block.
Instances For
Dependency graph
The descriptors #
The descriptors: k cells.
Equations
- Sym.descQ f cnt k CQ = Sym.projQ (fun (x : Fin (k * (7 + k))) => Sym.SA.col (Fin.cast ⋯ x)) (Sym.powX (Sym.cellsQ f cnt k CQ) k)
Instances For
Dependency graph
The environment #
The environment of the symbolic evaluation, built from a cut.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The environment built from a cut is sound wherever the cut holds the null.