-
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
Base case for enumerations #973
Comments
In the same vein, the base case for enumerations using decimation actually is
But the type system won't allow it. Consider this from the same RC2 spec:
Here we would want to write something like |
Right now, the type for enumerations looks like:
If we change |
I totally misread the example code as Anyway, I've also run into this problem of not being able to make enumerations of the form I have to say that I'm not a fan of The Isabelle standard library defines a half-open interval notation |
I like the idea of having a half-open interval; I've definitely wanted to write things like I don't think it helps with the |
One of the reasons we didn't do open intervals is that things get tricky if the upper bound is not representable in the same type as the elements in the enumeration (e.g., things like I know this is not what @weaversa was asking for, and I am sure we could work something out, I am just mentioning it because I remember it being a bit tricky. |
The additional thing that might be nice is other options for specifying "down from" enumerations other than the current |
I am advocating here that
[4..3]
should result in[]
rather than an error. I'm fine if[5..3]
gives an error, but I would like to be able to create an enumeration with no elements.This comes from trying to create a Cryptol spec of RC2 (https://tools.ietf.org/html/rfc2268). Namely, this loop here:
T is a type variable that ranges from 1 to 128 inclusive, and when T is 128 we don't enter the loop. It is possible to write this in Cryptol, but it's not as clean as it could be.
I'd rather like to write something like:
An alternative way to write it is like so:
But even so I'd still like use the loop bounds from the spec, like so, but this doesn't work when
T = 128
:The text was updated successfully, but these errors were encountered: