pseudo-boolean 0.1.9.0 → 0.1.10.0
raw patch · 10 files changed
+35/−10 lines, 10 filesdep ~basedep ~hashable
Dependency ranges changed: base, hashable
Files
- CHANGELOG.markdown +4/−0
- README.md +2/−1
- pseudo-boolean.cabal +8/−6
- src/Data/PseudoBoolean/Attoparsec.hs +1/−1
- src/Data/PseudoBoolean/Megaparsec.hs +1/−1
- src/Data/PseudoBoolean/Parsec.hs +1/−1
- test/TestPBFile.hs +4/−0
- test/samples/invalid-lhs-empty-sum.opb +4/−0
- test/samples/invalid-lhs-empty-sum.wbo +6/−0
- test/samples/invalid-obj-empty-sum.opb +4/−0
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.1.10.0+-------+* allow parsing empty `<sum>`. https://github.com/msakai/pseudo-boolean/pull/5+ 0.1.9.0 ------- * fix compilation error with `megaparsec <4.4` due to the lack of MonadPlus requirement
README.md view
@@ -1,7 +1,8 @@ # pseudo-boolean Haskell library for parsing/generating OPB/WBO files used in pseudo boolean competition. -[](https://travis-ci.org/msakai/pseudo-boolean)+[](https://travis-ci.org/msakai/pseudo-boolean)+[](https://github.com/msakai/pseudo-boolean/actions) [](https://coveralls.io/r/msakai/pseudo-boolean) [](https://hackage.haskell.org/package/pseudo-boolean) [](https://packdeps.haskellers.com/feed?needle=pseudo-boolean)
pseudo-boolean.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: pseudo-boolean-version: 0.1.9.0+version: 0.1.10.0 synopsis: Reading/Writing OPB/WBO files used in pseudo boolean competition description: Reading\/Writing OPB\/WBO files used in pseudo boolean competition homepage: https://github.com/msakai/pseudo-boolean@@ -27,7 +27,9 @@ GHC ==8.0.2 GHC ==8.2.2 GHC ==8.4.4- GHC ==8.6.3+ GHC ==8.6.5+ GHC ==8.8.4+ GHC ==8.10.4 source-repository head type: git@@ -53,13 +55,13 @@ FlexibleContexts OverloadedStrings build-depends:- base >=4.6.0.1 && <4.14,+ base >=4.6.0.1 && <4.16, containers >=0.4.2.1, parsec >=3.1.2 && <4,- megaparsec >=4 && <8,- bytestring >=0.9.2.1 && <0.11,+ megaparsec >=4 && <10,+ bytestring >=0.9.2.1 && <0.12, bytestring-builder,- dlist >=0.7.0 && <0.9.0,+ dlist >=0.7.0 && <1.1.0, attoparsec >=0.10.4.0, deepseq >=1.3.0.0, hashable >=1.1.2.5 && <1.4.0.0,
src/Data/PseudoBoolean/Attoparsec.hs view
@@ -126,7 +126,7 @@ -- <sum>::= <weightedterm> | <weightedterm> <sum> sum :: Parser Sum-sum = many1 weightedterm+sum = many' weightedterm -- we relax the grammer to allow empty sum -- <weightedterm>::= <integer> <oneOrMoreSpace> <term> <oneOrMoreSpace> weightedterm :: Parser WeightedTerm
src/Data/PseudoBoolean/Megaparsec.hs view
@@ -184,7 +184,7 @@ -- <sum>::= <weightedterm> | <weightedterm> <sum> sum :: C e s m => m Sum-sum = some weightedterm+sum = many weightedterm -- we relax the grammer to allow empty sum -- <weightedterm>::= <integer> <oneOrMoreSpace> <term> <oneOrMoreSpace> weightedterm :: C e s m => m WeightedTerm
src/Data/PseudoBoolean/Parsec.hs view
@@ -126,7 +126,7 @@ -- <sum>::= <weightedterm> | <weightedterm> <sum> sum :: Stream s m Char => ParsecT s u m Sum-sum = many1 weightedterm+sum = many weightedterm -- we relax the grammer to allow empty sum -- <weightedterm>::= <integer> <oneOrMoreSpace> <term> <oneOrMoreSpace> weightedterm :: Stream s m Char => ParsecT s u m WeightedTerm
test/TestPBFile.hs view
@@ -41,6 +41,10 @@ case_normalized_opt_market_split_4_30_2 = checkOPBFile "test/samples/normalized-opt-market-split_4_30_2.opb" case_pigeonhole_5_4 = checkOPBFile "test/samples/pigeonhole_5_4.opb" +case_invalid_obj_empty_sum = checkOPBFile "test/samples/invalid-obj-empty-sum.opb"+case_invalid_lhs_empty_sum = checkOPBFile "test/samples/invalid-lhs-empty-sum.opb"+case_invalid_lhs_empty_sum_wbo = checkWBOFile "test/samples/invalid-lhs-empty-sum.wbo"+ case_trailing_junk = do isError (parseOPBString "" trailingJunk) @?= True isError (M.parseOPBString "" trailingJunk) @?= True
+ test/samples/invalid-lhs-empty-sum.opb view
@@ -0,0 +1,4 @@+* #variable= 0 #constraint= 1+* This is invalid according to the grammer of http://www.cril.univ-artois.fr/PB11/format.pdf ,+* but we relax the grammar to allow it.+>= 0;
+ test/samples/invalid-lhs-empty-sum.wbo view
@@ -0,0 +1,6 @@+* #variable= 0 #constraint= 2 #soft= 1 mincost= 1 maxcost= 1 sumcost= 1+* This is invalid according to the grammer of http://www.cril.univ-artois.fr/PB11/format.pdf ,+* but we relax the grammar to allow it.+soft: ;+[1] >= 1;+>= 0;
+ test/samples/invalid-obj-empty-sum.opb view
@@ -0,0 +1,4 @@+* #variable= 0 #constraint= 0+* This is invalid according to the grammer of http://www.cril.univ-artois.fr/PB11/format.pdf ,+* but we relax the grammar to allow it.+min: ;