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

Re: [tlaplus] Generating records like functions



Hello jwnhy,

Do you mean something like this?

``tlaplus

f == [x |-> {0, 1}, y |-> {4,5}]

``


image.png


On Mon, Jan 3, 2022 at 4:30 PM jwnhy <qq799433746@xxxxxxxxx> wrote:
Hello, I'm new to TLA+ and trying to learn it.

I know that I can generate a set of all possible functions by writing

[{"A", "B"} -> {0, 1}] \* all functions from {"A", "B"} to {0, 1}

I'm wondering if there is a similar way for records?

For example, if I have a record that most of its fields is BOOLEAN, I'm wondering if I can write something like

mstatus \in [{SD, TSR, TW, TVM}: BOOLEAN] \* THIS DOES NOT WORK

Or is there a way to specify a function with different range for different domain?

e.g: f["x"] \in {0,1} f["y"] \in {4, 5}

Thanks,
jwnhy.

--
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/9aaa082e-b2ae-4503-a6d8-76ccfe962702n%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/CAC2JkJsG4mhX5Q9P493TqAF%2BO8tABKyo%2B1AYmyzdhpDGo8hgHA%40mail.gmail.com.