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

P2540 Empty Product for certain Views #1202

Closed
wg21bot opened this issue Feb 22, 2022 · 8 comments
Closed

P2540 Empty Product for certain Views #1202

wg21bot opened this issue Feb 22, 2022 · 8 comments
Labels
C++23 Targeted at C++23 IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. ranges std::ranges tentatively-ready-for-plenary Reviewed between meetings; ready for a vote.
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Feb 22, 2022

P2540R0 Empty Product for certain Views (Steve Downey)

@wg21bot wg21bot added the SG9 Ranges SG label Feb 22, 2022
@wg21bot wg21bot added this to the 2022-telecon milestone Feb 22, 2022
@cor3ntin cor3ntin added the C++23 Targeted at C++23 label Feb 22, 2022
@inbal2l
Copy link
Collaborator

inbal2l commented Mar 15, 2022

Was seen by SG9 (Ranges) on 2022-03-14 (Full Minutes)

Polls

POLL: We support forwarding the change proposed in P2540R1 to LEWG.

SF F N A SA
3 3 0 0 0

Attendance: 11

# of Authors: 1

Author Position: SF

Outcome: Consensus in favor

Summary

R1 of the paper (which includes minor fixes, described in minutes) was forwarded to LWEG.

@inbal2l inbal2l added LEWG Library Evolution ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review size - small paper size estimate size - tiny paper size estimate, smaller than small ranges std::ranges and removed SG9 Ranges SG size - small paper size estimate labels Mar 15, 2022
@inbal2l
Copy link
Collaborator

inbal2l commented Mar 19, 2022

Paper was discussed in LEWG on March 15th 2022 (Full Minutes)

2022-03-15 Library Evolution Telecon

P2540R1: Empty Product for certain Views

Chair: Inbal Levi

Champion: Steve Downey

Minute Taker: Mark Hoemmen

Summary

Some discussion on Zip behaviour. R1 of the paper was forwarded to C++23 (as a bug fix).

POLL: We support adopting the change proposed in [P2540R1] (Empty Product for certain Views) for C++23 with priority 2 (to be approved by LEWG electronic poll).

Strongly Favor Favor Neutral Against Strongly Against
5 7 1 0 0

Attendance: 25

# of Authors: 1

Author Position: SF

Outcome: Strong consensus in favor

Outcome

R1 of the paper was forwarded to electronic polling for C++23, with priority 2.

@inbal2l inbal2l added ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll and removed ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Mar 19, 2022
@wg21bot
Copy link
Collaborator Author

wg21bot commented Mar 21, 2022

P2540R1 Empty Product for certain Views (Steve Downey)

@brycelelbach brycelelbach added IS Ship vehicle: IS B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e labels Apr 7, 2022
@fstirlitz
Copy link

Contrary to what R1 suggests, there is no contradiction between defining zip to be the diagonal of lexicographical Cartesian product and the identity element of zip being an infinite sequence of empty tuples.

Let A be a tuple of tuples, and let’s denote the length of a tuple x by |x|, and the i-th element of x by x[i]. On one hand, we have that

zip(A)[k] := (jA[j][k])

for all k where for all j, A[j][k] exists. It’s clear to see that zip over an empty tuple is an infinite tuple of empty tuples, and this is the identity element of that operation, up to isomorphism.

We can also define the lexicographical product as:

lex(A)[∑i < |A| k[i] ∏j < i |A[j]| ] := (jA[j][k[j]])

for tuples of integers k where 0 ≤ k[i] < |A[i]| for all 0 ≤ i < |A|. If A is an empty tuple of tuples, k is likewise an empty tuple of indices, and the above only defines lex(A)[0], because the indexing expression is the empty sum. As such, |lex(A)| = 1.

However, if we then appropriately define the diagonal index as

diag(A)[k] := ∑i < |A| kj < i |A[j]|

for integer k, then we see that if A is the empty tuple, then diag(A)[k] is also the empty sum, and therefore zero, for all k. So even though the empty lexicographical product is a singleton, picking the diagonal of that product is going to repeatedly pick its only element, and the identity

zip(A)[j] = lex(A)[diag(A)[j]]

is maintained even for empty A. ∎

If you want to define zip over nothing as repeat(tuple<> {}), go for it.

@brycelelbach brycelelbach added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Apr 22, 2022
@brycelelbach brycelelbach added lwg-pending LWG Chair needs to disposition LWG Library and removed LEWG Library Evolution ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Jun 19, 2022
@brycelelbach
Copy link

2022-05 Library Evolution Electronic Poll Outcomes

POLL: Send [P2540R0] Empty Product For Certain Views to Library Working Group for C++23, classified as an improvement of an existing feature ([P0592R4] bucket 2 item).

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
7 7 2 2 1

Weak consensus in favor.

@jwakely jwakely added tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. and removed lwg-pending LWG Chair needs to disposition labels Jul 1, 2022
@jwakely
Copy link
Member

jwakely commented Jul 1, 2022

Reviewed and approved by LWG for C++23 (conditional on approval of P2374 #1044 of course).

@JeffGarland
Copy link
Member

Details from 2022-07-01 review https://wiki.edg.com/bin/view/Wg21telecons2022/P2540-20220701

poll: put p2540r1 into C++23 assuming p2374 is on voted in

F A N
12 0 2

@JeffGarland JeffGarland removed B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e size - tiny paper size estimate, smaller than small labels Jul 2, 2022
@cor3ntin cor3ntin added the plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. label Jul 25, 2022
@tkoeppe
Copy link

tkoeppe commented Aug 17, 2022

This has been applied.

@tkoeppe tkoeppe closed this as completed Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++23 Targeted at C++23 IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. ranges std::ranges tentatively-ready-for-plenary Reviewed between meetings; ready for a vote.
Projects
None yet
Development

No branches or pull requests

8 participants