Native certificates with explicit polynomial degrees #
NativeCertificate.IsPolynomial says that a certificate's time and space bounds are polynomial in
the encoded input length, without naming a degree. NativeCertificate.HasDegree c d names it: the
time and space bounds are at most a constant times (n + 1) ^ d on encoded inputs of length n,
and the encoded output has linear length. Linear output is what keeps the degree from growing under
composition: a degree-d bound evaluated at a linearly long intermediate value is again of degree
d. This is the discipline of Turing.MultiTapeTM.ComputableInDegree with output degree one,
applied to the input-dependent bounds that certificates carry.
Every certificate combinator preserves HasDegree, so a simulation assembled from them inherits an
explicit degree from its primitives. Model.NativePrimitives.HasDegree asks the same of all
primitive certificates of a RAM model.
Main definitions #
Cslib.GenericRAM.NativeCertificate.HasDegree: time and space bounds of degreed, encoded output of linear length.Cslib.GenericRAM.NativeCertificate.ofDegree: the certificate of a degree-dcomputation with linear output.Cslib.GenericRAM.Model.NativePrimitives.HasDegree: every primitive certificate has degreed.
Main results #
Cslib.GenericRAM.NativeCertificate.HasDegree.isPolynomial: a degree bound is polynomial.Cslib.GenericRAM.NativeCertificate.comp_hasDegree,.prod_hasDegree,.branch_hasDegree,.option_hasDegreeand the other*_hasDegreelemmas: the combinators preserve the degree.
Time and space bounds of degree d, and encoded output of linear length, in the encoded input
length.
The time bound has degree
d.The space bound has degree
d.- length : Turing.MultiTapeTM.DegreeBounded (fun (a : α) => (ei a).length) (fun (a : α) => (em (f a)).length) 1
The encoded output has linear length.
Transfer a degree to a certificate with the same bounds for a pointwise equal function. This sees through certificates defined by case analysis, whose casts block unification.
A degree-d bound evaluated at an intermediate value of linear length has degree d.
A linear-time, linear-space computation has encoded output of linear length.
A certificate with linear space has encoded output of linear length.
A certificate whose time has degree d ≥ 1 and whose space is linear has degree d.
The certificate of a computation in time and space degree d with linear output.
The combinators preserve the degree #
Every primitive certificate of the bundle has degree d.
Every literal symbol's certificate has degree
d.Every operation symbol's certificate has degree
d.Every test symbol's certificate has degree
d.The address extraction certificate has degree
d.The move validation certificate has degree
d.The control-label validation certificate has degree
d.
Raising the degree of a primitive bundle keeps the bound.