The approximation method #
A local approximation scheme compares a circuit evaluated exactly with the same circuit evaluated
in an approximate interpretation, on a finite space of samples. It gives, for every gate, a finite
set of samples on which replacing the exact operation by the approximate one may go wrong, of
bounded size. Evaluating the circuit approximately, the approximate value of every wire is then
correct on every sample outside the union of the exception sets of the gates (program_correct),
and so a circuit computing a target fails on at most as many samples as the total cost of its
gates (card_failures_le_cost). Each gate is charged once, however often its value is reused.
Correctness is a relation between exact values, so that it can be one-sided, as in Razborov's method of approximations for monotone circuits Jukna, Chapter 9.
Main definitions #
Cslib.Circuits.Approximation.Scheme: a local approximation scheme.Cslib.Circuits.Approximation.Scheme.programExceptions: the exceptions of all gates.Cslib.Circuits.Approximation.Scheme.failures: the samples on which an approximate value is wrong.
Main results #
Cslib.Circuits.Approximation.Scheme.program_correct: the approximate values are correct away from the exceptions.Cslib.Circuits.Approximation.Scheme.card_failures_le_cost: the number of failures is at most the total cost.
References #
A local approximation scheme for the exact interpretation exact by the approximate
interpretation approx, on samples Sample: decode a s reads an approximate value a on the
sample s, the exact circuit inputs on a sample are exactInput s, and the approximate ones are
approxInput.
- relation : U → U → Prop
Correctness of a decoded approximate value with respect to an exact value.
- map_relation (op : σ.Op) (u v : Fin (σ.Arity op) → U) : (∀ (i : Fin (σ.Arity op)), self.relation (u i) (v i)) → self.relation (exact op u) (exact op v)
The exact operations preserve correctness.
The number of exceptions charged to each operation.
The samples on which applying an approximate operation to given arguments may go wrong.
The approximate inputs are correct on every sample.
- gate_correct (op : σ.Op) (a : Fin (σ.Arity op) → A) (s : Sample) : s ∉ self.exceptions op a → self.relation (exact op fun (i : Fin (σ.Arity op)) => decode (a i) s) (decode (approx op a) s)
An approximate operation is correct away from its exceptions.
Instances For
The exceptions of all gates of a program, applied to their approximate arguments.
Instances For
There are at most as many exceptions as the total cost of the gates.
Away from the exceptions, the approximate value of every wire is correct.
Away from the exceptions, every output of a circuit is correct.
The samples of samples on which the approximate value a is not correct for target.
Instances For
A circuit computing target exactly on the samples fails, approximately, only on
exceptions.
The approximation method. A circuit computing target exactly on the samples fails,
approximately, on at most as many of them as the total cost of its gates.