AIMA.Test.Core.Unit.Logic.FOL.KB.Data.ClauseTest.testIsHornClause C# (CSharp) Method

testIsHornClause() private method

private testIsHornClause ( ) : void
return void
        public void testIsHornClause()
        {
            Clause c1 = new Clause();
            Assert.IsFalse(c1.isHornClause());

            c1.addNegativeLiteral(new Predicate("Pred1", new List<Term>()));
            Assert.IsTrue(c1.isHornClause());

            c1.addPositiveLiteral(new Predicate("Pred2", new List<Term>()));
            Assert.IsTrue(c1.isHornClause());

            c1.addNegativeLiteral(new Predicate("Pred3", new List<Term>()));
            Assert.IsTrue(c1.isHornClause());
            c1.addNegativeLiteral(new Predicate("Pred4", new List<Term>()));
            Assert.IsTrue(c1.isHornClause());

            c1.addPositiveLiteral(new Predicate("Pred5", new List<Term>()));
            Assert.IsFalse(c1.isHornClause());
        }