-
Notifications
You must be signed in to change notification settings - Fork 274
Rip out the heart of bmct [depends: 3557, blocks: 3578, 3580, 3581] #3565
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
Rip out the heart of bmct [depends: 3557, blocks: 3578, 3580, 3581] #3565
Conversation
f7ad772
to
e9d1f38
Compare
89555c4
to
bf74357
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: bf74357).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/94676355
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
bf74357
to
1561b05
Compare
1561b05
to
cd34e43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: cd34e43).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/94899726
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving the functions one by one would make reviewing easier but otherwise looks fine.
jbmc/src/jbmc/Makefile
Outdated
@@ -40,6 +40,7 @@ OBJ += ../$(CPROVER_DIR)/src/ansi-c/ansi-c$(LIBEXT) \ | |||
../$(CPROVER_DIR)/src/json/json$(LIBEXT) \ | |||
../$(CPROVER_DIR)/src/cbmc/all_properties$(OBJEXT) \ | |||
../$(CPROVER_DIR)/src/cbmc/bmc$(OBJEXT) \ | |||
../$(CPROVER_DIR)/src/cbmc/bmc_util$(OBJEXT) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in commit message? "Factor out bmct building blocks int bmc_util" -> into?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but I am wondering whether at some point all contents of the cbmc
folder will have moved to the goto-checker
folder? Is "bounded model checking"-specific code really something that should be placed in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally not convinced at the granularity of these methods, especially the ones that just print an informational message before calling another method, or the ones that mess with symex internal state without being members of symex.
src/cbmc/bmc_util.cpp
Outdated
message_handlert &message_handler) | ||
{ | ||
messaget msg(message_handler); | ||
msg.status() << "converting SSA" << messaget::eom; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good time to improve this rubbish message :) "Converting VCCs to propositional formula"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, this isn't a very useful utility-- print a message then call another public function? Probably just inline this?
src/cbmc/bmc_util.cpp
Outdated
ui_message_handlert &ui_message_handler) | ||
{ | ||
messaget msg(ui_message_handler); | ||
msg.status() << "Building error trace" << messaget::eom; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the symex case below, this isn't a very useful utility
src/cbmc/bmc_util.cpp
Outdated
if(!ns.lookup(INITIALIZE_FUNCTION, init_symbol)) | ||
symex.language_mode = init_symbol->mode; | ||
|
||
msg.status() << "Starting Bounded Model Checking" << messaget::eom; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this message even true? Symex isn't really BMC any more than any of the prior passes were
src/cbmc/bmc_util.cpp
Outdated
|
||
symex.last_source_location.make_nil(); | ||
|
||
symex.unwindset.parse_unwind(options.get_option("unwind")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this method onto symex? It exclusively has effects on symex's members
src/cbmc/bmc_util.cpp
Outdated
} | ||
|
||
void slice( | ||
symex_bmct &symex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Const reference?
src/cbmc/bmc_util.cpp
Outdated
} | ||
} | ||
} | ||
msg.statistics() << "Generated " << symex.get_total_vccs() << " VCC(s), " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like symex_target_equation
is assumed to be bound to symex
at this point, such that slicing the target equation has an invisible side-effect on symex
(so that get_remaining_vccs()
reflects the result of slicing). That suggests moving this onto goto_symext
src/cbmc/bmc_util.h
Outdated
prop_convt &, | ||
message_handlert &); | ||
|
||
void report_failure(ui_message_handlert &); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these methods now have names that don't specify what they do that clearly, because they're no longer in bmct
. Move them into a namespace bmc_utilt
?
Maybe I was not sufficiently clear about the purpose of this PR: The point of this is to extract from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go on then
cd34e43
to
04822bd
Compare
This is an intermediate step in order to reuse the building blocks in the new implementation of bmct. The old implementation is functional until it can be replaced by the new one.
04822bd
to
c343989
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: c343989).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/96683683
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
This breaks up
bmct
into reusable pieces with side effects made explicit. Follow up PRs will transform this into a new modular implementation.Based on #3564
Review only the last 3 commits.