The number of nodes of a formula #
The node count of a formula is the number of nodes of its syntax tree: the operation nodes, nullary
ones such as constants included (Cslib.Circuits.Formula.size), together with the input leaves
(Cslib.Circuits.Formula.leafSize). It is the size of a formula in the usual sense of algebraic
complexity, where leaves labelled by variables and by constants both count.
Main definitions #
Cslib.Circuits.Formula.nodeCount: the number of syntax-tree nodes.
Main results #
Cslib.Circuits.Formula.nodeCount_input,Cslib.Circuits.Formula.nodeCount_gate: an input is one node, and an operation node adds one to the nodes of its arguments.Cslib.Circuits.Formula.nodeCount_pos: every formula has a node.