Private implementation details of DFAs.
More...
|
| pImpl () |
| Constructs private implementation object for a DFA accepting the empty language ∅. More...
|
|
| pImpl (vector< char32_t > &alphabet, vector< vector< size_t >> &transitions, vector< string > &labels, valarray< bool > &accepting) |
| Constructs private implementation object with provided members. More...
|
|
|
valarray< bool > | accepting |
| A true value marks an index as belonging to an accept state. More...
|
|
vector< char32_t > | alphabet |
| Represents the set of processable symbols. More...
|
|
vector< string > | utf8Alphabet |
| Represents the set of processable symbols as UTF-8-encoded strings. More...
|
|
vector< string > | labels |
| Stores the names of states. More...
|
|
vector< vector< size_t > > | transitions |
| Stores the transition function as a table viz state index × symbol index → state index. More...
|
|
Private implementation details of DFAs.
Definition at line 35 of file dfa.cpp.
◆ pImpl() [1/2]
reg::dfa::pImpl::pImpl |
( |
| ) |
|
|
inline |
Constructs private implementation object for a DFA accepting the empty language ∅.
Definition at line 43 of file dfa.cpp.
vector< char32_t > alphabet
Represents the set of processable symbols.
valarray< bool > accepting
A true value marks an index as belonging to an accept state.
vector< string > utf8Alphabet
Represents the set of processable symbols as UTF-8-encoded strings.
vector< string > labels
Stores the names of states.
vector< vector< size_t > > transitions
Stores the transition function as a table viz state index × symbol index → state index...
◆ pImpl() [2/2]
reg::dfa::pImpl::pImpl |
( |
vector< char32_t > & |
alphabet, |
|
|
vector< vector< size_t >> & |
transitions, |
|
|
vector< string > & |
labels, |
|
|
valarray< bool > & |
accepting |
|
) |
| |
|
inline |
Constructs private implementation object with provided members.
Definition at line 46 of file dfa.cpp.
53 for (char32_t symbol : this->alphabet) {
static std::unique_ptr< std::wstring_convert< std::codecvt_utf8< char32_t >, char32_t > > const converter
Converts between UTF-8-encoded and UTF-32-encoded strings.
vector< char32_t > alphabet
Represents the set of processable symbols.
valarray< bool > accepting
A true value marks an index as belonging to an accept state.
vector< string > utf8Alphabet
Represents the set of processable symbols as UTF-8-encoded strings.
vector< string > labels
Stores the names of states.
vector< vector< size_t > > transitions
Stores the transition function as a table viz state index × symbol index → state index...
◆ indistinguishableStates()
static vector<valarray<bool> > reg::dfa::pImpl::indistinguishableStates |
( |
vector< vector< size_t >> const & |
transitions, |
|
|
valarray< bool > const & |
accepting |
|
) |
| |
|
inlinestatic |
Builds the table of indistinguishable states w.r.t. a transition function.
- Parameters
-
transitions | the transition function to base indistinguishability computation off |
accepting | the set of states that's trivially distinguishable from the rest |
- Returns
- state index × state index table where
true
values mark indistinguishable states
Definition at line 64 of file dfa.cpp.
66 vector<valarray<bool>> distinguishable;
70 distinguishable.push_back(valarray<bool>(
false,
transitions.size()));
71 for (
size_t p(0); p < q; p++) {
73 distinguishable[q][p] = (qAcc != pAcc);
74 distinguishable[p][q] = (qAcc != pAcc);
81 for (
size_t p(0); p < q; p++) {
82 if (distinguishable[q][p]) {
88 if (distinguishable[qS][pS]) {
90 distinguishable[q][p] =
true;
91 distinguishable[p][q] =
true;
99 for (
size_t i(0); i < distinguishable.size(); i++) {
100 distinguishable[i] ^= allTrue;
102 return distinguishable;
valarray< bool > accepting
A true value marks an index as belonging to an accept state.
vector< vector< size_t > > transitions
Stores the transition function as a table viz state index × symbol index → state index...
◆ accepting
valarray<bool> reg::dfa::pImpl::accepting |
A true
value marks an index as belonging to an accept state.
Definition at line 36 of file dfa.cpp.
◆ alphabet
vector<char32_t> reg::dfa::pImpl::alphabet |
Represents the set of processable symbols.
Definition at line 37 of file dfa.cpp.
◆ labels
vector<string> reg::dfa::pImpl::labels |
Stores the names of states.
Definition at line 39 of file dfa.cpp.
◆ transitions
vector<vector<size_t> > reg::dfa::pImpl::transitions |
Stores the transition function as a table viz state index × symbol index → state index.
Definition at line 40 of file dfa.cpp.
◆ utf8Alphabet
vector<string> reg::dfa::pImpl::utf8Alphabet |
Represents the set of processable symbols as UTF-8-encoded strings.
Definition at line 38 of file dfa.cpp.
The documentation for this struct was generated from the following file: