Copyright | (c) Masahiro Sakai 2011-2016 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Portability | non-portable (BangPatterns, FlexibleContexts, TypeFamilies, CPP, ConstraintKinds) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Data.PseudoBoolean.Megaparsec
Description
A parser library for OPB file and WBO files used in pseudo boolean competition.
References:
- Input/Output Format and Solver Requirements for the Competitions of Pseudo-Boolean Solvers http://www.cril.univ-artois.fr/PB11/format.pdf
Synopsis
- opbParser :: (MonadParsec e s m, Token s ~ Word8, IsString (Tokens s)) => m Formula
- parseOPBString :: String -> String -> Either ParseError Formula
- parseOPBByteString :: String -> ByteString -> Either ParseError Formula
- parseOPBFile :: FilePath -> IO (Either ParseError Formula)
- wboParser :: (MonadParsec e s m, Token s ~ Word8, IsString (Tokens s)) => m SoftFormula
- parseWBOString :: String -> String -> Either ParseError SoftFormula
- parseWBOByteString :: String -> ByteString -> Either ParseError SoftFormula
- parseWBOFile :: FilePath -> IO (Either ParseError SoftFormula)
- type ParseError = ParseErrorBundle ByteString Void
Parsing OPB files
opbParser :: (MonadParsec e s m, Token s ~ Word8, IsString (Tokens s)) => m Formula Source #
Parser for OPB files
parseOPBString :: String -> String -> Either ParseError Formula Source #
Parse a OPB format string containing pseudo boolean problem.
parseOPBByteString :: String -> ByteString -> Either ParseError Formula Source #
Parse a OPB format lazy bytestring containing pseudo boolean problem.
parseOPBFile :: FilePath -> IO (Either ParseError Formula) Source #
Parse a OPB file containing pseudo boolean problem.
Parsing WBO files
wboParser :: (MonadParsec e s m, Token s ~ Word8, IsString (Tokens s)) => m SoftFormula Source #
Parser for WBO files
parseWBOString :: String -> String -> Either ParseError SoftFormula Source #
Parse a WBO format string containing weighted boolean optimization problem.
parseWBOByteString :: String -> ByteString -> Either ParseError SoftFormula Source #
Parse a WBO format lazy bytestring containing pseudo boolean problem.
parseWBOFile :: FilePath -> IO (Either ParseError SoftFormula) Source #
Parse a WBO file containing weighted boolean optimization problem.
Error type
type ParseError = ParseErrorBundle ByteString Void Source #