Transformation plans and executable checking #
This module resolves elementary-axis lengths for rearrange, repeat, and
reduce. A composite input dimension may contain at most one axis whose
length is not supplied or fixed by an anonymous numeric axis. The remaining
length is inferred by exact division.
TransformPlan stores only the mathematical data consumed by semantics and
lowering: a normalized pattern, a total axis-length function, and the physical
output shape. Supplementary user input and partial assignments belong to the
concrete checking algorithm and deliberately do not survive in the plan. This
separation also permits elaborators to construct plans from symbolic Nat
expressions without imitating the concrete inference procedure.
When a known product is zero and the input dimension is also zero, the missing factor is not uniquely determined. The certified checker rejects that case rather than relying on the reference implementation's accidental integer division by zero.
User-supplied lengths for named axes.
Instances For
Names in a supplementary-length list, preserving user order.
Instances For
Look up the first supplied length with the given name.
Instances For
A possibly incomplete assignment of elementary-axis lengths.
Instances For
Seed an assignment from anonymous literals and named supplementary lengths.
Instances For
Update one elementary-axis length.
Instances For
Multiply the resolved lengths of a list of elementary axes.
Instances For
The semantic data of a checked transformation.
Axis lengths are total because all resolution obligations are discharged
before a plan is constructed. This avoids exposing the checker's temporary
Option-valued assignment to semantics, lowerings, or symbolic elaboration.
- normalization : CheckedNormalization
Parsed and ellipsis-expanded transformation with structural proofs.
Total length assignment for every logical elementary axis.
- output : Shape
Physical output induced by grouped output axes.
Instances For
The normalized transformation underlying a checked plan.
Instances For
Every elementary axis relevant to the plan, with harmless cross-side repetition.
Instances For
The product represented by one composite axis.
Instances For
Input dimensions reconstructed from resolved elementary-axis lengths.
Instances For
Output dimensions reconstructed from resolved elementary-axis lengths.
Instances For
Anonymous numeric axes retain their literal lengths.
Instances For
The semantic facts certified for every transformation plan.
- normalization : plan.normalized.Valid
The underlying parsed transformation satisfies all structural checks.
Every anonymous numeric axis retains the length written in the pattern.
Resolved logical-axis lengths reconstruct the physical input shape.
The stored output shape is exactly the shape induced by the output groups.
Instances For
A transformation bundled with every invariant required by semantics and lowering.
- value : TransformPlan
Total semantic plan produced by shape checking.
Proof that all lengths and physical shapes agree with the normalized pattern.
Instances For
Check a normalized transformation against concrete dimensions and supplied named-axis lengths.