Kits for the round trips: the file test #
The kit wrapping the file-test round trip, by the template of
DescriptiveComplexity.Problems.Wide.DrawKit: a phase inductive, a rule
inductive with concrete guards, the rules function at a phase embedding, an
in-shape separation lemma, and a discharge – any program whose rule set
contains the kit's rules satisfies the composite's run theorem
(DescriptiveComplexity.Draw.TestKit.reaches_pos/_neg: scan up to the file
top, bounce, one question per register on the way down, verdict in the phase,
return to the marker).
The verdict phases double as return phases, which is where the cell-coupled
forms of the layer earn their keep: the walking rule of the passing phase is
guarded rg ≠ one ∧ wk ≠ one, disjoint from the register rules, and the
coupled hypotheses of DescriptiveComplexity.Draw.Prog.reaches_fileRoundTrip are
exactly what shows it fires wherever the composite needs it. The failing
phase hosts no register rule, so its single rule takes the disjunction
rg = one ∨ wk ≠ one and serves hold, walk and return at once.
Rules are owned by their source phase: how a program enters the kit (at the
scan phase, off the marker) and how it leaves the two verdict phases (at
the marker, guarded wk = one ∧ rg ≠ one, disjoint from every rule here) is
the caller's business.
The file test's shapes #
The phases of a test trip: the up-scan, the bounce, and the two verdict phases – the passing one doubling as the descent phase of the pass.
- up : TestPh
Scanning up to the file top.
- b2 : TestPh
Bounced off the top, about to re-enter rightwards.
- ty : TestPh
Every register so far passed (also: returning with verdict yes).
- tn : TestPh
Some register failed (also: returning with verdict no).
Instances For
Dependency graph
Dependency graph
Dependency graph
The rule families of a test trip, one constructor each.
- up : TestRule
Scan right while the file-top mark is clear.
- b1 : TestRule
At the file top: step left into the bounce phase.
- b2go : TestRule
Bounce: step back right into the pass.
- pass : TestRule
At a register that passes the question: carry on down.
- fail : TestRule
At a register that fails it: switch to the failing phase.
- walkY : TestRule
Walk left over unmarked cells, and return, in the passing phase.
- stayN : TestRule
Hold at registers, walk and return, in the failing phase.
Instances For
Dependency graph
Dependency graph
Dependency graph
A file-test kit: the walked track, the three service slots, the per-register question as a predicate of the tracks, and where its phases sit in the program.
- t : W
The walked track being questioned.
- rg : W
The register mark.
- rl : W
The file-top mark.
- wk : W
The working-cell marker slot.
- TestG : (W → A) → Prop
The per-register question, decided by the tracks.
- emb : TestPh → 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
In-shape separation: two of the kit's rules firing in the same phase on the same data are the same rule.
Dependency graph
Exit disjointness: at the kit's two verdict phases – where a caller's
exit rule, guarded wk = one ∧ rg ≠ one, lives – no kit rule fires on a
symbol satisfying that guard.
Dependency graph
The trip stays inside its own phases: every rule lands in one the kit was given, which is what a caller that must know a property of the phases the machine can be in reads off a sub-machinery.
Dependency graph
The discharge #
The kit runs a passing file test: from the scan phase anywhere, up to the file top, down the file – every register passing – and back to the marker in the passing phase.
Dependency graph
The kit runs a passing file test, the budget forgotten.
Dependency graph
The kit runs a failing file test: some register fails, and the trip ends at the marker in the failing phase.
Dependency graph
The kit runs a failing file test, the budget forgotten.
Dependency graph
The clear and copy trips #
The same itinerary with a writing pass in the middle: one phase runs the
descent and the return alike, its register rule rewriting the walked digit
and its walking rule – guarded rg ≠ one ∧ wk ≠ one – serving the gaps of
the file and the way home.
The phases of a write-pass trip: the up-scan, the bounce, and the one pass-and-return phase.
- up : TrackPh
Scanning up to the file top.
- b2 : TrackPh
Bounced off the top, about to re-enter rightwards.
- run : TrackPh
Running the pass down the file, and returning.
Instances For
Dependency graph
Dependency graph
Dependency graph
The rule families of a write-pass trip.
- up : TrackRule
Scan right while the file-top mark is clear.
- b1 : TrackRule
At the file top: step left into the bounce phase.
- b2go : TrackRule
Bounce: step back right into the pass.
- put : TrackRule
At a register: rewrite the walked digit and carry on down.
- walk : TrackRule
Walk left over unmarked cells, and return.
Instances For
Dependency graph
Dependency graph
Dependency graph
A track-clearing kit: the walked track, the three service slots, and the phases.
- t : W
The walked track being cleared.
- rg : W
The register mark.
- rl : W
The file-top mark.
- wk : W
The working-cell marker slot.
- emb : TrackPh → 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
The trip stays inside its own phases: every rule lands in one the kit was given, which is what a caller that must know a property of the phases the machine can be in reads off a sub-machinery.
Dependency graph
In-shape separation.
Dependency graph
Exit disjointness at the kit's pass-and-return phase.
Dependency graph
The kit clears its track: from the scan phase anywhere, up to the file top, one pass writing the clear digit at every register, and back to the marker.
Dependency graph
The kit clears a track, the budget forgotten.
Dependency graph
A track-copying kit: the walked track, the source slot – which must hold a bit at every register – the three service slots, and the phases.
- t : W
The walked track being overwritten.
- src : W
The source slot whose digit is copied.
- rg : W
The register mark.
- rl : W
The file-top mark.
- wk : W
The working-cell marker slot.
- emb : TrackPh → 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
The trip stays inside its own phases: every rule lands in one the kit was given, which is what a caller that must know a property of the phases the machine can be in reads off a sub-machinery.
Dependency graph
In-shape separation.
Dependency graph
Exit disjointness at the kit's pass-and-return phase.
Dependency graph
The kit copies the source slot into its track: from the scan phase anywhere, up to the file top, one pass replacing every register's walked digit by its source digit, and back to the marker.
Dependency graph
The kit copies a track, the budget forgotten.
Dependency graph
A track-mapping kit: the walked track is rewritten by a bit the other tracks at each register decide – the pattern writes of the program, a target register loaded from the marks. The function ignoring the walked slot is the discharge's frame hypothesis.
- t : W
The walked track being overwritten.
- rg : W
The register mark.
- rl : W
The file-top mark.
- wk : W
The working-cell marker slot.
- Fb : (W → A) → Prop
The written bit, computed from the tracks.
- emb : TrackPh → 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
The trip stays inside its own phases: every rule lands in one the kit was given, which is what a caller that must know a property of the phases the machine can be in reads off a sub-machinery.
Dependency graph
In-shape separation.
Dependency graph
Exit disjointness at the kit's pass-and-return phase.
Dependency graph
The kit rewrites its track by the function: from the scan phase anywhere, up to the file top, one pass writing the computed bit at every register, and back to the marker.
Dependency graph
The kit rewrites a track, the budget forgotten.