org.sat4j.tools
Class DimacsArrayToDimacsConverter

java.lang.Object
  extended by org.sat4j.tools.DimacsArrayToDimacsConverter
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ExtendedDimacsArrayToDimacsConverter

public class DimacsArrayToDimacsConverter
extends java.lang.Object
implements java.io.Serializable

Converts Dimacs problems in array format (without the terminating 0) to Dimacs Strings. Adaptation of org.sat4j.reader.DimacsReader.

Author:
dlb, or, fuhs
See Also:
Serialized Form

Field Summary
protected  int clauses
           
protected  java.lang.StringBuilder dimacs
           
 
Constructor Summary
DimacsArrayToDimacsConverter(int bufSize)
           
 
Method Summary
 java.lang.String decode(int[] model)
           
protected  boolean handleConstr(int gateType, int output, int[] inputs)
           
protected  void init()
           
 java.lang.String parseInstance(int[] gateType, int[] outputs, int[][] inputs, int maxVar)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clauses

protected int clauses

dimacs

protected java.lang.StringBuilder dimacs
Constructor Detail

DimacsArrayToDimacsConverter

public DimacsArrayToDimacsConverter(int bufSize)
Method Detail

handleConstr

protected boolean handleConstr(int gateType,
                               int output,
                               int[] inputs)
                        throws ContradictionException
Throws:
ContradictionException

parseInstance

public java.lang.String parseInstance(int[] gateType,
                                      int[] outputs,
                                      int[][] inputs,
                                      int maxVar)
                               throws ContradictionException
Parameters:
gateType - gateType[i] is the type of gate i according to the Extended Dimacs specs; ignored in DimacsArrayReader, but important for inheriting classes
outputs - outputs[i] is the number of the output; ignored in DimacsArrayReader
inputs - inputs[i] contains the clauses in DimacsArrayReader; an overriding class might have it contain the inputs of the current gate
maxVar - the maximum number of assigned ids
Throws:
ContradictionException - si le probleme est trivialement inconsitant

init

protected void init()

decode

public java.lang.String decode(int[] model)


Copyright © 2007 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.