qlogic-0.9: A Haskell Library for Propositional Logic.

Safe HaskellSafe-Infered

Qlogic.Formula

Contents

Synopsis

Types

data Formula l a

Constructors

A a 
SL l 
And [Formula l a] 
Or [Formula l a] 
Iff (Formula l a) (Formula l a) 
Ite (Formula l a) (Formula l a) (Formula l a) 
Imp (Formula l a) (Formula l a) 
Maj (Formula l a) (Formula l a) (Formula l a) 
Odd (Formula l a) (Formula l a) (Formula l a) 
Neg (Formula l a) 
Top 
Bot 

Instances

Typeable2 Formula 
(Eq l, PropAtom a) => NGBoolean (PropFormula l) a 
Monad s => MonadState [PropFormula l] (NatMonad s l) 
(Eq l, Eq a) => Eq (Formula l a) 
(Ord l, Ord a) => Ord (Formula l a) 
(Show l, Show a) => Show (Formula l a) 
(Eq a, Eq l) => Boolean (Formula l a) 
(Monad s, Eq l) => Boolean (MemoFormula arg s l) 
(Monad s, Eq l, PropAtom a) => NGBoolean (MemoFormula arg s l) a 
(Eq l, PropAtom a, Eq b) => NGBoolean (DioFormula l DioVar b) a 

operations

literal :: l -> Formula l a

isCnf :: Formula l a -> Bool

size :: Formula l a -> Int

simplify :: (Eq l, Eq a) => Formula l a -> Formula l a

performs basic simplification of formulas

atoms :: (Ord a, Ord l) => Formula l a -> Set (Either l a)

utility functions

pprintFormula :: (Show a, Show l) => Formula l a -> Doc