Make Interleave agree with the rest of the module on the empty sequence - #129
Merged
Conversation
Interleave was the only operator that turned an empty argument into a non-empty result. It now yields the identity, as Zip, FlattenSeq and Reverse already do. This is a breaking change, but a narrow one: it is confined to a single input, no other operator in the module reaches that input, and no proof depends on it. [Refactor] Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
lemmy
requested review from
muenchnerkindl
and
a balanced review from Copilot
September 8, 2026 17:59
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the existing documented behavior and is adequately covered by focused tests.
Pull request overview
Aligns Interleave’s empty-sequence behavior with its documented contract and related sequence operators.
Changes:
- Returns
<<>>when both inputs are empty. - Adds bounded property tests covering length and ordering invariants.
File summaries
| File | Description |
|---|---|
modules/SequencesExt.tla |
Corrects the empty-input result and documents the rationale. |
tests/SequencesExtTests.tla |
Updates the empty-case expectation and adds invariant coverage. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
This definition clearly makes more sense than the previous one. Assuming |
muenchnerkindl
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Interleave was the only operator that turned an empty argument into a non-empty result. It now yields the identity, as Zip, FlattenSeq and Reverse already do.
This is a breaking change, but a narrow one: it is confined to a single input, no other operator in the module reaches that input, and no proof depends on it.
[Refactor]