Hello Huailin,
Yes, a state in TLA+ is an assignment of values to all variables declared in the spec. For example, if you have variables x, y, and z declared, then to define a state, we must provide values for each variable x, y, and z.
You can try defining an action, say Action, which does not say how the value of z, for example, changes between states. TLC will throw the following error: Successor state is not completely specified by action Action of the next-state relation. The following variable is not assigned: z.
For example, the spec:
---- MODULE Variables ----
EXTENDS Naturals
VARIABLES x, y, z
Action1 ==
/\ x < 10
/\ x' = x + 1
/\ y' = y + 1
Action2 ==
/\ x < 10
/\ y + z >= 1
/\ x' = y + z - 1
/\ UNCHANGED <<y, z>>
Init ==
/\ x = 0
/\ y = 0
/\ z = 0
Next == Action1 \/ Action2
Spec == Init /\ [][Next]_<<x, y, z>>
====
Action1 does not specify the value of z in a successor state... Maybe you actually do not want the value of z to change so you can add UNCHANGED z to Action1 and TLC will perform a successful model check.
Note: x' = y + z - 1 is equivalent to x' + 1 = y + z, but as Andrew suggested, you must write it in the form x' = y + z - 1 in order for TLC to evaluate it properly.
Best,