Compositional properties of typed tensor programs #
Theorems here lift local operation rules through the existing typed interpreter. They use the same program, scalar families, payloads and evaluation functions as execution.
run_inductioncarries a predicate on values and conversion flags through a successful run.run_relcarries a relation between two successful runs, allowing different interpreters, inputs and parameter payloads.eval_reltransfers pointwise node relations to the designated results in return order.
These rules remove the traversal argument from proofs about a tensor program. A numerical bound, permutation property or other relation still needs correct rules for its operations, including input and constant nodes. Successful execution is an explicit hypothesis; the rules do not prove that a program executes for every input or that an external backend implements its semantics.
A relation preserved by each operation holds between the completed value tables.
The interpreters may use different scalar representations, and their inputs and payloads may also differ. The local rule must cover those differences for input, constant and numerical nodes. The relation can describe the whole prefix and accumulated conversion flags, allowing bounds and exception conditions to depend on earlier results.
Carry an invariant from the empty value table through every successful operation.
The predicate can express bounds on intermediate tensors or conditions on conversion flags. It is supplied by the proof, independently of the frontend or model architecture.
Operation rules imply a relation between corresponding returned tensors.
This includes multiple arguments, repeated result nodes and any return order. The rules apply to the program's actual typed operations and payloads; no architecture specification is required.