Adds algorithm to check if a tree is an acceptable parse