The Tree Evaluation problem #
An instance of Tree Evaluation with height h and value length ℓ is a perfect binary tree
with every leaf at depth h. Its leaves carry ℓ-bit values and its internal nodes carry
arbitrary gates
{0,1}^ℓ × {0,1}^ℓ → {0,1}^ℓ. The value of a node is its gate applied to the values of its two
children; the answer is the value of the root.
We follow Goldreich's parametrization by the value length ℓ, rather than by the alphabet size
k = 2^ℓ, so that values are bit strings Fin ℓ → Bool without rounding.
Main definitions #
Cslib.TreeEval.Tree ℓ h: a Tree Evaluation instance of heighthand value lengthℓ.Cslib.TreeEval.Tree.eval: the value of the root.Cslib.TreeEval.Tree.nodeAt: the node at a path from the root.
References #
- S. Cook, P. McKenzie, D. Wehr, M. Braverman and R. Santhanam, Pebbles and branching programs for tree evaluation introduce the problem.
- O. Goldreich, On the Cook–Mertz Tree Evaluation procedure uses the parametrization by value length.
A gate on ℓ-bit values: a function of the values of the two children.
Instances For
A Tree Evaluation instance: a perfect binary tree with all leaves at depth h, carrying
ℓ-bit values, and internal nodes carrying gates on pairs of ℓ-bit values.
- leaf {ℓ : ℕ} (v : Fin ℓ → Bool) : Tree ℓ 0
A leaf carrying a value.
- node {ℓ h : ℕ} (f : Gate ℓ) (l r : Tree ℓ h) : Tree ℓ (h + 1)
An internal node carrying a gate, with its left and right subtrees.