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

Copyright(c) Masahiro Sakai 2011
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Stabilityprovisional
Portabilitynon-portable (FlexibleInstances, MultiParamTypeClasses, FunctionalDependencies)
Safe HaskellSafe
LanguageHaskell2010

ToySolver.Data.OrdRel

Contents

Description

Ordering relations

Synopsis

Relational operators

data RelOp Source #

relational operators

Constructors

Lt 
Le 
Ge 
Gt 
Eql 
NEq 

Instances

Eq RelOp Source # 

Methods

(==) :: RelOp -> RelOp -> Bool #

(/=) :: RelOp -> RelOp -> Bool #

Ord RelOp Source # 

Methods

compare :: RelOp -> RelOp -> Ordering #

(<) :: RelOp -> RelOp -> Bool #

(<=) :: RelOp -> RelOp -> Bool #

(>) :: RelOp -> RelOp -> Bool #

(>=) :: RelOp -> RelOp -> Bool #

max :: RelOp -> RelOp -> RelOp #

min :: RelOp -> RelOp -> RelOp #

Show RelOp Source # 

Methods

showsPrec :: Int -> RelOp -> ShowS #

show :: RelOp -> String #

showList :: [RelOp] -> ShowS #

flipOp :: RelOp -> RelOp Source #

flipping relational operator

rel (flipOp op) a b is equivalent to rel op b a

negOp :: RelOp -> RelOp Source #

negating relational operator

rel (negOp op) a b is equivalent to notB (rel op a b)

showOp :: RelOp -> String Source #

operator symbol

evalOp :: Ord a => RelOp -> a -> a -> Bool Source #

evaluate an operator into a comparision function

Relation

data OrdRel e Source #

Atomic formula

Constructors

OrdRel e RelOp e 

Instances

Functor OrdRel Source # 

Methods

fmap :: (a -> b) -> OrdRel a -> OrdRel b #

(<$) :: a -> OrdRel b -> OrdRel a #

IsOrdRel e (OrdRel e) Source # 

Methods

(.<.) :: e -> e -> OrdRel e Source #

(.<=.) :: e -> e -> OrdRel e Source #

(.>.) :: e -> e -> OrdRel e Source #

(.>=.) :: e -> e -> OrdRel e Source #

ordRel :: RelOp -> e -> e -> OrdRel e Source #

IsEqRel e (OrdRel e) Source # 

Methods

(.==.) :: e -> e -> OrdRel e Source #

(./=.) :: e -> e -> OrdRel e Source #

Eq e => Eq (OrdRel e) Source # 

Methods

(==) :: OrdRel e -> OrdRel e -> Bool #

(/=) :: OrdRel e -> OrdRel e -> Bool #

Ord e => Ord (OrdRel e) Source # 

Methods

compare :: OrdRel e -> OrdRel e -> Ordering #

(<) :: OrdRel e -> OrdRel e -> Bool #

(<=) :: OrdRel e -> OrdRel e -> Bool #

(>) :: OrdRel e -> OrdRel e -> Bool #

(>=) :: OrdRel e -> OrdRel e -> Bool #

max :: OrdRel e -> OrdRel e -> OrdRel e #

min :: OrdRel e -> OrdRel e -> OrdRel e #

Show e => Show (OrdRel e) Source # 

Methods

showsPrec :: Int -> OrdRel e -> ShowS #

show :: OrdRel e -> String #

showList :: [OrdRel e] -> ShowS #

Variables e => Variables (OrdRel e) Source # 

Methods

vars :: OrdRel e -> VarSet Source #

Complement (OrdRel c) Source # 

Methods

notB :: OrdRel c -> OrdRel c Source #

IsOrdRel (Expr c) (Formula (Atom c)) Source # 

Methods

(.<.) :: Expr c -> Expr c -> Formula (Atom c) Source #

(.<=.) :: Expr c -> Expr c -> Formula (Atom c) Source #

(.>.) :: Expr c -> Expr c -> Formula (Atom c) Source #

(.>=.) :: Expr c -> Expr c -> Formula (Atom c) Source #

ordRel :: RelOp -> Expr c -> Expr c -> Formula (Atom c) Source #

IsEqRel (Expr c) (Formula (Atom c)) Source # 

Methods

(.==.) :: Expr c -> Expr c -> Formula (Atom c) Source #

(./=.) :: Expr c -> Expr c -> Formula (Atom c) Source #

fromOrdRel :: IsOrdRel e r => OrdRel e -> r Source #

DSL

class IsEqRel e r | r -> e where Source #

type class for constructing relational formula

Minimal complete definition

(.==.), (./=.)

Methods

(.==.) :: e -> e -> r infix 4 Source #

(./=.) :: e -> e -> r infix 4 Source #

class IsEqRel e r => IsOrdRel e r | r -> e where Source #

type class for constructing relational formula

Minimal complete definition

(.<.), (.<=.), (.>.), (.>=.) | ordRel

Methods

(.<.), (.<=.), (.>.), (.>=.) :: e -> e -> r infix 4 .<., .<=., .>., .>=. Source #

ordRel :: RelOp -> e -> e -> r Source #