sbv-7.10: 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

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Enum Word4 Source #

Enum instance, trivial definitions.

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Eq Word4 Source # 
Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

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.

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Data Word4 Source # 
Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

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

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Ord Word4 Source # 
Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

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

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Real Word4 Source #

Real instance simply uses the Word8 instance

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Methods

toRational :: Word4 -> Rational #

Show Word4 Source #

Show instance

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Methods

showsPrec :: Int -> Word4 -> ShowS #

show :: Word4 -> String #

showList :: [Word4] -> ShowS #

Bits Word4 Source #

Bits instance

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Random Word4 Source #

Random instance, used in quick-check

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

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

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

SymWord Word4 Source #

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

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

SatModel Word4 Source #

SatModel instance, merely uses the generic parsing method.

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

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

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

SDivisible Word4 Source #

SDvisible instance, using 0-extension

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

SIntegral Word4 Source #

SIntegral instance, using default methods

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Splittable Word8 Word4 Source #

Joiningsplitting tofrom Word8

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

word4 :: Word8 -> Word4 Source #

Smart constructor; simplifies conversion from Word8

type SWord4 = SBV Word4 Source #

SWord4 type synonym