I'd like to define an unordered set of values using an Extended Backus-Naur Form (EBNF) context free grammar. It's easy to define an unordered list of values in EBNF, for example:
value = 'A' | 'B' | 'C';
list = value, {',', value};
However, I'm having doubts it can be done for an unordered set.
Below are examples of valid unordered sets of values:
A, B, C, D
A, B, D, C
A, D, C, B
...
D, C, B, A
Whilst invalid lists would be:
A, A, C, D
B, C, C, B
A, A, A, A
...
or lists of arbitrary length.
A, A, B, C, D, A
A, B, C, D, A, B, C, D
...