@Test public void testTrueFalseEvaluation() { Assert.assertEquals(true, m.isTrue(trueSentence)); Assert.assertEquals(false, m.isFalse(trueSentence)); Assert.assertEquals(false, m.isTrue(falseSentence)); Assert.assertEquals(true, m.isFalse(falseSentence)); }
@Test public void testSentenceStatusWhenPFalseAndQFalse() { String p = "P"; String q = "Q"; m = m.extend(new Symbol(p), false); m = m.extend(new Symbol(q), false); Assert.assertEquals(true, m.isFalse(andSentence)); Assert.assertEquals(true, m.isFalse(orSentence)); Assert.assertEquals(true, m.isTrue(impliedSentence)); Assert.assertEquals(true, m.isTrue(biConditionalSentence)); }
@Test public void testComplexSentence() { String p = "P"; String q = "Q"; m = m.extend(new Symbol(p), true); m = m.extend(new Symbol(q), false); Sentence sent = (Sentence) parser.parse("((P OR Q) AND (P => Q))"); Assert.assertFalse(m.isTrue(sent)); Assert.assertTrue(m.isFalse(sent)); Sentence sent2 = (Sentence) parser.parse("((P OR Q) AND (Q))"); Assert.assertFalse(m.isTrue(sent2)); Assert.assertTrue(m.isFalse(sent2)); }
@Test public void testExtendModel() { String p = "P"; m = m.extend(new Symbol(p), true); Assert.assertEquals(Boolean.TRUE, m.getStatus(new Symbol("P"))); }
@Test public void testEmptyModel() { Assert.assertEquals(null, m.getStatus(new Symbol("P"))); Assert.assertEquals(true, m.isUnknown(new Symbol("P"))); }