Skip to content

Parenthesize SUBSET and UNION where precedence is unspecified. - #252

Merged
lemmy merged 1 commit into
masterfrom
mku-gh892
Nov 5, 2026
Merged

lemmy merged 1 commit into
masterfrom
mku-gh892

Conversation

@lemmy

@lemmy lemmy commented Nov 4, 2026

Copy link
Copy Markdown
Member

The Summary of TLA+ gives SUBSET, UNION, \cup, and \ precedence 8-8. Equal precedence leaves the binding unspecified, and TLA+ rejects the expression. SANY has given SUBSET and UNION precedence 10-13, under which SUBSET S \ T parses as (SUBSET S) \ T and A \cup UNION B as A \cup (UNION B). tlaplus#1508 restores the documented ranges, so the unparenthesized forms become syntax errors. The parentheses keep the binding SANY has been using.

Related to Github RFC issue #28
tlaplus/rfcs#28

See Github pull request #1508
tlaplus/tlaplus#1508

The Summary of TLA+ gives SUBSET, UNION, \cup, and \ precedence 8-8.
Equal precedence leaves the binding unspecified, and TLA+ rejects the
expression. SANY has given SUBSET and UNION precedence 10-13, under
which SUBSET S \ T parses as (SUBSET S) \ T and A \cup UNION B as
A \cup (UNION B). tlaplus#1508 restores the documented ranges, so the
unparenthesized forms become syntax errors. The parentheses keep the
binding SANY has been using.

Related to Github RFC issue #28
tlaplus/rfcs#28

See Github pull request #1508
tlaplus/tlaplus#1508

Co-authored-by: Grok 4.7 <noreply@x.ai>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified for the set-operator grouping changes.

No open issues 🎉

What changed in this PR

This PR makes set-operator grouping explicit in three TLA+ specifications, preserving SANY’s existing interpretation while preparing for the documented precedence rules.

Changes:

  • Parenthesizes UNION expressions used with set union.
  • Parenthesizes SUBSET Key before set subtraction in both PlusCal and its TLA+ translation.
  • Updates the PlusCal translation checksums.
File Description
specifications/​LevelChecking/​LevelSpec.tla Clarifies UNION grouping in level-constraint calculations.
specifications/​KeyValueStore/​KVsnap.tla Clarifies nonempty key-set selection and updates translation checksums.
specifications/​allocator/​AllocatorImplementation.tla Clarifies UNION grouping in allocation invariants.

Review effort: Balanced

@lemmy
lemmy merged commit ca16805 into master Nov 5, 2026
8 checks passed
@lemmy
lemmy deleted the mku-gh892 branch November 5, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants