def is_prepreterminal(node):
    """Returns True iff all children of this node are preterminals."""
    subtrees = node.subtrees()
    return len(subtrees) > 0 and \
        all(subtree.is_preterminal() for subtree in subtrees)