automata-0.1.0.0: automata

Safe HaskellNone
LanguageHaskell2010

Automata.Internal.Transducer

Synopsis

Documentation

data Nfst t m Source #

A nondeterministic finite state transducer. The t represents the input token on which a transition occurs. The m represents the output token that is generated when a transition is taken. On an epsilon transation, no output is generated.

Constructors

Nfst 

Fields

  • nfstTransition :: !(Array (TransitionNfst t m))

    Given a state and transition, this field tells you what state to go to next. The length of this array must match the total number of states. The data structure inside is an interval map. This is capable of collapsing adjacent key-value pairs into ranges.

  • nfstFinal :: !(Set Int)

    A string that ends in any of these set of states is considered to have been accepted by the grammar.

Instances
(Eq t, Eq m) => Eq (Nfst t m) Source # 
Instance details

Defined in Automata.Internal.Transducer

Methods

(==) :: Nfst t m -> Nfst t m -> Bool #

(/=) :: Nfst t m -> Nfst t m -> Bool #

(Bounded t, Enum t, Show t, Show m) => Show (Nfst t m) Source # 
Instance details

Defined in Automata.Internal.Transducer

Methods

showsPrec :: Int -> Nfst t m -> ShowS #

show :: Nfst t m -> String #

showList :: [Nfst t m] -> ShowS #

data TransitionNfst t m Source #

Constructors

TransitionNfst 
Instances
(Eq t, Eq m) => Eq (TransitionNfst t m) Source # 
Instance details

Defined in Automata.Internal.Transducer

(Bounded t, Enum t, Show t, Show m) => Show (TransitionNfst t m) Source # 
Instance details

Defined in Automata.Internal.Transducer

data Dfst t m Source #

A deterministic finite state transducer.

Constructors

Dfst 

Fields

  • dfstTransition :: !(Array (Map t (MotionDfst m)))

    Given a state and transition, this field tells you what state to go to next. The length of this array must match the total number of states.

  • dfstFinal :: !(Set Int)

    A string that ends in any of these set of states is considered to have been accepted by the grammar.

Instances
(Eq t, Eq m) => Eq (Dfst t m) Source # 
Instance details

Defined in Automata.Internal.Transducer

Methods

(==) :: Dfst t m -> Dfst t m -> Bool #

(/=) :: Dfst t m -> Dfst t m -> Bool #

(Bounded t, Enum t, Show t, Show m) => Show (Dfst t m) Source # 
Instance details

Defined in Automata.Internal.Transducer

Methods

showsPrec :: Int -> Dfst t m -> ShowS #

show :: Dfst t m -> String #

showList :: [Dfst t m] -> ShowS #

data MotionDfst m Source #

Constructors

MotionDfst 
Instances
Eq m => Eq (MotionDfst m) Source # 
Instance details

Defined in Automata.Internal.Transducer

Methods

(==) :: MotionDfst m -> MotionDfst m -> Bool #

(/=) :: MotionDfst m -> MotionDfst m -> Bool #

Show m => Show (MotionDfst m) Source # 
Instance details

Defined in Automata.Internal.Transducer

data Edge t m Source #

Constructors

Edge !Int !Int !t !t !m 

data EdgeDest t m Source #

Constructors

EdgeDest !Int !t !t !m 

rejection :: (Ord t, Bounded t, Monoid m, Ord m) => Nfst t m Source #

Transducer that rejects all input, generating the monoid identity as output. This is the identity for union.

union :: (Bounded t, Ord m) => Nfst t m -> Nfst t m -> Nfst t m Source #

Accepts input that is accepts by either of the transducers, producing the output of both of them.