Package kodkod.engine.satlab

Examples of kodkod.engine.satlab.SATMinSolver


    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);
View Full Code Here

TOP

Related Classes of kodkod.engine.satlab.SATMinSolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.