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

Safe HaskellSafe

Data.Integer.SAT

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 Source

A collection of propositions.

Instances

noProps :: PropSetSource

An empty collection of propositions.

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

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 -> PropSetSource

Add a new proposition to an existing collection.

data Prop Source

The type of proposition.

Instances

data Expr Source

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

Constructors

Expr :+ Expr

Addition

Expr :- Expr

Subtraction

Integer :* Expr

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

Instances

data BoundType Source

Constructors

Lower 
Upper 

Instances

getExprBound :: BoundType -> Expr -> PropSet -> Maybe IntegerSource

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

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

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

data Name Source

Instances