# Multiplicity Keyword in Subset Constraint

**URL:** https://alloytools.discourse.group/t/multiplicity-keyword-in-subset-constraint/539
**Category:** Software Abstractions
**Created:** [September 12, 2025, 7:03pm UTC](https://alloytools.discourse.group/t/multiplicity-keyword-in-subset-constraint/539 "2025-09-12T19:03:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jackc](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jackc](https://alloytools.discourse.group/u/jackc)
#### Post date: [September 12, 2025, 7:03pm UTC](https://alloytools.discourse.group/t/multiplicity-keyword-in-subset-constraint/539/1 "2025-09-12T19:03:56Z")

</div>

Hi,

I am encountering a problem with using Multiplicity keywords within a subset constraint.

In the Software Abstractions Revised edition, on bottom page 275 it says

> In either a declaration
> 
> decl ::= _[**disj**]_ name,+ : _[**disj**]_ expr  
> or a subset constraint
> 
> expr ::= expr **in** expr
> 
> the right-hand side expression may include _multiplicities_, and the keyword _set_ that represents the omission of a multiplicity constraint.

and on top page 290 it says

> As explained in section B.7.3, a boolean expression formed with the _in_ keyword may, like a declaration, use multiplicity symbols to impose an additional constraint.

I think the above means that I can write something like this:

> fact {  
> x in lone S  
> }

But this is recognized as a syntax error in the Alloy Analyzer.

It would be great if someone could explain the semantics of such a constraint too.

Thank you,

Jack

---

<div class="post-metadata">

### Author: ![alcino](https://yyz2.discourse-cdn.com/free1/user_avatar/alloytools.discourse.group/alcino/32/25_2.png) [@alcino](https://alloytools.discourse.group/u/alcino)
#### Post date: [February 21, 2026, 10:06am UTC](https://alloytools.discourse.group/t/multiplicity-keyword-in-subset-constraint/539/2 "2026-02-21T10:06:37Z")

</div>

Hi,

I think you need parenthesis in the right hand side of `in`. At least the following works for me.

```alloy
sig A {}

fact {
	A in (lone univ)
}

```

Regards,  
Alcino
