Search in sources :

Example 1 with CeilingsAndFloors

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());
}
Also used : Formula(kodkod.ast.Formula) CeilingsAndFloors(examples.alloy.CeilingsAndFloors) Solution(kodkod.engine.Solution)

Example 2 with CeilingsAndFloors

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);
}
Also used : CeilingsAndFloors(examples.alloy.CeilingsAndFloors) Solution(kodkod.engine.Solution)

Example 3 with CeilingsAndFloors

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);
}
Also used : CeilingsAndFloors(examples.alloy.CeilingsAndFloors) Solution(kodkod.engine.Solution)

Aggregations

CeilingsAndFloors (examples.alloy.CeilingsAndFloors)3 Solution (kodkod.engine.Solution)3 Formula (kodkod.ast.Formula)1