hevm-0.50.2: Ethereum virtual machine evaluator
Safe HaskellSafe-Inferred
LanguageGHC2021

EVM.SMT

Description

 
Synopsis

Encoding ** ----------------------------------------------------------------------------------

data CexVars Source #

Constructors

CexVars 

Fields

Instances

Instances details
Monoid CexVars Source # 
Instance details

Defined in EVM.SMT

Semigroup CexVars Source # 
Instance details

Defined in EVM.SMT

Show CexVars Source # 
Instance details

Defined in EVM.SMT

Eq CexVars Source # 
Instance details

Defined in EVM.SMT

Methods

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

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

data SMTCex Source #

Instances

Instances details
Show SMTCex Source # 
Instance details

Defined in EVM.SMT

Eq SMTCex Source # 
Instance details

Defined in EVM.SMT

Methods

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

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

data SMT2 Source #

Constructors

SMT2 [Builder] CexVars 

Instances

Instances details
Monoid SMT2 Source # 
Instance details

Defined in EVM.SMT

Methods

mempty :: SMT2 #

mappend :: SMT2 -> SMT2 -> SMT2 #

mconcat :: [SMT2] -> SMT2 #

Semigroup SMT2 Source # 
Instance details

Defined in EVM.SMT

Methods

(<>) :: SMT2 -> SMT2 -> SMT2 #

sconcat :: NonEmpty SMT2 -> SMT2 #

stimes :: Integral b => b -> SMT2 -> SMT2 #

Show SMT2 Source # 
Instance details

Defined in EVM.SMT

Methods

showsPrec :: Int -> SMT2 -> ShowS #

show :: SMT2 -> String #

showList :: [SMT2] -> ShowS #

Eq SMT2 Source # 
Instance details

Defined in EVM.SMT

Methods

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

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

declareIntermediates :: BufEnv -> StoreEnv -> SMT2 Source #

Reads all intermediate variables from the builder state and produces SMT declaring them as constants

Execution ** -------------------------------------------------------------------------------

data Solver Source #

Supported solvers

Constructors

Z3 
CVC5 
Bitwuzla 
Custom Text 

Instances

Instances details
Show Solver Source # 
Instance details

Defined in EVM.SMT

data SolverInstance Source #

A running solver instance

newtype SolverGroup Source #

A channel representing a group of solvers

Constructors

SolverGroup (Chan Task) 

data Task Source #

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

Constructors

Task 

data CheckSatResult Source #

The result of a call to (check-sat)

Constructors

Sat SMTCex 
Unsat 
Unknown 
Error Text 

Instances

Instances details
Show CheckSatResult Source # 
Instance details

Defined in EVM.SMT

Eq CheckSatResult Source # 
Instance details

Defined in EVM.SMT

parseErr :: Show a => a -> b Source #

parseSC :: (Num a, Eq a) => SpecConstant -> 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

readSExpr :: Handle -> IO [Text] Source #

Reads lines from h until we have a balanced sexpr

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

concatBytes :: [Expr Byte] -> Builder Source #

Concatenates a list of bytes into a larger bitvector

writeBytes :: ByteString -> Expr Buf -> Builder Source #

Concatenates a list of bytes into a larger bitvector