55 operator nfa const&()
const;
60 size_t delta(
size_t qi,
size_t si)
const;
64 size_t delta_(
size_t qi, char32_t u32symbol)
const;
u32string findShortestWord_(dfa const &d)
Searches the shortest UTF-32-encoded word accepted by a given DFA.
std::string const & getInitialState() const
Names this DFA's initial state.
string findShortestWord(dfa const &d)
Searches the shortest UTF-8-encoded word accepted by a given DFA.
bool isAccepting(size_t qi) const
Tests whether a state is an accept state within this DFA.
dfa()
Constructs a DFA accepting the empty language ∅.
Represents nondeterministic finite automata with ε-moves.
bool operator==(dfa const &d) const
Tests whether this DFA accepts exactly the same language as another one.
size_t deltaHat_(size_t qi, std::u32string const &u32word) const
Computes this DFA's transition function recursively for a UTF-32-encoded string of symbols...
Represents deterministic finite automata.
size_t deltaHat(size_t qi, std::string const &word) const
Computes this DFA's transition function recursively for a UTF-8-encoded string of symbols...
size_t delta(size_t qi, size_t si) const
Computes this DFA's transition function for a state index and a symbol index.
bool operator!=(dfa const &d) const
Tests whether this DFA doesn't accept the same language as another one.
static fabuilder complement(dfa const &d)
Creates a builder for a DFA accepting the complement of the language of a DFA.
std::vector< std::string > const & getStates() const
Fetches this DFA's set of states.
std::vector< std::string > const & getAlphabet() const
Fetches this DFA's set of processable symbols as UTF-8-encoded strings.
friend std::string findShortestWord(dfa const &d)
Searches the shortest UTF-8-encoded word accepted by a given DFA.
friend std::u32string findShortestWord_(dfa const &d)
Searches the shortest UTF-32-encoded word accepted by a given DFA.
Constructs NFAs step by step.
static std::vector< std::valarray< bool > > indistinguishableStates(std::vector< std::vector< size_t >> const &transitions, std::valarray< bool > const &accepting)
Builds the table of indistinguishable states w.r.t. a transition function.
Where this library lives.
static fabuilder unite(dfa const &d1, dfa const &d2)
Creates a builder for a DFA accepting the union of the languages of two DFAs.
static fabuilder subtract(dfa const &d1, dfa const &d2)
Creates a builder for a DFA accepting the set difference of the languages of two DFAs.
Private implementation details of DFAs.
static fabuilder intersect(dfa const &d1, dfa const &d2)
Creates a builder for a DFA accepting the intersection of the languages of two DFAs.
std::vector< char32_t > const & getAlphabet_() const
Fetches this DFA's set of processable symbols.
size_t delta_(size_t qi, char32_t u32symbol) const
Computes this DFA's transition function for a state index and a UTF-32-encoded symbol.
dfa & operator=(dfa const &d)
Copy-assigns this DFA by copying another one's private implementation object.