Defining 3 successive states

20 views
Skip to first unread message

Imran Meah

unread,
Mar 24, 2019, 1:56:40 AM3/24/19
to tlaplus
I know we can define 2 state states machine (say states A and B) by using Next operator. My question is how do I define 3 or more states.

For example, read, process, write and I want the state to transition like this
read -> process -> write

Apostolis Xekoukoulotakis

unread,
Mar 24, 2019, 3:46:09 AM3/24/19
to tla...@googlegroups.com
If they are successive, why do you need to represent them with three states or two atomic actions instead of one?

--
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 post to this group, send email to tla...@googlegroups.com.
Visit this group at https://groups.google.com/group/tlaplus.
For more options, visit https://groups.google.com/d/optout.

Martin

unread,
Mar 24, 2019, 9:31:44 AM3/24/19
to tla...@googlegroups.com
Hello Imran,

An action describes how the current state relates to the next. You could
add a variable status and use it to remember what you were about to do:


VARIABLE status

Init == status = "read"
Next == \/ status = "read" /\ status' = "process"
\/ status = "process" /\ status' = "write"

I am using strings to represent the different states because different
strings are always different (for arbitrary constants a,b I would need
to add an axiom a /= b ). The relation above doesn't do anything beyond
changing the status yet - anything more would go as an additional
conjunct for the status it is intended for.

hope this helps,
Martin
Reply all
Reply to author
Forward
0 new messages