-
Notifications
You must be signed in to change notification settings - Fork 338
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
Allow flat matching on inductive families #6238
Comments
I seem to recall that every program that is accepted is also accepted if every reference to the cohesive modality is removed, and I suspect that all compiler backends ignore this modality. Thus your change is presumably "safe". Is it the case that this modality is only used together with (unprovable) postulates or assumptions? In that case the question is perhaps if your change is compatible with the postulates or assumptions that users want to use. |
* #6238: Add test case * #6238: Suggested fix * re #6237: forbid by default flat-split & without-K When --flat-split and --cubical(-compatible) are used (which is not --safe), --flat-split behaves as an injective flag. Furthermore, in that case, the transpX clauses will not be generated for the function. (We skip this by failing the LeftInv computation, so that a NoEquivWhenSplitting warning is printed indicating the defn. won't compute) * mention in changelog that --cubical implies --no-flat-split * fixup: update debug interaction test * fixup: remove stray Nix file * fixup: update changelog and remove 1 more stray file * fixup: add test for --without-K as well Co-authored-by: Amélia Liao <me@amelia.how>
Has this issue been fixed by |
Yes. I'll write a follow-up issue to cover working out the proper interaction(s) between Cubical Agda and the |
The following example does not type check with latest Agda (master):
Agda gives the following error:
Agda throws the same error with
--cubical-compatible
and if I understood #6236 correctly, once it is merged, Agda will also throw an error without any flag.But, as I understand the flat modality in Agda, it should provide an approximation to what can be done with flat and sharp in real-cohesive hott (article). There, 'crisp identity induction' is derivable (Theorem 5.6 on p. 35), which is a general induction principle that would justify the pattern matching in the example above. The reasoning should apply to general inductive types.
So, considering what the flat modality in Agda should model, I think pattern matching on inductive families should be allowed and without any extra assumption, it should not be possible to derive anything new with this (up to adding '@♭' to derivable statements).
The text was updated successfully, but these errors were encountered: