parse-dimacs-1.3: DIMACS CNF parser library

Safe HaskellSafe-Inferred

Language.CNF.Parse.ParseDIMACS

Description

A simple module for parsing CNF files in DIMACS format.

Synopsis

Documentation

parseByteString :: SourceName -> ByteString -> Either ParseError CNFSource

Parse a byte string containing DIMACS CNF data. The source name is only | used in error messages and may be the empty string.

parseFile :: FilePath -> IO (Either ParseError CNF)Source

Parse a file containing DIMACS CNF data.

data CNF Source

Constructors

CNF 

Fields

numVars :: !Int

The number of variables in the problem as reported by the cnf header.

numClauses :: !Int

The number of clauses in the problem as reported by the cnf header.

clauses :: ![Clause]
 

Instances