try {
final Translation translation = Translator.translate(formula, bounds, options);
final long endTransl = System.currentTimeMillis();
final SATMinSolver cnf = (SATMinSolver)translation.cnf();
for(Relation r : bounds.relations()) {
IntSet vars = translation.primaryVariables(r);
if (vars != null) {
int rcost = cost.edgeCost(r);
for(IntIterator iter = vars.iterator(); iter.hasNext(); ) {
cnf.setCost(iter.next(), rcost);
}
}
}
options.reporter().solvingCNF(0, cnf.numberOfVariables(), cnf.numberOfClauses());
final long startSolve = System.currentTimeMillis();
final boolean isSat = cnf.solve();
final long endSolve = System.currentTimeMillis();
final Statistics stats = new Statistics(translation, endTransl - startTransl, endSolve - startSolve);
return isSat ? sat(bounds, translation, stats) : unsat(translation, stats);