|
| Language.HaLex.Ndfa | | Portability | portable | | Stability | provisional | | Maintainer | jas@di.uminho.pt |
|
|
|
|
|
| Description |
| Non-Deterministic Finite Automata in Haskell. Code Included in the Lecture Notes on
Language Processing (with a functional flavour).
|
|
| Synopsis |
|
|
|
|
| Data type |
|
| data Ndfa st sy |
| The type of Non-Deterministic Finite Automata. Paramterized with
the type st of states and sy of symbols. | | Constructors | | Ndfa [sy] [st] [st] [st] (st -> Maybe sy -> [st]) | |
| | Instances | | (Show st, Show sy, Ord st, Ord sy) => Fa Ndfa st sy | | (Eq st, Show st, Show sy) => Show (Ndfa st sy) |
|
|
|
| toHaskell |
| :: Show fa | | | => fa | Automaton | | -> [Char] | Haskell module or file name | | -> IO () | | | Produce the transition table of a given finite automaton. |
|
|
| renameNdfa :: Eq st => Ndfa st sy -> Int -> Ndfa Int sy |
| Renames a Ndfa. |
|
| transitionTableNdfa |
| :: Ndfa st sy | Automaton | | -> [(st, Maybe sy, st)] | Transition table | Produce the transition table of a given Ndfa.
Given a Ndfa it returns a list of triples of the form
(Origin,Symbol,Destination)
defining all the transitions of the Ndfa.
|
|
|
| ndfaaccept |
| :: Ord st | | | => Ndfa st sy | Automaton | | -> [sy] | Input symbols | | -> Bool | | | Test whether the given automaton accepts the given list of
input symbols. |
|
|
| ndfawalk |
| :: Ord st | | | => (st -> Maybe sy -> [st]) | Transition function | | -> [st] | Initial states | | -> [sy] | Input symbols | | -> [st] | Reached states | | Execute the transition function of a Ndfa on an initial state
and list of input symbol. Return the final state when all input
symbols have been consumed. |
|
|
| epsilon_closure |
| :: Ord st | | | => (st -> Maybe sy -> [st]) | Transition function | | -> [st] | Current states | | -> [st] | Reached states | | COmpute the eplison closure of a Ndfa. |
|
|
| sizeNdfa :: Ndfa st sy -> Int |
| The size of an automaton is the number of its states. |
|
| limit :: Eq a => (a -> a) -> a -> a |
|
| ndfaIsStDead :: Ord st => st -> [sy] -> [st] -> (st -> Maybe sy -> [st]) -> Bool |
|
| Produced by Haddock version 0.6 |