NLA-lib Explorer

The geometry of a list of views

Library · Source module

The geometry of a list of views

A program that works on several views (a matrix, a stack, an output vector, scratch registers) needs the same three facts about them in every proof: each view refers to a live buffer, each has room for its declared length, and the views are pairwise apart. NLAlib.Ops.Geometry is that conjunction for a list of views and lengths. It survives every write that keeps the buffer lengths (NLAlib.Ops.Geometry.of_eqOff), gives the disjointness of any two views or of any two disjoint selections of views, and extends to the views allocated by a scratch allocation after the caller's buffers (NLAlib.Ops.Geometry.allocated). An algorithm states its own geometry as this predicate at its list of views, instead of a structure with the same three fields and the same lemmas re-proved.

Main definitions

* NLAlib.Ops.Geometry: liveness, room and separation of a list of views.

Main results

* NLAlib.Ops.Geometry.of_eqOff, NLAlib.Ops.Geometry.live_of_subset: preservation and liveness of sublists. * NLAlib.Ops.Geometry.disj, NLAlib.Ops.Geometry.disj_select: disjointness of views. * NLAlib.Ops.Geometry.allocated: the geometry after a scratch allocation. * NLAlib.Ops.Mem.room_append: room for two lists of views.

Declarations