These will be fairly expensive routines to call and might be abused in
real code, but are quite useful when debugging or in asserts and are
reasonable and well formed properties to query.
I've used one of them in an assert that was requested in a code review
here.
My real question: are these utilities worth adding now that we see the
amount of code involved? I just want to double check that this is what
was expected when it was brought up in code review.
Provided this is what we want, I'll add more comprehensive coverage of
these routines in the unittests to make sure they actually work
correctly, etc. Just wanted the sanity check first.
Why not walk over SCC instances directly? The way you've written these, I think you'll spend time "re-discovering" the SCC structures (that is walking intra-SCC call edges) when that is avoidable.