mios-1.2.1: A Minisat-based SAT solver in Haskell

Safe HaskellSafe
LanguageHaskell2010

SAT.Solver.Mios.Solver

Contents

Description

This is a part of MIOS

Synopsis

Solver

data Solver Source #

Fig. 2.(p.9) Internal State of the solver

Constructors

Solver 

Fields

Instances

VarOrder Solver Source #

Interfate to select a decision var based on variable activity.

newSolver :: MiosConfiguration -> CNFDescription -> IO Solver Source #

returns an everything-is-initialized solver from the arguments

Misc Accessors

nAssigns :: Solver -> IO Int Source #

returns the number of current assigments

nClauses :: Solver -> IO Int Source #

returns the number of constraints (clauses)

nLearnts :: Solver -> IO Int Source #

returns the number of learnt clauses

decisionLevel :: Solver -> IO Int Source #

returns the current decision level

valueVar :: Solver -> Var -> IO Int Source #

returns the assignment (:: LiftedBool = [-1, 0, -1]) from Var

valueLit :: Solver -> Lit -> IO Int Source #

returns the assignment (:: LiftedBool = [-1, 0, -1]) from Lit

locked :: Solver -> Clause -> IO Bool Source #

Fig. 7. (p.11) returns True if the clause is locked (used as a reason). Learnt clauses only

data VarHeap Source #

VarHeap is a heap tree built from two Vec This implementation is identical wtih that in Minisat-1.14 Note: the zero-th element of heap is used for holding the number of elements Note: VarHeap itself is not a VarOrder, because it requires a pointer to solver

State Modifiers

addClause :: Solver -> Vec -> IO Bool Source #

returns False if a conflict has occured. This function is called only before the solving phase to register the given clauses.

enqueue :: Solver -> Lit -> Clause -> IO Bool Source #

Fig. 9 (p.14) Puts a new fact on the propagation queue, as well as immediately updating the variable's value in the assignment vector. If a conflict arises, False is returned and the propagation queue is cleared. The parameter from contains a reference to the constraint from which p was propagated (defaults to Nothing if omitted).

assume :: Solver -> Lit -> IO Bool Source #

Fig. 12 (p.17) returns False if immediate conflict.

Pre-condition: propagation queue is empty

cancelUntil :: Solver -> Int -> IO () Source #

#M22: Revert to the states at given level (keeping all assignment at level but not beyond).

getModel :: Solver -> IO [Int] Source #

return the model as a list of literal

Activities

claBumpActivity :: Solver -> Clause -> IO () Source #

Fig. 14 (p.19)

claDecayActivity :: Solver -> IO () Source #

Fig. 14 (p.19)

varBumpActivity :: Solver -> Var -> IO () Source #

Fig. 14 (p.19) Bumping of clause activity

varDecayActivity :: Solver -> IO () Source #

Fig. 14 (p.19)

Stats

incrementStat :: Solver -> StatIndex -> Int -> IO () Source #

increments a stat data corresponding to StatIndex

getStats :: Solver -> IO [(StatIndex, Int)] Source #

returns the statistics as list