Constant conversion into Set

已查看 38 次
跳至第一个未读帖子

MK Bug

未读,
2019年6月22日 14:21:462019/6/22
收件人 tlaplus
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'}

Thanks in advance.

Regards,
Malaika

Stephan Merz

未读,
2019年6月23日 09:17:412019/6/23
收件人 tla...@googlegroups.com
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



--
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+u...@googlegroups.com.
To post to this group, send email to tla...@googlegroups.com.
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.

MK Bug

未读,
2019年6月23日 09:32:562019/6/23
收件人 tla...@googlegroups.com
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

Stephan Merz

未读,
2019年6月23日 09:44:282019/6/23
收件人 tla...@googlegroups.com
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

MK Bug

未读,
2019年6月23日 09:55:112019/6/23
收件人 tla...@googlegroups.com
But this will share the length of the string but not the actual values of the string. 

I need the values as mentioned. 

Hillel Wayne

未读,
2019年6月24日 12:04:452019/6/24
收件人 tla...@googlegroups.com

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

MK Bug

未读,
2019年6月24日 12:54:362019/6/24
收件人 tla...@googlegroups.com
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

MK Bug

未读,
2019年7月6日 17:21:512019/7/6
收件人 tla...@googlegroups.com
Hi,

I getting the following error, can you please share how to resolve this issue?

image.png
回复全部
回复作者
转发
0 个新帖子