Copyright | (c) Masahiro Sakai 2011-2013 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | non-portable (FlexibleInstances) |
Safe Haskell | None |
Language | Haskell2010 |
Naive implementation of Cooper's algorithm
Reference:
- http://hagi.is.s.u-tokyo.ac.jp/pub/staff/hagiya/kougiroku/ronri/5.txt
- http://www.cs.cmu.edu/~emc/spring06/home1_files/Presburger%20Arithmetic.ppt
See also:
- type ExprZ = Expr Integer
- data Lit
- evalLit :: Model Integer -> Lit -> Bool
- data QFFormula
- fromLAAtom :: Atom Rational -> QFFormula
- (.|.) :: Integer -> ExprZ -> QFFormula
- evalQFFormula :: Model Integer -> QFFormula -> Bool
- project :: Var -> QFFormula -> (QFFormula, Model Integer -> Model Integer)
- projectN :: VarSet -> QFFormula -> (QFFormula, Model Integer -> Model Integer)
- projectCases :: Var -> QFFormula -> [(QFFormula, Model Integer -> Model Integer)]
- projectCasesN :: VarSet -> QFFormula -> [(QFFormula, Model Integer -> Model Integer)]
- solve :: VarSet -> [Atom Rational] -> Maybe (Model Integer)
- solveQFFormula :: VarSet -> QFFormula -> Maybe (Model Integer)
- solveQFLA :: VarSet -> [Atom Rational] -> VarSet -> Maybe (Model Rational)
Language of presburger arithmetics
Literal
Pos e
meanse > 0
Divisible True d e
meanse
can be divided byd
(i.e.d|e
)Divisible False d e
meanse
can not be divided byd
(i.e.¬(d|e)
)
quantifier-free negation normal form
fromLAAtom :: Atom Rational -> QFFormula Source