Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Symbolic STG Execution Support Architecture
- newtype SymbolicT s a = SymbolicT {
- run :: s -> (s, a)
- fmap :: Functor f => forall a b. (a -> b) -> f a -> f b
- pure :: Applicative f => forall a. a -> f a
- (<*>) :: Applicative f => forall a b. f (a -> b) -> f a -> f b
- return :: Monad m => forall a. a -> m a
- (>>=) :: Monad m => forall a b. m a -> (a -> m b) -> m b
- data State = State {
- state_status :: !Status
- state_stack :: !Stack
- state_heap :: !Heap
- state_globals :: !Globals
- state_code :: !Code
- state_names :: ![Name]
- state_paths :: !PathCons
- data Symbol = Symbol Var (Maybe (Expr, Locals))
- data Status = Status {
- status_id :: !Int
- status_parent :: !Int
- status_steps :: !Int
- data Stack
- data Frame
- = CaseFrame Var [Alt] Locals
- | ApplyFrame [Atom] Locals
- | UpdateFrame MemAddr
- data MemAddr
- data Value
- data Locals
- data Heap
- data HeapObj
- data Globals
- data Code
- data PathCons
- data Constraint = Constraint (AltCon, [Var]) Expr Locals Bool
- nameOccStr :: Name -> String
- nameUnique :: Name -> Int
- varName :: Var -> Name
- null_addr :: MemAddr
- addrInt :: MemAddr -> Int
- init_status :: Status
- incStatusSteps :: Status -> Status
- updateStatusId :: Int -> Status -> Status
- empty_stack :: Stack
- popStack :: Stack -> Maybe (Frame, Stack)
- pushStack :: Frame -> Stack -> Stack
- stackToList :: Stack -> [Frame]
- empty_locals :: Locals
- lookupLocals :: Var -> Locals -> Maybe Value
- insertLocals :: (Var, Value) -> Locals -> Locals
- insertLocalsList :: [(Var, Value)] -> Locals -> Locals
- localsToList :: Locals -> [(Name, Value)]
- empty_heap :: Heap
- lookupHeap :: MemAddr -> Heap -> Maybe HeapObj
- allocHeap :: HeapObj -> Heap -> (Heap, MemAddr)
- allocHeapList :: [HeapObj] -> Heap -> (Heap, [MemAddr])
- insertHeap :: (MemAddr, HeapObj) -> Heap -> Heap
- insertHeapList :: [(MemAddr, HeapObj)] -> Heap -> Heap
- heapToList :: Heap -> [(MemAddr, HeapObj)]
- empty_globals :: Globals
- lookupGlobals :: Var -> Globals -> Maybe Value
- insertGlobals :: (Var, Value) -> Globals -> Globals
- insertGlobalsList :: [(Var, Value)] -> Globals -> Globals
- globalsToList :: Globals -> [(Name, Value)]
- empty_pathcons :: PathCons
- insertPathCons :: Constraint -> PathCons -> PathCons
- insertPathConsList :: [Constraint] -> PathCons -> PathCons
- pathconsToList :: PathCons -> [Constraint]
- lookupValue :: Var -> Locals -> Globals -> Maybe Value
- vlookupHeap :: Var -> Locals -> Globals -> Heap -> Maybe (MemAddr, HeapObj)
- memAddrType :: MemAddr -> Heap -> Maybe Type
Documentation
newtype SymbolicT s a Source #
Symbolic Transformation represents transformations applied to some State`(s). This is useful in allowing us to transfer from different actions within the engine.
pure :: Applicative f => forall a. a -> f a #
Lift a value.
(<*>) :: Applicative f => forall a b. f (a -> b) -> f a -> f b #
Sequential application.
(>>=) :: Monad m => forall a b. m a -> (a -> m b) -> m b #
Sequentially compose two actions, passing any value produced by the first as an argument to the second.
State
contains the information necessary to perform symbolic execution.
Eval/Apply graph reduction semantics are used.
State | |
|
Symbolic variables. The Maybe (Expr, Locals)
can be used to trace the
source from which the symbolic variable was generated. For instance, this is
useful during symbolic function application.
State status.
Status | |
|
Execution stack used in graph reduction semnatics.
Frames of a stack.
Memory address for things on the Heap
.
Heap objects.
Globals are statically loaded at the time when a State
is loaded.
However, because uninterpreted / out-of-scope variables are made symbolic
at runtime, it can be modified during execution.
Evaluation of the current expression. We are either evaluating, or ready
to return with some Value
.
Path constraints are the conjunctive normal form of Constraint
s.
data Constraint Source #
Constraints denote logical paths taken in program execution thus far.
init_status :: Status Source #
Initial Status
.
empty_stack :: Stack Source #
Empty `Stack.
empty_locals :: Locals Source #
Empty Locals
.
empty_heap :: Heap Source #
Empty Heap
.
empty_globals :: Globals Source #
Empty Globals
.
empty_pathcons :: PathCons Source #
Empty PathCons
.
insertPathCons :: Constraint -> PathCons -> PathCons Source #
PathCons
insertion.
insertPathConsList :: [Constraint] -> PathCons -> PathCons Source #
Insert a list of Constraint
s into a PathCons
.
pathconsToList :: PathCons -> [Constraint] Source #
PathCons
to list of Constraint
s.