Skip to content

Commit a0c45f4

Browse files
Factor out show properties command line def and docs
to avoid repetition across the CPROVER tools
1 parent 937b5f9 commit a0c45f4

10 files changed

+38
-13
lines changed

src/cbmc/cbmc_parse_options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ void cbmc_parse_optionst::help()
924924
" cbmc file.c ... source file names\n"
925925
"\n"
926926
"Analysis options:\n"
927-
" --show-properties show the properties, but don't run analysis\n" // NOLINT(*)
927+
HELP_SHOW_PROPERTIES
928928
" --symex-coverage-report f generate a Cobertura XML coverage report in f\n" // NOLINT(*)
929929
" --property id only check one specific property\n"
930930
" --stop-on-fail stop analysis once a failed property is detected\n" // NOLINT(*)

src/cbmc/cbmc_parse_options.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ class optionst;
5353
"(aig)(16)(32)(64)(LP64)(ILP64)(LLP64)(ILP32)(LP32)" \
5454
"(little-endian)(big-endian)" \
5555
OPT_SHOW_GOTO_FUNCTIONS \
56+
OPT_SHOW_PROPERTIES \
5657
"(show-loops)" \
5758
"(show-symbol-table)(show-parse-tree)(show-vcc)" \
58-
"(show-claims)(claim):(show-properties)" \
5959
"(drop-unused-functions)" \
6060
"(property):(stop-on-fail)(trace)" \
6161
"(error-label):(verbosity):(no-library)" \
@@ -72,7 +72,7 @@ class optionst;
7272
"(graphml-witness):" \
7373
"(localize-faults)(localize-faults-method):" \
7474
OPT_GOTO_TRACE \
75-
"(fixedbv)(floatbv)(all-claims)(all-properties)" // legacy, and will eventually disappear // NOLINT(whitespace/line_length)
75+
"(claim):(show-claims)(fixedbv)(floatbv)(all-claims)(all-properties)" // legacy, and will eventually disappear // NOLINT(whitespace/line_length)
7676
// clang-format on
7777

7878
class cbmc_parse_optionst:

src/clobber/clobber_parse_options.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,27 @@ Author: Daniel Kroening, [email protected]
1919

2020
#include <analyses/goto_check.h>
2121
#include <goto-programs/show_goto_functions.h>
22+
#include <goto-programs/show_properties.h>
2223

2324
#include <java_bytecode/java_bytecode_language.h>
2425

2526
class goto_functionst;
2627
class optionst;
2728

29+
// clang-format off
2830
#define CLOBBER_OPTIONS \
2931
"(depth):(context-bound):(unwind):" \
3032
OPT_GOTO_CHECK \
3133
OPT_SHOW_GOTO_FUNCTIONS \
34+
OPT_SHOW_PROPERTIES \
3235
"(no-assertions)(no-assumptions)" \
3336
"(error-label):(verbosity):(no-library)" \
3437
"(version)" \
3538
"(string-abstraction)" \
36-
"(show-locs)(show-vcc)(show-properties)(show-trace)" \
39+
"(show-locs)(show-vcc)(show-trace)" \
3740
"(property):" \
3841
JAVA_BYTECODE_LANGUAGE_OPTIONS
42+
// clang-format on
3943

4044
class clobber_parse_optionst:
4145
public parse_options_baset,

src/goto-analyzer/goto_analyzer_parse_options.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,7 @@ void goto_analyzer_parse_optionst::help()
815815

816816
std::cout << " * *\n";
817817

