Clover coverage report -
Coverage timestamp: jeu. sept. 29 2005 23:57:39 CEST
file stats: LOC: 67   Methods: 1
NCLOC: 46   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
MoreThanSAT.java 0% 0% 0% 0%
coverage
 1    package org.sat4j;
 2   
 3    import java.io.FileNotFoundException;
 4    import java.io.IOException;
 5   
 6    import org.sat4j.minisat.SolverFactory;
 7    import org.sat4j.reader.InstanceReader;
 8    import org.sat4j.reader.ParseFormatException;
 9    import org.sat4j.reader.Reader;
 10    import org.sat4j.specs.ContradictionException;
 11    import org.sat4j.specs.IProblem;
 12    import org.sat4j.specs.ISolver;
 13    import org.sat4j.specs.IVecInt;
 14    import org.sat4j.specs.TimeoutException;
 15    import org.sat4j.tools.RemiUtils;
 16    import org.sat4j.tools.SolutionCounter;
 17   
 18    /*
 19    * Created on 21 dï¿œc. 2004
 20    *
 21    * TODO To change the template for this generated file go to
 22    * Window - Preferences - Java - Code Style - Code Templates
 23    */
 24   
 25    /**
 26    * This is an example of use of the SAT4J library for computing the backbone of
 27    * a CNF or to compute the number of solutions of a CNF. We do not claim that
 28    * those tools are very efficient: they were simple to write and they helped us
 29    * on small examples.
 30    *
 31    * @author leberre
 32    */
 33    public class MoreThanSAT {
 34   
 35  0 public static void main(String[] args) {
 36  0 ISolver solver = SolverFactory.newMiniLearning();
 37  0 SolutionCounter sc = new SolutionCounter(solver);
 38  0 solver.setTimeout(3600); // 1 hour timeout
 39  0 Reader reader = new InstanceReader(solver);
 40   
 41    // filename is given on the command line
 42  0 try {
 43  0 IProblem problem = reader.parseInstance(args[0]);
 44  0 if (problem.isSatisfiable()) {
 45  0 System.out.println("Satisfiable !");
 46  0 System.out.println(reader.decode(problem.model()));
 47  0 IVecInt backbone = RemiUtils.backbone(solver);
 48  0 System.out.println("BackBone:" + backbone);
 49  0 System.out.println("Counting solutions...");
 50  0 System.out.println("Number of solutions : "
 51    + sc.countSolutions());
 52    } else {
 53  0 System.out.println("Unsatisfiable !");
 54    }
 55    } catch (FileNotFoundException e) {
 56  0 e.printStackTrace();
 57    } catch (ParseFormatException e) {
 58  0 e.printStackTrace();
 59    } catch (IOException e) {
 60  0 e.printStackTrace();
 61    } catch (ContradictionException e) {
 62  0 System.out.println("Unsatisfiable (trivial)!");
 63    } catch (TimeoutException e) {
 64  0 System.out.println("Timeout, sorry!");
 65    }
 66    }
 67    }