use of kodkod.ast.Decls in project org.alloytools.alloy by AlloyTools.
the class BugTests method testFelix_05192007.
public final void testFelix_05192007() {
Relation x5 = Relation.nary("this/de", 1);
Relation x6 = Relation.nary("this/dir", 1);
Relation x7 = Relation.nary("this/de.contents", 2);
Relation x8 = Relation.nary("this/dir.entries", 2);
Relation x9 = Relation.nary("this/dir.parent", 2);
List<String> atomlist = Arrays.asList("de[0]", "de[1]", "de[2]", "de[3]", "dir[0]", "dir[1]", "dir[2]", "dir[3]");
Universe universe = new Universe(atomlist);
TupleFactory factory = universe.factory();
Bounds bounds = new Bounds(universe);
TupleSet x5_upper = factory.noneOf(1);
x5_upper.add(factory.tuple("de[0]"));
x5_upper.add(factory.tuple("de[1]"));
x5_upper.add(factory.tuple("de[2]"));
x5_upper.add(factory.tuple("de[3]"));
bounds.bound(x5, x5_upper);
TupleSet x6_upper = factory.noneOf(1);
x6_upper.add(factory.tuple("dir[0]"));
x6_upper.add(factory.tuple("dir[1]"));
x6_upper.add(factory.tuple("dir[2]"));
x6_upper.add(factory.tuple("dir[3]"));
bounds.bound(x6, x6_upper);
TupleSet x7_upper = factory.noneOf(2);
x7_upper.add(factory.tuple("de[0]").product(factory.tuple("dir[0]")));
x7_upper.add(factory.tuple("de[0]").product(factory.tuple("dir[1]")));
x7_upper.add(factory.tuple("de[0]").product(factory.tuple("dir[2]")));
x7_upper.add(factory.tuple("de[0]").product(factory.tuple("dir[3]")));
x7_upper.add(factory.tuple("de[1]").product(factory.tuple("dir[0]")));
x7_upper.add(factory.tuple("de[1]").product(factory.tuple("dir[1]")));
x7_upper.add(factory.tuple("de[1]").product(factory.tuple("dir[2]")));
x7_upper.add(factory.tuple("de[1]").product(factory.tuple("dir[3]")));
x7_upper.add(factory.tuple("de[2]").product(factory.tuple("dir[0]")));
x7_upper.add(factory.tuple("de[2]").product(factory.tuple("dir[1]")));
x7_upper.add(factory.tuple("de[2]").product(factory.tuple("dir[2]")));
x7_upper.add(factory.tuple("de[2]").product(factory.tuple("dir[3]")));
x7_upper.add(factory.tuple("de[3]").product(factory.tuple("dir[0]")));
x7_upper.add(factory.tuple("de[3]").product(factory.tuple("dir[1]")));
x7_upper.add(factory.tuple("de[3]").product(factory.tuple("dir[2]")));
x7_upper.add(factory.tuple("de[3]").product(factory.tuple("dir[3]")));
bounds.bound(x7, x7_upper);
TupleSet x8_upper = factory.noneOf(2);
x8_upper.add(factory.tuple("dir[0]").product(factory.tuple("de[0]")));
x8_upper.add(factory.tuple("dir[0]").product(factory.tuple("de[1]")));
x8_upper.add(factory.tuple("dir[0]").product(factory.tuple("de[2]")));
x8_upper.add(factory.tuple("dir[0]").product(factory.tuple("de[3]")));
x8_upper.add(factory.tuple("dir[1]").product(factory.tuple("de[0]")));
x8_upper.add(factory.tuple("dir[1]").product(factory.tuple("de[1]")));
x8_upper.add(factory.tuple("dir[1]").product(factory.tuple("de[2]")));
x8_upper.add(factory.tuple("dir[1]").product(factory.tuple("de[3]")));
x8_upper.add(factory.tuple("dir[2]").product(factory.tuple("de[0]")));
x8_upper.add(factory.tuple("dir[2]").product(factory.tuple("de[1]")));
x8_upper.add(factory.tuple("dir[2]").product(factory.tuple("de[2]")));
x8_upper.add(factory.tuple("dir[2]").product(factory.tuple("de[3]")));
x8_upper.add(factory.tuple("dir[3]").product(factory.tuple("de[0]")));
x8_upper.add(factory.tuple("dir[3]").product(factory.tuple("de[1]")));
x8_upper.add(factory.tuple("dir[3]").product(factory.tuple("de[2]")));
x8_upper.add(factory.tuple("dir[3]").product(factory.tuple("de[3]")));
bounds.bound(x8, x8_upper);
TupleSet x9_upper = factory.noneOf(2);
x9_upper.add(factory.tuple("dir[0]").product(factory.tuple("dir[0]")));
x9_upper.add(factory.tuple("dir[0]").product(factory.tuple("dir[1]")));
x9_upper.add(factory.tuple("dir[0]").product(factory.tuple("dir[2]")));
x9_upper.add(factory.tuple("dir[0]").product(factory.tuple("dir[3]")));
x9_upper.add(factory.tuple("dir[1]").product(factory.tuple("dir[0]")));
x9_upper.add(factory.tuple("dir[1]").product(factory.tuple("dir[1]")));
x9_upper.add(factory.tuple("dir[1]").product(factory.tuple("dir[2]")));
x9_upper.add(factory.tuple("dir[1]").product(factory.tuple("dir[3]")));
x9_upper.add(factory.tuple("dir[2]").product(factory.tuple("dir[0]")));
x9_upper.add(factory.tuple("dir[2]").product(factory.tuple("dir[1]")));
x9_upper.add(factory.tuple("dir[2]").product(factory.tuple("dir[2]")));
x9_upper.add(factory.tuple("dir[2]").product(factory.tuple("dir[3]")));
x9_upper.add(factory.tuple("dir[3]").product(factory.tuple("dir[0]")));
x9_upper.add(factory.tuple("dir[3]").product(factory.tuple("dir[1]")));
x9_upper.add(factory.tuple("dir[3]").product(factory.tuple("dir[2]")));
x9_upper.add(factory.tuple("dir[3]").product(factory.tuple("dir[3]")));
bounds.bound(x9, x9_upper);
Expression x39 = x5.union(Expression.INTS);
Expression x38 = x6.union(x39);
Expression x37 = x38.product(Expression.UNIV);
Expression x35 = Expression.IDEN.intersection(x37);
Expression x34 = x35.intersection(x7);
Formula x33 = x34.no();
Variable x44 = Variable.nary("functional_x", 1);
Decls x43 = x44.oneOf(x5);
Expression x48 = x44.join(x7);
Formula x47 = x48.lone();
Formula x45 = Formula.TRUE.implies(x47);
Formula x42 = x45.forAll(x43);
Formula x32 = x33.and(x42);
Variable x51 = Variable.nary("total_x", 1);
Decls x50 = x51.oneOf(x5);
Expression x54 = x51.join(x7);
Formula x53 = x54.some();
Formula x52 = Formula.TRUE.implies(x53);
Formula x49 = x52.forAll(x50);
Formula x31 = x32.and(x49);
Variable x57 = Variable.nary("injective_x", 1);
Decls x56 = x57.oneOf(x6);
Expression x60 = x7.join(x57);
Formula x59 = x60.lone();
Formula x58 = Formula.TRUE.implies(x59);
Formula x55 = x58.forAll(x56);
Formula x30 = x31.and(x55);
Expression x63 = x7.join(x8);
Expression x62 = x63.transpose();
Formula x61 = x62.in(x63);
Formula x29 = x30.and(x61);
Variable x66 = Variable.nary("acyclic_x", 1);
Decls x65 = x66.oneOf(x5);
Expression x72 = x7.join(x8);
Expression x71 = x72.closure();
Expression x70 = x66.join(x71);
Formula x69 = x66.in(x70);
Formula x68 = x69.not();
Formula x67 = Formula.TRUE.implies(x68);
Formula x64 = x67.forAll(x65);
Formula x28 = x29.and(x64);
Variable x75 = Variable.nary("surjective_x", 1);
Decls x74 = x75.oneOf(x5);
Expression x78 = x8.join(x75);
Formula x77 = x78.some();
Formula x76 = Formula.TRUE.implies(x77);
Formula x73 = x76.forAll(x74);
Formula x27 = x28.and(x73);
Variable x81 = Variable.nary("functional_x", 1);
Decls x80 = x81.oneOf(x6);
Expression x84 = x81.join(x8);
Formula x83 = x84.lone();
Formula x82 = Formula.TRUE.implies(x83);
Formula x79 = x82.forAll(x80);
Formula x26 = x27.and(x79);
Variable x87 = Variable.nary("acyclic_x", 1);
Decls x86 = x87.oneOf(x6);
Expression x93 = x8.join(x7);
Expression x92 = x93.closure();
Expression x91 = x87.join(x92);
Formula x90 = x87.in(x91);
Formula x89 = x90.not();
Formula x88 = Formula.TRUE.implies(x89);
Formula x85 = x88.forAll(x86);
Formula x25 = x26.and(x85);
Expression x96 = x9.transpose();
Expression x95 = x96.intersection(x9);
Expression x98 = x38.product(Expression.UNIV);
Expression x97 = Expression.IDEN.intersection(x98);
Formula x94 = x95.in(x97);
Formula x24 = x25.and(x94);
Expression x102 = x38.product(Expression.UNIV);
Expression x101 = Expression.IDEN.intersection(x102);
Expression x100 = x101.intersection(x9);
Formula x99 = x100.no();
Formula x23 = x24.and(x99);
Expression x106 = x38.product(Expression.UNIV);
Expression x105 = Expression.IDEN.intersection(x106);
Expression x104 = x105.intersection(x8);
Formula x103 = x104.no();
Formula x22 = x23.and(x103);
Variable x109 = Variable.nary("injective_x", 1);
Decls x108 = x109.oneOf(x5);
Expression x112 = x8.join(x109);
Formula x111 = x112.lone();
Formula x110 = Formula.TRUE.implies(x111);
Formula x107 = x110.forAll(x108);
Formula x21 = x22.and(x107);
Variable x115 = Variable.nary("acyclic_x", 1);
Decls x114 = x115.oneOf(x6);
Expression x120 = x9.closure();
Expression x119 = x115.join(x120);
Formula x118 = x115.in(x119);
Formula x117 = x118.not();
Formula x116 = Formula.TRUE.implies(x117);
Formula x113 = x116.forAll(x114);
Formula x20 = x21.and(x113);
Variable x123 = Variable.nary("functional_x", 1);
Decls x122 = x123.oneOf(x6);
Expression x126 = x123.join(x9);
Formula x125 = x126.lone();
Formula x124 = Formula.TRUE.implies(x125);
Formula x121 = x124.forAll(x122);
Formula x19 = x20.and(x121);
Variable x129 = Variable.nary("injective_x", 1);
Decls x128 = x129.oneOf(x6);
Expression x132 = x9.join(x129);
Formula x131 = x132.lone();
Formula x130 = Formula.TRUE.implies(x131);
Formula x127 = x130.forAll(x128);
Formula x18 = x19.and(x127);
Variable x137 = Variable.nary("rootedOne_root", 1);
Decls x136 = x137.oneOf(x6);
Variable x139 = Variable.nary("rootedOne_root", 1);
Decls x138 = x139.oneOf(x6);
Decls x135 = x136.and(x138);
Expression x146 = x9.closure();
Expression x148 = x38.product(Expression.UNIV);
Expression x147 = Expression.IDEN.intersection(x148);
Expression x145 = x146.union(x147);
Expression x144 = x137.join(x145);
Formula x143 = x6.in(x144);
Expression x152 = x9.closure();
Expression x154 = x38.product(Expression.UNIV);
Expression x153 = Expression.IDEN.intersection(x154);
Expression x151 = x152.union(x153);
Expression x150 = x139.join(x151);
Formula x149 = x6.in(x150);
Formula x142 = x143.and(x149);
Formula x156 = x137.eq(x139);
Formula x155 = x156.and(Formula.TRUE);
Formula x141 = x142.implies(x155);
Formula x140 = Formula.TRUE.implies(x141);
Formula x134 = x140.forAll(x135);
Variable x159 = Variable.nary("rootedOne_root", 1);
Decls x158 = x159.oneOf(x6);
Expression x164 = x9.closure();
Expression x166 = x38.product(Expression.UNIV);
Expression x165 = Expression.IDEN.intersection(x166);
Expression x163 = x164.union(x165);
Expression x162 = x159.join(x163);
Formula x161 = x6.in(x162);
Formula x160 = Formula.TRUE.and(x161);
Formula x157 = x160.forSome(x158);
Formula x133 = x134.and(x157);
Formula x17 = x18.and(x133);
Variable x170 = Variable.nary("weaklyConnected_d", 1);
Decls x169 = x170.oneOf(x6);
Variable x172 = Variable.nary("weaklyConnected_g", 1);
Decls x171 = x172.oneOf(x6);
Decls x168 = x169.and(x171);
Formula x177 = x170.eq(x172);
Formula x176 = x177.not();
Formula x175 = x176.not();
Expression x182 = x9.transpose();
Expression x181 = x9.union(x182);
Expression x180 = x181.closure();
Expression x179 = x172.join(x180);
Formula x178 = x170.in(x179);
Formula x174 = x175.or(x178);
Formula x173 = Formula.TRUE.implies(x174);
Formula x167 = x173.forAll(x168);
Formula x16 = x17.and(x167);
Expression x187 = x8.join(x7);
Expression x188 = Expression.UNIV.product(x6);
Expression x186 = x187.intersection(x188);
Expression x185 = x9.union(x186);
Expression x184 = x185.transpose();
Formula x183 = x184.in(x185);
Formula x15 = x16.and(x183);
Variable x191 = Variable.nary("inner_injective_x", 1);
Variable x197 = Variable.nary("ternary_a", 1);
Expression x198 = x7.join(x38);
Decls x196 = x197.oneOf(x198);
Variable x200 = Variable.nary("ternary_b", 1);
Expression x202 = x38.join(x7);
Expression x203 = x8.join(x38);
Expression x201 = x202.intersection(x203);
Decls x199 = x200.oneOf(x201);
Variable x205 = Variable.nary("ternary_c", 1);
Expression x206 = x38.join(x8);
Decls x204 = x205.oneOf(x206);
Decls x195 = x196.and(x199).and(x204);
Expression x209 = x197.product(x200);
Formula x208 = x209.in(x7);
Expression x211 = x200.product(x205);
Formula x210 = x211.in(x8);
Formula x207 = x208.and(x210);
Expression x194 = x207.comprehension(x195);
Expression x193 = x194.join(x38);
Expression x192 = x193.join(x38);
Decls x190 = x191.oneOf(x192);
Variable x215 = Variable.nary("injective_x", 1);
Expression x217 = x191.join(x194);
Expression x216 = x38.join(x217);
Decls x214 = x215.oneOf(x216);
Expression x221 = x191.join(x194);
Expression x220 = x221.join(x215);
Formula x219 = x220.lone();
Formula x218 = Formula.TRUE.implies(x219);
Formula x213 = x218.forAll(x214);
Formula x212 = Formula.TRUE.implies(x213);
Formula x189 = x212.forAll(x190);
Formula x14 = x15.and(x189);
Variable x224 = Variable.nary("inner_injective_x", 1);
Variable x230 = Variable.nary("ternary_a", 1);
Expression x231 = x8.join(x38);
Decls x229 = x230.oneOf(x231);
Variable x233 = Variable.nary("ternary_b", 1);
Expression x235 = x38.join(x8);
Expression x236 = x7.join(x38);
Expression x234 = x235.intersection(x236);
Decls x232 = x233.oneOf(x234);
Variable x238 = Variable.nary("ternary_c", 1);
Expression x239 = x38.join(x7);
Decls x237 = x238.oneOf(x239);
Decls x228 = x229.and(x232).and(x237);
Expression x242 = x230.product(x233);
Formula x241 = x242.in(x8);
Expression x244 = x233.product(x238);
Formula x243 = x244.in(x7);
Formula x240 = x241.and(x243);
Expression x227 = x240.comprehension(x228);
Expression x226 = x227.join(x38);
Expression x225 = x226.join(x38);
Decls x223 = x224.oneOf(x225);
Variable x248 = Variable.nary("injective_x", 1);
Expression x250 = x224.join(x227);
Expression x249 = x38.join(x250);
Decls x247 = x248.oneOf(x249);
Expression x254 = x224.join(x227);
Expression x253 = x254.join(x248);
Formula x252 = x253.lone();
Formula x251 = Formula.TRUE.implies(x252);
Formula x246 = x251.forAll(x247);
Formula x245 = Formula.TRUE.implies(x246);
Formula x222 = x245.forAll(x223);
Formula x13 = x14.and(x222);
Variable x259 = Variable.nary("rootedOne_root", 1);
Decls x258 = x259.oneOf(x6);
Variable x261 = Variable.nary("rootedOne_root", 1);
Decls x260 = x261.oneOf(x6);
Decls x257 = x258.and(x260);
Variable x272 = Variable.nary("rootedOne_a", 1);
Decls x271 = x272.oneOf(x6);
Variable x274 = Variable.nary("rootedOne_b", 1);
Decls x273 = x274.oneOf(x6);
Decls x270 = x271.and(x273);
Variable x277 = Variable.nary("rootedOne_c", 1);
Decls x276 = x277.oneOf(x38);
Expression x281 = x277.product(x274);
Expression x280 = x272.product(x281);
Variable x285 = Variable.nary("ternary_a", 1);
Expression x286 = x8.join(x38);
Decls x284 = x285.oneOf(x286);
Variable x288 = Variable.nary("ternary_b", 1);
Expression x290 = x38.join(x8);
Expression x291 = x7.join(x38);
Expression x289 = x290.intersection(x291);
Decls x287 = x288.oneOf(x289);
Variable x293 = Variable.nary("ternary_c", 1);
Expression x294 = x38.join(x7);
Decls x292 = x293.oneOf(x294);
Decls x283 = x284.and(x287).and(x292);
Expression x297 = x285.product(x288);
Formula x296 = x297.in(x8);
Expression x299 = x288.product(x293);
Formula x298 = x299.in(x7);
Formula x295 = x296.and(x298);
Expression x282 = x295.comprehension(x283);
Formula x279 = x280.in(x282);
Formula x278 = Formula.TRUE.and(x279);
Formula x275 = x278.forSome(x276);
Expression x269 = x275.comprehension(x270);
Expression x268 = x269.closure();
Expression x301 = x38.product(Expression.UNIV);
Expression x300 = Expression.IDEN.intersection(x301);
Expression x267 = x268.union(x300);
Expression x266 = x259.join(x267);
Formula x265 = x6.in(x266);
Variable x309 = Variable.nary("rootedOne_a", 1);
Decls x308 = x309.oneOf(x6);
Variable x311 = Variable.nary("rootedOne_b", 1);
Decls x310 = x311.oneOf(x6);
Decls x307 = x308.and(x310);
Variable x314 = Variable.nary("rootedOne_c", 1);
Decls x313 = x314.oneOf(x38);
Expression x318 = x314.product(x311);
Expression x317 = x309.product(x318);
Formula x316 = x317.in(x282);
Formula x315 = Formula.TRUE.and(x316);
Formula x312 = x315.forSome(x313);
Expression x306 = x312.comprehension(x307);
Expression x305 = x306.closure();
Expression x320 = x38.product(Expression.UNIV);
Expression x319 = Expression.IDEN.intersection(x320);
Expression x304 = x305.union(x319);
Expression x303 = x261.join(x304);
Formula x302 = x6.in(x303);
Formula x264 = x265.and(x302);
Formula x322 = x259.eq(x261);
Formula x321 = x322.and(Formula.TRUE);
Formula x263 = x264.implies(x321);
Formula x262 = Formula.TRUE.implies(x263);
Formula x256 = x262.forAll(x257);
Variable x325 = Variable.nary("rootedOne_root", 1);
Decls x324 = x325.oneOf(x6);
Variable x334 = Variable.nary("rootedOne_a", 1);
Decls x333 = x334.oneOf(x6);
Variable x336 = Variable.nary("rootedOne_b", 1);
Decls x335 = x336.oneOf(x6);
Decls x332 = x333.and(x335);
Variable x339 = Variable.nary("rootedOne_c", 1);
Decls x338 = x339.oneOf(x38);
Expression x343 = x339.product(x336);
Expression x342 = x334.product(x343);
Formula x341 = x342.in(x282);
Formula x340 = Formula.TRUE.and(x341);
Formula x337 = x340.forSome(x338);
Expression x331 = x337.comprehension(x332);
Expression x330 = x331.closure();
Expression x345 = x38.product(Expression.UNIV);
Expression x344 = Expression.IDEN.intersection(x345);
Expression x329 = x330.union(x344);
Expression x328 = x325.join(x329);
Formula x327 = x6.in(x328);
Formula x326 = Formula.TRUE.and(x327);
Formula x323 = x326.forSome(x324);
Formula x255 = x256.and(x323);
Formula x12 = x13.and(x255);
Expression x348 = x9.join(x9);
Formula x347 = x348.in(x9);
Formula x346 = x347.not();
Formula x11 = x12.and(x346);
Expression x352 = x6.product(x6);
Formula x351 = x9.in(x352);
Expression x355 = x6.product(x5);
Formula x354 = x8.in(x355);
Expression x359 = x5.product(x6);
Formula x358 = x7.in(x359);
Formula x363 = Formula.TRUE.and(Formula.TRUE);
Formula x362 = Formula.TRUE.and(x363);
Formula x361 = Formula.TRUE.and(x362);
Formula x360 = Formula.TRUE.and(x361);
Formula x357 = x358.and(x360);
Formula x356 = Formula.TRUE.and(x357);
Formula x353 = x354.and(x356);
Formula x350 = x351.and(x353);
Formula x349 = Formula.TRUE.and(x350);
Formula x10 = x11.and(x349);
Solver solver = new Solver();
solver.options().setLogTranslation(1);
solver.options().setSolver(SATFactory.MiniSatProver);
solver.options().setBitwidth(4);
solver.options().setIntEncoding(Options.IntEncoding.TWOSCOMPLEMENT);
Solution sol = solver.solve(x10, bounds);
// System.out.println(sol.toString());
Proof proof = sol.proof();
proof.minimize(new RCEStrategy(proof.log()));
Set<Formula> core = Nodes.minRoots(x10, sol.proof().highLevelCore().values());
// final Set<Formula> minCore = new LinkedHashSet<Formula>(core);
// for(Iterator<Formula> itr = minCore.iterator(); itr.hasNext();) {
// Formula f = itr.next();
// Formula noF = Formula.TRUE;
// for( Formula f1 : minCore ) {
// if (f!=f1)
// noF = noF.and(f1);
// }
// if (solver.solve(noF, bounds).instance()==null) {
// itr.remove();
// }
// }
// assertTrue(minCore.size()==core.size());
assertTrue(isMinimal(solver, bounds, core));
}
use of kodkod.ast.Decls in project org.alloytools.alloy by AlloyTools.
the class BugTests method testBGP_03172011.
public final void testBGP_03172011() {
Relation x5 = Relation.unary("s012");
Relation x8 = Relation.unary("zero");
Relation x9 = Relation.unary("one");
Relation x12 = Relation.nary("next", 2);
Universe universe = new Universe(Arrays.asList("0", "1", "2", "3"));
TupleFactory factory = universe.factory();
Bounds bounds = new Bounds(universe);
bounds.boundExactly(x5, factory.setOf("0", "1", "2"));
bounds.boundExactly(x8, factory.setOf("0"));
bounds.bound(x9, factory.setOf("1"), factory.setOf("1", "2"));
TupleSet x12_upper = factory.noneOf(2);
x12_upper.add(factory.tuple("1", "2"));
x12_upper.add(factory.tuple("2", "3"));
bounds.boundExactly(x12, x12_upper);
Variable x714 = Variable.unary("x714");
Decls x713 = x714.oneOf(x8.union(x9));
Variable x720 = Variable.unary("x720");
Expression x723 = x8.union(x9);
Expression x724 = x9.join(x12);
Expression x722 = x723.union(x724);
Expression x721 = x722.difference(x714);
Decls x719 = x720.oneOf(x721);
Variable x727 = Variable.unary("x727");
Expression x732 = x714.union(x720);
Expression x728 = x5.difference(x732);
Decls x726 = x727.oneOf(x728);
Variable x735 = Variable.unary("x735");
Decls x734 = x735.oneOf(x8);
Variable x893 = Variable.unary("x893");
Decls x892 = x893.oneOf(x727);
Formula x894 = x720.no();
Formula x891 = x894.forAll(x892);
Formula x712 = x891.forSome(x713.and(x719).and(x726).and(x734));
Formula x267 = Formula.FALSE.or(x712);
Solver solver = new Solver();
solver.options().setSolver(SATFactory.MiniSat);
solver.options().setBitwidth(4);
// solver.options().setFlatten(false);
solver.options().setIntEncoding(Options.IntEncoding.TWOSCOMPLEMENT);
solver.options().setSymmetryBreaking(20);
solver.options().setSkolemDepth(0);
final Solution sol = solver.solve(x267, bounds);
assertEquals(sol.outcome(), Solution.Outcome.TRIVIALLY_UNSATISFIABLE);
}
use of kodkod.ast.Decls in project org.alloytools.alloy by AlloyTools.
the class BugTests method testFelix_06192008.
public final void testFelix_06192008() {
Relation x5 = Relation.unary("R");
List<String> atomlist = Arrays.asList("X");
Universe universe = new Universe(atomlist);
TupleFactory factory = universe.factory();
Bounds bounds = new Bounds(universe);
TupleSet x5_upper = factory.noneOf(1);
x5_upper.add(factory.tuple("X"));
bounds.bound(x5, x5_upper);
Variable x10 = Variable.unary("a");
Expression x11 = x5.difference(x5);
Decls x9 = x10.oneOf(x11);
Variable x14 = Variable.nary("b", 2);
Expression x15 = x5.product(x5);
Decls x13 = x14.setOf(x15);
Expression x19 = x5.product(x5);
Formula x17 = x14.in(x19);
Expression x22 = x10.product(x10);
Formula x21 = x22.eq(x14);
Formula x16 = x17.and(x21);
Formula x12 = x16.forSome(x13);
Formula x7 = x12.forAll(x9);
// System.out.println(x7);
Solver solver = new Solver();
solver.options().setSolver(SATFactory.DefaultSAT4J);
solver.options().setBitwidth(4);
// solver.options().setFlatten(false);
solver.options().setIntEncoding(Options.IntEncoding.TWOSCOMPLEMENT);
solver.options().setSymmetryBreaking(20);
// System.out.println("Depth=0..."); System.out.flush();
solver.options().setSkolemDepth(0);
assertEquals(Solution.Outcome.TRIVIALLY_SATISFIABLE, solver.solve(x7, bounds).outcome());
// System.out.println("Depth=1..."); System.out.flush();
solver.options().setSkolemDepth(1);
final Solution sol = solver.solve(x7, bounds);
assertEquals(Solution.Outcome.SATISFIABLE, sol.outcome());
assertEquals(2, sol.instance().relations().size());
for (Relation r : sol.instance().relations()) {
assertTrue(sol.instance().tuples(r).isEmpty());
}
}
Aggregations