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

Add option to ignore suggestions that require unsatisfiable constraints #3

Open
ekmett opened this issue Sep 22, 2015 · 5 comments
Open

Comments

@ekmett
Copy link
Contributor

ekmett commented Sep 22, 2015

I have a lot of code that often can't incur the extra Ord constraints and the like that would be required to satisfy herbie. e.g. it currently works over Complex numbers or other cases that aren't Ord.

It'd be nice to have the option to be able to filter out suggestions that don't apply in the "context as written".

@mikeizbicki
Copy link
Owner

I think what you're suggesting is that given a function f, Herbie might want to rewrite it to something that incurs an Ord constraint (which you can't add), and you want to force Herbie to only search for solutions that don't have Ord constraints. If so, that's not something that the Herbie backend currently supports. But I'll definitely pass these suggestions on to them and see how easy they'd be to implement.

@ekmett
Copy link
Contributor Author

ekmett commented Sep 22, 2015

Right now in Herbie/CoreManip.hs you have a WARNING: you show that says you can't satisfy the constraint and that you won't be applying the rewrite. I'm mostly just looking to see if that can suppress the entire suggestion with a flag or a module annotation.

If I'm going to start incorporating herbie into my day-to-day workflow things like that 'd be nice to have.

@mikeizbicki
Copy link
Owner

Sure, I can add a few options to toggle things like this. I'll probably wait a few days to collect feedback from people about what options would be useful before adding them.

@ekmett
Copy link
Contributor Author

ekmett commented Sep 23, 2015

Sure thing. I just went through and filed this stuff before I forgot about it. =)

@mikeizbicki
Copy link
Owner

You can now pass the flag -fplugin-opt=Herbie:noRewrite to prevent the plugin from performing rewrites. This will eliminate all the warnings, but there's still no option within the Herbie program to selectively disable certain transformations, like those that require the Ord constraint.

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