A circuit is a standard one of among many ways of representing a
propositional logic formula. This module provides a flexible circuit type
class and various representations that admit efficient conversion to funsat
CNF.

A CCode represents a circuit element for Shared circuits. A CCode is
a flattened tree node which has been assigned a unique number in the
corresponding map inside CMaps, which indicates children, if any.

For example, CAnd i has the two children of the tuple lookup i (andMap
cmaps) assuming cmaps :: CMaps v.

Explicit tree circuit

Explicit tree representation, which is a generic description of a circuit.
This representation enables a conversion operation to any other type of
circuit. Trees evaluate from variable values at the leaves to the root.

Produces a CNF formula that is satisfiable if and only if the input circuit
is satisfiable. Note that it does not produce an equivalent CNF formula.
It is not equivalent in general because the transformation introduces
variables into the CNF which were not present as circuit inputs. (Variables
in the CNF correspond to circuit elements.) Returns equisatisfiable CNF
along with the frozen input circuit, and the mapping between the variables of
the CNF and the circuit elements.

The implementation uses the Tseitin transformation, to guarantee that the
output CNF formula is linear in the size of the circuit. Contrast this with
the naive DeMorgan-laws transformation which produces an exponential-size CNF
formula.