Skip to content

'union' syntax support - #332

Merged
Smattr merged 7 commits into
mainfrom
smattr/github-331
Aug 16, 2026
Merged

'union' syntax support#332
Smattr merged 7 commits into
mainfrom
smattr/github-331

Conversation

@Smattr

@Smattr Smattr commented Aug 11, 2026

Copy link
Copy Markdown
Owner

This is in a preliminary state and needs a lot of work, but worth getting some CI.

@Smattr
Smattr force-pushed the smattr/github-331 branch from b4ac715 to 2662c93 Compare August 12, 2026 07:06
Smattr added a commit that referenced this pull request Aug 12, 2026
Smattr added a commit that referenced this pull request Aug 12, 2026
@Smattr
Smattr force-pushed the smattr/github-331 branch from 2662c93 to 35f35d0 Compare August 12, 2026 09:47
Smattr added a commit that referenced this pull request Aug 12, 2026
@Smattr
Smattr force-pushed the smattr/github-331 branch from 35f35d0 to 2cb9376 Compare August 13, 2026 07:06
Smattr added a commit that referenced this pull request Aug 13, 2026
@Smattr
Smattr force-pushed the smattr/github-331 branch 3 times, most recently from fe67f4b to 26502ed Compare August 14, 2026 07:03
Smattr added a commit that referenced this pull request Aug 14, 2026
@Smattr
Smattr force-pushed the smattr/github-331 branch 2 times, most recently from 965b1d9 to 824d5e3 Compare August 15, 2026 21:37
@Smattr
Smattr marked this pull request as ready for review August 15, 2026 21:39
@Smattr Smattr changed the title [WIP] 'union' syntax support 'union' syntax support Aug 15, 2026
@Smattr

Smattr commented Aug 15, 2026

Copy link
Copy Markdown
Owner Author

This is in a state where we could now merge it if it passes CI.

Smattr added 7 commits August 16, 2026 11:02
This support is extremely limited. The intent is to allow parsing
`union` with librumur so users can build union-supporting tools on top,
but not to support `union` within `rumur`. Despite this, some partial
handling of `union` is added within `rumur`. The intent of this is to
avoid anything slipping through the cracks if/when `union` support is
added to `rumur` in future. I.e. any attempt to do this should result in
visible errors surfacing from these locations that need to be updated.

This change does not include changes to the parser itself, which will
arrive in an upcoming commit.

There are a number of notable divergences from CMurphi semantics:
  1. As discussed in an added comment, unions with 0 or 1 members are
     supported in contrast to CMurphi.
  2. Differing unions within other types make the containing types
     non-equal. E.g. CMurphi appears to consider variables of types
     `record a: union {foo, bar}; endrecord` and
     `record a: union {foo, baz}; endrecord` to be
     comparable/assignable/etc because they have at least one equivalent
     type interpretation. In Rumur, we do not consider these variables
     compatible in this way.

Gitlab: #331 “MultiSet support within scope?”
This still has no effect because `union` is not yet supported during
parsing.

Github: #331 “MultiSet support within scope?”
At this point, it is possible to parse and process a model using `union`
types. Doing this on real world models is still challenging because
there is no support for `ismember` that most real world `union`-using
models also use.

Github: #331 “MultiSet support within scope?”
This is still rejected by most Rumur tools. The intent is to just allow
librumur users to successfully parse models using `ismember`.

Gitlab: #331 “MultiSet support within scope?”
There is still no parser support.

Github: #331 “MultiSet support within scope?”
At this point, `ismember` support is complete, in the sense we can parse
and manipulate it. This allows ingesting models like sci.m from
CMurphi’s examples. There is still no support for producing a checker
from a model that uses `union` types or `ismember`, and none is planned
right now.

Gitlab: #331 “MultiSet support within scope?”
@Smattr
Smattr force-pushed the smattr/github-331 branch from 824d5e3 to c89bd8a Compare August 16, 2026 01:18
@Smattr
Smattr merged commit e6bcc53 into main Aug 16, 2026
23 checks passed
@Smattr
Smattr deleted the smattr/github-331 branch August 16, 2026 02:45
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.

1 participant