Compositional exact instruction counts #
Ram.Source.TimeExact is an equality about the existing measured execution,
not a new execution relation or a cost annotation. Like TimeBound, it is
conditional on completed execution and does not establish termination.
Straight-line code reuses its proved compiled length. Branches and calls add the actual generated instructions, and a constant-cost continuation needs no intermediate functional invariant. A safe execution can subsequently be given the exact count without rebuilding its execution tree or proving its endpoint again. Functional correctness and termination remain independent of the cost.
Heap and call-depth indices retain their original meaning. These conditional equalities cannot be enlarged to other capacities merely by monotonicity: an insufficient capacity may make the premise vacuous.
Every completed execution at the stated capacities has the given count. The cost expression is a property to prove, never an input to the program.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Rewrite the mathematical count without changing its execution or domain.
An exact equation supplies the corresponding conditional upper bound.
Every completed straight-line block has its already proved compiled length. Memory and input safety are supplied by the execution, not assumed away here.
A state-independent continuation count needs no intermediate invariant or new termination proof. Both counts refer to the actual component executions.
A known zero guard charges its evaluation, conditional jump and false branch, without asking for a cost proof of an unreachable true branch.
A known nonzero guard also charges the true branch's final jump past the false branch. Only the branch selected by the mathematical precondition is used.
A recursive or ordinary function call reuses the callee's body count at its actual arguments. Setup, return and receipt costs are compiler-derived; the rule handles the measured call tree and requires no callee endpoint.
Attach a separately proved count to the same safe execution and endpoint. This uses existence of measurement, not a second functional or termination proof.