Skip to content

Commit 3f255b2

Browse files
Merge pull request #2388 from peterschrammel/improve-jbmc-options
Improve JBMC command line options
2 parents 0d7a943 + 0a10bf3 commit 3f255b2

File tree

44 files changed

+115
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+115
-74
lines changed

jbmc/regression/jbmc-strings/StringEquals/test_verify.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
KNOWNBUG
22
Test.class
3-
--refine-strings --string-max-input-length 5 --string-max-length 100 --unwind 10 --function Test.verify --java-throw-runtime-exceptions
3+
--refine-strings --string-max-input-length 5 --string-max-length 100 --unwind 10 --function Test.verify --throw-runtime-exceptions
44
^EXIT=0$
55
^SIGNAL=0$
66
assertion at file Test.java line 60 .* SUCCESS

jbmc/regression/jbmc-strings/StringLastIndexOf/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--function Test.check --refine-strings --string-max-length 100
3+
--function Test.check --refine-strings --string-max-input-length 100
44
^EXIT=10$
55
^SIGNAL=0$
66
assertion at file Test.java line 11 .* SUCCESS$

jbmc/regression/jbmc-strings/char_escape/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Test.class
33
--refine-strings --function Test.test --cover location --trace --json-ui
44
^EXIT=0$
55
^SIGNAL=0$
6-
20 of 23 covered \(87.0%\)|30 of 44 covered \(68.2%\)
6+
20 of 22 covered \(90.9%\)|30 of 44 covered \(68.2%\)

jbmc/regression/jbmc/ArithmeticException1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArithmeticExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ArithmeticExceptionTest.java line 8 function.*: FAILURE$

jbmc/regression/jbmc/ArithmeticException2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArithmeticExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ArithmeticExceptionTest.java line 9 function.*: FAILURE$

jbmc/regression/jbmc/ArithmeticException3/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArithmeticExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ArithmeticExceptionTest.java line 8 function.*: FAILURE$

jbmc/regression/jbmc/ArithmeticException4/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArithmeticExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ArithmeticExceptionTest.java line 9 function.*: FAILURE$

jbmc/regression/jbmc/ArithmeticException5/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArithmeticExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL

jbmc/regression/jbmc/ArithmeticException6/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArithmeticExceptionTest.class
3-
--java-throw-runtime-exceptions --function ArithmeticExceptionTest.main
3+
--throw-runtime-exceptions --function ArithmeticExceptionTest.main
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ArithmeticExceptionTest.java line 7 function.*: FAILURE$

jbmc/regression/jbmc/ArithmeticException7/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArithmeticExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ArithmeticExceptionTest.java line 8 function.*: FAILURE$

jbmc/regression/jbmc/ArrayIndexOutOfBoundsException1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArrayIndexOutOfBoundsExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ArrayIndexOutOfBoundsExceptionTest.java line 8 function.*: FAILURE$

jbmc/regression/jbmc/ArrayIndexOutOfBoundsException2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArrayIndexOutOfBoundsExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ArrayIndexOutOfBoundsExceptionTest.java line 8 function.*: FAILURE$

jbmc/regression/jbmc/ArrayIndexOutOfBoundsException3/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArrayIndexOutOfBoundsExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ArrayIndexOutOfBoundsExceptionTest.java line 8 function.*: FAILURE$

jbmc/regression/jbmc/ClassCastException1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ClassCastExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ClassCastExceptionTest.java line 8 function.*: FAILURE$

jbmc/regression/jbmc/ClassCastException2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ClassCastExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

jbmc/regression/jbmc/ClassCastException3/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ClassCastExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ClassCastExceptionTest.java line 12 function.*: FAILURE$

jbmc/regression/jbmc/NegativeArraySizeException1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
NegativeArraySizeExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file NegativeArraySizeExceptionTest.java line 7 function.*: FAILURE$

jbmc/regression/jbmc/NegativeArraySizeException2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
NegativeArraySizeExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file NegativeArraySizeExceptionTest.java line 7 function.*: FAILURE$

jbmc/regression/jbmc/NullPointerException2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file Test.java line 14 function.*: FAILURE$

jbmc/regression/jbmc/NullPointerException3/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file Test.java line 14 function.*: FAILURE$

jbmc/regression/jbmc/NullPointerException4/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--java-throw-runtime-exceptions
3+
--throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file Test.java line 12 function.*: FAILURE$

