Package aima.core.logic.propositional.visitors

Examples of aima.core.logic.propositional.visitors.CNFTransformer.transform()


    for (int i = 0; i < symbols.size(); i++) {
      Symbol sym = (Symbol) symbols.get(i);
      myModel = myModel.extend(sym, Util.randomBoolean());
    }
    List<Sentence> clauses = new Converter<Sentence>()
        .setToList(clauseGatherer.getClausesFrom(transformer
            .transform(s)));

    for (int i = 0; i < numberOfFlips; i++) {
      if (getNumberOfClausesSatisfiedIn(
          new Converter<Sentence>().listToSet(clauses), myModel) == clauses
View Full Code Here


    for (int i = 0; i < symbols.size(); i++) {
      Symbol sym = (Symbol) symbols.get(i);
      myModel = myModel.extend(sym, Util.randomBoolean());
    }
    List<Sentence> clauses = new Converter<Sentence>()
        .setToList(clauseGatherer.getClausesFrom(transformer
            .transform(s)));

    for (int i = 0; i < numberOfFlips; i++) {
      if (getNumberOfClausesSatisfiedIn(
          new Converter<Sentence>().listToSet(clauses), myModel) == clauses
View Full Code Here

  @Test
  public void testAimaExample() {
    Sentence aimaEg = (Sentence) parser.parse("( B11 <=> (P12 OR P21))");
    CNFTransformer transformer = new CNFTransformer();
    Sentence transformed = transformer.transform(aimaEg);
    Set<Sentence> clauses = gatherer.getClausesFrom(transformed);
    Sentence clause1 = (Sentence) parser.parse("( B11 OR  ( NOT P12 )  )");
    Sentence clause2 = (Sentence) parser.parse("( B11 OR  ( NOT P21 )  )");
    Sentence clause3 = (Sentence) parser
        .parse("(  ( NOT B11 )  OR  ( P12 OR P21 ) )");
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.