A borrowed-buffer traversal with a helper call and branch #
Each iteration reads the current cell, calls the source increment function,
selects the bounded value and writes it to the same shared buffer. The source
uses an ordinary range loop with an immutable iteration index. The complete source proof shows
termination and the native array map result by fun x => min (x + 1) limit;
no host array operation executes in place of the declared traversal.
Examples.Language.TraversalCompiled connects this same source proof to its
compiled invocation and an independent linear execution-cost bound.
Apply a chosen mathematical contract to the native block action. Continuations see ordinary mutable outputs; proved frames restore the fixed captures.
Coordinate conversion for composing this named observation.
Fold an actual source invocation back to its named ordinary-argument observation.
Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compose an increasing count and a transitive heap frame from the actual guard and body contracts. The guard preserves the count and heap; normal body steps increase the count by one. Array effects and the exit consequence remain supplied mathematical facts, without a runtime budget.
Apply a chosen mathematical contract to the native block action. Continuations see ordinary mutable outputs; proved frames restore the fixed captures.
The named function's actual independently interpreted source body.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The actual source block observed with ordinary named local inputs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Resume from actual mutable locals; immutable captures are preserved by the source frame.
The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Relational total correctness with ordinary mutable parameters and fixed captures. The existing block contract retains both actual heaps and excludes faults.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.
Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.
The source program's declared first-order signatures.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.
Relational total correctness with ordinary mutable parameters and fixed captures. The existing block contract retains both actual heaps and excludes faults.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The actual value-producing guard, reevaluated on every iteration.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Relational total correctness with ordinary mutable parameters and fixed captures. The existing block contract retains both actual heaps and excludes faults.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Fold an actual source invocation back to its named ordinary-argument observation.
The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.
Coordinate conversion for composing this named observation.
Prove this actual loop with fixed captures and well-founded progress on its mutable locals. Only normal body exits must decrease; guard effects, returns and faults retain their real heap.
Introduce named mutable variables directly, without unpacking internal coordinates.
The actual parsed lexical body, with its enclosing return type.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.
The finite table of actual named source bodies.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Exact total source contract derived from the checked encoded-result equation and the existing raw-input reconstruction, with the same final heap.
The same source execution returns the encoded mathematical result without changing its supplied heap, under the actual input representations.
Source lexical immutability preserves these captures on every actual exit.
Prove this actual loop using a related mathematical state and well-founded progress. Fixed captures are retained by the generated execution frames.
The actual source block observed with ordinary named local inputs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.
Ordinary arguments and the actual result observed in their real source heaps. This interface does not assert the existence of a total mathematical model.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.
One source-body equation in ordinary monadic notation; named callees remain opaque.
Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.
The same complete environment, grouped by source mutability.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source lexical immutability preserves these captures on every actual exit.
Prove a named loop from independent mathematical guard and body contracts. Actual guard effects and early body returns are retained; only normal iterations decrease.
Observe lexical coordinates without unfolding the equivalence structure.
The actual source block observed with ordinary named local inputs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.
Equations
- Complexity.Language.Examples.Traversal.Implementation.increment_onArgs function✝ env✝ = function✝ env✝.head
Instances For
Prove a named loop from independent mathematical guard and body contracts. Actual guard effects and early body returns are retained; only normal iterations decrease.
Apply a chosen mathematical contract to the native block action. Continuations see ordinary mutable outputs; proved frames restore the fixed captures.
Introduce named mutable variables directly, without unpacking internal coordinates.
One source-body equation in ordinary monadic notation; named callees remain opaque.
Introduce named mutable variables directly, without unpacking internal coordinates.
Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source lexical immutability preserves these captures on every actual exit.
This named source function's index in its declared signature table.
Equations
Instances For
The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.
The actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.
Equations
Instances For
Fixed lexical captures, independent of the shared heap.
Equations
Instances For
The named function's actual independently interpreted source body.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.
Equations
Instances For
This named source function's index in its declared signature table.
Equations
Instances For
Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.
The ordinary mutable locals of this source loop.
Equations
Instances For
This actual source block, retaining its loop or allocation-scope semantics.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The named function's actual independently interpreted source body.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.
Equations
Instances For
Ordinary arguments and the actual result observed in their real source heaps. This interface does not assert the existence of a total mathematical model.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Complete lexical coordinates for this source block.
Equations
Instances For
Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Ordinary mathematical function generated from the same represented source block.
Equations
Instances For
The actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Automatic correspondence for the same generated source function, without a machine budget.
This named source function's index in its declared signature table.
Equations
Instances For
Ordinary arguments and the actual result observed in their real source heaps. This interface does not assert the existence of a total mathematical model.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prove this actual loop with fixed captures and well-founded progress on its mutable locals. Only normal body exits must decrease; guard effects, returns and faults retain their real heap.
Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.
Equations
- Complexity.Language.Examples.Traversal.Implementation.boundedMap_onArgs function✝ env✝ = function✝ env✝.head env✝.tail.head
Instances For
Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.
Coordinate conversion for composing this named observation.
The actual helper returns the mathematical increment and preserves every initial heap. This statement does not impose a machine word width or budget.
At the traversal boundary, the processed prefix uses the mathematical update while the unread suffix still has its original values.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Before the first iteration, the mapped prefix is empty.
The guard returns its ordinary mathematical decision and preserves the index and heap. Fixed captures stay inside the generated block interface.
One native body proof advances the mathematical prefix and retains every outside-buffer observation at the same actual final heap.
The prefix invariant and outside-buffer frame compose across the actual iterations. Descent is ordinary subtraction on the number of unread cells; the guard and body are specified independently, with their real endpoint heaps.
The traversal's ordinary array result and its outside-buffer frame hold at the same actual final heap. This includes disjoint slices of the same object.
The declared traversal terminates and updates the actual buffer to the ordinary native array map. This is the same source program, not a host map used as its implementation, and correctness imposes no proposed runtime budget.
The ordinary array specification transfers to the source function contract through its generated argument interface, with no register or environment proof.
Callers receive the same array-map specification together with preservation of every disjoint borrowed view, relative to their actual calling heap.
Observe ordinary array input and output without changing the in-place
implementation or its Unit return. The output is read at the final heap.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The existing implementation proof supplies the shared mathematical correspondence; it is not another implementation or loop induction.
An ordinary array theorem composes with implementation correspondence. This proves a property of the same source execution without reopening its loop.