Package aima.core.logic.fol.kb

Examples of aima.core.logic.fol.kb.FOLKnowledgeBase.ask()


    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());
View Full Code Here


    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()) {
View Full Code Here

    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()) {
View Full Code Here

    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()) {
View Full Code Here

    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()) {
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.