Linking
Library · Source module
Linking
An implementation of the operations Op₁ over the operations Op₂ is a table (NLAlib.Ops.Table): each operation of Op₁ is given an implementation over Op₂ (NLAlib.Ops.Impl, the tree of a routine with the arity of the operation) or is kept as an operation of Op₂. Linking (NLAlib.Ops.Stmt.link) turns each call of an implemented operation into the frame of its tree; a call whose numbers of dimensions and operands do not fit the implementation becomes abort. The linked program is a first-order tree for all sizes. Queries (tests and index uses) have their own names Tst, which no table maps: they are primitives and linking leaves them alone.
The interpretation of Op₁ induced by a table and an interpretation of Op₂ (NLAlib.Ops.Interp.link): an implemented operation means the run of its tree.
NLAlib.Ops.run_link: the linked program under I and the program under the induced interpretation end in the same memory, or both fail. This is the refinement transfer, in both modes, with no certificate.
The three statements of the layer, NLAlib.Ops.Routine.Meets, NLAlib.Ops.Interp.Satisfies and NLAlib.Ops.Impl.Satisfies, and their roles are described once, in NLAlib/Ops/README.md ("Three statements") and the header of NLAlib/Ops/Routine.lean.
Main results
* NLAlib.Ops.run_link: refinement transfer. * NLAlib.Ops.Interp.link_callS_inl: the call of an implemented operation under the induced interpretation is the run of its implementation. * NLAlib.Ops.Stmt.link_comp, NLAlib.Ops.Interp.link_comp: linking through two tables is linking through their composition NLAlib.Ops.Table.comp; NLAlib.Ops.Table.iter is the k-fold composition of a table of a signature over itself, which is how recursion is linked.
Declarations
- NLAlib.Ops.Impl
- NLAlib.Ops.Impl.Fits
- NLAlib.Ops.Interp.link
- NLAlib.Ops.Interp.link_callS_inl
- NLAlib.Ops.Interp.link_callS_inr
- NLAlib.Ops.Interp.link_comp
- NLAlib.Ops.Interp.link_id
- NLAlib.Ops.Program.link
- NLAlib.Ops.Program.run_link
- NLAlib.Ops.Stmt.link
- NLAlib.Ops.Stmt.link_comp
- NLAlib.Ops.Stmt.link_id
- NLAlib.Ops.Table
- NLAlib.Ops.Table.comp
- NLAlib.Ops.Table.id
- NLAlib.Ops.Table.iter
- NLAlib.Ops.run_link
- NLAlib.Ops.run_link_call