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

Extensional case equivalence #21

Open
np opened this issue Nov 12, 2015 · 2 comments
Open

Extensional case equivalence #21

np opened this issue Nov 12, 2015 · 2 comments

Comments

@np
Copy link
Owner

np commented Nov 12, 2015

Consider the following:

assert (x : Bool)-> (case x of { `true -> < ?Int > , `false -> < !Int > })
     = (x : Bool)-> < case x of { `true -> ?Int , `false -> !Int } >
     : Type

This is rejected so far but I wish we accept by checking that setting x to true andfalse leads to the resulting terms to be equivalent.

@np np added the enhancement label Nov 12, 2015
@Danten
Copy link
Collaborator

Danten commented Nov 12, 2015

So while I agree that this would be nice, but should we only do this because Bool is not recursive? What criteria can we have, another could be that < _ > commutes with case, but I'm not entirely sure we can just add that and still have the equality be transitive and congurent (I'm not sure what would break or if we even have that now).

A similar situation is, f (case x { true -> e , false -> e' }), which could be equal to case x { true -> f e , false -> f e' }.

@np
Copy link
Owner Author

np commented Nov 13, 2015

The data-types in Ling are all non-recursive, non-parameterized, non-indexed... They are just a finite enumeration of tags.

My example was with <_> but my intent was wider:

Γ, x : A = `c_i ⊢ t_i = t
-------------------------------------------
Γ, x : A ⊢ case x { `c_i -> t_i } = t

Where the multiple premises form a conjunction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants