-
Notifications
You must be signed in to change notification settings - Fork 307
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
[RTG] Add set union operation #7916
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Computes the union of the given sets. If the list of sets must contain at | ||
least one element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the second sentence want to say "The list of sets must contain at least one element."? If yes, it might be worth checking for that in the verifier, or if empty sets are valid, maybe just return an empty set in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's what it should say. It originally said that if there are zero operands, it returns the empty set but then changed it because the SameOperandsAndResultType
trait verifies that there is at least one operand (there is also a test for that already added). We could go back to allowing zero operands, but I'm not sure it it's beneficial (it would just fold to a zero-operand set_create
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice! I was wondering where the error message came from 😀 No need to change anything, disallowing empty operand lists feels very reasonable. Especially since you'd have two different ways of creating a constant empty set otherwise, which would be pretty weird.
6990196
to
f5204eb
Compare
2bf1d4d
to
d4c18d8
Compare
d4c18d8
to
f61ea9d
Compare
f61ea9d
to
9e4d714
Compare
No description provided.