Java Code Examples for kodkod.engine.config.Options#setBitwidth()

The following examples show how to use kodkod.engine.config.Options#setBitwidth() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IncrementalOverflowNumTest.java    From org.alloytools.alloy with Apache License 2.0 6 votes vote down vote up
@Test
public void testBasic() {
    Options opt = new Options();
    opt.setNoOverflow(true);
    opt.setBitwidth(2);
    IncrementalSolver solver = IncrementalSolver.solver(opt);
    Universe univ = new Universe("-2", "-1", "0", "1");
    Bounds b = new Bounds(univ);
    TupleFactory factory = univ.factory();
    b.boundExactly(-2, factory.range(factory.tuple("-2"), factory.tuple("-2")));
    b.boundExactly(-1, factory.range(factory.tuple("-1"), factory.tuple("-1")));
    b.boundExactly(0, factory.range(factory.tuple("0"), factory.tuple("0")));
    b.boundExactly(1, factory.range(factory.tuple("1"), factory.tuple("1")));
    Variable n = Variable.unary("n");
    Formula f = n.sum().plus(IntConstant.constant(1)).lte(n.sum()).forSome(n.oneOf(Expression.INTS));
    Solution sol = solver.solve(f, b);
    assertNoInstance(sol);
}
 
Example 2
Source File: HOLSome4AllTest.java    From org.alloytools.alloy with Apache License 2.0 5 votes vote down vote up
protected void setupOptions() {
    options = new Options();
    options.setNoOverflow(true);
    options.setBitwidth(bw());
    options.setSolver(SATFactory.MiniSat);
    options.setAllowHOL(true);
}
 
Example 3
Source File: OverflowTheoremTest.java    From org.alloytools.alloy with Apache License 2.0 5 votes vote down vote up
protected void setupOptions() {
    options = new Options();
    options.setNoOverflow(true);
    options.setBitwidth(bw);
    options.setSolver(SATFactory.MiniSat);
    options.setSkolemDepth(0);
}
 
Example 4
Source File: Transpose4x4UnaryL.java    From kodkod with MIT License 5 votes vote down vote up
/**
 * Returns the options used for solving.
 * @return options used for solving.
 */
final Options options() {
	final Options opt = new Options();
	opt.setSolver(SATFactory.MiniSat);
	opt.setBitwidth(5);
	return opt;
}
 
Example 5
Source File: Transpose4x4UnaryLR.java    From kodkod with MIT License 5 votes vote down vote up
/**
 * Returns the options used for solving.
 * @return options used for solving.
 */
final Options options() {
	final Options opt = new Options();
	opt.setSolver(SATFactory.Glucose);
	opt.setBitwidth(6);
	opt.setReporter(new ConsoleReporter());
	return opt;
}
 
Example 6
Source File: OverflowNumTest.java    From org.alloytools.alloy with Apache License 2.0 4 votes vote down vote up
protected void setupOptions() {
    options = new Options();
    options.setNoOverflow(true);
    options.setBitwidth(bw());
    options.setSolver(SATFactory.MiniSat);
}