Work of a run as an instruction count plus the weight of selected calls
Library · Source module
Work of a run as an instruction count plus the weight of selected calls
A resource model often charges one unit for every instruction except a few expensive primitives, whose weights are caller parameters of arbitrary growth. This file bounds the weighted count of a counted run by two separate terms: the number of instructions of the static count (the per-slot monomial of NLAlib.Ops.stmtWorkMono), and the number of selected calls times an envelope of their weights. The number of selected calls is the polynomial of the tree with every unselected subtree removed (NLAlib.Ops.Stmt.keepCalls), so it is not inflated by the cheap instructions.
Main definitions
* NLAlib.Ops.Stmt.hasCall: whether a tree contains a selected call. * NLAlib.Ops.Stmt.keepCalls: the tree with every subtree without a selected call removed.
Main results
* NLAlib.Ops.Count.lift_le_size_add: a weight at most one plus g is at most the number of instructions plus the weight g. * NLAlib.Ops.stmtWeightedCost_keepCalls: removing unselected subtrees keeps the weighted cost of weights supported on the selected calls. * NLAlib.Ops.Program.exec_lift_le_add_selected: the weighted count of a run is at most the monomial bound of its instructions plus the selected-call polynomial times the envelope.