Programs in stages, and a loop of calls to a stored program #
The programs of the repeated tailored verifier (Phase 2 of planning/aldous-lyons-track.md,
issue #280) are built in stages: polynomial-time functions, which prepare the next stage's input
while carrying what later stages need, alternate with calls to the input programs through the
universal machine. This module is the glue.
seq p qrunsqon the result ofp(seq_runs, and its inversionseq_inv).withCtx prunspon the second component of a pair and keeps the first: the context a later stage needs passes over a stage that does not.mapCall univ, on(c, [q₁, …, q_m]), runsunivon(c, qᵢ)for everyiand returns the list of results. Withunivthe universal machine andca program's description, it runs the program on every query. It halts with[r₁, …, r_m]when every call halts withrᵢ, at the cost of the calls plus a quadratic overhead (mapCall_runs), and only then (mapCall_inv), which is what lets a halting repeated program say that every coordinate's program halted.
Sequencing #
A polynomial-time stage followed by q: a run of q on the stage's value is a run of the
sequence.
Inversion of a polynomial-time stage followed by q.
Keeping a context #
On cons a b, the pair cons a (p b).
Equations
Instances For
The loop of calls #
The body of the loop, on the state cons c (cons rem acc): stop with acc when rem is
empty; otherwise run univ on cons c q for the head q of rem, push the result onto acc
and continue with the tail.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The loop of calls: on cons c (list qs), the list of the results of univ on
cons c q, q ∈ qs, in order.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The state of the loop.
Equations
- MIPRE.Tailored.Calls.mapState c rem acc = c.cons ((MIPRE.Cost.Data.list rem).cons (MIPRE.Cost.Data.list acc))
Instances For
Inversion of the body: on an empty rem it stops with acc; otherwise it ran univ on the
head and continues.
The loop with the results known: from the state (c, rem, acc), the loop stops with the
results on rem, reversed, before acc.
Inversion of the loop: a halting loop ran every call.
The loop of calls with the results known.
Inversion of the loop of calls: a halting run ran univ on every query, and returned
the results in order.
Runs within a bound #
p runs on x to r within cost T.
Equations
- MIPRE.Tailored.Calls.RunsLe p x r T = ∃ t ≤ T, p.Runs x r t