818+
// clang-format off
818819
std::cout <<
819820
"* * Daniel Kroening, DiffBlue * *\n"
820821
"* * [email protected] * *\n"
@@ -898,8 +899,7 @@ void goto_analyzer_parse_optionst::help()
898899
" --show-parse-tree show parse tree\n"
899900
" --show-symbol-table show symbol table\n"
900901
HELP_SHOW_GOTO_FUNCTIONS
901-
// NOLINTNEXTLINE(whitespace/line_length)
902-
" --show-properties show the properties, but don't run analysis\n"
902+
HELP_SHOW_PROPERTIES
903903
"\n"
904904
"Program instrumentation options:\n"
905905
HELP_GOTO_CHECK
@@ -908,4 +908,5 @@ void goto_analyzer_parse_optionst::help()
908908
" --version show version and exit\n"
909909
HELP_TIMESTAMP
910910
"\n";
911+
// clang-format on
911912
}

src/goto-analyzer/goto_analyzer_parse_options.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Author: Daniel Kroening, [email protected]
109109

110110
#include <goto-programs/goto_model.h>
111111
#include <goto-programs/show_goto_functions.h>
112+
#include <goto-programs/show_properties.h>
112113

113114
#include <analyses/ai.h>
114115
#include <analyses/goto_check.h>
@@ -119,17 +120,19 @@ class bmct;
119120
class goto_functionst;
120121
class optionst;
121122

123+
// clang-format off
122124
#define GOTO_ANALYSER_OPTIONS \
123125
OPT_FUNCTIONS \
124126
"D:I:(std89)(std99)(std11)" \
125127
"(classpath):(cp):(main-class):" \
126128
"(16)(32)(64)(LP64)(ILP64)(LLP64)(ILP32)(LP32)" \
127129
"(little-endian)(big-endian)" \
128130
OPT_SHOW_GOTO_FUNCTIONS \
131+
OPT_SHOW_PROPERTIES \
129132
OPT_GOTO_CHECK \
130133
"(show-loops)" \
131134
"(show-symbol-table)(show-parse-tree)" \
132-
"(show-properties)(show-reachable-properties)(property):" \
135+
"(show-reachable-properties)(property):" \
133136
"(verbosity):(version)" \
134137
"(gcc)(arch):" \
135138
"(taint):(show-taint)" \
@@ -147,6 +150,7 @@ class optionst;
147150
"(location-sensitive)(concurrent)" \
148151
"(no-simplify-slicing)" \
149152
JAVA_BYTECODE_LANGUAGE_OPTIONS
153+
// clang-format on
150154

151155
class goto_analyzer_parse_optionst:
152156
public parse_options_baset,

src/goto-instrument/goto_instrument_parse_options.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,7 @@ void goto_instrument_parse_optionst::instrument_goto_program()
14521452
/// display command line help
14531453
void goto_instrument_parse_optionst::help()
14541454
{
1455+
// clang-format off
14551456
std::cout <<
14561457
"\n"
14571458
"* * Goto-Instrument " CBMC_VERSION " - Copyright (C) 2008-2013 * *\n" // NOLINT(*)
@@ -1475,7 +1476,7 @@ void goto_instrument_parse_optionst::help()
14751476
"\n"
14761477
"Diagnosis:\n"
14771478
" --show-loops show the loops in the program\n"
1478-
" --show-properties show the properties\n"
1479+
HELP_SHOW_PROPERTIES
14791480
" --show-symbol-table show symbol table\n"
14801481
" --list-symbols list symbols with type information\n"
14811482
HELP_SHOW_GOTO_FUNCTIONS
@@ -1570,4 +1571,5 @@ void goto_instrument_parse_optionst::help()
15701571
" --json-ui use JSON-formatted output\n"
15711572
HELP_TIMESTAMP
15721573
"\n";
1574+
// clang-format on
15731575
}

src/goto-instrument/goto_instrument_parse_options.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ Author: Daniel Kroening, [email protected]
1818

1919
#include <goto-programs/goto_functions.h>
2020
#include <goto-programs/show_goto_functions.h>
21+
#include <goto-programs/show_properties.h>
2122
#include <goto-programs/remove_const_function_pointers.h>
2223

2324
#include <analyses/goto_check.h>
2425

