-
Notifications
You must be signed in to change notification settings - Fork 339
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
Disallow certain forms of pattern matching when an index is erased #5468
Comments
I hope you mean indices should not be erased when Also, I don't have a strong intuition on how PS: Could you perhaps use different names for the constructors of |
I suggest that we leave things like they are when the K rule is on.
This is a key lemma in the theory of |
Perhaps unrelated to the issue at hand, but do we not have canonicity for cubical? is-it-though : should-be-true ≡ true
is-it-though i = true
-- unbox (primTransp (λ i → Box ([]-cong refl i .Erased.erased)) i0 [ true ])
-- != true of type Bool
-- when checking the definition of is-it-though |
Cubical Agda does not yet have proper support for inductive families (#3733). |
The naive desugaring of
A more appropriate desugaring for erased indexes might be to consider the equality erased as well
This is accepted as a definition, but Also Which makes me wonder, can you actually prove that Btw, I mention the erased equality desugaring because it seems like appropriate semantics for e.g. vectors:
then we need to figure out how this affects the rules for pattern matching definitions. |
This makes sense to me. |
@Saizan, can this issue be closed now (if a test case is added)? |
@Saizan, can this issue be closed now? |
Yes, looks good. |
The following code should not be accepted:
The (non-strict) GHC backend compiles the right-hand sides of
should-be-true
andshould-be-false
to identical pieces of code:A simple way to fix this would be to disallow indices from being erased. Can we do better?
Related: #4784, #5448.
The text was updated successfully, but these errors were encountered: