toysolver-0.8.1: Assorted decision procedures for SAT, SMT, Max-SAT, PB, MIP, etc
Copyright(c) Masahiro Sakai 2016
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

ToySolver.Arith.DifferenceLogic

Description

Synopsis

Documentation

data SimpleAtom b Source #

a :- b :<= k represents a - b ≤ k

Constructors

Diff :<= b infix 4 

Instances

Instances details
Show b => Show (SimpleAtom b) Source # 
Instance details

Defined in ToySolver.Arith.DifferenceLogic

Eq b => Eq (SimpleAtom b) Source # 
Instance details

Defined in ToySolver.Arith.DifferenceLogic

Methods

(==) :: SimpleAtom b -> SimpleAtom b -> Bool #

(/=) :: SimpleAtom b -> SimpleAtom b -> Bool #

Ord b => Ord (SimpleAtom b) Source # 
Instance details

Defined in ToySolver.Arith.DifferenceLogic

type Var = Int Source #

data Diff Source #

Difference of two variables

Constructors

Var :- Var infixl 6 

Instances

Instances details
Show Diff Source # 
Instance details

Defined in ToySolver.Arith.DifferenceLogic

Methods

showsPrec :: Int -> Diff -> ShowS #

show :: Diff -> String #

showList :: [Diff] -> ShowS #

Eq Diff Source # 
Instance details

Defined in ToySolver.Arith.DifferenceLogic

Methods

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

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

Ord Diff Source # 
Instance details

Defined in ToySolver.Arith.DifferenceLogic

Methods

compare :: Diff -> Diff -> Ordering #

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

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

(>) :: Diff -> Diff -> Bool #

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

max :: Diff -> Diff -> Diff #

min :: Diff -> Diff -> Diff #

solve :: (Hashable label, Eq label, Real b) => [(label, SimpleAtom b)] -> Either (HashSet label) (IntMap b) Source #

Takes labeled list of constraints, and returns eithera

  • unsatisfiable set of constraints as a set of labels, or
  • satisfying assignment.