diff --git a/alib2algo/src/automaton/run/Accept.h b/alib2algo/src/automaton/run/Accept.h index 76511849186a6dc9e1d7469cf5f22702be10de29..2364ee560f2bdbad043d97cba48dfc55040014a6 100644 --- a/alib2algo/src/automaton/run/Accept.h +++ b/alib2algo/src/automaton/run/Accept.h @@ -33,27 +33,154 @@ namespace run { class Accept { public: /** - * Performs conversion. - * @return left regular grammar equivalent to source automaton. + * Automaton run implementation resulting in boolean true if the automaton accepted the input. + * + * \tparam SymbolType type of symbols of the string and terminal symbols of the runned automaton + * \tparam StateType type of states of the runned automaton + * + * \param automaton the runned automaton + * \param string the input of the automaton + * + * \return true if the automaton accepts given string */ template < class SymbolType, class StateType > static bool accept ( const automaton::DFA < SymbolType, StateType > & automaton, const string::LinearString < SymbolType > & string ); + + /** + * \override + * + * \tparam SymbolType type of symbols of the string and terminal symbols of the runned automaton + * \tparam StateType type of states of the runned automaton + * + * \param automaton the runned automaton + * \param string the input of the automaton + * + * \return true if the automaton accepts given string + */ template < class SymbolType, class StateType > static bool accept ( const automaton::NFA < SymbolType, StateType > & automaton, const string::LinearString < SymbolType > & string ); + + /** + * \override + * + * \tparam SymbolType type of symbols of the string and terminal symbols of the runned automaton + * \tparam EpsilonType type of epsilon in the runned automaton + * \tparam StateType type of states of the runned automaton + * + * \param automaton the runned automaton + * \param string the input of the automaton + * + * \return true if the automaton accepts given string + */ template < class SymbolType, class EpsilonType, class StateType > static bool accept ( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & automaton, const string::LinearString < SymbolType > & string ); + + /** + * \override + * + * \tparam SymbolType type of symbols of nodes and terminal symbols of the runned automaton + * \tparam RankType type of ranks of nodes and terminal symbols of the runned automaton + * \tparam StateType type of states of the runned automaton + * + * \param automaton the runned automaton + * \param string the input of the automaton + * + * \return true if the automaton accepts given string + */ template < class SymbolType, class RankType, class StateType > static bool accept ( const automaton::DFTA < SymbolType, RankType, StateType > & automaton, const tree::RankedTree < SymbolType, RankType > & tree ); + + /** + * \override + * + * \tparam SymbolType type of symbols of nodes and terminal symbols of the runned automaton + * \tparam RankType type of ranks of nodes and terminal symbols of the runned automaton + * \tparam StateType type of states of the runned automaton + * + * \param automaton the runned automaton + * \param string the input of the automaton + * + * \return true if the automaton accepts given string + */ template < class SymbolType, class RankType, class StateType > static bool accept ( const automaton::NFTA < SymbolType, RankType, StateType > & automaton, const tree::RankedTree < SymbolType, RankType > & tree ); + + /** + * \override + * + * \tparam InputSymbolType type of symbols of the string and terminal symbols of the runned automaton + * \tparam PushdownStoreSymbolType type of pushdown store symbols of the runned automaton + * \tparam StateType type of states of the runned automaton + * + * \param automaton the runned automaton + * \param string the input of the automaton + * + * \return true if the automaton accepts given string + */ template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > static bool accept ( const automaton::InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string ); + + /** + * \override + * + * \tparam InputSymbolType type of symbols of the string and terminal symbols of the runned automaton + * \tparam PushdownStoreSymbolType type of pushdown store symbols of the runned automaton + * \tparam StateType type of states of the runned automaton + * + * \param automaton the runned automaton + * \param string the input of the automaton + * + * \return true if the automaton accepts given string + */ template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > static bool accept ( const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string ); + + /** + * \override + * + * \tparam InputSymbolType type of symbols of the string and terminal symbols of the runned automaton + * \tparam EpsilonType type of epsilon in the runned automaton + * \tparam PushdownStoreSymbolType type of pushdown store symbols of the runned automaton + * \tparam StateType type of states of the runned automaton + * + * \param automaton the runned automaton + * \param string the input of the automaton + * + * \return true if the automaton accepts given string + */ template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > static bool accept ( const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string ); + + /** + * \override + * + * \tparam InputSymbolType type of symbols of the string and terminal symbols of the runned automaton + * \tparam EpsilonType type of epsilon in the runned automaton + * \tparam PushdownStoreSymbolType type of pushdown store symbols of the runned automaton + * \tparam StateType type of states of the runned automaton + * + * \param automaton the runned automaton + * \param string the input of the automaton + * + * \return true if the automaton accepts given string + */ template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > static bool accept ( const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string ); + + /** + * \override + * + * \tparam InputSymbolType type of input symbols of the string and terminal symbols of the runned automaton + * \tparam OutputSymbolType type of output symbols of the runned automaton + * \tparam EpsilonType type of epsilon in the runned automaton + * \tparam PushdownStoreSymbolType type of pushdown store symbols of the runned automaton + * \tparam StateType type of states of the runned automaton + * + * \param automaton the runned automaton + * \param string the input of the automaton + * + * \return true if the automaton accepts given string + */ template < class InputSymbolType, class OutputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > static bool accept ( const automaton::NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string );