Layers of circuit codes #
A layer is a list of gates that read only the wires computed before it. Evaluating a layer
appends the value of each of its gates, computed from the values before the layer
(evalCode_layer), and in the depth interpretation its values are at most the largest value before
it plus the largest cost of its operations (le_of_mem_evalCode_depth_layer). So a circuit given
as a code of layers has a depth with costs bounded by summing the costs of the layers
(Circuit.depthWith_le_of_evalCode).
Main results #
Cslib.Circuits.evalCode_layer: the values of a layer.Cslib.Circuits.le_of_mem_evalCode_depth_layer: depths after a layer.Cslib.Circuits.Circuit.isCodeFrom_code,Cslib.Circuits.Circuit.toNat_outputs_lt: the code of a circuit is a code from its inputs, and its outputs are wires of it.Cslib.Circuits.getD_evalCode_depth_le,Cslib.Circuits.cost_le_getD_evalCode_depth: in the depth interpretation, a gate is deeper than its arguments, and at least as deep as its cost.Cslib.Circuits.Circuit.getD_evalCode_depthInterpretation: the depth with costs of an output is the value of its wire in the depth interpretation.Cslib.Circuits.Circuit.depthWith_le_of_evalCode: a bound on all the depths computed by the code of a circuit bounds its depth with costs.
These are original implementation lemmas for the existing circuit semantics.
A list of gates, each with as many arguments as its arity and reading only the n inputs and
the k gates before the list, is a code from gate k.
Evaluating a layer. When every gate of gates reads only wires below the length of x,
evaluating gates from x appends the value of each gate on the wires of x.
Depths after a layer. In the depth interpretation, if the values of x are at most D
and every gate of the layer gates has cost at most c, the values after the layer are at most
D + c.
The gate list of a circuit is a code from its inputs.
In the depth interpretation, a gate is deeper than each of its arguments by its cost.
Depths through the code. The depth with costs of the wire of output j is the value at
its number of the code of the circuit evaluated in the depth interpretation from zero inputs.
Depth from the code. If every value that the code of a circuit computes in the depth
interpretation from zero inputs is at most D, the circuit has depth at most D with costs.