Package daikon.diff

Class ConsequentSortComparator

  • All Implemented Interfaces:
    Comparator<Invariant>

    public class ConsequentSortComparator
    extends Object
    implements Comparator<Invariant>
    Comparator for sorting invariants. If an invariant is an implication, its consequent is used instead of the whole invariant. If the consequents of two invariants are equal, the predicates are compared. The predicates and consequents themselves are compared using the Comparator c passed to the constructor. Some examples:
     this.compare(A⇒B, A⇒C) == c.compare(B, C)
     this.compare(B, A⇒C) == c.compare(B, C)
     this.compare(B, C) == c.compare(B, C)
     this.compare(A⇒C, B⇒C) == c.compare(A, B)