Gate equations for shared real arithmetic circuits #
Each gate contributes one equation relating its value to its argument wires. The coordinates are the program inputs followed by the gates in program order. The equations uniquely determine the gate values once the input coordinates are fixed. Their terms refer directly to shared wires.
This adapts the gate equations and trace correctness of
LeanCanny.CountingHierarchy.RealCircuit at
970f28a5ecefc1327402ade16c068aa4b1b2c183 to the CSLib circuit API.
The gate coordinate minus its operation on its immediate argument wires.
The simultaneous zeros of the shallow gate equations are exactly the program traces with the indicated input coordinates.
Conjoin one shallow equation per gate, in program order.
With the inputs fixed, the unique extension satisfying the gate guard is the program's real evaluation.
A matrix is satisfiable on the circuit's real executions exactly when it is satisfiable together with the gate guard.
Quantify the circuit's gate values under the gate guard. The existential coordinates stay first and all gate coordinates join the universal block.
On every fixed existential assignment, the guarded matrix is true for all universal and gate coordinates exactly when the matrix holds on every real execution.