|
| automaton (bool collapse_epsilon=false, bool no_epsilon_produced=false) |
| Constructor. More...
|
|
printer_base< State > * | int_state_printer () const |
| Optionally Implement Returns a printer for states. More...
|
|
printer_base< Symbol > * | int_symbol_printer () const |
| Optionally Implement Returns a printer for symbols. More...
|
|
bool | int_is_final_state (const State &state) const |
| Implement This function determines if a specific state is final. More...
|
|
void | int_initial_states (State_vector &states) const |
| Implement Returns the initial states. More...
|
|
void | int_successors (const State &state, const Symbol &sigma, State_vector &successors) const |
| Implement Returns the successor for a specific state. More...
|
|
void | int_next_symbols (const State &state, Symbol_vector &symbols) const |
| Implement Returns possible successor symbols for a state. More...
|
|
bool | int_is_epsilon (const Symbol &symbol) const |
| Implement Determines if a symbol should be considered an epsilon transition. More...
|
|
bool | is_final_state (const State &state) const |
| This function determines if a specific state is final. More...
|
|
void | initial_states (State_vector &states) const |
| Returns the initial states. More...
|
|
void | initial_states (State_set &states) const |
| Returns the initial states. More...
|
|
State_vector | initial_states () const |
| Returns a set of initial states. More...
|
|
void | successors (const State &state, const Symbol &sigma, State_vector &successors1) const |
| Returns the successor for a specific state. More...
|
|
State_set | successors (const State_set &states, const Symbol &sigma) const |
| Finds successors for a set of states. More...
|
|
void | successors (const State_set &states, const Symbol &sigma, State_set &successors1) const |
| Returns successors for a set of states. More...
|
|
State_vector | successors (const State &state, const Symbol &sigma) const |
| Returns successors for a state. More...
|
|
void | next_symbols (const State &state, Symbol_vector &symbols) const |
| Returns possible successor symbols for a state. More...
|
|
Symbol_vector | next_symbols (const State &state) const |
| Returns possible successor symbols of a state. More...
|
|
void | next_symbols (const State &state, Symbol_set &symbols) const |
| Returns possible successor symbols of a state. More...
|
|
const printer_base< State > & | state_printer () const |
| Returns a printer for states. More...
|
|
const printer_base< Symbol > & | symbol_printer () const |
| Returns a printer for symbols. More...
|
|
bool | is_epsilon (const Symbol &symbol) const |
| Determines if a symbol should be considered an epsilon transition. More...
|
|
bool | is_final_state (const State_set &states) const |
| Determines if one of the states is final. More...
|
|
template<class State, class Symbol, class Implementation>
class Limi::automaton< State, Symbol, Implementation >
Automata need to inherit from this class and implement certain methods.
We use the curiously recurring template pattern (CRTP). This means that the custom automaton must inherit from this class and pass itself as the Implementation template argument. Furthermore none of the methods should be declared virtual (virtual function calls are too slow) and small functions should be declared inline if possible. Functions that need to be implemented by the deriving class start with int_
and are marked as Implement.
- Template Parameters
-
State | The state class that the automaton will use. |
Symbol | The symbol class. |
Implementation | The deriving class must pass its own name here. |
template<class State, class Symbol, class Implementation>
bool Limi::automaton< State, Symbol, Implementation >::int_is_epsilon |
( |
const Symbol & |
symbol | ) |
const |
Implement Determines if a symbol should be considered an epsilon transition.
If a symbol is an epsilon transition it means that this symbol will be collapsed and never appear if collapse_epsilon is true. If collapse_epsilon is false the symbol will appear in the counter-example produced by the language inclusion, but the right-hand side will not be advanced on an epsilon transition.
- Returns
- Returns true if a symbol should be considered an epsilon transition.
template<class State, class Symbol, class Implementation>
void Limi::automaton< State, Symbol, Implementation >::int_next_symbols |
( |
const State & |
state, |
|
|
Symbol_vector & |
symbols |
|
) |
| const |
Implement Returns possible successor symbols for a state.
Note that it is possible to return symbols by this function and when later int_successors() is queried for a specific symbol it returns an empty list. This function must return a superset of possible successor symbols.
- Parameters
-
state | The state for which successor symbols should be listed. |
symbols | A vector of symbols, where the symbols on the outgoing edges of state should be added. May not be empty when the function is called. |
template<class State, class Symbol, class Implementation>
bool Limi::automaton< State, Symbol, Implementation >::is_epsilon |
( |
const Symbol & |
symbol | ) |
const |
|
inline |
Determines if a symbol should be considered an epsilon transition.
If a symbol is an epsilon transition it means that this symbol will be collapsed and never appear if collapse_epsilon is true. If collapse_epsilon is false the symbol will appear in the counter-example produced by the language inclusion, but the right-hand side will not be advanced on an epsilon transition.
- Returns
- Returns true if a symbol should be considered an epsilon transition.