Exemplo n.º 1
0
        /// <summary>
        /// Returns the pairwise union (disjunction) of the enumerated pairs.
        /// </summary>
        /// <param name="predicates">given enumeration of predicate pairs</param>
        public Pair <S, T> MkOr(IEnumerable <Pair <S, T> > predicates)
        {
            var one = first.MkOr(EnumerateFirstComponents(predicates));
            var two = second.MkOr(EnumerateSecondComponents(predicates));

            if (one.Equals(first.False) && second.Equals(second.False))
            {
                return(ff);
            }
            else if (one.Equals(first.True) && second.Equals(second.True))
            {
                return(tt);
            }
            else
            {
                return(new Pair <S, T>(one, two));
            }
        }