Circuit dependencies #
The consumers of a wire are the gates that read it. Equality of two evaluations propagates through the program outside a boundary when the gates crossing that boundary have equal values.
@[instance_reducible]
instance
Cslib.Circuits.Program.instDecidableReads
{σ : Signature}
{n g : ℕ}
(p : Program σ n g)
(gate : Fin g)
(wire : Wire n g)
:
Equations
- p.instDecidableReads gate wire = id inferInstance
theorem
Cslib.Circuits.Program.trace_eq_of_boundary
{σ : Signature}
{n g : ℕ}
{U : Type u_1}
(p : Program σ n g)
(I : Interpretation σ U)
(x y : Fin n → U)
(boundary : Set (Wire n g))
(limit : ℕ)
(hinput : ∀ (i : Fin n), Wire.input i ∉ boundary → x i = y i)
(hgate :
∀ (j : Fin g),
n + ↑j < limit →
Wire.gate j ∉ boundary →
(∃ (a : Fin (σ.Arity (p.lines j).op)), (p.lines j).wires a ∈ boundary) → p.eval I x j = p.eval I y j)
(wire : Wire n g)
(hwire : wire ∉ boundary)
(hlimit : ↑wire.index < limit)
:
Equality propagates away from a boundary if every gate crossing it agrees.