How to define a class that does not have two equivalent predicate objects?
问题 I'm trying to define class of intervals. Each interval object may have (optionally) at most two boundary points. One of them - lower boundary, and another - upper boundary. How can I restrict my class of intervals, so that lower and upper individual boundary points must be different (if provided)? 回答1: You can declare that the hasLowerBound and hasUpperBound properties are disjoint. This means that an individual with values for both cannot have the same value for both. Here's an example. I've