The chain combinator: checkpoints around abstract stages #
The outer program, the evaluation's spine and one variable's machinery all repeat one pattern: checkpoints – a phase whose stay rule walks left to the working-cell marker and whose dispatch rules fire there – between stages that are kit instances or further abstract blocks. The remaining machinery (the gates, the per-atom subroutines, the tuple and element loops) is more of the same, so this file is the pattern as a combinator, built once:
DescriptiveComplexity.Draw.PreRule– a rule without its source phase, what a dispatch descriptor is;DescriptiveComplexity.Draw.ChainPh/ChainSite/ChainSh–ncheckpoints (each carrying the three-rule gadget ofDescriptiveComplexity.Draw.EvalChkRule) plus an abstract stage family;DescriptiveComplexity.Draw.chainRule– the rules, the dispatches given as descriptors per checkpoint (Fin n → Bool → PreRule): a descriptor's target may be any phase, so loops – a tuple loop's back edge – cost nothing;DescriptiveComplexity.Draw.chainSep/chainHosrc– separation and ownership, from two per-checkpoint hypotheses: every dispatch fires only at the marker, and the two dispatches of a checkpoint never fire together.
A machinery block is then a stage family (its kits, with their sep and
exit_disjoint) plus a descriptor list, and nothing else.
Rules without their source phase #
A rule without its source phase: what a chain's dispatch descriptor is – the checkpoint it belongs to supplies the source.
- guard : (Q → A) → (W → A) → Prop
When the rule applies.
- dstPh : P
The phase the rule moves to.
- dstSt : (Q → A) → (W → A) → Q → A
The pointer the rule leaves in the control.
- wr : (Q → A) → (W → A) → W → A
The tracks the rule writes.
- moveRight : Prop
Whether the rule moves the head right.
Instances For
Dependency graph
A descriptor, at a source phase.
Equations
Instances For
Dependency graph
The chain's shapes #
The phases of a chain: n checkpoints, and the stages'.
- chk
{n : ℕ}
{PS : Type}
: Fin n → ChainPh n PS
A checkpoint.
- sub
{n : ℕ}
{PS : Type}
: PS → ChainPh n PS
A stage phase.
Instances For
Dependency graph
Dependency graph
The sites of a chain.
- chk
{n : ℕ}
{SS : Type}
: Fin n → ChainSite n SS
A checkpoint site.
- sub
{n : ℕ}
{SS : Type}
: SS → ChainSite n SS
A stage site.
Instances For
Dependency graph
The rule shape of each chain site: checkpoints carry the three-rule gadget, stages their own shapes.
Equations
Instances For
Dependency graph
The rules #
The rules of a chain: per checkpoint the walk back to the marker and its two dispatch descriptors; the stages' rules are the parameter.
Equations
- One or more equations did not get rendered due to their size.
- DescriptiveComplexity.Draw.chainRule one wk emb ruleS dsp (DescriptiveComplexity.Draw.ChainSite.sub s) ρ = ruleS s ρ
Instances For
Dependency graph
A property of a chain's phases and its dispatches' destinations holds of
every phase it can move to: the checkpoints stay where they are, the
dispatches go where their descriptors say, and the stages are the parameter.
This is what a determinism-after-the-guess argument asks of a sequenced
machinery (DescriptiveComplexity.Draw.Data.nexProg_uniqueFrom).
Dependency graph
A chain separates in-shape: the stay's guard is disjoint from the dispatches' – they only fire at the marker – and the two dispatches of a checkpoint never fire together; the stages' separation is the parameter.
Dependency graph
Every chain rule fires from a phase its site owns; the stages' obligation is the parameter.