Tree Evaluation in small space #
Cook and Mertz: Tree Evaluation of value length ℓ and height H is tidily computable on
multi-tape Turing machines in space O((ℓ + H + 1) · log (ℓ + 2) + log (n + 2)), where n
is the length of the encoded instance. On nontrivial instances (1 ≤ ℓ and 1 ≤ H), both 2 ^ ℓ
and 2 ^ H are at most n, so ℓ, H < |n| and |ℓ| ≤ ||n|| (writing |m| for the binary length
of m), which yields the headline input-size space bound O(|n| · ||n||) = O(log n · log log n).
The step machine simulating the read machine Cslib.TreeEval.Reader.machine is tidy, its run on an
instance halts with the value of the tree, and its states along the run, which follow the states
of the read machine together with the position of the head, stay within the space bound.
Main definitions #
Cslib.TreeEval.NontrivialInstance: Tree Evaluation instances with1 ≤ ℓand1 ≤ H.Cslib.TreeEval.encNontrivialInstance: the encoding of nontrivial instances.
Main results #
Cslib.TreeEval.computableTidilyInSpace_eval: Tree Evaluation in spaceO(spaceBound ℓ H + log (n + 2)).Cslib.TreeEval.spaceBound_add_length_le_log_mul_log_log: on nontrivial instances,spaceBound ℓ H + |n + 1| ≤ 6 · |n| · ||n||.Cslib.TreeEval.computableTidilyInSpace_eval_log_mul_log_log: Tree Evaluation on nontrivial instances in spaceO(|n| · ||n||) = O(log n · log log n).
References #
A nontrivial Tree Evaluation instance: both the value length ℓ and the height H are
positive.
Instances For
The encoding of nontrivial Tree Evaluation instances.
Instances For
Tree Evaluation in small space (Cook–Mertz): the value of the tree of an instance of value
length ℓ and height H is tidily computable from its encoding in space
O((ℓ + H + 1) · log (ℓ + 2) + log (n + 2)).
On a nontrivial instance (1 ≤ ℓ and 1 ≤ H), the parameter space bound plus the head-counter
length is at most 6 · |n| · ||n||, where n = (encInstance I).length and
|m| = (encNat m).length.
Tree Evaluation in space O(log n · log log n) (Cook–Mertz): on nontrivial instances
(1 ≤ ℓ and 1 ≤ H), the value of the tree is tidily computable from its encoding in space
O(|n| · ||n||), where n is the length of the encoded instance and |m| = (encNat m).length.