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

wasm: Add support for set values #1429

Merged
merged 2 commits into from
May 15, 2019

Conversation

tsandall
Copy link
Member

These changes add support for set values. In the process I discovered a bug in partial evaluation of unification with two sets. This PR also contains a commit resolving that issue.

Sets are not unified recursively so variables contained in sets need
to be checked against the save set recursively unlike other
terms. These changes just update the save set check to take sets into account.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
These changes add support for set values in preparation for rules
support. With these changes in place we will be able to compile all
rules to wasm.

These changes mostly duplicate existing code paths for object values
but specialize them for sets. Sets are implemented as sorted lists for
now. Set operations are O(n) for now.

These changes are not accompanied with end-to-end tests due to partial
evaluation. I.e., if set literals are constructed, any test operations
like iteration will be unrolled by partial evaluation and since input
can only contain JSON values, we don't have a way to fully exercise
the set values. Once rules are supported we can improve this.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Copy link
Contributor

@patrick-east patrick-east left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

None yet

2 participants