Native generation of Boolean constant words #
The generator emits the existing two-gate constant circuit and each output's binary wire reference. The numeral is binary encoded and the requested output width is unary encoded.
Main definitions #
Cslib.Circuits.Boolean.wordConstCode: total raw constant-word circuit code.
Main results #
Cslib.Circuits.Boolean.wordConstCode_eq_bits: exact code, including truncated numerals.Cslib.Circuits.Boolean.wordConstCode_eq: agreement for a bounded numeral.Cslib.Circuits.Boolean.computableInPolyTime_wordConstCode: native generation of the full code.
Extracted from the threshold generator with the circuit and encoding unchanged. Oversized numerals generate their low bits.
The total raw code selects the numeral's low bits, including an oversized numeral.
The raw numeral code is exactly the typed constant-word circuit.
theorem Cslib.Circuits.Boolean.computableInPolyTime_wordConstCode {α : Type} {enc : α ↪ List Bool} {n w q : α → ℕ} (hn : Turing.MultiTapeTM.ComputableInPolyTime n enc Turing.MultiTapeTM.encNat) (hw : Turing.MultiTapeTM.ComputableInPolyTime w enc Turing.MultiTapeTM.encUnary) (hq : Turing.MultiTapeTM.ComputableInPolyTime q enc Turing.MultiTapeTM.encNat) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (a : α) => wordConstCode (n a) (w a) (q a)) enc encCode
Native generation charges every output reference, from unary width and a binary numeral.