Commit c091d768 authored by Daniel Le Berre's avatar Daniel Le Berre

Fixed test case.

parent ae418f13
Pipeline #9098 passed with stages
in 111 minutes and 47 seconds
......@@ -85,11 +85,12 @@ public class TestXor {
IVecInt lits = new VecInt(new int[] { 1, 2, 3 });
solver.addParity(lits, true);
ModelIterator iterator = new ModelIterator(solver);
int[] model = {};
while (iterator.isSatisfiable()) {
iterator.model(); // to go to the next model
model = iterator.model(); // to go to the next model
}
assertEquals(4, iterator.numberOfModelsFoundSoFar());
System.out.println(new VecInt(solver.model()));
System.out.println(new VecInt(model));
}
@Test
......@@ -104,11 +105,12 @@ public class TestXor {
clause.push(-1).push(-3);
solver.addClause(clause);
ModelIterator iterator = new ModelIterator(solver);
int[] model = {};
while (iterator.isSatisfiable()) {
iterator.model(); // to go to the next model
model = iterator.model(); // to go to the next model
}
assertEquals(2, iterator.numberOfModelsFoundSoFar());
System.out.println(new VecInt(solver.model()));
System.out.println(new VecInt(model));
}
@Test
......@@ -119,10 +121,11 @@ public class TestXor {
solver.addParity(lits, true);
solver.addAtLeast(lits, 1);
ModelIterator iterator = new ModelIterator(solver);
int[] model = {};
while (iterator.isSatisfiable()) {
iterator.model(); // to go to the next model
model = iterator.model(); // to go to the next model
}
assertEquals(3, iterator.numberOfModelsFoundSoFar());
System.out.println(new VecInt(solver.model()));
System.out.println(new VecInt(model));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment