Examples of InferenceResult


Examples of aima.core.logic.fol.inference.InferenceResult

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

    InferenceResult answer = akb.ask(query);

    Assert.assertTrue(null != answer);
    if (expectedToFail) {
      Assert.assertTrue(answer.isPossiblyFalse());
      Assert.assertFalse(answer.isTrue());
      Assert.assertFalse(answer.isUnknownDueToTimeout());
      Assert.assertFalse(answer.isPartialResultDueToTimeout());
      Assert.assertTrue(0 == answer.getProofs().size());
    } else {
      Assert.assertFalse(answer.isPossiblyFalse());
      Assert.assertTrue(answer.isTrue());
      Assert.assertFalse(answer.isUnknownDueToTimeout());
      Assert.assertFalse(answer.isPartialResultDueToTimeout());
      Assert.assertTrue(1 == answer.getProofs().size());
      Assert.assertTrue(0 == answer.getProofs().get(0)
          .getAnswerBindings().size());
    }
  }
View Full Code Here

Examples of aima.core.logic.fol.inference.InferenceResult

    List<Term> terms = new ArrayList<Term>();
    terms.add(new Constant("John"));
    Predicate query = new Predicate("Evil", terms);

    InferenceResult answer = kb.ask(query);

    System.out.println("Kings Knowledge Base:");
    System.out.println(kbStr);
    System.out.println("Query: " + query);
    for (Proof p : answer.getProofs()) {
      System.out.print(ProofPrinter.printProof(p));
      System.out.println("");
    }
  }
View Full Code Here

Examples of aima.core.logic.fol.inference.InferenceResult

    List<Term> terms = new ArrayList<Term>();
    terms.add(new Variable("x"));
    Predicate query = new Predicate("King", terms);

    InferenceResult answer = kb.ask(query);

    System.out.println("Kings Knowledge Base:");
    System.out.println(kbStr);
    System.out.println("Query: " + query);
    for (Proof p : answer.getProofs()) {
      System.out.print(ProofPrinter.printProof(p));
    }
  }
View Full Code Here

Examples of aima.core.logic.fol.inference.InferenceResult

    List<Term> terms = new ArrayList<Term>();
    terms.add(new Variable("x"));
    Predicate query = new Predicate("Criminal", terms);

    InferenceResult answer = kb.ask(query);

    System.out.println("Weapons Knowledge Base:");
    System.out.println(kbStr);
    System.out.println("Query: " + query);
    for (Proof p : answer.getProofs()) {
      System.out.print(ProofPrinter.printProof(p));
      System.out.println("");
    }
  }
View Full Code Here

Examples of aima.core.logic.fol.inference.InferenceResult

    List<Term> terms = new ArrayList<Term>();
    terms.add(new Constant("Curiosity"));
    terms.add(new Constant("Tuna"));
    Predicate query = new Predicate("Kills", terms);

    InferenceResult answer = kb.ask(query);

    System.out.println("Loves Animal Knowledge Base:");
    System.out.println(kbStr);
    System.out.println("Query: " + query);
    for (Proof p : answer.getProofs()) {
      System.out.print(ProofPrinter.printProof(p));
      System.out.println("");
    }
  }
View Full Code Here

Examples of aima.core.logic.fol.inference.InferenceResult

    String kbStr = kb.toString();

    TermEquality query = new TermEquality(new Constant("A"), new Constant(
        "C"));

    InferenceResult answer = kb.ask(query);

    System.out.println("ABC Equality Axiom Knowledge Base:");
    System.out.println(kbStr);
    System.out.println("Query: " + query);
    for (Proof p : answer.getProofs()) {
      System.out.print(ProofPrinter.printProof(p));
      System.out.println("");
    }
  }
View Full Code Here

Examples of aima.core.logic.fol.inference.InferenceResult

    String kbStr = kb.toString();

    TermEquality query = new TermEquality(new Constant("A"), new Constant(
        "C"));

    InferenceResult answer = kb.ask(query);

    System.out.println("ABC Equality No Axiom Knowledge Base:");
    System.out.println(kbStr);
    System.out.println("Query: " + query);
    for (Proof p : answer.getProofs()) {
      System.out.print(ProofPrinter.printProof(p));
      System.out.println("");
    }
  }
View Full Code Here

Examples of aima.core.logic.fol.inference.InferenceResult

        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));
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.