Testing if a relationship is a function