mios-1.2.1: A Minisat-based SAT solver in Haskell

Safe HaskellSafe
LanguageHaskell2010

SAT.Util.CNFIO.Writer

Contents

Description

Write SAT data to CNF file

Synopsis

Interface

toFile :: FilePath -> [[Int]] -> IO () Source #

Write the CNF to file f, using toCNFString

toCNFString :: [[Int]] -> String Source #

Convert [Clause] to String, where Clause is [Int]

>>> toCNFString []
"p cnf 0 0\n"
>>> toCNFString [[-1, 2], [-3, -4]]
"p cnf 4 2\n-1 2 0\n-3 -4 0\n"
>>> toCNFString [[1], [-2], [-3, -4], [1,2,3,4]]
"p cnf 4 4\n1 0\n-2 0\n-3 -4 0\n1 2 3 4 0\n"

toString :: [[Int]] -> String -> String -> String Source #

converts [[Int]] to a String

toLatexString :: [[Int]] -> String Source #

converts [[Int]] to a LaTeX expression