Determining if a relation is a function or not