Compiling the named mutable traversal #
The source traversal and its ordinary array-map correctness theorem are reused unchanged. Realization checks the actual intermediate increments and call nesting; independent cost rules count the same helper, branches and stores. The compiler supplies register transport and the connection to actual execution.
The source helper's existing ordinary equation supplies its callable contract without a second proof of the addition.
The actual increment, not only its later clipped value, must fit the word backend. The helper has no nested calls.
The proved primitive, return and initialization charges bound this helper's actual generated body. This bound is independent of its termination proof.
A uniform guard budget inferred by the existing compiler-derived rules. The witness is chosen before the source locals and heap are introduced.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Guard evaluation includes the current buffer length, comparison and its Boolean return, using the automatically inferred uniform budget.
The actual body budget is inferred once from its bindings, read, supplied callee certificate, branches and store. No operation-price table is added.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A body includes the real read, helper call, selected store and local index update. Its uniform bound needs no second contents or termination proof.
The shared linear-loop budget uses the inferred guard and body costs; the compiler rule supplies normal-continuation and final-exit charges.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The real loop has a linear potential: every round pays for its guard, body and loop control, and the remaining constant pays for the final false guard. The original source invariant supplies preservation, not new contents or termination reasoning in the cost proof.
Guard realization only needs the compared natural values and its Boolean result to fit. No assumption on the array's contents is used by the guard.
Realize a single body using its current unread cell and the already proved helper contract. The ordinary source invariant supplies access validity; only actual intermediate ranges and one call level are added here.
Source totality already proves termination of this loop. The additional proof only checks guard/body realizability and reuses the source step's closed invariant; there is no second well-founded induction or time-budget premise.
The traversal uses one call level for its helper. Its original values' increments, limit and view length are the genuine bounded-word obligations.
The inferred complete traversal-body budget, shared by direct and imported callers. It follows the actual compiler without duplicating its structural constants.
Equations
Instances For
The complete inferred body bound reuses the source contents solely to identify the traversal's already proved state transitions.
The complete invocation budget includes the compiler's outer call and final halt exactly once. Its body budget is the inferred traversal certificate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The compiled traversal returns its ordinary array-map result and preserves every disjoint borrowed view in the same actual final heap. The shared typed outcome retains source evaluation, halted execution, physical memory and return facts; its independent instruction bound describes that very invocation. The launch keeps the original word ranges, represented input and two-frame capacity, while actual intermediate increments must separately fit.
The compiled traversal halts with its ordinary array-map result and preserves every initially observed disjoint view in the same represented final heap. Its independent linear instruction bound describes that very invocation. Preloaded objects, intermediate increments, code and stack capacity are explicit; no operational time budget or algorithm-specific register proof is assumed.
The same compiled traversal halts, realizes the ordinary array-map result in its actual final heap, and satisfies the independent linear body bound. Preloaded objects, intermediate increments, code and stack capacity are explicit; no operational time budget or algorithm-specific register proof is assumed.