pseudo-boolean-0.1.10.0: Reading/Writing OPB/WBO files used in pseudo boolean competition
Copyright(c) Masahiro Sakai 2011-2015
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.PseudoBoolean.ByteStringBuilder

Description

 
Synopsis

Builder for (Lazy) ByteString generation

opbBuilder :: Formula -> Builder Source #

A ByteString Builder which renders a OPB format byte-string containing pseudo boolean problem.

wboBuilder :: SoftFormula -> Builder Source #

A ByteString Builder which renders a WBO format byte-string containing weighted boolean optimization problem.

Lazy ByteString generation

toOPBByteString :: Formula -> ByteString Source #

Generate a OPB format byte-string containing pseudo boolean problem.

toWBOByteString :: SoftFormula -> ByteString Source #

Generate a WBO format byte-string containing weighted boolean optimization problem.

File I/O

writeOPBFile :: FilePath -> Formula -> IO () Source #

Output a OPB file containing pseudo boolean problem.

writeWBOFile :: FilePath -> SoftFormula -> IO () Source #

Output a WBO file containing weighted boolean optimization problem.

hPutOPB :: Handle -> Formula -> IO () Source #

Output a OPB file to a Handle using hPutBuilder.

It is recommended that the Handle is set to binary and BlockBuffering mode. See hSetBinaryMode and hSetBuffering.

This function is more efficient than hPut . toOPBByteString because in many cases no buffer allocation has to be done.

hPutWBO :: Handle -> SoftFormula -> IO () Source #

Output a WBO file to a Handle using hPutBuilder.

It is recommended that the Handle is set to binary and BlockBuffering mode. See hSetBinaryMode and hSetBuffering.

This function is more efficient than hPut . toWBOByteString because in many cases no buffer allocation has to be done.