Copyright | (c) Jorge Santiago Alvarez Cuadros 2016 |
---|---|
License | GPL-3 |
Maintainer | sanjorgek@ciencias.unam.mx |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Extensions |
|
Map implementation, represent a partial function
- type (:*>:) a p o = Map (Label a, p) o
- type (:->:) a p1 p2 = (:*>:) a p1 (Label a, p2)
- liftD :: (Ord a, Ord p1) => [(a, p1, a, p2)] -> (:->:) a p1 p2
- nextD :: (Ord p1, Ord a) => (:->:) a p1 p2 -> (Label a, p1) -> Label a
- type (:-<:) a p1 p2 = (:*>:) a p1 (Set (Label a, p2))
- liftND :: (Ord a, Ord p1, Ord p2) => [(a, p1, [(a, p2)])] -> (:-<:) a p1 p2
- nextND :: (Ord p1, Ord a) => (:-<:) a p1 p2 -> p2 -> (Label a, p1) -> Set (Label a)
- liftL :: (Ord a, Ord p) => [(a, p, o)] -> (:*>:) a p o
- nextTMaybe :: (Ord p1, Ord a) => (:*>:) a p1 o -> (Label a, p1) -> Maybe o
- nextSymbol :: (Ord p1, Ord a) => (:*>:) a p1 Symbol -> (Label a, p1) -> Symbol
- getFirstParam :: Eq b => Map (a, b) a1 -> [b]
- getFirstParamSet :: Ord b => Map (a, b) a1 -> Set b
- getSecondParamD :: Eq p2 => (:->:) a p1 p2 -> [p2]
- getSecondParamND :: Ord p2 => (:-<:) a p1 p2 -> [p2]
- getSecondParamSetD :: Ord b => Map k (a, b) -> Set b
- getSecondParamSetND :: Ord p2 => (:-<:) a p1 p2 -> Set p2
- getStateDomain :: Eq a => Map (a, b) a1 -> [a]
- getStateDomainSet :: Ord a => Map (a, b) a1 -> Set a
- getStateRangeD :: Eq a => (:->:) a p1 p2 -> [Label a]
- getStateRangeND :: Ord a => (:-<:) a p1 p2 -> [Label a]
- getStateRangeSetD :: Ord a => (:->:) a p1 p2 -> Set (Label a)
- getStateRangeSetND :: Ord a => (:-<:) a p1 p2 -> Set (Label a)
Delta
Generic
Deterministic
Constructor
type (:->:) a p1 p2 = (:*>:) a p1 (Label a, p2) Source #
Deterministic Delta
Maps a tuple, a state and a param, to another tuple, a state and a param.
Functions
liftD :: (Ord a, Ord p1) => [(a, p1, a, p2)] -> (:->:) a p1 p2 Source #
Lifts a deterministic delta from a 4-tuple list
nextD :: (Ord p1, Ord a) => (:->:) a p1 p2 -> (Label a, p1) -> Label a Source #
Next state function for deterministic delta
Not deterministic
Constructor
type (:-<:) a p1 p2 = (:*>:) a p1 (Set (Label a, p2)) Source #
Non-Deterministic Delta
Maps a tuple, a state and a param, to a tuple, a state list and a param.
Functions
liftND :: (Ord a, Ord p1, Ord p2) => [(a, p1, [(a, p2)])] -> (:-<:) a p1 p2 Source #
Lifts a non-deterministic delta from a 4-tuple list
nextND :: (Ord p1, Ord a) => (:-<:) a p1 p2 -> p2 -> (Label a, p1) -> Set (Label a) Source #
Next state function for non-deterministic delta
Functions
liftL :: (Ord a, Ord p) => [(a, p, o)] -> (:*>:) a p o Source #
Lift a generic delta/map from a 3-tuple list
nextTMaybe :: (Ord p1, Ord a) => (:*>:) a p1 o -> (Label a, p1) -> Maybe o Source #
Take a state and a param and maybe resolve some output
nextSymbol :: (Ord p1, Ord a) => (:*>:) a p1 Symbol -> (Label a, p1) -> Symbol Source #
For simple map with Chars range
Auxiliar functions
getFirstParam :: Eq b => Map (a, b) a1 -> [b] Source #
Gets all params at domain, for (:->:) and (:-<:)
getFirstParamSet :: Ord b => Map (a, b) a1 -> Set b Source #
Gets all params at domain, for (:-<:) and (:-<:)
getSecondParamD :: Eq p2 => (:->:) a p1 p2 -> [p2] Source #
Gets all params at range, for (:->:)
getSecondParamND :: Ord p2 => (:-<:) a p1 p2 -> [p2] Source #
Gets all params at range, for (:-<:)
getSecondParamSetND :: Ord p2 => (:-<:) a p1 p2 -> Set p2 Source #
Gets all params at range, for (:-<:)
getStateDomain :: Eq a => Map (a, b) a1 -> [a] Source #
Gets all states at domain, for (:->:) and (:-<:)
getStateDomainSet :: Ord a => Map (a, b) a1 -> Set a Source #
Gets all states at domain, for (:->:) and (:-<:)
getStateRangeND :: Ord a => (:-<:) a p1 p2 -> [Label a] Source #
Gets state at range in a list, for (:-<:)