NLA-lib Explorer

Loop rules with footprints

Library · Source module

Loop rules with footprints

Every loop rule here has the standard invariant form: a family of footprints F i (what the first i rounds may write, increasing in i) and a family of postconditions P i. A round is proved from a fresh memory m' with the frame m.store.EqOff (F i) m'.store and P i m', and must write only F (i + 1) from m'; the rule composes the frames. So a round never writes an EqOff chain from the start of the loop, and the invariant never says ∃ s', m' = ⟨s', _⟩.

Main results

* NLAlib.Ops.writes_loop: the counted loop. * NLAlib.Ops.writes_loop₂: two nested counted loops, with an invariant indexed by the row and the column (no quotient or remainder of a linear index). * NLAlib.Ops.writes_fill, NLAlib.Ops.writes_fill₂: a loop (two loops) that fills a vector (a matrix in a layout) one entry per round, with the position of the tape moving; the round only has to prove the one cell it writes. * NLAlib.Ops.writes_fillRel, NLAlib.Ops.writes_fillRel₂: the same when the values are known only by a relation (the outputs of relational calls: gemm, coefficients). * NLAlib.Ops.writes_whileFuel: the loop with early exit. * NLAlib.Ops.writes_ifPos, NLAlib.Ops.writes_ifZero: branches on a size.

Declarations