Copyright | (c) 2013-2015 Galois, Inc. |
---|---|
License | BSD3 |
Maintainer | cryptol@galois.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
This module defines intervals and interval arithmetic.
- data Interval = Interval {
- lowerBound :: Nat'
- upperBound :: Nat'
- isFinite :: Bool
- anything :: Interval
- iConst :: Nat' -> Interval
- iAdd :: Interval -> Interval -> Interval
- iMul :: Interval -> Interval -> Interval
- iExp :: Interval -> Interval -> Interval
- iMin :: Interval -> Interval -> Interval
- iMax :: Interval -> Interval -> Interval
- iLg2 :: Interval -> Interval
- iWidth :: Interval -> Interval
- iSub :: Interval -> Interval -> Interval
- iDiv :: Interval -> Interval -> Interval
- iMod :: Interval -> Interval -> Interval
- iLenFromThen :: Interval -> Interval -> Interval -> Interval
- iLenFromTo :: Interval -> Interval -> Interval
- iLenFromThenTo :: Interval -> Interval -> Interval -> Interval
- iLeq :: Interval -> Interval -> Bool
- iLt :: Interval -> Interval -> Bool
- iDisjoint :: Interval -> Interval -> Bool
Documentation
Representation of intervals.
Intervals always include the lower bound.
Intervals include the upper bound if:
* either the upper bound is finite, or
* the upper bound is Inf
and isFinite == False
.
Invariant: if the upper bound is finite, then `isFinite == True`.
[x,y] Interval (Nat x) (Nat y) True [x,inf] Interval (Nat x) Inf False [x,inf) Interval (Nat x) Inf True
Interval | |
|
iLenFromTo :: Interval -> Interval -> Interval Source