[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlaplus] how to updating state and return in a definition



It is important to note that Calculate() is not a "function" that we use everyday in programming languages.
Calculate() is an action that changes the current state to the next state by changing the value of variable val.

AmirHossein

On Wed, May 15, 2019 at 5:24 AM Balaji Arun <ba2669@xxxxxx> wrote:
I am trying to have a specification with a definition for Calculate()

module A:

VARIABLE val

Calculate() ==
   val
' = val + 1
   (*return [v: val] here*)

How do I return that val to whoever is calling it (even another module that instantiates module A)? Assuming multiple processes call Calculate concurrently.

--
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+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to tlaplus@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/tlaplus.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/d6598cfb-609a-4f6c-98a6-b12d58e6c6b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to tlaplus@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/tlaplus.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/CAKxfy0szHY1W0fyLrBrCf2LKfra_AfARMm9u1n39GYE9iypmDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.