diff --git a/src/nfagraph/ng_limex.cpp b/src/nfagraph/ng_limex.cpp index 66494c77..5f782460 100644 --- a/src/nfagraph/ng_limex.cpp +++ b/src/nfagraph/ng_limex.cpp @@ -344,6 +344,13 @@ void attemptToUseAsStart(const NGHolder &g, NFAVertex u, if (!contains(unhandled_succ_tops, v)) { return; } + /* if it has vacuous reports we need to make sure that the report sets + * are the same */ + if ((v == g.accept || v == g.acceptEod) + && g[g.start].reports != g[u].reports) { + DEBUG_PRINTF("different report behaviour\n"); + return; + } const flat_set &v_tops = unhandled_succ_tops.at(v); flat_set new_inter; auto ni_inserter = inserter(new_inter, new_inter.end()); @@ -362,6 +369,7 @@ void attemptToUseAsStart(const NGHolder &g, NFAVertex u, return; } + DEBUG_PRINTF("reusing %u is a start vertex\n", g[u].index); markTopSuccAsHandled(u, top_inter, succs, tops_out, unhandled_top_succs, unhandled_succ_tops); } @@ -377,6 +385,7 @@ void reusePredsAsStarts(const NGHolder &g, const map &top_reach, map> &tops_out) { /* create list of candidates first, to avoid issues of iter invalidation * and determinism */ + DEBUG_PRINTF("attempting to reuse vertices for top starts\n"); vector cand_starts; for (NFAVertex u : unhandled_succ_tops | map_keys) { if (hasSelfLoop(u, g)) { @@ -434,6 +443,7 @@ void makeTopStates(NGHolder &g, map> &tops_out, while (!unhandled_succ_tops.empty()) { assert(!unhandled_top_succs.empty()); + DEBUG_PRINTF("creating top start vertex\n"); flat_set u_tops; flat_set u_succs; pickNextTopStateToHandle(unhandled_top_succs, unhandled_succ_tops, @@ -473,7 +483,7 @@ set findZombies(const NGHolder &h, } if (in_degree(h.acceptEod, h) != 1 || all_reports(h).size() != 1) { - DEBUG_PRINTF("can be made undead - bad reports\n"); + DEBUG_PRINTF("cannot be made undead - bad reports\n"); return zombies; }