-
Notifications
You must be signed in to change notification settings - Fork 123
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
SBV.SMT.SMTLib2.cvtExp.sh: impossible happened #135
Comments
I can reproduce with just comparing bits.
And:
|
|
Is this really a bug? Why should False be less than True? I imagine that inequalities should only apply to numbers. Not if [False] < [True] didn’t work, that would be a bug. Best, Ian Blumenfeld On Nov 3, 2014, at 8:07 AM, weaversa [email protected] wrote:
|
Cryptol gives concrete answers:
And, the That is, if we allowed arithmetic to be defined on
But, when happens when we move up a rank? Surely we don't want to apply the operation element-wise:
But, here we do want to apply element-wise:
So, refusing to define arithmetic on Maybe I wasn't very clear...I'm trying to write down my intuition about this. |
I see. I looked over the SMT-LIB2 document, and I’m fairly certain that the inequality operators are not defined in the Core theory for Bools, only on theories like Int, Real, Bit-vectors, etc. I think SMT-LIB2 is making the right choice here. Saying False < True is True is not really sensible mathematics. I suppose you could just implicitly equate less-than-or-equals to to implication (giving the very silly looking typography (<=) == (=>) ) which gives the same results that you want, but as a mathematician, it leaves a bad taste in my mouth. Ian Blumenfeld On Nov 3, 2014, at 10:09 AM, weaversa [email protected] wrote:
|
Lexicographic ordering and big-bit endian (MSB 0 endian) work naturally with comparisons. Comparison of integers (and greater rank structures) can be done by folding the bit-level definitions over the greater rank structure. That is, if For example, say |
This seems to be a bug in the SBV library. I just opened an issue for it: LeventErkok/sbv#97. Once we have a patch, I'll pull it into our local fork. In the meantime I'll add a test to our regression suite for this. |
The words If
@brianhuffman, it may not be a bug in SBV --- maybe @LeventErkok doesn't want SBV to do comparisons on individual bits? |
@weaversa This is a bug in SBV.. Since Bool is an instance of Ord in Haskell, SBV has no choice but to implement that properly. However, I do share Ian and Sean's sentiments.. I am not sure why we ever had Ask John Launchbury if he's around; he might remember if there was a good reason.. As far as Cryptol is concerned; I guess you could go both ways here as well. I don't think anyone is going to complain if the type-checker rejected comparisons on |
Patch pushed to SBV: LeventErkok/sbv@67656c6 Give it a try and let me know if it's still choking! |
Works for me:
I ported these by hand, but someone else probably has an automated way to port SBV patches and Cryptol/sbv, so they should commit instead. |
I usually take care of the porting of SBV updates; it's a slightly-automated process involving Anyway, thanks for the patch, @LeventErkok! |
Cool.. I noticed you also picked up several other updates, and in particular a change required for the new release of Boolector v2.0.1. Unfortunately, the change is not backwards compatible, so if anyone is using Boolector as a backend solver for Cryptol, then they'll have to make sure to upgrade their Boolector installation. |
Ah; and you also picked up |
After I load this code
if I try
:sat \x y -> bar x y
it crashes cryptol:This is in a fairly recent version from git (14b9399) - the latest, I think.
The text was updated successfully, but these errors were encountered: