The product of a typed sampler and a directly answered one: the program #
The program half of MIPRE/Foundations/CL/ProductSampler. A DirectSampler is a family of
typed presentations whose queries a total polynomial-time function answers outright, for every
level, from parameters a routine computes at the index: the downsized PCP sampler of answer
reduction is one. The product
TypedSampler.prodDirect A B L of a typed sampler A and a direct sampler B has the types
Ta × Tb, the presentations prodCL L (A.cl n w ta) (B.cl n tb) and a program making at most
one call, through the universal machine, to A's, after a call to B's parameter routine:
- the dimension query is forwarded to
A, andB's dimension added; - a typed query is split: the last
B.dim nbits of its vectors go toB's answer function, the others make upA's query, whose answer the post-processor prepends; - beyond
A's levelℓa(it is padded toL), the marginal is asked at levelℓa, and a linear map or factor query is answered directly,A's half zero.
The program is hardcode core (encode (A.prog, ℓa, B.parProg)) for a core depending only on
B's two functions: that is what makes a sampler built this way depend only on its input sampler's
program and its parameters.
The input of a direct answer: (p, type, kind, j, u, y), with p the parameters at the
index and the query's kind, level and vectors as in Sampler.Query.toTuple.
Equations
Instances For
A directly answered typed sampler, the same for both players: a routine computes its
parameters pd n at the index n, and a polynomial-time function of the parameters answers its
queries, at every level.
- parProg : Cost.Prog
The parameter routine.
- parProg_closed : Cost.Prog.WellScoped 1 self.parProg
The parameters at each index.
The dimension.
The typed CL functions.
- dimProg : Cost.PolyTimeFun Cost.Data Cost.Unary
The dimension, in unary, from the parameters.
- answer : Cost.PolyTimeFun DirectInput Cost.BitStr
The answers.
- answer_linear (n : ℕ) (t : T) (j : ℕ) (u y : Cost.BitStr) : 1 ≤ j → (∃ (x : Fin (self.dim n) → 𝔽₂), u = toBits ((CLFun.truncate (j - 1) (self.cl n t)).eval x)) → List.length y = self.dim n → self.answer.toFun (self.pd n, Cost.encode t, 2, j, u, y) = toBits (((self.cl n t).mapOfPrefix (j - 1) (ofBits (self.dim n) u)) (ofBits (self.dim n) y))
Instances For
The parameter stage #
The input is (H, n, q) with H = (A.prog, ℓa, B.parProg) hardcoded. The first stage calls
the parameter routine on n and prepends its answer.
Call the parameter routine on the index, keeping the input.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prepend the parameters.
Equations
Instances For
The core #
Its input is (p, H, n, q), p the parameters.
The parameters.
Instances For
A's program.
Equations
Instances For
A's level.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The index.
Equations
Instances For
The typed query, nil for the dimension query.
Equations
Instances For
The type pair.
Equations
Instances For
The untyped query.
Equations
Instances For
The untyped query, parsed: (n, kind, w, j, u, y).
Equations
Instances For
B's dimension.
Equations
Instances For
The kind of the query.
Equations
Instances For
Its level.
Equations
Instances For
Its first vector.
Equations
Instances For
Its second vector.
Equations
Instances For
All but the last B.dim n bits: A's half.
Equations
Instances For
The last B.dim n bits: B's half.
Equations
Instances For
B's half of the answer.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A's query at the level j: (n, (ta, (kind, w, j, u_A, y_A))).
Equations
- One or more equations did not get rendered due to their size.
Instances For
A call to A on its typed query at the level j; the context is B's half.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The call for the dimension; the context is B's dimension.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The marginal's level for A, at most ℓa.
Equations
Instances For
The direct answer beyond A's level: zero on A's half.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The router.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The post-processor: A's bits then B's, or the sum of the dimensions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The routed stage of the core.
Equations
Instances For
The parameter stage of the core.
Equations
Instances For
The core of the product sampler: the parameters, then the routed call.
Equations
Instances For
The product sampler's program: the core with (A.prog, ℓa, parProg) hardcoded.
Equations
- MIPRE.CL.ProductSampler.prog B D ap ℓa pp = MIPRE.Cost.hardcode (MIPRE.CL.ProductSampler.core B D) (MIPRE.Cost.encode (ap, ℓa, pp))
Instances For
The router on well-formed queries #
The input of the routed stage on a typed query.
Equations
- MIPRE.CL.ProductSampler.input ap ℓa pp pdn n q = pdn.cons ((MIPRE.Cost.encode (ap, ℓa, pp)).cons (MIPRE.Cost.encode (n, q)))
Instances For
Every call the router makes keeps the index.
The parameter stage prepends the routine's answer.
The product sampler #
The product of a typed sampler and a direct sampler: the types are pairs, the
presentations prodCL, and the program calls A's at most once.
Equations
- One or more equations did not get rendered due to their size.