Determining if a relation represents a function