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

[CLOSED] skip constructor #130

Closed
lastland opened this issue Nov 3, 2020 · 2 comments
Closed

[CLOSED] skip constructor #130

lastland opened this issue Nov 3, 2020 · 2 comments

Comments

@lastland
Copy link
Collaborator

lastland commented Nov 3, 2020

Issue by sweirich
Thursday Jun 27, 2019 at 18:23 GMT
Originally opened as antalsz/hs-to-coq#130


When I skip all except for the NoUnfolding constructor of the Unfolding data type, hs-to-coq produces the wrong output for this input.

hasSomeUnfolding :: Unfolding -> Bool
hasSomeUnfolding NoUnfolding   = False
hasSomeUnfolding BootUnfolding = False
hasSomeUnfolding _             = True

Specifically, the result is:

Definition hasSomeUnfolding : Unfolding -> bool :=
  fun arg_0__ => match arg_0__ with | NoUnfolding => false | _ => true end.

which Coq rejects because of the redundant pattern.

I'm currently working around by skipping this function.

@lastland
Copy link
Collaborator Author

lastland commented Nov 3, 2020

Comment by antalsz
Thursday Jun 27, 2019 at 18:30 GMT


Ah, the expected edge cases. This may be tricky to eliminate algorithmically – would a

skip equation Core.hasSomeUnfolding _

edit work instead? That might be simpler.

@lastland
Copy link
Collaborator Author

lastland commented Nov 3, 2020

Comment by antalsz
Friday Jun 28, 2019 at 06:04 GMT


8180fd5 adds the aforementioned skip equation edit, which was much simpler to add than a pattern redundancy checker. I'm closing this, but I've created #135 to remind us to consider adding automatic redundancy checking.

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

1 participant