Skip to content

Commit e0656e2

Browse files
authored
Merge pull request #7900 from qinheping/features/synthesizer-cbmc-args
SYNTHESIZER: Allow goto-synthesizer accept all CBMC options
2 parents faa3144 + b1e19b9 commit e0656e2

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
@@ -15,17 +15,32 @@ Author: Qinheping Hu
1515

1616
#include <goto-programs/read_goto_binary.h>
1717
#include <goto-programs/set_properties.h>
18+
#include <goto-programs/show_goto_functions.h>
19+
#include <goto-programs/show_properties.h>
1820
#include <goto-programs/write_goto_binary.h>
1921

2022
#include <ansi-c/gcc_version.h>
23+
#include <cbmc/cbmc_parse_options.h>
2124
#include <goto-instrument/contracts/contracts.h>
2225
#include <goto-instrument/nondet_volatile.h>
26+
#include <goto-instrument/reachability_slicer.h>
2327

2428
#include "enumerative_loop_contracts_synthesizer.h"
2529

2630
#include <fstream>
2731
#include <iostream>
2832

33+
goto_synthesizer_parse_optionst::goto_synthesizer_parse_optionst(
34+
int argc,
35+
const char **argv)
36+
: parse_options_baset(
37+
GOTO_SYNTHESIZER_OPTIONS CBMC_OPTIONS,
38+
argc,
39+
argv,
40+
"goto-synthesizer")
41+
{
42+
}
43+
2944
/// invoke main modules
3045
int goto_synthesizer_parse_optionst::doit()
3146
{
@@ -58,7 +73,7 @@ int goto_synthesizer_parse_optionst::doit()
5873
configure_gcc(gcc_version);
5974
}
6075

61-
// Get options and preprocess `goto_model`.
76+
// Get options for the backend verifier and preprocess `goto_model`.
6277
const auto &options = get_options();
6378

6479
// Synthesize loop invariants and annotate them into `goto_model`
@@ -231,7 +246,8 @@ void goto_synthesizer_parse_optionst::help()
231246
"\n"
232247
"Main options:\n" HELP_DUMP_LOOP_CONTRACTS HELP_LOOP_CONTRACTS_NO_UNWIND
233248
"\n"
234-
"Backend options:\n" HELP_CONFIG_BACKEND HELP_SOLVER
249+
"Accepts all of cbmc's options plus the following backend "
250+
"options:\n" HELP_CONFIG_BACKEND HELP_SOLVER
235251
"\n"
236252
" {y--arrays-uf-never} \t never turn arrays into uninterpreted functions\n"
237253
" {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)