Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Minisat-based Implementation and Optimization Study on SAT solver
- versionId :: String
- data CNFDescription = CNFDescription {}
- module SAT.Mios.OptionParser
- runSolver :: Traversable t => MiosConfiguration -> CNFDescription -> t [Int] -> IO (Either [Int] [Int])
- solveSAT :: Traversable m => CNFDescription -> m [Int] -> IO [Int]
- solveSATWithConfiguration :: Traversable m => MiosConfiguration -> CNFDescription -> m [Int] -> IO [Int]
- solve :: Foldable t => Solver -> t Lit -> IO Bool
- getModel :: Solver -> IO [Int]
- validateAssignment :: (Traversable m, Traversable n) => CNFDescription -> m [Int] -> n Int -> IO Bool
- validate :: Traversable t => Solver -> t Int -> IO Bool
- executeSolverOn :: FilePath -> IO ()
- executeSolver :: MiosProgramOption -> IO ()
- executeValidatorOn :: FilePath -> IO ()
- executeValidator :: MiosProgramOption -> IO ()
- dumpAssigmentAsCNF :: FilePath -> Bool -> [Int] -> IO ()
Interface to the core of solver
data CNFDescription Source #
misc information on CNF
CNFDescription | |
|
module SAT.Mios.OptionParser
runSolver :: Traversable t => MiosConfiguration -> CNFDescription -> t [Int] -> IO (Either [Int] [Int]) Source #
new top-level interface that returns
- conflicting literal set :: Left [Int]
- satisfiable assignment :: Right [Int]
solveSAT :: Traversable m => CNFDescription -> m [Int] -> IO [Int] Source #
the easiest interface for Haskell programs
This returns the result ::[[Int]]
for a given (CNFDescription, [[Int]])
The first argument target
can be build by Just target <- cnfFromFile targetfile
.
The second part of the first argument is a list of vector, which 0th element is the number of its real elements
solveSATWithConfiguration :: Traversable m => MiosConfiguration -> CNFDescription -> m [Int] -> IO [Int] Source #
solves the problem (2rd arg) under the configuration (1st arg) and returns an assignment as list of literals :: Int
solve :: Foldable t => Solver -> t Lit -> IO Bool Source #
Fig. 16. (p.20) Main solve method.
Pre-condition: If assumptions are used, simplifyDB
must be
called right before using this method. If not, a top-level conflict (resulting in a
non-usable internal state) cannot be distinguished from a conflict under assumptions.
Assignment Validator
validateAssignment :: (Traversable m, Traversable n) => CNFDescription -> m [Int] -> n Int -> IO Bool Source #
validate :: Traversable t => Solver -> t Int -> IO Bool Source #
validates the assignment even if the implementation of Solver
is wrong; we re-implement some functions here.
For standalone programs
executeSolverOn :: FilePath -> IO () Source #
executes a solver on the given CNF file This is the simplest entry to standalone programs; not for Haskell programs
executeSolver :: MiosProgramOption -> IO () Source #
executes a solver on the given 'arg :: MiosConfiguration' | This is another entry point for standalone programs.
executeValidatorOn :: FilePath -> IO () Source #
validates a given assignment from STDIN for the CNF file (2nd arg) this is the entry point for standalone programs
executeValidator :: MiosProgramOption -> IO () Source #
validates a given assignment for the problem (2nd arg) this is another entry point for standalone programs; see app/mios.hs