124. A half-open range of cuts is also the piece it bounds (2026-11-21)
- Decision. With cuts
j, i: D.bounds,j..iis aRange<D.bounds>(iterating it yields cuts). Wherever aRange<D>is expected, it converts implicitly to the positions between cutjand cuti:cost(j..i),pre.sum(j..i),a[j..i],window.move(to: j..i). The two readings are the same set underc ↦ c.right. Every cut inj..ihas a right neighbour becauseiis excluded, and both are stored as the same two integers.j..=iover cuts stays a range of cuts only (its last cut may be the end) and gets no conversion. Constant integer literals are accepted for cut-domain values, checked against the domain's range (var mex: Potential.bounds = 0). - Why. DP transitions iterate cuts (
for j in lo..i: dp[i] min= dp[j] + cost(j..i)) and pass the piece between them on the same line. A single rule keeps both readings without a cast or a second spelling, and the "ranges are over cuts" model stays exact: a range's ends are cuts, its elements are positions. - Rejected. Context deciding what
j..imeans (one text, two meanings);..versus..=choosing the element type; mandatoryspan(j, i)(honest but noisy on the commonest DP line, and the fallback if the conversion ever surprises reviewers). - Reverse. Drop the conversion; call sites use
span(j, i). - Status. Accepted; not implemented. Blocked first on
D.boundsas a value incpl run/cpl build(E0501).