-
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
Explicit type more general than inferred type? #58
Comments
This is definitely a bug, and Cryptol knows it! Here's what happens when you use your
|
I came across what looks like another instance of the same problem. I wrote the following definition and it typechecked, even though
Evaluating
|
Ah, yeah, I know what that is about: I've actually fixed it and then unfixed it a couple of times :-) I'll have a look at it. |
I came across another example of this recently. The type of (#) clearly says that front, the length of the first sequence, has to be finite. So, as expected, type checking rejects the expression
Now the
|
Thanks for your example! This is a known bug in the current constraint solver. We are currently working on a new version of Cryptol's constraint solver that should solve this problem (and, hopefully, others too!). |
With the latest check-in (the same that fixed #140), the |
Here's an oddity:
some: {n} [n] -> Bit
some x = x != 0
some' x = x != 0
Loading this in Cryptol 2.0.0 gives unexpected results. The definition of 'some' should fail, as the comparison should require that n is finite (as described in "CryptolPrims.pdf", the instance of 'Cmp [n]a' requires 'fin n' and I did not see another matching instance).
Cryptol reports
Main> :t some'
some' : {a} (fin a) => [a] -> Bit
just as expected. But to my surprise the definition of some is accepted.
Main> :t some
some : {n} [n] -> Bit
The text was updated successfully, but these errors were encountered: