Loop abstraction [depends-on: #2707]#2871
Closed
zhixing-xu wants to merge 2 commits intodiffblue:developfrom
Closed
Loop abstraction [depends-on: #2707]#2871zhixing-xu wants to merge 2 commits intodiffblue:developfrom
zhixing-xu wants to merge 2 commits intodiffblue:developfrom
Conversation
Member
|
Thanks, @zhixing-xu for your contribution. While we are going to review this in more detail, could you please the compilation, linting and formatting errors?
|
08c2ec0 to
805dc55
Compare
26e58d7 to
35eba37
Compare
When generating dependences for a parameter in a function call, its data dependence node is set to be the line this function call happens. The result is unrelated variables are pulled into the dependence chain. The fix does a 1-1 mapping between the symbols of function call parameters and the symbols of the arguments given for the call.
Enables proving properties in selected loops without having to unwind them. Based on "Property Checking Array Programs Using Loop Shrinking" by Shrawan Kumar, Amitabha Sanyal, Venkatesh R and Punit Shah, TACAS 2018.
35eba37 to
ea8504e
Compare
Contributor
|
Closing due to age (no further comment on PR content), please reopen with rebase on develop if you intent to continue this work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two flags '--abstract-loops', '--abstractset' are added into goto-instrument and cbmc to support automated loop abstraction for given program.
The goal of this loop abstraction method is to prove memory safety in specific loops without having to unwind them.
If memory safety assertions in a loop are only decided by the loop variables and values unchanged in the loop, and the assertions outside the loop does not depend on loop contents; the loop could be reduced into 1 iteration (shrinkable), by making the loop variables nondet with constraints inflicted by the loop condition. As illustrated in the following example:
Original code:
After abstraction
'--abstract-loops' enables the method and '--abstractset' allows user to specify loops to be reduced. The method first check if the loops follow the property that allows them to be abstracted by analyzing the data dependence of the loop variables and assertions. For the loops following the property, it proceeds to do the abstraction on them.
This PR also includes #2707, which gives more accurate data dependency through function calls, thus helping decide the loop shrinkability problem better.
It would beneficial to also include #2646, #2694, they give more accurate data dependency for dynamic objects. The regression test abstract-loops3 would pass with these patches.