Skip to content

Commit 0208218

Browse files
Merge pull request #1861 from peterschrammel/goto-diff-properties
Show properties for goto-diff
2 parents b36a90a + df9aab5 commit 0208218

24 files changed

+380
-171
lines changed
775 Bytes
Binary file not shown.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
public class Test {
2+
3+
private static Test static_test = null;
4+
private Test test = new Test();
5+
6+
public Test() {
7+
}
8+
9+
public int foo(int x) {
10+
if (x > 10) {
11+
return x;
12+
} else {
13+
return x * 10;
14+
}
15+
}
16+
17+
public void newfun() {
18+
}
19+
}
770 Bytes
Binary file not shown.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
public class Test {
2+
3+
private static Test static_test = new Test();
4+
private Test test = null;
5+
6+
public Test() {
7+
}
8+
9+
public int foo(int x) {
10+
if (x > 10) {
11+
return x;
12+
} else {
13+
return x * 10;
14+
}
15+
}
16+
17+
public void obsolete() {
18+
}
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
new.jar
3+
old.jar --json-ui --show-properties --cover location
4+
// Enable multi-line checking
5+
activate-multi-line-match
6+
EXIT=0
7+
SIGNAL=0
8+
"deletedFunctions": \[\n {\n "name": "java::Test\.obsolete:\(\)V",\n "properties": \[\n {\n "class": "coverage",\n "coveredLines": "18",\n "description": "block 1",\n "expression": "false",\n "name": "java::Test\.obsolete:\(\)V\.coverage\.1",\n "sourceLocation": {\n "bytecodeIndex": "0",\n "file": "Test\.java",\n "function": "java::Test\.obsolete:\(\)V",\n "line": "18"\n }\n }\n ],\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.obsolete:\(\)V",\n "line": "18"\n }\n }\n ],\n "modifiedFunctions": \[\n {\n "name": "java::Test\.<init>:\(\)V",\n "properties": \[\n {\n "class": "coverage",\n "coveredLines": "6",\n "description": "block 1",\n "expression": "false",\n "name": "java::Test\.<init>:\(\)V\.coverage\.1",\n "sourceLocation": {\n "bytecodeIndex": "1",\n "file": "Test\.java",\n "function": "java::Test\.<init>:\(\)V",\n "line": "6"\n }\n },\n {\n "class": "coverage",\n "coveredLines": "4",\n "description": "block 2",\n "expression": "false",\n "name": "java::Test\.<init>:\(\)V\.coverage\.2",\n "sourceLocation": {\n "bytecodeIndex": "3",\n "file": "Test\.java",\n "function": "java::Test\.<init>:\(\)V",\n "line": "4"\n }\n },\n {\n "class": "coverage",\n "coveredLines": "4",\n "description": "block 3",\n "expression": "false",\n "name": "java::Test\.<init>:\(\)V\.coverage\.3",\n "sourceLocation": {\n "bytecodeIndex": "5",\n "file": "Test\.java",\n "function": "java::Test\.<init>:\(\)V",\n "line": "4"\n }\n },\n {\n "class": "coverage",\n "coveredLines": "4,7",\n "description": "block 4",\n "expression": "false",\n "name": "java::Test\.<init>:\(\)V\.coverage\.4",\n "sourceLocation": {\n "bytecodeIndex": "6",\n "file": "Test\.java",\n "function": "java::Test\.<init>:\(\)V",\n "line": "4"\n }\n }\n ],\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.<init>:\(\)V",\n "line": "6"\n }\n },\n {\n "name": "java::Test\.<clinit>:\(\)V",\n "properties": \[\n {\n "class": "coverage",\n "coveredLines": "3",\n "description": "block 1",\n "expression": "false",\n "name": "java::Test\.<clinit>:\(\)V\.coverage\.1",\n "sourceLocation": {\n "bytecodeIndex": "1",\n "file": "Test\.java",\n "function": "java::Test\.<clinit>:\(\)V",\n "line": "3"\n }\n }\n ],\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.<clinit>:\(\)V",\n "line": "3"\n }\n }\n ],\n "newFunctions": \[\n {\n "name": "java::Test\.newfun:\(\)V",\n "properties": \[\n {\n "class": "coverage",\n "coveredLines": "18",\n "description": "block 1",\n "expression": "false",\n "name": "java::Test\.newfun:\(\)V\.coverage\.1",\n "sourceLocation": {\n "bytecodeIndex": "0",\n "file": "Test\.java",\n "function": "java::Test\.newfun:\(\)V",\n "line": "18"\n }\n }\n ],\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.newfun:\(\)V",\n "line": "18"\n }\n }\n ],\n
9+
--
10+
^warning: ignoring

src/cbmc/cbmc_parse_options.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ int cbmc_parse_optionst::doit()
534534
if(cmdline.isset("show-claims") || // will go away
535535
cmdline.isset("show-properties")) // use this one
536536
{
537-
show_properties(goto_model, ui_message_handler.get_ui());
537+
show_properties(
538+
goto_model, get_message_handler(), ui_message_handler.get_ui());
538539
return CPROVER_EXIT_SUCCESS;
539540
}
540541

@@ -923,7 +924,7 @@ void cbmc_parse_optionst::help()
923924
" cbmc file.c ... source file names\n"
924925
"\n"
925926
"Analysis options:\n"
926-
" --show-properties show the properties, but don't run analysis\n" // NOLINT(*)
927+
HELP_SHOW_PROPERTIES
927928
" --symex-coverage-report f generate a Cobertura XML coverage report in f\n" // NOLINT(*)
928929
" --property id only check one specific property\n"
929930
" --stop-on-fail stop analysis once a failed property is detected\n" // NOLINT(*)

src/cbmc/cbmc_parse_options.h

Lines changed: 2 additions & 2 deletions
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.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int clobber_parse_optionst::doit()
150150

151151
if(cmdline.isset("show-properties"))
152152
{
153-
show_properties(goto_model, get_ui());
153+
show_properties(goto_model, get_message_handler(), get_ui());
154154
return 0;
155155
}
156156

src/clobber/clobber_parse_options.h

Lines changed: 5 additions & 1 deletion
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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
592592

593593
if(cmdline.isset("show-properties"))
594594
{
595-
show_properties(goto_model, get_ui());
595+
show_properties(goto_model, get_message_handler(), get_ui());
596596
return CPROVER_EXIT_SUCCESS;
597597
}
598598

@@ -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
}

0 commit comments

Comments
 (0)