Restrict function calls in pattern predicates