- 
                Notifications
    
You must be signed in to change notification settings  - Fork 286
 
[CONTRACTS] DFCC loop assigns infererence with functions inlined #8490
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change now strictly necessary given the additional widening?
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.
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.