parses constraints to create a predicate for filtering