AIMA.Test.Core.Unit.Logic.FOL.CNFConverterTest.testNegationsAndNestedImplications C# (CSharp) Method

testNegationsAndNestedImplications() private method

private testNegationsAndNestedImplications ( ) : void
return void
        public void testNegationsAndNestedImplications()
        {
            FOLDomain domain = new FOLDomain();
            domain.addPredicate("P");
            domain.addPredicate("Q");
            domain.addPredicate("R");
            domain.addConstant("A");

            FOLParser parser = new FOLParser(domain);
            CNFConverter cnfConv = new CNFConverter(parser);

            // ~(((~p or ~q) => ~(p or q)) => r)
            Sentence sent = parser
                    .parse("NOT(((((NOT(P(A)) OR NOT(Q(A)))) => NOT((P(A) OR Q(A)))) => R(A)))");
            CNF cnf = cnfConv.convertToCNF(sent);

            Assert
                    .AreEqual(
                            "[~P(A), P(A)],[~P(A), Q(A)],[~Q(A), P(A)],[~Q(A), Q(A)],[~R(A)]",
                            cnf.ToString());
        }