Charged origins in De Morgan programs #
origins follows zero-cost constants, identities, and negations, but
stops at an input or an AND/OR gate. It is the structural view used by gate
elimination: zero-cost chains disappear without changing the underlying
Program/Circuit representation.
Evaluate one source line symbolically from already-computed origins. fresh
names the line's own output and is used exactly for charged binary operations.
Equations
- Algebraic.DeMorgan.lineOrigin { op := Algebraic.DeMorgan.Op.false, wires := wires } values fresh = Algebraic.DeMorgan.ResidualValue.constant false
- Algebraic.DeMorgan.lineOrigin { op := Algebraic.DeMorgan.Op.true, wires := wires } values fresh = Algebraic.DeMorgan.ResidualValue.constant true
- Algebraic.DeMorgan.lineOrigin { op := Algebraic.DeMorgan.Op.id, wires := wires } values fresh = values (wires ⟨0, Algebraic.DeMorgan.lineOrigin._proof_3⟩)
- Algebraic.DeMorgan.lineOrigin { op := Algebraic.DeMorgan.Op.not, wires := wires } values fresh = (values (wires ⟨0, Algebraic.DeMorgan.lineOrigin._proof_4⟩)).negate
- Algebraic.DeMorgan.lineOrigin { op := Algebraic.DeMorgan.Op.and, wires := wires } values fresh = Algebraic.DeMorgan.ResidualValue.wire false fresh
- Algebraic.DeMorgan.lineOrigin { op := Algebraic.DeMorgan.Op.or, wires := wires } values fresh = Algebraic.DeMorgan.ResidualValue.wire false fresh
Instances For
The charged origin of each internal gate output.
Equations
- One or more equations did not get rendered due to their size.
- Algebraic.DeMorgan.gateOrigins Cslib.Circuits.Program.empty gate = gate.elim0
Instances For
The charged origin of every wire: a constant, a signed input, or a signed AND/OR-gate output. Free internal gates are followed transitively.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The origin map lifted through one appended gate.
A charged newly-appended gate is its own origin.
Last-wire spelling of origins_gateWire_last_of_charged. With inductive
wires the last wire is Wire.gate (Fin.last g), so the two statements agree.
A residual value's structural input support.
Equations
- Algebraic.DeMorgan.originSupport program (Algebraic.DeMorgan.ResidualValue.constant value_2) = ∅
- Algebraic.DeMorgan.originSupport program (Algebraic.DeMorgan.ResidualValue.wire negated wire) = program.wireSupport wire
Instances For
Following free gates preserves structural input support exactly.
An origin is an input or the output of a charged internal gate.
Equations
- One or more equations did not get rendered due to their size.
- Algebraic.DeMorgan.ValidOrigin program (Algebraic.DeMorgan.ResidualValue.constant value_1) = True
Instances For
Every value returned by Program.origins is a valid charged origin.