AIMA.Test.Core.Unit.Logic.Propositional.Visitors.CNFClauseGathererTest.testAimaExample C# (CSharp) Method

testAimaExample() private method

private testAimaExample ( ) : void
return void
        public void testAimaExample()
        {
            Sentence aimaEg = (Sentence)parser.parse("( B11 <=> (P12 OR P21))");
            CNFTransformer transformer = new CNFTransformer();
            Sentence transformed = transformer.transform(aimaEg);
            List<Sentence> clauses = gatherer.getClausesFrom(transformed);
            Sentence clause1 = (Sentence)parser.parse("( B11 OR  ( NOT P12 )  )");
            Sentence clause2 = (Sentence)parser.parse("( B11 OR  ( NOT P21 )  )");
            Sentence clause3 = (Sentence)parser
                    .parse("(  ( NOT B11 )  OR  ( P12 OR P21 ) )");
            Assert.AreEqual(3, clauses.Count);
            Assert.IsTrue(clauses.Contains(clause1));
            Assert.IsTrue(clauses.Contains(clause2));
            Assert.IsTrue(clauses.Contains(clause3));
        }
    }