コード例 #1
0
        public void TestDoesNotKnow()
        {
            KnowledgeBase kb = new KnowledgeBase();

            kb.Tell("A");
            Assert.IsFalse(kb.AskWithTTEntails("B"));
            Assert.IsFalse(kb.AskWithTTEntails("~B"));
        }
コード例 #2
0
        public void TestTTEntailsSucceedsWithChadCarffsBugReport()
        {
            KnowledgeBase kb = new KnowledgeBase();

            kb.Tell("B12 <=> P11 | P13 | P22 | P02");
            kb.Tell("B21 <=> P20 | P22 | P31 | P11");
            kb.Tell("B01 <=> P00 | P02 | P11");
            kb.Tell("B10 <=> P11 | P20 | P00");
            kb.Tell("~B21");
            kb.Tell("~B12");
            kb.Tell("B10");
            kb.Tell("B01");

            Assert.IsTrue(kb.AskWithTTEntails("P00"));
            Assert.IsFalse(kb.AskWithTTEntails("~P00"));
        }
コード例 #3
0
 public void TestSimpleSentence1()
 {
     kb.Tell("A & B");
     Assert.AreEqual(true, kb.AskWithTTEntails("A"));
 }
コード例 #4
0
        public void TestTTEntailsSucceedsWithCStackOverFlowBugReport()
        {
            KnowledgeBase kb = new KnowledgeBase();

            Assert.IsTrue(kb.AskWithTTEntails("((A | (~ A)) & (A | B))"));
        }