macaw-base
Safe HaskellNone
LanguageHaskell2010

Data.Macaw.AbsDomain.StackAnalysis

Description

This module defines a relational abstract domain for tracking registers and stack addresses. The model records when one of these values is known to be equal to the current pointer stack frame. This domain also tracks equalities between nodes so that analysis algorithms built on top of this are modulo known equivalences between registers and stack locations.

The theory is defined over bitvector with a predefined "address width" addrWidth for the number of bits in the address space

p := t = u
  |  t = stack_frame + c
  |  t = uext u w    (1 <= width u && width u < w)

t := r (@r@ is a register)
  |  *(stack_frame + c)

c is a signed addrWidth-bit bitvector. stack_frame denotes a addrWidth-bit bitvector for the stack frame. w is a width parameter.

Given a set of axioms using the constraint P we have the following proof rules:

A,p |= p                                                       (assumption)
A   |= t = t                                                   (reflexivity)
A   |= t = u => A |= u = t                                     (symmetry)
A   |= t = u && A |= u = v => A |= t = v                       (transitivity)
A   |= t = uext u w && A |= u = uext v w' => A |= t = uext v w (double uext)
A   |= t = uext u w && A |= u = v => A |= t = uext v w         (uext congruence)
Synopsis

Block level datatypes

BlockStartStackConstraints

data BlockStartStackConstraints arch Source #

Constraints on start of block.

This datatype maintains equality constraints between locations and stack offsets. It is used in jump bounds and other analysis libraries where we want to know when two registers or stack locations are equal.

data StackEqConstraint (r :: Type -> Type) (tp :: Type) where Source #

A constraint on the value stored in a location (i.e., register or stack offset) at the start of block executino.

Constructors

