úÎÙÖ     portable experimental/Sebastian Fischer (sebf@informatik.uni-kiel.de)8Conjunctive normalforms are lists of lists of literals. CLiterals are variables that occur either positively or negatively. 3Boolean formulas are represented as values of type Boolean. %and disjunction of boolean formulas. #and finally we provide conjunction Not constructs negated formulas, No represents false, Yes represents true, Variables are labeled with an Int, =This function returns the name of the variable in a literal. !This function negates a literal. =This predicate checks whether the given literal is positive. BWe convert boolean formulas to conjunctive normal form by pushing 9 negations down to variables and repeatedly applying the  distributive laws. portable experimental/Sebastian Fischer (sebf@informatik.uni-kiel.de)A  SatSolver( can be used to solve boolean formulas. -A new SAT solver without stored constraints. 9This predicate tells whether all constraints are solved. CWe can lookup the binding of a variable according to the currently ? stored constraints. If the variable is unbound, the result is  Nothing. +We can assert boolean formulas to update a  SatSolver. The D assertion may fail if the resulting constraints are unsatisfiable. ?This function guesses a value for the given variable, if it is B currently unbound. As this is a non-deterministic operation, the 2 resulting solvers are returned in an instance of  MonadPlus. @This function guesses values for variables such that the stored D constraints are satisfied. The result may be non-deterministic and ' is, hence, returned in an instance of  MonadPlus. BWe select a variable from the shortest clause hoping to produce a  unit clause. !"#$%&   '       !"#$%&'()incremental-sat-solver-0.1Data.Boolean.SatSolver Data.BooleanBoolean:||::&&:NotNoYesVar SatSolver newSatSolverisSolved lookupVar assertTrue branchOnVarsatisfyselectBranchVarClauseCNFLiteralNegPos literalVar invLiteralisPositiveLiteral booleanToCNFflatConjunctionflatDisjunctionasLongAsPossible everywhere atChildrenclausesbindings updateSolversimplifysimplifyClauses propagatebranchOnUnboundguessshorter