-
Notifications
You must be signed in to change notification settings - Fork 97
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
Integrate goto-synthesizer into Kani #2204
Conversation
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.
That's awesome! Thanks for adding this. I have a few questions:
- How does the loop synthesizer interacts with loop unwind argument?
- Is there anyway we can avoid the non-termination? Even if that means failing the synthesis?
- We need to add some documentation around this. I would suggest writing an RFC explaining the user experience, the value it adds and and its limitations.
Yes, in the Call-outs part of the PR description I introduced my plan to handle non-termination and how to deal with unwinding numbers. More comments about them are appropriated. And yes, I will create a RFC about it. |
I think an RFC will help. From what you described, there is a conflict between unwind and loop synthesis, at least for now. In this case, we should figure out what the message should be and how we handle a harness that is annotated with |
Is it possible to add tests? |
14f6680
to
e9605e1
Compare
I added two simple tests to check the synthesizer is correctly called and enumerates required loop invariants. More experiments are needed to see how the synthesizer works on more complicated tests. |
565205b
to
fee143d
Compare
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.
Awesome! Are you planning to add more tests to this feature? I think it would be nice to at least add tests where there are assertions inside the loop and test cases where the proof fails. I'm OK if you want to just create an issue for now and work on it later.
fee143d
to
ea87e59
Compare
Thank you Celina! Yes, I plan to add more tests. I am doing the experiment of running the synthesizer on all current Kani benchmarks, which will provide us better insight about what we can and cannot synthesize. I will create an issue and add tests when the experiment is done. |
63b374d
to
9626ade
Compare
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.
Thanks @qinheping!
28424bd
to
6dff259
Compare
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.
Thanks @qinheping! Please address any remaining comments from @celinval and wait for her approval before merging.
7aadedb
to
144faa0
Compare
a97d072
to
329c764
Compare
329c764
to
894e39b
Compare
Description of changes:
This PR integrate
goto-synthesizer
into Kani, and add an option to synthesize loop contracts for all loops.Resolved issues:
Resolves #2156
Call-outs:
The purpose of this PR is to allow us to experiment the loop-contracts synthesizer on Kani benchmarks. However, there are still a few issues we need to address with later PRs:
goto-synthesizer
side, we will add an option to limit the size of candidates we enumerate, so that it will not keep enumerating when there is no solution in the candidate space. On the Kani side, we can also add an option to limit the running time of the synthesizer.goto-synthesizer
. Then users can choose to synthesize loop contracts only for those loops without unwinding number specified.Testing:
This PR include a regression test.
No.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.