|
| | DFA (unsigned int initial, bool isAccepting=false) |
| | Constructs the DFA. More...
|
| |
| void | addState (unsigned int state, bool isAccepting=false) |
| | Adds a state to the DFA. More...
|
| |
| void | addTransition (unsigned int p, Sigma symbol, unsigned int q) |
| | Adds a transition to the DFA. More...
|
| |
| bool | isAccepted (const std::list< Sigma > &word) |
| | Tests whether the word is accepted by the DFA. More...
|
| |
| bool | isAccepted (const std::vector< Sigma > &word) |
| | Tests whether the word is accepted by the DFA. More...
|
| |
| unsigned int | getNumberOfStates () const |
| | Returns the number of states in this DFA. More...
|
| |
| std::string | to_dot () const |
| | Constructs a string that is the representation of the DFA in the DOT language. More...
|
| |
| template<typename T > |
| std::unique_ptr< DFA< T > > | convert (const std::map< Sigma, T > &conversionMap) const |
| | Creates a new DFA with exactly the same number of states and the same transitions but the type of the alphabet is changed. More...
|
| |
| bool | isAcceptingState (unsigned int state) const |
| | Tests whether the given state is a final (or accepting) state. More...
|
| |
| const std::unordered_set< unsigned int > & | getStates () const |
| | Returns the set of states in this DFA. More...
|
| |
| const std::unordered_set< unsigned int > & | getAcceptingStates () const |
| | Returns the set of accepting states of this DFA. More...
|
| |
| unsigned int | getInitialState () const |
| | Returns the initial state of this DFA. More...
|
| |
| const std::map< unsigned int, std::map< Sigma, unsigned int > > | getTransitions () const |
| | Returns the function delta. More...
|
| |
| bool | isState (unsigned int state) const |
| | Checks if the given state number is in the states set. More...
|
| |
template<typename Sigma >
| void gsjj::DFA< Sigma >::addTransition |
( |
unsigned int |
p, |
|
|
Sigma |
symbol, |
|
|
unsigned int |
q |
|
) |
| |
|
inline |
Adds a transition to the DFA.
If the DFA is in the state p and reads the given symbol, it goes to the state q. The function checks that delta(p, symbol) does not yet exist and that p and q exist.
- Parameters
-
| p | The state where the transition starts |
| symbol | The symbol to read to activate the transition |
| q | The state where the transition ends |
Definition at line 79 of file DFA.h.