Skip to content

Fix #5816: skip generating cubical clauses for Prop stuff - #5897

Closed
andreasabel wants to merge 2 commits into
masterfrom
issue5816
Closed

andreasabel wants to merge 2 commits into
masterfrom
issue5816

Conversation

@andreasabel

Copy link
Copy Markdown
Member

Fix #5816: skip generating cubical clauses for Prop stuff

TODO:

  • disallow --cubical and --prop together?

@andreasabel andreasabel added without-K K-related restrictions to pattern matching, termination checking, indices, erasure prop Prop, definitional proof irrelevance labels May 9, 2022
@andreasabel andreasabel added this to the 2.6.3 milestone May 9, 2022
@Saizan

Saizan commented May 9, 2022

Copy link
Copy Markdown
Collaborator

The models of CTT support a Prop universe. What one should do for indexed families and/or HITs in Prop would require more thought though. It does not seem like you should be able to support the same eliminators in general.

@andreasabel

Copy link
Copy Markdown
Member Author

Thanks for chiming in, @Saizan.
Current master contributes indexed inductive types to Cubical Agda, but the development isn't finished yet. We need a plan what to do about it for the 2.6.3 release.
This PR is a clumsy attempt to work around an internal error introduced by the new code for indexed inductive cubicality. Any help to do better appreciated.

return $ abstract (mapCohesion updCoh <$> dtel) dt
dsort <- addContext delta1 $ reduce (getSort dtype)
dsort <- fromMaybe __IMPOSSIBLE__ . isSort . unEl <$> do addContext dtel $ reduce dt
return $ (dsort,) $ abstract (mapCohesion updCoh <$> dtel) dt

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Saizan: Do you agree to this fix, that dsort should be the target universe of the data type?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense

@nad

nad commented May 10, 2022

Copy link
Copy Markdown
Collaborator

Thanks for chiming in, @Saizan. Current master contributes indexed inductive types to Cubical Agda, but the development isn't finished yet. We need a plan what to do about it for the 2.6.3 release.

One option is perhaps to disallow the combination of --prop and --cubical/--erased-cubical when --safe is active. However, if the combination of --prop and --cubical can lead to lots of broken invariants, then perhaps it should be ruled out entirely.

@andreasabel

Copy link
Copy Markdown
Member Author

@Mergifyio rebase

@mergify

mergify Bot commented Aug 16, 2022

Copy link
Copy Markdown

rebase

✅ Branch has been successfully rebased

@plt-amy

plt-amy commented Aug 16, 2022

Copy link
Copy Markdown
Contributor

The fix looks good; In the future we'd have to revisit generation of hcomp clauses into types living in Prop if we were to e.g. make Prop univalent. For the 2.6.3 release, I think the cleanest option is to lock support for cubical indexed inductives behind a flag: it has a tendency to explode (#5816, #6005, #6001) and Injectivity is a very popular unification step.

@nad

nad commented Aug 17, 2022

Copy link
Copy Markdown
Collaborator

For the 2.6.3 release, I think the cleanest option is to lock support for cubical indexed inductives behind a flag

Should that flag be compatible with --safe?

@plt-amy

plt-amy commented Aug 17, 2022

Copy link
Copy Markdown
Contributor

It doesn't let you prove anything new, so it's not not --safe... but it's not entirely safe since there's a lot of __IMPOSSIBLE__ to run into? So I'd say "no"

@nad

nad commented Aug 22, 2022 •

Copy link
Copy Markdown
Collaborator

If the only problem is that Agda might crash, then I think it is fine to make the flag compatible with --safe. The idea of that flag is that when it is used, then any logical or runtime errors are Agda bugs.

@jespercockx

Copy link
Copy Markdown
Member

In the past we have often made experimental flags not compatible with --safe, even though in principle they do not add any inconsistencies (see for example --prop). If this is still the policy, I would suggest making this new flag incompatible with --safe until it is fully implemented (in particular with support for Injectivity and Prop).

@plt-amy

plt-amy commented Oct 21, 2022

Copy link
Copy Markdown
Contributor

Actually, do we still need this after #6153? I don't think so

@plt-amy plt-amy removed this from the 2.6.3 milestone Oct 24, 2022
@andreasabel

Copy link
Copy Markdown
Member Author

Since the problems reported in #5816 are fixed (and a testcase has been added), I don't see a reason to keep this PR.

@plt-amy
plt-amy deleted the issue5816 branch March 17, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prop Prop, definitional proof irrelevance without-K K-related restrictions to pattern matching, termination checking, indices, erasure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic at Cubical.hs:2265 with --without-K and --prop

5 participants