Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Uni.Top

The universal machine: input and result #

The input of the universal machine is the word of a tree z, its brackets in preorder (Interpreter.tbits). The machine reads the word and builds the tree in its heap, with a frame for every subtree that is being read (Uni.sumTo_parse), and then evaluates the formula with the code z.hd at z.tl. For a plain instance z the sum of the weights of its runs is the plain sum Interpreter.pv θ z, and the runs are short (Uni.sumTo_universalMachine).

Main definitions #

Main results #

References #

def Cslib.Circuits.Arithmetic.Separation.Uni.ParsesReturns {A : Type} [CommRing A] (θ : List Bool → A) (supp : Finset (List Bool)) (H : List (Rec RecKind)) (k : ℕ) (inp : List Bool) (o : Interpreter.Tree) (S : A) (B : ℤ) :

What happens when a tree o that has been read is returned to the frame at the address k: the run sum is S, within B steps.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.sumTo_parse {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} {S : A} (a : Interpreter.Tree) (B : ℤ) (H : List (Rec RecKind)) (k : ℕ) (σ : Config supp) (rest : List Bool) :
InMode σ Mode.parse H (Interpreter.tbits a ++ rest) → σ.regs 1 = k → ParsesReturns θ supp H k rest a S B → (universalMachine θ supp).SumTo σ S (B + 3 * ↑a.size)

Reading a tree: from the mode parse with the frame at register 1, the machine reads the word of a, builds a in the heap and returns it to the frame, in 3 * a.size steps.

The first state: the mode start₀, the empty record, and the word of z as the input.

The sum over runs that name no constants, with the factors 1, is the plain value.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.sumTo_universalMachine {A : Type} [CommRing A] {θ : List Bool → A} {supp : Finset (List Bool)} (hθ : ∀ q ∉ supp, θ q = 0) {τ : ℕ} {z : Interpreter.Tree} (h : Interpreter.Plain θ τ z) :
(universalMachine θ supp).SumTo (initState supp z) (Interpreter.pv θ z) (3 * ↑z.size + codeCost supp * ↑τ + 10)

The universal machine is exact: started at the word of a plain instance z, the sum of the weights of its accepting runs is the plain sum of z, and the runs have at most 3 * z.size + codeCost supp * τ + 10 steps.