25.7 part 4's finite syntactic compilation: every Boolean map of k ≥ 1 input bits to o
output bits compiles, by disjunctive normal form and the NOR identities, into a straight-line NOR
program on registers, with at most o(4k+4)2^k gates (PAGE2's loose bound).
Equations
- MindFormal.A705SupportPrograms.Gate.run R g = Function.update R g.d !(R g.a || R g.b)
Instances For
Equations
Instances For
A gate list writes only registers in S.
Equations
- MindFormal.A705SupportPrograms.WritesIn gs S = ∀ g ∈ gs, S g.d
Instances For
@[reducible, inline]
Registers for k inputs: inputs 0…k-1, the constant zero k, scratch k+1…k+4.
Equations
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
The mismatch literal x_i ≠ v_i into dst, using tmp.
Equations
Instances For
The OR of the mismatch literals of indices < i, accumulated in rOr.
Equations
- One or more equations did not get rendered due to their size.
- MindFormal.A705SupportPrograms.orChain k v 0 = MindFormal.A705SupportPrograms.mismatchGates 0 (v 0) (MindFormal.A705SupportPrograms.rOr k) (MindFormal.A705SupportPrograms.rT k)
Instances For
theorem
MindFormal.A705SupportPrograms.mismatch_writes
(i : ℕ)
(vi : Bool)
(dst tmp : ℕ)
{S : ℕ → Prop}
(hd : S dst)
(ht : S tmp)
:
WritesIn (mismatchGates i vi dst tmp) S
Inputs as a register file prefix.
Equations
- MindFormal.A705SupportPrograms.inputVec k R i = R ↑i
Instances For
noncomputable def
MindFormal.A705SupportPrograms.compile
(k m : ℕ)
(Δ : (Fin k → Bool) → Fin m → Bool)
:
The compiled circuit of a Boolean map Δ on k ≥ 1 inputs: output j into register
k + 5 + j.
Equations
- MindFormal.A705SupportPrograms.compile k m Δ = List.flatMap (fun (j : Fin m) => MindFormal.A705SupportPrograms.outGates k (fun (x : Fin k → Bool) => Δ x j) (k + 5 + ↑j)) (List.finRange m)