distinction between undefined and invalid comparisons