Examples of convertToCNF()


Examples of aima.core.logic.fol.CNFConverter.convertToCNF()

    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));
View Full Code Here

Examples of aima.core.logic.fol.CNFConverter.convertToCNF()

    FOLParser parser = new FOLParser(domain);

    CNFConverter cnfConverter = new CNFConverter(parser);
    Sentence s1 = parser.parse("((x1 = y1 AND y1 = z1) => x1 = z1)");
    Sentence s2 = parser.parse("((x2 = y2 AND F(y2) = z2) => F(x2) = z2)");
    CNF cnf1 = cnfConverter.convertToCNF(s1);
    CNF cnf2 = cnfConverter.convertToCNF(s2);

    Clause c1 = cnf1.getConjunctionOfClauses().get(0);
    Clause c2 = cnf2.getConjunctionOfClauses().get(0);
View Full Code Here

Examples of aima.core.logic.fol.CNFConverter.convertToCNF()

    CNFConverter cnfConverter = new CNFConverter(parser);
    Sentence s1 = parser.parse("((x1 = y1 AND y1 = z1) => x1 = z1)");
    Sentence s2 = parser.parse("((x2 = y2 AND F(y2) = z2) => F(x2) = z2)");
    CNF cnf1 = cnfConverter.convertToCNF(s1);
    CNF cnf2 = cnfConverter.convertToCNF(s2);

    Clause c1 = cnf1.getConjunctionOfClauses().get(0);
    Clause c2 = cnf2.getConjunctionOfClauses().get(0);

    Assert.assertFalse(c1.equals(c2));
View Full Code Here

Examples of aima.core.logic.fol.CNFConverter.convertToCNF()

    Assert.assertFalse(c1.equals(c2));

    s1 = parser.parse("((x1 = y1 AND y1 = z1) => x1 = z1)");
    s2 = parser.parse("((x2 = y2 AND y2 = z2) => x2 = z2)");
    cnf1 = cnfConverter.convertToCNF(s1);
    cnf2 = cnfConverter.convertToCNF(s2);

    c1 = cnf1.getConjunctionOfClauses().get(0);
    c2 = cnf2.getConjunctionOfClauses().get(0);
View Full Code Here

Examples of aima.core.logic.fol.CNFConverter.convertToCNF()

    Assert.assertFalse(c1.equals(c2));

    s1 = parser.parse("((x1 = y1 AND y1 = z1) => x1 = z1)");
    s2 = parser.parse("((x2 = y2 AND y2 = z2) => x2 = z2)");
    cnf1 = cnfConverter.convertToCNF(s1);
    cnf2 = cnfConverter.convertToCNF(s2);

    c1 = cnf1.getConjunctionOfClauses().get(0);
    c2 = cnf2.getConjunctionOfClauses().get(0);

    Assert.assertTrue(c1.equals(c2));
View Full Code Here

Examples of aima.core.logic.fol.CNFConverter.convertToCNF()

    Assert.assertTrue(c1.equals(c2));

    s1 = parser.parse("((x1 = y1 AND y1 = z1) => x1 = z1)");
    s2 = parser.parse("((y2 = z2 AND x2 = y2) => x2 = z2)");
    cnf1 = cnfConverter.convertToCNF(s1);
    cnf2 = cnfConverter.convertToCNF(s2);

    c1 = cnf1.getConjunctionOfClauses().get(0);
    c2 = cnf2.getConjunctionOfClauses().get(0);
View Full Code Here

Examples of aima.core.logic.fol.CNFConverter.convertToCNF()

    Assert.assertTrue(c1.equals(c2));

    s1 = parser.parse("((x1 = y1 AND y1 = z1) => x1 = z1)");
    s2 = parser.parse("((y2 = z2 AND x2 = y2) => x2 = z2)");
    cnf1 = cnfConverter.convertToCNF(s1);
    cnf2 = cnfConverter.convertToCNF(s2);

    c1 = cnf1.getConjunctionOfClauses().get(0);
    c2 = cnf2.getConjunctionOfClauses().get(0);

    Assert.assertTrue(c1.equals(c2));
View Full Code Here

Examples of aima.core.logic.fol.CNFConverter.convertToCNF()

    Assert.assertTrue(c1.equals(c2));

    s1 = parser.parse("(((x1 = y1 AND y1 = z1) AND z1 = r1) => x1 = r1)");
    s2 = parser.parse("(((x2 = y2 AND y2 = z2) AND z2 = r2) => x2 = r2)");
    cnf1 = cnfConverter.convertToCNF(s1);
    cnf2 = cnfConverter.convertToCNF(s2);

    c1 = cnf1.getConjunctionOfClauses().get(0);
    c2 = cnf2.getConjunctionOfClauses().get(0);
View Full Code Here

Examples of aima.core.logic.fol.CNFConverter.convertToCNF()

    Assert.assertTrue(c1.equals(c2));

    s1 = parser.parse("(((x1 = y1 AND y1 = z1) AND z1 = r1) => x1 = r1)");
    s2 = parser.parse("(((x2 = y2 AND y2 = z2) AND z2 = r2) => x2 = r2)");
    cnf1 = cnfConverter.convertToCNF(s1);
    cnf2 = cnfConverter.convertToCNF(s2);

    c1 = cnf1.getConjunctionOfClauses().get(0);
    c2 = cnf2.getConjunctionOfClauses().get(0);

    Assert.assertTrue(c1.equals(c2));
View Full Code Here

Examples of aima.core.logic.fol.CNFConverter.convertToCNF()

    Assert.assertTrue(c1.equals(c2));

    s1 = parser.parse("(((x1 = y1 AND y1 = z1) AND z1 = r1) => x1 = r1)");
    s2 = parser.parse("(((z2 = r2 AND y2 = z2) AND x2 = y2) => x2 = r2)");
    cnf1 = cnfConverter.convertToCNF(s1);
    cnf2 = cnfConverter.convertToCNF(s2);

    c1 = cnf1.getConjunctionOfClauses().get(0);
    c2 = cnf2.getConjunctionOfClauses().get(0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.