Ejemplo n.º 1
0
 @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));
 }
Ejemplo n.º 2
0
 @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));
 }
Ejemplo n.º 3
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));
 }
Ejemplo n.º 4
0
 @Test
 public void testExtendModel() {
   String p = "P";
   m = m.extend(new Symbol(p), true);
   Assert.assertEquals(Boolean.TRUE, m.getStatus(new Symbol("P")));
 }
Ejemplo n.º 5
0
 @Test
 public void testEmptyModel() {
   Assert.assertEquals(null, m.getStatus(new Symbol("P")));
   Assert.assertEquals(true, m.isUnknown(new Symbol("P")));
 }