AIMA.Core.Logic.FOL.KB.FOLKnowledgeBaseFactory.createABCDEqualityAndSubstitutionKnowledgeBase C# (CSharp) Method

createABCDEqualityAndSubstitutionKnowledgeBase() public static method

public static createABCDEqualityAndSubstitutionKnowledgeBase ( InferenceProcedure infp, bool includeEqualityAxioms ) : FOLKnowledgeBase
infp InferenceProcedure
includeEqualityAxioms bool
return FOLKnowledgeBase
        public static FOLKnowledgeBase createABCDEqualityAndSubstitutionKnowledgeBase(
                InferenceProcedure infp, bool includeEqualityAxioms)
        {
            FOLDomain domain = new FOLDomain();
            domain.addConstant("A");
            domain.addConstant("B");
            domain.addConstant("C");
            domain.addConstant("D");
            domain.addPredicate("P");
            domain.addFunction("F");

            FOLKnowledgeBase kb = new FOLKnowledgeBase(domain, infp);

            kb.tell("F(A) = B");
            kb.tell("F(B) = A");
            kb.tell("C = D");
            kb.tell("P(A)");
            kb.tell("P(C)");

            if (includeEqualityAxioms)
            {
                // Reflexivity Axiom
                kb.tell("x = x");
                // Symmetry Axiom
                kb.tell("(x = y => y = x)");
                // Transitivity Axiom
                kb.tell("((x = y AND y = z) => x = z)");
                // Function F Substitution Axiom
                kb.tell("((x = y AND F(y) = z) => F(x) = z)");
                // Predicate P Substitution Axiom
                kb.tell("((x = y AND P(y)) => P(x))");
            }

            return kb;
        }
    }