/** * Eliminate the implications from a sentence. * * @param sentence * a propositional logic sentence. * @return an equivalent Sentence to the input with all implications * eliminated. */ public static Sentence eliminate(Sentence sentence) { ImplicationElimination eliminator = new ImplicationElimination(); Sentence result = sentence.accept(eliminator, null); return(result); }
/** * 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); }