NLA-lib Explorer

The interface of a routine

Library · Source module

The interface of a routine

A routine (NLAlib.Ops.Routine) is a fixed tree with an interface: its dimensions and, for each operand (NLAlib.Ops.Port), how it is used (NLAlib.Ops.Access: read, written, updated in place, or isolated) and its length as a function of the dimensions. Operands are written with NLAlib.Ops.Port.read, .write, .update, .isolated. This file defines interfaces and the separation they require; the judgment and certificates are in NLAlib/Ops/Routine.lean.

An operand may continue the operand before it (NLAlib.Ops.Port.continuing): its block is in the same buffer and starts where that block ends, as the columns appended to a stored basis. Its position is fixed by the interface, so a call supplies one operand for each region of the interface (NLAlib.Ops.Port.regions), and NLAlib.Ops.Routine.operands gives the positions of all operands. Separation is required of the regions.

A written operand may be unreported (NLAlib.Ops.Port.unreported): the judgment says nothing of its final contents. Caller-supplied scratch and a matrix destroyed in place are such operands.

The separation of operands is one of two fixed rules named by the interface (NLAlib.Ops.Separation: by buffer, or by block so that operands may be disjoint blocks of one buffer); the author cannot state another. Under either rule, operands that are only read may overlap, except an isolated one.

A routine declares the number of tape positions it draws; one whose draws depend on the data declares none.

Main definitions

* NLAlib.Ops.Access, NLAlib.Ops.Port, NLAlib.Ops.Routine: interfaces and routines. * NLAlib.Ops.Separation, NLAlib.Ops.Routine.SeparatedAt: the two fixed separation rules and the separation a routine requires.

Main results

* NLAlib.Ops.Routine.separated_iff_pairwise: separation by buffer is a condition on pairs of operands.

Declarations