From 6bdb7424a9b3560ae0db1dc03e4304f7886fa206 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Tue, 25 Sep 2018 21:39:44 +0200
Subject: [PATCH] add documentation to automaton run algorithms

---
 alib2algo/src/automaton/run/Accept.h      |  12 +-
 alib2algo/src/automaton/run/Occurrences.h |  82 ++++++++-
 alib2algo/src/automaton/run/Result.h      | 166 ++++++++++++++++-
 alib2algo/src/automaton/run/Run.h         | 213 ++++++++++++++++++++++
 alib2algo/src/automaton/run/Translate.h   |  18 +-
 5 files changed, 481 insertions(+), 10 deletions(-)

diff --git a/alib2algo/src/automaton/run/Accept.h b/alib2algo/src/automaton/run/Accept.h
index 2364ee560f..1313648eeb 100644
--- a/alib2algo/src/automaton/run/Accept.h
+++ b/alib2algo/src/automaton/run/Accept.h
@@ -30,6 +30,10 @@ namespace automaton {
 
 namespace run {
 
+/**
+ * \brief
+ * Implementation of test whether automaton accepts its input.
+ */
 class Accept {
 public:
 	/**
@@ -78,8 +82,8 @@ public:
 	/**
 	 * \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 SymbolType type of symbols of tree nodes and terminal symbols of the runned automaton
+	 * \tparam RankType type of ranks of tree nodes and terminal symbols of the runned automaton
 	 * \tparam StateType type of states of the runned automaton
 	 *
 	 * \param automaton the runned automaton
@@ -93,8 +97,8 @@ public:
 	/**
 	 * \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 SymbolType type of symbols of tree nodes and terminal symbols of the runned automaton
+	 * \tparam RankType type of ranks of tree nodes and terminal symbols of the runned automaton
 	 * \tparam StateType type of states of the runned automaton
 	 *
 	 * \param automaton the runned automaton
diff --git a/alib2algo/src/automaton/run/Occurrences.h b/alib2algo/src/automaton/run/Occurrences.h
index 29243e3579..7786cf7cd9 100644
--- a/alib2algo/src/automaton/run/Occurrences.h
+++ b/alib2algo/src/automaton/run/Occurrences.h
@@ -25,22 +25,100 @@ namespace automaton {
 
 namespace run {
 
+/**
+ * \brief
+ * Implementation of automaton run over its input reporting occurrences .
+ */
 class Occurrences {
 public:
 	/**
-	 * Performs conversion.
-	 * @return left regular grammar equivalent to source automaton.
+	 * Automaton occurrences run implementation.
+	 *
+	 * \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 set of indexes to the string where the automaton passed a final state
 	 */
 	template < class SymbolType, class StateType >
 	static ext::set < unsigned > occurrences ( const automaton::DFA < SymbolType, StateType > & automaton, const string::LinearString < SymbolType > & string );
+
+	/**
+	 * \override
+	 *
+	 * \tparam SymbolType type of symbols of tree nodes and terminal symbols of the runned automaton
+	 * \tparam RankType type of ranks of tree 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 set of indexes to the tree where the automaton passed a final state (as in the postorder traversal)
+	 */
 	template < class SymbolType, class RankType, class StateType >
 	static ext::set < unsigned > occurrences ( const automaton::DFTA < 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 set of indexes to the tree where the automaton passed a final state
+	 */
 	template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
 	static ext::set < unsigned > occurrences ( 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 set of indexes to the tree where the automaton passed a final
+	 */
 	template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
 	static ext::set < unsigned > occurrences ( 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 set of indexes to the tree where the automaton passed a final state
+	 */
 	template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType >
 	static ext::set < unsigned > occurrences ( 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 set of indexes to the tree where the automaton passed a final state
+	 */
 	template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType >
 	static ext::set < unsigned > occurrences ( const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string );
 
diff --git a/alib2algo/src/automaton/run/Result.h b/alib2algo/src/automaton/run/Result.h
index 4ba1035747..3005a1a72f 100644
--- a/alib2algo/src/automaton/run/Result.h
+++ b/alib2algo/src/automaton/run/Result.h
@@ -26,35 +26,197 @@ namespace automaton {
 
 namespace run {
 
+/**
+ * \brief
+ * Implementation of automaton run over its input returning the reached state.
+ */
 class Result {
 public:
 	/**
-	 * Performs conversion.
-	 * @return left regular grammar equivalent to source automaton.
+	 * General automaton run implementation resulting in the reached state. Generic fail state is returned if the automaton's transition function was not defined for 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 state where the run stopped
 	 */
 	template < class SymbolType, class StateType >
 	static StateType result ( const automaton::DFA < SymbolType, StateType > & automaton, const string::LinearString < SymbolType > & string );
+
+	/**
+	 * \override
+	 *
+	 * \tparam SymbolType type of symbols of tree nodes and terminal symbols of the runned automaton
+	 * \tparam RankType type of ranks of tree 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 state where the run stopped
+	 */
 	template < class SymbolType, class RankType, class StateType >
 	static StateType result ( const automaton::DFTA < 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 state where the run stopped
+	 */
 	template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
 	static StateType result ( 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 state where the run stopped
+	 */
 	template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
 	static StateType result ( 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 state where the run stopped
+	 */
 	template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType >
 	static StateType result ( 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 state where the run stopped
+	 */
 	template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType >
 	static StateType result ( const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string );
 
+	/**
+	 * General automaton run implementation resulting in the reached state. Given fail state is returned if the automaton's transition function was not defined for 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
+	 * \param the fail state to use when transition function is not defined for the input
+	 *
+	 * \return state where the run stopped
+	 */
 	template < class SymbolType, class StateType >
 	static StateType result ( const automaton::DFA < SymbolType, StateType > & automaton, const string::LinearString < SymbolType > & string, const StateType & failLabel );
+
+	/**
+	 * \override
+	 *
+	 * \tparam SymbolType type of symbols of tree nodes and terminal symbols of the runned automaton
+	 * \tparam RankType type of ranks of tree 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
+	 * \param the fail state to use when transition function is not defined for the input
+	 *
+	 * \return state where the run stopped
+	 */
 	template < class SymbolType, class RankType, class StateType >
 	static StateType result ( const automaton::DFTA < SymbolType, RankType, StateType > & automaton, const tree::RankedTree < SymbolType, RankType > & tree, const StateType & failLabel );
+
+	/**
+	 * \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
+	 * \param the fail state to use when transition function is not defined for the input
+	 *
+	 * \return state where the run stopped
+	 */
 	template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
 	static StateType result ( const automaton::InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string, const StateType & failLabel );
+
+	/**
+	 * \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
+	 * \param the fail state to use when transition function is not defined for the input
+	 *
+	 * \return state where the run stopped
+	 */
 	template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
 	static StateType result ( const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string, const StateType & failLabel );
+
+	/**
+	 * \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
+	 * \param the fail state to use when transition function is not defined for the input
+	 *
+	 * \return state where the run stopped
+	 */
 	template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType >
 	static StateType result ( const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string, const StateType & failLabel );
+
+	/**
+	 * \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
+	 * \param the fail state to use when transition function is not defined for the input
+	 *
+	 * \return state where the run stopped
+	 */
 	template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType >
 	static StateType result ( const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string, const StateType & failLabel );
 };
diff --git a/alib2algo/src/automaton/run/Run.h b/alib2algo/src/automaton/run/Run.h
index d292f1a03b..2919ec748e 100644
--- a/alib2algo/src/automaton/run/Run.h
+++ b/alib2algo/src/automaton/run/Run.h
@@ -35,33 +35,246 @@ namespace automaton {
 
 namespace run {
 
+/**
+ * \brief
+ * Implementation of automaton run over its input.
+ */
 class Run {
+	/**
+	 * Recursive implementation of automaton run over a tree.
+	 *
+	 * \tparam SymbolType type of symbols of tree nodes and terminal symbols of the runned automaton
+	 * \tparam RankType type of ranks of tree 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
+	 * \param occ the set of collected occurrences
+	 * \param i the index to the tree following the postorder traversal
+	 *
+	 * \return pair of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	state where the computation ended
+	 */
 	template < class SymbolType, class RankType, class StateType >
 	static ext::pair < bool, StateType > calculateState ( const automaton::DFTA < SymbolType, RankType, StateType > & automaton, const ext::tree < common::ranked_symbol < SymbolType, RankType > > & node, ext::set < unsigned > & occ, unsigned & i );
+
+	/**
+	 * \override
+	 *
+	 * \tparam SymbolType type of symbols of tree nodes and terminal symbols of the runned automaton
+	 * \tparam RankType type of ranks of tree 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
+	 * \param occ the set of collected occurrences
+	 * \param i the index to the tree following the postorder traversal
+	 *
+	 * \return pair of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	state where the computation ended
+	 */
 	template < class SymbolType, class RankType, class StateType >
 	static ext::pair < bool, ext::set < StateType > > calculateStates ( const automaton::NFTA < SymbolType, RankType, StateType > & automaton, const ext::tree < common::ranked_symbol < SymbolType, RankType > > & node, ext::set < unsigned > & occ, unsigned & i );
+
+	/**
+	 * Test whether a pushdown store contains symbols to pop.
+	 *
+	 * \tparam SymbolType type of pushdown store symbols
+	 *
+	 * \param pushdownStore the pushdown store to test
+	 * \param pop symbols tested to be on top of the pushdown store
+	 *
+	 * \return true if the pushdown store contains pop symbols as its top symbols, false otherwise
+	 */
 	template < class SymbolType >
 	static bool canPop ( const ext::deque < SymbolType > & pushdownStore, const ext::vector < SymbolType > & pop );
 
 public:
+	/**
+	 * General automaton run implementation.
+	 *
+	 * \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 tuple of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	state where the run stopped
+	 *	set of indexes to the string where the automaton passed a final state
+	 */
 	template < class SymbolType, class StateType >
 	static ext::tuple < bool, StateType, ext::set < unsigned > > calculateState ( 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 tuple of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	set of states where the run stopped
+	 *	set of indexes to the string where the automaton passed a final state
+	 */
 	template < class SymbolType, class StateType >
 	static ext::tuple < bool, ext::set < StateType >, ext::set < unsigned > > calculateStates ( 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 tuple of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	set of states where the run stopped
+	 *	set of indexes to the string where the automaton passed a final state
+	 */
 	template < class SymbolType, class EpsilonType, class StateType >
 	static ext::tuple < bool, ext::set < StateType >, ext::set < unsigned > > calculateStates ( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & automaton, const string::LinearString < SymbolType > & string );
+
+	/**
+	 * \override
+	 *
+	 * \tparam SymbolType type of symbols of tree nodes and terminal symbols of the runned automaton
+	 * \tparam RankType type of ranks of tree 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 tuple of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	state where the run stopped
+	 *	set of indexes to the tree where the automaton passed a final state (as in the postorder traversal)
+	 */
 	template < class SymbolType, class RankType, class StateType >
 	static ext::tuple < bool, StateType, ext::set < unsigned > > calculateState ( const automaton::DFTA < SymbolType, RankType, StateType > & automaton, const tree::RankedTree < SymbolType, RankType > & tree );
+
+	/**
+	 * \override
+	 *
+	 * \tparam SymbolType type of symbols of tree nodes and terminal symbols of the runned automaton
+	 * \tparam RankType type of ranks of tree 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 tuple of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	set of states where the run stopped
+	 *	set of indexes to the tree where the automaton passed a final state (as in the postorder traversal)
+	 */
 	template < class SymbolType, class RankType, class StateType >
 	static ext::tuple < bool, ext::set < StateType >, ext::set < unsigned > > calculateStates ( 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 tuple of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	state where the run stopped
+	 *	set of indexes to the tree where the automaton passed a final state
+	 *	deque representing the final content of the pushdown store
+	 */
 	template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
 	static ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreSymbolType > > calculateState ( 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 tuple of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	state where the run stopped
+	 *	set of indexes to the tree where the automaton passed a final
+	 *	deque representing the final content of the pushdown store
+	 */
 	template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
 	static ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreSymbolType > > calculateState ( 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 tuple of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	state where the run stopped
+	 *	set of indexes to the tree where the automaton passed a final state
+	 *	deque representing the final content of the pushdown store
+	 */
 	template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType >
 	static ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreSymbolType > > calculateState ( 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 tuple of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	state where the run stopped
+	 *	set of indexes to the tree where the automaton passed a final state
+	 *	deque representing the final content of the pushdown store
+	 */
 	template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType >
 	static ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreSymbolType > > calculateState ( 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 tuple of
+	 *	true if the automaton does not fail to find transitions, false otherwise
+	 *	set of states where the run stopped
+	 *	set of symbol vectors representing the translations
+	 */
 	template < class InputSymbolType, class OutputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType >
 	static ext::tuple < bool, ext::set < StateType >, ext::set < ext::vector < OutputSymbolType > > > calculateStates ( const automaton::NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string );
 };
diff --git a/alib2algo/src/automaton/run/Translate.h b/alib2algo/src/automaton/run/Translate.h
index 314685a592..315926cf8c 100644
--- a/alib2algo/src/automaton/run/Translate.h
+++ b/alib2algo/src/automaton/run/Translate.h
@@ -20,11 +20,25 @@ namespace automaton {
 
 namespace run {
 
+/**
+ * \brief
+ * Implementation of transducer run over its input.
+ */
 class Translate {
 public:
 	/**
-	 * Performs conversion.
-	 * @return left regular grammar equivalent to source automaton.
+	 * \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 set of strings representing the translations
 	 */
 	template < class InputSymbolType, class OutputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType >
 	static ext::set < string::LinearString < OutputSymbolType > > translate ( const automaton::NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string );
-- 
GitLab