toysolver-0.7.0: Assorted decision procedures for SAT, SMT, Max-SAT, PB, MIP, etc
Copyright(c) Masahiro Sakai 2016-2018
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Stabilityprovisional
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

ToySolver.Text.CNF

Description

Deprecated: Use ToySolver.FileFormat.CNF instead

Reader and Writer for DIMACS CNF and family of similar formats.

Synopsis

Documentation

data CNF Source #

DIMACS CNF format

Constructors

CNF 

Fields

Instances

Instances details
Eq CNF Source # 
Instance details

Defined in ToySolver.FileFormat.CNF

Methods

(==) :: CNF -> CNF -> Bool #

(/=) :: CNF -> CNF -> Bool #

Ord CNF Source # 
Instance details

Defined in ToySolver.FileFormat.CNF

Methods

compare :: CNF -> CNF -> Ordering #

(<) :: CNF -> CNF -> Bool #

(<=) :: CNF -> CNF -> Bool #

(>) :: CNF -> CNF -> Bool #

(>=) :: CNF -> CNF -> Bool #

max :: CNF -> CNF -> CNF #

min :: CNF -> CNF -> CNF #

Read CNF Source # 
Instance details

Defined in ToySolver.FileFormat.CNF

Show CNF Source # 
Instance details

Defined in ToySolver.FileFormat.CNF

Methods

showsPrec :: Int -> CNF -> ShowS #

show :: CNF -> String #

showList :: [CNF] -> ShowS #

FileFormat CNF Source # 
Instance details

Defined in ToySolver.FileFormat.CNF

Parsing .cnf files

parseFile :: (FileFormat a, MonadIO m) => FilePath -> m (Either String a) Source #

Parse a file but returns an error message when parsing fails.

parseByteString :: ByteString -> Either String CNF Source #

Parse a CNF file but returns an error message when parsing fails.

Generating .cnf files

writeFile :: (FileFormat a, MonadIO m) => FilePath -> a -> m () Source #

Write a value into a file.

hPutCNF :: Handle -> CNF -> IO () Source #

Output a CNF to a Handle.

cnfBuilder :: CNF -> Builder Source #

Encode a CNF to a Builder