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

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


    FOLKnowledgeBase akb = FOLKnowledgeBaseFactory
        .createABCDEqualityAndSubstitutionKnowledgeBase(infp, true);

    List<Term> terms = new ArrayList<Term>();
    terms.add(new Constant("A"));
    Function fa = new Function("F", terms);
    terms = new ArrayList<Term>();
    terms.add(fa);
    Function ffa = new Function("F", terms);
    terms = new ArrayList<Term>();
    terms.add(ffa);
    Predicate query = new Predicate("P", terms);

    InferenceResult answer = akb.ask(query);
View Full Code Here


    FOLKnowledgeBase akb = FOLKnowledgeBaseFactory
        .createABCDEqualityAndSubstitutionKnowledgeBase(infp, false);

    List<Term> terms = new ArrayList<Term>();
    terms.add(new Constant("A"));
    Function fa = new Function("F", terms);
    terms = new ArrayList<Term>();
    terms.add(fa);
    TermEquality query = new TermEquality(new Function("F", terms),
        new Constant("A"));

    InferenceResult answer = akb.ask(query);

    Assert.assertTrue(null != answer);
View Full Code Here

    FOLKnowledgeBase akb = FOLKnowledgeBaseFactory
        .createABCDEqualityAndSubstitutionKnowledgeBase(infp, false);

    List<Term> terms = new ArrayList<Term>();
    terms.add(new Constant("A"));
    Function fa = new Function("F", terms);
    terms = new ArrayList<Term>();
    terms.add(fa);
    Function ffa = new Function("F", terms);
    terms = new ArrayList<Term>();
    terms.add(ffa);
    Predicate query = new Predicate("P", terms);

    InferenceResult answer = akb.ask(query);
View Full Code Here

    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

      for (Variable eVar : sentence.getVariables()) {
        if (universalScope.size() > 0) {
          // Replace with a Skolem Function
          String skolemFunctionName = parser.getFOLDomain()
              .addSkolemFunction();
          skolemSubst.put(eVar, new Function(skolemFunctionName,
              new ArrayList<Term>(universalScope)));
        } else {
          // Replace with a Skolem Constant
          String skolemConstantName = parser.getFOLDomain()
              .addSkolemConstant();
View Full Code Here

  public Term parseFunction() {
    Token t = lookAhead(1);
    String functionName = t.getText();
    List<Term> terms = processTerms();
    return new Function(functionName, terms);
  }
View Full Code Here

TOP

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

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.