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

*Log b (b^n) is wrongly reduced to n if b is not a literal #44

Open
rowanG077 opened this issue Jul 10, 2022 · 1 comment
Open

*Log b (b^n) is wrongly reduced to n if b is not a literal #44

rowanG077 opened this issue Jul 10, 2022 · 1 comment

Comments

@rowanG077
Copy link
Member

rowanG077 commented Jul 10, 2022

While working on #43 I noticed this bug. It is not allowed to reduce because if b <= 1 then the logarithm will never reduce. This check is already applied if b is a literal but not in the general case.

Easy fix is just adding that check. Which sucks because now existing code will break. Better would be to start emitting new constraints, similar to how ghc-typelits-natnormalise does it. This will still break existing code. But at least the only thing that would need to happen is add the appropriate constraints.

@christiaanb
Copy link
Member

I’m okay with breaking code, since the check is obviously needed in order to be correct.

I agree that we should go the route of emitting new constraints in this case.

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

2 participants