org.sat4j.reader
Class CSPReader

java.lang.Object
  extended by org.sat4j.reader.CSPReader
All Implemented Interfaces:
Reader

public class CSPReader
extends java.lang.Object
implements Reader

This class is a CSP to SAT translator that is able to read a CSP problem using the First CSP solver competition input format and that translates it into clausal and cardinality (equality) constraints. That code has not been tested very thoroughtly yet and was written very quickly to meet the competition deadline :=)) There is plenty of room for improvement.

Author:
leberre

Constructor Summary
CSPReader(ISolver solver)
           
 
Method Summary
 java.lang.String decode(int[] model)
          Produce a model using the reader format.
 void parseInstance(java.io.LineNumberReader in)
           
 IProblem parseInstance(java.lang.String filename)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSPReader

public CSPReader(ISolver solver)
Method Detail

parseInstance

public IProblem parseInstance(java.lang.String filename)
                       throws java.io.FileNotFoundException,
                              ParseFormatException,
                              java.io.IOException,
                              ContradictionException
Specified by:
parseInstance in interface Reader
Throws:
java.io.FileNotFoundException
ParseFormatException
java.io.IOException
ContradictionException

parseInstance

public void parseInstance(java.io.LineNumberReader in)
                   throws ParseFormatException,
                          ContradictionException
Throws:
ParseFormatException
ContradictionException

decode

public java.lang.String decode(int[] model)
Description copied from interface: Reader
Produce a model using the reader format.

Specified by:
decode in interface Reader
Parameters:
model - a model using the Dimacs format.
Returns:
a human readable view of the model.