Compiler-derived costs of the splay implementation #
The bounds below concern the existing ExecutionCost of the declared source
program and its actual lowering. In particular, rotation charges count the
two field reads, two field writes, control dispatch and function initialization.
They are not prices assigned to mathematical tree rotations.
Functional correctness and source termination remain independent of these conditional bounds. A completed realized execution supplies the successful accesses; its instruction accounting does not ask for a second safety proof.
The complete rotation body bound, from two compiled reads, two compiled writes, two sequence dispatches, a scalar return and flag initialization.
Equations
Instances For
The actual right-rotation function obeys its compiler-derived bound at every successful represented invocation; no content-dependent bound is needed.
The independently lowered left rotation has the same body bound. Its behavioral symmetry is not used as a substitute for instruction accounting.
Either rotation call pays its actual generated argument/frame/return work in addition to the verified body bound.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The pure mathematical tree determines the initial root and search query; its representation records the actual values read before the recursive call.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A conservative per-level coefficient from this program's actual emitted code and helper calls. Static code length is used only as a sufficient allowance for the acyclic non-callee work; recursive execution is charged separately.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The empty-tree branch incurs only the actual test, branch and return work.
The real compiled splay body costs at most a fixed compiler-derived amount per traversed search edge, plus one initial allowance. The ghost search path counts only nonempty child edges; even a final recursive call on zero is paid.
The proof uses the represented reads only to select the source branch and the actual recursive child. It does not require BST order, distinct identifiers, heap frames or a second functional-correctness proof: those belong to the independent source contract. All bounds remain conditional on actual successful realized execution, uniformly in word width and permitted call nesting.