The space of the Tree Evaluation read machine #
On the encoding of an instance of value length ℓ and height H, the space budget of every state
that Cslib.TreeEval.Reader.machine reaches is O((ℓ + H + 1) · log (ℓ + 2)): residues
below the prime p ≤ 4ℓ + 2 have O(log (ℓ + 2)) bits. The registers and the sums hold ℓ
of them, the stack holds at most H frames with a residue each, and the counters have
O(ℓ + H + 1) bits.
Main definitions #
Cslib.TreeEval.Reader.spaceBound: the bound(ℓ + H + 1) · (|ℓ| + 1), with|ℓ|the length ofℓin binary.
Main results #
Cslib.TreeEval.Reader.stateBudget_le: the budget of every state reached isO(spaceBound ℓ H).
References #
- J. Cook and I. Mertz, Tree Evaluation is in Space O(log n · log log n)
- O. Goldreich, On the Cook–Mertz Tree Evaluation procedure, Algorithm 1, which the machine runs.
The bounds on the components of a state that satisfies the invariant.
Bound on the value length
ℓ.Bound on the tree height.
Binary length bound on the prime modulus
p.- regs (r : Fin 3) : (s.regs.get r).length ≤ ℓ ∧ ((Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) (s.regs.get r)).length ≤ ℓ * (2 * ((Turing.MultiTapeTM.encNat ℓ).length + 3) + 1)
Length and encoded-word bounds on each of the three registers.
Stack depth bound.
- rounds (fr : Iter.Frame) : fr ∈ s.stack → (Turing.MultiTapeTM.encNat fr.round).length ≤ (Turing.MultiTapeTM.encNat ℓ).length + 3
Binary length bound on the round counter of each frame in the stack.
- n₁ : (Turing.MultiTapeTM.encNat s.ctl.toTuple.n₁).length ≤ (Turing.MultiTapeTM.encNat ℓ).length + H + 3 * ℓ + 4
Binary length bound on the first control counter.
Binary length bound on the second control counter.
- acc : s.ctl.toTuple.acc.length ≤ ℓ ∧ ((Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) s.ctl.toTuple.acc).length ≤ ℓ * (2 * ((Turing.MultiTapeTM.encNat ℓ).length + 3) + 1)
Length and encoded-word bounds on the control accumulator list.
The budget of a state within the space bound.