55 operator nfa const&()
const;
77 friend expression::operator nfa
const&()
const;
78 gnfa(expression
const& r);
Represents nondeterministic finite automata with ε-moves.
bool operator!=(nfa const &n) const
Checks whether this RE describes a different regular language than another object.
expression::exptr getTransition(std::string const &q, std::string const &p) const
Extracts the RE labelling the transition between two states.
Represents deterministic finite automata.
nfa splitAllTransitions()
Splits all transitions until only ∅, ε, and symbol REs remain and builds the resulting NFA...
expression::exptr ripAllStates()
Removes all active states, constructing an RE semantically equivalent to this GNFA.
std::string const & getAcceptingState() const
Reveals the name of this GNFA's accept state.
std::string const & getInitialState() const
Reveals the name of this GNFA's initial state.
bool operator==(nfa const &n) const
Checks whether this RE describes the same regular language as another object.
gnfa & operator=(gnfa const &n)
Copy-assigns this GNFA by copying another one's private implementation object.
Contains the reg::expression class defintion.
state_vector splitTransition(std::string const &q, std::string const &p)
Splits a transition between two states, adding new states if needed.
Represents generalized nondeterministic finite automata.
state_vector getActiveStates() const
Reveals the names of this GNFA's non-initial, non-accepting states.
Where this library lives.
void bypassTransition(std::string const &q, std::string const &p, std::unordered_map< std::string, expression::exptr > const &offer={})
Removes a transition between two states and replaces it with equivalent ones, bypassing its beginning...
std::shared_ptr< expression const > exptr
This is the type used to handle regular expressions.
gnfa(dfa const &d)
Constructs a GNFA with the same states and transitions as a given DFA.
void ripState(std::string const &q, std::unordered_map< std::string, std::unordered_map< std::string, expression::exptr >> const &offer={})
Removes a state, bypassing all its outgoing transitions.
state_pair_vector getSplittableTransitions() const
Reveals this GNFA's splittable transitions.
std::vector< std::pair< std::reference_wrapper< std::string const >, std::reference_wrapper< std::string const > > > state_pair_vector
Nicer name for arrays of pairs names of states. Should store pairs of references to existing state na...
std::vector< std::reference_wrapper< std::string const > > state_vector
Nicer name for arrays of names of states. Should store references to existing state names...