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

Feature request: product inequality #84

Open
gergoerdi opened this issue Oct 12, 2024 · 2 comments
Open

Feature request: product inequality #84

gergoerdi opened this issue Oct 12, 2024 · 2 comments

Comments

@gergoerdi
Copy link

For some constants a and b, and type variables x and y, would it be possible to solve a * b <= x * y from (a <= x, b <= y)?

@christiaanb
Copy link
Member

Could you check if the thing you want to do works with:

My plan is to make the above package subsume ghc-typelits-natnormalise as it has a much better approach for solving inequalities.

@gergoerdi
Copy link
Author

Using ghc-typelits-sopsat at 87e632bf0d I got my intended use case to work!

foo :: forall n m. (1 <= n * m * m * n) => SNat n -> SNat m -> ()
foo _ _ = ()

bar :: forall n m. (1 <= n, 1 <= m) => SNat n -> SNat m -> ()
bar = foo

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