ng: ensure that only match states have reports

Ensure (and assert) that vertices without an edge to {accept, acceptEod}
do not have reports set.
This commit is contained in:
Justin Viiret
2016-07-18 12:41:31 +10:00
committed by Matthew Barr
parent 3d9a60d023
commit 4ce268af47
10 changed files with 70 additions and 20 deletions

View File

@@ -297,15 +297,29 @@ void clearReports(NGHolder &g);
void duplicateReport(NGHolder &g, ReportID r_old, ReportID r_new);
#ifndef NDEBUG
// Assertions: only available in internal builds
/** \brief Used in sanity-checking assertions: returns true if all vertices
* leading to accept or acceptEod have at least one report ID. */
// Assertions: only available in internal builds.
/**
* Used in sanity-checking assertions: returns true if all vertices
* with edges to accept or acceptEod have at least one report ID. Additionally,
* checks that ONLY vertices with edges to accept or acceptEod has reports.
*/
bool allMatchStatesHaveReports(const NGHolder &g);
/**
* Assertion: returns true if the vertices in this graph are contiguously (and
* uniquely) numbered from zero.
*/
bool hasCorrectlyNumberedVertices(const NGHolder &g);
/**
* Assertion: returns true if the edges in this graph are contiguously (and
* uniquely) numbered from zero.
*/
bool hasCorrectlyNumberedEdges(const NGHolder &g);
#endif
#endif // NDEBUG
} // namespace ue2