-
Notifications
You must be signed in to change notification settings - Fork 62
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
Remove the internal "predicate" convention #1090
Comments
@brianhuffman, I'm particularly interested on your thoughts regarding this idea. |
This sounds like a good idea to me. It would probably simplify the code for various backends, because as it stands currently, they have to include code for dealing with both lambda-bound and free (i.e. I suppose we don't even really have to do this simplification all at once; we can just go around to all the saw backends one by one and remove all the extra cruft for handling lambdas-as-quantifiers. As we do that, we just need to make sure that none of the code in saw-script ever tries to pass lambda-quantifiers into any of the backends. |
Another thing we might consider doing is moving the definition of the |
I'm currently thinking my first step is to introduce a
Maybe it also makes sense to push In both cases (sat queries and prop), I'm considering allowing |
Why would the |
Perhaps, I haven't thought it all the way through. I'm a bit concerned that just using |
Major progress on this issue in #1102. I believe all the SAT-based proof backends are now using the new SATQuery type. In addition, several of the proof abstractions were significantly strengthened. In a second pass, I intend to remove the old predicate-based methods and generally clean up dangling code. |
This is now finished in #1134 |
A user-interface convention that SAW inherited from Cryptol is the "function as predicate" style. In this style, theorems to prove or SAT queries to issue are specified as terms of function type that return booleans.
This convention is still used internally inside SAW to communicate problems down to solvers. However, it has been partially replaced with the
Prop
type that appears in proof states, which uses a "types as propositions" approach instead. The two forms are interrelated via thepropToPredicate
andpredicateToProp
operations. Solver communication is generally done with the "function a predicate" style. However, internally to the solvers, the lambda lists are usually "unbound", making the arguments into top-level free variables, which is how solvers generally expect to have problems stated. If you follow through the various code paths, you'll see terms pass through a variety of these conventions before finally arriving where they need to go, and some paths use a combination of the styles, which is quite confusing.We should be more explicit, via internal data types, about which convention we are using at any given moment, and reduce the number of conversions between conventions we use. In particular, I think we should remove the internal "function as predicate" style and relegate it (only) to a user-interface convention.
SAT-based solvers want to receive a boolean term with free variables (as does the symbolic simulator), proof tactics want to work with propositions, and users want to input functions written in Cryptol syntax. We should have separate data types representing these conventions and rearrange internal functions to accept the most natural one, and we should work to eliminate as many of the translations back-and-forth between these conventions as possible.
The text was updated successfully, but these errors were encountered: