Examples of binaryResolvents()


Examples of aima.core.logic.fol.kb.data.Clause.binaryResolvents()

    c1.addPositiveLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    c2.addNegativeLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    Assert.assertNotNull(c1.binaryResolvents(c2));
    Assert.assertEquals(1, c1.binaryResolvents(c2).size());
    Assert.assertTrue(c1.binaryResolvents(c2).iterator().next().isEmpty());
    Assert.assertNotNull(c2.binaryResolvents(c1));
    Assert.assertEquals(1, c2.binaryResolvents(c1).size());
    Assert.assertTrue(c2.binaryResolvents(c1).iterator().next().isEmpty());

    // Ensure that two clauses that have two complementaries
    // resolve with two resolvents
View Full Code Here

Examples of aima.core.logic.fol.kb.data.Clause.binaryResolvents()

    c2.addNegativeLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    Assert.assertNotNull(c1.binaryResolvents(c2));
    Assert.assertEquals(1, c1.binaryResolvents(c2).size());
    Assert.assertTrue(c1.binaryResolvents(c2).iterator().next().isEmpty());
    Assert.assertNotNull(c2.binaryResolvents(c1));
    Assert.assertEquals(1, c2.binaryResolvents(c1).size());
    Assert.assertTrue(c2.binaryResolvents(c1).iterator().next().isEmpty());

    // Ensure that two clauses that have two complementaries
    // resolve with two resolvents
    c1.addPositiveLiteral(new Predicate("Pred1", new ArrayList<Term>()));
View Full Code Here

Examples of aima.core.logic.fol.kb.data.Clause.binaryResolvents()

    Assert.assertNotNull(c1.binaryResolvents(c2));
    Assert.assertEquals(1, c1.binaryResolvents(c2).size());
    Assert.assertTrue(c1.binaryResolvents(c2).iterator().next().isEmpty());
    Assert.assertNotNull(c2.binaryResolvents(c1));
    Assert.assertEquals(1, c2.binaryResolvents(c1).size());
    Assert.assertTrue(c2.binaryResolvents(c1).iterator().next().isEmpty());

    // Ensure that two clauses that have two complementaries
    // resolve with two resolvents
    c1.addPositiveLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    c2.addNegativeLiteral(new Predicate("Pred1", new ArrayList<Term>()));
View Full Code Here

Examples of aima.core.logic.fol.kb.data.Clause.binaryResolvents()

    c2.addNegativeLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    c1.addPositiveLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    c2.addNegativeLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertNotNull(c1.binaryResolvents(c2));
    Assert.assertEquals(2, c1.binaryResolvents(c2).size());
    Assert.assertNotNull(c2.binaryResolvents(c1));
    Assert.assertEquals(2, c2.binaryResolvents(c1).size());

    // Ensure two clauses that factor are not
    // considered resolved
    c1 = new Clause();
View Full Code Here

Examples of aima.core.logic.fol.kb.data.Clause.binaryResolvents()

    c1.addPositiveLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    c2.addNegativeLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertNotNull(c1.binaryResolvents(c2));
    Assert.assertEquals(2, c1.binaryResolvents(c2).size());
    Assert.assertNotNull(c2.binaryResolvents(c1));
    Assert.assertEquals(2, c2.binaryResolvents(c1).size());

    // Ensure two clauses that factor are not
    // considered resolved
    c1 = new Clause();
    c2 = new Clause();
View Full Code Here

Examples of aima.core.logic.fol.kb.data.Clause.binaryResolvents()

    c1.addNegativeLiteral(new Predicate("Pred4", new ArrayList<Term>()));
    c2.addPositiveLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    c2.addNegativeLiteral(new Predicate("Pred4", new ArrayList<Term>()));
    Assert.assertNotNull(c1.binaryResolvents(c2));
    Assert.assertEquals(0, c1.binaryResolvents(c2).size());
    Assert.assertNotNull(c2.binaryResolvents(c1));
    Assert.assertEquals(0, c2.binaryResolvents(c1).size());

    // Ensure the resolvent is a subset of the originals
    c1 = new Clause();
    c2 = new Clause();
View Full Code Here

Examples of aima.core.logic.fol.kb.data.Clause.binaryResolvents()

    c2.addPositiveLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    c2.addNegativeLiteral(new Predicate("Pred4", new ArrayList<Term>()));
    Assert.assertNotNull(c1.binaryResolvents(c2));
    Assert.assertEquals(0, c1.binaryResolvents(c2).size());
    Assert.assertNotNull(c2.binaryResolvents(c1));
    Assert.assertEquals(0, c2.binaryResolvents(c1).size());

    // Ensure the resolvent is a subset of the originals
    c1 = new Clause();
    c2 = new Clause();
    c1.addPositiveLiteral(new Predicate("Pred1", new ArrayList<Term>()));
View Full Code Here

Examples of aima.core.logic.fol.kb.data.Clause.binaryResolvents()

    c1.addPositiveLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    c1.addNegativeLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    c1.addNegativeLiteral(new Predicate("Pred3", new ArrayList<Term>()));
    c2.addPositiveLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertNotNull(c1.binaryResolvents(c2));
    Assert.assertNotNull(c2.binaryResolvents(c1));
    Assert.assertEquals(1, c1.binaryResolvents(c2).iterator().next()
        .getNumberPositiveLiterals());
    Assert.assertEquals(1, c1.binaryResolvents(c2).iterator().next()
        .getNumberNegativeLiterals());
    Assert.assertEquals(1, c2.binaryResolvents(c1).iterator().next()
View Full Code Here

Examples of aima.core.logic.fol.kb.data.Clause.binaryResolvents()

    Assert.assertNotNull(c2.binaryResolvents(c1));
    Assert.assertEquals(1, c1.binaryResolvents(c2).iterator().next()
        .getNumberPositiveLiterals());
    Assert.assertEquals(1, c1.binaryResolvents(c2).iterator().next()
        .getNumberNegativeLiterals());
    Assert.assertEquals(1, c2.binaryResolvents(c1).iterator().next()
        .getNumberPositiveLiterals());
    Assert.assertEquals(1, c2.binaryResolvents(c1).iterator().next()
        .getNumberNegativeLiterals());
  }
View Full Code Here

Examples of aima.core.logic.fol.kb.data.Clause.binaryResolvents()

        .getNumberPositiveLiterals());
    Assert.assertEquals(1, c1.binaryResolvents(c2).iterator().next()
        .getNumberNegativeLiterals());
    Assert.assertEquals(1, c2.binaryResolvents(c1).iterator().next()
        .getNumberPositiveLiterals());
    Assert.assertEquals(1, c2.binaryResolvents(c1).iterator().next()
        .getNumberNegativeLiterals());
  }

  @Test
  public void testBinaryResolventsOrderDoesNotMatter() {
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.