| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
LAM.Pure
Contents
Description
Pure versions of abstract machine states.
These hold the entire state, instead of needing an IO context to fetch data from the heap.
Synopsis
- class IsNamedEnv t => ToPureState a (t :: Type -> Type) where
- toPureState :: a -> IO (PState t)
- type PState (t :: Type -> Type) = (RHeap Term t, PState' t)
- type PState' (t :: Type -> Type) = RState Ref Term t
- class IsNamedEnv (t :: Type -> Type) where
- type RHeap term (t :: Type -> Type) = [(RHeapPointer Ref term t, Maybe (RClosure Ref term t))]
- data Ref a
- simpHeapAddrs :: forall (t :: Type -> Type). IsNamedEnv t => PState t -> PState t
- heuristicCompState :: (ToPureState s1 Trie, ToPureState s2 Trie) => s1 -> s2 -> IO Bool
- heuristicCompPState :: forall (t :: Type -> Type). IsNamedEnv t => PState t -> PState t -> Bool
- trimState :: forall (t :: Type -> Type). IsNamedEnv t => PState t -> PState t
- toPureStateGen :: forall t (t1 :: Type -> Type) (t2 :: Type -> Type). (CanTrim t t1, Traversable t1, IsNamedEnv t1, IsNamedEnv t2) => (t -> DBTerm) -> RState IORef t t1 -> IO (PState t2)
- stateToTerm :: forall (t :: Type -> Type). IsNamedEnv t => PState t -> Term
- runHnf :: ToPureState s Trie => IsLAM IO e s Term -> Term -> IO Term
- runHnfPrint :: ToPureState s Trie => IsLAM IO e s Term -> Term -> IO ()
- runHnfPrintTrace :: ToPureState s Trie => IsLAM IO e s Term -> Term -> IO ()
Documentation
class IsNamedEnv t => ToPureState a (t :: Type -> Type) where #
A class for printing abstract machine states.
Methods
toPureState :: a -> IO (PState t) #
Instances
| ToPureState (State NamedList) NamedList # | |
Defined in LAM.Exec.DBNoTrimPure | |
| ToPureState (State NamedList) Trie # | |
Defined in LAM.Exec.DBNoTrimPure | |
| ToPureState (State Seq) NamedList # | |
Defined in LAM.Exec.DBNoTrimPure | |
| ToPureState (State Seq) Trie # | |
Defined in LAM.Exec.DBNoTrimPure | |
| ToPureState (State Vector) NamedList # | |
Defined in LAM.Exec.DBNoTrimPure | |
| ToPureState (State Vector) Trie # | |
Defined in LAM.Exec.DBNoTrimPure | |
| ToPureState (State []) NamedList # | |
Defined in LAM.Exec.DBNoTrimPure | |
| ToPureState (State []) Trie # | |
Defined in LAM.Exec.DBNoTrimPure | |
| ToPureState (State NamedList) NamedList # | |
Defined in LAM.Exec.DBTrimPure | |
| ToPureState (State NamedList) Trie # | |
Defined in LAM.Exec.DBTrimPure | |
| ToPureState (State []) Trie # | |
Defined in LAM.Exec.DBTrimPure | |
| IsNamedEnv t => ToPureState (PState t) t # | |
| (IsNamedEnv t1, IsNamedEnv t2) => ToPureState (PState t1) t2 # | |
| (Traversable t1, CanTrim Term t1, IsNamedEnv t1, IsNamedEnv t2) => ToPureState (RState IORef Term t1) t2 # | |
type PState (t :: Type -> Type) = (RHeap Term t, PState' t) #
Pure state, i.e. a state that includes the heap.
class IsNamedEnv (t :: Type -> Type) where #
An environment
Methods
eToList :: t a -> [(Name, a)] #
eFromList :: [(Name, a)] -> t a #
Instances
type RHeap term (t :: Type -> Type) = [(RHeapPointer Ref term t, Maybe (RClosure Ref term t))] #
A list representing the heap. We extract this from an abstract machine to get a pure value we can manipulate freely.
The address pointing to a value of type a. We want to convert
an IORef to this.
Instances
| Foldable Ref # | |
Defined in LAM.Pure Methods fold :: Monoid m => Ref m -> m # foldMap :: Monoid m => (a -> m) -> Ref a -> m # foldMap' :: Monoid m => (a -> m) -> Ref a -> m # foldr :: (a -> b -> b) -> b -> Ref a -> b # foldr' :: (a -> b -> b) -> b -> Ref a -> b # foldl :: (b -> a -> b) -> b -> Ref a -> b # foldl' :: (b -> a -> b) -> b -> Ref a -> b # foldr1 :: (a -> a -> a) -> Ref a -> a # foldl1 :: (a -> a -> a) -> Ref a -> a # elem :: Eq a => a -> Ref a -> Bool # maximum :: Ord a => Ref a -> a # | |
| Traversable Ref # | |
| Functor Ref # | |
| Show (Ref a) # | |
| Eq (Ref a) # | |
| IsNamedEnv t => ToPureState (PState t) t # | |
| (IsNamedEnv t1, IsNamedEnv t2) => ToPureState (PState t1) t2 # | |
simpHeapAddrs :: forall (t :: Type -> Type). IsNamedEnv t => PState t -> PState t #
Replace actual heap addresses by small integers to make it easier to read the output.
heuristicCompState :: (ToPureState s1 Trie, ToPureState s2 Trie) => s1 -> s2 -> IO Bool #
Heuristic equality for ToPureStates. This doesn't properly
follow pointers, but it should be very difficult to create two
states that this test equates but aren't actually equal.
heuristicCompState s1 s2 = false => s1 /= s2
heuristicCompPState :: forall (t :: Type -> Type). IsNamedEnv t => PState t -> PState t -> Bool #
Heuristic equality for 'PState. This doesn't properly follow pointers, but it should be very difficult to create two states that this test equates but aren't actually equal.
heuristicCompPState s1 s2 = false => s1 /= s2
trimState :: forall (t :: Type -> Type). IsNamedEnv t => PState t -> PState t #
Removed unused references from 'PState
toPureStateGen :: forall t (t1 :: Type -> Type) (t2 :: Type -> Type). (CanTrim t t1, Traversable t1, IsNamedEnv t1, IsNamedEnv t2) => (t -> DBTerm) -> RState IORef t t1 -> IO (PState t2) #
Generic function to write ToPureState classes.
stateToTerm :: forall (t :: Type -> Type). IsNamedEnv t => PState t -> Term #
runHnfPrint :: ToPureState s Trie => IsLAM IO e s Term -> Term -> IO () #
runHnfPrintTrace :: ToPureState s Trie => IsLAM IO e s Term -> Term -> IO () #