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

Portabilitynon-portable (BangPatterns)
Maintainermasahiro.sakai@gmail.com
Safe HaskellSafe-Inferred

Text.PBFile

Contents

Description

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

References:

Synopsis

Abstract Syntax

type Formula = (Maybe Sum, [Constraint])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

type SoftFormula = (Maybe Integer, [SoftConstraint])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 = IntSource

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

type Var = IntSource

Variable are repserented positive integer.

Parsing .opb files

parseOPBString :: SourceName -> String -> Either ParseError FormulaSource

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 SoftFormulaSource

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

Utility