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

*From*: Isaac DeFrain <isaacdefrain@xxxxxxxxx>*Date*: Thu, 22 Apr 2021 15:34:40 -0600*Ironport-hdrordr*: A9a23:6Sgx76yuycZA4XVvBl8/KrPxCOgkLtp033Aq2lEZdDV8acaYl9+jkbAyyHbP+X0scVsnns2NP7TFZHva+4J874V5B8bSYCDNvmy0IIZ+qbb4yzr7FCHkssJb36Fsc69xYeeATWRSp8D8/QW+DpIc0MCKmZrYxNv24lVMaUVEa6R84xwRMGymO2B/WQUuP+tFKLOy/cxCzgDQAkg/TsP+PXUdWviGmtujruOZXTciBwQ7rCGUhzKp97KSKWnT4j46UylThZYv9HGtqX212oyHs+unjj/QvlWjp6h+vdv61597AtaQ4/JlZgnErwazecBaR7aZtis0q+3H0idkrPDoow08e/h18W/bZGuvoRDgsjOQngoGz1/H5RumjWD4ocr/LQhKdPZpoY5CaBPW5w4BkbhHodh29kaUrYBeAx+FvAm4xtDTVnhR5zqJiEM4neQegnBZW4d2Us4mkaUl8ElYEIgNEUvBgehNfYUPfaKshocyTXqgY3/UpWVpytC3N05DZiuueUQav9zQ7j4+pgEx82Ij2Mcdkn0cnahNLaVs2uKsCNUQqJhzVMMMKYpyCOAdKPHHdlDlcFbpOGKWDk/gEMg8SgDwgq+yxL004eWjf9gy0J4/3LXATUkwjx9GR2veTemH3JhO+heIe3m5UXDIyttF64IRgMyJeJPbdQmKSFUrm8zlnPkFGM3cXJ+ISeVrKs6mCWf1A45G00nfdt1yIWMeOfdlyeoTaha1u8rObqfquubYfO2WG7b3CzYjXQrEbUcrbXzIPc1FqmWmRXP86SK+Z1rdPnbn9ZY1KrXT4vQIobJtCqR89jkbiVO4+9HOFhVriMUNDS9DCYKio6y6ommq7SL2y2l1MnNmfyFo3Ik=*References*: <6841633b-0f09-4fa9-bedf-1d2345f680dbn@googlegroups.com> <f0c51d43-c594-44af-a30b-ded598c34182n@googlegroups.com> <CAE7Z=+7X96c9p=oKvBMPJe2DUmD2J07VJS775GOQX3qHw=Y9iw@mail.gmail.com>

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>>

====

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,

Isaac DeFrain

On Thu, Apr 22, 2021 at 3:06 PM Huailin <huailin@xxxxxxxxx> wrote:

Thanks a lot, Andrew.From Lamport's paper or/and the book,"An action represents a relation between old states and new states, where is unprimed variables refer to the old state and the primed variables refer to the new state."and"Formally, the meaning [[A]] of an action A is a relation between states--a function that assigns a boolean s[[A]]t to a pair of states s, t. "Hence, if I have an action described as my previous email:x' + 1 = y+zthen the meaning ofs[[x' + 1 = y+z ]] t:

s: (x, y,z) values.

t: (x', y,z) values. /* y and z are not changed after this action

In other words, in TLA, the state is NOT 1:1 mapped to a variable, but to the whole set of the variables.Am I correct?Thanks,Huailin--On Thu, Apr 22, 2021 at 6:38 AM Andrew Helwer <andrew.helwer@xxxxxxxxx> wrote:Hi Huailin,The formula x' + 1 = y + z is syntactically valid and can be used in an action property, but if you want to use TLC it cannot be used in an action itself. See Specifying Systems p238 for the expressions TLC can handle when computing successor states; they include expressions of the form:

- x' = e
- x' \in S
- UNCHANGED x
Andrew--On Wednesday, April 21, 2021 at 11:48:27 PM UTC-4 hua...@xxxxxxxxx wrote:Folks,For an TLA's action, which is essentially a boolean _expression_, does it ONLY relate to two variables(primed or non-primed)?For instance, x' + 1 =y. (Please refer to Section 2.3 in Lamport's seminal paper "The Temporal Logic of Actions"-ACM 1993).Can we have an x' + 1 = y+z as an action? If yes, how we define the "old state" and the new state with the postfix notation? maybe define a super-state to cover (y, z)?Thanks huge,Huailin

You received this message because you are subscribed to a topic in the Google Groups "tlaplus" group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/tlaplus/8tZQbkMScgU/unsubscribe.

To unsubscribe from this group and all its topics, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.

To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/f0c51d43-c594-44af-a30b-ded598c34182n%40googlegroups.com.

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 view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/CAE7Z%3D%2B7X96c9p%3DoKvBMPJe2DUmD2J07VJS775GOQX3qHw%3DY9iw%40mail.gmail.com.

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 view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/CAM3xQxFR%3DZmPmNzOp_Tkzhh%2BSDvGCQo9ZM0FFda1wd%2Bf4u7vDQ%40mail.gmail.com.

**Follow-Ups**:**Re: [tlaplus] Re: About Action***From:*Huailin

**References**:**[tlaplus] About Action***From:*hua...@xxxxxxxxx

**[tlaplus] Re: About Action***From:*Andrew Helwer

**Re: [tlaplus] Re: About Action***From:*Huailin

- Prev by Date:
**Re: [tlaplus] Re: About Action** - Next by Date:
**Re: [tlaplus] Re: About Action** - Previous by thread:
**Re: [tlaplus] Re: About Action** - Next by thread:
**Re: [tlaplus] Re: About Action** - Index(es):