List<TermEquality> rewrites = new ArrayList<TermEquality>();
rewrites.add((TermEquality) parser.parse("Plus(x, ZERO) = x"));
rewrites.add((TermEquality) parser.parse("Plus(ZERO, x) = x"));
rewrites.add((TermEquality) parser.parse("Power(x, ONE) = x"));
rewrites.add((TermEquality) parser.parse("Power(x, ZERO) = ONE"));
DefaultClauseSimplifier simplifier = new DefaultClauseSimplifier(
rewrites);
Sentence s1 = parser
.parse("((P(Plus(y,ZERO),Plus(ZERO,y)) OR P(Power(y, ONE),Power(y,ZERO))) OR P(Power(y,ZERO),Plus(y,ZERO)))");
CNFConverter cnfConverter = new CNFConverter(parser);
CNF cnf = cnfConverter.convertToCNF(s1);
Assert.assertEquals(1, cnf.getNumberOfClauses());
Clause simplified = simplifier.simplify(cnf.getConjunctionOfClauses()
.get(0));
Assert.assertEquals("[P(y,y), P(y,ONE), P(ONE,y)]",
simplified.toString());
}