Safe Haskell | Safe |
---|
Data.Algorithm.SatSolver.Lit
Contents
Type
Lit
type
Constructing
mkNeg :: Var a -> Lit a Source #
mkNeg
v
makes a negative literal from propositionalvariable v
.
>>>
import qualified Data.Algoritm.SatSolver.Var as Var
>>>
mkNeg (Var.mk "x1")
-"x1"
mkPos :: Var a -> Lit a Source #
mkPos
v
makes a positive literal from propositional variable v
.
>>>
import qualified Data.Algoritm.SatSolver.Var as Var
>>>
mkPos (Var.mk "x1")
+"x1"
mkNeg'
n
makes a propositional variable with name n
and next
makes a negative literal from this propositional variable.
>>>
mkNeg' "x1"
-"x1"
mkPos'
n
makes a propositional variable with name n
and next
makes a positive literal from this propositional variable.
>>>
mkPos' "x1"
+"x1"
fromString :: String -> Lit String Source #
fromString
s
makes a literal from a string.
The first character must be either -
or +
(leading and trailing whitespaces are removed).
>>>
fromString "-x1"
-"x1">>>
:type fromString "-x1"
fromString "-x1" :: Lit String>>>
fromString "+x1"
+"x1">>>
:type fromString "+x1"
fromString "+x1" :: Lit String
neg :: Lit a -> Lit a Source #
neg
l
returns the opposite literal of literal l
.
>>>
neg $ mkNeg' "x1"
+"x1">>>
neg $ mkNeg' "x1"
-"x1"