Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Uni.Det

The universal machine is deterministic but for the guesses and the input #

In each mode, the kind of the loaded record determines the rule (Uni.nextRule), except for the rules that read an input bit or guess (Uni.IsChosen). Configurations whose heap has the nil record at 0, addresses below the counter and one record per address (Uni.WellFormed) stay so (Uni.WellFormed.step). In such a configuration a step fires exactly when its rule matches the mode and the loaded record (Uni.fire_iff), so the run sum is the weight of the forced rule times the run sum after it (Uni.sumTo_rule), or 0 if no rule matches (Uni.sumTo_stuck).

Main definitions #

Main results #

References #

The rule for a mode and the kind of the record that is loaded.

The rules that are chosen by the input or by a guess.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.nextRule_rule {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} (r : Rule supp) (hr : ¬IsChosen r) :
nextRule supp (rule θ supp r).src (rule θ supp r).lk = some r
theorem Cslib.Circuits.Arithmetic.Separation.Uni.src_ne_halt {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} (r : Rule supp) :
(rule θ supp r).src ≠ Mode.halt
@[reducible, inline]

States of the universal machine.

A heap that can be used.

def Cslib.Circuits.Arithmetic.Separation.Uni.env {supp : Finset (List Bool)} (σ : Config supp) (p q s : ℕ) :
Fin 9 → ℕ

The values of the variables.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Uni.step {A : Type} [CommRing A] {supp : Finset (List Bool)} (θ : List Bool → A) (σ : Config supp) (r : Rule supp) (p q s : ℕ) :
Config supp

The state after a step.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.WellFormed.step {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} {σ : Config supp} (hσ : WellFormed σ) (r : Rule supp) (p q s : ℕ) :
WellFormed (Uni.step θ σ r p q s)
theorem Cslib.Circuits.Arithmetic.Separation.Uni.heap_subset_step {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} (σ : Config supp) (r : Rule supp) (p q s : ℕ) :
σ.heap ⊆ (step θ σ r p q s).heap
theorem Cslib.Circuits.Arithmetic.Separation.Uni.mem_heap_step {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} (σ : Config supp) (r : Rule supp) (p q s : ℕ) :
((rule θ supp r).ak, ![σ.n + 1, env σ p q s ((rule θ supp r).af 0), env σ p q s ((rule θ supp r).af 1), env σ p q s ((rule θ supp r).af 2)]) ∈ (step θ σ r p q s).heap

The record that is allocated is in the heap.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.inp_step {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} (σ : Config supp) (r : Rule supp) (p q s : ℕ) :
(step θ σ r p q s).inp = List.drop (rule θ supp r).rd.toList.length σ.inp
theorem Cslib.Circuits.Arithmetic.Separation.Uni.fire_iff {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} {σ : Config supp} (hσ : WellFormed σ) {κ : RecKind} {p q s : ℕ} (hrec : (κ, ![σ.regs (loadReg σ.mode), p, q, s]) ∈ σ.heap) (st : (universalMachine θ supp).Step) :
Mach.Fire σ st ↔ (rule θ supp st.1).src = σ.mode ∧ (rule θ supp st.1).lk = κ ∧ (rule θ supp st.1).rd.toList <+: σ.inp ∧ st.2 = env σ p q s

The possible steps.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.sumTo_rule {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} {σ : Config supp} (hσ : WellFormed σ) {κ : RecKind} {p q s : ℕ} (hrec : (κ, ![σ.regs (loadReg σ.mode), p, q, s]) ∈ σ.heap) (r : Rule supp) (hr : nextRule supp σ.mode κ = some r) (hm : σ.mode ≠ Mode.parse) (hd : ¬(σ.mode = Mode.decode 7 ∧ κ = RecKind.nil)) (hs : (rule θ supp r).src = σ.mode) (hk : (rule θ supp r).lk = κ) {S : A} {B : ℤ} (h : (universalMachine θ supp).SumTo (step θ σ r p q s) S B) :
(universalMachine θ supp).SumTo σ ((rule θ supp r).wt * S) (B + 1)

A step that is forced.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.sumTo_stuck {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} {σ : Config supp} (hσ : WellFormed σ) {κ : RecKind} {p q s : ℕ} (hrec : (κ, ![σ.regs (loadReg σ.mode), p, q, s]) ∈ σ.heap) (hr : nextRule supp σ.mode κ = none) (hm : σ.mode ≠ Mode.parse) (hd : ¬(σ.mode = Mode.decode 7 ∧ κ = RecKind.nil)) (hz : σ.mode ≠ Mode.halt) (B : ℤ) :
(universalMachine θ supp).SumTo σ 0 B

No rule applies.