Copyright(c) Stéphane Vialette, 2014
LicenseMIT
Maintainervialette@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred

SatSolver

Description

 

Synopsis

Documentation

selectLiteral :: (Eq a, Ord a) => Formula a -> Literal a

solve :: Ord a => Formula a -> Maybe (Map (Variable a) Bool)

The solve function returns Nothing if the formula is not satisfiable. Ohherwise it returns a satisfying assignment (possibly incomplete) in the form of a map.

>>> solve $ F.makeFormula [[1,2], [-1,-2], [2,3], [1,-2], [-2,4]]
Just (fromList [(1,True),(2,False),(3,True)])
>>> solve $ F.makeFormula [[1,2], [-1,2], [1,-2], [-1,-2]]
Nothing