# Re: [tlaplus] Constant conversion into Set

Thanks Hillel. Its been a pleasure that you answered. I have following your blog it is very informative and helping me a lot.

I have some confusion about the tool as well. Is it appropriate to send you an email regarding to the tool understanding.

Regards
Malaika

On Mon, Jun 24, 2019, 9:04 PM Hillel Wayne <hwayne@xxxxxxxxx> wrote:

That's a set map and will give you all of the values in the sequence. Note that while in TLA+ strings are sequences, TLC treats them as atoms. If you're using TLC and need to convert strings to sets, you're better off storing the string as a sequence, like

Z == <<'s', 'o', 'm', 'e'>>

H

On 6/23/19 8:54 AM, MK Bug wrote:
But this will share the length of the string but not the actual values of the string.

I need the values as mentioned.

On Sun, Jun 23, 2019, 6:44 PM Stephan Merz <stephan.merz@xxxxxxxxx> wrote:
Strings are sequences of characters, and it looks like you want to compute the set of characters contained in a string. For an arbitrary sequence (hence in particular for a string), its range can be defined as

Range(seq) == { seq[i] : i \in 1 .. Len(seq) }

Stephan

On 23 Jun 2019, at 15:32, MK Bug <android.ruba@xxxxxxxxx> wrote:

I am new in tla+, I want to convert

Z='somevalue'

Into

S= {'s','o','m','e','v','a','l','u','e'}

This is the only conversion I want or can anyone suggest how to split values in tla+

Thanks

On Sun, Jun 23, 2019, 6:17 PM Stephan Merz <stephan.merz@xxxxxxxxx> wrote:
Hello,

I find it hard to understand your question: since TLA+ is based on Zermelo-Fraenkel set theory, formally all values are sets (although it is easier to think of objects such as numbers, strings or functions as being separate entities since we don't know which elements they contain when considered as sets). There is no need to "convert" constants into sets.

For the rest, the syntax that you use is not that of TLA+, which doesn't help me understand your problem.

May I suggest that you study the introductory material about TLA+ [1,2] and come back when you have precise questions?

Thank you,
Stephan

On 22 Jun 2019, at 20:21, MK Bug <android.ruba@xxxxxxxxx> wrote:

Please share how to convert a constant into a set.

For Eaxample:

Constant A    ----Contains value 'ABCnma12'

Set B {'A','B','C','n','m','a','1','2'}

Regards,
Malaika

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/aa716feb-a210-4857-9868-ab2903ff8843%40googlegroups.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/EAA3CDAE-9C70-4C27-BAA7-0B9D6A4F74DE%40gmail.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/CA%2BkanUJw_dRWx%2B1%3DAxWsRB0QkXyrbn12syTq7ZteJx8%3DqXbv7g%40mail.gmail.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/4D56784E-FD04-43EF-959B-3555F78BF520%40gmail.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/CA%2BkanUKWqLFT5u6L%2BOqhHTaTWJT8-xMn%3DEZJ2VY7wR1gyK5u%2BA%40mail.gmail.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/545b2faa-6080-e06f-2451-e7c76d9451ad%40gmail.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/CA%2BkanUKVhoVM%3DSJFJmdauV_FR0XdvoDcbwNtFx3Y9hyvGvs5vw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.