Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data CexVars = CexVars {
- calldataV :: [Text]
- buffersV :: [Text]
- 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
- prelude :: SMT2
- declareBufs :: [Builder] -> SMT2
- referencedBufs :: Expr a -> [Builder]
- referencedBufs' :: Prop -> [Builder]
- referencedVars' :: Prop -> [Builder]
- referencedFrameContext' :: Prop -> [Builder]
- referencedBlockContext' :: Prop -> [Builder]
- declareVars :: [Builder] -> SMT2
- referencedVars :: Expr a -> [Builder]
- declareFrameContext :: [Builder] -> SMT2
- referencedFrameContext :: Expr a -> [Builder]
- declareBlockContext :: [Builder] -> SMT2
- referencedBlockContext :: Expr a -> [Builder]
- exprToSMT :: Expr a -> Builder
- sp :: Builder -> Builder -> Builder
- zero :: Builder
- one :: Builder
- propToSMT :: Prop -> Builder
- data Solver
- data SolverInstance = SolverInstance {}
- newtype SolverGroup = SolverGroup (Chan Task)
- data Task = Task {}
- data CheckSatResult
- isSat :: CheckSatResult -> Bool
- isErr :: CheckSatResult -> Bool
- isUnsat :: CheckSatResult -> Bool
- checkSat :: SolverGroup -> SMT2 -> IO CheckSatResult
- parseW256 :: SpecConstant -> W256
- parseInteger :: SpecConstant -> Integer
- parseW8 :: SpecConstant -> Word8
- parseErr :: Show a => a -> b
- parseVar :: Text -> Expr EWord
- parseBlockCtx :: Text -> Expr EWord
- parseFrameCtx :: Text -> Expr EWord
- getVars :: (Text -> Expr EWord) -> SolverInstance -> [Text] -> IO (Map (Expr EWord) W256)
- getBufs :: SolverInstance -> [Text] -> IO (Map (Expr Buf) ByteString)
- parseSC :: (Num a, Eq a) => SpecConstant -> a
- withSolvers :: Solver -> Natural -> Maybe Natural -> (SolverGroup -> IO a) -> IO a
- solverArgs :: Solver -> Maybe Natural -> [Text]
- spawnSolver :: Solver -> Maybe Natural -> IO SolverInstance
- stopSolver :: SolverInstance -> IO ()
- sendScript :: SolverInstance -> SMT2 -> IO (Either Text ())
- sendCommand :: SolverInstance -> Text -> IO Text
- sendLine :: SolverInstance -> Text -> IO Text
- sendLine' :: SolverInstance -> Text -> IO ()
- getValue :: SolverInstance -> Text -> IO Text
- readSExpr :: Handle -> IO [Text]
- 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
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 #
declareBufs :: [Builder] -> SMT2 Source #
referencedBufs :: Expr a -> [Builder] Source #
referencedBufs' :: Prop -> [Builder] Source #
referencedVars' :: Prop -> [Builder] Source #
referencedFrameContext' :: Prop -> [Builder] Source #
referencedBlockContext' :: Prop -> [Builder] Source #
declareVars :: [Builder] -> SMT2 Source #
referencedVars :: Expr a -> [Builder] Source #
declareFrameContext :: [Builder] -> SMT2 Source #
referencedFrameContext :: Expr a -> [Builder] Source #
declareBlockContext :: [Builder] -> SMT2 Source #
referencedBlockContext :: Expr a -> [Builder] Source #
Execution ** -------------------------------------------------------------------------------
Supported solvers
data SolverInstance Source #
A running solver instance
A script to be executed, a list of models to be extracted in the case of a sat result, and a channel where the result should be written
Task | |
|
data CheckSatResult Source #
The result of a call to (check-sat)
Instances
Show CheckSatResult Source # | |
Defined in EVM.SMT showsPrec :: Int -> CheckSatResult -> ShowS # show :: CheckSatResult -> String # showList :: [CheckSatResult] -> ShowS # | |
Eq CheckSatResult Source # | |
Defined in EVM.SMT (==) :: CheckSatResult -> CheckSatResult -> Bool # (/=) :: CheckSatResult -> CheckSatResult -> Bool # |
isSat :: CheckSatResult -> Bool Source #
isErr :: CheckSatResult -> Bool Source #
isUnsat :: CheckSatResult -> Bool Source #
checkSat :: SolverGroup -> SMT2 -> IO CheckSatResult Source #
parseW256 :: SpecConstant -> W256 Source #
parseInteger :: SpecConstant -> Integer Source #
parseW8 :: SpecConstant -> Word8 Source #
getBufs :: SolverInstance -> [Text] -> IO (Map (Expr Buf) ByteString) Source #
withSolvers :: Solver -> Natural -> Maybe Natural -> (SolverGroup -> IO a) -> IO a Source #
solverArgs :: Solver -> Maybe Natural -> [Text] Source #
Arguments used when spawing a solver instance
spawnSolver :: Solver -> Maybe Natural -> IO SolverInstance Source #
Spawns a solver instance, and sets the various global config options that we use for our queries
stopSolver :: SolverInstance -> IO () Source #
Cleanly shutdown a running solver instnace
sendScript :: SolverInstance -> SMT2 -> IO (Either Text ()) Source #
Sends a list of commands to the solver. Returns the first error, if there was one.
sendCommand :: SolverInstance -> Text -> IO Text Source #
Sends a single command to the solver, returns the first available line from the output buffer
sendLine :: SolverInstance -> Text -> IO Text Source #
Sends a string to the solver and appends a newline, returns the first available line from the output buffer
sendLine' :: SolverInstance -> Text -> IO () Source #
Sends a string to the solver and appends a newline, doesn't return stdout
getValue :: SolverInstance -> Text -> IO Text Source #
Returns a string representation of the model for the requested variable
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