Nonuniform costs for the existing array-record loop #
The unchanged ArrayRangeNative.repeatAppend copies a growing array on each
iteration. Its generated mathematical guard/body contracts transport the
current array observations through the actual heaps. The shared arena loop rule
reuses these contracts with a finite-sum potential, without a second execution
induction, a new termination argument or reconstruction of array handles.
The inferred body certificate uses the real allocating append cost, including
the caller's record updates. Structural composition accounts for the enclosing
function and its initialization once. The resulting all-input bound grows as
1 + count + count * initialSize + count² * chunkSize; its mathlib asymptotic
corollary concerns this same envelope. These are conditional cost contracts,
not readiness, capacity, space or complete launched-execution guarantees.
Infer the actual guard's uniform cost at the caller's depth.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Infer one round's cost from the current mathematical input lengths and actual heap observations. Both append inputs may share storage.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Sum the size-dependent round envelopes and the final false guard.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The real append supplies the slope; caller bookkeeping is size-independent.
One iteration increases the current array length and consumes its own charge.
Reuse the existing mathematical round contracts at every actual intermediate heap. No resource invariant beyond their array observations is needed here.
Infer the unchanged function's statement envelope using only count and input lengths, before introducing handles, payloads, word width or heap limit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The callable function adds its existing initialization charge exactly once.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Bound the same callable function under its original array/record observations, without imposing disjointness, termination budgets or capacity assumptions.
All iteration-dependent work is the finite sum; the remaining caller work is exactly its zero-iteration envelope.
An all-input polynomial bound obtained by bounding each actual round's size by the final array size. Compiler-derived coefficients remain explicit.
The same three-parameter envelope has mathlib's asymptotic growth bound. The proof uses an all-input inequality, not constraints on relative input sizes.