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

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

ToySolver.Data.MIP

Description

Mixed-Integer Programming Problems with some commmonly used extensions

Synopsis

Documentation

readFile :: FileOptions -> FilePath -> IO (Problem Scientific) Source #

Parse .lp or .mps file based on file extension

readLPFile :: FileOptions -> FilePath -> IO (Problem Scientific) Source #

Parse a file containing LP file data.

readMPSFile :: FileOptions -> FilePath -> IO (Problem Scientific) Source #

Parse a file containing MPS file data.

parseLPString :: FileOptions -> String -> String -> Either (ParseError Char Void) (Problem Scientific) Source #

Parse a string containing LP file data.

parseMPSString :: FileOptions -> String -> String -> Either (ParseError Char Void) (Problem Scientific) Source #

Parse a string containing MPS file data.

data ParseError t e :: * -> * -> * #

ParseError t e represents a parse error parametrized over the token type t and the custom data e.

Note that the stack of source positions contains current position as its head, and the rest of positions allows to track full sequence of include files with topmost source file at the end of the list.

Semigroup and Monoid instances of the data type allow to merge parse errors from different branches of parsing. When merging two ParseErrors, the longest match is preferred; if positions are the same, custom data sets and collections of message items are combined. Note that fancy errors take precedence over trivial errors in merging.

Since: 6.0.0

Constructors

TrivialError (NonEmpty SourcePos) (Maybe (ErrorItem t)) (Set (ErrorItem t))

Trivial errors, generated by Megaparsec's machinery. The data constructor includes the stack of source positions, unexpected token (if any), and expected tokens.

FancyError (NonEmpty SourcePos) (Set (ErrorFancy e))

Fancy, custom errors.

Instances

(Eq e, Eq t) => Eq (ParseError t e) 

Methods

(==) :: ParseError t e -> ParseError t e -> Bool #

(/=) :: ParseError t e -> ParseError t e -> Bool #

(Ord e, Ord t, Data e, Data t) => Data (ParseError t e) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ParseError t e -> c (ParseError t e) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ParseError t e) #

toConstr :: ParseError t e -> Constr #

dataTypeOf :: ParseError t e -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (ParseError t e)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d a. (Data d, Data a) => c (t d a)) -> Maybe (c (ParseError t e)) #

gmapT :: (forall b. Data b => b -> b) -> ParseError t e -> ParseError t e #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ParseError t e -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ParseError t e -> r #

gmapQ :: (forall d. Data d => d -> u) -> ParseError t e -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ParseError t e -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ParseError t e -> m (ParseError t e) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ParseError t e -> m (ParseError t e) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ParseError t e -> m (ParseError t e) #

(Ord e, Ord t, Read e, Read t) => Read (ParseError t e) 
(Show e, Show t) => Show (ParseError t e) 

Methods

showsPrec :: Int -> ParseError t e -> ShowS #

show :: ParseError t e -> String #

showList :: [ParseError t e] -> ShowS #

Generic (ParseError t e) 

Associated Types

type Rep (ParseError t e) :: * -> * #

Methods

from :: ParseError t e -> Rep (ParseError t e) x #

to :: Rep (ParseError t e) x -> ParseError t e #

(Ord t, Ord e) => Semigroup (ParseError t e) 

Methods

(<>) :: ParseError t e -> ParseError t e -> ParseError t e #

sconcat :: NonEmpty (ParseError t e) -> ParseError t e #

stimes :: Integral b => b -> ParseError t e -> ParseError t e #

(Ord t, Ord e) => Monoid (ParseError t e) 

Methods

mempty :: ParseError t e #

mappend :: ParseError t e -> ParseError t e -> ParseError t e #

mconcat :: [ParseError t e] -> ParseError t e #

(Show t, Ord t, ShowToken t, Typeable * t, Show e, ShowErrorComponent e, Typeable * e) => Exception (ParseError t e) 
(NFData t, NFData e) => NFData (ParseError t e) 

Methods

rnf :: ParseError t e -> () #

type Rep (ParseError t e)