Documentation

MIPRE.Foundations.Pipeline.UnaryArith

Unary arithmetic by loops #

The routines the pipeline's parameter computations need, whose running time is polynomial in the value of their input rather than its size: writing a binary number in unary (toUnaryProg) and raising a unary number to a binary power (powProg). Both are whileProg loops (MIPRE/Foundations/Cost/While) of polynomial-time steps.

Binary to unary #

One step of the conversion, on (x, acc): stop with acc at x = 0, else move one unit.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Binary to unary: encode x ↦ encode (unary x).

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Powers #

      One step of the power, on (e, acc, b): stop with acc at e = 0, else multiply by b.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        The power: encode (b, e) ↦ encode (unary (|b|^e)).

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Stages #

          A stage of a routine: split the input into an argument and a context, run p on the argument, and combine the context with its answer.

          Equations
          Instances For
            theorem MIPRE.Pipeline.stageProg_runs (pre : Cost.PolyTimeFun Cost.Data Cost.Data) {p : Cost.Prog} (hp : Cost.Prog.WellScoped 1 p) (post : Cost.PolyTimeFun (Cost.Data × Cost.Data) Cost.Data) (X a ctx r : Cost.Data) (t : ℕ) (hpre : pre.toFun X = a.cons ctx) (hr : p.Runs a r t) :
            ∃ (t' : ℕ), (stageProg pre p post).Runs X (post.toFun (ctx, r)) t'