|
|
|
|
|
Description |
Finite state machines.
Here an FSM is a map from symbols to actions. Symbols are parametric
(will usually be Strings or Chars). Actions specify the action of a
symbol on each state, and are represented as lists of transitions: one
per state. States are just numbers, from 0 to n, corresponding to
indices on transition lists in Actions. Then deterministic actions
are just Ints, identifying the state to transition to under that
action; nondeterministic actions are lists of Ints: all the states to
possibly transition to under that action.
|
|
Synopsis |
|
|
|
|
Data types
|
|
|
States are integers, counting from zero.
|
|
|
Destination sets are just lists of States.
| Constructors | | Instances | |
|
|
|
Actions are lists of DestinationSets, indexed by source
State.
| Constructors | | Instances | |
|
|
|
Finite state machine whose nodes are labelled with type sy.
| Instances | |
|
|
|
Words are lists of symbols.
| Constructors | |
|
|
Simple FSM operations
|
|
|
Create an FSM from a list of symbol, Action pairs.
|
|
|
Turn an FSM into a list of symbol, Action pairs.
|
|
|
Delete a symbol and its action from an FSM.
|
|
|
Look up a symbol's Action in an FSM
|
|
|
Map a function over the FSM.
|
|
|
Compute the list of states of the FSM. Only really meaningful
if the FSM's well-formedness is not BadLengths. With current
implementation, is just [0..n] for some n (or empty).
|
|
|
Compute the alphabet of an FSM.
|
|
Normalisation
|
|
|
Normalise an FSM, i.e. normalise all its Actions.
|
|
|
|
Operations on actions
|
|
|
Build an action given a nested list of destination states.
|
|
|
Build a deterministic action given a list of destination states.
|
|
|
Append two Actions, ie compute the Action corresponding to
the application of the first followed by the second.
|
|
|
Compute the DestinationSet reached by following some Action
from some State.
|
|
|
Compute the Action for some Word over some FSM. The word
might contain symbols outside the FSM's alphabet, so the result
could be Nothing.
|
|
|
Test if two Words are action-equivalent over some FSM.
|
|
Destination sets
|
|
|
Compute the DestinationSet for some Word at some State of
an FSM. The word might contain symbols outside the FSM's
alphabet, or the state might be out of range, so the result could
be Nothing.
|
|
|
Test if two Words are destination-equivalent at some State of
an FSM.
|
|
Identity
|
|
|
Compute the identity action for a given FSM.
|
|
|
Compute the identity action for a given number of states
|
|
Determinism
|
|
|
Test if an Action is deterministic or not.
|
|
|
Compute whether an FSM is deterministic or not.
|
|
Produced by Haddock version 2.6.0 |