Local approximation schemes for shared circuits #
A local approximation scheme supplies an approximate interpretation of every gate and a finite exception set on which that local replacement may be incorrect. Folding the scheme over a straight-line program unions the local exception sets. Consequently each gate is charged once, even when its value fans out to many later gates.
This is deliberately independent of polynomials, probability, and any particular circuit basis. The monotone CLIQUE application uses bounded-width DNF approximators and two different sample families with the same approximate interpretation.
A locally sound approximate interpretation on a finite sample space.
- relation : U → U → Prop
One-sided correctness relation from exact to approximate values.
- relation_trans {left middle right : U} : self.relation left middle → self.relation middle right → self.relation left right
Local and inherited correctness compose.
- interpretation_preserves (op : σ.Op) (exactArguments approxArguments : Fin (σ.Arity op) → U) : (∀ (input : Fin (σ.Arity op)), self.relation (exactArguments input) (approxArguments input)) → self.relation (exactInterpretation op exactArguments) (exactInterpretation op approxArguments)
Exact operations preserve the correctness relation pointwise.
- errorCost : OperationCost σ
Maximum number of fresh exceptions charged to an operation.
Fresh exceptions for one concrete approximate gate application.
- input_correct (sample : Sample) (input : Fin n) : self.relation (exactInput sample input) (decode (approxInput input) sample)
Approximate inputs are exact on every sample.
- gate_correct (op : σ.Op) (arguments : Fin (σ.Arity op) → A) (sample : Sample) : sample ∉ self.exceptions op arguments → self.relation (exactInterpretation op fun (input : Fin (σ.Arity op)) => decode (arguments input) sample) (decode (approxInterpretation op arguments) sample)
A local gate is exact away from its fresh exceptions.
- exceptions_card_le (op : σ.Op) (arguments : Fin (σ.Arity op) → A) : (self.exceptions op arguments).card ≤ self.errorCost op
Each fresh exception set respects its advertised operation cost.
Instances For
The approximate argument tuple supplied to the next line.
Equations
- Algebraic.Approximation.Scheme.lineArguments program line approxInterpretation approxInput = program.trace approxInterpretation approxInput ∘ line.wires
Instances For
The union of all local exception sets created by a program.
Equations
- One or more equations did not get rendered due to their size.
- scheme.programExceptions Cslib.Circuits.Program.empty = ∅
Instances For
The global exception set is bounded by the sum of local gate budgets.
Every approximate wire agrees with its exact sampled value away from the single global exception set.
A circuit output is correct on every sample outside the union of its local exceptions.
Samples on which one approximate value violates a one-sided correctness relation with a target.
Equations
- Algebraic.Approximation.Scheme.failures relation decode value target = {sample : Sample | ¬relation (target sample) (decode value sample)}
Instances For
The failure set of a correctly computed target is contained in the scheme's global exception set.
Total sampled failure is at most the sum of local approximation errors, with sharing charged once.