Examples of convertToCNF()


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);

    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 = 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

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 = y2) => x2 = r2)");
    cnf1 = cnfConverter.convertToCNF(s1);
    cnf2 = cnfConverter.convertToCNF(s2);

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

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

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

    s1 = parser
        .parse("(((((x1 = y1 AND y1 = z1) AND z1 = r1) AND r1 = q1) AND q1 = s1) => x1 = r1)");
    s2 = parser
        .parse("(((((x2 = y2 AND y2 = z2) AND z2 = r2) AND r2 = q2) AND q2 = s2) => 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()

    s1 = parser
        .parse("(((((x1 = y1 AND y1 = z1) AND z1 = r1) AND r1 = q1) AND q1 = s1) => x1 = r1)");
    s2 = parser
        .parse("(((((x2 = y2 AND y2 = z2) AND z2 = r2) AND r2 = q2) AND q2 = s2) => 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()

    s1 = parser
        .parse("((((NOT(Animal(c1920)) OR NOT(Animal(c1921))) OR NOT(Kills(c1922,c1920))) OR NOT(Kills(c1919,c1921))) OR NOT(Kills(SF0(c1922),SF0(c1919))))");
    s2 = parser
        .parse("((((NOT(Animal(c1929)) OR NOT(Animal(c1928))) OR NOT(Kills(c1927,c1929))) OR NOT(Kills(c1930,c1928))) OR NOT(Kills(SF0(c1930),SF0(c1927))))");
    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()

    s1 = parser
        .parse("((((NOT(Animal(c1920)) OR NOT(Animal(c1921))) OR NOT(Kills(c1922,c1920))) OR NOT(Kills(c1919,c1921))) OR NOT(Kills(SF0(c1922),SF0(c1919))))");
    s2 = parser
        .parse("((((NOT(Animal(c1929)) OR NOT(Animal(c1928))) OR NOT(Kills(c1927,c1929))) OR NOT(Kills(c1930,c1928))) OR NOT(Kills(SF0(c1930),SF0(c1927))))");
    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()

    Sentence origSentence = parser
        .parse("FORALL x (FORALL y (Animal(y) => Loves(x, y)) => EXISTS y Loves(y, x))");

    CNFConverter cnfConv = new CNFConverter(parser);

    CNF cnf = cnfConv.convertToCNF(origSentence);

    System.out.println("Convert '" + origSentence + "' to CNF.");
    System.out.println("CNF=" + cnf.toString());
    System.out.println("");
  }
View Full Code Here

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

    Sentence s = parser.parse(sh);

    CNFConverter cnfConv = new CNFConverter(parser);

    CNF cnf = cnfConv.convertToCNF(s);

    // Contains 9 duplicates
    Assert.assertEquals(40, cnf.getNumberOfClauses());

    Set<Clause> clauses = new HashSet<Clause>(cnf.getConjunctionOfClauses());
View Full Code Here

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

    // subsumed clauses removed
    Assert.assertEquals(8, clauses.size());

    // Ensure only the 8 correct/expected clauses remain
    Clause cl1 = cnfConv
        .convertToCNF(
            parser.parse("(NOT(will_wait(v)) OR (patrons(v,Full) OR patrons(v,Some)))"))
        .getConjunctionOfClauses().get(0);
    Clause cl2 = cnfConv
        .convertToCNF(
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.