Facts about straight-line programs #
Upstreaming candidates for Cslib.Computability.Circuit.Program:
Program.lines_wires_eq_gate_lt: a gate reads only earlier gates.Program.FanInAtMost.arity_le: under a fan-in bound, every line has bounded arity.Program.trace_gate: the value of a gate is its operation applied to the values of its arguments.Program.UpstreamandProgram.trace_congr_of_upstream: the value of a wire depends only on the inputs upstream of it.Circuit.innerSize: the number of gates of positive arity. Gates of arity zero are constants, leaves of the circuit like its inputs.
theorem
Cslib.Circuits.Program.trace_gate
{σ : Signature}
{n s : ℕ}
{U : Type u_1}
(p : Program σ n s)
(I : Interpretation σ U)
(x : Fin n → U)
(g : Fin s)
:
The value of a gate is its operation applied to the values of its argument wires.
inductive
Cslib.Circuits.Program.Upstream
{σ : Signature}
{n s : ℕ}
(p : Program σ n s)
(w : Wire n s)
:
p.Upstream w v: the wire v is w itself or an argument of a gate upstream of w. The
value of w can depend only on the wires upstream of it.
- refl
{σ : Signature}
{n s : ℕ}
{p : Program σ n s}
{w : Wire n s}
: p.Upstream w w
Every wire is upstream of itself.
- arg
{σ : Signature}
{n s : ℕ}
{p : Program σ n s}
{w : Wire n s}
{g : Fin s}
(a : Fin (σ.Arity (p.lines g).op))
: p.Upstream w (Wire.gate g) → p.Upstream w ((p.lines g).wires a)
The arguments of a gate upstream of
ware upstream ofw.
Instances For
theorem
Cslib.Circuits.Program.trace_congr_of_upstream
{σ : Signature}
{n s : ℕ}
{U : Type u_1}
(p : Program σ n s)
(I : Interpretation σ U)
{x y : Fin n → U}
{w : Wire n s}
(h : ∀ (i : Fin n), p.Upstream w (Wire.input i) → x i = y i)
(v : Wire n s)
:
The value of a wire depends only on the inputs upstream of it.
The inner gates of a program: those of positive arity. A gate of arity zero is a constant, a leaf of the circuit like an input.