Package aima.core.logic.fol.kb.data

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


    Assert.assertFalse(c1.isHornClause());

    c1.addNegativeLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    Assert.assertTrue(c1.isHornClause());

    c1.addPositiveLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertTrue(c1.isHornClause());

    c1.addNegativeLiteral(new Predicate("Pred3", new ArrayList<Term>()));
    Assert.assertTrue(c1.isHornClause());
    c1.addNegativeLiteral(new Predicate("Pred4", new ArrayList<Term>()));
View Full Code Here


    c1.addNegativeLiteral(new Predicate("Pred3", new ArrayList<Term>()));
    Assert.assertTrue(c1.isHornClause());
    c1.addNegativeLiteral(new Predicate("Pred4", new ArrayList<Term>()));
    Assert.assertTrue(c1.isHornClause());

    c1.addPositiveLiteral(new Predicate("Pred5", new ArrayList<Term>()));
    Assert.assertFalse(c1.isHornClause());
  }

  @Test
  public void testIsDefiniteClause() {
View Full Code Here

    Assert.assertFalse(c1.isDefiniteClause());

    c1.addNegativeLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    Assert.assertFalse(c1.isDefiniteClause());

    c1.addPositiveLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertTrue(c1.isDefiniteClause());

    c1.addNegativeLiteral(new Predicate("Pred3", new ArrayList<Term>()));
    Assert.assertTrue(c1.isDefiniteClause());
    c1.addNegativeLiteral(new Predicate("Pred4", new ArrayList<Term>()));
View Full Code Here

    c1.addNegativeLiteral(new Predicate("Pred3", new ArrayList<Term>()));
    Assert.assertTrue(c1.isDefiniteClause());
    c1.addNegativeLiteral(new Predicate("Pred4", new ArrayList<Term>()));
    Assert.assertTrue(c1.isDefiniteClause());

    c1.addPositiveLiteral(new Predicate("Pred5", new ArrayList<Term>()));
    Assert.assertFalse(c1.isDefiniteClause());
  }

  @Test
  public void testIsUnitClause() {
View Full Code Here

  @Test
  public void testIsUnitClause() {
    Clause c1 = new Clause();
    Assert.assertFalse(c1.isUnitClause());

    c1.addPositiveLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    Assert.assertTrue(c1.isUnitClause());

    c1.addPositiveLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertFalse(c1.isUnitClause());
View Full Code Here

    Assert.assertFalse(c1.isUnitClause());

    c1.addPositiveLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    Assert.assertTrue(c1.isUnitClause());

    c1.addPositiveLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertFalse(c1.isUnitClause());

    c1 = new Clause();
    Assert.assertFalse(c1.isUnitClause());
View Full Code Here

    Assert.assertFalse(c1.isUnitClause());

    c1 = new Clause();
    Assert.assertFalse(c1.isUnitClause());

    c1.addPositiveLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    Assert.assertTrue(c1.isUnitClause());

    c1.addNegativeLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertFalse(c1.isUnitClause());
View Full Code Here

    Assert.assertFalse(c1.isUnitClause());

    c1.addNegativeLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    Assert.assertTrue(c1.isUnitClause());

    c1.addPositiveLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertFalse(c1.isUnitClause());
  }

  @Test
  public void testIsImplicationDefiniteClause() {
View Full Code Here

  @Test
  public void testIsImplicationDefiniteClause() {
    Clause c1 = new Clause();
    Assert.assertFalse(c1.isImplicationDefiniteClause());

    c1.addPositiveLiteral(new Predicate("Pred1", new ArrayList<Term>()));
    Assert.assertFalse(c1.isImplicationDefiniteClause());

    c1.addNegativeLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertTrue(c1.isImplicationDefiniteClause());
    c1.addNegativeLiteral(new Predicate("Pred3", new ArrayList<Term>()));
View Full Code Here

    c1.addNegativeLiteral(new Predicate("Pred2", new ArrayList<Term>()));
    Assert.assertTrue(c1.isImplicationDefiniteClause());
    c1.addNegativeLiteral(new Predicate("Pred3", new ArrayList<Term>()));
    Assert.assertTrue(c1.isImplicationDefiniteClause());

    c1.addPositiveLiteral(new Predicate("Pred4", new ArrayList<Term>()));
    Assert.assertFalse(c1.isImplicationDefiniteClause());
  }

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