-
Notifications
You must be signed in to change notification settings - Fork 34
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
yices proof fails with "Unexpected non-success response" #335
Comments
It feels to me like SBV is handling the failure in quite a nice way actually :-) What would you have SBV do in this case? I'm not sure how to recover from something like this. |
I wouldn't call it "nice": it calls the Haskell It would be nicer if instead of calling
|
I see. Currently, SBV will say When the solver actually returns This is what's happening here. Z3 is nice enough to wait and tell you It seems only way to distinguish would be to actually read the "error" message sent back and do some analysis on whether it can be turned into "unknown". But that seems fragile at best, and really not in the spirit of the interface. If we get an error, then it's something to worry about. I'm not sure how else to proceed here; if we start assigning semantics to error messages from individual solvers, that'll likely lead to a whole can of worms down the road. |
Ok, I see now that we shouldn't conflate "error" and "unknown" responses; they mean different things. But I would really prefer the error response to be handled by some means other than the Haskell With |
That is a good point; we should be able to make better use of Can you create a direct test case in SBV to exhibit this behavior? I'll see what I can do! |
@brianhuffman On second thought, this unfortunately doesn't really work. Ever since we moved to the "query" mode of operation, the user is allowed to send arbitrary commands down to the solver. And the solver can respond back That sounds very onerous, and I'm not sure if it's worth the complexity. Maybe there's another solution to tell Cryptol it was the solver returning an |
Perhaps a compromise would be to throw a specific exception if we get an "error" back from the solver, instead of calling |
Yes, that would be perfect. You should make sure to use |
@brianhuffman I was just looking at this again, and I'm actually getting a segmentation-fault from Z3 with this query. (My Z3 version is quite fresh.) I'm guessing you must be using a rather old version of Z3? Perhaps that should be reported to the Z3 folks separately. |
I'm using z3 version 4.5.0, which I understand is the latest release. For reference, here is the generated smt file, which produces an "unknown" response when I give it to z3:
|
@brianhuffman Interesting. By looking at the generated SMT-Lib, this one seems to be using 26-bits only. (Not 32 as in the original.) What happens if you try with 32-bits? |
26 bits is the smallest size at which z3 fails, and it is the same size I used in my original z3 example. I just tried z3 with 32 bits; in Cryptol I get
Up to size 28 I get an "unknown" response just like with size 26, but with 29 and above I get the "Giving up!" response (which I guess signifies a segfault). |
That makes sense. The |
@brianhuffman Finally got around to implementing this. SBV will now Lines 135 to 146 in 190fa05
There's a nice Exceptions are tricky to deal with, so I'll keep this ticket open and refrain from making a release till you get a chance to test this out and make sure it works as expected. Let me know what you find out! |
@brianhuffman Did you get a chance to test this out? Would like to close the ticket if we have some confirmation that it works as expected. |
@brianhuffman I'm intending to make a new SBV release in about a week or so. I don't know if you got a chance to test this out. Would like to close this ticket before the release. |
SBV 7.5 will be released soon; I'm closing this ticket as I think this release addresses it. If not, please feel free to reopen! |
This example below is from GaloisInc/cryptol#444. (Sorry I haven't converted it to a Haskell/SBV example.) Basically, yices fails if you send it a value raised to an exponent greater than 2^31-1, and SBV doesn't handle the failure in a nice way.
The text was updated successfully, but these errors were encountered: