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

Copyright(c) Masahiro Sakai 2011
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Portabilitynon-portable (BangPatterns)
Safe HaskellSafe-Inferred
LanguageHaskell2010

ToySolver.Text.PBFile

Contents

Description

A parser library for .opb file and .wbo files used by PB Competition.

References:

Synopsis

Abstract Syntax

data Formula Source

Pair of objective function and a list of constraints.

type Constraint = (Sum, Op, Integer) Source

Lhs, relational operator and rhs.

data Op Source

Relational operators

Constructors

Ge

greater than or equal

Eq

equal

Instances

data SoftFormula Source

A pair of top cost and a list of soft constraints.

type SoftConstraint = (Maybe Integer, Constraint) Source

A pair of weight and constraint.

type WeightedTerm = (Integer, Term) Source

Coefficient and Term

type Term = [Lit] Source

List of variables interpreted as products

type Lit = Int Source

Positive (resp. negative) literal is represented as a positive (resp. negative) integer.

type Var = Int Source

Variable are repserented positive integer.

Parsing .opb files

parseOPBString :: SourceName -> String -> Either ParseError Formula Source

Parse a .opb file containing pseudo boolean problem.

parseOPBFile :: FilePath -> IO (Either ParseError Formula) Source

Parse a .opb format string containing pseudo boolean problem.

Parsing .wbo files

parseWBOString :: SourceName -> String -> Either ParseError SoftFormula Source

Parse a .wbo file containing weighted boolean optimization problem.

parseWBOFile :: FilePath -> IO (Either ParseError SoftFormula) Source

Parse a .wbo format string containing weighted boolean optimization problem.

Show .opb files

Show .wbo files