use of examples.alloy.CeilingsAndFloors in project org.alloytools.alloy by AlloyTools.
the class EnumerationTest method testCeilingsAndFloors.
public final void testCeilingsAndFloors() {
final CeilingsAndFloors model = new CeilingsAndFloors();
final Formula f = model.checkBelowTooAssertion();
// has exactly one instance
Iterator<Solution> sol = solver.solveAll(f, model.bounds(2, 2));
assertNotNull(sol.next().instance());
assertNull(sol.next().instance());
assertFalse(sol.hasNext());
// has more than one instance
sol = solver.solveAll(f, model.bounds(3, 3));
assertNotNull(sol.next().instance());
assertNotNull(sol.next().instance());
assertTrue(sol.hasNext());
// has no instances
sol = solver.solveAll(model.checkBelowTooDoublePrime(), model.bounds(3, 3));
assertNull(sol.next().instance());
}
use of examples.alloy.CeilingsAndFloors in project org.alloytools.alloy by AlloyTools.
the class ExamplesTest method testCeilingsAndFloors_BelowTooAssertion.
/**
* Runs the CeilingsAndFloors.checkBelowTooAssertion example for 6 Man, 6
* Platform.
*/
public void testCeilingsAndFloors_BelowTooAssertion() {
final CeilingsAndFloors prob = new CeilingsAndFloors();
final Solution sol = solve(prob.checkBelowTooAssertion(), prob.bounds(6, 6));
check(prob.getClass().getSimpleName(), sol, SATISFIABLE, 90, 1750, 3414);
}
use of examples.alloy.CeilingsAndFloors in project org.alloytools.alloy by AlloyTools.
the class ExamplesTest method testCeilingsAndFloors_BelowTooDoublePrime.
/**
* Runs the CeilingsAndFloors.checkBelowTooDoublePrime example for 6 Man, 6
* Platform.
*/
public void testCeilingsAndFloors_BelowTooDoublePrime() {
final CeilingsAndFloors prob = new CeilingsAndFloors();
final Solution sol = solve(prob.checkBelowTooDoublePrime(), prob.bounds(6, 6));
check(prob.getClass().getSimpleName(), sol, UNSATISFIABLE, 90, 1750, 3414);
}
Aggregations