-
Notifications
You must be signed in to change notification settings - Fork 9
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
Automatically delete redundant cases/equations #135
Comments
Comment by nomeata I think this should be possible. We have code like |
Comment by antalsz I looked into using that, but the naïve way of reusing it produces quadratic code (check every prefix), and this solution seemed like it’d be quicker to pull together. Although, if we only check the last case for redundancy, and then if that was redundant check the preceding case, we’d catch some of the problems – maybe enough? |
Comment by nomeata Yes, this might work:
|
Comment by antalsz We also have to handle each argument separately, but yeah, that seems like a good outline. Particularly if we assume that this is only introduced by |
Comment by nomeata
You mean in functions with multiple arguments? That’s taken care of, I believe, as
surprisingly :-) (I had a recollection that I had to prune redundant catch-all cases at the end, but looking at the code that does not seem to be true. Which is good.) |
Issue by antalsz
Friday Jun 28, 2019 at 05:33 GMT
Originally opened as antalsz/hs-to-coq#135
Sometimes, when using
skip constructor
, we'll be left with redundant cases. For example:If we skip every constructor except for
NoUnfolding
, the resulting Coq code isBut since our data type has only one constructor, Coq will reject this because the
_ => true
case is redundant. We can work around this withskip equation
orskip case pattern
, but could we instead infer this automatically?(Examples and motivation from #130)
The text was updated successfully, but these errors were encountered: