Package aima.core.logic.fol.domain

Examples of aima.core.logic.fol.domain.FOLDomain


  // Note: Tests derived from:
  // http://logic.stanford.edu/classes/cs157/2008/lectures/lecture12.pdf
  // slides 17 and 18.
  @Test
  public void testSubsumes() {
    FOLDomain domain = new FOLDomain();
    domain.addConstant("A");
    domain.addConstant("B");
    domain.addConstant("C");
    domain.addConstant("D");
    domain.addConstant("E");
    domain.addConstant("F");
    domain.addConstant("G");
    domain.addConstant("H");
    domain.addConstant("I");
    domain.addConstant("J");
    domain.addPredicate("P");
    domain.addPredicate("Q");

    FOLParser parser = new FOLParser(domain);

    // Example
    // {~p(a,b),q(c)}
View Full Code Here


  private static void fOL_CNFConversion() {
    System.out.println("-------------------------------------------------");
    System.out.println("Conjuctive Normal Form for First Order Logic Demo");
    System.out.println("-------------------------------------------------");
    FOLDomain domain = DomainFactory.lovesAnimalDomain();
    FOLParser parser = new FOLParser(domain);

    Sentence origSentence = parser
        .parse("FORALL x (FORALL y (Animal(y) => Loves(x, y)) => EXISTS y Loves(y, x))");
View Full Code Here

  private static void fOL_Demodulation() {
    System.out.println("-----------------");
    System.out.println("Demodulation Demo");
    System.out.println("-----------------");
    FOLDomain domain = new FOLDomain();
    domain.addConstant("A");
    domain.addConstant("B");
    domain.addConstant("C");
    domain.addConstant("D");
    domain.addConstant("E");
    domain.addPredicate("P");
    domain.addFunction("F");
    domain.addFunction("G");
    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)");
View Full Code Here

  // Note: Based on:
  // http://logic.stanford.edu/classes/cs157/2008/lectures/lecture15.pdf
  // Slide 31.
  @Test
  public void testSimpleExample() {
    FOLDomain domain = new FOLDomain();
    domain.addConstant("A");
    domain.addConstant("B");
    domain.addPredicate("P");
    domain.addPredicate("Q");
    domain.addPredicate("R");
    domain.addFunction("F");

    FOLParser parser = new FOLParser(domain);

    List<Literal> lits = new ArrayList<Literal>();
    AtomicSentence a1 = (AtomicSentence) parser.parse("P(F(x,B),x)");
View Full Code Here

  private static void fOL_Paramodulation() {
    System.out.println("-------------------");
    System.out.println("Paramodulation Demo");
    System.out.println("-------------------");

    FOLDomain domain = new FOLDomain();
    domain.addConstant("A");
    domain.addConstant("B");
    domain.addPredicate("P");
    domain.addPredicate("Q");
    domain.addPredicate("R");
    domain.addFunction("F");

    FOLParser parser = new FOLParser(domain);

    List<Literal> lits = new ArrayList<Literal>();
    AtomicSentence a1 = (AtomicSentence) parser.parse("P(F(x,B),x)");
View Full Code Here

        .toString());
  }

  @Test
  public void testMultipleTermEqualitiesInBothClausesExample() {
    FOLDomain domain = new FOLDomain();
    domain.addConstant("A");
    domain.addConstant("B");
    domain.addConstant("C");
    domain.addConstant("D");
    domain.addPredicate("P");
    domain.addPredicate("Q");
    domain.addPredicate("R");
    domain.addFunction("F");

    FOLParser parser = new FOLParser(domain);

    List<Literal> lits = new ArrayList<Literal>();
    AtomicSentence a1 = (AtomicSentence) parser.parse("F(C,x) = D");
View Full Code Here

        it.next().toString());
  }

  @Test
  public void testBypassReflexivityAxiom() {
    FOLDomain domain = new FOLDomain();
    domain.addConstant("A");
    domain.addConstant("B");
    domain.addConstant("C");
    domain.addPredicate("P");
    domain.addFunction("F");

    FOLParser parser = new FOLParser(domain);

    List<Literal> lits = new ArrayList<Literal>();
    AtomicSentence a1 = (AtomicSentence) parser.parse("P(y, F(A,y))");
View Full Code Here

    Assert.assertEquals(0, paras.size());
  }

  @Test
  public void testNegativeTermEquality() {
    FOLDomain domain = new FOLDomain();
    domain.addConstant("A");
    domain.addConstant("B");
    domain.addConstant("C");
    domain.addPredicate("P");
    domain.addFunction("F");

    FOLParser parser = new FOLParser(domain);

    List<Literal> lits = new ArrayList<Literal>();
    AtomicSentence a1 = (AtomicSentence) parser.parse("P(y, F(A,y))");
View Full Code Here

  // Note: Based on:
  // http://logic.stanford.edu/classes/cs157/2008/lectures/lecture15.pdf
  // Slide 22.
  @Test
  public void testSimpleAtomicExamples() {
    FOLDomain domain = new FOLDomain();
    domain.addConstant("A");
    domain.addConstant("B");
    domain.addConstant("C");
    domain.addConstant("D");
    domain.addConstant("E");
    domain.addPredicate("P");
    domain.addFunction("F");
    domain.addFunction("G");
    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)");
View Full Code Here

  // Note: Based on:
  // http://logic.stanford.edu/classes/cs157/2008/lectures/lecture15.pdf
  // Slide 23.
  @Test
  public void testSimpleAtomicNonExample() {
    FOLDomain domain = new FOLDomain();
    domain.addConstant("A");
    domain.addConstant("B");
    domain.addConstant("C");
    domain.addConstant("D");
    domain.addConstant("E");
    domain.addPredicate("P");
    domain.addFunction("F");
    domain.addFunction("G");
    domain.addFunction("H");
    domain.addFunction("J");

    FOLParser parser = new FOLParser(domain);

    Predicate expression = (Predicate) parser.parse("P(A,G(x,B),C)");
    TermEquality assertion = (TermEquality) parser.parse("G(A,y) = J(y)");
View Full Code Here

TOP

Related Classes of aima.core.logic.fol.domain.FOLDomain

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.