Allocation-aware linear cost of the existing buffer append #
The actual Copy.append allocates and initializes its fresh destination, copies
the left input, copies the right input, then returns that destination. Its cost
proof reuses the existing copy loop bound and source contracts at the real
intermediate heaps. Inputs may overlap: only the freshly allocated destination
needs to be disjoint. No readiness or finite-word assumption restricts this
conditional cost contract; those belong to the independent launch proof.
The size envelopes count initialization, both calls, their sequence dispatch, and the actual return. The whole-invocation envelope additionally counts its outer call and final halt through the existing compiler cost function.
The same copying body has its existing bound on any actual arena trace. The local no-allocation check permits its actual target writes.
The compiler-derived core envelope includes real allocation initialization and both actual copying calls; it omits only the outer function initialization.
Equations
- Ram.LanguageCompiler.BufferCopy.appendCoreBound leftSize rightSize = ↑(Ram.LanguageCompiler.BufferCopy.appendCost✝ leftSize rightSize)
Instances For
Bound the same allocating source statement from ordinary input contents. There are no cell ranges, word-width inequalities or proposed readiness premises.
Each input element pays for one initializer iteration and one copy round. All remaining compiler-generated costs are fixed overhead.
The complete lowered function-body envelope uses only total input size, and adds the existing two-instruction function initialization exactly once.
Equations
Instances For
Splitting the same total size differently does not change the body envelope.
The actual callable append body has a total-size bound under just its original contents precondition. Both inputs may refer to overlapping storage.
The body envelope is affine in the sum of the two native array lengths.
Add the actual outer invocation and final halt to the proved body budget.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The invocation keeps exactly the body envelope's linear coefficient.
The body cost is linear in total native input size.
The complete invocation envelope is linear in total native input size.