Skip to content
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

Generating precise modifies clauses #245

Open
zvonimir opened this issue Jul 6, 2017 · 6 comments
Open

Generating precise modifies clauses #245

zvonimir opened this issue Jul 6, 2017 · 6 comments
Assignees

Comments

@zvonimir
Copy link
Member

zvonimir commented Jul 6, 2017

It would be good for SMACK to actually generate precise modifies clauses, instead of relying on a back-end verifier to support inference of modified globals.
The way I see it, there are two ways one could go about implementing this feature:

  1. Gather modified variables while building Boogie ASTs
  2. Gather modified variables during a separate dedicated post-processing pass
    The advantage of the first one is that we do not have to scan the code twice, but on the other hand it would introduce these cross-cutting additions all over the place. The advantage of the second one is that the code would be nice and contained, but on the other hand it would scan the code again.
    Let's discuss this a little bit and decide how to go about implementing it.
@zvonimir
Copy link
Member Author

zvonimir commented Jul 6, 2017

@michael-emmi : Thoughts? Thx!

@michael-emmi
Copy link
Contributor

Between the two, I think the second is preferable. Don’t forget that besides a linear-time intra-procedural code scan to determine the variables modified directly by each function, you’d still need another (possibly more asymptotically expensive?) inter-procedural pass to propagate transitively-modified variables. So the possible savings with Option 1 may be insignificant in the grand scheme of things.

I am missing a basic premise though: are there back-end verifiers besides Boogie that require modifies-clause annotation? and what’s so bad about relying on Boogie to do the annotation?

@zvonimir
Copy link
Member Author

UltimateAtomizer requires for modifies clauses to be there. In addition, currently we are not really generating legal Boogie programs (based on the language spec). I think it would be good to fix that, meaning that I think that SMACK should always generate legal Boogie programs.

@lzbaer
Copy link

lzbaer commented Dec 12, 2018

Just wanted to bump this, currently running into this issue. Has this been implemented? If not, could you point me in the direction of where in the code I could look to start implementing it as in option 2?

@liammachado
Copy link
Contributor

I implemented this over a year ago; it's currently an open pull request:
#267

@lzbaer
Copy link

lzbaer commented Dec 14, 2018

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants