if you remove the empty pair of parentheses, your definition is correct TLA+. It defines an operator whose effect it is to increment the state variable val and in can be used inside an action like so:
/\ Calculate \* update variable val
There is no notion of "returning" an update of a variable.
If you'd rather compute a value that can be used within an _expression_ you can define
ValPlusOne == val + 1
and have something like
f' = [f EXCEPT ![p] = ValPlusOne]
for updating an array at a certain position.
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/5313435A-78BA-494C-8A89-28E2C4720933%40gmail.com.
For more options, visit https://groups.google.com/d/optout.