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

*From*: Kestutis Siaulys <kestutis@xxxxxxxxx>*Date*: Thu, 2 May 2019 02:35:28 -0700 (PDT)*References*: <372df3a8-685a-4668-b97a-47ce153ca812@googlegroups.com> <E6A1BFA0-6E6F-42C3-9FE0-8959A006F2D6@gmail.com>

Thanks! This solved the "issue".

-- Regards,

Kestutis

On Thursday, May 2, 2019 at 10:57:51 AM UTC+2, Stephan Merz wrote:

On Thursday, May 2, 2019 at 10:57:51 AM UTC+2, Stephan Merz wrote:

Hello,if my understanding is correct, you would like to update the function state for all elements of the set. There is no specific syntax for this, writestate' = [ x \in DOMAIN state |-> IF x \in A THEN "newState" ELSE state[x] ](Presumably you can replace "DOMAIN state" by a simpler set.)Hope this helps,StephanOn 2 May 2019, at 10:38, kest...@xxxxxxxxx wrote:Suppose the next state relation for the function "state" is:

state' = [state EXCEPT ![A] = "newState"]

where A is some argument of the function "state". This obviously works when A is a single argument.

What about when A is a "set of arguments" (i.e., A = {"A1", "A2", "A3"})? Then the _expression_:

state' = [state EXCEPT ![A] = "newState"]

is not correct: TLC gives an error message:

"TLC threw an unexpected exception.

This was probably caused by an error in the spec or model. See the User Output or TLC Console for clues to what happened. The exception was a java.lang.RuntimeException: Attempted to check equality of string "A1" with non-string: {"A1"}

The error occurred when TLC was evaluating the nested

expressions at the following positions:"

Clearly, I am missing something obvious. How could it be possible to resolve this?

--

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 tla...@googlegroups.com .

To post to this group, send email to tla...@xxxxxxxxxxxxxxxx.

Visit this group at https://groups.google.com/group/tlaplus .

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.

For more options, visit https://groups.google.com/d/optout.

**References**:**[tlaplus] Beginner question: EXCEPT construct***From:*kestutis

**Re: [tlaplus] Beginner question: EXCEPT construct***From:*Stephan Merz

- Prev by Date:
**Re: [tlaplus] Beginner question: EXCEPT construct** - Next by Date:
**[tlaplus] Re: problems debugging liveness errors.** - Previous by thread:
**Re: [tlaplus] Beginner question: EXCEPT construct** - Next by thread:
**[tlaplus] A minor thing in Video course 6 (TwoPhase Commit)** - Index(es):