35 size_t delta(
size_t q, char32_t symbol)
const;
36 size_t delta(
size_t q, std::string
const& utf8Symbol)
const;
37 size_t deltaHat(
size_t q, std::u32string
const& word)
const;
38 size_t deltaHat(
size_t q, std::string
const& utf8Word)
const;
71 std::unique_ptr<pImpl> p;
75 std::unique_ptr<pImpl> p;
77 std::vector<char32_t>& alphabet,
78 std::vector<std::vector<size_t>>& transitions,
79 std::vector<std::string>& labels,
80 std::valarray<bool>& acceptingStates
bool isAccepting(size_t q) const
Tests whether a state is an accept state within this DFA.
bool operator!=(const dfa &d) const
Tests whether this DFA doesn't accept the same language as another one.
builder & setAccepting(std::string const &state, bool accept)
Sets whether or not a state will be accepting within the prospective DFA.
size_t delta(size_t q, char32_t symbol) const
Computes this DFA's transition function for a state and a symbol.
dfa()
Constructs a DFA accepting the empty language ∅.
Represents nondeterministic finite automata with ε-moves.
Represents deterministic finite automata.
Private implementation details of DFAs.
builder & purge()
Purges the prospective DFA of unreachable and non-producing states, allowing for minimization.
std::vector< char32_t > const & getAlphabet() const
Fetches this DFA's set of processable symbols.
dfa & operator=(const dfa &d)
Copy-assigns this DFA by copying another one's private implementation object.
Private implementation details of DFA builders.
bool operator==(const dfa &d) const
Tests whether this DFA accepts exactly the same language as another one.
builder & makeInitial(std::string const &state)
Resets the initial state for the prospective DFA.
builder & merge()
Merges the prospective DFA's indistinguishable states, allowing for minimization. ...
Constructs DFAs step by step.
size_t deltaHat(size_t q, std::u32string const &word) const
Computes this DFA's transition function recursively for a string of symbols, starting in a specified ...
size_t getNumberOfStates() const
Counts this DFA's states.
builder()
Constructs a blank builder object.
builder & operator=(const builder &b)
Copy-assigns a builder by copying another one's private implementation object.
std::string const & getLabelOf(size_t q) const
Puts a name to an index.
dfa build()
Builds the DFA, as defined by previous operations, including completion.
std::vector< std::string > const & getUtf8Alphabet() const
Fetches this DFA's set of processable symbols as UTF-8-encoded strings.
builder & defineTransition(std::string const &from, std::string const &to, char32_t symbol)
(Re-)Defines a transition for the prospective DFA.
builder & addSymbol(char32_t symbol)
Adds a symbol to the prospective DFA's alphabet.