Exemple #1
0
        public sealed override int GetHashCode()
        {
            var left  = LeftOperand.GetHashCode();
            var right = RightOperand.GetHashCode();

            return(EqualsRelationship.GetHashCodeMinMaxOrdered(left, right, GetType().GetHashCode()));
        }
        protected NotEqualsRelationship(SymbolicValue leftOperand, SymbolicValue rightOperand)
            : base(leftOperand, rightOperand)
        {
            this.hash = new Lazy <int>(() =>
            {
                var left  = LeftOperand.GetHashCode();
                var right = RightOperand.GetHashCode();

                return(EqualsRelationship.GetHashCodeMinMaxOrdered(left, right, GetType().GetHashCode()));
            });
        }
 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);
     }
 }