Skip to content

Support assignment in conditional parts of an expression#359

Merged
keyboardDrummer merged 71 commits intostrata-org:mainfrom
keyboardDrummer:conditionalAssignmentInExpression
Feb 13, 2026
Merged

Support assignment in conditional parts of an expression#359
keyboardDrummer merged 71 commits intostrata-org:mainfrom
keyboardDrummer:conditionalAssignmentInExpression

Conversation

@keyboardDrummer
Copy link
Contributor

@keyboardDrummer keyboardDrummer commented Jan 30, 2026

Changes

  • Support assignment in conditional parts of an expression

Testing

  • Added conditionalAssignmentInExpression test-case to test-file T2_ImpureExpressions

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@keyboardDrummer keyboardDrummer requested a review from a team as a code owner January 30, 2026 14:38
atomb
atomb previously approved these changes Feb 2, 2026
Copy link
Contributor

@atomb atomb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks nice. My one comment could be addressed in a future PR, if at all.

@joscoh
Copy link
Contributor

joscoh commented Feb 4, 2026

This seems to have a lot of overlap with #358. What is the difference between them?

@keyboardDrummer
Copy link
Contributor Author

keyboardDrummer commented Feb 5, 2026

This seems to have a lot of overlap with #358. What is the difference between them?

This is stacked on top of that PR so it includes all the changes from that one, which sadly GH does not support well. Best to review this after that is merged.

From a user perspective, this PR enables this test:

procedure conditionalAssignmentInExpression(x: int) {
  var y: int := 0;
  var z: int := (if (x > 0) { y := y + 1; } else { 0 }) + y;
  if (x > 0) {
    assert y == 1;
    assert z == 2;
  } else {
    assert z == 0;
    assert y == 0;
  }
}

atomb
atomb previously approved these changes Feb 11, 2026
Copy link
Contributor

@joscoh joscoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good once the partials have been removed. The termination proofs will become easier once #392 is merged.

@keyboardDrummer keyboardDrummer added this pull request to the merge queue Feb 13, 2026
Merged via the queue into strata-org:main with commit b354a0b Feb 13, 2026
9 checks passed
@keyboardDrummer keyboardDrummer deleted the conditionalAssignmentInExpression branch February 13, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments