Copyright | (c) Masahiro Sakai 2012 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Tseitin encoding
TODO:
- reduce variables.
References:
- [Tse83] G. Tseitin. On the complexity of derivation in propositional calculus. Automation of Reasoning: Classical Papers in Computational Logic, 2:466-483, 1983. Springer-Verlag.
- [For60] R. Fortet. Application de l'algèbre de Boole en rechercheop opérationelle. Revue Française de Recherche Opérationelle, 4:17-26, 1960.
- [BM84a] E. Balas and J. B. Mazzola. Nonlinear 0-1 programming: I. Linearization techniques. Mathematical Programming, 30(1):1-21, 1984.
- [BM84b] E. Balas and J. B. Mazzola. Nonlinear 0-1 programming: II. Dominance relations and algorithms. Mathematical Programming, 30(1):22-45, 1984.
- [PG86] D. Plaisted and S. Greenbaum. A Structure-preserving Clause Form Translation. In Journal on Symbolic Computation, volume 2, 1986.
- [ES06] N . Eéen and N. Sörensson. Translating Pseudo-Boolean Constraints into SAT. JSAT 2:1–26, 2006.
- data Encoder
- newEncoder :: Solver -> IO Encoder
- setUsePB :: Encoder -> Bool -> IO ()
- encSolver :: Encoder -> Solver
- data Polarity = Polarity {}
- negatePolarity :: Polarity -> Polarity
- polarityPos :: Polarity
- polarityNeg :: Polarity
- polarityBoth :: Polarity
- polarityNone :: Polarity
- type Formula = BoolExpr Lit
- evalFormula :: IModel m => m -> Formula -> Bool
- addFormula :: Encoder -> Formula -> IO ()
- encodeConj :: Encoder -> [Lit] -> IO Lit
- encodeConjWithPolarity :: Encoder -> Polarity -> [Lit] -> IO Lit
- encodeDisj :: Encoder -> [Lit] -> IO Lit
- encodeDisjWithPolarity :: Encoder -> Polarity -> [Lit] -> IO Lit
- encodeITE :: Encoder -> Lit -> Lit -> Lit -> IO Lit
- encodeITEWithPolarity :: Encoder -> Polarity -> Lit -> Lit -> Lit -> IO Lit
- getDefinitions :: Encoder -> IO [(Lit, Formula)]
The Encoder
type
newEncoder :: Solver -> IO Encoder Source
Create a Encoder
instance.
Polarity
negatePolarity :: Polarity -> Polarity Source
Boolean formula type
evalFormula :: IModel m => m -> Formula -> Bool Source
Encoding of boolean formulas
addFormula :: Encoder -> Formula -> IO () Source
Assert a given formula to underlying SAT solver by using Tseitin encoding.
encodeConj :: Encoder -> [Lit] -> IO Lit Source
Return an literal which is equivalent to a given conjunction.
encodeConj encoder =encodeConjWithPolarity
encoderpolarityBoth
encodeConjWithPolarity :: Encoder -> Polarity -> [Lit] -> IO Lit Source
Return an literal which is equivalent to a given conjunction which occurs only in specified polarity.
encodeDisj :: Encoder -> [Lit] -> IO Lit Source
Return an literal which is equivalent to a given disjunction.
encodeDisj encoder =encodeDisjWithPolarity
encoderpolarityBoth
encodeDisjWithPolarity :: Encoder -> Polarity -> [Lit] -> IO Lit Source
Return an literal which is equivalent to a given disjunction which occurs only in specified polarity.
encodeITE :: Encoder -> Lit -> Lit -> Lit -> IO Lit Source
Return an literal which is equivalent to a given if-then-else.
encodeITE encoder =encodeITEWithPolarity
encoderpolarityBoth
encodeITEWithPolarity :: Encoder -> Polarity -> Lit -> Lit -> Lit -> IO Lit Source
Return an literal which is equivalent to a given if-then-else which occurs only in specified polarity.