Executing a native linked-list constructor on RAM #
This is the actual generated NativeConstruction.Source.prepend wrapper, not
the imported constructor considered in isolation. Its ordinary source refinement
supplies head :: values; the shared constructor-call rule supplies readiness
and the exact count for the same execution. The invocation includes both call
levels, initialization, the wrapper return and the final halt.
The returned execution retains the actual extended heap and updated cursor. The original tail remains available in that same heap, including when it is shared by other roots. No disjointness or suffix copying is required.
Infer the straight-line wrapper's bound from its actual body and the constructor certificate. The measured theorem below establishes the exact count.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The actual imported constructor call and the wrapper's own return.
Equations
Instances For
Full instruction count for the generated wrapper, including its outer invocation, private-flag initialization and final halt exactly once.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The wrapper's uniform cost follows from the actual constructor certificate and its own generated statements, independently of readiness or termination.
The generated constructor body exposes its exact allocation and instruction count in ordinary arguments, so later callers reuse it at their current heap and cursor without opening the imported constructor again.
The ordinary native constructor halts in one real allocating RAM invocation. The source refinement is independent of resources; the launch supplies the existing finite-word, rootedness and code/stack conditions. Only three additional arena words are needed, regardless of the represented tail's length.
Infer both actual wrapper calls and the final return from the generated body. The exact execution theorem below retains both calls at the same nesting depth.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Two sequential calls to the same generated constructor reuse its exact body count. Each call pays its own frame work; the final return belongs to the caller.
Equations
Instances For
The actual two-constructor wrapper's complete invocation count, including its own initialization, outer call and final halt.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Two calls to the generated constructor run sequentially at depth two and retain both actual allocations. The ordinary result and shared-tail frame refer to the same halted invocation whose exact count includes both wrapper calls.
Only the chosen branch allocates: three nodes on the true path and two on the false path, including the common continuation's final constructor call.
Equations
Instances For
The actual branch and common continuation's core count. Initialize the optional result slot, then assign the selected value to it once. The common option match copies its payload once before the final call. Assignments, branches and sequencing use the existing compiler costs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The selected branch's complete invocation, including the wrapper's own initialization, outer call and halt. Untaken branch calls are not charged.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A native list-valued conditional allocates along its actual selected branch, merges that list, then invokes the common continuation on the same real heap. The original roots remain observable even if they share nodes. The execution record retains complete physical memory and placement for a subsequent call.
Infer the wrapper's uniform structural bound from its actual body and the two callee certificates. No call-table index or field-copy formula is supplied.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The inferred bound is independent of word width, heap limit and List length.
Equations
Instances For
Complete constant invocation bound, including the enclosing initialization, outer call and halt. Input loading is outside this preloaded-call boundary.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Ordinary List matching reads at most one actual node, shares its tail and allocates one new head. The same halted RAM execution satisfies the native mathematical equation, a length-independent instruction bound and three-word growth. Every old List observation remains valid, including shared tails.