Examples of AtomicSentence


Examples of aima.core.logic.fol.parsing.ast.AtomicSentence

    domain.addFunction("F");

    FOLParser parser = new FOLParser(domain);

    List<Literal> lits = new ArrayList<Literal>();
    AtomicSentence a1 = (AtomicSentence) parser.parse("P(y, F(A,y))");
    lits.add(new Literal(a1));

    Clause c1 = new Clause(lits);

    lits.clear();
View Full Code Here

Examples of aima.core.logic.fol.parsing.ast.AtomicSentence

    domain.addFunction("F");

    FOLParser parser = new FOLParser(domain);

    List<Literal> lits = new ArrayList<Literal>();
    AtomicSentence a1 = (AtomicSentence) parser.parse("P(F(x,B),x)");
    AtomicSentence a2 = (AtomicSentence) parser.parse("Q(x)");
    lits.add(new Literal(a1));
    lits.add(new Literal(a2));

    Clause c1 = new Clause(lits);
View Full Code Here

Examples of aima.core.logic.fol.parsing.ast.AtomicSentence

                  continue;
                }

                ReplaceMatchingTerm rmt = new ReplaceMatchingTerm();

                AtomicSentence altExpression = rmt.replace(
                    l1.getAtomicSentence(),
                    icm.getMatchingTerm(), replaceWith);

                // I have an alternative, create a new clause
                // with the alternative and the substitution
View Full Code Here

Examples of aima.core.logic.fol.parsing.ast.AtomicSentence

    if (renameSubstitution.size() > 0) {
      List<Literal> lits = new ArrayList<Literal>();

      for (Literal l : chain.getLiterals()) {
        AtomicSentence atom = (AtomicSentence) substVisitor.subst(
            renameSubstitution, l.getAtomicSentence());
        lits.add(l.newInstance(atom));
      }

      Chain renamed = new Chain(lits);
View Full Code Here

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

    parser = new PEParser();
  }

  @Test
  public void testAtomicSentenceTrueParse() {
    AtomicSentence sen = (AtomicSentence) parser.parse("true");
    Assert.assertEquals(TrueSentence.class, sen.getClass());
    sen = (AtomicSentence) parser.parse("(true)");
    Assert.assertEquals(TrueSentence.class, sen.getClass());
    sen = (AtomicSentence) parser.parse("((true))");
    Assert.assertEquals(TrueSentence.class, sen.getClass());
  }
View Full Code Here

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

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

  @Test
  public void testAtomicSentenceFalseParse() {
    AtomicSentence sen = (AtomicSentence) parser.parse("faLse");
    Assert.assertEquals(FalseSentence.class, sen.getClass());
  }
View Full Code Here

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

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

  @Test
  public void testAtomicSentenceSymbolParse() {
    AtomicSentence sen = (AtomicSentence) parser.parse("AIMA");
    Assert.assertEquals(Symbol.class, sen.getClass());
  }
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.