zsdd-0.2.1.0: Zero-Suppressed and Reduced Decision Diagrams
Copyright(c) Eddie Jones 2020
LicenseBSD-3
Maintainereddiejones2108@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.Diagram.ZeroSup

Description

Zero-suppressed Binary Decision Diagrams

Synopsis

Diagram

data Diagram l s a Source #

A binary decision diagram

Instances

Instances details
Monad (Diagram l s) Source # 
Instance details

Defined in Data.Diagram.ZeroSup

Methods

(>>=) :: Diagram l s a -> (a -> Diagram l s b) -> Diagram l s b #

(>>) :: Diagram l s a -> Diagram l s b -> Diagram l s b #

return :: a -> Diagram l s a #

Functor (Diagram l s) Source # 
Instance details

Defined in Data.Diagram.ZeroSup

Methods

fmap :: (a -> b) -> Diagram l s a -> Diagram l s b #

(<$) :: a -> Diagram l s b -> Diagram l s a #

Applicative (Diagram l s) Source # 
Instance details

Defined in Data.Diagram.ZeroSup

Methods

pure :: a -> Diagram l s a #

(<*>) :: Diagram l s (a -> b) -> Diagram l s a -> Diagram l s b #

liftA2 :: (a -> b -> c) -> Diagram l s a -> Diagram l s b -> Diagram l s c #

(*>) :: Diagram l s a -> Diagram l s b -> Diagram l s b #

(<*) :: Diagram l s a -> Diagram l s b -> Diagram l s a #

runDiagram :: (forall s. Diagram l s a) -> a Source #

Extract non-diagrammatic information

Families of Sets

data Family l s Source #

A diagramatic family of sets build on atomic elements of type l

Instances

Instances details
Eq (Family l s) Source # 
Instance details

Defined in Data.Diagram.ZeroSup

Methods

(==) :: Family l s -> Family l s -> Bool #

(/=) :: Family l s -> Family l s -> Bool #

Ord (Family l s) Source # 
Instance details

Defined in Data.Diagram.ZeroSup

Methods

compare :: Family l s -> Family l s -> Ordering #

(<) :: Family l s -> Family l s -> Bool #

(<=) :: Family l s -> Family l s -> Bool #

(>) :: Family l s -> Family l s -> Bool #

(>=) :: Family l s -> Family l s -> Bool #

max :: Family l s -> Family l s -> Family l s #

min :: Family l s -> Family l s -> Family l s #

mkFamily :: (Eq l, Hashable l) => l -> Family l s -> Family l s -> Diagram l s (Family l s) Source #

Make a family (if not already present) from it's hi and lo cases

empty :: Family l s Source #

Simple families

base :: Family l s Source #

Simple families

change :: (Ord l, Hashable l) => l -> Family l s -> Diagram l s (Family l s) Source #

Flip an element in a family

subset :: (Ord l, Hashable l) => l -> Bool -> Family l s -> Diagram l s (Family l s) Source #

Subsets that do or do not contain a particular element

bindElem :: (Ord l, Hashable l) => Family l s -> (l -> Diagram l s (Family l s)) -> Diagram l s (Family l s) Source #

Replace an element with a family of sets

Combinations

intersect :: (Ord l, Hashable l) => Family l s -> Family l s -> Diagram l s (Family l s) Source #

The intersection of families

union :: (Ord l, Hashable l) => Family l s -> Family l s -> Diagram l s (Family l s) Source #

The union of families

difference :: (Ord l, Hashable l) => Family l s -> Family l s -> Diagram l s (Family l s) Source #

The difference between families

Summary

fold :: (Hashable l, Eq l) => (l -> b -> b -> Diagram l s b) -> (Bool -> Diagram l s b) -> Family l s -> Diagram l s b Source #

Create a summary value of a family

anySat :: (Hashable l, Eq l) => Family l s -> Diagram l s Bool Source #

Determine if the family is empty

 anySat = fold (\_ p q -> p || q) id