Template Function sequant::subtree_any

Function Documentation

template<typename Node, typename Pred>
bool sequant::subtree_any(Node const &n, Pred const &pred)

Note

Iterative (an explicit stack), not recursive: this is called on whole values, a forest root included (ordered_executor.hpp’s volatile_of resolves a value id to its node and asks this), and a residual reaches the evaluator as a single in-place Sum tree whose left spine is as deep as the term count. Pushing the right child before the left one keeps the visit order the recursion’s pre-order, so the short-circuit sees the same first satisfying node.

Returns:

whether any node in the subtree rooted at n satisfies pred.