Skip to content

Fix: several grapht functions were uncompilable if ever called #2389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

polgreen
Copy link
Contributor

@polgreen polgreen commented Jun 22, 2018

This code didn't compile because it accessed visited, a vector<bool>, using a pair from maps<node_indext, nodet> edgest as the position. It should instead have used the node_indext, the first element of the pair.

These functions are never used in CBMC, and presumably not used by any other tools using CBMC (since the code didn't compile) so they might be candidates for removal anyway.

I've also updated the for loops.

edgest is a map from node_indext to some type edget. In order to access the node_indext, you must access the first element of the pair.

I've also updated the iterators.
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed Diffblue compatibility checks (cbmc commit: de77f26).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/77027049

@smowton
Copy link
Contributor

smowton commented Jun 22, 2018

If we keep these we should add unit tests that exercise them, to prevent similar decay in future.

@polgreen
Copy link
Contributor Author

I don't need this fix, or these functions, so I'm not going to write unit tests, sorry. Feel free to ignore the PR and leave the uncompilable code in there if lack of unit tests is a blocker.

@smowton
Copy link
Contributor

smowton commented Jun 22, 2018

I'll write something Monday

@smowton
Copy link
Contributor

smowton commented Jun 25, 2018

Tests for make-chordal here [https://github.com/smowton/cbmc/tree/smowton/admin/graph-unit-tests], tests for connected-subgraphs coming tomorrow.

Side note: grapht::make_chordal is pretty aggressive, it even adds a cycle to A <-> B <-> C!

@smowton
Copy link
Contributor

smowton commented Jun 27, 2018

Merged as #2480

@smowton smowton closed this Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants