The control's dictionary: which slot plays which role #
The program's states carry a pointer f : dt.CtlIx → A, and every semantic
parameter of the machinery – the coordinates a name guard compares against,
the accumulators the folds update, the flags a verdict is stored in – is a
designation of some of its slots. This file fixes them, once, with the
casts through the budgets that DescriptiveComplexity.Draw.Data.eDim and
friends were computed for:
| role | slots |
|---|---|
| the coordinates of the current loop element | lvC (the first dd₀ of the lv family) |
| the inner fold's accumulators | accC |
| an element loop's sub-fold accumulators | sacC |
| the verdicts of the matrix's atoms | avC |
| the leaf reads of the current round | rdfC |
| the tag witnesses | tgfC |
| the gates' verdict, a copied bit, two scratch | gateFlagC, bitFlagC, scratchC |
and the two operations every parameter is built from: reading a slot as a
bit, and writing one (DescriptiveComplexity.Draw.Data.ctlBit and
setCtl), with their read-back equations. Nothing here is about the tape;
the machinery's dstSt parameters are functions of the pointer alone, and
this is their vocabulary.
The designations #
The coordinates of the loop element: the first dd₀ loop-variable
slots. A name guard compares a cell's name slots against these, so they are
the coord of every read and write trip.
Equations
- dt.lvC j = DescriptiveComplexity.Draw.Ctl.lv (Fin.castLE ⋯ j)
Instances For
Dependency graph
The inner fold's accumulators: one per level of the quantifier prefix, and one over.
Equations
Instances For
Dependency graph
A sub-fold's accumulators: one per level of an element loop's own prefix.
Equations
Instances For
Dependency graph
The verdict of an atom of the matrix.
Equations
Instances For
Dependency graph
The verdict of a leaf read of the current element-loop round.
Equations
Instances For
Dependency graph
A tag-witness flag.
Equations
Instances For
Dependency graph
The gates' verdict flag: cleared by a failing block, read by the verdict checkpoint.
Equations
Instances For
Dependency graph
The copied bit of a tuple loop: written by the read trip's verdict exit, read back by the write trip.
Equations
Instances For
Dependency graph
The remaining scratch flags: the last leaf's value, the comparison loops' accumulator and their two verdict bits, and two spare.
Equations
- dt.scratchC k = DescriptiveComplexity.Draw.Ctl.flag (k.addNat 2)
Instances For
Dependency graph
The ∃-levels' gate flag of a VAL round: the conjunction, over the existentially quantified levels of the variable's pack, of “this level's inner block is an encoding”. The last free scratch flag.
Equations
Instances For
Dependency graph
The ∀-levels' gate flag of a VAL round: the same conjunction over the universally quantified levels. Reuses the outer gates' flag, which is dead once the verdict checkpoint has dispatched on it – nothing inside the VAL loop reads it again.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Distinctness #
The roles are disjoint families of the same inductive, so telling them apart is a matter of constructors – except inside a family, where it is the index. These are the facts an update needs: writing one slot leaves the others alone.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Reading and writing one slot #
A control slot, read as a bit.
Instances For
Dependency graph
A control slot, written: the pointer with one slot set to a bit.
Equations
- dt.setCtl zero one q b f = Function.update f q (DescriptiveComplexity.Draw.bitVal zero one b)
Instances For
Dependency graph
Dependency graph
Dependency graph
A write leaves the other slots' values alone, not only their bits.
Dependency graph
The tuple enumeration #
An element loop runs over the tuples of source elements in the
lexicographic order, one coordinatewise successor per round
(DescriptiveComplexity.TupSucc, which
DescriptiveComplexity.Draw.reflTransGen_of_tupLoop indexes its rounds by).
The loop's three semantic parameters are the functions behind that
relation: where it starts, what it advances to, and when it is done.
The tuple is exhausted: every coordinate is maximal, i.e., it is the lexicographic top.
Equations
- DescriptiveComplexity.Draw.IsMaxTup t = ∀ (p : Fin D) (a : A), a ≤ t p
Instances For
Dependency graph
A non-exhausted tuple has a successor.
Dependency graph
The next tuple, the lexicographic successor – itself at the top, where no round follows.
Equations
- DescriptiveComplexity.Draw.tupNext t = if h : ∃ (w : Fin D → A), DescriptiveComplexity.TupSucc t w then h.choose else t
Instances For
Dependency graph
Below the top, the next tuple is a successor.
Dependency graph
The coordinate a round carries #
A fold's update rule needs to know which coordinate rolled over, and the
loop's control does: it is the greatest non-maximal coordinate of the tuple,
which is the witness of DescriptiveComplexity.TupSucc – unique, so the
machine's dstSt may name it.
The body of DescriptiveComplexity.TupSucc at a named coordinate.
Equations
Instances For
Dependency graph
The carried coordinate is unique: above it every coordinate is already maximal, and it is not.
Dependency graph
The coordinate a round carries, read off the tuple – as a level index, so that a fold's rules may use it directly; at the top, where no round follows, it is past the last coordinate.
Equations
- DescriptiveComplexity.Draw.tupCarry t = if h : ∃ (p : Fin D), DescriptiveComplexity.Draw.TupSuccAt p t (DescriptiveComplexity.Draw.tupNext t) then ↑h.choose else D
Instances For
Dependency graph
What the carried coordinate is: the witness of the tuple's step, which is unique.
Dependency graph
Below the top the carried coordinate is a level, and the round steps there.
Dependency graph
The first tuple: every coordinate the least element.
Equations
Instances For
Dependency graph
Dependency graph
The loop element, read and written #
Two widths, one family of slots: an element loop of an expansion atom or a
domain gate enumerates the whole prefix of its defining sentence – up to
eDim coordinates – while a coordinate loop (a block copy, a comparison)
enumerates the dd₀ coordinates a cell's name carries. The first dd₀ slots
of the wide tuple are the narrow one (lvC_eq_lvE), so a leaf read of a wide
loop names its cell from the coordinates it computes and a leaf read of a
narrow one from the slots directly.
The loop element's coordinates, read out of the control.
Instances For
Dependency graph
The loop element's coordinates, written: the pointer with the loop-variable slots set to a tuple.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
A loop variable of an element loop, at the full width.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
The wide loop element, read out of the control.
Instances For
Dependency graph
The wide loop element, written.
Instances For
Dependency graph
Dependency graph
Dependency graph
The accumulators, the verdicts and the flags ride along a write of the wide loop element.
Dependency graph
Dependency graph
The loop's three operations #
DescriptiveComplexity.Draw.tupNext and friends, in the slots: where a loop
starts, what it advances to, and when it is done – the initEl/advEl/
IsMaxEl of every element loop, at either width.
The wide loop, started.
Equations
- dt.initLvE f = dt.putLvE f DescriptiveComplexity.Draw.botTup
Instances For
Dependency graph
The wide loop, advanced.
Equations
- dt.advLvE f = dt.putLvE f (DescriptiveComplexity.Draw.tupNext (dt.readLvE f))
Instances For
Dependency graph
The wide loop, exhausted.
Equations
- dt.IsMaxLvE f = DescriptiveComplexity.Draw.IsMaxTup (dt.readLvE f)
Instances For
Dependency graph
The narrow loop, started.
Equations
- dt.initLvN f = dt.putLv f DescriptiveComplexity.Draw.botTup
Instances For
Dependency graph
The narrow loop, advanced.
Equations
- dt.advLvN f = dt.putLv f (DescriptiveComplexity.Draw.tupNext (dt.readLv f))
Instances For
Dependency graph
The narrow loop, exhausted.
Equations
- dt.IsMaxLvN f = DescriptiveComplexity.Draw.IsMaxTup (dt.readLv f)