|
Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Nondeterministic real time height deterministic pushdown automaton. Accepts subset of context free languages. More...
#include <RealTimeHeightDeterministicNPDA.h>
Public Types | |
| typedef InputSymbolTypeT | InputSymbolType |
| typedef PushdownStoreSymbolTypeT | PushdownStoreSymbolType |
| typedef StateTypeT | StateType |
Friends | |
| ext::ostream & | operator<< (ext::ostream &out, const RealTimeHeightDeterministicNPDA &instance) |
Nondeterministic real time height deterministic pushdown automaton. Accepts subset of context free languages.
Definition A = (Q, T, G, I, Z, \delta, F), Q (States) = nonempty finite set of states, T (TerminalAlphabet) = finite set of terminal symbols G (PushdownStoreAlphabet) = finite set of pushdown store symbol - having this empty makes the automaton equivalent to DFA I (InitialState) = initial state, Z (BottomOfTheStackSymbol) = initial pushdown store symbol \delta is split to three disjoint parts
| InputSymbolTypeT | used for the terminal alphabet |
| PushdownSymbolTypeT | used for the pushdown store alphabet |
| StateTypeT | used to the states, and the initial state of the automaton. |
| typedef InputSymbolTypeT automaton::RealTimeHeightDeterministicNPDA< InputSymbolTypeT, PushdownStoreSymbolTypeT, StateTypeT >::InputSymbolType |
| typedef PushdownStoreSymbolTypeT automaton::RealTimeHeightDeterministicNPDA< InputSymbolTypeT, PushdownStoreSymbolTypeT, StateTypeT >::PushdownStoreSymbolType |
| typedef StateTypeT automaton::RealTimeHeightDeterministicNPDA< InputSymbolTypeT, PushdownStoreSymbolTypeT, StateTypeT >::StateType |
|
explicit |
Creates a new instance of the automaton with a concrete set of states, call, return, and local alphabets, pushdown store alphabet, initial state, bottom of the stack symbol, and a set of final states.
| states | the initial set of states of the automaton |
| callAlphabet | the initial input alphabet |
| returnAlphabet | the initial input alphabet |
| localAlphabet | the initial input alphabet |
| pushdownStoreAlphabet | the initial set of symbols used in the pushdown store by the automaton |
| initialState | the initial state of the automaton |
| bottomOfTheStackSymbol | the initial pushdown symbol of the automaton |
| finalStates | the initial set of final states of the automaton |
|
explicit |
Creates a new instance of the automaton with a concrete initial state and bottom of the stack symbol.
| initialState | the initial state of the automaton |
| bottomOfTheStackSymbol | the bottom of the stack symbol of the automaton |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::addCallTransition | ( | StateType | from, |
| common::symbol_or_epsilon< InputSymbolType > | input, | ||
| StateType | to, | ||
| PushdownStoreSymbolType | push | ||
| ) |
Adds a call transition to the automaton.
The transition is in a form A \times a -> B \times g, where A, B \in Q, a \in T \cup { \eps }, and g \in G
| from | the source state (A) |
| input | the input symbol or epsilon (a) |
| to | the target state (B) |
| push | symbol to be pushed to the pushdown store on the transition use (g) |
| AutomatonException | when transition contains state or symbol not present in the automaton components or when the transition would cause nondeterminism |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::addCallTransition | ( | StateType | from, |
| InputSymbolType | input, | ||
| StateType | to, | ||
| PushdownStoreSymbolType | push | ||
| ) |
Adds a call transition to the automaton.
The transition is in a form A \times a -> B \times g, where A, B \in Q, a \in T, and g \in G
| from | the source state (A) |
| input | the input symbol (a) |
| to | the target state (B) |
| push | symbol to be pushed to the pushdown store on the transition use (g) |
| AutomatonException | when transition contains state or symbol not present in the automaton components or when the transition would cause nondeterminism |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::addCallTransition | ( | StateType | from, |
| StateType | to, | ||
| PushdownStoreSymbolType | push | ||
| ) |
Adds a call transition to the automaton.
The transition is in a form A \times \eps -> B \times g, where A, B \in Q, and g \in G
| from | the source state (A) |
| to | the target state (B) |
| push | symbol to be pushed to the pushdown store on the transition use (g) |
| AutomatonException | when transition contains state or symbol not present in the automaton components or when the transition would cause nondeterminism |
|
inline |
Adder of a final state.
| state | the new state to be added to a set of final states |
|
inline |
Adder of an initial state.
| state | the new state to be added to a set of initial states |
|
inline |
Adder of a input symbol.
| symbol | the new symbol to be added to an input alphabet |
|
inline |
Adder of input symbols.
| symbols | new symbols to be added to an input alphabet |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::addLocalTransition | ( | StateType | from, |
| common::symbol_or_epsilon< InputSymbolType > | input, | ||
| StateType | to | ||
| ) |
Adds a local transition to the automaton.
The transition is in a form A \times a -> B, where A, B \in Q and a \in T \cup { \eps }
| from | the source state (A) |
| input | the input symbol or epsilon (a) |
| to | the target state (B) |
| AutomatonException | when transition contains state or symbol not present in the automaton components or when the transition would cause nondeterminism |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::addLocalTransition | ( | StateType | from, |
| InputSymbolType | input, | ||
| StateType | to | ||
| ) |
Adds a local transition to the automaton.
The transition is in a form A \times a -> B, where A, B \in Q and a \in T
| from | the source state (A) |
| input | the call input symbol (a) |
| to | the target state (B) |
| AutomatonException | when transition contains state or symbol not present in the automaton components or when the transition would cause nondeterminism |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::addLocalTransition | ( | StateType | from, |
| StateType | to | ||
| ) |
Adds a local transition to the automaton.
The transition is in a form A \times \eps -> B, where A, B \in Q
| from | the source state (A) |
| to | the target state (B) |
| AutomatonException | when transition contains state or symbol not present in the automaton components or when the transition would cause nondeterminism |
|
inline |
Adder of a pushdown store symbol.
| symbol | the new symbol to be added to a pushdown store alphabet |
|
inline |
Adder of pushdown store symbols.
| symbols | new symbols to be added to a pushdown store alphabet |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::addReturnTransition | ( | StateType | from, |
| common::symbol_or_epsilon< InputSymbolType > | input, | ||
| PushdownStoreSymbolType | pop, | ||
| StateType | to | ||
| ) |
Adds a return transition to the automaton.
The transition is in a form A \times a \times g -> B, where A, B \in Q, a \in T \cup { \eps }, and g \in G
| from | the source state (A) |
| input | the input symbol or epsilon (a) |
| pop | symbol to be poped to the pushdown store on the transition use (g) |
| to | the target state (B) |
| AutomatonException | when transition contains state or symbol not present in the automaton components or when the transition would cause nondeterminism |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::addReturnTransition | ( | StateType | from, |
| InputSymbolType | input, | ||
| PushdownStoreSymbolType | pop, | ||
| StateType | to | ||
| ) |
Adds a return transition to the automaton.
The transition is in a form A \times a \times g -> B, where A, B \in Q, a \in T, and g \in G
| from | the source state (A) |
| input | the input symbol (a) |
| pop | symbol to be poped to the pushdown store on the transition use (g) |
| to | the target state (B) |
| AutomatonException | when transition contains state or symbol not present in the automaton components or when the transition would cause nondeterminism |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::addReturnTransition | ( | StateType | from, |
| PushdownStoreSymbolType | pop, | ||
| StateType | to | ||
| ) |
Adds a return transition to the automaton.
The transition is in a form A \times \eps \times g -> B, where A, B \in Q, and g \in G
| from | the source state (A) |
| pop | symbol to be poped to the pushdown store on the transition use (g) |
| to | the target state (B) |
| AutomatonException | when transition contains state or symbol not present in the automaton components or when the transition would cause nondeterminism |
|
inline |
Adder of a state.
| state | the new state to be added to a set of states |
|
inline |
Getter of the bottom of the stack symbol.
|
inline |
Getter of the bottom of the stack symbol.
| ext::multimap< ext::pair< StateType, common::symbol_or_epsilon< InputSymbolType > >, ext::pair< StateType, PushdownStoreSymbolType > > && automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::getCallTransitions | ( | ) | && |
Get the call transition function of the automaton in its natural form.
| const ext::multimap< ext::pair< StateType, common::symbol_or_epsilon< InputSymbolType > >, ext::pair< StateType, PushdownStoreSymbolType > > & automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::getCallTransitions | ( | ) | const & |
Get the call transition function of the automaton in its natural form.
|
inline |
Getter of final states.
|
inline |
Getter of final states.
|
inline |
Getter of initial state.
|
inline |
Getter of initial state.
|
inline |
Getter of the input alphabet.
|
inline |
Getter of the input alphabet.
| ext::multimap< ext::pair< StateType, common::symbol_or_epsilon< InputSymbolType > >, StateType > && automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::getLocalTransitions | ( | ) | && |
Get the local transition function of the automaton in its natural form.
| const ext::multimap< ext::pair< StateType, common::symbol_or_epsilon< InputSymbolType > >, StateType > & automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::getLocalTransitions | ( | ) | const & |
Get the local transition function of the automaton in its natural form.
|
inline |
Getter of the pushdown store alphabet.
|
inline |
Getter of the pushdown store alphabet.
| ext::multimap< ext::tuple< StateType, common::symbol_or_epsilon< InputSymbolType >, PushdownStoreSymbolType >, StateType > && automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::getReturnTransitions | ( | ) | && |
Get the return transition function of the automaton in its natural form.
| const ext::multimap< ext::tuple< StateType, common::symbol_or_epsilon< InputSymbolType >, PushdownStoreSymbolType >, StateType > & automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::getReturnTransitions | ( | ) | const & |
Get the return transition function of the automaton in its natural form.
|
inline |
Getter of states.
|
inline |
Getter of states.
|
inline |
The three way comparison implementation
| other | the other instance |
other.
|
inline |
The equality comparison implementation.
| other | the other object to compare with. |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::removeCallTransition | ( | const StateType & | from, |
| const common::symbol_or_epsilon< InputSymbolType > & | input, | ||
| const StateType & | to, | ||
| const PushdownStoreSymbolType & | push | ||
| ) |
Removes a call transition from the automaton.
The transition is in a form A \times a -> B \times g, where A, B \in Q, a \in T \cup { \eps }, and g \in G
| from | the source state (A) |
| input | the input symbol or epsilon (a) |
| to | the target state (B) |
| push | symbol to be pushed to the pushdown store on the transition use (g) |
| AutomatonException | when removed transition left hand side was found but the right hand side did not match. |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::removeCallTransition | ( | const StateType & | from, |
| const InputSymbolType & | input, | ||
| const StateType & | to, | ||
| const PushdownStoreSymbolType & | push | ||
| ) |
Removes a call transition from the automaton.
The transition is in a form A \times a -> B \times g, where A, B \in Q, a \in T, and g \in G
| from | the source state (A) |
| input | the input symbol (a) |
| to | the target state (B) |
| push | symbol to be pushed to the pushdown store on the transition use (g) |
| AutomatonException | when removed transition left hand side was found but the right hand side did not match. |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::removeCallTransition | ( | const StateType & | from, |
| const StateType & | to, | ||
| const PushdownStoreSymbolType & | push | ||
| ) |
Removes a call transition from the automaton.
The transition is in a form A \times \eps -> B \times g, where A, B \in Q, and g \in G
| from | the source state (A) |
| to | the target state (B) |
| push | symbol to be pushed to the pushdown store on the transition use (g) |
| AutomatonException | when removed transition left hand side was found but the right hand side did not match. |
|
inline |
Remover of a final state.
| state | a state to be removed from a set of final states |
|
inline |
Remover of an initial state.
| state | a state to be removed from a set of initial states |
|
inline |
Remover of an input symbol.
| symbol | a symbol to be removed from an input alphabet |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::removeLocalTransition | ( | const StateType & | from, |
| const common::symbol_or_epsilon< InputSymbolType > & | input, | ||
| const StateType & | to | ||
| ) |
Removes a local transition from the automaton.
The transition is in a form A \times a -> B, where A, B \in Q and a \in T \cup { \eps }
| from | the source state (A) |
| input | the input symbol or epsilon (a) |
| to | the target state (B) |
| AutomatonException | when removed transition left hand side was found but the right hand side did not match. |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::removeLocalTransition | ( | const StateType & | from, |
| const InputSymbolType & | input, | ||
| const StateType & | to | ||
| ) |
Removes a local transition from the automaton.
The transition is in a form A \times a -> B, where A, B \in Q and a \in T
| from | the source state (A) |
| input | the input symbol (a) |
| to | the target state (B) |
| AutomatonException | when removed transition left hand side was found but the right hand side did not match. |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::removeLocalTransition | ( | const StateType & | from, |
| const StateType & | to | ||
| ) |
Removes a local transition from the automaton.
The transition is in a form A \times \eps -> B, where A, B \in Q
| from | the source state (A) |
| to | the target state (B) |
| AutomatonException | when removed transition left hand side was found but the right hand side did not match. |
|
inline |
Remover of an pushdown store symbol.
| symbol | a symbol to be removed from a pushdown store alphabet |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::removeReturnTransition | ( | const StateType & | from, |
| const common::symbol_or_epsilon< InputSymbolType > & | input, | ||
| const PushdownStoreSymbolType & | pop, | ||
| const StateType & | to | ||
| ) |
Removes a return transition from the automaton.
The transition is in a form A \times a \times g -> B, where A, B \in Q, a \in T \cup { \eps }, and g \in G
| from | the source state (A) |
| input | the input symbol or epsilon (a) |
| pop | symbol to be poped to the pushdown store on the transition use (g) |
| to | the target state (B) |
| AutomatonException | when removed transition left hand side was found but the right hand side did not match. |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::removeReturnTransition | ( | const StateType & | from, |
| const InputSymbolType & | input, | ||
| const PushdownStoreSymbolType & | pop, | ||
| const StateType & | to | ||
| ) |
Removes a return transition from the automaton.
The transition is in a form A \times a \times g -> B, where A, B \in Q, a \in T, and g \in G
| from | the source state (A) |
| input | the input symbol (a) |
| pop | symbol to be poped to the pushdown store on the transition use (g) |
| to | the target state (B) |
| AutomatonException | when removed transition left hand side was found but the right hand side did not match. |
| bool automaton::RealTimeHeightDeterministicNPDA< InputSymbolType, PushdownStoreSymbolType, StateType >::removeReturnTransition | ( | const StateType & | from, |
| const PushdownStoreSymbolType & | pop, | ||
| const StateType & | to | ||
| ) |
Removes a return transition from the automaton.
The transition is in a form A \times \eps \times g -> B, where A, B \in Q, and g \in G
| from | the source state (A) |
| pop | symbol to be poped to the pushdown store on the transition use (g) |
| to | the target state (B) |
| AutomatonException | when removed transition left hand side was found but the right hand side did not match. |
|
inline |
Remover of a state.
| state | a state to be removed from a set of states |
|
inline |
Setter of the bottom of the stack symbol.
| symbol | new bottom of the stack symbol of the automaton |
|
inline |
Setter of final states.
| states | completely new set of final states |
|
inline |
Setter of initial states.
| states | completely new set of initial states |
|
inline |
Setter of input alphabet.
| symbols | completely new input alphabet |
|
inline |
Setter of a pushdown store alphabet.
| symbols | completely new pushdown store alphabet |
|
inline |
Setter of states.
| states | completely new set of states |
|
friend |
Print this object as raw representation to ostream.
| out | ostream where to print |
| instance | object to print |