qlogic-0.9: A Haskell Library for Propositional Logic.

Safe HaskellSafe-Infered

Qlogic.Assign

Contents

Synopsis

Bindings

type Binding l = (A l, Bool)

A Binding maps a variable to a Boolean value

(|->) :: A l -> Bool -> Binding l

construct a Binding

Assignments

type Assign l = Map (A l) Bool

lookup :: Ord l => A l -> Assign l -> Maybe Bool

lookup the truth-value of a variable from the given assignment, or return Nothing when the given variable is not bound.

empty :: Assign l

the empty assignment

add :: Ord l => [Binding l] -> Assign l -> Assign l

update the given assignment with a list of bindings, overwriting previous bindings

fromMap :: Map (A l) Bool -> Assign l

toMap :: Assign l -> Map (A l) Bool

eval :: Ord l => PropFormula l -> Assign l -> Bool

evaluate a Formula under the given assignment

prettyPrint :: Show l => Assign l -> Doc