A program's tape is a function of the address #
DescriptiveComplexity.TMData takes the tape to be a function on the whole
universe of the machine, WPoint A → WPoint A. A program's tape is never that
general: the control points are not cells, so they keep the blank they started
with for ever, and every real cell holds a symbol – an element of the instance.
So a program's tape is a function
f : (A → Prop) → A, a symbol for each address,
and DescriptiveComplexity.wideTape is the machine's tape it presents. Working
in that form is worth a file of its own because it removes the same three
obligations from every step of every phase:
| obligation | in the general form | here |
|---|---|---|
| the symbol under the head | tp (Sum.inl s) = Sum.inr a | f s, no equation |
| the frame condition | ∀ p : WPoint A, p ≠ Sum.inl s → … | ∀ r, r ≠ s → f' r = f r |
| the control points | a case of every proof | discharged once |
DescriptiveComplexity.step_wideTape_right and its leftward twin are the step
in that form, DescriptiveComplexity.reaches_scan_tape and
DescriptiveComplexity.reaches_scanBack_tape are the scans, and
DescriptiveComplexity.isInit_wideTape is the initial configuration of a program
that has marked its register file
(DescriptiveComplexity.Problems.Wide.Marks).
Note what is not here: Function.update. An address is a set, so equality of
addresses is not decidable, and a program's tapes come from formulas anyway. A
write is described by naming the new tape function and saying where it agrees
with the old one, which is what hagree is in every statement below.
The tape of a program #
The tape a symbol assignment presents: the symbol of each address, and the blank on the control points, which are not cells and are never written.
Equations
- DescriptiveComplexity.wideTape f b (Sum.inl s) = Sum.inr (f s)
- DescriptiveComplexity.wideTape f b (Sum.inr val) = Sum.inr b
Instances For
Dependency graph
Dependency graph
Dependency graph
The frame condition, in the program's form: two symbol assignments agreeing off one address present tapes agreeing off that cell. The control points are where the general statement needs a case and this one does not.
Dependency graph
One step #
A right-moving step of a program. The head is on s, the transition τ
applies to the state and to the symbol f s written there, and the new
assignment f' differs from f at s only.
Dependency graph
A left-moving step of a program, the head stepping down to the address whose increment it is on.
Dependency graph
The scans #
A program scans right to the first cell that stops it. The scanning transition is asked for at the symbol the assignment gives, so no symbol is quantified: a caller supplies one transition per symbol it does not stop at.
Dependency graph
A program scans right to the first cell that stops it, the budget forgotten.
Dependency graph
A program scans left to the first cell that stops it, the same reading downwards.
Dependency graph
A program scans left to the first cell that stops it, the budget forgotten.
Dependency graph
Writing a track across the tape #
The phase a program spends laying something out: sweep up, writing one symbol per
address as it goes. The tape it holds part-way through is written below the head
and untouched at and above it, which is the address-scale twin of
DescriptiveComplexity.Problems.Wide.Mirror's mirror during a register walk.
The new symbols are a parameter, so the same statement serves a deterministic layout phase – build the register file, plant a marker – and a guessing one: if the transition offered at each cell may write either of two symbols, the run below exists for every choice, and the choice is the certificate.
A family in mid-installation: the new value at the addresses the head has passed, the old one where it stands and above. The value type is arbitrary – a sweep installs symbols this way, and a program installs whole backgrounds.
Equations
- DescriptiveComplexity.midTape f₀ f₁ s r = if DescriptiveComplexity.WMSetLt DescriptiveComplexity.WMLe r s then f₁ r else f₀ r
Instances For
Dependency graph
The cell the head stands on still holds its old symbol.
Dependency graph
One increment later, the cell holds its new symbol.
Dependency graph
A step of the sweep changes one cell: off the cell the head is on, the tape before and after the write agree.
Dependency graph
A writing sweep carrying a state. At every cell of a stretch the machine
writes the new symbol and moves right, and its state advances with the head: at
the cell r it is st r, and the step to r's successor leaves it in that
successor's state. It arrives at the top of the stretch with the tape rewritten
below it and untouched above.
A state that varies is what lets a sweep write something different in every cell: a rule computes its symbol from what it reads and from the state, and the tape it reads is blank everywhere, so a phase laying down a pattern has to hold the pattern's index in the state. That is how a program builds its own register file – the state holds the element whose register the head is on, and the order successor moves it along.
Dependency graph
A writing sweep. The previous statement in a fixed state.
The new assignment f₁ is universally quantified, so a guessing phase is this
statement read at the guess: whatever the certificate, the run that writes it
exists.
Dependency graph
The two ends of a run #
The initial configuration of a program: a start state, the head on the
empty address, and the tape whose symbol at the cell of x is the name of x
and whose symbol everywhere else is the blank.
Dependency graph
A program accepts: it starts as DescriptiveComplexity.isInit_wideTape
says, roams, and ends in an accepting state. This is the whole of
DescriptiveComplexity.WideAcceptSpace for a program with a register file.
Dependency graph
A program on a clock accepts: the same run with its budget kept and compared once with the number of addresses.
Dependency graph
A program with a register file accepts on its clock, the budget compared
against 2 ^ n.