use of kodkod.instance.Bounds in project org.alloytools.alloy by AlloyTools.
the class GEO091 method main.
/**
* Usage: java examples.tptp.GEO191 [univ size]
*/
public static void main(String[] args) {
if (args.length < 1)
usage();
try {
final int n = Integer.parseInt(args[0]);
final Solver solver = new Solver();
solver.options().setSolver(SATFactory.MiniSat);
final GEO091 model = new GEO091();
final Formula f = model.checkTheorem_2_13();
System.out.println(model.theorem_2_13());
final Bounds b = model.bounds(n);
final Solution sol = solver.solve(f, b);
System.out.println(sol);
// System.out.println((new
// Evaluator(sol.instance())).evaluate(model.axioms().and(model.theorem213().not())));
} catch (NumberFormatException nfe) {
usage();
}
}
use of kodkod.instance.Bounds in project org.alloytools.alloy by AlloyTools.
the class ALG195 method main.
/**
* Usage: java examples.tptp.ALG195
*/
public static void main(String[] args) {
try {
final ALG195 model = new ALG195();
final Solver solver = new Solver();
solver.options().setSolver(SATFactory.MiniSat);
final Formula f = model.checkCO1();
final Bounds b = model.bounds();
// System.out.println(model.decls());
// System.out.println(model.ax2ax7());
// System.out.println(b);
final Solution sol = solver.solve(f, b);
if (sol.instance() == null) {
System.out.println(sol);
} else {
System.out.println(sol.stats());
model.display(sol.instance());
}
} catch (NumberFormatException nfe) {
usage();
}
}
use of kodkod.instance.Bounds in project org.alloytools.alloy by AlloyTools.
the class ALG197 method bounds.
/**
* Returns the bounds the problem (axioms 1, 4, 9-11, last formula of 14-15, and
* first formula of 16-22).
*
* @return the bounds for the problem
*/
@Override
public final Bounds bounds() {
final Bounds b = super.bounds();
final TupleFactory f = b.universe().factory();
final TupleSet op1h = b.upperBound(op1).clone();
final TupleSet op2h = b.upperBound(op2).clone();
// axiom
final TupleSet op1l = f.setOf(f.tuple("e16", "e16", "e15"));
// 14,
// line
// 6
// axiom
final TupleSet op2l = f.setOf(f.tuple("e26", "e26", "e25"));
// 15,
// line
// 6
op1h.removeAll(f.area(f.tuple("e16", "e16", "e10"), f.tuple("e16", "e16", "e16")));
op1h.addAll(op1l);
op2h.removeAll(f.area(f.tuple("e26", "e26", "e20"), f.tuple("e26", "e26", "e26")));
op2h.addAll(op2l);
b.bound(op1, op1l, op1h);
b.bound(op2, op2l, op2h);
final TupleSet high = f.area(f.tuple("e10", "e20"), f.tuple("e15", "e26"));
// first line of axioms 16-22
for (int i = 0; i < 7; i++) {
Tuple t = f.tuple("e16", "e2" + i);
high.add(t);
b.bound(h[i], f.setOf(t), high);
high.remove(t);
}
return b;
}
use of kodkod.instance.Bounds in project org.alloytools.alloy by AlloyTools.
the class ALG197 method main.
/**
* Usage: java examples.tptp.ALG197
*/
public static void main(String[] args) {
try {
final ALG197 model = new ALG197();
final Solver solver = new Solver();
solver.options().setSolver(SATFactory.MiniSat);
final Formula f = model.checkCO1();
final Bounds b = model.bounds();
final Solution sol = solver.solve(f, b);
if (sol.instance() == null) {
System.out.println(sol);
} else {
System.out.println(sol.stats());
model.display(sol.instance());
}
} catch (NumberFormatException nfe) {
usage();
}
}
use of kodkod.instance.Bounds in project org.alloytools.alloy by AlloyTools.
the class GEO092 method main.
/**
* Usage: ava examples.tptp.GEO192 [# curves] [# points]
*/
public static void main(String[] args) {
if (args.length < 2)
usage();
try {
final int n = Integer.parseInt(args[0]);
final Solver solver = new Solver();
solver.options().setSolver(SATFactory.MiniSat);
final GEO092 model = new GEO092();
final Formula f = model.checkProposition2141();
System.out.println(model.proposition2141());
final Bounds b = model.bounds(n);
final Solution sol = solver.solve(f, b);
System.out.println(sol);
// System.out.println((new
// Evaluator(sol.instance())).evaluate(model.axioms().and(model.theorem213().not())));
} catch (NumberFormatException nfe) {
usage();
}
}
Aggregations