-
Notifications
You must be signed in to change notification settings - Fork 274
Incremental unwinding of one specified loop #4361
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
Changes from 1 commit
54d581b
452b524
1fb7d2d
73fb826
41d3864
7fbc6b0
2a7b16c
cef212c
4e894a4
d7581bd
30ca986
aa1389b
657a899
cc60ab3
f1af977
20613e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_test_pl_tests( | ||
"perl -e 'alarm shift @ARGV; exec @ARGV' 8 $<TARGET_FILE:cbmc> --slice-formula" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
CORE | ||
main.c | ||
--incremental-check main.0 --unwind-max 25 --no-unwinding-assertions | ||
--incremental-loop main.0 --unwind-max 15 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tests have been in the codebase without the actual implementation (= this PR). We decided to give the option a different name now. |
||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
CORE | ||
THOROUGH | ||
main.c | ||
--incremental-check main.0 | ||
^EXIT=142$ | ||
--incremental-loop main.0 --unwinding-assertions | ||
^EXIT=(142|14)$ | ||
^SIGNAL=0$ | ||
-- | ||
^warning: ignoring | ||
-- | ||
Tests whether goto-symex does not stop early. | ||
Mac OS exit code is 14 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
CORE | ||
THOROUGH | ||
main.c | ||
--incremental-check main.0 | ||
^EXIT=142$ | ||
--incremental-loop main.0 --unwinding-assertions | ||
^EXIT=(142|14)$ | ||
^SIGNAL=0$ | ||
-- | ||
^warning: ignoring | ||
-- | ||
Tests whether goto-symex does not stop early when it cannot figure out the | ||
loop bound and there is no error in the loop. | ||
Mac OS exit code is 14 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are the exit codes different? Is the exit code not under our control in this situation? What process is receiving the SIGALRM - perl, or cbmc? or something else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perl - the exit codes seem to be different on linux vs mac os. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
extern int nondet_int(); | ||
int main() | ||
{ | ||
int x = nondet_int(); | ||
__CPROVER_assume(0 <= x && x <= 1); | ||
while(1) // main.0 | ||
{ | ||
if(nondet_int()) | ||
break; | ||
} | ||
while(x < 4) // main.1 | ||
{ | ||
x = x + 1; | ||
assert(x < 4); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CORE | ||
main.c | ||
--incremental-loop main.1 --unwind 2 | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
^VERIFICATION FAILED$ | ||
^Not unwinding loop main\.0 iteration 2 | ||
^Unwinding loop main\.1 iteration 3 | ||
-- | ||
^warning: ignoring | ||
-- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
extern int nondet_int(); | ||
int main() | ||
{ | ||
int x = nondet_int(); | ||
__CPROVER_assume(0 <= x && x <= 1); | ||
int y = 0; | ||
while(y < 5) // main.0 | ||
{ | ||
y++; | ||
if(nondet_int()) | ||
break; | ||
} | ||
while(1) // main.1 | ||
{ | ||
if(nondet_int()) | ||
break; | ||
} | ||
while(x < 4) // main.3 | ||
{ | ||
while(1) // main.2 | ||
{ | ||
if(nondet_int()) | ||
break; | ||
} | ||
x = x + 1; | ||
assert(x < 4); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CORE | ||
main.c | ||
--incremental-loop main.3 --unwindset main.1:2,main.2:8 | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
^VERIFICATION FAILED$ | ||
^Unwinding loop main\.0 iteration 5 | ||
^Not unwinding loop main\.1 iteration 2 | ||
^Not unwinding loop main\.2 iteration 8 | ||
^Unwinding loop main\.3 iteration 3 | ||
-- | ||
^warning: ignoring | ||
^Unwinding loop main\.0 iteration 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a
perl -e
wrapper for those tests?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the timeout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a comment would be nice to have.