Пример #1
0
 @Test
 public void testSentenceStatusWhenPFalseAndQTrue() {
   String p = "P";
   String q = "Q";
   m = m.extend(new Symbol(p), false);
   m = m.extend(new Symbol(q), true);
   Assert.assertEquals(true, m.isFalse(andSentence));
   Assert.assertEquals(true, m.isTrue(orSentence));
   Assert.assertEquals(true, m.isTrue(impliedSentence));
   Assert.assertEquals(true, m.isFalse(biConditionalSentence));
 }
Пример #2
0
 @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));
 }
Пример #3
0
 @Test
 public void testExtendModel() {
   String p = "P";
   m = m.extend(new Symbol(p), true);
   Assert.assertEquals(Boolean.TRUE, m.getStatus(new Symbol("P")));
 }