satchmo-1.1.1: SAT encoding monad

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 :: Int -> Number -> SAT NumberSource

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

add :: Number -> Number -> SAT NumberSource

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

times :: Number -> Number -> SAT NumberSource

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

number :: Int -> SAT NumberSource

declare a number variable (bit width)

constant :: Integer -> SAT NumberSource

declare a number constant