Circuit codes for constant-size gate replacements #
When each gate is replaced by a block of the same positive size and each block returns its last gate, the location of every simulated wire follows from its original wire number. The simulating program concatenates the replacement blocks in source order and substitutes the relocated source wires for each block's inputs.
Main definitions #
Cslib.Circuits.Circuit.simulateWireNumbergives the wire number after gate replacement.
Main results #
Cslib.Circuits.Program.toNat_simulateRenaming_uniformlocates every original wire in the replacement program.Cslib.Circuits.Circuit.code_simulate_uniformgives the gate list and output wires of the simulating circuit. Only operations occurring in the source circuit need have the given size.
Relocate a wire when each source gate becomes a block of B gates returning its last gate.
An original program wire is relocated to its fixed block position in the simulation.
Replace each gate by a block of B gates whose sole output is the block's last gate.
Input references in a block read the corresponding relocated source wire. Internal references
read earlier gates of that same block. Output references use the same relocation as input
references. Operations absent from the circuit can have arbitrary implementations.