private ComparisonRelationship GetTransitiveRelationship(ComparisonRelationship other) { var comparisonKind = ComparisonKind == ComparisonKind.LessOrEqual && other.ComparisonKind == ComparisonKind.LessOrEqual ? ComparisonKind.LessOrEqual : ComparisonKind.Less; if (RightOperand.Equals(other.LeftOperand)) { return(new ComparisonRelationship(comparisonKind, LeftOperand, other.RightOperand)); } else if (LeftOperand.Equals(other.RightOperand)) { return(new ComparisonRelationship(comparisonKind, other.LeftOperand, RightOperand)); } else { return(null); } }
private BinaryRelationship GetTransitiveRelationship(EqualsRelationship other) { if (LeftOperand.Equals(other.LeftOperand)) { return(new ComparisonRelationship(ComparisonKind, other.RightOperand, RightOperand)); } else if (RightOperand.Equals(other.LeftOperand)) { return(new ComparisonRelationship(ComparisonKind, LeftOperand, other.RightOperand)); } else if (LeftOperand.Equals(other.RightOperand)) { return(new ComparisonRelationship(ComparisonKind, other.LeftOperand, RightOperand)); } else if (RightOperand.Equals(other.RightOperand)) { return(new ComparisonRelationship(ComparisonKind, LeftOperand, other.LeftOperand)); } else { return(null); } }
internal bool AreOperandsSwapped(ComparisonRelationship rel) { return(LeftOperand.Equals(rel.RightOperand) && RightOperand.Equals(rel.LeftOperand)); }