-
Notifications
You must be signed in to change notification settings - Fork 246
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
Fragile NonZero
and implementation-dependent luck
#2644
Comments
Unfortunately, I didn't understand the discussion on the main Agda Zulip, but get your outline of what might be required. What's not clear is how many of these lemmas (all?) regarding the affected functions are touched by the change. is it 'simply' a case of the |
@jamesmckinna The heart of the issue is that (without lossy-unification) Agda will not generally solve for %-congˡ : ∀{m n o} .⦃ _ : NonZero o ⦄ → m ≡ n → m % o ≡ n % o here the variables (It currently works by coincidence: at the use sites I inspected, the correct So, to summarize, the |
(P.S. I'd be happy to hold back on my instance search work/have it under a flag for a while/etc so these functions can have a proper deprecation cycle, since I'm not sure what the stdlib policy here is) |
Thanks @plt-amy ! for:
Regarding the second, I'm guessing your changes to instance inference/lossy unification will be v2.8.0, and since we're currently in a v2.7.0.* test/release cycle, I think these things could be considered 'non-interfering' (notwithstanding other changes to |
Yes, getting rid of the unforced choices by 2.8.0 sounds like a good plan on the compiler end. |
Yes, I think these changes should be pushed to |
A quite thorough description of the issue is already written so I won't repeat it all here.
Basically some of our
NonZero
instances resolve through sheer luck of the details of the current implementation and changes to make the upstream algorithm less ad hoc breakstdlib
. The issue boils down to some non-injective functions (like/
and%
) having accompanyingcong
functions with implicits that should be explicit as they can't in general be inferred [see details at above post.]. So we should fix thosecong
routines to not be so fragile.This will be a breaking change, but one that we are forced to do, as our current implementation should be regarded as buggy because it relies on 'sheer luck' to work.
While I am intending to fix this myself, I'm not sure how fast I'll be, so I would be very happy to collaborate with others on that.
The text was updated successfully, but these errors were encountered: