-
Notifications
You must be signed in to change notification settings - Fork 126
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
Symbolic Integer exponentiation not caught #725
Comments
Wow, yeah, this is totally a bug. We can also prove even more ridiculous things like this:
I have a feeling that the problem might lie within the SBV library; maybe it's some weird interaction having to do with path conditions and partially-defined functions. With @robdockins' new
As for the wording of the error message, I guess we support neither "exponentation" nor exponentiation on symbolic integers, so it's technically correct :-) |
This doesn't reproduce with Cryptol 2.8.0 from Hackage:
(Also note that But this version also doesn't understand Let me know what you find out; planning to have an SBV release soon, so it'd be good to have this incorporated if there's anything to be done on the SBV side. |
Bisection shows that the first bad commit is ffdf11d by @robdockins, dated March 26, which has the commit message "Minor style and bugfixes". |
Changeset ffdf11d introduced the current definition of cryptol/src/Cryptol/Eval/SBV.hs Lines 300 to 305 in 1c38465
I can also confirm that the first branch of that definition (with the My best guess is that the real problem is some interaction between Here's another instance of the same bug, which doesn't use integer exponentiation at all:
|
An even more ridiculous example, this one showing
(Note that this predicate should always evaluate to |
In Cryptol 1.X, our strategy was to symbolically substitute I think Cryptol 2.X has dropped I think the |
In Cryptol 2.x we (until recently) translated all partial functions to |
Yes, I'm pretty sure I understand what's happening here. The issue is that during the overhaul, I made sure we explicitly computed safety predicates, but pending some design decisions (CF #284), I left the safety predicates as ignored in the SBV backend. I think we've arrived at a consensus for how It's worth noting, also, that PR #724 will change the type of |
Fixed in #724. We eventually decided to continue to allow exponents to be Integer, so this error can still occur. However, it's now upgraded in severity so it doesn't interact with safety predicates, and instead just throws an exception. |
If I add a conditional in front of the Integer exponentiation, z3 proves an incorrect theorem. I gather that the check "operation can not be supported on symbolic values: integer exponentation" is being avoided somehow. Also, "exponentation" in the error message is spelled wrong.
The text was updated successfully, but these errors were encountered: