Fix bitrot.
Allow the user to generate only terms satisfying a predicate (for Dan)