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

Satchmo.BinaryTwosComplement.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

data Number Source #

Instances

Instances details
Constant Number Source # 
Instance details

Defined in Satchmo.BinaryTwosComplement.Numeric

Methods

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

Create Number Source # 
Instance details

Defined in Satchmo.BinaryTwosComplement.Numeric

Methods

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

Numeric Number Source # 
Instance details

Defined in Satchmo.BinaryTwosComplement.Numeric

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

Defined in Satchmo.BinaryTwosComplement.Data

Methods

decode :: Number -> m Integer Source #

fromBooleans :: [Boolean] -> Number Source #

Make a number from its binary representation

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

Get a number variable of given bit width

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.

width :: Number -> Int Source #

Get bit width

isNull :: Number -> Bool Source #

isNull n == True if width n == 0

msb :: Number -> Boolean Source #

Most significant bit

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

Get a number constant

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

constantWidth w declares a number constant using at least w bits