Automaton

Typedefs

using Aut = Automaton<char>

Functions

template<class T>
Automaton<T> operator+(const Automaton<T> &a, const Automaton<T> &b)
template<class T>
Automaton<T> operator*(const Automaton<T> &a, const Automaton<T> &b)
template<class T>
std::ostream &operator<<(std::ostream &os, const Automaton<T> &aut)
template<class T>
class Automaton

Public Functions

Automaton()
int stateCount() const
void addState(const bool isStart, const bool isAccepting)
void addEpsilonTransition(const int state1, const int state2)
void addTransition(const int state1, const T letter, const int state2)
void removeState(const int s)
std::vector<T> alphabet() const
void clear()
bool isAccepted(const std::vector<T> &str) const
bool hasEpsilonTransitions() const
void removeEpsilonTransitions()
bool isComplete() const
bool isComplete(const std::vector<T> &alphabet) const
void makeComplete()
void makeComplete(const std::vector<T> &newAlphabet)
void determinize()
void minimize()
void applyKleenStar()
void applyKleenPlus()
void operator+=(const Automaton<T> &other)
void operator*=(const Automaton<T> &other)

Public Static Functions

static Automaton<T> fromRegex(const Regex<T> *r)

Private Members

std::multimap<std::pair<int, T>, int> m_transitions
std::multimap<int, int> m_epsilonTransitions
std::set<int> m_startStates
std::vector<bool> m_isAccepting

Friends

template<class U>
friend Automaton<U> operator+(const Automaton<U> &a, const Automaton<U> &b)
template<class U>
friend Automaton<U> operator*(const Automaton<U> &a, const Automaton<U> &b)
template<class U>
friend std::ostream &operator<<(std::ostream &os, const Automaton<U> &aut)