Appendable raw-circuit fragments #
Primitive copy/constant gates and generic composition laws for building a
CircuitCode.RawCircuit in successive topologically ordered fragments.
Evaluation passes the memo array from one fragment to the next, and successful
evaluation preserves every previously available wire.
Evaluating appended raw fragments is sequential evaluation with the first fragment's memo array passed to the second.
Appending a copy gate to a nonempty circuit maps its original output by the gate's optional negation.
Output-match extension serialization consists of the incremented gate count, the original gate stream, and one final copy gate.
An output-match extension returns true exactly when the original nonempty circuit returns the selected bit.
Exact decoding turns an output-match extension into a true-evaluation test at the declared input width.
Live-bit output-match extension serialization consists of the incremented
gate count, the original gate stream, and two final copy gates. The live
expected bit occurs positively in the first new gate.
A live-bit output-match extension returns true exactly when the original nonempty circuit returns the selected bit.
Exact decoding turns a live-bit output-match extension into a true-evaluation test at the declared input width.
Appended fragments are topological exactly when each fragment is topological at its corresponding initial wire count.