Independent cumulative work allowances. These count logical operations and
slots, not bytes or elapsed time. sifts counts visited chain levels (including
terminal levels); points counts point visits; pairs counts Schreier pairs.
images counts permutation-image slots. certificates counts program and
certificate nodes, including reserved copies. storage counts auxiliary
container slots. Search nodes and refinement tests have their own counters.
- nodes : Resource
- refinements : Resource
- sifts : Resource
- certificates : Resource
- points : Resource
- pairs : Resource
- images : Resource
- storage : Resource
Instances For
Equations
- Hex.PermGroup.Execution.instBEqResource.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Cumulative producer reservations. Batches may reserve an upper bound before execution; unused reservations are retained, so surplus budget never changes the reported usage. Image slots count permutation storage separately from program nodes and traversal work.
- nodes : Nat
- refinements : Nat
- sifts : Nat
- certificates : Nat
- points : Nat
- pairs : Nat
- images : Nat
- storage : Nat
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Hex.PermGroup.Execution.instBEqWork.beq x✝¹ x✝ = false
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Equations
- w.get Hex.PermGroup.Execution.Resource.nodes = w.nodes
- w.get Hex.PermGroup.Execution.Resource.refinements = w.refinements
- w.get Hex.PermGroup.Execution.Resource.sifts = w.sifts
- w.get Hex.PermGroup.Execution.Resource.certificates = w.certificates
- w.get Hex.PermGroup.Execution.Resource.points = w.points
- w.get Hex.PermGroup.Execution.Resource.pairs = w.pairs
- w.get Hex.PermGroup.Execution.Resource.images = w.images
- w.get Hex.PermGroup.Execution.Resource.storage = w.storage
Instances For
Counters never exceed the supplied allowances. Every successful charge retains this invariant, including when a later operation exhausts its budget.
- used : Work
Instances For
Instances For
An unmet charge identifies both the exhausted resource and the counters at the stopping point. It makes no claim that the search has finished.
Instances For
Equations
Instances For
A primitive operation either returns its result and updated counters or the exact stopping point. Both alternatives retain the budget invariant.
- ok {budget : Budget} {α : Type} (value : α) (meter : Meter budget) : Measured budget α
- exhausted {budget : Budget} {α : Type} (failure : Exhausted budget) : Measured budget α
Instances For
A computation threads one meter through all nested operations. Failure retains the counters at the first reservation that could not be met.
Equations
- Hex.PermGroup.Execution.Run budget α = StateT (Hex.PermGroup.Execution.Meter budget) (Except (Hex.PermGroup.Execution.Exhausted budget)) α
Instances For
Continue an operation with an existing meter; nested work never receives fresh allowances.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reserve work before invoking the operation that uses it.
Equations
- Hex.PermGroup.Execution.reserve r k = do let meter ← get match meter.spend r k with | Except.error failure => throw failure | Except.ok meter => set meter
Instances For
Evaluate a producer from zero usage. Replay uses a separate invocation and its own allowances; it cannot consume a producer's remaining budget.
Equations
- Hex.PermGroup.Execution.run budget computation = (Hex.PermGroup.Execution.Meter.empty budget).execute computation