Translating circuits and formulas between signatures #
A map of signatures φ : σ.Hom τ (Cslib.Circuits.Signature.Hom) sends each operation of σ to
an operation of τ of the same
arity. It is a map of the operation symbols, unlike cslib's Homomorphism, which maps the carriers
of two interpretations of one signature. It translates programs and circuits over σ into
programs and circuits over τ gate by gate (Circuit.mapOp), keeping the size and the depth
(Circuit.size_mapOp, Circuit.depth_mapOp), and when φ keeps the meaning of every operation
(Signature.Hom.Preserves) the translated circuit computes the same function
(Circuit.eval_mapOp). This embeds circuits over a basis into circuits over a larger basis; it is
analogous to cslib's Program.simulate with a budget of one gate for every operation. Formulas
are translated likewise (Formula.mapOp), keeping their function, size, leaves and depth.
Main definitions #
Cslib.Circuits.Line.mapOp,Cslib.Circuits.Program.mapOp,Cslib.Circuits.Circuit.mapOp,Cslib.Circuits.Formula.mapOp: the translation along a map of signatures.
Main results #
Cslib.Circuits.Circuit.eval_mapOp,Cslib.Circuits.Circuit.Computes.mapOp: the translation computes the same function along a meaning-preserving map.Cslib.Circuits.Circuit.size_mapOp,Cslib.Circuits.Circuit.depth_mapOp: size and depth are kept.Cslib.Circuits.Circuit.mapOp_id,Cslib.Circuits.Circuit.mapOp_comp: translation is functorial.Cslib.Circuits.Formula.eval_mapOp,Cslib.Circuits.Formula.depthWith_mapOp: a translated formula computes the same function, with depth measured by the costs of the images.
The program performing φ op in place of each operation op: its lines translated by
Line.mapOp.
Instances For
The translated program computes the same gate values along a meaning-preserving map.
The translated circuit computes the same function along a meaning-preserving map.
A circuit translated along a meaning-preserving map computes what the circuit computes.
Formulas #
The translated formula computes the same function along a meaning-preserving map.
A formula translated along a meaning-preserving map computes what the formula computes.