Evaluating a game tree with an explicit stack #
A game tree alternates a sum over the messages and a maximum over the replies. The value of a node
with n + 1 rounds to go is its leaf value plus, for every message, the largest value over the
replies of the child reached by the message and the reply; a node with no rounds to go has its leaf
value (Cslib.Complexity.GameTree.value). The messages and the replies are the first N iterates
next^[i] first of an enumeration, whose last one last recognizes, and a node is identified by
the messages and replies leading to it, the most recent first. Every value is capped at cap, so
that all numbers stay at most cap; the cap does not change values that are at most cap.
The evaluator (Cslib.Complexity.GameTree.step) is the depth-first traversal with an explicit
stack. A frame stores the current message and reply of a node, the capped sum over the earlier
messages, which starts at the leaf value, and the maximum over the earlier replies to the current
message. A node with n rounds to go returns its value to the same stack after
Cslib.Complexity.GameTree.time N n steps (Cslib.Complexity.GameTree.iterate_step_node), at
most (N + 1) ^ (2 * n + 1) (Cslib.Complexity.GameTree.time_le); the evaluation from the empty
stack then stays put (Cslib.Complexity.GameTree.iterate_step_eval). Along the way the stack holds
at most D frames, the depth of the root, each storing two iterates and two numbers at most cap
(Cslib.Complexity.GameTree.Good, Cslib.Complexity.GameTree.good_iterate_step). Thus the retained
state has size polynomial in D, the size of the iterates and the size of cap. Overall time and
space bounds also require resource bounds for the leaf, successor and final-element callbacks;
the step count alone does not bound their cost. The certified specialization in IP/PSPACE
supplies these bounds for evaluating the optimal prover in the proof of IP ⊆ PSPACE
Arora and Barak, Chapter 8.
Main definitions #
Cslib.Complexity.GameTree.value: the value of a node.Cslib.Complexity.GameTree.step: one step of the evaluator.Cslib.Complexity.GameTree.time: the number of steps of an evaluation.Cslib.Complexity.GameTree.Good: the invariant bounding the states.
Main results #
Cslib.Complexity.GameTree.iterate_step_node: a node returns its value.Cslib.Complexity.GameTree.iterate_step_eval: the evaluation from the empty stack.Cslib.Complexity.GameTree.time_le: the number of steps.Cslib.Complexity.GameTree.good_iterate_step: the states stay small.
References #
A frame: the current message and reply, the capped sum over the earlier messages, and the maximum over the earlier replies to the current message.
Instances For
One step of the evaluator. Without a value to return, a node at depth D returns its leaf
value, and any other node pushes a frame for its first message and reply. A value returned into a
frame updates the maximum, and moves on to the next reply; after the last reply, it adds the
maximum to the sum and moves on to the next message; after the last message, it pops the frame and
returns the sum. A value returned into the empty stack is a fixed point.
Instances For
The number of steps to evaluate a node with n rounds to go.
Instances For
Correctness #
A node returns its value after time N n steps, to the same stack.
The evaluation from the empty stack returns the value of the root within time N D steps
and stays put afterwards.
Bounds on the states #
The invariant of the evaluation: at most D frames, whose messages and replies satisfy P,
and all numbers at most cap.
At most
Dframes.The frames store messages and replies satisfying
P, and numbers at mostcap.The returned value is at most
cap.
Instances For
The states stay small: every state of the evaluation from the empty stack satisfies the invariant.