Search in sources :

Example 26 with Solution

use of kodkod.engine.Solution 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 27 with Solution

use of kodkod.engine.Solution in project org.alloytools.alloy by AlloyTools.

the class ExamplesTest method testSET967.

/**
 * Runs SET967.checkT120_zfmisc_1 for 3.
 */
public void testSET967() {
    final SET967 prob = new SET967();
    final Solution sol = solve(prob.checkT120_zfmisc_1(), prob.bounds(3));
    check(prob.getClass().getSimpleName(), sol, UNSATISFIABLE, 407, 6968, 15413);
}
Also used : SET967(examples.tptp.SET967) Solution(kodkod.engine.Solution)

Example 28 with Solution

use of kodkod.engine.Solution in project org.alloytools.alloy by AlloyTools.

the class ExamplesTest method testFileSystem.

/**
 * Runs FileSystem.checkNoDirAliases for 5.
 */
public void testFileSystem() {
    final FileSystem prob = new FileSystem();
    final Solution sol = solve(prob.checkNoDirAliases(), prob.bounds(5));
    check(prob.getClass().getSimpleName(), sol, SATISFIABLE, 444, 4341, 18485);
}
Also used : FileSystem(examples.alloy.FileSystem) Solution(kodkod.engine.Solution)

Example 29 with Solution

use of kodkod.engine.Solution in project org.alloytools.alloy by AlloyTools.

the class ExamplesTest method testALG212.

/**
 * Runs ALG212.checkDistLong for 4.
 */
public void testALG212() {
    final ALG212 prob = new ALG212();
    final Solution sol = solve(prob.checkDistLong(), prob.bounds(4));
    check(prob.getClass().getSimpleName(), sol, UNSATISFIABLE, 407, 6968, 15413);
}
Also used : ALG212(examples.tptp.ALG212) Solution(kodkod.engine.Solution)

Example 30 with Solution

use of kodkod.engine.Solution in project org.alloytools.alloy by AlloyTools.

the class ExamplesTest method testMED009.

/**
 * Runs MED009.checkTranssls2_qige27 for 6.
 */
public void testMED009() {
    final MED009 prob = new MED009();
    final Solution sol = solve(prob.checkTranssls2_qige27(), prob.bounds(6));
    check(prob.getClass().getSimpleName(), sol, UNSATISFIABLE, 407, 6968, 15413);
}
Also used : MED009(examples.tptp.MED009) Solution(kodkod.engine.Solution)

Aggregations

Solution (kodkod.engine.Solution)153 Formula (kodkod.ast.Formula)101 Bounds (kodkod.instance.Bounds)75 Solver (kodkod.engine.Solver)72 Universe (kodkod.instance.Universe)32 Relation (kodkod.ast.Relation)30 TupleFactory (kodkod.instance.TupleFactory)30 TupleSet (kodkod.instance.TupleSet)25 Variable (kodkod.ast.Variable)24 IntExpression (kodkod.ast.IntExpression)19 Expression (kodkod.ast.Expression)17 Test (org.junit.Test)16 QuantifiedFormula (kodkod.ast.QuantifiedFormula)15 Decls (kodkod.ast.Decls)11 Evaluator (kodkod.engine.Evaluator)10 HigherOrderDeclException (kodkod.engine.fol2sat.HigherOrderDeclException)7 UnboundLeafException (kodkod.engine.fol2sat.UnboundLeafException)7 ConsoleReporter (kodkod.engine.config.ConsoleReporter)6 Instance (kodkod.instance.Instance)6 ArrayList (java.util.ArrayList)5