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

Copyright (c) Masahiro Sakai 2011 BSD-style masahiro.sakai@gmail.com provisional non-portable (FlexibleInstances, MultiParamTypeClasses, FunctionalDependencies) Safe-Inferred Haskell2010

ToySolver.Data.ArithRel

Contents

Description

Arithmetic relations

Synopsis

# Relational operators

data RelOp Source

relational operators

Constructors

 Lt Le Ge Gt Eql NEq

Instances

 Eq RelOp Ord RelOp Show RelOp

flipping relational operator

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

negating relational operator

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

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 (Rel e) IsRel (Expr Integer) QFFormula IsRel (Expr c) (Formula (Atom c))

(.<.) :: 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