NLA-lib Explorer

NLAlib.Ops.Impl

Library · structure

An implementation of an operation: the entry of a linking table (NLAlib.Ops.Table). It is a tree with the arity of the operation it implements: its index variables are the nd dimensions of the call followed by the offsets of its operands, and its buffer variables are the nin input and nout output operands.

It is not a routine (NLAlib.Ops.Routine). It is the tree of a routine with the arity of that routine (NLAlib.Ops.Routine.impl), and the two are different because one tree may implement an operation whose contract admits several layouts of the operands, which are several routines sharing that tree. The axpy entry of NLAlib.Ops.RCLikeScalar.table is one tree; its contract admits the output apart from both vectors, on either vector in place, and on both at once, and each of these is a routine with its own interface. What an implementation must prove is NLAlib.Ops.Impl.Satisfies, by cases on the layout, from the judgments of those routines.

An entry is written directly, not as the tree of a routine, only where no routine can describe it: an entry of a context table, whose first inputs are the context forwarded to every call (NLAlib.Ops.ContextDense.impl); an implementation that does not always terminate, for liberal mode (NLAlib.Ops.Examples.divImpl); and the examples that prove a contract from the run of the entry itself, the layer on which routine judgments are built (NLAlib.Ops.Examples.dotImpl).

NLAlib.Ops.Impl (Op Tst : Type) : Type

Full source on GitHub

Import NLAlib.Ops.Link.