Semantic circuit rewiring #
The circuit model stores wires as ANFs and records availability by membership
in a wire space. Consequently a basis replacement at one gate can leave all
later factor ANFs unchanged: only their membership proofs have to be
transported across the equality of wire spaces. This file implements that
transport as an actual Circuit, rather than only as a flag-level statement.
Replace one gate output in a circuit output sequence.
Equations
- UnrestrictedBooleanMul.N4.updateGate C j t = Function.update C.gate j t
Instances For
Replace a first-entry gate by a direct affine product while preserving all later gate functions and the final wire space.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Commute a gate whose two factors are affine one position toward the front. No earlier gate can depend on it, and after the pair the wire space is unchanged.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A non-affine final wire has a first gate at which it enters the flag.
Move a direct affine-product gate left to any earlier position by adjacent legal commutations. Gates strictly before the destination are untouched.
Promote a rational target direction which is absent from a chosen prefix to a direct affine-product gate at the end of that prefix. The transformation preserves the final wire space and every earlier gate.