Static counts and workspace
Library · Source module
Static counts and workspace
The counts and the scratch payload bytes of a run are bounded by functions of the tree and the values of its index variables alone: NLAlib.Ops.stmtCost and NLAlib.Ops.stmtPeak. For a tree without tests and index binders the count is exact; a branch counts the larger side, a whileFuel its fuel, a bindIdx its worst value.
NLAlib.Ops.exec_within: every successful counted run stays within them. So a count is obtained by evaluating a function on the tree, never by a proof about loops, and NLAlib.Ops.ConditionalRuns.of_run turns a statement about the memory (program logic) into the full statement with counts and workspace.
Main definitions
* NLAlib.Ops.stmtCost, NLAlib.Ops.stmtPeak: the static count and workspace of a tree. * NLAlib.Ops.staticCost, NLAlib.Ops.staticPeak: those of a program, with its structural instructions.
Main results
* NLAlib.Ops.exec_within: soundness of the static count and workspace. * NLAlib.Ops.ConditionalRuns.of_run: from a run to a run within its static budget.
Declarations
- NLAlib.Ops.ConditionalRuns
- NLAlib.Ops.ConditionalRuns.mono
- NLAlib.Ops.ConditionalRuns.of_run
- NLAlib.Ops.ConditionalRunsL
- NLAlib.Ops.ConditionalRunsW
- NLAlib.Ops.ConditionalRunsW.mono
- NLAlib.Ops.St.Within
- NLAlib.Ops.St.Within.mono
- NLAlib.Ops.St.Within.refl
- NLAlib.Ops.St.Within.tick
- NLAlib.Ops.St.Within.trans
- NLAlib.Ops.exec_static
- NLAlib.Ops.exec_within
- NLAlib.Ops.iter_within
- NLAlib.Ops.runs_iff_runsW
- NLAlib.Ops.staticCost
- NLAlib.Ops.staticPeak
- NLAlib.Ops.staticPeak_eq
- NLAlib.Ops.stmtCost
- NLAlib.Ops.stmtCost_alloc
- NLAlib.Ops.stmtCost_note
- NLAlib.Ops.stmtPeak
- NLAlib.Ops.stmtPeak_alloc
- NLAlib.Ops.stmtPeak_instrument
- NLAlib.Ops.stmtPeak_note
- NLAlib.Ops.stmtPeak_tally
- NLAlib.Ops.testCost
- NLAlib.Ops.useCost
- NLAlib.Ops.whileIter_within