示例#1
0
        /**
         * Eliminate the biconditionals from a sentence.
         *
         * @param sentence
         *            a propositional logic sentence.
         * @return an equivalent Sentence to the input with all biconditionals
         *         eliminated.
         */
        public static Sentence eliminate(Sentence sentence)
        {
            BiconditionalElimination eliminator = new BiconditionalElimination();

            Sentence result = sentence.accept(eliminator, null);

            return(result);
        }
示例#2
0
        /**
         * Returns the specified sentence in its logically equivalent negation
         * normal form.
         *
         * @param s
         *            a propositional logic sentence
         *
         * @return the input sentence converted to it logically equivalent
         *         negation normal form.
         */
        public static Sentence convert(Sentence s)
        {
            Sentence result = null;

            Sentence biconditionalsRemoved = BiconditionalElimination.eliminate(s);
            Sentence implicationsRemoved   = ImplicationElimination.eliminate(biconditionalsRemoved);
            Sentence notsMovedIn           = MoveNotInwards.moveNotsInward(implicationsRemoved);

            result = notsMovedIn;

            return(result);
        }