-
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
Pass universally quantified assumptions to Z3 #1037
Comments
We've been considering this for a long time, but had held off on implementing it mostly because it wasn't clear whether we could build a useful solver-independent interface to it. However, maybe it's worth just going ahead and doing it in a solver-specific way, and perhaps generalize it later if that seems feasible. I believe What4 does support passing in universally quantified lemmas, so the next step might be to decide what the SAWScript API should look like. |
I wonder if @brianhuffman or @robdockins have a sense for how hard this would be with the current state of the What4 backend. |
What I got from the discussion on the SAW channel is that What4 already supports quantified formulas, and so I presume that making sure those formulas are passed to Z3 is a matter of calling What4 the right way. It would be useful for the blst project if someone could throw together a saw-scrip command that does it, just for us to try it out (no need for anything fancy like support triggers etc. I would just like to see the universally quantified formulas in my saw-core terms make it to Z3). We are spending a significant portion of our time doing manual rewrites of field-arithmetic expressions, so this could potentially save us quite a bit of work. Alternatively, could someone give me a few pointers to get me started on implementing it myself? |
I often have to prove by rewriting that two terms involving field operations are equivalent. Unfortunately, SAW's SMT tactics are seemingly of no help due to the bitwidth I am dealing with.
However, it seems that Z3 can handle some of those goals if passed equations saying e.g. that multiplication is commutative. The problem is that if I express commutativity of multiplication as a universally quantified formula in my SAW goal, it does not appear in the output passed to the solver. Would it be possible to change that? Alternatively, are there other ways to deal with those goals? (at the moment I am resorting to rewriting within SAW using
simplify
, but it is tedious).Here is a simplified example drawn from a recent proof:
Z3 does fine with the following encoding, so I'm hoping it would too when called from SAW if passed the lemmas:
The text was updated successfully, but these errors were encountered: