Predicates for working with Prolog terms