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

Dynamically sized sequences? #1746

Open
yav opened this issue Sep 5, 2024 · 2 comments
Open

Dynamically sized sequences? #1746

yav opened this issue Sep 5, 2024 · 2 comments
Labels
design needed We need to specify precisely what we want language Changes or extensions to the language

Comments

@yav
Copy link
Member

yav commented Sep 5, 2024

Some specs require filtering with a predicate on a sequence, and it is hard to express these in Cryptol. There are various workarounds for this, but they are all a bit hacky, and even worse sometimes they resort to using undefined.

It would be more direct to add a sequence type without a static size instead.

We need to figure out exactly what operations we want on this type. Most usual operations likely make sense on this type too, but it might be nice to start with a small set and more as needed, to make things more manageable.

Another decision is if we want to allow these sequences to be potentially infinite, or restrict them to just finite ones.

@yav yav added language Changes or extensions to the language design needed We need to specify precisely what we want labels Sep 5, 2024
@sauclovian-g
Copy link
Contributor

I would definitely like to have such objects. However, adding inductive types seems like a large can of worms. One could encode as SMT arrays, but then the usual operations don't work very well.

Much as I'd rather have inductives, would it be sufficient to have sequences of bounded length? (That is, instead of length n, of length <= n, so under the covers they can be a sequence of length n and a count.)

@yav
Copy link
Member Author

yav commented Sep 5, 2024

Yes, to clarify this issue is very much about sequences, not generic inductive types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design needed We need to specify precisely what we want language Changes or extensions to the language
Projects
None yet
Development

No branches or pull requests

2 participants