Package aima.core.logic.fol.parsing.ast

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


  public Object visitPredicate(Predicate predicate, Object arg) {
    List<Term> terms = predicate.getTerms();
    List<Term> newTerms = new ArrayList<Term>();
    for (int i = 0; i < terms.size(); i++) {
      Term t = terms.get(i);
      Term subsTerm = (Term) t.accept(this, arg);
      newTerms.add(subsTerm);
    }
    return new Predicate(predicate.getPredicateName(), newTerms);

  }
View Full Code Here


    return new Predicate(predicate.getPredicateName(), newTerms);

  }

  public Object visitTermEquality(TermEquality equality, Object arg) {
    Term newTerm1 = (Term) equality.getTerm1().accept(this, arg);
    Term newTerm2 = (Term) equality.getTerm2().accept(this, arg);
    return new TermEquality(newTerm1, newTerm2);
  }
View Full Code Here

  public Object visitFunction(Function function, Object arg) {
    List<Term> terms = function.getTerms();
    List<Term> newTerms = new ArrayList<Term>();
    for (int i = 0; i < terms.size(); i++) {
      Term t = terms.get(i);
      Term subsTerm = (Term) t.accept(this, arg);
      newTerms.add(subsTerm);
    }
    return new Function(function.getFunctionName(), newTerms);
  }
View Full Code Here

  private List<Term> processTerms() {
    consume();
    List<Term> terms = new ArrayList<Term>();
    match("(");
    Term term = parseTerm();
    terms.add(term);

    while (lookAhead(1).getType() == LogicTokenTypes.COMMA) {
      match(",");
      term = parseTerm();
View Full Code Here

    match(")");
    return terms;
  }

  public Sentence parseTermEquality() {
    Term term1 = parseTerm();
    match("=");
    // System.out.println("=");
    Term term2 = parseTerm();
    return new TermEquality(term1, term2);
  }
View Full Code Here

TOP

Related Classes of aima.core.logic.fol.parsing.ast.Term

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.