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

List/drop causes exponentially sized normal form #1286

Open
ear7h opened this issue Jun 15, 2022 · 5 comments
Open

List/drop causes exponentially sized normal form #1286

ear7h opened this issue Jun 15, 2022 · 5 comments

Comments

@ear7h
Copy link
Contributor

ear7h commented Jun 15, 2022

Normalizing List/drop without a number results in an expression with exponential size relative to the input list.

I have a minimal demo in this gist.

Note that this this issue also affects List/index.

@Gabriella439
Copy link
Contributor

What do you mean when you say that this also affects List/index?

@Gabriella439
Copy link
Contributor

After looking into this I believe the only way that this could be fixed would be to add a built-in function for List/drop and List/take

@ear7h
Copy link
Contributor Author

ear7h commented Jun 16, 2022

@Gabriella439

What do you mean when you say that this also affects List/index?

I was just making a note that List/index calls List.drop so it also has the same problem. For, example changing drop to index in the demo is also exponential.

As for a solution, I was thinking the same thing, I can work on a PR for that

@Gabriella439
Copy link
Contributor

Yeah, I'd vote in favor of a PR to add those built-ins

@sjakobi
Copy link
Collaborator

sjakobi commented Jun 16, 2022

I think adding a List/drop builtin would be sufficient to address the exponential normalization in List.index too, no?!

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

3 participants