Package aima.core.logic.propositional.parsing.ast

Examples of aima.core.logic.propositional.parsing.ast.UnarySentence


  public Object visitFalseSentence(FalseSentence fs, Object arg) {
    return new FalseSentence();
  }

  public Object visitNotSentence(UnarySentence fs, Object arg) {
    return new UnarySentence((Sentence) fs.getNegated().accept(this, arg));
  }
View Full Code Here


  }

  private UnarySentence parseNotSentence() {
    match("NOT");
    Sentence sen = parseSentence();
    return new UnarySentence(sen);
  }
View Full Code Here

    Assert.assertEquals(Symbol.class, sen.getClass());
  }

  @Test
  public void testNotSentenceParse() {
    UnarySentence sen = (UnarySentence) parser.parse("NOT AIMA");
    Assert.assertEquals(UnarySentence.class, sen.getClass());
  }
View Full Code Here

    sen = (BinarySentence) parser.parse(s);
    Assert.assertEquals(" (  ( P AND Q ) OR  ( S AND T ) )", sen.toString());
    Assert.assertEquals("OR", sen.getOperator());

    s = "(NOT ((P AND Q) => (S AND T)))";
    UnarySentence nsen = (UnarySentence) parser.parse(s);
    // assertEquals("=>",sen.getOperator());
    s = "(NOT (P <=> (S AND T)))";
    nsen = (UnarySentence) parser.parse(s);
    Assert.assertEquals(" ( NOT  ( P <=>  ( S AND T ) ) ) ",
        nsen.toString());

    s = "(P <=> (S AND T))";
    sen = (BinarySentence) parser.parse(s);

    s = "(P => Q)";
View Full Code Here

TOP

Related Classes of aima.core.logic.propositional.parsing.ast.UnarySentence

Copyright © 2018 www.massapicom. 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.