Module logicng

Class FormulaDimacsFileWriter


  • public final class FormulaDimacsFileWriter
    extends Object
    A dimacs file writer for a formula. Writes the internal data structure of the formula to a dimacs file.
    Since:
    1.2
    Version:
    2.4.0
    • Method Detail

      • write

        public static void write​(String fileName,
                                 Formula formula,
                                 boolean writeMapping)
                          throws IOException
        Writes a given formula's internal data structure as a dimacs file. Must only be called with a formula which is in CNF.
        Parameters:
        fileName - the file name of the dimacs file to write, will be extended by suffix .cnf if not already present
        formula - the formula in CNF
        writeMapping - indicates whether an additional file for translating the ids to variable names shall be written
        Throws:
        IOException - if there was a problem writing the file
        IllegalArgumentException - if the formula was not in CNF