-
Notifications
You must be signed in to change notification settings - Fork 269
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
SYNTHESIZER: Allow goto-synthesizer accept all CBMC options #7900
SYNTHESIZER: Allow goto-synthesizer accept all CBMC options #7900
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #7900 +/- ##
========================================
Coverage 78.62% 78.62%
========================================
Files 1701 1700 -1
Lines 195974 195974
========================================
Hits 154086 154086
Misses 41888 41888
☔ View full report in Codecov by Sentry. |
7ea1ad2
to
7408ce3
Compare
if(strcmp(cbmc_args[0], "cbmc") != 0) | ||
{ | ||
throw invalid_command_line_argument_exceptiont( | ||
"cbmc-cmd must starts with cbmc, e.g., --cbmc-cmd \"cbmc [args]\"", |
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.
I don't have much background, but why not make the option --cbmc-options
instead to remove the need to specify cbmc
(which seems redundant?).
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.
goto-synthesizer
checks its arguments of that start with --
against the SYNTHEZIER_OPT
, and errors out if the argument is not matched any defined option. It will happen if some CBMC option is not one of the synthesizer options.
So we let the argument start with cbmc
instead to avoid the check.
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.
Doing string tokenisation and possibly having to deal with quoting/unquoting feels fragile. Could we please try a rather different approach:
- Move the implementation of
goto_synthesizer_parse_optionst::goto_synthesizer_parse_optionst(int argc, const char **argv)
togoto_synthesizer_parse_options.cpp
. - Keep
#include <cbmc/cbmc_parse_options.h>
as proposed in the current commit. - Use
GOTO_SYNTHESIZER_OPTIONS CBMC_OPTIONS
(no operator required between these) as the first argument togoto_synthesizer_parse_optionst::goto_synthesizer_parse_optionst
. - Now
goto-synthesizer
should just accept all of CBMC's options, and will continue to do so even when those change. We just need to find some good solution for the--help
output, perhaps just say "Accepts all of cbmc's options plus the following: ..."
7408ce3
to
65524d5
Compare
Thank you! I also updated the title and description of this PR. |
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.
Could you please re-add a test, if that's at all possible (i.e., if there is any new behaviour observable)?
With this commit, goto-synthesizer will accept all of CBMC options so that we don't need to update the backend options in goto-synthesizer when they are updated in CBMC_OPTION.
31b22af
to
b1e19b9
Compare
With this PR,
goto-synthesizer
will accept all of CBMC options so that we don't need to update the backend options ingoto-synthesizer
when they are updated inCBMC_OPTION
.