Add conditions/predicates

We use them in a different way in scarph and tabula. So it would be nice to move here the common part.