Skip to content

Field sensitive goto-symex #2574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 16, 2019
6 changes: 4 additions & 2 deletions jbmc/regression/jbmc-generics/constant_propagation/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ Test.class
--function Test.main --show-vcc
^EXIT=0$
^SIGNAL=0$
^\{-\d+\} symex_dynamic::dynamic_object1#3 = \{ \{ \{ "java::GenericSub" \}, NULL, 0 \} \}$
^\{-\d+\} symex_dynamic::dynamic_object1#4 = \{ \{ \{ "java::GenericSub" \}, NULL, 5 \} \}$
^\{-\d+\} symex_dynamic::dynamic_object1#2 = \{ \{ \{ "java::GenericSub" \}, NULL, 0 \} \}$
^\{-\d+\} symex_dynamic::dynamic_object1#2\.\.@Generic\.\[email protected]\.\.@class_identifier = "java::GenericSub"$
^\{-\d+\} symex_dynamic::dynamic_object1#2\.\.@Generic\.\.key = NULL$
^\{-\d+\} symex_dynamic::dynamic_object1#3\.\.@Generic\.\.x = 5$
--
byte_extract_(big|little)_endian
--
Expand Down
2 changes: 0 additions & 2 deletions jbmc/regression/jbmc-strings/ClassName/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ test.class
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
\[java::test\.main:\(\)V\.assertion\.1\] line 5 assertion at file test\.java line 5 function java::test\.main:\(\)V bytecode-index 8: SUCCESS$
\[java::test\.main:\(\)V\.assertion\.2\] line 6 assertion at file test\.java line 6 function java::test\.main:\(\)V bytecode-index 19: SUCCESS$
2 changes: 1 addition & 1 deletion regression/cbmc-concurrency/norace_struct1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KNOWNBUG pthread
CORE pthread
main.c

^EXIT=0$
Expand Down
21 changes: 21 additions & 0 deletions regression/cbmc/Array_Propagation1/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <assert.h>

struct S
{
int a;
};

int main()
{
struct S s;
s.a = 1;

assert(s.a == 1);

int A[1];
A[0] = 1;

assert(A[0] == 1);

return 0;
}
13 changes: 13 additions & 0 deletions regression/cbmc/Array_Propagation1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
KNOWNBUG
main.c

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
(Starting CEGAR Loop|VCC\(s\), 0 remaining after simplification$)
--
^warning: ignoring
--
This requires field-sensitive SSA encoding of arrays to pass entirely via
constant propagation (changing the above condition to "1 remaining after
simplification" would also make it pass, but this isn't the point of the test).
34 changes: 34 additions & 0 deletions regression/cbmc/Struct_Propagation1/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
struct S
{
int v;
struct Inner
{
int x;
} inner;
};

struct S works;

int main()
{
struct S fails;

works.v = 2;
fails.v = 2;

while(works.v > 0)
--(works.v);

while(fails.v > 0)
--(fails.v);

__CPROVER_assert(works.inner.x == 0, "");

_Bool b;
if(b)
{
struct S s = {42, {42}};
}

return 0;
}
9 changes: 9 additions & 0 deletions regression/cbmc/Struct_Propagation1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
main.c
--unwind 5
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
(Starting CEGAR Loop|VCC\(s\), 0 remaining after simplification$)
--
^warning: ignoring
5 changes: 5 additions & 0 deletions regression/cbmc/variable-access-to-constant-array/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ main.c
^VERIFICATION FAILED$
--
^warning: ignoring
--
This test actually passes when using the SMT2 back-end, but takes 68 seconds to
do so.

Field-sensitive encoding of array accesses for an array of 2^16 elements is very
expensive. We might consider some bounds up to which we actually do field
expansion, or at least need to mark this test as "THOROUGH."
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
CORE
main.c
--harness-type call-function --max-nondet-tree-depth 4 --min-null-tree-depth 1 --function test_function
\[test_function.unwind.\d+\] line \d+ unwinding assertion loop 0: SUCCESS
\[test_function.unwind.\d+\] line \d+ unwinding assertion loop 1: SUCCESS
\[test_function.assertion.\d+\] line \d+ assertion list_walker->datum == \+\+i: SUCCESS
^EXIT=0$
^SIGNAL=0$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
CORE
main.c
--harness-type call-function --max-nondet-tree-depth 4 --min-null-tree-depth 1 --function test_function --nondet-globals
\[test_function.unwind.\d+\] line \d+ unwinding assertion loop 0: SUCCESS
\[test_function.unwind.\d+\] line \d+ unwinding assertion loop 1: SUCCESS
\[test_function.assertion.\d+\] line \d+ assertion list_walker->datum == \+\+i: SUCCESS
^EXIT=0$
^SIGNAL=0$
Expand Down
1 change: 1 addition & 0 deletions src/goto-symex/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SRC = auto_objects.cpp \
build_goto_trace.cpp \
field_sensitivity.cpp \
goto_state.cpp \
goto_symex.cpp \
goto_symex_state.cpp \
Expand Down
Loading