mcclellan: Remove the use of state numbering

McClellan and Haig only need to know which states are not participants
(i.e. unused start, startDs)
This commit is contained in:
Justin Viiret
2016-03-23 11:47:54 +11:00
committed by Matthew Barr
parent 5dd4aa9c13
commit 839c90594c
6 changed files with 87 additions and 88 deletions

View File

@@ -281,6 +281,17 @@ void dropUnusedStarts(NGHolder &g, ue2::unordered_map<NFAVertex, u32> &states) {
}
}
flat_set<NFAVertex> findUnusedStates(const NGHolder &g) {
flat_set<NFAVertex> dead;
if (startIsRedundant(g)) {
dead.insert(g.start);
}
if (proper_out_degree(g.startDs, g) == 0) {
dead.insert(g.startDs);
}
return dead;
}
/** Construct a reversed copy of an arbitrary NGHolder, mapping starts to
* accepts. */
void reverseHolder(const NGHolder &g_in, NGHolder &g) {