Executable array copy with a reusable returned state #
copy executes the existing Unit-returning copy function and returns its actual
shared state through applyState. Ordinary list equations describe the copied memory;
the logical lists occur only in erased safety proofs, never as runtime arguments.
The implementation does not allocate or load either array.
copyThenSum is a host-level composition of two genuine compiled calls: it passes
copy's returned state directly to the existing executable sum function. It is not
a new single compiled RAM program. Host-side preloading and state projection are
not charged as RAM array-conversion instructions, and no whole-program cost is
claimed for this composition. Each original operation retains its separate cost
theorems. The existing raw-block copy example remains independent.
The existing array assertions provide a safe non-overlapping copy of the runtime length. No contents or proposed result become executable inputs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Budget-free copy correctness establishes normal termination of this compiled call. No measured execution or proposed time bound is needed.
Execute the existing compiled copy and return its source-visible state. The proof is erased, and the destination contents come from actual RAM stores.
Equations
- Ram.Examples.ArrayCopyFunction.copy source destination length heapLimit entry safe hstack = (Ram.Source.Array.copyFunctions.applyState.copy source destination length heapLimit entry ⋯).2
Instances For
Typed Unit application retains the actual copied shared state. The empty value does not replace execution: the destination contents, frame and streams come from the same compiled invocation.
The actual returned state contains the copied list at both pointers, preserves memory outside the destination, and retains both I/O streams.
The ordinary list observation of the actual copied destination equals the source list. This reuses the existing representation-to-list theorem.
The existing independent body bound gives a bound for the actual copy
call, including argument setup, return and halt. It is not used by copy_halts.
Host-level sequencing of two actual compiled applications. Sum reads the destination from copy's returned state, not the input state or a logical list.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Ordinary function composition preserves the source list's modular sum. No loop, RAM register or calling-convention proof is opened in this argument.