NLA-lib Explorer

Example: a loop over the cells of a block, from the tree to the readable statement

Library · Source module

Example: a loop over the cells of a block, from the tree to the readable statement

NLAlib.Ops.Examples.VectorSum.vadd is [n] (x : read n, y : read n) → (z : write n): a loop of z_i := x_i + y_i over scalar additions. It is the smallest routine whose tree is a loop over calls on indexed cells, and the worked example of the contributor guide for the loop invariant, the read of one cell of a block, and a block-valued output in the readable statement (docs/contributing/routines.md).

Main definitions

* NLAlib.Ops.Examples.VectorSum.vadd, NLAlib.Ops.Examples.VectorSum.vaddSpec: the routine and its specification. * NLAlib.Ops.Examples.VectorSum.vaddDomain: its admitted inputs. * NLAlib.Ops.Examples.VectorSum.vaddAlgorithm: the certificate.

Main results

* NLAlib.Ops.Examples.VectorSum.vadd_meets: the routine meets its specification. * NLAlib.Ops.Examples.VectorSum.vadd_checked: what the certificate states, in terms of the execution rules.

Declarations