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

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

ToySolver.Data.MIP.Base

Contents

Description

Mixed-Integer Programming Problems with some commmonly used extensions

Synopsis

Documentation

type Expr = [Term] Source

expressions

data Term Source

terms

Constructors

Term Rational [Var] 

data OptDir :: *

The OptDir type represents optimization directions.

Constructors

OptMin

minimization

OptMax

maximization

type ObjectiveFunction = (Maybe Label, Expr) Source

objective function

type Bounds = (BoundExpr, BoundExpr) Source

type for representing lower/upper bound of variables

type Label = String Source

label

type Var = InternedString Source

variable

type BoundExpr = Extended Rational Source

type for representing lower/upper bound of variables

data Extended r :: * -> *

Extended r is an extension of r with positive/negative infinity (±∞).

Constructors

NegInf

negative infinity (-∞)

Finite !r

finite value

PosInf

positive infinity (+∞)

Instances

Functor Extended 
Bounded (Extended r) 
Eq r => Eq (Extended r) 
(Fractional r, Ord r) => Fractional (Extended r)

Note that Extended r is not a field, nor a ring.

Data r => Data (Extended r) 
(Num r, Ord r) => Num (Extended r)

Note that Extended r is not a field, nor a ring.

PosInf + NegInf is left undefined as usual, but we define 0 * PosInf = 0 * NegInf = 0 by following the convention of probability or measure theory.

Ord r => Ord (Extended r) 
Read r => Read (Extended r) 
Show r => Show (Extended r) 
NFData r => NFData (Extended r) 
Hashable r => Hashable (Extended r) 
Typeable (* -> *) Extended 

data RelOp Source

relational operators

Constructors

Le 
Ge 
Eql 

data SOSType Source

types of SOS (special ordered sets) constraints

Constructors

S1

Type 1 SOS constraint

S2

Type 2 SOS constraint

data SOSConstraint Source

SOS (special ordered sets) constraints

Constructors

SOSConstraint 

defaultBounds :: Bounds Source

default bounds

defaultLB :: BoundExpr Source

default lower bound (0)

defaultUB :: BoundExpr Source

default upper bound (+∞)

toVar :: String -> Var Source

convert a string into a variable

fromVar :: Var -> String Source

convert a variable into a string

getVarInfo :: Problem -> Var -> VarInfo Source

looking up attributes for a variable

getVarType :: Problem -> Var -> VarType Source

looking up bounds for a variable

getBounds :: Problem -> Var -> Bounds Source

looking up bounds for a variable

Utilities