Defining multiple possible actions in one line

16 views
Skip to first unread message

jack malkovick

unread,
Feb 24, 2022, 10:15:37 AM2/24/22
to tlaplus
Another beginner question. Let's say I have something like

VARIABLE v
Increase(x) == v' = v + x
Possibilities == {1, 2, 3}

And I would like to define something like

Next == Increase(1) \/ Increase(2) \/ Increase(3)

but using something like p \in Possibilites. I've tried all kinds of stuff but a silly subtle error makes TLA to generate only one action instead of 3.

Stephan Merz

unread,
Feb 24, 2022, 11:52:27 AM2/24/22
to tla...@googlegroups.com
Have you tried

Next == \E p \in Possibilities : Increase(p)

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 on the web visit https://groups.google.com/d/msgid/tlaplus/b1976433-a008-4802-aad6-fdb2ae842e65n%40googlegroups.com.

jack malkovick

unread,
Feb 24, 2022, 12:37:03 PM2/24/22
to tlaplus
Yes. I did try that on my spec (that is not as simple as the above), so the error is somewhere else :(
Thanks for the answer. I'll keep digging...

jack malkovick

unread,
Feb 24, 2022, 1:51:37 PM2/24/22
to tlaplus
An update to my silly problem. The issue was that x was added at a later time and I was using a view... unfortunately I did not update the view also :) 
Reply all
Reply to author
Forward
0 new messages