Confined contracts, uniform models and charged resources
Library · Source module
Confined contracts, uniform models and charged resources
NLAlib.Ops.AccessModel accepts any contract for a primitive: a contract may depend on the whole problem input, may read or write cells that are not operands of the call, and may be given zero work. A certificate over such a model is a true statement about that model, and can still mislead: a unit-cost primitive can write the answer.
This file names three properties that exclude this, as classes on the model, so that a certificate can state them and a check can report them. They restrict no existing statement.
* A contract is confined (NLAlib.Ops.Contract.Confined) when it is in operand form (NLAlib.Ops.BlockRel.spec): it reads the operand blocks and the tape window, writes the output blocks, and the lengths of all of them are functions of the dimensions of the call, the key of its cost. A query is confined (NLAlib.Ops.QueryContract.Confined) when its result depends on the memory only through the blocks read at its operands. * A model is uniform (NLAlib.Ops.AccessModel.Uniform) when its contracts do not depend on the sizes or the input. A model with a declared oracle, such as the application of an operator given as semantic data, is confined and not uniform. * A model is charged (NLAlib.Ops.AccessModel.Charged) when every primitive, query and structural instruction has positive work.
Main results
* NLAlib.Ops.Contract.Confined.frame: a confined call changes no buffer that is not an output operand. * NLAlib.Ops.AccessModel.Charged.size_le_work: under a charged model the work of a count is at least its number of instructions.
Declarations
- NLAlib.Ops.AccessModel.Charged
- NLAlib.Ops.AccessModel.Charged.size_le_work
- NLAlib.Ops.AccessModel.Confined
- NLAlib.Ops.AccessModel.Uniform
- NLAlib.Ops.BlockRel.confined_spec
- NLAlib.Ops.Contract.Confined
- NLAlib.Ops.Contract.Confined.frame
- NLAlib.Ops.Count.size
- NLAlib.Ops.Mem.getElem?_updBlocks_of_ne
- NLAlib.Ops.QueryContract.Confined
- NLAlib.Ops.QueryContract.Confined.test_congr
- NLAlib.Ops.Store.getElem?_updBlock_of_ne