Simultaneous circuit synthesis #
Synthesis I sources targets cost bounds the number of additional gates needed to compute
targets from sources under an interpretation I. Every function already available in the
starting program remains available, so successive constructions can share intermediate results.
The signature and its carrier are arbitrary; neither needs to be finite or decidable.
The core rules compose bounds, combine finite families, and apply operations of the signature,
either to functions that are already available or to functions synthesized in turn. Composition
keeps everything built along the way available to later steps. The fold rules accept a bound
for combining two arguments, which may itself use several gates. Ordered families allow each
member to use all preceding members, with the total budget given by the sum of the step budgets.
Synthesis.exists_circuit_outputs selects any tuple of outputs without adding gates;
Synthesis.exists_circuit specializes this to a single output.
The functions computed by the wires of p, whether input wires or internal
gates.
Equations
- Cslib.Circuits.available I p = Set.range (p.wireFunction I)
Instances For
A function is available exactly when some wire computes it pointwise.
The input projections are available in every program.
Synthesis I sources targets cost says that targets can be computed from sources
using at most cost additional gates, without losing anything already computed.
Precisely: for every program p₁ on whose wires every function in sources is available,
there is a program p₂ such that
p₂has at mostcostmore gates thanp₁,- every function available in
p₁is still available inp₂, and - every function in
targetsis available inp₂.
Quantifying over an arbitrary starting program, rather than the empty one, is what lets
constructions share intermediate results: Synthesis.comp adds budgets because the second
construction may reuse wires built by the first.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Available functions require no additional gates.
Enlarge the source family, narrow the target family, or increase the budget.
Successive constructions add their gate budgets. The second construction may use the targets of the first, and both target families remain available.
Compose an indexed sequence of syntheses, adding their gate budgets.
Synthesize a family in order, allowing each function to use all preceding ones.
Combine two target families, preserving the first while constructing the second.
Combine a finite family of target sets, retaining all earlier results.
Combine target sets indexed by a finite type.
Simultaneously synthesize an indexed finite family of functions.
Synthesize every argument, then apply an operation with one further gate.
A nullary operation supplies its interpreted constant with one gate.
Feed a synthesized function to every argument of an operation, using one further gate. In particular, this applies a unary operation.
Feed f to argument zero and g to the remaining arguments, using one further gate.
For a binary operation, these are its two arguments.
Apply a synthesis bound to two previously synthesized arguments. The combining construction can use several gates and can reuse either argument.
Fold an ordered list of synthesized functions. No algebraic laws are needed for the combining operation. The seed and the combining construction have their own gate budgets.
Fold a finite set of synthesized functions with a commutative associative operation. The seed need not be an identity or a constant, and the combining construction may use several gates.
Select a tuple of outputs from a synthesis bound. Selecting outputs, including repeated outputs or none at all, requires no additional gates.
Each program gate can be synthesized from the inputs and preceding gates.
Rebuild a program from gatewise synthesis bounds, retaining every wire function.