use of kodkod.engine.Solution 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.engine.Solution 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.engine.Solution 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.engine.Solution 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();
}
}
use of kodkod.engine.Solution in project org.alloytools.alloy by AlloyTools.
the class GRA013_026 method main.
/**
* Usage: java examples.tptp.GRA013_026 <graph size> <clique size>
*/
public static void main(String[] args) {
if (args.length < 2)
usage();
try {
final GRA013_026 model = new GRA013_026(Integer.parseInt(args[0]), Integer.parseInt(args[1]));
final Bounds b = model.bounds();
final Solver solver = new Solver();
solver.options().setSolver(SATFactory.MiniSat);
solver.options().setReporter(new ConsoleReporter());
final Formula f = model.checkGoalToBeProved();
System.out.println(PrettyPrinter.print(f, 2));
// System.out.println(b);
final Solution s = solver.solve(f, b);
System.out.println(s);
// System.out.println((new Evaluator(s.instance())).evaluate(f));
} catch (HigherOrderDeclException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnboundLeafException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NumberFormatException nfe) {
usage();
}
}
Aggregations