Composing imported functions in one executable source #
functions imports the existing copy and sum implementations and calls them
from a new function. Copy returns Unit and is called for its shared-memory
effect, without a dummy result field or destination. No callee body is duplicated. The
copy's mathematical postcondition supplies the destination representation needed
by sum, and their previously proved contracts are transported through the
generated embeddings.
This is one compiled RAM invocation, not two host-level runner calls. The arrays are preloaded and disjoint; allocation and loading are not implemented here. Correctness and termination do not depend on a proposed execution bound.
The declared function's compiled body count, excluding its enclosing call overhead.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Execute the declared function's compiled call, retaining the complete machine result.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The declared function's result and shared state, observed through its actual execution.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Execute the declared function and return its typed value and source shared state, excluding private stack cells and restoring caller registers while retaining actual stream effects.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Execute the declared function and return its typed value and source shared state, excluding private stack cells and restoring caller registers while retaining actual stream effects.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Execute the declared function and return its typed value and source shared state, excluding private stack cells and restoring caller registers while retaining actual stream effects.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
The declared function's result and shared state, observed through its actual execution.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Copy an existing array and sum the destination through imported functions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
The declared function's result and shared state, observed through its actual execution.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
The declared function's compiled body count, excluding its enclosing call overhead.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Execute the declared function's compiled call, retaining the complete machine result.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Project the declared word, array, or Unit result of the normally terminating call.
Use runTotal or applyState to observe execution when the result is Unit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Ram.Examples.FunctionComposition.functions.importMap.Copy i✝ = List.length { registers := 0, declarations := [] }.program + i✝
Instances For
Execute the declared function with a normal-halt proof, retaining its state and count.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Execute the declared function with a normal-halt proof, retaining its state and count.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Execute the declared function with a normal-halt proof, retaining its state and count.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
The declared function's result and shared state, observed through its actual execution.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Execute the declared function's compiled call, retaining the complete machine result.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Project the declared word, array, or Unit result of the normally terminating call.
Use runTotal or applyState to observe execution when the result is Unit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Execute the declared function and return its typed value and source shared state, excluding private stack cells and restoring caller registers while retaining actual stream effects.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Execute the declared function's compiled call, retaining the complete machine result.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Project the declared word, array, or Unit result of the normally terminating call.
Use runTotal or applyState to observe execution when the result is Unit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Project the declared word, array, or Unit result of the normally terminating call.
Use runTotal or applyState to observe execution when the result is Unit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The declared function's compiled body count, excluding its enclosing call overhead.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Execute the declared function with a normal-halt proof, retaining its state and count.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The declared parameters' actual by-value word fields.
The declared function's compiled body count, excluding its enclosing call overhead.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Mathematical contents and framing describe the effect of the composed implementation. No register index, stack layout or callee loop enters this proof.
The same compiled composition admits an ordinary mathematical return equation, while retaining the actual copied shared state.
An imported function's own calls are relocated as well. The original two-array theorem transfers without reopening either sum call or its loop.
Existing disjoint arrays with matching lengths. Their contents are logical witnesses, not arguments used to execute the source program.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Fixed code for the imported functions and the new composed call.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Correctness of the source composition supplies normal termination of its compiled invocation. This proof does not use the independent time bound.
Ordinary execution returns both the computed sum and the copied shared state from one compiled call. All proof arguments are erased at runtime.
Equations
- Ram.Examples.FunctionComposition.copyThenSum source destination heapLimit entry safe hstack = Ram.Examples.FunctionComposition.functions.applyState.copyThenSum source destination heapLimit entry ⋯
Instances For
A mathematical postcondition of the actual executable result: the scalar is the list sum and the destination contains the copied list.