Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data CexVars = CexVars {
- calldataV :: [Text]
- buffersV :: [Text]
- storeReads :: [(Expr EWord, Expr EWord)]
- blockContextV :: [Text]
- txContextV :: [Text]
- data SMTCex = SMTCex {}
- getVar :: SMTCex -> Text -> W256
- data SMT2 = SMT2 [Builder] CexVars
- formatSMT2 :: SMT2 -> Text
- declareIntermediates :: BufEnv -> StoreEnv -> SMT2
- assertProps :: [Prop] -> SMT2
- referencedBufsGo :: Expr a -> [Builder]
- referencedBufs :: Expr a -> [Builder]
- referencedBufs' :: Prop -> [Builder]
- referencedVarsGo :: Expr a -> [Builder]
- referencedVars :: Expr a -> [Builder]
- referencedVars' :: Prop -> [Builder]
- referencedFrameContextGo :: Expr a -> [Builder]
- referencedFrameContext :: Expr a -> [Builder]
- referencedFrameContext' :: Prop -> [Builder]
- referencedBlockContextGo :: Expr a -> [Builder]
- referencedBlockContext :: Expr a -> [Builder]
- referencedBlockContext' :: Prop -> [Builder]
- isAbstractStorage :: Expr Storage -> Bool
- findStorageReads :: Prop -> [(Expr EWord, Expr EWord)]
- declareBufs :: [Builder] -> SMT2
- declareVars :: [Builder] -> SMT2
- declareFrameContext :: [Builder] -> SMT2
- declareBlockContext :: [Builder] -> SMT2
- prelude :: SMT2
- exprToSMT :: Expr a -> Builder
- sp :: Builder -> Builder -> Builder
- zero :: Builder
- one :: Builder
- propToSMT :: Prop -> Builder
- copySlice :: Expr EWord -> Expr EWord -> Expr EWord -> Builder -> Builder -> Builder
- expandExp :: Expr EWord -> W256 -> Builder
- concatBytes :: [Expr Byte] -> Builder
- writeBytes :: ByteString -> Expr Buf -> Builder
- encodeConcreteStore :: Map W256 (Map W256 W256) -> Builder
- parseW256 :: SpecConstant -> W256
- parseInteger :: SpecConstant -> Integer
- parseW8 :: SpecConstant -> Word8
- parseSC :: (Num a, Eq a) => SpecConstant -> a
- parseErr :: Show a => a -> b
- parseVar :: Text -> Expr EWord
- parseBlockCtx :: Text -> Expr EWord
- parseFrameCtx :: Text -> Expr EWord
- getVars :: (Text -> Expr EWord) -> (Text -> IO Text) -> [Text] -> IO (Map (Expr EWord) W256)
- getBufs :: (Text -> IO Text) -> [Text] -> IO (Map (Expr Buf) ByteString)
- getStore :: (Text -> IO Text) -> [(Expr EWord, Expr EWord)] -> IO (Map W256 (Map W256 W256))
- interpretNDArray :: (Map Symbol Term -> Term -> a) -> Map Symbol Term -> Term -> W256 -> a
- interpret1DArray :: Map Symbol Term -> Term -> W256 -> W256
- interpret2DArray :: Map Symbol Term -> Term -> W256 -> W256 -> W256
Encoding ** ----------------------------------------------------------------------------------
CexVars | |
|
formatSMT2 :: SMT2 -> Text Source #
declareIntermediates :: BufEnv -> StoreEnv -> SMT2 Source #
Reads all intermediate variables from the builder state and produces SMT declaring them as constants
assertProps :: [Prop] -> SMT2 Source #
referencedBufsGo :: Expr a -> [Builder] Source #
referencedBufs :: Expr a -> [Builder] Source #
referencedBufs' :: Prop -> [Builder] Source #
referencedVarsGo :: Expr a -> [Builder] Source #
referencedVars :: Expr a -> [Builder] Source #
referencedVars' :: Prop -> [Builder] Source #
referencedFrameContextGo :: Expr a -> [Builder] Source #
referencedFrameContext :: Expr a -> [Builder] Source #
referencedFrameContext' :: Prop -> [Builder] Source #
referencedBlockContextGo :: Expr a -> [Builder] Source #
referencedBlockContext :: Expr a -> [Builder] Source #
referencedBlockContext' :: Prop -> [Builder] Source #
findStorageReads :: Prop -> [(Expr EWord, Expr EWord)] Source #
This function overapproximates the reads from the abstract storage. Potentially, it can return locations that do not read a slot directly from the abstract store but from subsequent writes on the store (e.g, SLoad addr idx (SStore addr idx val AbstractStore)). However, we expect that most of such reads will have been simplified away.
declareBufs :: [Builder] -> SMT2 Source #
declareVars :: [Builder] -> SMT2 Source #
declareFrameContext :: [Builder] -> SMT2 Source #
declareBlockContext :: [Builder] -> SMT2 Source #
Helpers ** ---------------------------------------------------------------------------------
copySlice :: Expr EWord -> Expr EWord -> Expr EWord -> Builder -> Builder -> Builder Source #
Stores a region of src into dst
expandExp :: Expr EWord -> W256 -> Builder Source #
Unrolls an exponentiation into a series of multiplications
writeBytes :: ByteString -> Expr Buf -> Builder Source #
Concatenates a list of bytes into a larger bitvector
Cex parsing ** --------------------------------------------------------------------------------
parseW256 :: SpecConstant -> W256 Source #
parseInteger :: SpecConstant -> Integer Source #
parseW8 :: SpecConstant -> Word8 Source #
getVars :: (Text -> Expr EWord) -> (Text -> IO Text) -> [Text] -> IO (Map (Expr EWord) W256) Source #
getStore :: (Text -> IO Text) -> [(Expr EWord, Expr EWord)] -> IO (Map W256 (Map W256 W256)) Source #
interpretNDArray :: (Map Symbol Term -> Term -> a) -> Map Symbol Term -> Term -> W256 -> a Source #
Interpret an N-dimensional array as a value of type a. Parameterized by an interpretation function for array values.