예제 #1
0
        /**
         * Create a new conjunction of clauses by taking the clauses from the
         * current conjunction and adding additional clauses to it.
         *
         * @param additionalClauses
         *            the additional clauses to be added to the existing set of
         *            clauses in order to create a new conjunction.
         * @return a new conjunction of clauses containing the existing and
         *         additional clauses passed in.
         */
        public ConjunctionOfClauses extend(ICollection <Clause> additionalClauses)
        {
            ISet <Clause> extendedClauses = CollectionFactory.CreateSet <Clause>();

            extendedClauses.AddAll(clauses);
            extendedClauses.AddAll(additionalClauses);

            ConjunctionOfClauses result = new ConjunctionOfClauses(extendedClauses);

            return(result);
        }
예제 #2
0
        public override bool Equals(object othObj)
        {
            if (null == othObj)
            {
                return(false);
            }
            if (this == othObj)
            {
                return(true);
            }
            if (!(othObj is ConjunctionOfClauses))
            {
                return(false);
            }
            ConjunctionOfClauses othConjunctionOfClauses = (ConjunctionOfClauses)othObj;

            return(othConjunctionOfClauses.clauses.Equals(this.clauses));
        }