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

Use -local consistently for properties #626

Closed
gallais opened this issue Feb 19, 2019 · 20 comments · Fixed by #1822 or #2109
Closed

Use -local consistently for properties #626

gallais opened this issue Feb 19, 2019 · 20 comments · Fixed by #1822 or #2109
Assignees
Milestone

Comments

@gallais
Copy link
Member

gallais commented Feb 19, 2019

In Data.List.Properties we use

  • map-id₂ : All (λ x → f x ≡ x) xs → map f xs ≡ xs
  • map-cong₂ : All (λ x → f x ≡ g x) xs → map f xs ≡ map g xs
  • (we do not have map-compose₂)

I think that we should instead use the -relative suffix introduced in #510

@gallais gallais added this to the 1.0 milestone Feb 19, 2019
@MatthewDaggitt
Copy link
Contributor

What does relative refer to?

@gallais
Copy link
Member Author

gallais commented Feb 22, 2019

The fact the equality constraint is relative to a specific domain (in order to be
as tight a constraint as possible) rather than absolute.

@MatthewDaggitt
Copy link
Contributor

Hmm looking at this again, I'd probably prefer the prefix -locally (or -local) instead of -relative, as in the equality constraints hold locally. Thoughts?

@MatthewDaggitt MatthewDaggitt self-assigned this Mar 19, 2019
@JacquesCarette
Copy link
Contributor

To be honest, I don't like either -locally or -relative. Isn't this rather a 'lifting' property? You're lifting an equality to hold at a list. In some ways, this is a generalization of ap.

@MatthewDaggitt
Copy link
Contributor

So map-id-lift? I like it better than -relative but less than -local. I'd be fine with it though....

@MatthewDaggitt
Copy link
Contributor

Going to leave this out of v1.0, as I don't think we've reached consensus yet.

@MatthewDaggitt MatthewDaggitt modified the milestones: v1.0, v1.1 Mar 23, 2019
@MatthewDaggitt MatthewDaggitt removed this from the v1.1 milestone Jun 6, 2019
@MatthewDaggitt MatthewDaggitt added this to the v2.0 milestone Jul 11, 2021
@MatthewDaggitt
Copy link
Contributor

@jamesmckinna thinks the suffix should be at e.g. map-id-at

After discussion we're going with local

@jamesmckinna
Copy link
Contributor

Is it the case, for Lists at least, that the 'global' property map-id is (definitionally equal to; or merely equivalent to?) \forall xs \r (map-id-local xs) (modulo the actual arguments in order to fix the property)?

That is, do we uniformly have that property is All (property-local) for propertys of interest? Should we?

@jamesmckinna
Copy link
Contributor

@MatthewDaggitt this could also be linked to issue #509 (or at least, to a single PR which will knock them both off). You or me?

@MatthewDaggitt
Copy link
Contributor

Is it the case, for Lists at least, that the 'global' property map-id is (definitionally equal to; or merely equivalent to?) \forall xs \r (map-id-local xs) (modulo the actual arguments in order to fix the property)?

No it's not. And I'm not sure that it is desirable as the local property requires an intermediate proof of the predicate All. I don't think we should construct it just for the sake of destructing it again.

@MatthewDaggitt this could also be linked to issue #509 (or at least, to a single PR which will knock them both off). You or me?

It would be great if you could to tackle this while you're fixing #509 👍

@jamesmckinna
Copy link
Contributor

I think this bit of PR #1822 is now ready.

@jamesmckinna
Copy link
Contributor

jamesmckinna commented Sep 16, 2022

I was too hasty. There is a very large raft of updateAt-* properties, each with a -relative version, in:

  • Data.Vec.Properties
  • Data.Vec.Functional.Properties
  • Data.List.Relation.Unary.All.Properties

Turning to those Done now.
EDITED: and interestingly, those do use the 'all -local implies -global' idiom... except one, which I changed for the sake of (?) uniformity.

@jamesmckinna
Copy link
Contributor

Updated CHANGELOG.

jamesmckinna added a commit to jamesmckinna/agda-stdlib that referenced this issue Sep 17, 2022
@jamesmckinna
Copy link
Contributor

jamesmckinna commented Sep 17, 2022

Problem: type of map-updateAt in Data.Vec.Functional.Properties is in fact the 'local' statement, not the 'global' as suggested by the name...
Solution: it's a leaf node in the dependency graph. Will change name, and add new 'global' definition. Interesting knock-on viscosity: can't be captured by a mere deprecation warning!

jamesmckinna added a commit to jamesmckinna/agda-stdlib that referenced this issue Sep 17, 2022
@jamesmckinna
Copy link
Contributor

Is this issue now closed, or does there need to be an addition somewhere (HACKING?) to document the intention behind the name change?

@MatthewDaggitt
Copy link
Contributor

MatthewDaggitt commented Oct 24, 2022

I guess if you're keen you can add a note to the following?

https://github.com/agda/agda-stdlib/blob/master/notes/style-guide.md#naming-conventions

@jamesmckinna jamesmckinna linked a pull request Oct 24, 2022 that will close this issue
4 tasks
@jamesmckinna
Copy link
Contributor

I'll ponder what would be the most helpful way to introduce, exemplify, and reinforce the new agreed convention. But it seems 'small' compared to the gross-scale global conventions listed there. Too much thinking required perhaps!

@jamesmckinna
Copy link
Contributor

So: I think the issue/discussion of how to document the various already-merged PRs in HACKING, can be deferred to v2.1. I can't organise my thoughts properly about the right narrative approach here.

@MatthewDaggitt MatthewDaggitt changed the title Use -relative consistently for properties Use -local consistently for properties Sep 27, 2023
@MatthewDaggitt
Copy link
Contributor

Opened #2109 to knock this off as it's definitely low hanging fruit.

@jamesmckinna
Copy link
Contributor

OK, but I'll pass the baton on this one :-(

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