Hmm I should add that although rarer, I think you can generate an invalid hierarchy via making it impossible to simultaneously satisfy both monotonicity and local precedence order at the same time. Example:
C isa (D, E)
B isa (C, D, E)
IF A isa (B, C), A's C3 lin is ABCDE
IF A isa (C, B), A's C3 lin is invalid
The issue in the second case is that C3 gaurantees preservation of local precedence order (in other words, the ordering of @ISA won't be violated), so C3 requires on the one hand that C come before B due to the local precedence in A's @ISA, but due to B inheriting C this would violate monotonicity. (CB at the start of A's linearization vs BC at the start of B's linearizaton).
|