added parse function for predicate logic