Skip to content

Revert union, difference, etc. complexity changes #958

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

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

tomsmeding
Copy link
Contributor

As discussed in #870, the complexities for union, difference, etc. on Set and Map were changed in #830 to fix some partiality in the expressions, but along the way new partiality was introduced, and useful special cases like m = 1 get incorrect complexity values from the new formulas.

The original formula was as stated in the original paper:
https://dl.acm.org/doi/10.1145/322123.322127
and this holds for 0 < m <= n, which seems sufficient to me. (The m=0 case is excluded, but for m=0 nothing needs to be done anyway. This contrary to the m=1 case, in which useful work with very specific complexity (namely, O(log(n))) needs to be done.)

This commit reverts all occurrences of the modified complexity formula back to the original one.

NOTE: I have not checked that all functions for which I changed the complexity specification are indeed instances of the algorithms in the original paper. However, due to the quite specific complexity formula that is unlikely to occur anywhere else, I think this is correct anyway.

As discussed in haskell#870, the complexities for union, difference, etc. on
Set and Map were changed in haskell#830 to fix some partiality in the
expressions, but along the way new partiality was introduced, and useful
special cases like m = 1 get incorrect complexity values from the new
formulas.

The original formula was as stated in the original paper:
  https://dl.acm.org/doi/10.1145/322123.322127
and this holds for 0 < m <= n, which seems sufficient to me. (The m=0
case is excluded, but for m=0 nothing needs to be done anyway. This
contrary to the m=1 case, in which useful work with very specific
complexity (namely, O(log(n))) needs to be done.)

This commit reverts all occurrences of the modified complexity formula
back to the original one.
@treeowl treeowl merged commit 269f53e into haskell:master Sep 27, 2023
@treeowl
Copy link
Contributor

treeowl commented Sep 27, 2023

For now, we'll go with it. I would rather have something more complete.

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.

2 participants