@Test public void testGetRight() { Var a = new Var("a"); Var b = new Var("b"); Formula f = (a.and(b)); assertTrue(f.getRight().equals(b)); }
@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); }
@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); }