sbv-7.7: SMT Based Verification: Symbolic Haskell theorem prover using SMT solving.

Copyright(c) Brian Huffman
LicenseBSD3
Maintainererkokl@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Documentation.SBV.Examples.Misc.Word4

Description

Demonstrates how new sizes of word/int types can be defined and used with SBV.

Synopsis

Documentation

newtype Word4 Source #

Word4 as a newtype. Invariant: Word4 x should satisfy x < 16.

Constructors

Word4 Word8 

Instances

Bounded Word4 Source #

Bounded instance; from 0 to 255

Enum Word4 Source #

Enum instance, trivial definitions.

Eq Word4 Source # 

Methods

(==) :: Word4 -> Word4 -> Bool #

(/=) :: Word4 -> Word4 -> Bool #

Integral Word4 Source #

Integral instance, again using Word8 instance and casting. NB. we do not need to use the smart constructor here as neither the quotient nor the remainder can overflow a Word4.

Data Word4 Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word4 -> c Word4 #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word4 #

toConstr :: Word4 -> Constr #

dataTypeOf :: Word4 -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Word4) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word4) #

gmapT :: (forall b. Data b => b -> b) -> Word4 -> Word4 #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word4 -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word4 -> r #

gmapQ :: (forall d. Data d => d -> u) -> Word4 -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Word4 -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word4 -> m Word4 #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word4 -> m Word4 #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word4 -> m Word4 #

Num Word4 Source #

Num instance, merely lifts underlying 8-bit operation and casts back

Ord Word4 Source # 

Methods

compare :: Word4 -> Word4 -> Ordering #

(<) :: Word4 -> Word4 -> Bool #

(<=) :: Word4 -> Word4 -> Bool #

(>) :: Word4 -> Word4 -> Bool #

(>=) :: Word4 -> Word4 -> Bool #

max :: Word4 -> Word4 -> Word4 #

min :: Word4 -> Word4 -> Word4 #

Read Word4 Source #

Read instance. We read as an 8-bit word, and coerce

Real Word4 Source #

Real instance simply uses the Word8 instance

Methods

toRational :: Word4 -> Rational #

Show Word4 Source #

Show instance

Methods

showsPrec :: Int -> Word4 -> ShowS #

show :: Word4 -> String #

showList :: [Word4] -> ShowS #

Bits Word4 Source #

Bits instance

Random Word4 Source #

Random instance, used in quick-check

Methods

randomR :: RandomGen g => (Word4, Word4) -> g -> (Word4, g) #

random :: RandomGen g => g -> (Word4, g) #

randomRs :: RandomGen g => (Word4, Word4) -> g -> [Word4] #

randoms :: RandomGen g => g -> [Word4] #

randomRIO :: (Word4, Word4) -> IO Word4 #

randomIO :: IO Word4 #

HasKind Word4 Source #

HasKind instance; simply returning the underlying kind for the type

SymWord Word4 Source #

SymWord instance, allowing this type to be used in proofs/sat etc.

SatModel Word4 Source #

SatModel instance, merely uses the generic parsing method.

Methods

parseCWs :: [CW] -> Maybe (Word4, [CW]) Source #

cvtModel :: (Word4 -> Maybe b) -> Maybe (Word4, [CW]) -> Maybe (b, [CW]) Source #

SDivisible SWord4 Source #

SDvisible instance, using default methods

SDivisible Word4 Source #

SDvisible instance, using 0-extension

SIntegral Word4 Source #

SIntegral instance, using default methods

Splittable Word8 Word4 Source #

Joiningsplitting tofrom Word8

word4 :: Word8 -> Word4 Source #

Smart constructor; simplifies conversion from Word8

type SWord4 = SBV Word4 Source #

SWord4 type synonym