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

*From*: Huailin <huailin@xxxxxxxxx>*Date*: Thu, 22 Apr 2021 15:10:30 -0700*Ironport-hdrordr*: A9a23:criq96yBQDya4zmxNBiOKrPx8egkLtp033Aq2lEZdDV8Sebdv9yynfgdyB//gCsQXnZlotybJKycWxrnme8P3aA4Bp3neAX9omOnIMVZ7YXkyyD9ACGWzIMtrZtIW5NVTOf9BV0St6yKmTWQOdAm3dWB7eSUlf7Tpk0dOz1CRoNBy0NCCgidGlBrXwUuP/VWKLOw7tdKzgDQC0g/Qd+8AhA+Lpv+jv3N0KnreBsXQyMggTP+/Q+Azb7hDlyxxR0eUyxCqI1SslTttgzi++GDv/SjoyWsl1P7ypRNhZ/A57J4dYCxo+0UMCipswCzee1aKvy/lRU0uvzq1FExjNLXqQwhNMgb0QKSQkiQgT/Anzbtyywv7XiK8y7nvVLGqcz9RDU1T89An58xSGqV12MFsMtn2KxGm0K13qAneC/opT/w7dTEWxZhmiOP0DAfuNUehXBeTocSAYU5xedvmzIuYes9NRn34owmD+ViSPvky59tAC6nRkvUsWV1zNunUm5bJGb2fmE4ttWRw3xqmhlCvgAl7fYSmXoN7/sGK6Vs3fjOMahjidh1P7srRJ96bd1xNvefOyjnTR7KDWOfOliPLtBiB1v977DypJE4/vujdpBN9oY7hZipaiI6iUcCP2zpD8OK0Nln0DDoBF+8UzPk191E6/FC24HUdf7ENyuMTVxrvdCnv+xaIsCzYYf8BLtmR9HkK2XqFcJy2xDmH6NVNWIVXKQuy7QGcmPLhNnKJI3svumeWOrPJbbrDDYvUn7+BHxGZzToOMBc9CmQKzfFqSmUfWjsdEz59Zc1KqTc8uQJobJ9f7Fkg0wvhV605t6GJFR5w8lGGjoAHJrX1pmjrW3z12fF5WdkN158CQJ6+7P9Shpx1EA3D38=*References*: <6841633b-0f09-4fa9-bedf-1d2345f680dbn@googlegroups.com> <f0c51d43-c594-44af-a30b-ded598c34182n@googlegroups.com> <CAE7Z=+7X96c9p=oKvBMPJe2DUmD2J07VJS775GOQX3qHw=Y9iw@mail.gmail.com> <CAM3xQxFR=ZmPmNzOp_Tkzhh+SDvGCQo9ZM0FFda1wd+f4u7vDQ@mail.gmail.com>

Thanks, Isaac.

Your illustration makes much sense to me.

Just like what Lamport also used in his literature for example purpose: If we wanna define a moving object's position spec. in the universe, we used x, y, z three variables in a spec. to describe its coordinates. But the STATE for the object's position is ONE, which is the collection of the 3 variables. We cannot say the object has 3 states, while it does have 3 variables.

On Thu, Apr 22, 2021 at 2:34 PM Isaac DeFrain <isaacdefrain@xxxxxxxxx> wrote:

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, sayAction, 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 addUNCHANGED zto 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.

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%2B7ABZmDB95k_ThCYOeHDS1Cas7xqdhTHk9ci61Gdb7k9g%40mail.gmail.com.

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

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

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

**Re: [tlaplus] Re: About Action***From:*Isaac DeFrain

- Prev by Date:
**Re: [tlaplus] TLAPS proof of increment and update** - Next by Date:
**[tlaplus] CSP vs. TLA+** - Previous by thread:
**Re: [tlaplus] Re: About Action** - Next by thread:
**Re: [tlaplus] Re: About Action** - Index(es):