Package aima.core.logic.propositional.algorithms

Examples of aima.core.logic.propositional.algorithms.Model.extend()


  }

  @Test
  public void testDPLLReturnsTrueWhenAllClausesTrueInModel() {
    Model model = new Model();
    model = model.extend(new Symbol("A"), true).extend(new Symbol("B"),
        true);
    Sentence sentence = (Sentence) parser.parse("((A AND B) AND (A OR B))");
    boolean satisfiable = dpll.dpllSatisfiable(sentence, model);
    Assert.assertEquals(true, satisfiable);
  }
View Full Code Here


  }

  @Test
  public void testDPLLReturnsFalseWhenOneClauseFalseInModel() {
    Model model = new Model();
    model = model.extend(new Symbol("A"), true).extend(new Symbol("B"),
        false);
    Sentence sentence = (Sentence) parser.parse("((A OR B) AND (A => B))");
    boolean satisfiable = dpll.dpllSatisfiable(sentence, model);
    Assert.assertEquals(false, satisfiable);
  }
View Full Code Here

  }

  @Test
  public void testDPLLFiltersClausesTheStatusOfWhichAreKnown() {
    Model model = new Model();
    model = model.extend(new Symbol("A"), true).extend(new Symbol("B"),
        true);
    Sentence sentence = (Sentence) parser
        .parse("((A AND B) AND (B AND C))");
    List<Sentence> clauseList = new Converter<Sentence>()
        .setToList(new CNFClauseGatherer()
View Full Code Here

  }

  @Test
  public void testDPLLFilteringNonTrueClausesGivesNullWhenAllClausesAreKnown() {
    Model model = new Model();
    model = model.extend(new Symbol("A"), true)
        .extend(new Symbol("B"), true).extend(new Symbol("C"), true);
    Sentence sentence = (Sentence) parser
        .parse("((A AND B) AND (B AND C))");
    List<Sentence> clauseList = new Converter<Sentence>()
        .setToList(new CNFClauseGatherer()
View Full Code Here

  }

  @Test
  public void testDPLLFindsPurePositiveSymbolsWhenTheyExist() {
    Model model = new Model();
    model = model.extend(new Symbol("A"), true).extend(new Symbol("B"),
        true);
    Sentence sentence = (Sentence) parser
        .parse("((A AND B) AND (B AND C))");
    List<Sentence> clauseList = new Converter<Sentence>()
        .setToList(new CNFClauseGatherer()
View Full Code Here

  }

  @Test
  public void testDPLLFindsPureNegativeSymbolsWhenTheyExist() {
    Model model = new Model();
    model = model.extend(new Symbol("A"), true).extend(new Symbol("B"),
        true);
    Sentence sentence = (Sentence) parser
        .parse("((A AND B) AND ( B  AND (NOT C) ))");
    List<Sentence> clauseList = new Converter<Sentence>()
        .setToList(new CNFClauseGatherer()
View Full Code Here

  @Test
  public void testIssue66() {
    // http://code.google.com/p/aima-java/issues/detail?id=66
    Model model = new Model();
    model = model.extend(new Symbol("A"), false)
        .extend(new Symbol("B"), false).extend(new Symbol("C"), true);
    Sentence sentence = (Sentence) parser.parse("((A OR B) OR C)");
    Assert.assertTrue(dpll.dpllSatisfiable(sentence, model));
  }
View Full Code Here

    kb.tell("(B21 <=> ((P11 OR P22) OR P31))");
    kb.tell("(NOT B11)");
    kb.tell("(B21)");

    Model model = new Model();
    model = model.extend(new Symbol("B11"), false);
    model = model.extend(new Symbol("B21"), true);
    model = model.extend(new Symbol("P11"), false);
    model = model.extend(new Symbol("P12"), false);
    model = model.extend(new Symbol("P21"), false);
    model = model.extend(new Symbol("P22"), false);
View Full Code Here

    kb.tell("(NOT B11)");
    kb.tell("(B21)");

    Model model = new Model();
    model = model.extend(new Symbol("B11"), false);
    model = model.extend(new Symbol("B21"), true);
    model = model.extend(new Symbol("P11"), false);
    model = model.extend(new Symbol("P12"), false);
    model = model.extend(new Symbol("P21"), false);
    model = model.extend(new Symbol("P22"), false);
    model = model.extend(new Symbol("P31"), true);
View Full Code Here

    kb.tell("(B21)");

    Model model = new Model();
    model = model.extend(new Symbol("B11"), false);
    model = model.extend(new Symbol("B21"), true);
    model = model.extend(new Symbol("P11"), false);
    model = model.extend(new Symbol("P12"), false);
    model = model.extend(new Symbol("P21"), false);
    model = model.extend(new Symbol("P22"), false);
    model = model.extend(new Symbol("P31"), true);
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.