AIMA.Test.Core.Unit.Logic.FOL.UnifierTest.testNOTSentence C# (CSharp) Method

testNOTSentence() private method

private testNOTSentence ( ) : void
return void
        public void testNOTSentence()
        {
            FOLDomain domain = new FOLDomain();
            domain.addConstant("A");
            domain.addConstant("B");
            domain.addConstant("C");
            domain.addFunction("Plus");
            domain.addPredicate("P");

            FOLParser parser = new FOLParser(domain);

            Sentence s1 = parser.parse("NOT(P(A))");
            Sentence s2 = parser.parse("NOT(P(A))");

            Dictionary<Variable, Term> result = unifier.unify(s1, s2);

            Assert.IsNotNull(result);
            Assert.AreEqual(0, result.Count);

            s1 = parser.parse("NOT(P(A))");
            s2 = parser.parse("NOT(P(B))");

            result = unifier.unify(s1, s2);

            Assert.IsNull(result);

            s1 = parser.parse("NOT(P(A))");
            s2 = parser.parse("NOT(P(x))");

            result = unifier.unify(s1, s2);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(new Constant("A"), result[new Variable("x")]);
        }