module FST.TransducerTypes (
StateTy,
FinalStates,
FirstState,
LastState,
Sigma,
Relation,
Upper,
Lower,
Symbol (..),
TTransitions,
TTransitionTable,
InitialStates,
TransducerFunctions (..),
) where
import FST.AutomatonTypes (
StateTy, FinalStates, Sigma, FirstState, LastState, InitialStates
)
type Relation a = (Upper a, Lower a)
type Upper a = Symbol a
type Lower a = Symbol a
data Symbol a = S a | Eps
deriving (Show, Read, Eq)
type TTransitions a = [(Relation a, StateTy)]
type TTransitionTable a = [(StateTy, [(Relation a, StateTy)])]
class TransducerFunctions f where
states :: f a -> [StateTy]
isFinal :: f a -> StateTy -> Bool
initials :: f a -> InitialStates
finals :: f a -> FinalStates
transitionTable :: f a -> TTransitionTable a
transitionList :: f a -> StateTy -> TTransitions a
transitionsU :: Eq a => f a -> (StateTy, Symbol a) -> [(Symbol a, StateTy)]
transitionsD :: Eq a => f a -> (StateTy, Symbol a) -> [(Symbol a, StateTy)]
firstState :: f a -> StateTy
lastState :: f a -> StateTy
alphabet :: f a -> Sigma a