Copyright | (c) 2013-2015 Galois, Inc. |
---|---|
License | BSD3 |
Maintainer | cryptol@galois.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
- isTBit :: TValue -> Bool
- isTSeq :: TValue -> Maybe (TValue, TValue)
- isTFun :: TValue -> Maybe (TValue, TValue)
- isTTuple :: TValue -> Maybe (Int, [TValue])
- isTRec :: TValue -> Maybe [(Name, TValue)]
- tvSeq :: TValue -> TValue -> TValue
- numTValue :: TValue -> Nat'
- toNumTValue :: Nat' -> TValue
- finTValue :: TValue -> Integer
- data BV = BV !Integer !Integer
- mkBv :: Integer -> Integer -> BV
- data GenValue b w
- type Value = GenValue Bool BV
- newtype TValue = TValue {}
- data PPOpts = PPOpts {}
- defaultPPOpts :: PPOpts
- ppValue :: PPOpts -> Value -> Doc
- asciiMode :: PPOpts -> Integer -> Bool
- integerToChar :: Integer -> Char
- data WithBase a = WithBase PPOpts a
- ppWord :: PPOpts -> BV -> Doc
- class BitWord b w where
- packWord :: [b] -> w
- unpackWord :: w -> [b]
- mask :: Integer -> Integer -> Integer
- word :: Integer -> Integer -> Value
- lam :: (GenValue b w -> GenValue b w) -> GenValue b w
- tlam :: (TValue -> GenValue b w) -> GenValue b w
- toStream :: [GenValue b w] -> GenValue b w
- toFinSeq :: TValue -> [GenValue b w] -> GenValue b w
- boolToWord :: [Bool] -> Value
- toSeq :: TValue -> TValue -> [GenValue b w] -> GenValue b w
- toPackedSeq :: TValue -> TValue -> [Value] -> Value
- fromVBit :: GenValue b w -> b
- fromSeq :: BitWord b w => GenValue b w -> [GenValue b w]
- fromStr :: Value -> String
- fromVWord :: BitWord b w => GenValue b w -> w
- vWordLen :: Value -> Maybe Integer
- fromWord :: Value -> Integer
- fromVFun :: GenValue b w -> GenValue b w -> GenValue b w
- fromVPoly :: GenValue b w -> TValue -> GenValue b w
- fromVTuple :: GenValue b w -> [GenValue b w]
- fromVRecord :: GenValue b w -> [(Name, GenValue b w)]
- lookupRecord :: Name -> GenValue b w -> GenValue b w
- toExpr :: Type -> Value -> Maybe Expr
Documentation
toNumTValue :: Nat' -> TValue Source
Generic value type, parameterized by bit and word types.
An evaluated type. These types do not contain type variables, type synonyms, or type functions.
integerToChar :: Integer -> Char Source
class BitWord b w where Source
NOTE this assumes that the sequence of bits is big-endian and finite, so the first element of the list will be the most significant bit.
unpackWord :: w -> [b] Source
NOTE this produces a list of bits that represent a big-endian word, so the most significant bit is the first element of the list.
boolToWord :: [Bool] -> Value Source
This is strict!
toSeq :: TValue -> TValue -> [GenValue b w] -> GenValue b w Source
Construct either a finite sequence, or a stream. In the finite case, record whether or not the elements were bits, to aid pretty-printing.
toPackedSeq :: TValue -> TValue -> [Value] -> Value Source
Construct one of: * a word, when the sequence is finite and the elements are bits * a sequence, when the sequence is finite but the elements aren't bits * a stream, when the sequence is not finite
NOTE: do not use this constructor in the case where the thing may be a finite, but recursive, sequence.
fromVWord :: BitWord b w => GenValue b w -> w Source
Extract a packed word. Note that this does not clean-up any junk bits in the word.
fromVPoly :: GenValue b w -> TValue -> GenValue b w Source
Extract a polymorphic function from a value.
fromVTuple :: GenValue b w -> [GenValue b w] Source
Extract a tuple from a value.
fromVRecord :: GenValue b w -> [(Name, GenValue b w)] Source
Extract a record from a value.
lookupRecord :: Name -> GenValue b w -> GenValue b w Source
Lookup a field in a record.