Replacing gates by constants #
The signature σ.withConstants P is σ with a constant, an operation of arity zero, for every
element of P, and I.withConstants γ interprets the constant k as γ k. Replacing gates of
a program by constants (Program.replaceGates) keeps the shape of the program: the gate g
becomes the constant k when r g = some k, and keeps its line when r g = none.
Erasing a set of special gates (Program.eraseGates) replaces each special gate g by a
constant named after g itself, in σ.withConstants {g // special g}. The inner gates of the
erased program are the inner gates that are not special (Program.innerGates_eraseGates), and
its fan-in is that of the other gates (Program.fanInAtMost_eraseGates_iff). When the constants
hold the values of the special gates in a run of the original program, the erased program has the
same run (Program.trace_eraseGates). So a program with a few gates of unbounded fan-in is a
program of bounded fan-in, once the values of those gates are given.
Main definitions #
Cslib.Circuits.Signature.withConstants,Cslib.Circuits.Interpretation.withConstants: a signature and an interpretation with constants added.Cslib.Circuits.Program.replaceGates: replacing some gates by constants.Cslib.Circuits.Program.eraseGates: replacing the special gates by constants named after them.
Main results #
Cslib.Circuits.Program.lines_eraseGates: the lines of the erased program.Cslib.Circuits.Program.innerGates_eraseGates: its inner gates are the ordinary inner gates.Cslib.Circuits.Program.fanInAtMost_eraseGates_iff: its fan-in is that of the ordinary gates.Cslib.Circuits.Program.trace_eraseGates_gate,Cslib.Circuits.Program.trace_eraseGates: its run, and the run with the true values of the special gates.
Constants #
The signature σ with a constant, an operation of arity zero, for every element of P.
Instances For
The interpretation I, with the constant k holding the value γ k.
Instances For
The line of the constant k.
Instances For
A line over σ, as a line over the signature with constants.
Instances For
Replacing gates by constants #
Erasing the special gates #
Erasing the special gates. Each special gate g becomes the constant named g, and the
other gates are kept.
Instances For
The lines of an erased program.
The arity of a gate of the erased program: zero for a special gate, and the arity of the gate otherwise.
The inner gates of the erased program are the inner gates that are not special.
The erased program has fan-in at most r exactly when every gate that is not special
does.
The value of a gate in a run of the erased program: the value of its constant for a special gate, and the gate applied to the values of its arguments otherwise.
Erasing gates keeps the run when the constants hold the values of the special gates in the run of the original program.