Computing the depths of a Boolean circuit #
The ordinary code evaluator, interpreted over depths with unit gate cost, computes one depth for every input and gate. Missing arguments and unavailable wires read zero, so the computation is total even on malformed code. Each gate increases the largest available depth by at most one; the bounds below therefore require no well-formedness premise.
The circuit depth takes the maximum only over the designated outputs. Unused gates, including
ones deeper than every output, do not change it. Native polynomial-time certificates, with
binary wire indices and unary computed depths, are in Boolean.DepthTime.PolyTime.
Main definitions #
Cslib.Circuits.Boolean.wireDepthsCode: the input and gate depths, in wire-number order.Cslib.Circuits.Boolean.depthCode: the maximum designated-output depth.
Main results #
Cslib.Circuits.Boolean.wireDepthsCode_getD_toNat: agreement with typed program depths.Cslib.Circuits.Boolean.depthCode_code: agreement with typed circuit depth.Cslib.Circuits.Boolean.wireDepthsCode_le,Cslib.Circuits.Boolean.depthCode_le: depths are bounded by the number of gates, even for malformed code.
References #
The raw table of a typed program lists its zero input depths and then its gate depths.
Looking up a typed wire in the raw table gives its program depth.