Compositional combinators for native resource certificates #
These combinators assemble NativeCertificate witnesses for tuples, branches, retained-input
option elimination, sum tags, and clocked binary-counter iteration while tracking arbitrary
input-dependent time and space bounds. Linear postprocessing is absorbed into the producer's
bounds via its output-length guarantee; no polynomiality assumption or ofPolyTime selection is
used in the certificate constructors, while companion *_isPolynomial lemmas show that all
combinators preserve NativeCertificate.IsPolynomial.
Main definitions #
NativeCertificate.linear,.const,.prod,.post: basic linear, literal, pair, and postprocessing combinators.NativeCertificate.branch,.option: selected-branch conditional and retained-input option elimination.NativeCertificate.fst,.snd,.some,.inl,.inr,.congr,.pull,.payload: projections, constructors, and retained-input helpers.NativeCertificate.maxRoundTime,.maxRoundSpace,.maxStateLength,.iterate: clocked binary-counter iteration with trajectory-maximum bounds.
Main results #
NativeCertificate.linear_isPolynomial..NativeCertificate.iterate_isPolynomial: polynomiality preservation across all certificate combinators.
References #
Uses Christian Reitwiessner's native machine calculus and the parameterized option/sum resource lemmas.
Package a native linear-time/space implementation with its explicit input-length bound.
Instances For
A fixed literal, charged by the full input length.
Instances For
Construct a framed pair, adding the two producer bounds.
Instances For
Linear postprocessing is absorbed using the producer output-length guarantee.
Instances For
Charge the Boolean test and only the selected branch.
Instances For
Retain the original input across option elimination; charge duplication and selected branch.
Instances For
Project the first field, absorbing linear work in the producer bounds.
Instances For
Project the second field, absorbing linear work in the producer bounds.
Instances For
Add an option tag, absorbing linear work in the producer bounds.
Instances For
Add a left sum tag, absorbing linear work in the producer bounds.
Instances For
Add a right sum tag, absorbing linear work in the producer bounds.
Instances For
Transport along pointwise equality without changing bounds.
Instances For
Retain a producer on the first component of an extended input.
Instances For
Extract a retained-input continuation payload in linear time and space.
Instances For
Clocked iteration and polynomiality combinators for NativeCertificate #
Maximum single-round time along the first m + 1 iterates from b.
Instances For
Maximum single-round space along the first m + 1 iterates from b.
Instances For
Iterate step for n a rounds using a binary counter, charging the trajectory maxima over
0 ≤ j ≤ n a without requiring [Inhabited β] or pre-supplied polynomial bounds.
Instances For
Polynomiality preservation across certificate combinators #
Clocked iteration preserves polynomiality when the step count and reachable state lengths are polynomially bounded in the encoded input length.