Charges restricted to reachable results and to the calls made #
Sequencing laws need the continuation only where x can return. IsChargeBound.bind_of_le_supp
and IsChargeBound.bind_supp take the continuation bound on the structural support x.supp, and
costWith_le_cost_add_supp / cost_bind_le_supp restrict the worst-case cost of the
continuation the same way.
x.CallsIn S says that every call of x is at a position in S. Under it, charges and handlers
matter only on S:
IsChargeBound.congr_chargeandcostWith_congr_charge: charges agreeing onSgive the same bound and cost;liftM_congr_of_callsIn: handlers agreeing onSgive the same run;IsChargeBound.liftM_of_callsIn: free-handler transfer with step certificates only onS.
callsIn_iff_isChargeBound reads CallsIn as the zero budget for the indicator of the excluded
positions.
Restricted sequencing #
Sequencing on reachable results. If x stays within L ≤ B and the continuation at
every result x can return stays within B from any amount at most L, then x >>= f stays
within B.
Sequencing at an invariant. If x stays within L ≤ B, every result of x satisfies
I, and the continuation at every result satisfying I stays within B from any amount at most
L, then x >>= f stays within B. Reachable results are the case I := (· ∈ x.supp)
(IsChargeBound.bind_of_le_supp).
Budgets add under sequencing at an invariant.
Budgets add under sequencing on reachable results.
The leaf costs split off over reachable results only.
The cost of a sequence is at most the cost of the first part plus the worst continuation at a reachable result.
Provenance #
CallsIn is the zero budget for the indicator of the positions outside S.
A program calls only in the set of calls occurring in it; it is the least such set
(callsIn_iff_forall_mayCall).
Charges agreeing on the positions a program calls give the same cost.
Free-handler transfer on the positions called. Step certificates are needed only on
S.