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

Fix #7193: persistently remember what is a projection #7252

Merged
merged 2 commits into from
May 13, 2024

Conversation

andreasabel
Copy link
Member

@andreasabel andreasabel commented May 10, 2024

Introduces a new FunctionFlag FunProj that remembers whether this function is or came from a projection.
This flag is more stable than the funProjection data which relies on arity.
This helps ruling out accessing irrelevant fields in irrelevant definitions without activating --irrelevant-projections.

Fixes #7193. (Hopefully, feels almost too good to be true.)

Introduces a new `FunctionFlag` `FunProj` that remembers whether this
function is or came from a projection.  This flag is more stable than
the `funProjection` data which relies on arity.
This helps ruling out accessing irrelevant fields in irrelevant
definitions without activating `--irrelevant-projections`.
@andreasabel andreasabel added irrelevance Issues to do with irrelevance annotations irrelevant-projections Irrelevant projections and irrelevant definitions labels May 10, 2024
@andreasabel andreasabel added this to the 2.7.0 milestone May 10, 2024
@andreasabel andreasabel self-assigned this May 10, 2024
@andreasabel
Copy link
Member Author

@dolio: Please review, if you are available.

@dolio
Copy link

dolio commented May 10, 2024

It seems good to me. I think this is addressing the root cause, which was that Agda was losing track of which things are projections. I wasn't the one who originally came up with either trick, so it's possible that there are others I don't know about. But it fixes the ones I do.

I noticed that when you do the let open TSquash (emb x) in extract example, extract is still colored like a normal function (when irrelevant projections are on, or the projections aren't irrelevant). Is it possible to use this new information to color it pink like they are within the record, or when you open an unapplied record module? Seems like that'd be nice.

@andreasabel
Copy link
Member Author

andreasabel commented May 13, 2024

Thanks @dolio!

I noticed that when you do the let open TSquash (emb x) in extract example, extract is still colored like a normal function (when irrelevant projections are on, or the projections aren't irrelevant). Is it possible to use this new information to color it pink like they are within the record, or when you open an unapplied record module?

@nad requested the opposite, if I am not mistaken:

But maybe we can fix the following problem now: #3156.
(No, we can only make things more pink, not less.)

@andreasabel andreasabel merged commit 2aefef8 into master May 13, 2024
25 checks passed
@andreasabel andreasabel deleted the irrelevant-proj branch May 13, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
irrelevance Issues to do with irrelevance annotations irrelevant-projections Irrelevant projections and irrelevant definitions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agda always has irrelevant projections
2 participants