How to specify Semmetry sets in config file in visual studio code

73 views
Skip to first unread message

tamarind code

unread,
Jul 9, 2025, 11:50:37 AMJul 9
to tlaplus
I am using vscode with the TLA+ extension but I am having trouble adding symmetry sets in the config file. 
If I try
CONSTANTS
RM = {r1, r2}

\* Mark RM and Acceptor as symmetry sets to reduce state space
SYMMETRY Permutations(RM)
I keep getting the following error
The exception was a tlc2.tool.ConfigFileException
: TLC found an error in the configuration file at line 10
It was expecting a keyword, but did not find it.

I found this solution but that only works if I need to mark only one set as a symmetry set. 

What is the way to mark two or more sets as symmetry sets please?

Stephan Merz

unread,
Jul 9, 2025, 11:53:16 AMJul 9
to tla...@googlegroups.com
You want to define an operator in your TLA+ module such as

Symmetry == Permutations(RM)

then put

SYMMETRY Symmetry

in your config file. See Specifying Systems, section 14.7.1 for the grammar of config files.

Hope this helps,
Stephan

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/tlaplus/ea1381fa-bc74-458c-93d8-55ce483945aen%40googlegroups.com.

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

tamari...@gmail.com

unread,
Jul 10, 2025, 9:45:27 AMJul 10
to tlaplus
Thanks Stephen for the prompt response, very kind of you.
The approach you suggested does work but allows onely one set to be marked as a symmetrc set.
The section in the book you mentioned above does say only on SYMMETRY statement is allowed.
But us there a way to use that single symmetry statement to mark multiple sets as symmetry sets?
I have tried listing them separated by comma but doesn't seem to work.
Just wanted to confirm if it is possible?

Thanks so much again for your help

Sumuhan

Stephan Merz

unread,
Jul 11, 2025, 2:40:14 AMJul 11
to tla...@googlegroups.com
If you have two symmetry sets X and Y, you can define

Symmetry == Permutations(X) \union Permutations(Y)

I recommend you have a look at section 14.3.4 of Specifying Systems, where this is explained in detail.

Stephan

Markus Kuppe

unread,
Jul 11, 2025, 2:47:15 AMJul 11
to tla...@googlegroups.com
Message has been deleted

tamari...@gmail.com

unread,
Jul 17, 2025, 10:07:13 AMJul 17
to tlaplus
Thanks so much Stephan 😃 That really makes sense!
I actually saw something like "Symmetry == Permutations(X) \union Permutations(Y)" somewhere but then I was thinking mistakenly that if we have 
X { 1,2,3} and Y = { "a","b"} then I was thinking TLC will treat the entire Union as a symmetry set and that might break the spec as it might think it is OK to replace 1 with "a"
But now I think that won't be a problem as long as the spec prevents such substitution. For example if we have a counter with 
Init == x = 1
Next == x' = x +1
Then x can never be "a" anyway so using such a union for symmetry shouldn't break the rest of the spec

Thank you so much for your the guidance

tamari...@gmail.com

unread,
Jul 17, 2025, 11:00:21 AMJul 17
to tlaplus
And thanks Markus, That was very useful. It confirms the same answer. Thank you for pointing that out.
Reply all
Reply to author
Forward
0 new messages