An explicit polynomial for the number of instructions of a program
Library · Source module
An explicit polynomial for the number of instructions of a program
The static count of a program (NLAlib.Ops.staticCost) is a sum over the loops of its tree. This file computes from the tree a polynomial in the sizes, one variable per size, that bounds the number of instructions of every run: primitives, queries and structural instructions alike. Under a model whose weights are all at most one, that number bounds the work.
A polynomial is a list of terms, a coefficient and the list of its variables with multiplicity (NLAlib.Ops.CountPoly). The polynomial of a tree is computed by a structural recursion with no proof inside, so the kernel evaluates it on a fixed program and the result is an explicit list. A loop multiplies the polynomial of its body by an upper bound of its number of rounds; a branch adds its two sides; a truncated difference and a quotient are bounded by their first argument.
Main results
* NLAlib.Ops.stmtWeightedCost_le_countPoly: the weighted static cost of a tree is at most its polynomial, when every weight is at most one. * NLAlib.Ops.Program.exec_work_le_countPoly: the work of a canonical run is at most the polynomial of the instrumented program at its sizes. * NLAlib.Ops.Program.exec_weight_le_countPoly: the same for any weights at most one, which need not be those of the run. * NLAlib.Ops.Algorithm.withCountPoly: a certificate restated with that explicit work.
Declarations
- NLAlib.Ops.Algorithm.withCountPoly
- NLAlib.Ops.BoundedBy
- NLAlib.Ops.BoundedBy.getElem?
- NLAlib.Ops.CountPoly
- NLAlib.Ops.CountPoly.add
- NLAlib.Ops.CountPoly.const
- NLAlib.Ops.CountPoly.eval
- NLAlib.Ops.CountPoly.eval_add
- NLAlib.Ops.CountPoly.eval_cons
- NLAlib.Ops.CountPoly.eval_const
- NLAlib.Ops.CountPoly.eval_insert
- NLAlib.Ops.CountPoly.eval_map_mul
- NLAlib.Ops.CountPoly.eval_mul
- NLAlib.Ops.CountPoly.eval_nil
- NLAlib.Ops.CountPoly.eval_normalize
- NLAlib.Ops.CountPoly.eval_var
- NLAlib.Ops.CountPoly.insert
- NLAlib.Ops.CountPoly.monoEval
- NLAlib.Ops.CountPoly.monoEval_append
- NLAlib.Ops.CountPoly.monoEval_sortMono
- NLAlib.Ops.CountPoly.monoEval_sortedInsert
- NLAlib.Ops.CountPoly.mul
- NLAlib.Ops.CountPoly.normalize
- NLAlib.Ops.CountPoly.sortMono
- NLAlib.Ops.CountPoly.sortedInsert
- NLAlib.Ops.CountPoly.var
- NLAlib.Ops.IExp.evalList_le_upper
- NLAlib.Ops.IExp.eval_le_upper
- NLAlib.Ops.IExp.upper
- NLAlib.Ops.Program.boundedBy_sizeBounds
- NLAlib.Ops.Program.countPoly
- NLAlib.Ops.Program.exec_weight_le_countPoly
- NLAlib.Ops.Program.exec_work_le_countPoly
- NLAlib.Ops.Program.sizeBounds
- NLAlib.Ops.Stmt.countPoly
- NLAlib.Ops.stmtWeightedCost_le_countPoly
- NLAlib.Ops.«tacticPoly_eval[_]»