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.
theorem
Complexity.CircuitCode.RawCircuit.evalAux?_append
(first second : RawCircuit)
(wires : Array Bool)
:
Evaluating appended raw fragments is sequential evaluation with the first fragment's memo array passed to the second.
theorem
Complexity.CircuitCode.RawCircuit.topologicallyWellFormed_append
(available : ℕ)
(first second : RawCircuit)
:
TopologicallyWellFormed available (first ++ second) ↔ TopologicallyWellFormed available first ∧ TopologicallyWellFormed (available + List.length first) second
Appended fragments are topological exactly when each fragment is topological at its corresponding initial wire count.