-
Notifications
You must be signed in to change notification settings - Fork 63
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
Refactor skeleton / boilerplate generation #668
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.
This is a big change, looks good overall.
GaloisInc/crucible#464 has been merged, waiting on GaloisInc/macaw#157 to update |
The excellent description of this PR is much appreciated! |
The BIKE proofs are running out of memory on Travis and on Fryingpan. These were already "close to the edge" in terms of resource usage, so I suspect a recent Crucible change might have pushed them over. |
(Depends on GaloisInc/crucible#464.)
This PR improves the usability of SAWScript's LLVM boilerplate generation.
Previously, boilerplate generation was exposed through a function
llvm_boilerplate
, which emitted outlines of function specifications to a file, which could then be modified by hand. This approach was very "brittle": there was no way to generate specifications, tweak those specifications by hand, and then regenerate those specifications modulo the tweaks to reflect e.g. a code change. This was further exacerbated by the interface forcing the user to regenerate all specifications at once.Here, we break the former boilerplate generation into two components:
Let's look at an example. Consider the following function:
Previously, boilerplate generation would have produced a specification that looks like the following:
Now, boilerplate generation will produce something like:
The intent here is that this boilerplate should never need to be regenerated.
Most of the work previously done to determine argument sizes, allocate and initialize arguments, etc. is now done by SAWScript at runtime, rather than by the boilerplate generation function as a separate step.
(Boilerplate generation now only handles things that are truly boilerplate, such as passing the correct overrides to
crucible_llvm_verify
.)The skeleton generation interface allows adding additional preconditions or postconditions without constantly needing to copy these into new boilerplate. In the example above, we might add
to the end of
set_spec
to assert that the value pointed to byx
after executingset
is equal to the initial value ofy
.set_spec
will then work regardless of some small changes toset
(e.g. changingint
tolong
, or swapping the argument order).