Safe Haskell | None |
---|---|
Language | Haskell98 |
Operations with fixed bit width. Still they are non-overflowing: if overflow occurs, the constraints are not satisfiable. The bit width of the result of binary operations is the max of the bit width of the inputs.
- add :: MonadSAT m => Number -> Number -> m Number
- subtract :: MonadSAT m => Number -> Number -> m Number
- times :: MonadSAT m => Number -> Number -> m Number
- increment :: MonadSAT m => Number -> m Number
- negate :: MonadSAT m => Number -> m Number
- linear :: MonadSAT m => Number -> Number -> Number -> m Number
- data Number
- bits :: Number -> [Boolean]
- fromBooleans :: [Boolean] -> Number
- number :: MonadSAT m => Int -> m Number
- toUnsigned :: Number -> Number
- fromUnsigned :: Number -> Number
- width :: Number -> Int
- isNull :: Number -> Bool
- msb :: Number -> Boolean
- constant :: MonadSAT m => Integer -> m Number
- constantWidth :: MonadSAT m => Int -> Integer -> m Number
- equals :: MonadSAT m => Number -> Number -> m Boolean
- eq :: MonadSAT m => Number -> Number -> m Boolean
- lt :: MonadSAT m => Number -> Number -> m Boolean
- le :: MonadSAT m => Number -> Number -> m Boolean
- ge :: MonadSAT m => Number -> Number -> m Boolean
- gt :: MonadSAT m => Number -> Number -> m Boolean
- positive :: MonadSAT m => Number -> m Boolean
- negative :: MonadSAT m => Number -> m Boolean
- nonNegative :: MonadSAT m => Number -> m Boolean
Documentation
fromBooleans :: [Boolean] -> Number Source
Make a number from its binary representation
toUnsigned :: Number -> Number Source
Convert to unsigned number (see Satchmo.Binary.Op.Flexible)
fromUnsigned :: Number -> Number Source
Convert from unsigned number (see Satchmo.Binary.Op.Flexible). The result is interpreted as a positive or negative number, depending on its most significant bit.
constantWidth :: MonadSAT m => Int -> Integer -> m Number Source
constantWidth w
declares a number constant using at least w
bits
nonNegative :: MonadSAT m => Number -> m Boolean Source