IsStackOff :: forall (r :: Type -> Type). !(MemInt (RegAddrWidth r)) -> StackEqConstraint r ('BVType (RegAddrWidth r))

This indicates the value is equal to the frame pointer plus the given offset.

As stacks grow down on many architectures, the offset will typically be negative.

EqualLoc :: forall (r :: Type -> Type) (tp :: Type). !(BoundLoc r tp) -> StackEqConstraint r tp

Indicates the value is equal to the value stored at the location.

IsUExt :: forall (u :: Natural) (w :: Natural) (r :: Type -> Type). (1 <= u, (u + 1) <= w) => !(BoundLoc r (BVType u)) -> !(NatRepr w) -> StackEqConstraint r ('BVType w)

Indicates the value is the unsigned extension of the value at another location.

ppBlockStartStackConstraints :: ShowF (ArchReg arch) => BlockStartStackConstraints arch -> [Doc ann] Source #

Pretty print the lines in stack constraints.

ppStackEqConstraint :: forall (r :: Type -> Type) ann (tp :: Type). ShowF r => Doc ann -> StackEqConstraint r tp -> Doc ann Source #

blockStartLocExpr :: forall arch (tp :: Type) ids. (MemWidth (ArchAddrWidth arch), OrdF (ArchReg arch)) => BlockStartStackConstraints arch -> BoundLoc (ArchReg arch) tp -> StackExpr arch ids tp Source #

Return an expression equivalent to the location in the constraint map.

This attempts to normalize the expression to get a representative.

blockStartLocStackOffset :: forall arch (tp :: Type). (MemWidth (ArchAddrWidth arch), OrdF (ArchReg arch)) => BlockStartStackConstraints arch -> BoundLoc (ArchReg arch) tp -> Maybe (MemInt (ArchAddrWidth arch)) Source #

blockStartLocStackOffset c l determines if l has the form stack_frame + o using the constraints c for some stack offset o.

If it does, then this returns Just o. Otherwise it returns Nothing.

data StackOffConstraint (r :: Type -> Type) (tp :: Type) where Source #

Constraint on a class representative

Constructors

StackOffCns :: forall (r :: Type -> Type). !(MemInt (RegAddrWidth r)) -> StackOffConstraint r ('BVType (RegAddrWidth r)) 
UExtCns :: forall (u :: Natural) (w :: Natural) (r :: Type -> Type). (1 <= u, (u + 1) <= w) => !(BoundLoc r (BVType u)) -> !(NatRepr w) -> StackOffConstraint r ('BVType w) 

Instances

Instances details
TestEquality r => Eq (StackOffConstraint r tp) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

blockStartLocRepAndCns :: forall arch (tp :: Type). (MemWidth (ArchAddrWidth arch), OrdF (ArchReg arch)) => BlockStartStackConstraints arch -> BoundLoc (ArchReg arch) tp -> (BoundLoc (ArchReg arch) tp, Maybe (StackOffConstraint (ArchReg arch) tp)) Source #

boundsLocRep cns loc returns the representative location for loc.

This representative location has the property that a location must have the same value as its representative location, and if two locations have provably equal values in cns, then they must have the same representative.

data BoundLoc (r :: Type -> Type) (tp :: Type) where Source #

A location within a function tracked by our bounds analysis algorithms.

Locations for these purposes are registers, stack offsets, and global memory offsets.

Constructors

RegLoc :: forall (r :: Type -> Type) (tp :: Type). !(r tp) -> BoundLoc r tp

RegLoc r denotes the register r.

StackOffLoc :: forall (r :: Type -> Type) (tp :: Type). !(MemInt (RegAddrWidth r)) -> !(MemRepr tp) -> BoundLoc r tp

StackkOffLoc o repr denotes the bytes from address range [initSP + o .. initSP + o + memReprBytes repr).

initSP denotes the stack offset at the start of function execution.

We should note that this makes no claim that those addresses are valid.

Instances

Instances details
TestEquality r => TestEquality (BoundLoc r :: Type -> Type) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

testEquality :: forall (a :: Type) (b :: Type). BoundLoc r a -> BoundLoc r b -> Maybe (a :~: b) #

ShowF r => PrettyF (BoundLoc r :: Type -> Type) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

prettyF :: forall (tp :: Type) ann. BoundLoc r tp -> Doc ann Source #

OrdF r => OrdF (BoundLoc r :: Type -> Type) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

compareF :: forall (x :: Type) (y :: Type). BoundLoc r x -> BoundLoc r y -> OrderingF x y

leqF :: forall (x :: Type) (y :: Type). BoundLoc r x -> BoundLoc r y -> Bool

ltF :: forall (x :: Type) (y :: Type). BoundLoc r x -> BoundLoc r y -> Bool

geqF :: forall (x :: Type) (y :: Type). BoundLoc r x -> BoundLoc r y -> Bool

gtF :: forall (x :: Type) (y :: Type). BoundLoc r x -> BoundLoc r y -> Bool

ShowF r => ShowF (BoundLoc r :: Type -> Type) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

withShow :: forall p q (tp :: Type) a. p (BoundLoc r) -> q tp -> (Show (BoundLoc r tp) => a) -> a

showF :: forall (tp :: Type). BoundLoc r tp -> String

showsPrecF :: forall (tp :: Type). Int -> BoundLoc r tp -> String -> String

HasRepr r TypeRepr => HasRepr (BoundLoc r :: Type -> Type) TypeRepr Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

typeRepr :: forall (tp :: Type). BoundLoc r tp -> TypeRepr tp Source #

ShowF r => Show (BoundLoc r tp) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

showsPrec :: Int -> BoundLoc r tp -> ShowS #

show :: BoundLoc r tp -> String #

showList :: [BoundLoc r tp] -> ShowS #

TestEquality r => Eq (BoundLoc r tp) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

(==) :: BoundLoc r tp -> BoundLoc r tp -> Bool #

(/=) :: BoundLoc r tp -> BoundLoc r tp -> Bool #

ShowF r => Pretty (BoundLoc r tp) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

pretty :: BoundLoc r tp -> Doc ann

prettyList :: [BoundLoc r tp] -> Doc ann

joinBlockStartStackConstraints :: (MemWidth (ArchAddrWidth arch), OrdF (ArchReg arch), HasRepr (ArchReg arch) TypeRepr) => BlockStartStackConstraints arch -> BlockStartStackConstraints arch -> Changed s (BlockStartStackConstraints arch, JoinClassMap (ArchReg arch)) Source #

Return a jump bounds that implies both input bounds, or Nothing if every fact inx the old bounds is implied by the new bounds.

type JoinClassMap (r :: Type -> Type) = MapF (JoinClassPair (BoundLoc r)) (BoundLoc r) Source #

Maps representatives from old and new join constraints to representative in merged map.

data JoinClassPair (key :: k -> Type) (tp :: k) Source #

Constructors

JoinClassPair !(key tp) !(key tp) 

Instances

Instances details
TestEquality k2 => TestEquality (JoinClassPair k2 :: k1 -> Type) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

testEquality :: forall (a :: k1) (b :: k1). JoinClassPair k2 a -> JoinClassPair k2 b -> Maybe (a :~: b) #

OrdF k2 => OrdF (JoinClassPair k2 :: k1 -> Type) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

compareF :: forall (x :: k1) (y :: k1). JoinClassPair k2 x -> JoinClassPair k2 y -> OrderingF x y

leqF :: forall (x :: k1) (y :: k1). JoinClassPair k2 x -> JoinClassPair k2 y -> Bool

ltF :: forall (x :: k1) (y :: k1). JoinClassPair k2 x -> JoinClassPair k2 y -> Bool

geqF :: forall (x :: k1) (y :: k1). JoinClassPair k2 x -> JoinClassPair k2 y -> Bool

gtF :: forall (x :: k1) (y :: k1). JoinClassPair k2 x -> JoinClassPair k2 y -> Bool

BlockIntraStackConstraints

data BlockIntraStackConstraints arch ids Source #

Information about bounds for a particular value within a block.

Instances

Instances details
ShowF (ArchReg arch) => Pretty (BlockIntraStackConstraints arch ids) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

pretty :: BlockIntraStackConstraints arch ids -> Doc ann

prettyList :: [BlockIntraStackConstraints arch ids] -> Doc ann

mkBlockIntraStackConstraints :: (MemWidth (ArchAddrWidth arch), OrdF (ArchReg arch)) => BlockStartStackConstraints arch -> BlockIntraStackConstraints arch ids Source #

Create index bounds from initial index bounds.

intraStackValueExpr :: forall arch ids (tp :: Type). (MemWidth (ArchAddrWidth arch), OrdF (ArchReg arch)) => BlockIntraStackConstraints arch ids -> Value arch ids tp -> StackExpr arch ids tp Source #

Return the value of the index expression given the bounds.

data StackExpr arch ids (tp :: Type) where Source #

This is an expression that represents the value of stack locations and assignments during steping through the block.

The main diference between this and the Value type, index expressions do not depend on values read and written to memory during execution of the block, and are purely functions of the input

This is different from ClassPred in that ClassPred is a property assigned to equivalence classes

Constructors

ClassRepExpr :: forall arch (tp :: Type) ids. !(BoundLoc (ArchReg arch) tp) -> StackExpr arch ids tp

This refers to the value that a location had at the start of block execution.

The location should be a class representative in the initial bounds.

UninterpAssignExpr :: forall ids (tp :: Type) arch. !(AssignId ids tp) -> !(AssignRhs arch (Value arch ids) tp) -> StackExpr arch ids tp

An assignment that is not interpreted, and just treated as a constant.

StackOffsetExpr :: forall arch ids. !(MemInt (ArchAddrWidth arch)) -> StackExpr arch ids ('BVType (ArchAddrWidth arch))

Denotes the value of the stack pointer at function start plus some constant.

CExpr :: forall arch (tp :: Type) ids. !(CValue arch tp) -> StackExpr arch ids tp

Denotes a constant

UExtExpr :: forall (u :: Natural) (w :: Natural) arch ids. (1 <= u, (u + 1) <= w) => StackExpr arch ids (BVType u) -> NatRepr w -> StackExpr arch ids ('BVType w)

This is a pure function applied to other index expressions that may be worth interpreting (but could be treated as an uninterp assign expr also.

AppExpr :: forall ids (tp :: Type) arch. !(AssignId ids tp) -> !(App (StackExpr arch ids) tp) -> StackExpr arch ids tp

This is a pure function applied to other index expressions that may be worth interpreting (but could be treated as an uninterp assign expr also.

Instances

Instances details
TestEquality (ArchReg arch) => TestEquality (StackExpr arch ids :: Type -> Type) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

testEquality :: forall (a :: Type) (b :: Type). StackExpr arch ids a -> StackExpr arch ids b -> Maybe (a :~: b) #

ShowF (ArchReg arch) => PrettyF (StackExpr arch id :: Type -> Type) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

prettyF :: forall (tp :: Type) ann. StackExpr arch id tp -> Doc ann Source #

OrdF (ArchReg arch) => OrdF (StackExpr arch ids :: Type -> Type) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

compareF :: forall (x :: Type) (y :: Type). StackExpr arch ids x -> StackExpr arch ids y -> OrderingF x y

leqF :: forall (x :: Type) (y :: Type). StackExpr arch ids x -> StackExpr arch ids y -> Bool

ltF :: forall (x :: Type) (y :: Type). StackExpr arch ids x -> StackExpr arch ids y -> Bool

geqF :: forall (x :: Type) (y :: Type). StackExpr arch ids x -> StackExpr arch ids y -> Bool

gtF :: forall (x :: Type) (y :: Type). StackExpr arch ids x -> StackExpr arch ids y -> Bool

(HasRepr (ArchReg arch) TypeRepr, MemWidth (ArchAddrWidth arch)) => HasRepr (StackExpr arch ids :: Type -> Type) TypeRepr Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

typeRepr :: forall (tp :: Type). StackExpr arch ids tp -> TypeRepr tp Source #

ShowF (ArchReg arch) => Show (StackExpr arch ids tp) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

showsPrec :: Int -> StackExpr arch ids tp -> ShowS #

show :: StackExpr arch ids tp -> String #

showList :: [StackExpr arch ids tp] -> ShowS #

TestEquality (ArchReg arch) => Eq (StackExpr arch ids tp) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

(==) :: StackExpr arch ids tp -> StackExpr arch ids tp -> Bool #

(/=) :: StackExpr arch ids tp -> StackExpr arch ids tp -> Bool #

OrdF (ArchReg arch) => Ord (StackExpr arch ids tp) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

compare :: StackExpr arch ids tp -> StackExpr arch ids tp -> Ordering #

(<) :: StackExpr arch ids tp -> StackExpr arch ids tp -> Bool #

(<=) :: StackExpr arch ids tp -> StackExpr arch ids tp -> Bool #

(>) :: StackExpr arch ids tp -> StackExpr arch ids tp -> Bool #

(>=) :: StackExpr arch ids tp -> StackExpr arch ids tp -> Bool #

max :: StackExpr arch ids tp -> StackExpr arch ids tp -> StackExpr arch ids tp #

min :: StackExpr arch ids tp -> StackExpr arch ids tp -> StackExpr arch ids tp #

ShowF (ArchReg arch) => Pretty (StackExpr arch id tp) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

pretty :: StackExpr arch id tp -> Doc ann

prettyList :: [StackExpr arch id tp] -> Doc ann

intraStackRhsExpr :: forall arch ids (tp :: Type). (MemWidth (ArchAddrWidth arch), OrdF (ArchReg arch), ShowF (ArchReg arch)) => BlockIntraStackConstraints arch ids -> AssignId ids tp -> AssignRhs arch (Value arch ids) tp -> StackExpr arch ids tp Source #

Return an expression associated with the AssignRhs.

intraStackSetAssignId :: forall ids (tp :: Type) arch. AssignId ids tp -> StackExpr arch ids tp -> BlockIntraStackConstraints arch ids -> BlockIntraStackConstraints arch ids Source #

Associate the given bound expression with the assignment.

discardMemInfo :: BlockIntraStackConstraints arch ids -> BlockIntraStackConstraints arch ids Source #

Discard information about memory due to an operation that may affect arbitrary memory.

writeStackOff :: forall arch ids (tp :: Type). (MemWidth (ArchAddrWidth arch), OrdF (ArchReg arch)) => BlockIntraStackConstraints arch ids -> MemInt (ArchAddrWidth arch) -> MemRepr tp -> Value arch ids tp -> BlockIntraStackConstraints arch ids Source #

Update the stack to point to the given expression.

Block terminator updates

postJumpStackConstraints Source #

Arguments

:: RegisterInfo (ArchReg arch) 
=> BlockIntraStackConstraints arch ids

Constraints at end of block.

-> RegState (ArchReg arch) (Value arch ids)

Register values at start of next state.

Note. ip_reg is ignored, so it does not have to be up-to-date.

-> NextStateMonad arch ids (BlockStartStackConstraints arch) 

Bounds for block after jump

data CallParams (r :: Type -> Type) Source #

Minimal information needed to update stack constraints after a call.

postCallStackConstraints :: RegisterInfo (ArchReg arch) => CallParams (ArchReg arch) -> BlockIntraStackConstraints arch ids -> RegState (ArchReg arch) (Value arch ids) -> NextStateMonad arch ids (BlockStartStackConstraints arch) Source #

Return the index bounds after a function call.

LocMap

data LocMap (r :: Type -> Type) (v :: Type -> Type) Source #

A map from BoundLoc locations to values.

Constructors

LocMap 

Fields

locMapEmpty :: forall (r :: Type -> Type) (v :: Type -> Type). LocMap r v Source #

An empty location map.

locMapNull :: forall (r :: Type -> Type) (v :: Type -> Type). LocMap r v -> Bool Source #

Return true if map is null.

locMapToList :: forall (r :: Type -> Type) (v :: Type -> Type). LocMap r v -> [Pair (BoundLoc r) v] Source #

Construct a list out of a location map.

locLookup :: forall (r :: Type -> Type) (tp :: Type) v. (MemWidth (RegAddrWidth r), OrdF r) => BoundLoc r tp -> LocMap r v -> Maybe (v tp) Source #

Return value associated with location or nothing if it is not defined.

nonOverlapLocInsert :: forall (r :: Type -> Type) (tp :: Type) v. OrdF r => BoundLoc r tp -> v tp -> LocMap r v -> LocMap r v Source #

This associates the location with a value in the map, replacing any existing binding.

It is prefixed with "nonOverlap" because it doesn't guarantee that stack values are non-overlapping -- the user should ensure this before calling this.

locOverwriteWith Source #

Arguments

:: forall (r :: Type -> Type) v (tp :: Type). (OrdF r, MemWidth (RegAddrWidth r)) 
=> (v tp -> v tp -> v tp)

Update takes new and old.

-> BoundLoc r tp 
-> v tp 
-> LocMap r v 
-> LocMap r v 

ppLocMap :: forall (r :: Type -> Type) ann p. ShowF r => (forall (tp :: Type). Doc ann -> p tp -> Doc ann) -> LocMap r p -> [Doc ann] Source #

Pretty print a location map.

foldLocMap :: forall a (r :: Type -> Type) v. (forall (tp :: Type). a -> BoundLoc r tp -> v tp -> a) -> a -> LocMap r v -> a Source #

Fold over values in a location map.

MemMap

data MemMap o (v :: Type -> Type) Source #

This is a data structure for representing values written to concrete offsets in memory.

The offset type is a parameter so that we can use signed or unsigned offsets.

Instances

Instances details
FunctorF (MemMap o :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

fmapF :: (forall (x :: Type). f x -> g x) -> MemMap o f -> MemMap o g

emptyMemMap :: forall o (v :: Type -> Type). MemMap o v Source #

Empty stack map

memMapLookup :: forall o (tp :: Type) (p :: Type -> Type). MemIndex o => o -> MemRepr tp -> MemMap o p -> MemMapLookup o p tp Source #

Lookup value (if any) at given offset and representation.

memMapLookup' :: forall o (tp :: Type) (v :: Type -> Type). MemIndex o => o -> MemRepr tp -> MemMap o v -> Maybe (o, MemVal v) Source #

Lookup value (if any) at given offset and representation.

This generalized memMapLookup below to not require exact matches, but just some overlap.

data MemMapLookup o (p :: Type -> Type) (tp :: Type) where Source #

Result returned by memMapLookup.

Constructors

MMLResult :: forall (p :: Type -> Type) (tp :: Type) o. !(p tp) -> MemMapLookup o p tp

We found a value at the exact offset and repr

MMLOverlap :: forall o (utp :: Type) (p :: Type -> Type) (tp :: Type). !o -> !(MemRepr utp) -> !(p utp) -> MemMapLookup o p tp

We found a value that had an overlapping offset and repr.

MMLNone :: forall o (p :: Type -> Type) (tp :: Type). MemMapLookup o p tp

We found neither an exact match nor an overlapping write.

memMapOverwrite Source #

Arguments

:: forall o p (tp :: Type). (Ord o, Num o) 
=> o

Offset in the stack to write to

-> MemRepr tp

Type of value to write

-> p tp

Value to write

-> MemMap o p 
-> MemMap o p 

This assigns a region of bytes to a particular value in the stack.

It overwrites any values that overlap with the location.

memMapMapWithKey :: (forall (tp :: Type). o -> MemRepr tp -> a tp -> b tp) -> MemMap o a -> MemMap o b Source #

memMapTraverseWithKey_ :: Applicative m => (forall (tp :: Type). o -> MemRepr tp -> v tp -> m ()) -> MemMap o v -> m () Source #

memMapTraverseMaybeWithKey Source #

Arguments

:: Applicative m 
=> (forall (tp :: Type). o -> MemRepr tp -> a tp -> m (Maybe (b tp)))

Traversal function

-> MemMap o a 
-> m (MemMap o b) 

memMapDropAbove :: forall o (p :: Type -> Type). Integral o => Integer -> MemMap o p -> MemMap o p Source #

memMapDropBelow :: forall o (p :: Type -> Type). Integral o => Integer -> MemMap o p -> MemMap o p Source #

NextStateMonad

data NextStateMonad arch ids a Source #

Instances

Instances details
Applicative (NextStateMonad arch ids) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

pure :: a -> NextStateMonad arch ids a #

(<*>) :: NextStateMonad arch ids (a -> b) -> NextStateMonad arch ids a -> NextStateMonad arch ids b #

liftA2 :: (a -> b -> c) -> NextStateMonad arch ids a -> NextStateMonad arch ids b -> NextStateMonad arch ids c #

(*>) :: NextStateMonad arch ids a -> NextStateMonad arch ids b -> NextStateMonad arch ids b #

(<*) :: NextStateMonad arch ids a -> NextStateMonad arch ids b -> NextStateMonad arch ids a #

Functor (NextStateMonad arch ids) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

fmap :: (a -> b) -> NextStateMonad arch ids a -> NextStateMonad arch ids b #

(<$) :: a -> NextStateMonad arch ids b -> NextStateMonad arch ids a #

Monad (NextStateMonad arch ids) Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

(>>=) :: NextStateMonad arch ids a -> (a -> NextStateMonad arch ids b) -> NextStateMonad arch ids b #

(>>) :: NextStateMonad arch ids a -> NextStateMonad arch ids b -> NextStateMonad arch ids b #

return :: a -> NextStateMonad arch ids a #

getNextStateRepresentatives :: NextStateMonad arch ids [Pair (BoundLoc (ArchReg arch)) (StackExpr arch ids)] Source #

Return a list of locations and associated expressions that represent equivalence classes in the next state.

Note that each equivalence class has a unique stack expression, so all the locations in an equivalence class should have the same expression.

Miscelaneous

data MemVal (p :: Type -> Type) Source #

A value with a particular type along with a MemRepr indicating how the type is encoded in memory.

Constructors

MemVal !(MemRepr tp) !(p tp) 

Instances

Instances details
FunctorF MemVal Source # 
Instance details

Defined in Data.Macaw.AbsDomain.StackAnalysis

Methods

fmapF :: (forall (x :: Type). f x -> g x) -> MemVal f -> MemVal g