Search in sources :

Example 6 with IntTreeSet

use of kodkod.util.ints.IntTreeSet in project org.alloytools.alloy by AlloyTools.

the class BugTests method testVincent_02132006.

public final void testVincent_02132006() {
    IntTreeSet set = new IntTreeSet();
    for (int i = 0; i < 2; i++) {
        set.add(i);
    }
    IntTreeSet set2 = new IntTreeSet();
    for (int i = 0; i < 2; i++) {
        set2.add(i);
    }
    set.removeAll(set2);
    IntIterator setIterator = set.iterator();
    assertFalse(setIterator.hasNext());
    assertFalse(setIterator.hasNext());
    set.addAll(set2);
    assertSameContents(set, 0, 1);
    set2.clear();
    for (int i = 3; i < 5; i++) {
        set2.add(i);
    }
    set.addAll(set2);
    assertSameContents(set, 0, 1, 3, 4);
    set2.clear();
    for (int i = 1; i < 4; i++) {
        set2.add(i);
    }
    set.addAll(set2);
    assertSameContents(set, 0, 1, 2, 3, 4);
}
Also used : IntIterator(kodkod.util.ints.IntIterator) IntTreeSet(kodkod.util.ints.IntTreeSet)

Example 7 with IntTreeSet

use of kodkod.util.ints.IntTreeSet in project org.alloytools.alloy by AlloyTools.

the class BugTests method testEmina_02162006.

public final void testEmina_02162006() {
    final IntTreeSet s = new IntTreeSet();
    for (int i = 0; i < 5; i++) {
        s.add(i);
    }
    final IntTreeSet s1 = new IntTreeSet();
    s1.add(0);
    final IntSet intersection = new IntTreeSet(s);
    intersection.retainAll(s1);
    s.removeAll(intersection);
    assertSameContents(s, 1, 2, 3, 4);
    assertSameContents(s1, 0);
    assertSameContents(intersection, 0);
}
Also used : IntTreeSet(kodkod.util.ints.IntTreeSet) IntSet(kodkod.util.ints.IntSet)

Aggregations

IntTreeSet (kodkod.util.ints.IntTreeSet)7 IntSet (kodkod.util.ints.IntSet)5 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 Formula (kodkod.ast.Formula)2 Node (kodkod.ast.Node)2 RecordFilter (kodkod.engine.fol2sat.RecordFilter)2 TranslationRecord (kodkod.engine.fol2sat.TranslationRecord)2 IntIterator (kodkod.util.ints.IntIterator)2 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 PrintStream (java.io.PrintStream)1 IdentityHashMap (java.util.IdentityHashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 Set (java.util.Set)1 Matcher (java.util.regex.Matcher)1 Clause (kodkod.engine.satlab.Clause)1