boolean-normal-forms 0.0.0.2 → 0.0.1
raw patch · 10 files changed
+53/−7 lines, 10 filesdep +deepseqdep ~QuickCheckdep ~basedep ~containersPVP ok
version bump matches the API change (PVP)
Dependencies added: deepseq
Dependency ranges changed: QuickCheck, base, containers
API changes (from Hackage documentation)
+ Data.Algebra.Boolean.CNF.List: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Algebra.Boolean.CNF.List.CNF a)
+ Data.Algebra.Boolean.CNF.Set: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Algebra.Boolean.CNF.Set.CNF a)
+ Data.Algebra.Boolean.DNF.List: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Algebra.Boolean.DNF.List.DNF a)
+ Data.Algebra.Boolean.DNF.Set: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Algebra.Boolean.DNF.Set.DNF a)
+ Data.Algebra.Boolean.FreeBoolean: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Algebra.Boolean.FreeBoolean.FreeBoolean a)
+ Data.Algebra.Boolean.NNF.Set: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Algebra.Boolean.NNF.Set.NNF a)
+ Data.Algebra.Boolean.NNF.Tree: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Algebra.Boolean.NNF.Tree.NNF a)
+ Data.Algebra.Boolean.Negable: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Algebra.Boolean.Negable.Neg a)
Files
- CHANGELOG.md +3/−0
- boolean-normal-forms.cabal +4/−7
- src/Data/Algebra/Boolean/CNF/List.hs +4/−0
- src/Data/Algebra/Boolean/CNF/Set.hs +4/−0
- src/Data/Algebra/Boolean/DNF/List.hs +4/−0
- src/Data/Algebra/Boolean/DNF/Set.hs +4/−0
- src/Data/Algebra/Boolean/FreeBoolean.hs +9/−0
- src/Data/Algebra/Boolean/NNF/Set.hs +8/−0
- src/Data/Algebra/Boolean/NNF/Tree.hs +8/−0
- src/Data/Algebra/Boolean/Negable.hs +5/−0
+ CHANGELOG.md view
@@ -0,0 +1,3 @@+0.0.1++- Add `NFData` instances
boolean-normal-forms.cabal view
@@ -1,5 +1,5 @@ name: boolean-normal-forms-version: 0.0.0.2+version: 0.0.1 synopsis: Boolean normal form: NNF, DNF & CNF description: The provided types that might be useful in symbolic manipulation of propositional logic expressions. license: MIT@@ -10,7 +10,7 @@ category: Data build-type: Simple cabal-version: >=1.18-extra-source-files: README.md+extra-source-files: README.md CHANGELOG.md extra-doc-files: doc-formulae/*.svg tested-with: GHC==7.6.3,@@ -19,10 +19,6 @@ GHC==8.0.2, GHC==8.2.2 -source-repository head- type: git- location: https://github.com/phadej/boolean-normal-forms.git- library hs-source-dirs: src exposed-modules: Data.Algebra.Boolean.NormalForm,@@ -45,7 +41,8 @@ ScopedTypeVariables build-depends: base >=4.6 && <4.11, containers >=0.5 && <0.6,- cond >=0.4.1 && <0.5+ cond >=0.4.1 && <0.5,+ deepseq >=1.1.0.0 && <1.5 default-language: Haskell2010 ghc-options: -Wall
src/Data/Algebra/Boolean/CNF/List.hs view
@@ -24,6 +24,7 @@ import Data.Either (partitionEithers) import Data.Typeable (Typeable) import Data.Foldable (Foldable)+import Control.DeepSeq (NFData(rnf)) import Data.Algebra.Boolean.NormalForm import Data.Algebra.Boolean.Negable hiding (not)@@ -92,3 +93,6 @@ p (Left x) = x fromFreeBoolean = fromNNF . toBooleanWith toNormalForm++instance NFData a => NFData (CNF a) where+ rnf (CNF xss) = rnf xss
src/Data/Algebra/Boolean/CNF/Set.hs view
@@ -22,6 +22,7 @@ import Data.Monoid import Data.Typeable (Typeable) import Data.Foldable (Foldable)+import Control.DeepSeq (NFData(rnf)) import Data.Set (Set) import qualified Data.Set as Set@@ -105,3 +106,6 @@ p (Left x) = x fromFreeBoolean = fromNNF . toBooleanWith toNormalForm++instance NFData a => NFData (CNF a) where+ rnf (CNF xss) = rnf xss
src/Data/Algebra/Boolean/DNF/List.hs view
@@ -24,6 +24,7 @@ import Data.Either (partitionEithers) import Data.Typeable (Typeable) import Data.Foldable (Foldable)+import Control.DeepSeq (NFData(rnf)) import Data.Algebra.Boolean.NormalForm import Data.Algebra.Boolean.Negable hiding (not)@@ -92,3 +93,6 @@ q (Left x) = x fromFreeBoolean = fromNNF . toBooleanWith toNormalForm++instance NFData a => NFData (DNF a) where+ rnf (DNF xss) = rnf xss
src/Data/Algebra/Boolean/DNF/Set.hs view
@@ -22,6 +22,7 @@ import Data.Monoid import Data.Typeable (Typeable) import Data.Foldable (Foldable)+import Control.DeepSeq (NFData(rnf)) import Data.Set (Set) import qualified Data.Set as Set@@ -105,3 +106,6 @@ q (Left x) = x fromFreeBoolean = fromNNF . toBooleanWith toNormalForm++instance NFData a => NFData (DNF a) where+ rnf (DNF xss) = rnf xss
src/Data/Algebra/Boolean/FreeBoolean.hs view
@@ -17,6 +17,7 @@ import Data.Typeable (Typeable) import Data.Foldable (Foldable)+import Control.DeepSeq (NFData(rnf)) import Data.Algebra.Boolean.CoBoolean import Data.Algebra.Boolean.Negable hiding (not)@@ -56,3 +57,11 @@ (||) = FBOr (&&) = FBAnd not = FBNot++instance NFData a => NFData (FreeBoolean a) where+ rnf (FBValue a) = rnf a+ rnf (FBNot a) = rnf a+ rnf (FBAnd a b) = rnf a `seq` rnf b+ rnf (FBOr a b) = rnf a `seq` rnf b+ rnf FBTrue = ()+ rnf FBFalse = ()
src/Data/Algebra/Boolean/NNF/Set.hs view
@@ -27,6 +27,7 @@ import Data.Typeable (Typeable) import Data.Foldable (Foldable)+import Control.DeepSeq (NFData(rnf)) -- | Boolean formula in Negation Normal Form --@@ -102,3 +103,10 @@ simplify f (NNFOr xs) = orList $ map (simplify f) $ Set.toList xs fromFreeBoolean = toBooleanWith toNormalForm++instance NFData a => NFData (NNF a) where+ rnf (NNFValue a) = rnf a+ rnf (NNFOr a) = rnf a+ rnf (NNFAnd a) = rnf a+ rnf NNFTrue = ()+ rnf NNFFalse = ()
src/Data/Algebra/Boolean/NNF/Tree.hs view
@@ -26,6 +26,7 @@ import Data.Typeable (Typeable) import Data.Foldable (Foldable)+import Control.DeepSeq (NFData(rnf)) -- | Boolean formula in Negation Normal Form --@@ -93,3 +94,10 @@ simplify f (NNFOr a b) = nnfOr (simplify f a) (simplify f b) fromFreeBoolean = toBooleanWith toNormalForm++instance NFData a => NFData (NNF a) where+ rnf (NNFValue a) = rnf a+ rnf (NNFOr a b) = rnf a `seq` rnf b+ rnf (NNFAnd a b) = rnf a `seq` rnf b+ rnf NNFTrue = ()+ rnf NNFFalse = ()
src/Data/Algebra/Boolean/Negable.hs view
@@ -19,6 +19,7 @@ import Data.Monoid import Data.Typeable+import Control.DeepSeq (NFData(rnf)) import Prelude hiding (not) import qualified Prelude as P@@ -37,6 +38,10 @@ instance CoBoolean1 Neg where toBooleanWith f (Pos x) = f x toBooleanWith f (Neg x) = B.not $ f x++instance NFData a => NFData (Neg a) where+ rnf (Pos a) = rnf a+ rnf (Neg a) = rnf a -- | Class to represent invertible values. --