Class mata::AlphabetΒΆ
-
class Alphabet
The abstract interface for NFA alphabets.
Subclassed by EnumAlphabet, IntAlphabet, OnTheFlyAlphabet
Public Functions
-
inline virtual Word translate_word(const WordName &word_name) const
Translate sequence of symbol names to sequence of their respective values.
-
virtual std::string reverse_translate_symbol(Symbol symbol) const = 0
Translate internal
symbolrepresentation back to its original string name.Throws an exception when the
symbolis missing in the alphabet.- Parameters:
symbol β [in] Symbol to translate.
- Returns:
symboloriginal name.
-
inline virtual utils::OrdVector<Symbol> get_alphabet_symbols() const
Get a set of all symbols in the alphabet.
The result does not have to equal the list of symbols in the automaton using this alphabet.
-
inline virtual utils::OrdVector<Symbol> get_complement(const utils::OrdVector<Symbol> &symbols) const
complement of a set of symbols wrt the alphabet
-
inline virtual bool is_equal(const Alphabet &other_alphabet) const
Check whether two alphabets are equal.
In general, two alphabets are equal if and only if they are of the same class instance.
- Parameters:
other_alphabet β The other alphabet to compare with for equality.
- Returns:
True if equal, false otherwise.
-
inline virtual bool is_equal(const Alphabet *const other_alphabet) const
Check whether two alphabets are equal.
In general, two alphabets are equal if and only if they are of the same class instance.
- Parameters:
other_alphabet β The other alphabet to compare with for equality.
- Returns:
True if equal, false otherwise.
-
virtual bool empty() const = 0
Checks whether the alphabet has any symbols.
-
inline virtual Word translate_word(const WordName &word_name) const