Skip to content

Commit 65524d5

Browse files
committed
Allow goto-synthesizer accept all CBMC options
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.
1 parent f33b96a commit 65524d5

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

doc/man/goto-synthesizer.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dump the synthesized loop contracts as JSON
2525
.TP
2626
\fB\-\-json-\output\fR \fIfile\fR
2727
specify the output destination of the loop-contracts JSON
28-
.SS "Backend options:"
28+
.SS "Accepts all of cbmc's options plus the following backend options:"
2929
.TP
3030
\fB\-\-object\-bits\fR n
3131
number of bits used for object addresses

src/goto-synthesizer/goto_synthesizer_parse_options.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ Author: Qinheping Hu
1414

1515
#include <goto-programs/read_goto_binary.h>
1616
#include <goto-programs/set_properties.h>
17+
#include <goto-programs/show_goto_functions.h>
18+
#include <goto-programs/show_properties.h>
1719
#include <goto-programs/write_goto_binary.h>
1820

1921
#include <ansi-c/gcc_version.h>
22+
#include <cbmc/cbmc_parse_options.h>
2023
#include <goto-instrument/contracts/contracts.h>
2124
#include <goto-instrument/nondet_volatile.h>
25+
#include <goto-instrument/reachability_slicer.h>
2226

2327
#include "enumerative_loop_contracts_synthesizer.h"
2428

@@ -29,6 +33,17 @@ Author: Qinheping Hu
2933
# include <util/unicode.h>
3034
#endif
3135

36+
goto_synthesizer_parse_optionst::goto_synthesizer_parse_optionst(
37+
int argc,
38+
const char **argv)
39+
: parse_options_baset(
40+
GOTO_SYNTHESIZER_OPTIONS CBMC_OPTIONS,
41+
argc,
42+
argv,
43+
"goto-synthesizer")
44+
{
45+
}
46+
3247
/// invoke main modules
3348
int goto_synthesizer_parse_optionst::doit()
3449
{
@@ -61,7 +76,7 @@ int goto_synthesizer_parse_optionst::doit()
6176
configure_gcc(gcc_version);
6277
}
6378

64-
// Get options and preprocess `goto_model`.
79+
// Get options for the backend verifier and preprocess `goto_model`.
6580
const auto &options = get_options();
6681

6782
// Synthesize loop invariants and annotate them into `goto_model`
@@ -237,7 +252,8 @@ void goto_synthesizer_parse_optionst::help()
237252
"\n"
238253
"Main options:\n" HELP_DUMP_LOOP_CONTRACTS HELP_LOOP_CONTRACTS_NO_UNWIND
239254
"\n"
240-
"Backend options:\n" HELP_CONFIG_BACKEND HELP_SOLVER
255+
"Accepts all of cbmc's options plus the following backend "
256+
"options:\n" HELP_CONFIG_BACKEND HELP_SOLVER
241257
"\n"
242258
" {y--arrays-uf-never} \t never turn arrays into uninterpreted functions\n"
243259
" {y--arrays-uf-always} \t always turn arrays into uninterpreted"

src/goto-synthesizer/goto_synthesizer_parse_options.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,7 @@ class goto_synthesizer_parse_optionst : public parse_options_baset
3838
int doit() override;
3939
void help() override;
4040

41-
goto_synthesizer_parse_optionst(int argc, const char **argv)
42-
: parse_options_baset(
43-
GOTO_SYNTHESIZER_OPTIONS,
44-
argc,
45-
argv,
46-
"goto-synthesizer")
47-
{
48-
}
41+
goto_synthesizer_parse_optionst(int argc, const char **argv);
4942

5043
protected:
5144
void register_languages() override;

src/goto-synthesizer/module_dependencies.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
analyses
22
ansi-c
33
assembler
4+
cbmc
45
cpp
56
goto-checker
67
goto-instrument

0 commit comments

Comments
 (0)