Certified native array slices #
Contiguous tensor blocks can be copied with Array.foldl rather than
recomputing a source index for every scalar. These helpers retain
Array.ofFn as their independent semantic reference.
Contiguous copying reuses TorchLean.appendArraySlice and
appendArraySlice_eq_append_extract from the storage layer.
Appending fixed-width rows in finite-index order reconstructs their flattened finite function.
Build an array by appending one fixed-width source slice for each row.
The executable path uses an unboxed outer counter and the runtime array slice fold. Source range proofs remain confined to the correctness theorem.
Instances For
The native slice builder equals Array.ofFn when every extracted row agrees
with the corresponding finite-function row.
The native slice builder produces the requested flattened size.
Build a physical buffer by appending one fixed-width source slice per row.
For Float, appendSlice traverses the unboxed FloatArray directly.
Instances For
The physical slice builder observes as Array.ofFn when each copied source
row agrees with the corresponding semantic row.
The physical slice builder produces exactly the requested scalar count.
Build a shaped tensor by copying a fixed-width source slice for each row.
The shape equality and row certificates erase, leaving only the source array, four static index constants, and the native outer loop.
Instances For
The native tensor slice builder equals its ordinary finite-function tensor.