use of kodkod.ast.Decl in project org.alloytools.alloy by AlloyTools.
the class BugTests method testFelix_11262007.
public final void testFelix_11262007() {
Relation x6 = Relation.unary("R2");
List<String> atomlist = Arrays.asList("X", "Y", "Z");
Universe universe = new Universe(atomlist);
TupleFactory factory = universe.factory();
Bounds bounds = new Bounds(universe);
bounds.bound(x6, factory.allOf(1));
final Variable x32 = Variable.unary("a");
final Decls x31 = x32.oneOf(x6);
final Variable x36 = Variable.unary("b");
final Decls x35 = x36.oneOf(x32.join(x6.product(x6)));
final Formula x29 = x36.some().forSome(x35).forSome(x31);
Solver solver = new Solver();
solver.options().setSolver(SATFactory.DefaultSAT4J);
solver.options().setBitwidth(4);
solver.options().setIntEncoding(Options.IntEncoding.TWOSCOMPLEMENT);
solver.options().setSymmetryBreaking(20);
solver.options().setSkolemDepth(0);
final Set<Decl> decls = new LinkedHashSet<Decl>();
solver.options().setReporter(new AbstractReporter() {
@Override
public void skolemizing(Decl decl, Relation skolem, List<Decl> predecl) {
decls.add(decl);
}
});
Solution sol = solver.solve(x29, bounds);
assertEquals(2, decls.size());
assertTrue(decls.contains(x31));
assertTrue(decls.contains(x35));
assertNotNull(sol.instance());
}
use of kodkod.ast.Decl in project org.alloytools.alloy by AlloyTools.
the class BugTests method doTestAleks_03102013.
private final void doTestAleks_03102013() {
Relation r = Relation.unary("R");
Relation s = Relation.binary("f");
Variable v = Variable.unary("e");
Decl decl = v.oneOf(r);
Expression shared = v.join(s);
Formula expr = (shared.difference(shared)).one().forAll(decl);
Formula fin = expr.and(expr.not());
List<Object> atomlist = new LinkedList<Object>();
atomlist.add("R$0");
atomlist.add("R$1");
atomlist.add("R$2");
Universe universe = new Universe(atomlist);
TupleFactory factory = universe.factory();
Bounds bounds = new Bounds(universe);
bounds.bound(r, factory.allOf(1));
bounds.bound(s, factory.allOf(2));
Solver solver = new Solver();
solver.options().setSolver(SATFactory.DefaultSAT4J);
solver.options().setBitwidth(4);
solver.options().setSkolemDepth(0);
solver.options().setLogTranslation(0);
Solution sol = solver.solve(fin, bounds);
assertNull(sol.instance());
}
Aggregations