satchmo-2.6.0: SAT encoding monad

Safe HaskellNone
LanguageHaskell98

Satchmo.Binary.Op.Fixed

Description

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.

Synopsis

Documentation

restricted :: MonadSAT m => Int -> Number -> m Number Source

give only lower k bits, upper bits must be zero, (else unsatisfiable)

add :: MonadSAT m => Number -> Number -> m Number Source

result bit width is max of argument bit widths. if overflow occurs, then formula is unsatisfiable.

times :: MonadSAT m => Number -> Number -> m Number Source

result bit width is at most max of argument bit widths. if overflow occurs, then formula is unsatisfiable.

number :: MonadSAT m => Int -> m Number Source

declare a number variable (bit width)

constant :: MonadSAT m => Integer -> m Number Source

Declare a number constant

constantWidth :: MonadSAT m => Int -> Integer -> m Number Source

constantWidth w declares a number constant using at least w bits

toBinaryWidth :: Int -> Integer -> [Bool] Source

toBinaryWidth w converts to binary using at least w bits