Encodings of circuits with unbounded fan-in #
An operation of the unbounded fan-in basis is written as a number in unary: 0 for negation,
2 m + 1 for the conjunction of m arguments and 2 m + 2 for their disjunction
(Unbounded.Op.toNat). Circuits are then encoded by the encoding of circuits over an arbitrary
signature (Cslib.Circuits.Circuit.encCircuit): the number of inputs in unary, the gates in program
order with wire numbers in binary, and the output wires. The arity of a gate is written in unary,
but a gate of a circuit lists as many wires as its arity, so the encoding of a circuit is at most a
constant factor longer than with the arity in binary.
Main definitions #
Cslib.Circuits.Boolean.Unbounded.Op.toNat,Cslib.Circuits.Boolean.Unbounded.encOp: the operations in unary.Cslib.Circuits.Boolean.Unbounded.encCircuit: circuits over the unbounded fan-in basis.Cslib.Circuits.Boolean.Unbounded.ExtOp.toNat,Cslib.Circuits.Boolean.Unbounded.encExtOp,Cslib.Circuits.Boolean.Unbounded.encExtCircuit: unary operation encoding and binary circuit encoding for the extended unbounded fan-in basis (Unbounded.extSignature).
Main results #
Cslib.Circuits.Boolean.Unbounded.Op.toNat_injective,Cslib.Circuits.Boolean.Unbounded.ExtOp.toNat_injective: the numberings are injective.Cslib.Circuits.Boolean.Unbounded.computableInPolyTime_and,Cslib.Circuits.Boolean.Unbounded.computableInPolyTime_or,Cslib.Circuits.Boolean.Unbounded.computableInPolyTime_extOp_toNat,Cslib.Circuits.Boolean.Unbounded.computableInPolyTime_extOr: polynomial-time operation encoding and decoding.
The number of an operation: 0 for negation, 2 m + 1 for the conjunction of m arguments
and 2 m + 2 for their disjunction.
The numbering Op.toNat is injective.
Binary encoding of circuits over the unbounded fan-in basis with m outputs: the number of
inputs in unary, then the gates in program order and the output wires, with wire numbers in binary
(Cslib.Circuits.Circuit.encCircuit).
Writing the conjunction of m arguments is polynomial-time from m in unary.
Writing the disjunction of m arguments is polynomial-time from m in unary.
Extended unbounded fan-in basis (ExtOp) #
The number of an extended operation: 0 for negation, 3 m + 1 for conjunction of m
arguments, 3 m + 2 for disjunction of m arguments, and 3 m + 3 for the extra gate (such as
MOD_q or MAJ) of m arguments.
The numbering ExtOp.toNat is injective.
Operations of the extended unbounded fan-in basis, encoded by their number ExtOp.toNat in
unary.
Binary encoding of circuits over the extended unbounded fan-in basis
(Unbounded.extSignature) with m outputs: the number of inputs in unary, then the gates in
program order and the output wires, with wire numbers in binary
(Cslib.Circuits.Circuit.encCircuit).
Reading the unary code number of an extended operation is polynomial-time.
Writing the disjunction of m arguments in ExtOp is polynomial-time from m in unary.