@Test public void testIsSatisfiedBy_empty() throws ContradictionException, TimeoutException { Formula f = Formula.newInstanceforSAT(new Formula()); // emptyFormula assertTrue(f.getModels().isEmpty()); // emptyFormula formula is not satisfiable - not even by an emptyFormula model assertFalse(f.isSatisfiedBy(new Model(new int[] {}))); }
@Test public void testGetModels() throws ContradictionException, TimeoutException { Formula instance = Formula.newInstanceforSAT(new Var("a").and(new Var("b"))); Set<Model> expResult = new HashSet<Model>(); expResult.add(new Model(new int[] {1, 2})); Set<Model> result = instance.getModels(); assertEquals(expResult, result); }
@Test public void testGetModels_empty() throws ContradictionException, TimeoutException { Formula instance = Formula.newInstanceforSAT(new Formula()); Set<Model> expResult = new HashSet<Model>(); Set<Model> result = instance.getModels(); assertEquals(expResult, result); assertTrue(result.isEmpty()); }
@Test public void testNewInstanceforSAT_empty() throws Exception { Formula instance = Formula.newInstanceforSAT(new Formula()); assertNotNull(instance); assertTrue(instance.getModels().isEmpty()); }