toysolver-0.3.0: Assorted decision procedures for SAT, Max-SAT, PB, MIP, etc

Copyright(c) Masahiro Sakai 2015
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ToySolver.SAT.PBNLC

Contents

Description

 

Synopsis

Documentation

type PBTerm = (Integer, [Lit]) Source

Adding constraints

addPBAtLeast Source

Arguments

:: Encoder 
-> PBSum
[(c1,ls1),(c2,ls2),…]
-> Integer

n

-> IO () 

Add a non-linear pseudo boolean constraints c1*ls1 + c2*ls2 + … ≥ n.

addPBAtMost Source

Arguments

:: Encoder 
-> PBSum
[(c1,ls1),(c2,ls2),…]
-> Integer

n

-> IO () 

Add a non-linear pseudo boolean constraints c1*ls1 + c2*ls2 + … ≥ n.

addPBExactly Source

Arguments

:: Encoder 
-> PBSum
[(c1,ls1),(c2,ls2),…]
-> Integer

n

-> IO () 

Add a non-linear pseudo boolean constraints c1*ls1 + c2*ls2 + … = n.

addPBAtLeastSoft Source

Arguments

:: Encoder 
-> Lit

Selector literal sel

-> PBSum
[(c1,ls1),(c2,ls2),…]
-> Integer

n

-> IO () 

Add a soft non-linear pseudo boolean constraints sel ⇒ c1*ls1 + c2*ls2 + … ≥ n.

addPBAtMostSoft Source

Arguments

:: Encoder 
-> Lit

Selector literal sel

-> PBSum
[(c1,ls1),(c2,ls2),…]
-> Integer

n

-> IO () 

Add a soft non-linear pseudo boolean constraints sel ⇒ c1*ls1 + c2*ls2 + … ≤ n.

addPBExactlySoft Source

Arguments

:: Encoder 
-> Lit

indicator lit

-> PBSum
[(c1,ls1),(c2,ls2),…]
-> Integer

n

-> IO () 

Add a soft non-linear pseudo boolean constraints lit ⇒ c1*ls1 + c2*ls2 + … = n.

Linearlization

linearizePBSum :: Encoder -> PBSum -> IO PBLinSum Source

Encode a non-linear PBSum into a lienar PBLinSum.

linearizePBSum enc s is equivalent to linearizePBSumWithPolarity enc polarityBoth.

linearizePBSumWithPolarity :: Encoder -> Polarity -> PBSum -> IO PBLinSum Source

Linearize a non-linear PBSum into a lienar PBLinSum.

The input PBSum is assumed to occur only in specified polarity.

Evaluation