Circuit evaluation with stored gate values #
Program.evalVector stores gate values in an array-backed vector as it evaluates the program.
The compiler uses this implementation for Program.eval, Program.trace and Circuit.eval;
the kernel definitions and their simplification rules remain unchanged. The replacement theorems
prove equality for arbitrary signatures and interpretations, without an inhabited carrier.
The vector evaluators compute every gate, including unused gates. Separate calls may recompute
the vector; retain Circuit.evalVector explicitly when reading several outputs. Compiler
replacements apply to callers compiled with this module imported, not previously compiled callers.
This module does not certify a runtime bound.
Main definitions #
Cslib.Circuits.Program.evalVector: evaluate a program into a vector of gate values.Cslib.Circuits.Circuit.evalVector: evaluate all circuit outputs using one gate-value vector.
Main results #
Cslib.Circuits.Program.get_evalVector: the stored values agree withProgram.eval.Cslib.Circuits.Circuit.get_evalVector: the stored outputs agree withCircuit.eval.Cslib.Circuits.Circuit.eval_eq_evalImpl: proved compiler replacement for circuit evaluation.
Evaluate every gate in program order, storing its value in a vector.
Instances For
The stored gate values agree with the functional evaluator.
Compiler implementation of Program.eval using stored gate values.
Instances For
Compiler implementation of Program.trace, evaluating gates only for a gate wire.
Instances For
Evaluate all circuit outputs using one vector of stored gate values. Retain the result to read several outputs without reevaluating the program. This also evaluates unused gates.
Instances For
The stored output values agree with the functional evaluator.
Compiler implementation of Circuit.eval using stored gate values.