presburger-1.3.1: A decision procedure for quantifier-free linear arithmetic.

Safe HaskellTrustworthy
LanguageHaskell98

Data.Integer.SAT

Contents

Description

This module implements a decision procedure for quantifier-free linear arithmetic. The algorithm is based on the following paper:

An Online Proof-Producing Decision Procedure for Mixed-Integer Linear Arithmetic by Sergey Berezin, Vijay Ganesh, and David L. Dill

Synopsis

Documentation

data PropSet #

A collection of propositions.

Instances

noProps :: PropSet #

An empty collection of propositions.

checkSat :: PropSet -> Maybe [(Int, Integer)] #

Extract a model from a consistent set of propositions. Returns Nothing if the assertions have no model. If a variable does not appear in the assignment, then it is 0 (?).

assert :: Prop -> PropSet -> PropSet #

Add a new proposition to an existing collection.

data Prop #

The type of proposition.

Constructors

PTrue 
PFalse 
Prop :|| Prop infixr 2 
Prop :&& Prop infixr 3 
Not Prop 
Expr :== Expr infix 4 
Expr :/= Expr infix 4 
Expr :< Expr infix 4 
Expr :> Expr infix 4 
Expr :<= Expr infix 4 
Expr :>= Expr infix 4 

data Expr #

The type of integer expressions. Variable names must be non-negative.

Constructors

Expr :+ Expr infixl 6

Addition

Expr :- Expr infixl 6

Subtraction

Integer :* Expr infixl 7

Multiplication by a constant

Negate Expr

Negation

Var Name

Variable

K Integer

Constant

If Prop Expr Expr

A conditional expression

Div Expr Integer

Division, rounds down

Mod Expr Integer

Non-negative remainder

data BoundType #

Constructors

Lower 
Upper 

getExprBound :: BoundType -> Expr -> PropSet -> Maybe Integer #

Computes bounds on the expression that are compatible with the model. Returns Nothing if the bound is not known.

getExprRange :: Expr -> PropSet -> Maybe [Integer] #

Compute the range of possible values for an expression. Returns Nothing if the bound is not known.

data Name #

Instances

Eq Name # 

Methods

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

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

Ord Name # 

Methods

compare :: Name -> Name -> Ordering #

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

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

(>) :: Name -> Name -> Bool #

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

max :: Name -> Name -> Name #

min :: Name -> Name -> Name #

Read Name # 
Show Name # 

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

Iterators

allSolutions :: PropSet -> [Solutions] #

slnCurrent :: Solutions -> [(Int, Integer)] #

slnNextVal :: Solutions -> Maybe Solutions #

slnNextVar :: Solutions -> Maybe Solutions #

slnEnumerate :: Solutions -> [Solutions] #

Debug

allInerts :: PropSet -> [Inerts] #

ppInerts :: Inerts -> Doc #

For QuickCheck

data Bound #

Constructors

Bound Integer Term

The integer is strictly positive

Instances

tConst :: Integer -> Term #

A constant term.