The block loop of the repeated sampler #
The repeated sampler of thm:parallel-repetition answers a marginal, linear or factor query
on ๐ฝโ^{k s} by cutting the vectors of the query into k blocks of s coordinates, asking
the input sampler about each block, and concatenating the answers
(planning/repetition-verifier.md, R3(b)). This module is that loop:
pairTakeProgcuts the firstselements off two lists at once;mapBodyis the body of the loop, on the state(s, remU, remY, ctx, acc): stop withacconceremUis exhausted, and otherwise cut a block offremUandremY, build the query(n, kind, w, j, blockU, blockY)from the contextctx = (Sฬ, n, kind, w, j), run the input samplerSฬon it through the universal machineuniv, and push the answer, reversed, ontoacc;mapLoop_runsis the loop: its output is the reversed concatenation of the answers on the pairs of blocksData.chunkPairs, in time(|remU| + 1)times a quadratic in a boundZon the sizes in play and the costTuof one call.
The loop is uniform in the query kind: the blocks of an absent vector are empty, which is the
encoding of the empty bit string, so a marginal or factor query โ whose last component is
empty โ goes through the same code as a linear one. The answers are a parameter f of the
run lemma, known only on the pairs of blocks that occur: on well-formed queries they are the
input sampler's answers, on arbitrary ones whatever it halts with.
Cutting a block off two lists #
On cons us (cons remU remY) with us the unary numeral s: the pair of remainders and
the pair of blocks, cons remU' (cons remY' (cons blockU blockY)).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The loop body #
The context of the loop: the input sampler Sฬ and the fixed part (n, kind, w, j) of the
query.
Instances For
The state of the loop.
Equations
- MIPRE.Cost.Prog.mapState s remU remY ctx acc = (MIPRE.Cost.Data.ofNat s).cons ((MIPRE.Cost.Data.list remU).cons ((MIPRE.Cost.Data.list remY).cons (ctx.cons (MIPRE.Cost.Data.list acc))))
Instances For
The body of the block loop, with univ the universal machine.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The cost of one iteration, in the numeral s, the sizes U, Y of the remainders, C of
the context, A of the accumulator, and the cost Tu of the call.
Equations
Instances For
One iteration: the block is cut, the call made, its answer pushed reversed onto acc.
The output of the loop from the pairs of blocks: the answers, each reversed, in reverse
order, in front of acc.
Equations
- MIPRE.Cost.Prog.mapAcc f pairs acc = (List.map (fun (p : List MIPRE.Cost.Data ร List MIPRE.Cost.Data) => (f p.1 p.2).toList.reverse) pairs).reverse.flatten ++ acc
Instances For
The per-iteration budget of the loop, in a bound Z on the sizes in play.
Equations
- MIPRE.Cost.Prog.mapIter Z = 22 * (Z + 30) ^ 2
Instances For
The block loop. With f the answer of the universal machine on each pair of blocks
that occurs, at cost at most Tu, and Z a bound on the sizes in play, the loop from
(s, remU, remY, ctx, acc) outputs mapAcc f (chunkPairs s remU remY) acc in time
(|remU| + 1) ยท mapIter Z.