コード例 #1
0
  @Test
  public void testGetRight() {
    Var a = new Var("a");
    Var b = new Var("b");

    Formula f = (a.and(b));
    assertTrue(f.getRight().equals(b));
  }
コード例 #2
0
  @Test
  public void testIsLeaf() {
    Var a = new Var("a");
    Var b = new Var("b");

    Formula f = (a.and(b));
    assertFalse(f.isLeaf());
    assertTrue(f.getLeft().isLeaf() == true && f.getRight().isLeaf() == true);
  }
コード例 #3
0
  @Test
  public void testIsAtomic() {
    Var a = new Var("a");
    Var b = new Var("b");

    assertTrue(a.isAtomic()); // a literal is atomic
    assertTrue(a.not().isAtomic()); // a literal and its negation is atomic

    Formula f = (a.and(b));
    assertFalse(f.isAtomic());
    assertTrue(f.getLeft().isAtomic() == true && f.getRight().isAtomic() == true);
  }