26+
// clang-format off
2527
#define GOTO_INSTRUMENT_OPTIONS \
2628
"(all)" \
2729
"(document-claims-latex)(document-claims-html)" \
@@ -51,6 +53,7 @@ Author: Daniel Kroening, [email protected]
5153
"(stack-depth):(nondet-static)" \
5254
"(function-enter):(function-exit):(branch):" \
5355
OPT_SHOW_GOTO_FUNCTIONS \
56+
OPT_SHOW_PROPERTIES \
5457
"(drop-unused-functions)" \
5558
"(show-value-sets)" \
5659
"(show-global-may-alias)" \
@@ -64,7 +67,7 @@ Author: Daniel Kroening, [email protected]
6467
OPT_REMOVE_CONST_FUNCTION_POINTERS \
6568
"(print-internal-representation)" \
6669
"(remove-function-pointers)" \
67-
"(show-claims)(show-properties)(property):" \
70+
"(show-claims)(property):" \
6871
"(show-symbol-table)(show-points-to)(show-rw-set)" \
6972
"(cav11)" \
7073
OPT_TIMESTAMP \
@@ -81,8 +84,8 @@ Author: Daniel Kroening, [email protected]
8184
"(show-threaded)(list-calls-args)(print-path-lengths)" \
8285
"(undefined-function-is-assume-false)" \
8386
"(remove-function-body):"\
84-
"(splice-call):" \
85-
87+
"(splice-call):"
88+
// clang-format on
8689

8790
class goto_instrument_parse_optionst:
8891
public parse_options_baset,

src/goto-programs/show_properties.h

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ class goto_programt;
2222
class goto_functionst;
2323
class message_handlert;
2424

25+
// clang-format off
26+
#define OPT_SHOW_PROPERTIES \
27+
"(show-properties)"
28+
29+
#define HELP_SHOW_PROPERTIES \
30+
" --show-properties show the properties, but don't run analysis\n" // NOLINT(*)
31+
// clang-format on
32+
2533
void show_properties(
2634
const goto_modelt &,
2735
message_handlert &message_handler,

src/jbmc/jbmc_parse_options.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ void jbmc_parse_optionst::help()
878878

879879
std::cout << " * *\n";
880880

881+
// clang-format off
881882
std::cout <<
882883
"* * Daniel Kroening, Edmund Clarke * *\n"
883884
"* * Carnegie Mellon University, Computer Science Department * *\n"
@@ -889,7 +890,7 @@ void jbmc_parse_optionst::help()
889890
" jbmc class name of class to be checked\n"
890891
"\n"
891892
"Analysis options:\n"
892-
" --show-properties show the properties, but don't run analysis\n" // NOLINT(*)
893+
HELP_SHOW_PROPERTIES
893894
" --symex-coverage-report f generate a Cobertura XML coverage report in f\n" // NOLINT(*)
894895
" --property id only check one specific property\n"
895896
" --stop-on-fail stop analysis once a failed property is detected\n" // NOLINT(*)
@@ -962,4 +963,5 @@ void jbmc_parse_optionst::help()
962963
" --verbosity # verbosity level\n"
963964
HELP_TIMESTAMP
964965
"\n";
966+
// clang-format on
965967
}

src/jbmc/jbmc_parse_options.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Author: Daniel Kroening, [email protected]
2222

2323
#include <goto-programs/goto_trace.h>
2424
#include <goto-programs/lazy_goto_model.h>
25+
#include <goto-programs/show_properties.h>
2526

2627
#include <java_bytecode/java_bytecode_language.h>
2728

@@ -55,7 +56,7 @@ class optionst;
5556
OPT_SHOW_GOTO_FUNCTIONS \
5657
"(show-loops)" \
5758
"(show-symbol-table)(show-parse-tree)(show-vcc)" \
58-
"(show-properties)" \
59+
OPT_SHOW_PROPERTIES \
5960
"(drop-unused-functions)" \
6061
"(property):(stop-on-fail)(trace)" \
6162
"(verbosity):" \

0 commit comments

Comments
 (0)