示例#1
0
        private BinaryRelationship GetRelationship(BoolConstraint boolConstraint)
        {
            var relationship = new ComparisonRelationship(comparisonKind, LeftOperand, RightOperand);

            return(boolConstraint == BoolConstraint.True
                ? relationship
                : relationship.Negate());
        }
        private bool Equals(ComparisonRelationship other)
        {
            if (other == null ||
                ComparisonKind != other.ComparisonKind)
            {
                return(false);
            }

            return(base.Equals(other));
        }
        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);
            }
        }
 internal bool AreOperandsSwapped(ComparisonRelationship rel)
 {
     return(LeftOperand.Equals(rel.RightOperand) && RightOperand.Equals(rel.LeftOperand));
 }