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
Stabilityprovisional
Portabilitynon-portable (FlexibleInstances, MultiParamTypeClasses, FunctionalDependencies)
Safe HaskellSafe-Inferred
LanguageHaskell2010

ToySolver.Data.ArithRel

Contents

Description

Arithmetic relations

Synopsis

Relational operators

data RelOp Source

relational operators

Constructors

Lt 
Le 
Ge 
Gt 
Eql 
NEq 

Instances

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 Rel e Source

Atomic formula

Constructors

Rel e RelOp e 

Instances

Functor Rel 
IsRel e (Rel e) 
Eq e => Eq (Rel e) 
Ord e => Ord (Rel e) 
Show e => Show (Rel e) 
Complement (Rel c) 
Variables e => Variables (Rel e) 
IsRel (Expr c) (Formula (Atom c)) 

DSL

class IsRel e r | r -> e where Source

type class for constructing relational formula

Methods

rel :: RelOp -> e -> e -> r Source

Instances

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

constructing relational formula

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

constructing relational formula

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

constructing relational formula

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

constructing relational formula

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

constructing relational formula

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

constructing relational formula