Changing local work charges #
recost retains representations, codes and semantic functions while changing the local work
charge. The same machine implements the same programs and has the same traces, query counts,
traffic and peak sizes. Only work changes. Transporting work bounds requires a comparison of
the old and new charges; arbitrary recosting does not preserve a run bound.
The recosted backend carries the original structural code (HasComposition, HasProd,
HasSum, HasOption, IsDistributive), so composite realizations recost part by part
(QuantitativeRealization.seqComp_recost). A pointwise decrease of charges is also a
simulation (SimulatedBy.ofRecostLE).
Replace the cost function of a backend. Realizers, sizes and admissibility are untouched.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Structure carried by a recosted backend #
The original identity and composition code, under the new charges. The new charges are arbitrary, so the only generic connection overhead is the composite's own new charge.
Equations
- One or more equations did not get rendered due to their size.
The original product code.
Equations
- One or more equations did not get rendered due to their size.
The original sum code.
Equations
- One or more equations did not get rendered due to their size.
The original optional-value code.
Equations
- One or more equations did not get rendered due to their size.
The original distributivity code.
Equations
- PFunctor.QuantitativeStepClass.instIsDistributiveRecost = { distribute := fun {A B E : Type ?u.3} => PFunctor.QuantitativeStepClass.IsDistributive.distribute }
Recosting as a simulation #
A pointwise decrease of local charges is a simulation of the original backend by the
recosted one, along the identity on representations. It transports PolyRealizers but no run
bounds; QuantitativeRealization.runsWithinUnder_recost transports those.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The same realization over the recosted backend: same machine, state, and codes.
Equations
- PFunctor.DynSystem.DynComputation.QuantitativeRealization.recost cost' R = { machine := R.machine, state := R.state, initCode := R.initCode, headCode := R.headCode, updateCode := R.updateCode }
Instances For
Semantic correctness does not see the cost function.
Recosting commutes with sequential composition: neither the machine nor any code changes, and the recosted backend carries the original structural code.
Transport a trace to the recosted realization; the constructors are definitionally the same because the machine is.
Equations
- One or more equations did not get rendered due to their size.
- (PFunctor.DynSystem.DynComputation.QuantitativeRealization.ExecutionTrace.nil x✝).recost = PFunctor.DynSystem.DynComputation.QuantitativeRealization.ExecutionTrace.nil x✝
Instances For
The transported trace, ascribed to the recosted realization's own initial state so that component lemmas match syntactically.
Equations
- R.recostTrace input trace = trace.recost
Instances For
Visible queries do not see the cost function.
Boundary traffic does not see the cost function.
Peak state size does not see the cost function.
Peak head size does not see the cost function.
Only work moves: under the zero charge every prefix charges zero work.
Restore the original charge annotations on a trace.
Equations
- One or more equations did not get rendered due to their size.
- (PFunctor.DynSystem.DynComputation.QuantitativeRealization.ExecutionTrace.nil x✝).restore = PFunctor.DynSystem.DynComputation.QuantitativeRealization.ExecutionTrace.nil x✝
Instances For
Recosting preserves the set of allowed response prefixes.
Restoring charge annotations preserves allowed response prefixes.
Pointwise smaller local charges give smaller prefix work.
Pointwise smaller local charges preserve the whole resource inequality.
A run bound survives a decrease of local work charges, including the zero charge.