Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

skip constructor #130

Closed
sweirich opened this issue Jun 27, 2019 · 2 comments
Closed

skip constructor #130

sweirich opened this issue Jun 27, 2019 · 2 comments
Assignees

Comments

@sweirich
Copy link
Collaborator

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.

@sweirich sweirich changed the title skup constructor skip constructor Jun 27, 2019
@antalsz
Copy link
Owner

antalsz commented Jun 27, 2019

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.

@antalsz
Copy link
Owner

antalsz commented Jun 28, 2019

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants