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

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


    FOLKnowledgeBase akb = FOLKnowledgeBaseFactory
        .createLovesAnimalKnowledgeBase(infp);
    List<Term> terms = new ArrayList<Term>();
    terms.add(new Constant("Jack"));
    terms.add(new Constant("Tuna"));
    Predicate query = new Predicate("Kills", terms);

    InferenceResult answer = akb.ask(query);

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


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

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

    InferenceResult answer = akb.ask(query);

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

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

    if (expectedToTimeOut) {
      Assert.assertFalse(answer.isPossiblyFalse());
View Full Code Here

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

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

    InferenceResult answer = akb.ask(query);

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

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

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

    domain.addFunction("H");
    domain.addFunction("J");

    FOLParser parser = new FOLParser(domain);

    Predicate expression = (Predicate) parser
        .parse("P(A,F(B,G(A,H(B)),C),D)");
    TermEquality assertion = (TermEquality) parser.parse("B = E");

    Demodulation demodulation = new Demodulation();
    Predicate altExpression = (Predicate) demodulation.apply(assertion,
        expression);

    System.out.println("Demodulate '" + expression + "' with '" + assertion
        + "' to give");
    System.out.println(altExpression.toString());
    System.out.println("and again to give");
    System.out.println(demodulation.apply(assertion, altExpression)
        .toString());
    System.out.println("");
  }
View Full Code Here

    String kbStr = kb.toString();

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

    String kbStr = kb.toString();

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

    String kbStr = kb.toString();

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

    String kbStr = kb.toString();

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

TOP

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

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.