Ejemplo n.º 1
0
 public void testMakeDisjoint() {
   impOverlap.makeDisjoint();
   assertEquals(impDisjoint, impOverlap);
   Implication tmp = (Implication) impDisjoint.clone();
   impDisjoint.makeDisjoint();
   assertEquals(tmp, impDisjoint);
 }
Ejemplo n.º 2
0
 public void testEquals() {
   assertTrue("Self equals failure", impOverlap.equals(impOverlap));
   assertEquals("Equality to zero failure", false, impOverlap.equals(null));
   assertEquals("Equality to other type failure", false, impOverlap.equals(new Object()));
   assertTrue("Clone equals failure", impOverlap.equals(impOverlap.clone()));
   assertEquals("Not equals failure", false, impOverlap.equals(impDisjoint));
 }
Ejemplo n.º 3
0
  public void testIsRespectedBySet() {
    // implication is respected by set,if from premise \subseteq set => conclusion \subseteq set

    // test when set is not subset of premise
    assertTrue(impDisjoint.isRespectedBySet(SetBuilder.makeSet(new int[] {0, 0, 0, 0})));
    // normal case
    assertTrue(impDisjoint.isRespectedBySet(SetBuilder.makeSet(new int[] {1, 1, 0, 0})));
    // bigger case
    assertTrue(impDisjoint.isRespectedBySet(SetBuilder.makeSet(new int[] {1, 1, 1, 1})));

    assertEquals(false, impDisjoint.isRespectedBySet(SetBuilder.makeSet(new int[] {1, 0, 0, 0})));

    // test of implication for all objects

    Implication common =
        ImplicationsBuilder.makeImplication(new int[] {0, 0, 0, 0}, new int[] {1, 1, 0, 0}, 10);

    assertEquals(false, common.isRespectedBySet(SetBuilder.makeSet(new int[] {0, 0, 0, 0})));
    assertEquals(true, common.isRespectedBySet(SetBuilder.makeSet(new int[] {1, 1, 0, 1})));
  }
Ejemplo n.º 4
0
 public void testIsDisjoint() {
   assertEquals(false, impOverlap.isDisjoint());
   assertTrue(impDisjoint.isDisjoint());
 }