Package aima.core.logic.fol

Examples of aima.core.logic.fol.StandardizeApartResult


  public InferenceResult ask(Sentence query) {
    // Want to standardize apart the query to ensure
    // it does not clash with any of the sentences
    // in the database
    StandardizeApartResult saResult = standardizeApart.standardizeApart(
        query, queryIndexical);

    // Need to map the result variables (as they are standardized apart)
    // to the original queries variables so that the caller can easily
    // understand and use the returned set of substitutions
    InferenceResult infResult = getInferenceProcedure().ask(this,
        saResult.getStandardized());
    for (Proof p : infResult.getProofs()) {
      Map<Variable, Term> im = p.getAnswerBindings();
      Map<Variable, Term> em = new LinkedHashMap<Variable, Term>();
      for (Variable rev : saResult.getReverseSubstitution().keySet()) {
        em.put((Variable) saResult.getReverseSubstitution().get(rev),
            im.get(rev));
      }
      p.replaceAnswerBindings(em);
    }
View Full Code Here


  public InferenceResult ask(Sentence aQuery) {
    // Want to standardize apart the query to ensure
    // it does not clash with any of the sentences
    // in the database
    StandardizeApartResult saResult = standardizeApart.standardizeApart(
        aQuery, queryIndexical);

    // Need to map the result variables (as they are standardized apart)
    // to the original queries variables so that the caller can easily
    // understand and use the returned set of substitutions
    InferenceResult infResult = getInferenceProcedure().ask(this,
        saResult.getStandardized());
    for (Proof p : infResult.getProofs()) {
      Map<Variable, Term> im = p.getAnswerBindings();
      Map<Variable, Term> em = new LinkedHashMap<Variable, Term>();
      for (Variable rev : saResult.getReverseSubstitution().keySet()) {
        em.put((Variable) saResult.getReverseSubstitution().get(rev),
            im.get(rev));
      }
      p.replaceAnswerBindings(em);
    }
View Full Code Here

TOP

Related Classes of aima.core.logic.fol.StandardizeApartResult

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.