コード例 #1
0
  @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[] {})));
  }
コード例 #2
0
  @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);
  }
コード例 #3
0
  @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());
  }
コード例 #4
0
 @Test
 public void testNewInstanceforSAT_empty() throws Exception {
   Formula instance = Formula.newInstanceforSAT(new Formula());
   assertNotNull(instance);
   assertTrue(instance.getModels().isEmpty());
 }