Imported structured results with an optional borrowed buffer #
A pure metadata helper classifies a length. An independently declared library uses that actual result to return either no buffer or a full borrowed slice. The client matches the imported optional handle, reads and increments its first cell only when present, and returns the structured result. Products and options here are source values carried by actual calls, not a host-side substitute for the source implementations.
Correctness is stated with ordinary arrays and preservation of outside views.
OptionalBufferCompiled connects these same implementations to RAM execution.
The finite table of actual named source bodies.
Equations
- One or more equations did not get rendered due to their size.
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
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.
The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.
Fold an actual source invocation back to its named ordinary-argument observation.
The actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.
Equations
Instances For
The source program's declared first-order signatures.
Equations
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
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.OptionalBuffer.Metadata.classifyLength_onArgs function✝ env✝ = function✝ env✝.head
Instances For
This named source function's index in its declared signature table.
Equations
Instances For
The actual source action terminates with the generated native result and preserves every initial heap. Lean's native recursion principle proves this once.
Exact total source contract inherited from the generated native function.
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.
Actual imported function bodies with their internal calls relocated.
Equations
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.OptionalBuffer.Library.Source.inspect_onArgs function✝ env✝ = function✝ env✝.head
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
The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.
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
The same source action, without an asserted total mathematical model.
Equations
Instances For
Equations
Instances For
This named source function's index in its declared signature table.
Equations
Instances For
One source-body equation in ordinary monadic notation; named callees remain opaque.
Added function bodies already typed against the complete linked table.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Signature-preserving positions of this imported source program.
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.
The actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.
Equations
Instances For
The finite table of actual named source bodies.
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.
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
Signatures of the functions added by this source declaration.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The complete signature tables retained from imported source programs.
Equations
Instances For
Equations
Instances For
The source program's declared first-order signatures.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The imported functions retain their actual relocated bodies.
The same source action, without an asserted total mathematical model.
Equations
Instances For
Added function bodies already typed against the complete linked table.
Equations
- One or more equations did not get rendered due to their size.
Instances For
This named source function's index in its declared signature table.
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
Instances For
Signature-preserving positions of this imported source program.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The finite table of actual named source bodies.
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
Actual imported function bodies with their internal calls relocated.
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
The source program's declared first-order signatures.
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
The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.
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.
Signatures of the functions added by this source declaration.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The imported functions retain their actual relocated bodies.
One source-body equation in ordinary monadic notation; named callees remain opaque.
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.OptionalBuffer.Implementation.Source.bump_onArgs function✝ env✝ = function✝ env✝.head
Instances For
The complete signature tables retained from imported source programs.
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
The library returns the original borrowed handle exactly when nonempty.
Equations
Instances For
The returned handle and all array/frame properties refer to the same final heap.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Generated correspondence transfers the same pure result to source execution.
The imported classifier selects the actual full slice without changing the heap.
Inspecting metadata terminates even for an empty view, without reading its cells.
The client's native proof uses the imported result and the ordinary buffer read/write contracts; the resulting frame concerns the actual write heap.
Source correctness in ordinary parameters: the returned optional handle, updated native array and outside-view frame share one real final heap.