Skip to content
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

[x ..] (finite, open-ended enumeration) should be removed from the language #574

Closed
brianhuffman opened this issue Feb 27, 2019 · 1 comment

Comments

@brianhuffman
Copy link
Contributor

In Cryptol, the syntax [x ..] is actually shorthand for [x..2^^n-1], which often ends up being a vector with 18446744073709551616 elements, or some such. Such large (but finite) sequences are tricky and/or expensive to deal with during evaluation, and can cause problems in SAW or other backends. Usually users actually intend to write the very similar-looking [x ...], which gives a lazy infinite sequence that is easier to work with.

The [x..] construct has caused many problems: #226, #375, GaloisInc/saw-script#11, GaloisInc/saw-script#276, GaloisInc/saw-script#284, and GaloisInc/saw-script#368, to name a few.

I propose to remove the [x..] syntax from Cryptol. It does a poor job of conveying programmer intent, and experience shows that it often leads to nasty surprises. Users should write [x...] or [x..y] instead. We should remove the [x,y..] syntax as well.

@robdockins
Copy link
Contributor

I, for one, am in favor. I've never seen a use of [x..] that isn't better instead as [x...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants