Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new inner zip conflicts with interpreter proof bounds when the downstream relation accepts a strict supertype of the retained value.
1 open issue
What changed in this PR
Fixes retained Single composition so the left relation runs once and retains the value passed downstream.
Changes:
- Composes the left relation before zipping
Selfwith the downstream relation. - Adds coherence tests for both interpreter models.
- Preserves public output-type assertions without fixing the internal composition shape.
| File | Description |
|---|---|
| core/src/test/scala/decrel/RelationSpec.scala | Removes old composition-shape assertions. |
| core/src/test/scala/decrel/reify/monofunctor/KeepCoherenceSpec.scala | Tests single, repeated, and bulk execution coherence. |
| core/src/test/scala/decrel/reify/bifunctor/KeepCoherenceSpec.scala | Adds equivalent bifunctor coherence tests. |
| core/src/main/scala/decrel/syntax.scala | Evaluates retained Single relations once. |
Review effort: Balanced
Comment on lines
+42
to
46
| Relation.Self[LeftOut], | ||
| LeftOut, | ||
| LeftOut, | ||
| RightTree & Relation[RightIn, RightOut], | ||
| RightIn, |
This branch has not been deployed
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.

Single <>:placed the left relation in both branches of a zip, so an uncached effect could execute it twice and retain a different value from the one passed downstream. Compose the left relation once, then zipSelfwith the downstream relation, matching Optional and Many.Tests in both interpreter models use a deferred counter to verify single and bulk coherence and repeated execution. Existing relation-shape tests retain their public output-type assertions without depending on the old duplicated AST.
Validation:
core/test,core3/test,coreJS/test,coreJS3/test,fmt. All passed.