[CONTRACTS] DFCC loop assigns infererence with functions inlined#8490
[CONTRACTS] DFCC loop assigns infererence with functions inlined#8490qinheping merged 2 commits intodiffblue:developfrom
Conversation
9343bb6 to
09a3899
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8490 +/- ##
===========================================
- Coverage 78.90% 78.80% -0.11%
===========================================
Files 1727 1727
Lines 198425 198785 +360
Branches 18523 18529 +6
===========================================
+ Hits 156561 156643 +82
- Misses 41864 42142 +278 ☔ View full report in Codecov by Sentry. |
09a3899 to
45d7ad7
Compare
src/goto-instrument/contracts/dynamic-frames/dfcc_infer_loop_assigns.cpp
Show resolved
Hide resolved
cea198b to
0444fad
Compare
|
We also switch to a more aggressive loop-assigns widening strategy that also widens all dereference to whole object. The reason to do so is that it fits better for Kani loop contracts, while we have a good loop assigns specification support for C loop contracts for which the inference is less needed. |
|
|
||
| for(unsigned i = 0; i < SIZE; i++) | ||
| __CPROVER_loop_invariant(i <= SIZE) | ||
| __CPROVER_assigns(data[1], i) __CPROVER_loop_invariant(i <= SIZE) |
There was a problem hiding this comment.
Is this change now strictly necessary given the additional widening?
There was a problem hiding this comment.
Yes, new addition widening will infer object_whole(data), i which is not accurate for this test.
src/goto-instrument/contracts/dynamic-frames/dfcc_infer_loop_assigns.cpp
Outdated
Show resolved
Hide resolved
src/goto-instrument/contracts/dynamic-frames/dfcc_infer_loop_assigns.cpp
Outdated
Show resolved
Hide resolved
src/goto-instrument/contracts/dynamic-frames/dfcc_infer_loop_assigns.cpp
Outdated
Show resolved
Hide resolved
src/goto-instrument/contracts/dynamic-frames/dfcc_infer_loop_assigns.cpp
Show resolved
Hide resolved
src/goto-instrument/contracts/dynamic-frames/dfcc_infer_loop_assigns.cpp
Show resolved
Hide resolved
src/goto-instrument/contracts/dynamic-frames/dfcc_infer_loop_assigns.cpp
Show resolved
Hide resolved
src/goto-instrument/contracts/dynamic-frames/dfcc_infer_loop_assigns.cpp
Show resolved
Hide resolved
src/goto-instrument/contracts/dynamic-frames/dfcc_infer_loop_assigns.cpp
Outdated
Show resolved
Hide resolved
0444fad to
0b7047f
Compare
0b7047f to
2317524
Compare
Current loop assigns inference of DFCC can only infer targets considering only instructions in the same function. However, variables may be written to in the call of another function from function call inside the loop. So in this PR, we infer loop assigns based on a copy of the function and inlining all calls in the copy.