Composite kits: how the program instantiates its subroutines #
The composites of the layer take their phases and rule families as parameters (“no continuation labels”: a program's phase set is its list of call sites). The program therefore assembles as a sum of kits, one per composite shape:
- a phase shape – a small inductive, one constructor per phase the composite
visits (
DescriptiveComplexity.Draw.ReadPh); - a rule shape – one constructor per rule family, each with its concrete
guard (
DescriptiveComplexity.Draw.ReadRule); - the rules function – the shape's
DescriptiveComplexity.Draw.Rules, at a phase embedding and the kit's slots (DescriptiveComplexity.Draw.ReadKit.rule); - a discharge – any program whose rule set contains the kit's rules
satisfies the composite's rule hypotheses, so the composite's run theorem
holds for it (
DescriptiveComplexity.Draw.ReadKit.reaches_pos/_neg); - an in-shape separation lemma – two of the kit's rules firing in the same
phase on the same data are the same rule
(
DescriptiveComplexity.Draw.ReadKit.sep).
Global determinism then reduces to: each kit separates in-shape, the phase
embeddings are injective, and distinct kits use disjoint phases – the source
phase of a rule names its kit, so DescriptiveComplexity.Draw.Prog.sep_of's
hypothesis never crosses kits.
This file builds the smallest kit with full content – the named-bit read of
DescriptiveComplexity.Problems.Wide.DrawRead – as the template the others
follow.
Summing kits: separation of a program assembled from sites #
Separation of a program assembled from kits: when the rule names are a
sigma of per-site shapes, every rule's source phase is owned by its site, and
each site separates in-shape, the whole program separates. This is the form
DescriptiveComplexity.Draw.Prog.sep_of receives from an assembly: the
cross-site case is settled by ownership, the in-site case by the kits'
sep lemmas – which is why a kit's exit rules, fired from another kit's end
phases, must be grouped under the site owning those phases, not the site
they serve.
Dependency graph
The read trip's shapes #
The phases of a read trip: at the marker, scanning up, and the two verdict returns.
- start : ReadPh
At the working-cell marker, about to leave.
- up : ReadPh
Scanning up to the named cell.
- ry : ReadPh
The bit was set: returning.
- rn : ReadPh
The bit was clear: returning.
Instances For
Dependency graph
Dependency graph
Dependency graph
The rule families of a read trip, one constructor each.
- turn : ReadRule
Leave the marker rightwards.
- up : ReadRule
Scan right while the name does not match.
- rd1 : ReadRule
At the named cell with the bit set: branch positive, step left.
- rd0 : ReadRule
At the named cell with the bit clear: branch negative, step left.
- backY : ReadRule
Return leftwards in the positive phase.
- backN : ReadRule
Return leftwards in the negative phase.
- stayS : ReadRule
Walk left back to the marker before leaving it: what lets a dispatch enter the trip by stepping right off the marker.
Instances For
Dependency graph
Dependency graph
Dependency graph
The kit #
A read-trip kit: the two slots it reads, the name guard, and where its phases sit in the program.
- t : W
The walked track being read.
- wk : W
The working-cell marker slot.
- Match : (Q → A) → (W → A) → Prop
The name guard: this cell is the one the control names.
- emb : ReadPh → P
The kit's phases in the program.
Instances For
Dependency graph
The kit's rules. Every attribute is a function of the constructor, and every guard is decided by the slots the shape reads.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
In-shape separation: two of the kit's rules firing in the same phase on the same data are the same rule. The phase splits the families into four groups, and within a group the guards are mutually exclusive.
Dependency graph
A trip stays inside its own phases: every rule of the kit lands in one
of the four the kit was given, so a caller that knows a property of those
knows it of every phase the trip can be in. This is what a determinism-after-
the-guess argument needs of a sub-machinery
(DescriptiveComplexity.Draw.Data.nexProg_uniqueFrom).
Dependency graph
Exit disjointness at the kit's two verdict phases: no kit rule fires there on a symbol with the marker set.
Dependency graph
The discharge #
The kit reads a set bit: the composite's run theorem, with every rule hypothesis discharged from the kit's rules.
Dependency graph
The kit reads a set bit, the budget forgotten.
Dependency graph
The kit reads a clear bit.
Dependency graph
The kit reads a clear bit, the budget forgotten.
Dependency graph
The write trip's shapes #
The same trip writing the digit: the kit carries the written bit as a function of the control payload, so one shape serves constant writes and writes of a previously computed bit alike.
The phases of a write trip.
- start : WritePh
At the working-cell marker, about to leave.
- up : WritePh
Scanning up to the named cell.
- back : WritePh
Written: returning.
Instances For
Dependency graph
Dependency graph
Dependency graph
The rule families of a write trip.
- turn : WriteRule
Leave the marker rightwards.
- up : WriteRule
Scan right while the name does not match.
- put : WriteRule
At the named cell: write the bit, step left.
- back : WriteRule
Return leftwards.
- stayS : WriteRule
Walk left back to the marker before leaving it.
Instances For
Dependency graph
Dependency graph
Dependency graph
A write-trip kit: the slots, the name guard, the written bit as a function of the payload, and the phases.
- t : W
The walked track being written.
- wk : W
The working-cell marker slot.
- Match : (Q → A) → (W → A) → Prop
The name guard.
- bVal : (Q → A) → Prop
The written bit, as a function of the payload.
- emb : WritePh → P
The kit's phases in the program.
Instances For
Dependency graph
The kit's rules.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
A write trip stays inside its own phases: every rule of the kit lands
in one of the phases the kit was given, which is what a
determinism-after-the-guess argument needs of a sub-machinery
(DescriptiveComplexity.Draw.Data.nexProg_uniqueFrom).
Dependency graph
In-shape separation.
Dependency graph
Exit disjointness at the kit's return phase: no kit rule fires there on a symbol with the marker set.
Dependency graph
The kit writes its bit at the named cell and returns to the marker.
Dependency graph
The kit writes a named bit, the budget forgotten.