satchmo-2.9.9.4: SAT encoding monad
Safe HaskellSafe-Inferred
LanguageHaskell2010

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.

data Number Source #

Instances

Instances details
Constant Number Source # 
Instance details

Defined in Satchmo.Binary.Numeric

Methods

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

Create Number Source # 
Instance details

Defined in Satchmo.Binary.Numeric

Methods

create :: MonadSAT m => Int -> m Number Source #

Numeric Number Source # 
Instance details

Defined in Satchmo.Binary.Numeric

(Monad m, Decode m Boolean Bool) => Decode m Number Integer Source # 
Instance details

Defined in Satchmo.Binary.Data

Methods

decode :: Number -> m Integer Source #

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