jbmc/regression/jbmc/annotations1/show_annotation_symbol.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
annotations.class
3-
--verbosity 10 --show-symbol-table --function annotations.main
3+
--no-lazy-methods --verbosity 10 --show-symbol-table --function annotations.main
44
^EXIT=0$
55
^SIGNAL=0$
66
^Type\.\.\.\.\.\.\.\.: @java::ClassAnnotation struct annotations

jbmc/regression/jbmc/cast_null2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--java-throw-runtime-exceptions --function test.main
3+
--throw-runtime-exceptions --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

jbmc/regression/jbmc/coreModels/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--show-symbol-table --cp ../../../src/java_bytecode/library/core-models.jar:.
3+
--no-lazy-methods --no-refine-strings --show-symbol-table --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar`
44
^EXIT=0$
55
^SIGNAL=0$
66
^Symbol\s*\.*\: java\:\:org\.cprover\.CProver\.\<init\>\:\(\)V$

jbmc/regression/jbmc/exceptions21/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--function test.f --java-throw-runtime-exceptions
3+
--function test.f --throw-runtime-exceptions
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL

jbmc/regression/jbmc/exceptions23/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--java-throw-runtime-exceptions --function test.main
3+
--throw-runtime-exceptions --function test.main
44
^EXIT=10$
55
^SIGNAL=0$
66
VERIFICATION FAILED

jbmc/regression/jbmc/exceptions24/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--java-throw-runtime-exceptions --function test.main
3+
--throw-runtime-exceptions --function test.main
44
^EXIT=10$
55
^SIGNAL=0$
66
VERIFICATION FAILED

jbmc/regression/jbmc/generic_class_bound1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE symex-driven-lazy-loading-expected-failure
22
Gn.class
3-
--cover location
3+
--cover location --no-lazy-methods --no-refine-strings
44
^EXIT=0$
55
^SIGNAL=0$
66
.*file Gn.java line 6 function java::Gn.\<init\>:\(\)V bytecode-index 1 block .: FAILED

jbmc/regression/jbmc/lambda2/test_no_crash.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE symex-driven-lazy-loading-expected-failure
22
SymStream.class
3-
--verbosity 10 --show-goto-functions
3+
--no-lazy-methods --verbosity 10 --show-goto-functions
44
^EXIT=0
55
^SIGNAL=0
66
--

jbmc/regression/jbmc/lazyloading_synthetic_method_cleanup1/check_clinit_normally_present.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
3-
--show-goto-functions --function Test.main
3+
--no-lazy-methods --show-goto-functions --function Test.main
44
java::Unused::clinit_wrapper
55
Unused\.<clinit>\(\)
66
^EXIT=0$

jbmc/regression/jbmc/lazyloading_synthetic_method_cleanup2/check_clinit_normally_present.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
3-
--show-goto-functions --function Test.main
3+
--no-lazy-methods --show-goto-functions --function Test.main
44
java::Unused1::clinit_wrapper
55
java::Unused2::clinit_wrapper
66
Unused2\.<clinit>\(\)

jbmc/regression/jbmc/lazyloading_synthetic_method_cleanup3/check_clinit_normally_present.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
3-
--show-goto-functions --function Test.main
3+
--no-lazy-methods --show-goto-functions --function Test.main
44
java::Opaque\.<clinit>:\(\)V
55
java::Opaque::clinit_wrapper
66
^EXIT=0$

jbmc/regression/jbmc/lvt-groovy/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE symex-driven-lazy-loading-expected-failure
22
DetectSplitPackagesTask.class
3-
--show-symbol-table
3+
--show-symbol-table --no-lazy-methods --no-refine-strings
44
^EXIT=0$
55
^SIGNAL=0$
66
--

jbmc/regression/jbmc/no-main-int-array-maybe-null1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Main.class
3-
--function Main.main --java-throw-runtime-exceptions
3+
--function Main.main --throw-runtime-exceptions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$

jbmc/regression/jbmc/package_friendly1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE symex-driven-lazy-loading-expected-failure
22
main.class
3-
--java-load-class package_friendly1 --java-load-class package_friendly2 --show-goto-functions
3+
--no-lazy-methods --java-load-class package_friendly1 --java-load-class package_friendly2 --show-goto-functions
44
^main[.]main[\(].*[\)].*$
55
^package_friendly2[.]operation2[\(][\)].*$
66
^EXIT=0$

jbmc/regression/jbmc/provide_object_implementation/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE symex-driven-lazy-loading-expected-failure
22
java/lang/Object.class
3-
3+
--no-lazy-methods
44
^EXIT=6$
55
^SIGNAL=0$
66
^the program has no entry point$

jbmc/regression/strings-smoke-tests/java_append_string/test_substring.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test_append_string.class
3-
--refine-strings --string-max-length 10 --function test_append_string.check --java-assume-inputs-non-null
3+
--refine-strings --string-max-input-length 10 --function test_append_string.check --java-assume-inputs-non-null
44
^EXIT=10$
55
^SIGNAL=0$
66
^\[.*assertion.*\].* line 22.* SUCCESS$

jbmc/src/java_bytecode/java_bytecode_language.cpp

+33-11
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,54 @@ Author: Daniel Kroening, [email protected]
4545
void java_bytecode_languaget::get_language_options(const cmdlinet &cmd)
4646
{
4747
assume_inputs_non_null=cmd.isset("java-assume-inputs-non-null");
48-
string_refinement_enabled=cmd.isset("refine-strings");
49-
throw_runtime_exceptions=cmd.isset("java-throw-runtime-exceptions");
48+
string_refinement_enabled = !cmd.isset("no-refine-strings");
49+
throw_runtime_exceptions =
50+
cmd.isset("java-throw-runtime-exceptions") || // will go away
51+
cmd.isset("throw-runtime-exceptions");
5052
assert_uncaught_exceptions = !cmd.isset("disable-uncaught-exception-check");
5153
throw_assertion_error = cmd.isset("throw-assertion-error");
5254
threading_support = cmd.isset("java-threading");
5355

54-
if(cmd.isset("java-max-input-array-length"))
55-
object_factory_parameters.max_nondet_array_length=
56+
if(cmd.isset("java-max-input-array-length")) // will go away
57+
{
58+
object_factory_parameters.max_nondet_array_length =
5659
safe_string2size_t(cmd.get_value("java-max-input-array-length"));
57-
if(cmd.isset("java-max-input-tree-depth"))
58-
object_factory_parameters.max_nondet_tree_depth=
60+
}
61+
if(cmd.isset("max-nondet-array-length"))
62+
{
63+
object_factory_parameters.max_nondet_array_length =
64+
safe_string2size_t(cmd.get_value("max-nondet-array-length"));
65+
}
66+
67+
if(cmd.isset("java-max-input-tree-depth")) // will go away
68+
{
69+
object_factory_parameters.max_nondet_tree_depth =
5970
safe_string2size_t(cmd.get_value("java-max-input-tree-depth"));
60-
if(cmd.isset("string-max-input-length"))
61-
object_factory_parameters.max_nondet_string_length=
71+
}
72+
if(cmd.isset("max-nondet-tree-depth"))
73+
{
74+
object_factory_parameters.max_nondet_tree_depth =
75+
safe_string2size_t(cmd.get_value("max-nondet-tree-depth"));
76+
}
77+
78+
if(cmd.isset("string-max-input-length")) // will go away
79+
{
80+
object_factory_parameters.max_nondet_string_length =
6281
safe_string2size_t(cmd.get_value("string-max-input-length"));
63-
else if(cmd.isset("string-max-length"))
82+
}
83+
if(cmd.isset("max-nondet-string-length"))
84+
{
6485
object_factory_parameters.max_nondet_string_length =
65-
safe_string2size_t(cmd.get_value("string-max-length"));
86+
safe_string2size_t(cmd.get_value("max-nondet-string-length"));
87+
}
6688

6789
object_factory_parameters.string_printable = cmd.isset("string-printable");
6890
if(cmd.isset("java-max-vla-length"))
6991
max_user_array_length =
7092
safe_string2size_t(cmd.get_value("java-max-vla-length"));
7193
if(cmd.isset("symex-driven-lazy-loading"))
7294
lazy_methods_mode=LAZY_METHODS_MODE_EXTERNAL_DRIVER;
73-
else if(cmd.isset("lazy-methods"))
95+
else if(!cmd.isset("no-lazy-methods"))
7496
lazy_methods_mode=LAZY_METHODS_MODE_CONTEXT_INSENSITIVE;
7597
else
7698
lazy_methods_mode=LAZY_METHODS_MODE_EAGER;

0 commit comments

Comments
 (0)