Documentation

CslibFrontier.Computability.Circuit.Boolean.Unbounded.Encoding

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 #

Main results #

The number of an operation: 0 for negation, 2 m + 1 for the conjunction of m arguments and 2 m + 2 for their disjunction.

Operations of the unbounded fan-in basis, encoded by their number Op.toNat in unary.

@[reducible, inline]

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.

Operations of the extended unbounded fan-in basis, encoded by their number ExtOp.toNat in unary.

@[reducible, inline]

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).

Writing the disjunction of m arguments in ExtOp is polynomial-time from m in unary.