Search in sources :

Example 76 with Solver

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

the class SET967 method main.

/**
 * Usage: java examples.tptp.SET967 [univ size]
 */
public static void main(String[] args) {
    if (args.length < 1)
        usage();
    try {
        final int n = Integer.parseInt(args[0]);
        if (n < 1)
            usage();
        final SET967 model = new SET967();
        final Solver solver = new Solver();
        solver.options().setSolver(SATFactory.MiniSat);
        // solver.options().setSymmetryBreaking(n*n);
        // solver.options().setFlatten(false);
        final Formula f = model.checkT120_zfmisc_1();
        final Bounds b = model.bounds(n);
        System.out.println(f);
        final Solution sol = solver.solve(f, b);
        System.out.println(sol);
    } catch (NumberFormatException nfe) {
        usage();
    }
}
Also used : Formula(kodkod.ast.Formula) Solver(kodkod.engine.Solver) Bounds(kodkod.instance.Bounds) Solution(kodkod.engine.Solution)

Aggregations

Solver (kodkod.engine.Solver)76 Solution (kodkod.engine.Solution)72 Formula (kodkod.ast.Formula)67 Bounds (kodkod.instance.Bounds)67 Universe (kodkod.instance.Universe)26 TupleFactory (kodkod.instance.TupleFactory)25 Relation (kodkod.ast.Relation)24 TupleSet (kodkod.instance.TupleSet)23 Expression (kodkod.ast.Expression)14 IntExpression (kodkod.ast.IntExpression)14 Variable (kodkod.ast.Variable)14 Decls (kodkod.ast.Decls)11 HigherOrderDeclException (kodkod.engine.fol2sat.HigherOrderDeclException)7 UnboundLeafException (kodkod.engine.fol2sat.UnboundLeafException)7 ConsoleReporter (kodkod.engine.config.ConsoleReporter)6 LinkedHashSet (java.util.LinkedHashSet)5 Evaluator (kodkod.engine.Evaluator)3 AbstractReporter (kodkod.engine.config.AbstractReporter)3 Instance (kodkod.instance.Instance)3 Method (java.lang.reflect.Method)2