Lowered Forward Evaluation: Shared Invariants #
The shape list records the expected type of every value in the dynamic evaluator table.
packedAt and tensorAt recover an in-bounds value and its typed tensor from that invariant;
the lookup lemmas connect them to the evaluator's failure-aware interface. Small graph
constructors are shared by the local, per-operator evaluation theorems.
Local graph constructors for evaluator lemmas #
A unary node with parent 0 and an explicit output shape.
Instances For
A two-node graph for a unary op with explicit input and output shapes.
Instances For
A two-node graph for a unary op whose input and output share the same shape.
Instances For
A binary node with parents 0 and 1 and an explicit output shape.
Instances For
A three-node graph for a binary op with explicit parent and output shapes.
Instances For
A three-node graph for a binary op whose inputs and output share the same shape.
Instances For
A node consuming every preceding entry of a shape array, in order.
Instances For
Graph fixture for an arbitrary-arity evaluator theorem: one input node per parent shape followed by a node whose parent ids are the complete preceding range.
Instances For
A failure-aware lookup over List.range reconstructs the array's element list when it
succeeds at every valid index.
A failure-aware lookup reconstructs an array when it succeeds at every valid index.
The final node of a variadic evaluator fixture is its variadic operation node.
Evaluate a typed forward let-chain while accumulating every intermediate dynamic value.
Instances For
Graph.expectShape returns the stored tensor when the dynamic shape tag matches.
A successful shape check certifies the shape stored by the packed tensor.
A successful shape check identifies the packed value with the typed tensor it returned.
getVal returns the indexed tensor when the runtime value carries the expected shape tag.
Shape lookup through shapesOfVals agrees with looking up the dynamic value first.
shapesOfVals has one entry per runtime value.
A shape-context invariant proves that a typed index is in bounds for the value array.
The packed runtime value selected by a typed index and a matching shape context.
Instances For
Safe array lookup returns the packed value selected by packedAt.
The packed value selected by a typed index carries the statically expected shape.
The typed tensor selected by an index into a runtime context with the expected shapes.
Instances For
Packing the typed tensor recovered from a well-shaped context returns the original value.
Shape checking succeeds for the typed tensor extracted from a well-shaped context.
getVal succeeds from a well-shaped executable context.
This is the proof layer form of getVal_eq_ok: callers use the semantic invariant
shapesOfVals vals = Ctx inShape ss, and the lemma derives the array-bounds fact internally.