ghc-lib-parser-9.10.1.20250103: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Data.BooleanFormula

Description

Boolean formulas without quantifiers and without negation. Such a formula consists of variables, conjunctions (and), and disjunctions (or).

This module is used to represent minimal complete definitions for classes.

# Documentation

data BooleanFormula a #

Constructors

Var a |
And [LBooleanFormula a] |
Or [LBooleanFormula a] |
Parens (LBooleanFormula a) |

#### Instances

Instances details

Functor BooleanFormula # |
Instance details Defined in GHC.Data.BooleanFormula Methods fmap :: (a -> b) -> BooleanFormula a -> BooleanFormula b # (<$) :: a -> BooleanFormula b -> BooleanFormula a #
Foldable BooleanFormula # |
Instance details Defined in GHC.Data.BooleanFormula Methods fold :: Monoid m => BooleanFormula m -> m # foldMap :: Monoid m => (a -> m) -> BooleanFormula a -> m # foldMap' :: Monoid m => (a -> m) -> BooleanFormula a -> m # foldr :: (a -> b -> b) -> b -> BooleanFormula a -> b # foldr' :: (a -> b -> b) -> b -> BooleanFormula a -> b # foldl :: (b -> a -> b) -> b -> BooleanFormula a -> b # foldl' :: (b -> a -> b) -> b -> BooleanFormula a -> b # foldr1 :: (a -> a -> a) -> BooleanFormula a -> a # foldl1 :: (a -> a -> a) -> BooleanFormula a -> a # toList :: BooleanFormula a -> [a] # null :: BooleanFormula a -> Bool # length :: BooleanFormula a -> Int # elem :: Eq a => a -> BooleanFormula a -> Bool # maximum :: Ord a => BooleanFormula a -> a # minimum :: Ord a => BooleanFormula a -> a # sum :: Num a => BooleanFormula a -> a # product :: Num a => BooleanFormula a -> a #
Traversable BooleanFormula # |
Instance details Defined in GHC.Data.BooleanFormula Methods traverse :: Applicative f => (a -> f b) -> BooleanFormula a -> f (BooleanFormula b) # sequenceA :: Applicative f => BooleanFormula (f a) -> f (BooleanFormula a) # mapM :: Monad m => (a -> m b) -> BooleanFormula a -> m (BooleanFormula b) # sequence :: Monad m => BooleanFormula (m a) -> m (BooleanFormula a) #
Data a => Data (BooleanFormula a) # |
Instance details Defined in GHC.Data.BooleanFormula Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BooleanFormula a -> c (BooleanFormula a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BooleanFormula a) # toConstr :: BooleanFormula a -> Constr # dataTypeOf :: BooleanFormula a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BooleanFormula a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BooleanFormula a)) # gmapT :: (forall b. Data b => b -> b) -> BooleanFormula a -> BooleanFormula a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BooleanFormula a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BooleanFormula a -> r # gmapQ :: (forall d. Data d => d -> u) -> BooleanFormula a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> BooleanFormula a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BooleanFormula a -> m (BooleanFormula a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BooleanFormula a -> m (BooleanFormula a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BooleanFormula a -> m (BooleanFormula a) #
OutputableBndr a => Outputable (BooleanFormula a) # |
Instance details Defined in GHC.Data.BooleanFormula Methods ppr :: BooleanFormula a -> SDoc #
Eq a => Eq (BooleanFormula a) # |
Instance details Defined in GHC.Data.BooleanFormula Methods (==) :: BooleanFormula a -> BooleanFormula a -> Bool # (/=) :: BooleanFormula a -> BooleanFormula a -> Bool #

type LBooleanFormula a = LocatedL (BooleanFormula a) #

mkFalse :: BooleanFormula a #

mkTrue :: BooleanFormula a #

mkAnd :: Eq a => [LBooleanFormula a] -> BooleanFormula a #

mkOr :: Eq a => [LBooleanFormula a] -> BooleanFormula a #

mkVar :: a -> BooleanFormula a #

isFalse :: BooleanFormula a -> Bool #

isTrue :: BooleanFormula a -> Bool #

eval :: (a -> Bool) -> BooleanFormula a -> Bool #

simplify :: Eq a => (a -> Maybe Bool) -> BooleanFormula a -> BooleanFormula a #

isUnsatisfied :: Eq a => (a -> Bool) -> BooleanFormula a -> Maybe (BooleanFormula a) #

implies :: Uniquable a => BooleanFormula a -> BooleanFormula a -> Bool #

impliesAtom :: Eq a => BooleanFormula a -> a -> Bool #

pprBooleanFormula :: (Rational -> a -> SDoc) -> Rational -> BooleanFormula a -> SDoc #

pprBooleanFormulaNice :: Outputable a => BooleanFormula a -> SDoc #